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

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

Run clang-format on headers

Bug: 67853426
Test: compilation
Change-Id: I37dcac01e78fafb4ef0c7e97578d04605c46e88e
parent 776fb3df
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -50,14 +50,16 @@ class BleAdvertiserInterface {
  using IdStatusCallback =
      base::Callback<void(uint8_t /* advertiser_id */, uint8_t /* status */)>;
  using IdTxPowerStatusCallback =
      base::Callback<void(uint8_t /* advertiser_id */, int8_t /* tx_power */, uint8_t /* status */)>;
      base::Callback<void(uint8_t /* advertiser_id */, int8_t /* tx_power */,
                          uint8_t /* status */)>;
  using ParametersCallback =
      base::Callback<void(uint8_t /* status */, int8_t /* tx_power */)>;

  /** Registers an advertiser with the stack */
  virtual void RegisterAdvertiser(IdStatusCallback) = 0;

  using GetAddressCallback = base::Callback<void(uint8_t /* address_type*/, RawAddress /*address*/)>;
  using GetAddressCallback =
      base::Callback<void(uint8_t /* address_type*/, RawAddress /*address*/)>;
  virtual void GetOwnAddress(uint8_t advertiser_id, GetAddressCallback cb) = 0;

  /* Set the parameters as per spec, user manual specified values */
+286 −296
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@
#define BT_HARDWARE_MODULE_ID "bluetooth"
#define BT_STACK_MODULE_ID "bluetooth"


/** Bluetooth profile interface IDs */

#define BT_PROFILE_HANDSFREE_ID "handsfree"
@@ -54,9 +53,7 @@
#define BT_TEST_INTERFACE_MCAP_ID "mcap_test"

/** Bluetooth Device Name */
typedef struct {
    uint8_t name[249];
} __attribute__((packed))bt_bdname_t;
typedef struct { uint8_t name[249]; } __attribute__((packed)) bt_bdname_t;

/** Bluetooth Adapter Visibility Modes*/
typedef enum {
@@ -66,10 +63,7 @@ typedef enum {
} bt_scan_mode_t;

/** Bluetooth Adapter State */
typedef enum {
    BT_STATE_OFF,
    BT_STATE_ON
}   bt_state_t;
typedef enum { BT_STATE_OFF, BT_STATE_ON } bt_state_t;

/** Bluetooth Error Status */
/** We need to build on this */
@@ -93,9 +87,7 @@ typedef enum {
} bt_status_t;

/** Bluetooth PinKey Code */
typedef struct {
    uint8_t pin[16];
} __attribute__((packed))bt_pin_code_t;
typedef struct { uint8_t pin[16]; } __attribute__((packed)) bt_pin_code_t;

typedef struct {
  uint8_t status;
@@ -125,24 +117,20 @@ typedef enum {
} bt_acl_state_t;

/** Bluetooth SDP service record */
typedef struct
{
typedef struct {
  bluetooth::Uuid uuid;
  uint16_t channel;
  char name[256];  // what's the maximum length
} bt_service_record_t;


/** Bluetooth Remote Version info */
typedef struct
{
typedef struct {
  int version;
  int sub_ver;
  int manufacturer;
} bt_remote_version_t;

typedef struct
{
typedef struct {
  uint16_t version_supported;
  uint8_t local_privacy_enabled;
  uint8_t max_adv_instance;
@@ -255,16 +243,14 @@ typedef enum {
} bt_property_type_t;

/** Bluetooth Adapter Property data structure */
typedef struct
{
typedef struct {
  bt_property_type_t type;
  int len;
  void* val;
} bt_property_t;

/** Bluetooth Out Of Band data for bonding */
typedef struct
{
typedef struct {
  uint8_t le_bt_dev_addr[7]; /* LE Bluetooth Device Address */
  uint8_t c192[16];          /* Simple Pairing Hash C-192 */
  uint8_t r192[16];          /* Simple Pairing Randomizer R-192 */
@@ -275,8 +261,6 @@ typedef struct
  uint8_t le_sc_r[16];       /* LE Secure Connections Random Value */
} bt_out_of_band_data_t;



/** Bluetooth Device Type */
typedef enum {
  BT_DEVICE_DEVTYPE_BREDR = 0x1,
@@ -338,7 +322,8 @@ typedef void (*discovery_state_changed_callback)(bt_discovery_state_t state);

/** Bluetooth Legacy PinKey Request callback */
typedef void (*pin_request_callback)(RawAddress* remote_bd_addr,
                                        bt_bdname_t *bd_name, uint32_t cod, bool min_16_digit);
                                     bt_bdname_t* bd_name, uint32_t cod,
                                     bool min_16_digit);

/** Bluetooth SSP Request callback - Just Works & Numeric Comparison*/
/** pass_key - Shall be 0 for BT_SSP_PAIRING_VARIANT_CONSENT &
@@ -346,8 +331,7 @@ typedef void (*pin_request_callback)(RawAddress *remote_bd_addr,
/* TODO: Passkey request callback shall not be needed for devices with display
 * capability. We still need support this in the stack for completeness */
typedef void (*ssp_request_callback)(RawAddress* remote_bd_addr,
                                        bt_bdname_t *bd_name,
                                        uint32_t cod,
                                     bt_bdname_t* bd_name, uint32_t cod,
                                     bt_ssp_variant_t pairing_variant,
                                     uint32_t pass_key);

@@ -358,36 +342,36 @@ typedef void (*bond_state_changed_callback)(bt_status_t status,
                                            bt_bond_state_t state);

/** Bluetooth ACL connection state changed callback */
typedef void (*acl_state_changed_callback)(bt_status_t status, RawAddress *remote_bd_addr,
typedef void (*acl_state_changed_callback)(bt_status_t status,
                                           RawAddress* remote_bd_addr,
                                           bt_acl_state_t state);

typedef enum {
    ASSOCIATE_JVM,
    DISASSOCIATE_JVM
} bt_cb_thread_evt;
typedef enum { ASSOCIATE_JVM, DISASSOCIATE_JVM } bt_cb_thread_evt;

/** Thread Associate/Disassociate JVM Callback */
/* Callback that is invoked by the callback thread to allow upper layer to attach/detach to/from
 * the JVM */
/* Callback that is invoked by the callback thread to allow upper layer to
 * attach/detach to/from the JVM */
typedef void (*callback_thread_event)(bt_cb_thread_evt evt);

/** Bluetooth Test Mode Callback */
/* Receive any HCI event from controller. Must be in DUT Mode for this callback to be received */
typedef void (*dut_mode_recv_callback)(uint16_t opcode, uint8_t *buf, uint8_t len);
/* Receive any HCI event from controller. Must be in DUT Mode for this callback
 * to be received */
typedef void (*dut_mode_recv_callback)(uint16_t opcode, uint8_t* buf,
                                       uint8_t len);

/* LE Test mode callbacks
* This callback shall be invoked whenever the le_tx_test, le_rx_test or le_test_end is invoked
* The num_packets is valid only for le_test_end command */
 * This callback shall be invoked whenever the le_tx_test, le_rx_test or
 * le_test_end is invoked The num_packets is valid only for le_test_end command
 */
typedef void (*le_test_mode_callback)(bt_status_t status, uint16_t num_packets);

/** Callback invoked when energy details are obtained */
/* Ctrl_state-Current controller state-Active-1,scan-2,or idle-3 state as defined by HCI spec.
 * If the ctrl_state value is 0, it means the API call failed
 * Time values-In milliseconds as returned by the controller
 * Energy used-Value as returned by the controller
 * Status-Provides the status of the read_energy_info API call
 * uid_data provides an array of bt_uid_traffic_t, where the array is terminated by an element with
 * app_uid set to -1.
/* Ctrl_state-Current controller state-Active-1,scan-2,or idle-3 state as
 * defined by HCI spec. If the ctrl_state value is 0, it means the API call
 * failed Time values-In milliseconds as returned by the controller Energy
 * used-Value as returned by the controller Status-Provides the status of the
 * read_energy_info API call uid_data provides an array of bt_uid_traffic_t,
 * where the array is terminated by an element with app_uid set to -1.
 */
typedef void (*energy_info_callback)(bt_activity_energy_info* energy_info,
                                     bt_uid_traffic_t* uid_data);
@@ -415,7 +399,8 @@ typedef struct {
} bt_callbacks_t;

typedef void (*alarm_cb)(void* data);
typedef bool (*set_wake_alarm_callout)(uint64_t delay_millis, bool should_wake, alarm_cb cb, void *data);
typedef bool (*set_wake_alarm_callout)(uint64_t delay_millis, bool should_wake,
                                       alarm_cb cb, void* data);
typedef int (*acquire_wake_lock_callout)(const char* lock_name);
typedef int (*release_wake_lock_callout)(const char* lock_name);

@@ -438,13 +423,13 @@ typedef struct {
 *
 *    1.) If Bluetooth is not enabled, then the Bluetooth core shall mark the
 *        profile as enabled. Subsequently, when the application invokes the
 *        Bluetooth 'enable', as part of the enable sequence the profile that were
 *        marked shall be enabled by calling appropriate stack APIs. The
 *        Bluetooth 'enable', as part of the enable sequence the profile that
 * were marked shall be enabled by calling appropriate stack APIs. The
 *        'adapter_properties_cb' shall return the list of UUIDs of the
 *        enabled profiles.
 *
 *    2.) If Bluetooth is enabled, then the Bluetooth core shall invoke the stack
 *        profile API to initialize the profile and trigger a
 *    2.) If Bluetooth is enabled, then the Bluetooth core shall invoke the
 * stack profile API to initialize the profile and trigger a
 *        'adapter_properties_cb' with the current list of UUIDs including the
 *        newly added profile's UUID.
 *
@@ -528,8 +513,8 @@ typedef struct {

  /** BT Legacy PinKey Reply */
  /** If accept==FALSE, then pin_len and pin_code shall be 0x0 */
    int (*pin_reply)(const RawAddress *bd_addr, uint8_t accept,
                     uint8_t pin_len, bt_pin_code_t *pin_code);
  int (*pin_reply)(const RawAddress* bd_addr, uint8_t accept, uint8_t pin_len,
                   bt_pin_code_t* pin_code);

  /** BT SSP Reply - Just Works, Numeric Comparison and Passkey
   * passkey shall be zero for BT_SSP_VARIANT_PASSKEY_COMPARISON &
@@ -546,19 +531,22 @@ typedef struct {
  /* Configure DUT Mode - Use this mode to enter/exit DUT mode */
  int (*dut_mode_configure)(uint8_t enable);

    /* Send any test HCI (vendor-specific) command to the controller. Must be in DUT Mode */
  /* Send any test HCI (vendor-specific) command to the controller. Must be in
   * DUT Mode */
  int (*dut_mode_send)(uint16_t opcode, uint8_t* buf, uint8_t len);
  /** BLE Test Mode APIs */
    /* opcode MUST be one of: LE_Receiver_Test, LE_Transmitter_Test, LE_Test_End */
  /* opcode MUST be one of: LE_Receiver_Test, LE_Transmitter_Test, LE_Test_End
   */
  int (*le_test_mode)(uint16_t opcode, uint8_t* buf, uint8_t len);

    /** Sets the OS call-out functions that bluedroid needs for alarms and wake locks.
      * This should be called immediately after a successful |init|.
  /** Sets the OS call-out functions that bluedroid needs for alarms and wake
   * locks. This should be called immediately after a successful |init|.
   */
  int (*set_os_callouts)(bt_os_callouts_t* callouts);

    /** Read Energy info details - return value indicates BT_STATUS_SUCCESS or BT_STATUS_NOT_READY
      * Success indicates that the VSC command was sent to controller
  /** Read Energy info details - return value indicates BT_STATUS_SUCCESS or
   * BT_STATUS_NOT_READY Success indicates that the VSC command was sent to
   * controller
   */
  int (*read_energy_info)();

@@ -583,9 +571,11 @@ typedef struct {
  /**
   * Add a new device interoperability workaround for a remote device whose
   * first |len| bytes of the its device address match |addr|.
     * NOTE: |feature| has to match an item defined in interop_feature_t (interop.h).
   * NOTE: |feature| has to match an item defined in interop_feature_t
   * (interop.h).
   */
    void (*interop_database_add)(uint16_t feature, const RawAddress *addr, size_t len);
  void (*interop_database_add)(uint16_t feature, const RawAddress* addr,
                               size_t len);
} bt_interface_t;

#define BLUETOOTH_INTERFACE_STRING "bluetoothInterface"
+76 −76
Original line number Diff line number Diff line
@@ -113,7 +113,8 @@ typedef enum {
 */
typedef struct {
  btav_a2dp_codec_index_t codec_type;
  btav_a2dp_codec_priority_t codec_priority; // Codec selection priority
  btav_a2dp_codec_priority_t
      codec_priority;  // Codec selection priority
                       // relative to other codecs: larger value
                       // means higher priority. If 0, reset to
                       // default.
@@ -187,7 +188,6 @@ typedef struct {
/** Represents the standard BT-AV A2DP Source interface.
 */
typedef struct {

  /** set to sizeof(btav_source_interface_t) */
  size_t size;
  /**
@@ -203,7 +203,8 @@ typedef struct {
  bt_status_t (*disconnect)(RawAddress* bd_addr);

  /** configure the codecs settings preferences */
    bt_status_t (*config_codec)(std::vector<btav_a2dp_codec_config_t> codec_preferences);
  bt_status_t (*config_codec)(
      std::vector<btav_a2dp_codec_config_t> codec_preferences);

  /** Closes the interface. */
  void (*cleanup)(void);
@@ -213,7 +214,6 @@ typedef struct {
/** Represents the standard BT-AV A2DP Sink interface.
 */
typedef struct {

  /** set to sizeof(btav_sink_interface_t) */
  size_t size;
  /**
+52 −56
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@

/******************************************************************************
 *
 *  This file contains constants and definitions that can be used commonly between JNI and stack layer
 * This file contains constants and definitions that can be used commonly
 * between JNI and stack layer
 *
 ******************************************************************************/
#ifndef ANDROID_INCLUDE_BT_COMMON_TYPES_H
@@ -26,8 +27,7 @@

#include <bluetooth/uuid.h>

typedef struct
{
typedef struct {
  uint8_t client_if;
  uint8_t filt_index;
  uint8_t advertiser_state;
@@ -43,8 +43,7 @@ typedef struct
  uint8_t* p_scan_rsp_data;
} btgatt_track_adv_info_t;

typedef enum
{
typedef enum {
  BTGATT_DB_PRIMARY_SERVICE,
  BTGATT_DB_SECONDARY_SERVICE,
  BTGATT_DB_INCLUDED_SERVICE,
@@ -52,8 +51,7 @@ typedef enum
  BTGATT_DB_DESCRIPTOR,
} bt_gatt_db_attribute_type_t;

typedef struct
{
typedef struct {
  uint16_t id;
  bluetooth::Uuid uuid;
  bt_gatt_db_attribute_type_t type;
@@ -75,8 +73,7 @@ typedef struct
  uint16_t permissions;
} btgatt_db_element_t;

typedef struct
{
typedef struct {
  uint16_t feat_seln;
  uint16_t list_logic_type;
  uint8_t filt_logic_type;
@@ -89,5 +86,4 @@ typedef struct
  uint16_t num_of_tracking_entries;
} btgatt_filt_param_setup_t;


#endif /* ANDROID_INCLUDE_BT_COMMON_TYPES_H */
+24 −25
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
 * limitations under the License.
 */


#ifndef ANDROID_INCLUDE_BT_GATT_H
#define ANDROID_INCLUDE_BT_GATT_H

Loading