Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d06e575 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Hearing Aid BTIF interface implementation

Boilerplate code - thread switching, logging and attaching to BTIF
infrastructure.

Test: manual with hearing aid
Bug: 69623109
Change-Id: I34a6542827a581a2fbe0b53e7220b7ff7ecbf540
parent 002c137a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ cc_library_static {
        "gatt/bta_gatts_api.cc",
        "gatt/bta_gatts_main.cc",
        "gatt/bta_gatts_utils.cc",
        "hearing_aid/hearing_aid.cc",
        "hf_client/bta_hf_client_act.cc",
        "hf_client/bta_hf_client_api.cc",
        "hf_client/bta_hf_client_at.cc",
+48 −0
Original line number Diff line number Diff line
/******************************************************************************
 *
 *  Copyright 2018 The Android Open Source Project
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 ******************************************************************************/

#include "bta_hearing_aid_api.h"

#include <base/bind.h>
#include <base/logging.h>

using base::Closure;

void HearingAid::Initialize(
    bluetooth::hearing_aid::HearingAidCallbacks* callbacks, Closure initCb) {
  CHECK(false) << "unimplemented yet";
}

bool HearingAid::IsInitialized() {
  CHECK(false) << "unimplemented yet";
  return false;
}

HearingAid* HearingAid::Get() {
  CHECK(false) << "unimplemented yet";
  return nullptr;
};

void HearingAid::AddFromStorage(const RawAddress& address, uint16_t psm,
                                uint8_t capabilities, uint8_t codecs,
                                uint16_t audio_control_point_handle,
                                uint16_t volume_handle, uint64_t hiSyncId) {
  CHECK(false) << "unimplemented yet";
};

void HearingAid::CleanUp() { CHECK(false) << "unimplemented yet"; };
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ cc_library_static {
        "src/btif_gatt_server.cc",
        "src/btif_gatt_test.cc",
        "src/btif_gatt_util.cc",
        "src/btif_hearing_aid.cc",
        "src/btif_hf.cc",
        "src/btif_hf_client.cc",
        "src/btif_hh.cc",
+6 −0
Original line number Diff line number Diff line
@@ -195,6 +195,12 @@ bt_status_t btif_storage_load_bonded_hid_info(void);
 ******************************************************************************/
bt_status_t btif_storage_remove_hid_info(RawAddress* remote_bd_addr);

/** Loads information about bonded hearing aid devices */
void btif_storage_load_bonded_hearing_aids();

/** Deletes the bonded hearing aid device info from NVRAM */
void btif_storage_remove_hearing_aid(const RawAddress& address);

/*******************************************************************************
 *
 * Function         btif_storage_is_retricted_device
+7 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include <hardware/bt_av.h>
#include <hardware/bt_gatt.h>
#include <hardware/bt_hd.h>
#include <hardware/bt_hearing_aid.h>
#include <hardware/bt_hf_client.h>
#include <hardware/bt_hh.h>
#include <hardware/bt_hl.h>
@@ -71,6 +72,8 @@
/* Test interface includes */
#include "mca_api.h"

using bluetooth::hearing_aid::HearingAidInterface;

/*******************************************************************************
 *  Static variables
 ******************************************************************************/
@@ -109,6 +112,8 @@ extern const btrc_interface_t* btif_rc_get_interface();
extern const btrc_ctrl_interface_t* btif_rc_ctrl_get_interface();
/*SDP search client*/
extern const btsdp_interface_t* btif_sdp_get_interface();
/*Hearing Aid client*/
extern HearingAidInterface* btif_hearing_aid_get_interface();

/* List all test interface here */
extern const btmcap_test_interface_t* stack_mcap_get_interface();
@@ -375,6 +380,8 @@ static const void* get_profile_interface(const char* profile_id) {
  if (is_profile(profile_id, BT_TEST_INTERFACE_MCAP_ID))
    return stack_mcap_get_interface();

  if (is_profile(profile_id, BT_PROFILE_HEARING_AID_ID))
    return btif_hearing_aid_get_interface();
  return NULL;
}

Loading