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

Commit 9d718b1d authored by Weichin Weng's avatar Weichin Weng Committed by Gerrit Code Review
Browse files

Merge "HearingAid: Config GAP_HANDLE initialize value is GAP_INVALID_HANDLE."

parents 7e305589 c004f6c7
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -41,7 +41,6 @@
#include "stack/include/acl_api_types.h"  // tBTM_RSSI_RESULT
#include "stack/include/acl_api_types.h"  // tBTM_RSSI_RESULT
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_octets.h"
#include "stack/include/bt_octets.h"
#include "stack/include/gap_api.h"
#include "stack/include/l2c_api.h"  // L2CAP_MIN_OFFSET
#include "stack/include/l2c_api.h"  // L2CAP_MIN_OFFSET
#include "types/bluetooth/uuid.h"
#include "types/bluetooth/uuid.h"
#include "types/bt_transport.h"
#include "types/bt_transport.h"
@@ -589,9 +588,9 @@ class HearingAidImpl : public HearingAid {
    hearingDevice->first_connection = true;
    hearingDevice->first_connection = true;
    hearingDevice->service_changed_rcvd = true;
    hearingDevice->service_changed_rcvd = true;
    BtaGattQueue::Clean(hearingDevice->conn_id);
    BtaGattQueue::Clean(hearingDevice->conn_id);
    if (hearingDevice->gap_handle) {
    if (hearingDevice->gap_handle != GAP_INVALID_HANDLE) {
      GAP_ConnClose(hearingDevice->gap_handle);
      GAP_ConnClose(hearingDevice->gap_handle);
      hearingDevice->gap_handle = 0;
      hearingDevice->gap_handle = GAP_INVALID_HANDLE;
    }
    }
  }
  }


@@ -1549,9 +1548,9 @@ class HearingAidImpl : public HearingAid {
      hearingDevice->conn_id = 0;
      hearingDevice->conn_id = 0;
    }
    }


    if (hearingDevice->gap_handle) {
    if (hearingDevice->gap_handle != GAP_INVALID_HANDLE) {
      GAP_ConnClose(hearingDevice->gap_handle);
      GAP_ConnClose(hearingDevice->gap_handle);
      hearingDevice->gap_handle = 0;
      hearingDevice->gap_handle = GAP_INVALID_HANDLE;
    }
    }


    hearingDevice->accepting_audio = false;
    hearingDevice->accepting_audio = false;
+3 −2
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@
#include <functional>
#include <functional>
#include <vector>
#include <vector>


#include "stack/include/gap_api.h"
#include "types/raw_address.h"
#include "types/raw_address.h"


constexpr uint16_t HEARINGAID_MAX_NUM_UUIDS = 1;
constexpr uint16_t HEARINGAID_MAX_NUM_UUIDS = 1;
@@ -166,7 +167,7 @@ struct HearingDevice {
        connection_update_status(NONE),
        connection_update_status(NONE),
        accepting_audio(false),
        accepting_audio(false),
        conn_id(0),
        conn_id(0),
        gap_handle(0),
        gap_handle(GAP_INVALID_HANDLE),
        audio_control_point_handle(audio_control_point_handle),
        audio_control_point_handle(audio_control_point_handle),
        audio_status_handle(audio_status_handle),
        audio_status_handle(audio_status_handle),
        audio_status_ccc_handle(audio_status_ccc_handle),
        audio_status_ccc_handle(audio_status_ccc_handle),
@@ -190,7 +191,7 @@ struct HearingDevice {
        connection_update_status(NONE),
        connection_update_status(NONE),
        accepting_audio(false),
        accepting_audio(false),
        conn_id(0),
        conn_id(0),
        gap_handle(0),
        gap_handle(GAP_INVALID_HANDLE),
        audio_status_handle(0),
        audio_status_handle(0),
        audio_status_ccc_handle(0),
        audio_status_ccc_handle(0),
        service_changed_ccc_handle(0),
        service_changed_ccc_handle(0),