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

Commit 5cfafc99 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Automerger Merge Worker
Browse files

Merge "gatt: Extend Bluetooth GATT API with eatt support" am: 583c643e

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1404767

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8323324a0b416ff0e977f94b8375aa29c9743ad1
parents bf3599ef 583c643e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ interface IBluetoothGatt {
    void unregisterSync(in IPeriodicAdvertisingCallback callback);

    @UnsupportedAppUsage
    void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback);
    void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback, boolean eatt_support);

    @UnsupportedAppUsage
    void unregisterClient(in int clientIf);
@@ -101,7 +101,7 @@ interface IBluetoothGatt {
                            int maxInterval, int peripheralLatency, int supervisionTimeout,
                            int minConnectionEventLen, int maxConnectionEventLen);

    void registerServer(in ParcelUuid appId, in IBluetoothGattServerCallback callback);
    void registerServer(in ParcelUuid appId, in IBluetoothGattServerCallback callback, boolean eatt_support);
    void unregisterServer(in int serverIf);
    void serverConnect(in int serverIf, in String address, in boolean isDirect, in int transport);
    void serverDisconnect(in int serverIf, in String address);
+8 −8
Original line number Diff line number Diff line
@@ -31,21 +31,20 @@
#include <base/threading/thread.h>
#include <errno.h>
#include <hardware/bluetooth.h>
#include <string>
#include "device/include/controller.h"

#include "btif_common.h"
#include "btif_util.h"

#include <hardware/bt_gatt.h>

#include <string>

#include "bta_api.h"
#include "bta_gatt_api.h"
#include "btif_common.h"
#include "btif_config.h"
#include "btif_dm.h"
#include "btif_gatt.h"
#include "btif_gatt_util.h"
#include "btif_storage.h"
#include "btif_util.h"
#include "device/include/controller.h"
#include "osi/include/log.h"
#include "stack/include/acl_api.h"
#include "stack/include/acl_api_types.h"
@@ -255,7 +254,8 @@ void btm_read_rssi_cb(void* p_void) {
 *  Client API Functions
 ******************************************************************************/

static bt_status_t btif_gattc_register_app(const Uuid& uuid) {
static bt_status_t btif_gattc_register_app(const Uuid& uuid,
                                           bool eatt_support) {
  CHECK_BTGATT_INIT();

  return do_in_jni_thread(Bind(
@@ -274,7 +274,7 @@ static bt_status_t btif_gattc_register_app(const Uuid& uuid) {
                uuid),
            eatt_support);
      },
      uuid, false));
      uuid, eatt_support));
}

static void btif_gattc_unregister_app_impl(int client_if) {
+3 −2
Original line number Diff line number Diff line
@@ -267,11 +267,12 @@ static void btapp_gatts_cback(tBTA_GATTS_EVT event, tBTA_GATTS* p_data) {
/*******************************************************************************
 *  Server API Functions
 ******************************************************************************/
static bt_status_t btif_gatts_register_app(const Uuid& bt_uuid) {
static bt_status_t btif_gatts_register_app(const Uuid& bt_uuid,
                                           bool eatt_support) {
  CHECK_BTGATT_INIT();

  return do_in_jni_thread(
      Bind(&BTA_GATTS_AppRegister, bt_uuid, &btapp_gatts_cback, false));
      Bind(&BTA_GATTS_AppRegister, bt_uuid, &btapp_gatts_cback, eatt_support));
}

static bt_status_t btif_gatts_unregister_app(int server_if) {
+2 −1
Original line number Diff line number Diff line
@@ -211,7 +211,8 @@ typedef struct {

typedef struct {
  /** Registers a GATT client application with the stack */
  bt_status_t (*register_client)(const bluetooth::Uuid& uuid);
  bt_status_t (*register_client)(const bluetooth::Uuid& uuid,
                                 bool eatt_support);

  /** Unregister a client application from the stack */
  bt_status_t (*unregister_client)(int client_if);
+2 −1
Original line number Diff line number Diff line
@@ -138,7 +138,8 @@ typedef struct {
/** Represents the standard BT-GATT server interface. */
typedef struct {
  /** Registers a GATT server application with the stack */
  bt_status_t (*register_server)(const bluetooth::Uuid& uuid);
  bt_status_t (*register_server)(const bluetooth::Uuid& uuid,
                                 bool eatt_support);

  /** Unregister a server application from the stack */
  bt_status_t (*unregister_server)(int server_if);
Loading