diff --git a/include/hardware/ble_advertiser.h b/include/hardware/ble_advertiser.h index 02d553f2..5284800c 100644 --- a/include/hardware/ble_advertiser.h +++ b/include/hardware/ble_advertiser.h @@ -57,7 +57,7 @@ class BleAdvertiserInterface { /** Registers an advertiser with the stack */ virtual void RegisterAdvertiser(IdStatusCallback) = 0; - using GetAddressCallback = base::Callback; + using GetAddressCallback = base::Callback; virtual void GetOwnAddress(uint8_t advertiser_id, GetAddressCallback cb) = 0; /* Set the parameters as per spec, user manual specified values */ diff --git a/include/hardware/ble_scanner.h b/include/hardware/ble_scanner.h index c8f9ec26..2d3ec82a 100644 --- a/include/hardware/ble_scanner.h +++ b/include/hardware/ble_scanner.h @@ -37,7 +37,7 @@ typedef void (*track_adv_event_callback)( /** Callback for scan results */ typedef void (*scan_result_callback)(uint16_t event_type, uint8_t addr_type, - bt_bdaddr_t *bda, uint8_t primary_phy, + RawAddress *bda, uint8_t primary_phy, uint8_t secondary_phy, uint8_t advertising_sid, int8_t tx_power, int8_t rssi, uint16_t periodic_adv_int, @@ -90,7 +90,7 @@ class BleScannerInterface { int company_id, int company_id_mask, const bt_uuid_t *p_uuid, const bt_uuid_t *p_uuid_mask, - const bt_bdaddr_t *bd_addr, char addr_type, + const RawAddress *bd_addr, char addr_type, std::vector data, std::vector p_mask, FilterConfigCallback cb) = 0; @@ -125,12 +125,12 @@ class BleScannerInterface { using StartSyncCb = base::Callback; + RawAddress address, uint8_t phy, uint16_t interval)>; using SyncReportCb = base::Callback data)>; using SyncLostCb = base::Callback; - virtual void StartSync(uint8_t sid, bt_bdaddr_t address, uint16_t skip, + virtual void StartSync(uint8_t sid, RawAddress address, uint16_t skip, uint16_t timeout, StartSyncCb start_cb, SyncReportCb report_cb, SyncLostCb lost_cb) = 0; virtual void StopSync(uint16_t handle) = 0; diff --git a/include/hardware/bluetooth.h b/include/hardware/bluetooth.h index 6e287e6d..119c35d0 100644 --- a/include/hardware/bluetooth.h +++ b/include/hardware/bluetooth.h @@ -58,7 +58,7 @@ __BEGIN_DECLS /** Bluetooth Address */ typedef struct { uint8_t address[6]; -} __attribute__((packed))bt_bdaddr_t; +} __attribute__((packed))RawAddress; /** Bluetooth Device Name */ typedef struct { @@ -185,7 +185,7 @@ typedef enum { /** * Description - Bluetooth Device Address * Access mode - Only GET. - * Data type - bt_bdaddr_t + * Data type - RawAddress */ BT_PROPERTY_BDADDR, /** @@ -223,7 +223,7 @@ typedef enum { /** * Description - List of bonded devices * Access mode - Only GET. - * Data type - Array of bt_bdaddr_t of the bonded remote devices + * Data type - Array of RawAddress of the bonded remote devices * (Array size inferred from property length). */ BT_PROPERTY_ADAPTER_BONDED_DEVICES, @@ -334,7 +334,7 @@ typedef void (*adapter_properties_callback)(bt_status_t status, * multiple properties - num_properties shall be 1 */ typedef void (*remote_device_properties_callback)(bt_status_t status, - bt_bdaddr_t *bd_addr, + RawAddress *bd_addr, int num_properties, bt_property_t *properties); @@ -348,7 +348,7 @@ typedef void (*device_found_callback)(int num_properties, typedef void (*discovery_state_changed_callback)(bt_discovery_state_t state); /** Bluetooth Legacy PinKey Request callback */ -typedef void (*pin_request_callback)(bt_bdaddr_t *remote_bd_addr, +typedef void (*pin_request_callback)(RawAddress *remote_bd_addr, bt_bdname_t *bd_name, uint32_t cod, bool min_16_digit); /** Bluetooth SSP Request callback - Just Works & Numeric Comparison*/ @@ -356,7 +356,7 @@ typedef void (*pin_request_callback)(bt_bdaddr_t *remote_bd_addr, * BT_SSP_PAIRING_PASSKEY_ENTRY */ /* 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)(bt_bdaddr_t *remote_bd_addr, +typedef void (*ssp_request_callback)(RawAddress *remote_bd_addr, bt_bdname_t *bd_name, uint32_t cod, bt_ssp_variant_t pairing_variant, @@ -365,11 +365,11 @@ typedef void (*ssp_request_callback)(bt_bdaddr_t *remote_bd_addr, /** Bluetooth Bond state changed callback */ /* Invoked in response to create_bond, cancel_bond or remove_bond */ typedef void (*bond_state_changed_callback)(bt_status_t status, - bt_bdaddr_t *remote_bd_addr, + RawAddress *remote_bd_addr, bt_bond_state_t state); /** Bluetooth ACL connection state changed callback */ -typedef void (*acl_state_changed_callback)(bt_status_t status, bt_bdaddr_t *remote_bd_addr, +typedef void (*acl_state_changed_callback)(bt_status_t status, RawAddress *remote_bd_addr, bt_acl_state_t state); typedef enum { @@ -489,27 +489,27 @@ typedef struct { /** Set Bluetooth Adapter property of 'type' */ /* Based on the type, val shall be one of - * bt_bdaddr_t or bt_bdname_t or bt_scanmode_t etc + * RawAddress or bt_bdname_t or bt_scanmode_t etc */ int (*set_adapter_property)(const bt_property_t *property); /** Get all Remote Device properties */ - int (*get_remote_device_properties)(bt_bdaddr_t *remote_addr); + int (*get_remote_device_properties)(RawAddress *remote_addr); /** Get Remote Device property of 'type' */ - int (*get_remote_device_property)(bt_bdaddr_t *remote_addr, + int (*get_remote_device_property)(RawAddress *remote_addr, bt_property_type_t type); /** Set Remote Device property of 'type' */ - int (*set_remote_device_property)(bt_bdaddr_t *remote_addr, + int (*set_remote_device_property)(RawAddress *remote_addr, const bt_property_t *property); /** Get Remote Device's service record for the given UUID */ - int (*get_remote_service_record)(bt_bdaddr_t *remote_addr, + int (*get_remote_service_record)(RawAddress *remote_addr, bt_uuid_t *uuid); /** Start SDP to get remote services */ - int (*get_remote_services)(bt_bdaddr_t *remote_addr); + int (*get_remote_services)(RawAddress *remote_addr); /** Start Discovery */ int (*start_discovery)(void); @@ -518,28 +518,28 @@ typedef struct { int (*cancel_discovery)(void); /** Create Bluetooth Bonding */ - int (*create_bond)(const bt_bdaddr_t *bd_addr, int transport); + int (*create_bond)(const RawAddress *bd_addr, int transport); /** Create Bluetooth Bond using out of band data */ - int (*create_bond_out_of_band)(const bt_bdaddr_t *bd_addr, int transport, + int (*create_bond_out_of_band)(const RawAddress *bd_addr, int transport, const bt_out_of_band_data_t *oob_data); /** Remove Bond */ - int (*remove_bond)(const bt_bdaddr_t *bd_addr); + int (*remove_bond)(const RawAddress *bd_addr); /** Cancel Bond */ - int (*cancel_bond)(const bt_bdaddr_t *bd_addr); + int (*cancel_bond)(const RawAddress *bd_addr); /** * Get the connection status for a given remote device. * return value of 0 means the device is not connected, * non-zero return status indicates an active connection. */ - int (*get_connection_state)(const bt_bdaddr_t *bd_addr); + int (*get_connection_state)(const RawAddress *bd_addr); /** BT Legacy PinKey Reply */ /** If accept==FALSE, then pin_len and pin_code shall be 0x0 */ - int (*pin_reply)(const bt_bdaddr_t *bd_addr, uint8_t accept, + 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 @@ -547,7 +547,7 @@ typedef struct { * BT_SSP_VARIANT_CONSENT * For BT_SSP_VARIANT_PASSKEY_ENTRY, if accept==FALSE, then passkey * shall be zero */ - int (*ssp_reply)(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t variant, + int (*ssp_reply)(const RawAddress *bd_addr, bt_ssp_variant_t variant, uint8_t accept, uint32_t passkey); /** Get Bluetooth profile interface */ @@ -596,7 +596,7 @@ typedef struct { * first |len| bytes of the its device address match |addr|. * NOTE: |feature| has to match an item defined in interop_feature_t (interop.h). */ - void (*interop_database_add)(uint16_t feature, const bt_bdaddr_t *addr, size_t len); + void (*interop_database_add)(uint16_t feature, const RawAddress *addr, size_t len); } bt_interface_t; /** TODO: Need to add APIs for Service Discovery, Service authorization and diff --git a/include/hardware/bt_av.h b/include/hardware/bt_av.h index 91ae2ace..36722d43 100644 --- a/include/hardware/bt_av.h +++ b/include/hardware/bt_av.h @@ -130,13 +130,13 @@ typedef struct { * state will have one of the values from btav_connection_state_t */ typedef void (* btav_connection_state_callback)(btav_connection_state_t state, - bt_bdaddr_t *bd_addr); + RawAddress *bd_addr); /** Callback for audiopath state change. * state will have one of the values from btav_audio_state_t */ typedef void (* btav_audio_state_callback)(btav_audio_state_t state, - bt_bdaddr_t *bd_addr); + RawAddress *bd_addr); /** Callback for audio configuration change. * Used only for the A2DP Source interface. @@ -151,7 +151,7 @@ typedef void (* btav_audio_source_config_callback)( * sample_rate: sample rate in Hz * channel_count: number of channels (1 for mono, 2 for stereo) */ -typedef void (* btav_audio_sink_config_callback)(bt_bdaddr_t *bd_addr, +typedef void (* btav_audio_sink_config_callback)(RawAddress *bd_addr, uint32_t sample_rate, uint8_t channel_count); @@ -197,10 +197,10 @@ typedef struct { std::vector codec_priorities); /** connect to headset */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); + bt_status_t (*connect)( RawAddress *bd_addr ); /** dis-connect from headset */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); + bt_status_t (*disconnect)( RawAddress *bd_addr ); /** configure the codecs settings preferences */ bt_status_t (*config_codec)(std::vector codec_preferences); @@ -222,10 +222,10 @@ typedef struct { bt_status_t (*init)( btav_sink_callbacks_t* callbacks ); /** connect to headset */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); + bt_status_t (*connect)( RawAddress *bd_addr ); /** dis-connect from headset */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); + bt_status_t (*disconnect)( RawAddress *bd_addr ); /** Closes the interface. */ void (*cleanup)( void ); diff --git a/include/hardware/bt_common_types.h b/include/hardware/bt_common_types.h index cff30729..8d13ed45 100644 --- a/include/hardware/bt_common_types.h +++ b/include/hardware/bt_common_types.h @@ -34,7 +34,7 @@ typedef struct uint8_t tx_power; int8_t rssi_value; uint16_t time_stamp; - bt_bdaddr_t bd_addr; + RawAddress bd_addr; uint8_t adv_pkt_len; uint8_t *p_adv_pkt_data; uint8_t scan_rsp_len; diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h index f0b22c34..9adeb6f0 100644 --- a/include/hardware/bt_gatt_client.h +++ b/include/hardware/bt_gatt_client.h @@ -60,7 +60,7 @@ typedef struct typedef struct { uint8_t value[BTGATT_MAX_ATTR_LEN]; - bt_bdaddr_t bda; + RawAddress bda; uint16_t handle; uint16_t len; uint8_t is_notify; @@ -68,7 +68,7 @@ typedef struct typedef struct { - bt_bdaddr_t *bda1; + RawAddress *bda1; bt_uuid_t *uuid1; uint16_t u1; uint16_t u2; @@ -102,11 +102,11 @@ typedef enum typedef void (*register_client_callback)(int status, int client_if, const bt_uuid_t& app_uuid); /** GATT open callback invoked in response to open */ -typedef void (*connect_callback)(int conn_id, int status, int client_if, const bt_bdaddr_t& bda); +typedef void (*connect_callback)(int conn_id, int status, int client_if, const RawAddress& bda); /** Callback invoked in response to close */ typedef void (*disconnect_callback)(int conn_id, int status, - int client_if, const bt_bdaddr_t& bda); + int client_if, const RawAddress& bda); /** * Invoked in response to search_service when the GATT service search @@ -142,7 +142,7 @@ typedef void (*read_descriptor_callback)(int conn_id, int status, typedef void (*write_descriptor_callback)(int conn_id, int status, uint16_t handle); /** Callback triggered in response to read_remote_rssi */ -typedef void (*read_remote_rssi_callback)(int client_if, const bt_bdaddr_t& bda, +typedef void (*read_remote_rssi_callback)(int client_if, const RawAddress& bda, int rssi, int status); /** Callback invoked when the MTU for a given connection changes */ @@ -206,15 +206,15 @@ typedef struct { bt_status_t (*unregister_client)(int client_if); /** Create a connection to a remote LE or dual-mode device */ - bt_status_t (*connect)(int client_if, const bt_bdaddr_t& bd_addr, + bt_status_t (*connect)(int client_if, const RawAddress& bd_addr, bool is_direct, int transport, int initiating_phys); /** Disconnect a remote device or cancel a pending connection */ - bt_status_t (*disconnect)( int client_if, const bt_bdaddr_t& bd_addr, + bt_status_t (*disconnect)( int client_if, const RawAddress& bd_addr, int conn_id); /** Clear the attribute cache for a given device */ - bt_status_t (*refresh)( int client_if, const bt_bdaddr_t& bd_addr); + bt_status_t (*refresh)( int client_if, const RawAddress& bd_addr); /** * Enumerate all GATT services on a connected device. @@ -256,30 +256,30 @@ typedef struct { * characteristic */ bt_status_t (*register_for_notification)( int client_if, - const bt_bdaddr_t& bd_addr, uint16_t handle); + const RawAddress& bd_addr, uint16_t handle); /** Deregister a previous request for notifications/indications */ bt_status_t (*deregister_for_notification)( int client_if, - const bt_bdaddr_t& bd_addr, uint16_t handle); + const RawAddress& bd_addr, uint16_t handle); /** Request RSSI for a given remote device */ - bt_status_t (*read_remote_rssi)(int client_if, const bt_bdaddr_t& bd_addr); + bt_status_t (*read_remote_rssi)(int client_if, const RawAddress& bd_addr); /** Determine the type of the remote device (LE, BR/EDR, Dual-mode) */ - int (*get_device_type)(const bt_bdaddr_t &bd_addr); + int (*get_device_type)(const RawAddress &bd_addr); /** Configure the MTU for a given connection */ bt_status_t (*configure_mtu)(int conn_id, int mtu); /** Request a connection parameter update */ - bt_status_t (*conn_parameter_update)(const bt_bdaddr_t& bd_addr, int min_interval, + bt_status_t (*conn_parameter_update)(const RawAddress& bd_addr, int min_interval, int max_interval, int latency, int timeout); - bt_status_t (*set_preferred_phy)(const bt_bdaddr_t& bd_addr, uint8_t tx_phy, + bt_status_t (*set_preferred_phy)(const RawAddress& bd_addr, uint8_t tx_phy, uint8_t rx_phy, uint16_t phy_options); bt_status_t (*read_phy)( - const bt_bdaddr_t& bd_addr, + const RawAddress& bd_addr, base::Callback cb); diff --git a/include/hardware/bt_gatt_server.h b/include/hardware/bt_gatt_server.h index c24575fa..93ecc025 100644 --- a/include/hardware/bt_gatt_server.h +++ b/include/hardware/bt_gatt_server.h @@ -50,7 +50,7 @@ typedef void (*register_server_callback)(int status, int server_if, /** Callback indicating that a remote device has connected or been disconnected */ typedef void (*connection_callback)(int conn_id, int server_if, int connected, - const bt_bdaddr_t& bda); + const RawAddress& bda); /** Callback invoked in response to create_service */ typedef void (*service_added_callback)(int status, int server_if, @@ -68,20 +68,20 @@ typedef void (*service_deleted_callback)(int status, int server_if, * Callback invoked when a remote device has requested to read a characteristic * or descriptor. The application must respond by calling send_response */ -typedef void (*request_read_callback)(int conn_id, int trans_id, const bt_bdaddr_t& bda, +typedef void (*request_read_callback)(int conn_id, int trans_id, const RawAddress& bda, int attr_handle, int offset, bool is_long); /** * Callback invoked when a remote device has requested to write to a * characteristic or descriptor. */ -typedef void (*request_write_callback)(int conn_id, int trans_id, const bt_bdaddr_t& bda, +typedef void (*request_write_callback)(int conn_id, int trans_id, const RawAddress& bda, int attr_handle, int offset, bool need_rsp, bool is_prep, std::vector value); /** Callback invoked when a previously prepared write is to be executed */ typedef void (*request_exec_write_callback)(int conn_id, int trans_id, - const bt_bdaddr_t& bda, int exec_write); + const RawAddress& bda, int exec_write); /** * Callback triggered in response to send_response if the remote device @@ -141,11 +141,11 @@ typedef struct { bt_status_t (*unregister_server)(int server_if ); /** Create a connection to a remote peripheral */ - bt_status_t (*connect)(int server_if, const bt_bdaddr_t& bd_addr, + bt_status_t (*connect)(int server_if, const RawAddress& bd_addr, bool is_direct, int transport); /** Disconnect an established connection or cancel a pending one */ - bt_status_t (*disconnect)(int server_if, const bt_bdaddr_t& bd_addr, + bt_status_t (*disconnect)(int server_if, const RawAddress& bd_addr, int conn_id ); /** Create a new service */ @@ -166,11 +166,11 @@ typedef struct { bt_status_t (*send_response)(int conn_id, int trans_id, int status, const btgatt_response_t& response); - bt_status_t (*set_preferred_phy)(const bt_bdaddr_t& bd_addr, uint8_t tx_phy, + bt_status_t (*set_preferred_phy)(const RawAddress& bd_addr, uint8_t tx_phy, uint8_t rx_phy, uint16_t phy_options); bt_status_t (*read_phy)( - const bt_bdaddr_t& bd_addr, + const RawAddress& bd_addr, base::Callback cb); diff --git a/include/hardware/bt_hd.h b/include/hardware/bt_hd.h index 263f29fb..c99ab247 100644 --- a/include/hardware/bt_hd.h +++ b/include/hardware/bt_hd.h @@ -65,8 +65,8 @@ typedef struct uint32_t delay_variation; } bthd_qos_param_t; -typedef void (* bthd_application_state_callback)(bt_bdaddr_t *bd_addr, bthd_application_state_t state); -typedef void (* bthd_connection_state_callback)(bt_bdaddr_t *bd_addr, bthd_connection_state_t state); +typedef void (* bthd_application_state_callback)(RawAddress *bd_addr, bthd_application_state_t state); +typedef void (* bthd_connection_state_callback)(RawAddress *bd_addr, bthd_connection_state_t state); typedef void (* bthd_get_report_callback)(uint8_t type, uint8_t id, uint16_t buffer_size); typedef void (* bthd_set_report_callback)(uint8_t type, uint8_t id, uint16_t len, uint8_t *p_data); typedef void (* bthd_set_protocol_callback)(uint8_t protocol); @@ -105,7 +105,7 @@ typedef struct { bt_status_t (*unregister_app)(void); /** connects to host with virtual cable */ - bt_status_t (*connect)(bt_bdaddr_t *bd_addr); + bt_status_t (*connect)(RawAddress *bd_addr); /** disconnects from currently connected host */ bt_status_t (*disconnect)(void); diff --git a/include/hardware/bt_hf.h b/include/hardware/bt_hf.h index 2b89c91d..1f6f6ebe 100644 --- a/include/hardware/bt_hf.h +++ b/include/hardware/bt_hf.h @@ -91,89 +91,89 @@ typedef enum /** Callback for connection state change. * state will have one of the values from BtHfConnectionState */ -typedef void (* bthf_connection_state_callback)(bthf_connection_state_t state, bt_bdaddr_t *bd_addr); +typedef void (* bthf_connection_state_callback)(bthf_connection_state_t state, RawAddress *bd_addr); /** Callback for audio connection state change. * state will have one of the values from BtHfAudioState */ -typedef void (* bthf_audio_state_callback)(bthf_audio_state_t state, bt_bdaddr_t *bd_addr); +typedef void (* bthf_audio_state_callback)(bthf_audio_state_t state, RawAddress *bd_addr); /** Callback for VR connection state change. * state will have one of the values from BtHfVRState */ -typedef void (* bthf_vr_cmd_callback)(bthf_vr_state_t state, bt_bdaddr_t *bd_addr); +typedef void (* bthf_vr_cmd_callback)(bthf_vr_state_t state, RawAddress *bd_addr); /** Callback for answer incoming call (ATA) */ -typedef void (* bthf_answer_call_cmd_callback)(bt_bdaddr_t *bd_addr); +typedef void (* bthf_answer_call_cmd_callback)(RawAddress *bd_addr); /** Callback for disconnect call (AT+CHUP) */ -typedef void (* bthf_hangup_call_cmd_callback)(bt_bdaddr_t *bd_addr); +typedef void (* bthf_hangup_call_cmd_callback)(RawAddress *bd_addr); /** Callback for disconnect call (AT+CHUP) * type will denote Speaker/Mic gain (BtHfVolumeControl). */ -typedef void (* bthf_volume_cmd_callback)(bthf_volume_type_t type, int volume, bt_bdaddr_t *bd_addr); +typedef void (* bthf_volume_cmd_callback)(bthf_volume_type_t type, int volume, RawAddress *bd_addr); /** Callback for dialing an outgoing call * If number is NULL, redial */ -typedef void (* bthf_dial_call_cmd_callback)(char *number, bt_bdaddr_t *bd_addr); +typedef void (* bthf_dial_call_cmd_callback)(char *number, RawAddress *bd_addr); /** Callback for sending DTMF tones * tone contains the dtmf character to be sent */ -typedef void (* bthf_dtmf_cmd_callback)(char tone, bt_bdaddr_t *bd_addr); +typedef void (* bthf_dtmf_cmd_callback)(char tone, RawAddress *bd_addr); /** Callback for enabling/disabling noise reduction/echo cancellation * value will be 1 to enable, 0 to disable */ -typedef void (* bthf_nrec_cmd_callback)(bthf_nrec_t nrec, bt_bdaddr_t *bd_addr); +typedef void (* bthf_nrec_cmd_callback)(bthf_nrec_t nrec, RawAddress *bd_addr); /** Callback for AT+BCS and event from BAC * WBS enable, WBS disable */ -typedef void (* bthf_wbs_callback)(bthf_wbs_config_t wbs, bt_bdaddr_t *bd_addr); +typedef void (* bthf_wbs_callback)(bthf_wbs_config_t wbs, RawAddress *bd_addr); /** Callback for call hold handling (AT+CHLD) * value will contain the call hold command (0, 1, 2, 3) */ -typedef void (* bthf_chld_cmd_callback)(bthf_chld_type_t chld, bt_bdaddr_t *bd_addr); +typedef void (* bthf_chld_cmd_callback)(bthf_chld_type_t chld, RawAddress *bd_addr); /** Callback for CNUM (subscriber number) */ -typedef void (* bthf_cnum_cmd_callback)(bt_bdaddr_t *bd_addr); +typedef void (* bthf_cnum_cmd_callback)(RawAddress *bd_addr); /** Callback for indicators (CIND) */ -typedef void (* bthf_cind_cmd_callback)(bt_bdaddr_t *bd_addr); +typedef void (* bthf_cind_cmd_callback)(RawAddress *bd_addr); /** Callback for operator selection (COPS) */ -typedef void (* bthf_cops_cmd_callback)(bt_bdaddr_t *bd_addr); +typedef void (* bthf_cops_cmd_callback)(RawAddress *bd_addr); /** Callback for call list (AT+CLCC) */ -typedef void (* bthf_clcc_cmd_callback) (bt_bdaddr_t *bd_addr); +typedef void (* bthf_clcc_cmd_callback) (RawAddress *bd_addr); /** Callback for unknown AT command recd from HF * at_string will contain the unparsed AT string */ -typedef void (* bthf_unknown_at_cmd_callback)(char *at_string, bt_bdaddr_t *bd_addr); +typedef void (* bthf_unknown_at_cmd_callback)(char *at_string, RawAddress *bd_addr); /** Callback for keypressed (HSP) event. */ -typedef void (* bthf_key_pressed_cmd_callback)(bt_bdaddr_t *bd_addr); +typedef void (* bthf_key_pressed_cmd_callback)(RawAddress *bd_addr); /** Callback for BIND. Pass the remote HF Indicators supported. */ -typedef void (* bthf_bind_cmd_callback)(char *at_string, bt_bdaddr_t *bd_addr); +typedef void (* bthf_bind_cmd_callback)(char *at_string, RawAddress *bd_addr); /** Callback for BIEV. Pass the change in the Remote HF indicator values */ typedef void (* bthf_biev_cmd_callback)(bthf_hf_ind_type_t ind_id, int ind_value, - bt_bdaddr_t *bd_addr); + RawAddress *bd_addr); /** BT-HF callback structure. */ typedef struct { @@ -255,45 +255,45 @@ typedef struct { bt_status_t (*init)( bthf_callbacks_t* callbacks, int max_hf_clients, bool inband_ringing_supported); /** connect to headset */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); + bt_status_t (*connect)( RawAddress *bd_addr ); /** dis-connect from headset */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); + bt_status_t (*disconnect)( RawAddress *bd_addr ); /** create an audio connection */ - bt_status_t (*connect_audio)( bt_bdaddr_t *bd_addr ); + bt_status_t (*connect_audio)( RawAddress *bd_addr ); /** close the audio connection */ - bt_status_t (*disconnect_audio)( bt_bdaddr_t *bd_addr ); + bt_status_t (*disconnect_audio)( RawAddress *bd_addr ); /** start voice recognition */ - bt_status_t (*start_voice_recognition)( bt_bdaddr_t *bd_addr ); + bt_status_t (*start_voice_recognition)( RawAddress *bd_addr ); /** stop voice recognition */ - bt_status_t (*stop_voice_recognition)( bt_bdaddr_t *bd_addr ); + bt_status_t (*stop_voice_recognition)( RawAddress *bd_addr ); /** volume control */ - bt_status_t (*volume_control) (bthf_volume_type_t type, int volume, bt_bdaddr_t *bd_addr ); + bt_status_t (*volume_control) (bthf_volume_type_t type, int volume, RawAddress *bd_addr ); /** Combined device status change notification */ bt_status_t (*device_status_notification)(bthf_network_state_t ntk_state, bthf_service_type_t svc_type, int signal, int batt_chg); /** Response for COPS command */ - bt_status_t (*cops_response)(const char *cops, bt_bdaddr_t *bd_addr ); + bt_status_t (*cops_response)(const char *cops, RawAddress *bd_addr ); /** Response for CIND command */ bt_status_t (*cind_response)(int svc, int num_active, int num_held, bthf_call_state_t call_setup_state, - int signal, int roam, int batt_chg, bt_bdaddr_t *bd_addr ); + int signal, int roam, int batt_chg, RawAddress *bd_addr ); /** Pre-formatted AT response, typically in response to unknown AT cmd */ - bt_status_t (*formatted_at_response)(const char *rsp, bt_bdaddr_t *bd_addr ); + bt_status_t (*formatted_at_response)(const char *rsp, RawAddress *bd_addr ); /** ok/error response * ERROR (0) * OK (1) */ - bt_status_t (*at_response) (bthf_at_response_t response_code, int error_code, bt_bdaddr_t *bd_addr ); + bt_status_t (*at_response) (bthf_at_response_t response_code, int error_code, RawAddress *bd_addr ); /** response for CLCC command * Can be iteratively called for each call index @@ -302,7 +302,7 @@ typedef struct { bt_status_t (*clcc_response) (int index, bthf_call_direction_t dir, bthf_call_state_t state, bthf_call_mode_t mode, bthf_call_mpty_type_t mpty, const char *number, - bthf_call_addrtype_t type, bt_bdaddr_t *bd_addr ); + bthf_call_addrtype_t type, RawAddress *bd_addr ); /** notify of a call state change * Each update notifies @@ -318,11 +318,11 @@ typedef struct { void (*cleanup)( void ); /** configuration for the SCO codec */ - bt_status_t (*configure_wbs)( bt_bdaddr_t *bd_addr ,bthf_wbs_config_t config ); + bt_status_t (*configure_wbs)( RawAddress *bd_addr ,bthf_wbs_config_t config ); /** Response for HF Indicator change (+BIND) */ bt_status_t (*bind_response)(bthf_hf_ind_type_t ind_id, bthf_hf_ind_status_t ind_status, - bt_bdaddr_t *bd_addr); + RawAddress *bd_addr); /** Whether we will initiate SCO or not **/ bt_status_t (*set_sco_allowed)(bool value); diff --git a/include/hardware/bt_hf_client.h b/include/hardware/bt_hf_client.h index b728be3c..52072964 100644 --- a/include/hardware/bt_hf_client.h +++ b/include/hardware/bt_hf_client.h @@ -167,7 +167,7 @@ typedef enum { * state will have one of the values from BtHfConnectionState * peer/chld_features are valid only for BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED state */ -typedef void (* bthf_client_connection_state_callback)(const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_connection_state_callback)(const RawAddress *bd_addr, bthf_client_connection_state_t state, unsigned int peer_feat, unsigned int chld_feat); @@ -175,73 +175,73 @@ typedef void (* bthf_client_connection_state_callback)(const bt_bdaddr_t *bd_add /** Callback for audio connection state change. * state will have one of the values from BtHfAudioState */ -typedef void (* bthf_client_audio_state_callback)(const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_audio_state_callback)(const RawAddress *bd_addr, bthf_client_audio_state_t state); /** Callback for VR connection state change. * state will have one of the values from BtHfVRState */ -typedef void (* bthf_client_vr_cmd_callback)(const bt_bdaddr_t *bd_addr, bthf_client_vr_state_t state); +typedef void (* bthf_client_vr_cmd_callback)(const RawAddress *bd_addr, bthf_client_vr_state_t state); /** Callback for network state change */ -typedef void (* bthf_client_network_state_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_network_state_callback) (const RawAddress *bd_addr, bthf_client_network_state_t state); /** Callback for network roaming status change */ -typedef void (* bthf_client_network_roaming_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_network_roaming_callback) (const RawAddress *bd_addr, bthf_client_service_type_t type); /** Callback for signal strength indication */ -typedef void (* bthf_client_network_signal_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_network_signal_callback) (const RawAddress *bd_addr, int signal_strength); /** Callback for battery level indication */ -typedef void (* bthf_client_battery_level_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_battery_level_callback) (const RawAddress *bd_addr, int battery_level); /** Callback for current operator name */ -typedef void (* bthf_client_current_operator_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_current_operator_callback) (const RawAddress *bd_addr, const char *name); /** Callback for call indicator */ -typedef void (* bthf_client_call_callback) (const bt_bdaddr_t *bd_addr, bthf_client_call_t call); +typedef void (* bthf_client_call_callback) (const RawAddress *bd_addr, bthf_client_call_t call); /** Callback for callsetup indicator */ -typedef void (* bthf_client_callsetup_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_callsetup_callback) (const RawAddress *bd_addr, bthf_client_callsetup_t callsetup); /** Callback for callheld indicator */ -typedef void (* bthf_client_callheld_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_callheld_callback) (const RawAddress *bd_addr, bthf_client_callheld_t callheld); /** Callback for response and hold */ -typedef void (* bthf_client_resp_and_hold_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_resp_and_hold_callback) (const RawAddress *bd_addr, bthf_client_resp_and_hold_t resp_and_hold); /** Callback for Calling Line Identification notification * Will be called only when there is an incoming call and number is provided. */ -typedef void (* bthf_client_clip_callback) (const bt_bdaddr_t *bd_addr, const char *number); +typedef void (* bthf_client_clip_callback) (const RawAddress *bd_addr, const char *number); /** * Callback for Call Waiting notification */ -typedef void (* bthf_client_call_waiting_callback) (const bt_bdaddr_t *bd_addr, const char *number); +typedef void (* bthf_client_call_waiting_callback) (const RawAddress *bd_addr, const char *number); /** * Callback for listing current calls. Can be called multiple time. * If number is unknown NULL is passed. */ -typedef void (*bthf_client_current_calls) (const bt_bdaddr_t *bd_addr, int index, +typedef void (*bthf_client_current_calls) (const RawAddress *bd_addr, int index, bthf_client_call_direction_t dir, bthf_client_call_state_t state, bthf_client_call_mpty_type_t mpty, @@ -249,38 +249,38 @@ typedef void (*bthf_client_current_calls) (const bt_bdaddr_t *bd_addr, int index /** Callback for audio volume change */ -typedef void (*bthf_client_volume_change_callback) (const bt_bdaddr_t *bd_addr, +typedef void (*bthf_client_volume_change_callback) (const RawAddress *bd_addr, bthf_client_volume_type_t type, int volume); /** Callback for command complete event * cme is valid only for BTHF_CLIENT_CMD_COMPLETE_ERROR_CME type */ -typedef void (*bthf_client_cmd_complete_callback) (const bt_bdaddr_t *bd_addr, +typedef void (*bthf_client_cmd_complete_callback) (const RawAddress *bd_addr, bthf_client_cmd_complete_t type, int cme); /** Callback for subscriber information */ -typedef void (* bthf_client_subscriber_info_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_subscriber_info_callback) (const RawAddress *bd_addr, const char *name, bthf_client_subscriber_service_type_t type); /** Callback for in-band ring tone settings */ -typedef void (* bthf_client_in_band_ring_tone_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_in_band_ring_tone_callback) (const RawAddress *bd_addr, bthf_client_in_band_ring_state_t state); /** * Callback for requested number from AG */ -typedef void (* bthf_client_last_voice_tag_number_callback) (const bt_bdaddr_t *bd_addr, +typedef void (* bthf_client_last_voice_tag_number_callback) (const RawAddress *bd_addr, const char *number); /** * Callback for sending ring indication to app */ -typedef void (* bthf_client_ring_indication_callback) (const bt_bdaddr_t *bd_addr); +typedef void (* bthf_client_ring_indication_callback) (const RawAddress *bd_addr); /** BT-HF callback structure. */ typedef struct { @@ -320,62 +320,62 @@ typedef struct { bt_status_t (*init)(bthf_client_callbacks_t* callbacks); /** connect to audio gateway */ - bt_status_t (*connect)(bt_bdaddr_t *bd_addr); + bt_status_t (*connect)(RawAddress *bd_addr); /** disconnect from audio gateway */ - bt_status_t (*disconnect)(const bt_bdaddr_t *bd_addr); + bt_status_t (*disconnect)(const RawAddress *bd_addr); /** create an audio connection */ - bt_status_t (*connect_audio)(const bt_bdaddr_t *bd_addr); + bt_status_t (*connect_audio)(const RawAddress *bd_addr); /** close the audio connection */ - bt_status_t (*disconnect_audio)(const bt_bdaddr_t *bd_addr); + bt_status_t (*disconnect_audio)(const RawAddress *bd_addr); /** start voice recognition */ - bt_status_t (*start_voice_recognition)(const bt_bdaddr_t *bd_addr); + bt_status_t (*start_voice_recognition)(const RawAddress *bd_addr); /** stop voice recognition */ - bt_status_t (*stop_voice_recognition)(const bt_bdaddr_t *bd_addr); + bt_status_t (*stop_voice_recognition)(const RawAddress *bd_addr); /** volume control */ - bt_status_t (*volume_control) (const bt_bdaddr_t *bd_addr, + bt_status_t (*volume_control) (const RawAddress *bd_addr, bthf_client_volume_type_t type, int volume); /** place a call with number a number * if number is NULL last called number is called (aka re-dial)*/ - bt_status_t (*dial) (const bt_bdaddr_t *bd_addr, const char *number); + bt_status_t (*dial) (const RawAddress *bd_addr, const char *number); /** place a call with number specified by location (speed dial) */ - bt_status_t (*dial_memory) (const bt_bdaddr_t *bd_addr, int location); + bt_status_t (*dial_memory) (const RawAddress *bd_addr, int location); /** perform specified call related action * idx is limited only for enhanced call control related action */ - bt_status_t (*handle_call_action) (const bt_bdaddr_t *bd_addr, + bt_status_t (*handle_call_action) (const RawAddress *bd_addr, bthf_client_call_action_t action, int idx); /** query list of current calls */ - bt_status_t (*query_current_calls) (const bt_bdaddr_t *bd_addr); + bt_status_t (*query_current_calls) (const RawAddress *bd_addr); /** query name of current selected operator */ - bt_status_t (*query_current_operator_name) (const bt_bdaddr_t *bd_addr); + bt_status_t (*query_current_operator_name) (const RawAddress *bd_addr); /** Retrieve subscriber information */ - bt_status_t (*retrieve_subscriber_info) (const bt_bdaddr_t *bd_addr); + bt_status_t (*retrieve_subscriber_info) (const RawAddress *bd_addr); /** Send DTMF code*/ - bt_status_t (*send_dtmf) (const bt_bdaddr_t *bd_addr, char code); + bt_status_t (*send_dtmf) (const RawAddress *bd_addr, char code); /** Request a phone number from AG corresponding to last voice tag recorded */ - bt_status_t (*request_last_voice_tag_number) (const bt_bdaddr_t *bd_addr); + bt_status_t (*request_last_voice_tag_number) (const RawAddress *bd_addr); /** Closes the interface. */ void (*cleanup)(void); /** Send AT Command. */ - bt_status_t (*send_at_cmd) (const bt_bdaddr_t *bd_addr, int cmd, int val1, int val2, const char *arg); + bt_status_t (*send_at_cmd) (const RawAddress *bd_addr, int cmd, int val1, int val2, const char *arg); } bthf_client_interface_t; __END_DECLS diff --git a/include/hardware/bt_hh.h b/include/hardware/bt_hh.h index ece3c114..c39e3e5b 100644 --- a/include/hardware/bt_hh.h +++ b/include/hardware/bt_hh.h @@ -87,37 +87,37 @@ typedef struct /** Callback for connection state change. * state will have one of the values from bthh_connection_state_t */ -typedef void (* bthh_connection_state_callback)(bt_bdaddr_t *bd_addr, bthh_connection_state_t state); +typedef void (* bthh_connection_state_callback)(RawAddress *bd_addr, bthh_connection_state_t state); /** Callback for vitual unplug api. * the status of the vitual unplug */ -typedef void (* bthh_virtual_unplug_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status); +typedef void (* bthh_virtual_unplug_callback)(RawAddress *bd_addr, bthh_status_t hh_status); /** Callback for get hid info * hid_info will contain attr_mask, sub_class, app_id, vendor_id, product_id, version, ctry_code, len */ -typedef void (* bthh_hid_info_callback)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info); +typedef void (* bthh_hid_info_callback)(RawAddress *bd_addr, bthh_hid_info_t hid_info); /** Callback for get protocol api. * the protocol mode is one of the value from bthh_protocol_mode_t */ -typedef void (* bthh_protocol_mode_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, bthh_protocol_mode_t mode); +typedef void (* bthh_protocol_mode_callback)(RawAddress *bd_addr, bthh_status_t hh_status, bthh_protocol_mode_t mode); /** Callback for get/set_idle_time api. */ -typedef void (* bthh_idle_time_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, int idle_rate); +typedef void (* bthh_idle_time_callback)(RawAddress *bd_addr, bthh_status_t hh_status, int idle_rate); /** Callback for get report api. * if staus is ok rpt_data contains the report data */ -typedef void (* bthh_get_report_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, uint8_t* rpt_data, int rpt_size); +typedef void (* bthh_get_report_callback)(RawAddress *bd_addr, bthh_status_t hh_status, uint8_t* rpt_data, int rpt_size); /** Callback for set_report/set_protocol api and if error * occurs for get_report/get_protocol api. */ -typedef void (* bthh_handshake_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status); +typedef void (* bthh_handshake_callback)(RawAddress *bd_addr, bthh_status_t hh_status); /** BT-HH callback structure. */ @@ -148,37 +148,37 @@ typedef struct { bt_status_t (*init)( bthh_callbacks_t* callbacks ); /** connect to hid device */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr); + bt_status_t (*connect)( RawAddress *bd_addr); /** dis-connect from hid device */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); + bt_status_t (*disconnect)( RawAddress *bd_addr ); /** Virtual UnPlug (VUP) the specified HID device */ - bt_status_t (*virtual_unplug)(bt_bdaddr_t *bd_addr); + bt_status_t (*virtual_unplug)(RawAddress *bd_addr); /** Set the HID device descriptor for the specified HID device. */ - bt_status_t (*set_info)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info ); + bt_status_t (*set_info)(RawAddress *bd_addr, bthh_hid_info_t hid_info ); /** Get the HID proto mode. */ - bt_status_t (*get_protocol) (bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode); + bt_status_t (*get_protocol) (RawAddress *bd_addr, bthh_protocol_mode_t protocolMode); /** Set the HID proto mode. */ - bt_status_t (*set_protocol)(bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode); + bt_status_t (*set_protocol)(RawAddress *bd_addr, bthh_protocol_mode_t protocolMode); /** Get the HID Idle Time */ - bt_status_t (*get_idle_time)(bt_bdaddr_t *bd_addr); + bt_status_t (*get_idle_time)(RawAddress *bd_addr); /** Set the HID Idle Time */ - bt_status_t (*set_idle_time)(bt_bdaddr_t *bd_addr, uint8_t idleTime); + bt_status_t (*set_idle_time)(RawAddress *bd_addr, uint8_t idleTime); /** Send a GET_REPORT to HID device. */ - bt_status_t (*get_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, uint8_t reportId, int bufferSize); + bt_status_t (*get_report)(RawAddress *bd_addr, bthh_report_type_t reportType, uint8_t reportId, int bufferSize); /** Send a SET_REPORT to HID device. */ - bt_status_t (*set_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, char* report); + bt_status_t (*set_report)(RawAddress *bd_addr, bthh_report_type_t reportType, char* report); /** Send data to HID device. */ - bt_status_t (*send_data)(bt_bdaddr_t *bd_addr, char* data); + bt_status_t (*send_data)(RawAddress *bd_addr, char* data); /** Closes the interface. */ void (*cleanup)( void ); diff --git a/include/hardware/bt_hl.h b/include/hardware/bt_hl.h index bd29e3ab..6d909fbb 100644 --- a/include/hardware/bt_hl.h +++ b/include/hardware/bt_hl.h @@ -78,7 +78,7 @@ typedef void (* bthl_app_reg_state_callback)(int app_id, bthl_app_reg_state_t st * state will have one of the values from * bthl_connection_state_t and fd (file descriptor) */ -typedef void (* bthl_channel_state_callback)(int app_id, bt_bdaddr_t *bd_addr, int mdep_cfg_index, int channel_id, bthl_channel_state_t state, int fd); +typedef void (* bthl_channel_state_callback)(int app_id, RawAddress *bd_addr, int mdep_cfg_index, int channel_id, bthl_channel_state_t state, int fd); /** BT-HL callback structure. */ typedef struct { @@ -107,7 +107,7 @@ typedef struct { bt_status_t (*unregister_application) (int app_id); /** connect channel */ - bt_status_t (*connect_channel)(int app_id, bt_bdaddr_t *bd_addr, int mdep_cfg_index, int *channel_id); + bt_status_t (*connect_channel)(int app_id, RawAddress *bd_addr, int mdep_cfg_index, int *channel_id); /** destroy channel */ bt_status_t (*destroy_channel)(int channel_id); diff --git a/include/hardware/bt_mce.h b/include/hardware/bt_mce.h index 5d159b33..406a26a3 100644 --- a/include/hardware/bt_mce.h +++ b/include/hardware/bt_mce.h @@ -29,7 +29,7 @@ typedef struct } btmce_mas_instance_t; /** callback for get_remote_mas_instances */ -typedef void (*btmce_remote_mas_instances_callback)(bt_status_t status, bt_bdaddr_t *bd_addr, +typedef void (*btmce_remote_mas_instances_callback)(bt_status_t status, RawAddress *bd_addr, int num_instances, btmce_mas_instance_t *instances); typedef struct { @@ -46,7 +46,7 @@ typedef struct { bt_status_t (*init)(btmce_callbacks_t *callbacks); /** search for MAS instances on remote device */ - bt_status_t (*get_remote_mas_instances)(bt_bdaddr_t *bd_addr); + bt_status_t (*get_remote_mas_instances)(RawAddress *bd_addr); } btmce_interface_t; __END_DECLS diff --git a/include/hardware/bt_pan.h b/include/hardware/bt_pan.h index 83e7949b..2f2e2e56 100644 --- a/include/hardware/bt_pan.h +++ b/include/hardware/bt_pan.h @@ -39,7 +39,7 @@ typedef enum { * Callback for pan connection state */ typedef void (*btpan_connection_state_callback)(btpan_connection_state_t state, bt_status_t error, - const bt_bdaddr_t *bd_addr, int local_role, int remote_role); + const RawAddress *bd_addr, int local_role, int remote_role); typedef void (*btpan_control_state_callback)(btpan_control_state_t state, int local_role, bt_status_t error, const char* ifname); @@ -69,11 +69,11 @@ typedef struct { * start bluetooth pan connection to the remote device by specified pan role. The result state will be * returned by btpan_connection_state_callback */ - bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, int local_role, int remote_role); + bt_status_t (*connect)(const RawAddress *bd_addr, int local_role, int remote_role); /** * stop bluetooth pan connection. The result state will be returned by btpan_connection_state_callback */ - bt_status_t (*disconnect)(const bt_bdaddr_t *bd_addr); + bt_status_t (*disconnect)(const RawAddress *bd_addr); /** * Cleanup the pan interface diff --git a/include/hardware/bt_rc.h b/include/hardware/bt_rc.h index ee99d911..93fb32f0 100644 --- a/include/hardware/bt_rc.h +++ b/include/hardware/bt_rc.h @@ -287,98 +287,98 @@ typedef struct { } btrc_br_folder_name_t; /** Callback for the controller's supported feautres */ -typedef void (* btrc_remote_features_callback)(bt_bdaddr_t *bd_addr, +typedef void (* btrc_remote_features_callback)(RawAddress *bd_addr, btrc_remote_features_t features); /** Callback for play status request */ -typedef void (* btrc_get_play_status_callback)(bt_bdaddr_t *bd_addr); +typedef void (* btrc_get_play_status_callback)(RawAddress *bd_addr); /** Callback for list player application attributes (Shuffle, Repeat,...) */ -typedef void (* btrc_list_player_app_attr_callback)(bt_bdaddr_t *bd_addr); +typedef void (* btrc_list_player_app_attr_callback)(RawAddress *bd_addr); /** Callback for list player application attributes (Shuffle, Repeat,...) */ typedef void (* btrc_list_player_app_values_callback)(btrc_player_attr_t attr_id, - bt_bdaddr_t *bd_addr); + RawAddress *bd_addr); /** Callback for getting the current player application settings value ** num_attr: specifies the number of attribute ids contained in p_attrs */ typedef void (* btrc_get_player_app_value_callback) (uint8_t num_attr, - btrc_player_attr_t *p_attrs, bt_bdaddr_t *bd_addr); + btrc_player_attr_t *p_attrs, RawAddress *bd_addr); /** Callback for getting the player application settings attributes' text ** num_attr: specifies the number of attribute ids contained in p_attrs */ typedef void (* btrc_get_player_app_attrs_text_callback) (uint8_t num_attr, - btrc_player_attr_t *p_attrs, bt_bdaddr_t *bd_addr); + btrc_player_attr_t *p_attrs, RawAddress *bd_addr); /** Callback for getting the player application settings values' text ** num_attr: specifies the number of value ids contained in p_vals */ typedef void (* btrc_get_player_app_values_text_callback) (uint8_t attr_id, uint8_t num_val, - uint8_t *p_vals, bt_bdaddr_t *bd_addr); + uint8_t *p_vals, RawAddress *bd_addr); /** Callback for setting the player application settings values */ typedef void (* btrc_set_player_app_value_callback) (btrc_player_settings_t *p_vals, - bt_bdaddr_t *bd_addr); + RawAddress *bd_addr); /** Callback to fetch the get element attributes of the current song ** num_attr: specifies the number of attributes requested in p_attrs */ typedef void (* btrc_get_element_attr_callback) (uint8_t num_attr, btrc_media_attr_t *p_attrs, - bt_bdaddr_t *bd_addr); + RawAddress *bd_addr); /** Callback for register notification (Play state change/track change/...) ** param: Is only valid if event_id is BTRC_EVT_PLAY_POS_CHANGED */ typedef void (* btrc_register_notification_callback) (btrc_event_id_t event_id, uint32_t param, - bt_bdaddr_t *bd_addr); + RawAddress *bd_addr); /* AVRCP 1.4 Enhancements */ /** Callback for volume change on CT ** volume: Current volume setting on the CT (0-127) */ -typedef void (* btrc_volume_change_callback) (uint8_t volume, uint8_t ctype, bt_bdaddr_t *bd_addr); +typedef void (* btrc_volume_change_callback) (uint8_t volume, uint8_t ctype, RawAddress *bd_addr); /** Callback for passthrough commands */ -typedef void (* btrc_passthrough_cmd_callback) (int id, int key_state, bt_bdaddr_t *bd_addr); +typedef void (* btrc_passthrough_cmd_callback) (int id, int key_state, RawAddress *bd_addr); /** Callback for set addressed player response on TG **/ -typedef void (* btrc_set_addressed_player_callback) (uint16_t player_id, bt_bdaddr_t *bd_addr); +typedef void (* btrc_set_addressed_player_callback) (uint16_t player_id, RawAddress *bd_addr); /** Callback for set browsed player response on TG **/ -typedef void (* btrc_set_browsed_player_callback) (uint16_t player_id, bt_bdaddr_t *bd_addr); +typedef void (* btrc_set_browsed_player_callback) (uint16_t player_id, RawAddress *bd_addr); /** Callback for get folder items on TG ** num_attr: specifies the number of attributes requested in p_attr_ids */ typedef void (* btrc_get_folder_items_callback) (uint8_t scope, uint32_t start_item, - uint32_t end_item, uint8_t num_attr, uint32_t *p_attr_ids, bt_bdaddr_t *bd_addr); + uint32_t end_item, uint8_t num_attr, uint32_t *p_attr_ids, RawAddress *bd_addr); /** Callback for changing browsed path on TG **/ typedef void (* btrc_change_path_callback) (uint8_t direction, - uint8_t* folder_uid, bt_bdaddr_t *bd_addr); + uint8_t* folder_uid, RawAddress *bd_addr); /** Callback to fetch the get item attributes of the media item ** num_attr: specifies the number of attributes requested in p_attrs */ typedef void (* btrc_get_item_attr_callback) (uint8_t scope, uint8_t* uid, uint16_t uid_counter, - uint8_t num_attr, btrc_media_attr_t *p_attrs, bt_bdaddr_t *bd_addr); + uint8_t num_attr, btrc_media_attr_t *p_attrs, RawAddress *bd_addr); /** Callback for play request for the media item indicated by an identifier */ typedef void (* btrc_play_item_callback) (uint8_t scope, - uint16_t uid_counter, uint8_t* uid, bt_bdaddr_t *bd_addr); + uint16_t uid_counter, uint8_t* uid, RawAddress *bd_addr); /** Callback to fetch total number of items from a folder **/ -typedef void (* btrc_get_total_num_of_items_callback) (uint8_t scope, bt_bdaddr_t *bd_addr); +typedef void (* btrc_get_total_num_of_items_callback) (uint8_t scope, RawAddress *bd_addr); /** Callback for conducting recursive search on a current browsed path for a specified string */ typedef void (* btrc_search_callback) (uint16_t charset_id, - uint16_t str_len, uint8_t* p_str, bt_bdaddr_t *bd_addr); + uint16_t str_len, uint8_t* p_str, RawAddress *bd_addr); /** Callback to add a specified media item indicated by an identifier to now playing queue. */ typedef void (* btrc_add_to_now_playing_callback) (uint8_t scope, - uint8_t* uid, uint16_t uid_counter, bt_bdaddr_t *bd_addr); + uint8_t* uid, uint16_t uid_counter, RawAddress *bd_addr); /** BT-RC Target callback structure. */ typedef struct { @@ -422,45 +422,45 @@ typedef struct { ** 2. Song duration/length ** 3. Song position */ - bt_status_t (*get_play_status_rsp)( bt_bdaddr_t *bd_addr, btrc_play_status_t play_status, + bt_status_t (*get_play_status_rsp)( RawAddress *bd_addr, btrc_play_status_t play_status, uint32_t song_len, uint32_t song_pos); /** Lists the support player application attributes (Shuffle/Repeat/...) ** num_attr: Specifies the number of attributes contained in the pointer p_attrs */ - bt_status_t (*list_player_app_attr_rsp)( bt_bdaddr_t *bd_addr, int num_attr, + bt_status_t (*list_player_app_attr_rsp)( RawAddress *bd_addr, int num_attr, btrc_player_attr_t *p_attrs); /** Lists the support player application attributes (Shuffle Off/On/Group) ** num_val: Specifies the number of values contained in the pointer p_vals */ - bt_status_t (*list_player_app_value_rsp)( bt_bdaddr_t *bd_addr, int num_val, uint8_t *p_vals); + bt_status_t (*list_player_app_value_rsp)( RawAddress *bd_addr, int num_val, uint8_t *p_vals); /** Returns the current application attribute values for each of the specified attr_id */ - bt_status_t (*get_player_app_value_rsp)( bt_bdaddr_t *bd_addr, btrc_player_settings_t *p_vals); + bt_status_t (*get_player_app_value_rsp)( RawAddress *bd_addr, btrc_player_settings_t *p_vals); /** Returns the application attributes text ("Shuffle"/"Repeat"/...) ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs */ - bt_status_t (*get_player_app_attr_text_rsp)( bt_bdaddr_t *bd_addr, int num_attr, + bt_status_t (*get_player_app_attr_text_rsp)( RawAddress *bd_addr, int num_attr, btrc_player_setting_text_t *p_attrs); /** Returns the application attributes text ("Shuffle"/"Repeat"/...) ** num_attr: Specifies the number of attribute values' text contained in the pointer p_vals */ - bt_status_t (*get_player_app_value_text_rsp)( bt_bdaddr_t *bd_addr, int num_val, + bt_status_t (*get_player_app_value_text_rsp)( RawAddress *bd_addr, int num_val, btrc_player_setting_text_t *p_vals); /** Returns the current songs' element attributes text ("Title"/"Album"/"Artist") ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs */ - bt_status_t (*get_element_attr_rsp)( bt_bdaddr_t *bd_addr, uint8_t num_attr, + bt_status_t (*get_element_attr_rsp)( RawAddress *bd_addr, uint8_t num_attr, btrc_element_attr_val_t *p_attrs); /** Response to set player attribute request ("Shuffle"/"Repeat") ** rsp_status: Status of setting the player attributes for the current media player */ - bt_status_t (*set_player_app_value_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status); + bt_status_t (*set_player_app_value_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status); /* Response to the register notification request (Play state change/track change/...). ** event_id: Refers to the event_id this notification change corresponds too @@ -481,89 +481,89 @@ typedef struct { bt_status_t (*set_volume)(uint8_t volume); /* Set addressed player response from TG to CT */ - bt_status_t (*set_addressed_player_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status); + bt_status_t (*set_addressed_player_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status); /* Set browsed player response from TG to CT */ - bt_status_t (*set_browsed_player_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, + bt_status_t (*set_browsed_player_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status, uint32_t num_items, uint16_t charset_id, uint8_t folder_depth, btrc_br_folder_name_t *p_folders); /* Get folder item list response from TG to CT */ - bt_status_t (*get_folder_items_list_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, + bt_status_t (*get_folder_items_list_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status, uint16_t uid_counter, uint8_t num_items, btrc_folder_items_t *p_items); /* Change path response from TG to CT */ - bt_status_t (*change_path_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, + bt_status_t (*change_path_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status, uint32_t num_items); /** Returns the element's attributes num_attr: Specifies the number of attributes' text * contained in the pointer p_attrs */ - bt_status_t (*get_item_attr_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, + bt_status_t (*get_item_attr_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status, uint8_t num_attr, btrc_element_attr_val_t *p_attrs); /* play media item response from TG to CT */ - bt_status_t (*play_item_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status); + bt_status_t (*play_item_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status); /* get total number of items response from TG to CT*/ - bt_status_t (*get_total_num_of_items_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, + bt_status_t (*get_total_num_of_items_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status, uint32_t uid_counter, uint32_t num_items); /* Search VFS response from TG to CT */ - bt_status_t (*search_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, uint32_t uid_counter, + bt_status_t (*search_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status, uint32_t uid_counter, uint32_t num_items); /* add_to_now playing list response from TG to CT */ - bt_status_t (*add_to_now_playing_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status); + bt_status_t (*add_to_now_playing_rsp)(RawAddress *bd_addr, btrc_status_t rsp_status); /** Closes the interface. */ void (*cleanup)( void ); } btrc_interface_t; -typedef void (* btrc_passthrough_rsp_callback) (bt_bdaddr_t *bd_addr, int id, int key_state); +typedef void (* btrc_passthrough_rsp_callback) (RawAddress *bd_addr, int id, int key_state); typedef void (* btrc_groupnavigation_rsp_callback) (int id, int key_state); typedef void (* btrc_connection_state_callback) ( - bool rc_connect, bool bt_connect, bt_bdaddr_t *bd_addr); + bool rc_connect, bool bt_connect, RawAddress *bd_addr); -typedef void (* btrc_ctrl_getrcfeatures_callback) (bt_bdaddr_t *bd_addr, int features); +typedef void (* btrc_ctrl_getrcfeatures_callback) (RawAddress *bd_addr, int features); -typedef void (* btrc_ctrl_setabsvol_cmd_callback) (bt_bdaddr_t *bd_addr, uint8_t abs_vol, uint8_t label); +typedef void (* btrc_ctrl_setabsvol_cmd_callback) (RawAddress *bd_addr, uint8_t abs_vol, uint8_t label); -typedef void (* btrc_ctrl_registernotification_abs_vol_callback) (bt_bdaddr_t *bd_addr, uint8_t label); +typedef void (* btrc_ctrl_registernotification_abs_vol_callback) (RawAddress *bd_addr, uint8_t label); -typedef void (* btrc_ctrl_setplayerapplicationsetting_rsp_callback) (bt_bdaddr_t *bd_addr, +typedef void (* btrc_ctrl_setplayerapplicationsetting_rsp_callback) (RawAddress *bd_addr, uint8_t accepted); -typedef void (* btrc_ctrl_playerapplicationsetting_callback)(bt_bdaddr_t *bd_addr, +typedef void (* btrc_ctrl_playerapplicationsetting_callback)(RawAddress *bd_addr, uint8_t num_attr, btrc_player_app_attr_t *app_attrs, uint8_t num_ext_attr, btrc_player_app_ext_attr_t *ext_attrs); -typedef void (* btrc_ctrl_playerapplicationsetting_changed_callback)(bt_bdaddr_t *bd_addr, +typedef void (* btrc_ctrl_playerapplicationsetting_changed_callback)(RawAddress *bd_addr, btrc_player_settings_t *p_vals); -typedef void (* btrc_ctrl_track_changed_callback)(bt_bdaddr_t *bd_addr, uint8_t num_attr, +typedef void (* btrc_ctrl_track_changed_callback)(RawAddress *bd_addr, uint8_t num_attr, btrc_element_attr_val_t *p_attrs); -typedef void (* btrc_ctrl_play_position_changed_callback)(bt_bdaddr_t *bd_addr, +typedef void (* btrc_ctrl_play_position_changed_callback)(RawAddress *bd_addr, uint32_t song_len, uint32_t song_pos); -typedef void (* btrc_ctrl_play_status_changed_callback)(bt_bdaddr_t *bd_addr, +typedef void (* btrc_ctrl_play_status_changed_callback)(RawAddress *bd_addr, btrc_play_status_t play_status); -typedef void (* btrc_ctrl_get_folder_items_callback )(bt_bdaddr_t *bd_addr, +typedef void (* btrc_ctrl_get_folder_items_callback )(RawAddress *bd_addr, btrc_status_t status, const btrc_folder_items_t *folder_items, uint8_t count); -typedef void (* btrc_ctrl_change_path_callback)(bt_bdaddr_t *bd_addr, uint8_t count); +typedef void (* btrc_ctrl_change_path_callback)(RawAddress *bd_addr, uint8_t count); typedef void (* btrc_ctrl_set_browsed_player_callback )( - bt_bdaddr_t *bd_addr, uint8_t num_items, uint8_t depth); -typedef void (* btrc_ctrl_set_addressed_player_callback)(bt_bdaddr_t *bd_addr, uint8_t status); + RawAddress *bd_addr, uint8_t num_items, uint8_t depth); +typedef void (* btrc_ctrl_set_addressed_player_callback)(RawAddress *bd_addr, uint8_t status); /** BT-RC Controller callback structure. */ typedef struct { /** set to sizeof(BtRcCallbacks) */ @@ -597,47 +597,47 @@ typedef struct { bt_status_t (*init)( btrc_ctrl_callbacks_t* callbacks ); /** send pass through command to target */ - bt_status_t (*send_pass_through_cmd) (bt_bdaddr_t *bd_addr, uint8_t key_code, + bt_status_t (*send_pass_through_cmd) (RawAddress *bd_addr, uint8_t key_code, uint8_t key_state ); /** send group navigation command to target */ - bt_status_t (*send_group_navigation_cmd) (bt_bdaddr_t *bd_addr, uint8_t key_code, + bt_status_t (*send_group_navigation_cmd) (RawAddress *bd_addr, uint8_t key_code, uint8_t key_state ); /** send command to set player applicaiton setting attributes to target */ - bt_status_t (*set_player_app_setting_cmd) (bt_bdaddr_t *bd_addr, uint8_t num_attrib, + bt_status_t (*set_player_app_setting_cmd) (RawAddress *bd_addr, uint8_t num_attrib, uint8_t* attrib_ids, uint8_t* attrib_vals); /** send command to play a particular item */ bt_status_t (*play_item_cmd) ( - bt_bdaddr_t *bd_addr, uint8_t scope, uint8_t *uid, uint16_t uid_counter); + RawAddress *bd_addr, uint8_t scope, uint8_t *uid, uint16_t uid_counter); /** get the playback state */ - bt_status_t (*get_playback_state_cmd) (bt_bdaddr_t *bd_addr); + bt_status_t (*get_playback_state_cmd) (RawAddress *bd_addr); /** get the now playing list */ - bt_status_t (*get_now_playing_list_cmd) (bt_bdaddr_t *bd_addr, uint8_t start, uint8_t items); + bt_status_t (*get_now_playing_list_cmd) (RawAddress *bd_addr, uint8_t start, uint8_t items); /** get the folder list */ - bt_status_t (*get_folder_list_cmd) (bt_bdaddr_t *bd_addr, uint8_t start, uint8_t items); + bt_status_t (*get_folder_list_cmd) (RawAddress *bd_addr, uint8_t start, uint8_t items); /** get the folder list */ - bt_status_t (*get_player_list_cmd) (bt_bdaddr_t *bd_addr, uint8_t start, uint8_t items); + bt_status_t (*get_player_list_cmd) (RawAddress *bd_addr, uint8_t start, uint8_t items); /** get the folder list */ - bt_status_t (*change_folder_path_cmd) (bt_bdaddr_t *bd_addr, uint8_t direction, uint8_t * uid); + bt_status_t (*change_folder_path_cmd) (RawAddress *bd_addr, uint8_t direction, uint8_t * uid); /** set browsed player */ - bt_status_t (*set_browsed_player_cmd) (bt_bdaddr_t *bd_addr, uint16_t player_id); + bt_status_t (*set_browsed_player_cmd) (RawAddress *bd_addr, uint16_t player_id); /** set addressed player */ - bt_status_t (*set_addressed_player_cmd) (bt_bdaddr_t *bd_addr, uint16_t player_id); + bt_status_t (*set_addressed_player_cmd) (RawAddress *bd_addr, uint16_t player_id); /** send rsp to set_abs_vol received from target */ - bt_status_t (*set_volume_rsp) (bt_bdaddr_t *bd_addr, uint8_t abs_vol, uint8_t label); + bt_status_t (*set_volume_rsp) (RawAddress *bd_addr, uint8_t abs_vol, uint8_t label); /** send notificaiton rsp for abs vol to target */ - bt_status_t (*register_abs_vol_rsp) (bt_bdaddr_t *bd_addr, btrc_notification_type_t rsp_type, + bt_status_t (*register_abs_vol_rsp) (RawAddress *bd_addr, btrc_notification_type_t rsp_type, uint8_t abs_vol, uint8_t label); /** Closes the interface. */ diff --git a/include/hardware/bt_sdp.h b/include/hardware/bt_sdp.h index 8f39bc5b..76cb5798 100644 --- a/include/hardware/bt_sdp.h +++ b/include/hardware/bt_sdp.h @@ -109,7 +109,7 @@ typedef union { /** Callback for SDP search */ -typedef void (*btsdp_search_callback)(bt_status_t status, bt_bdaddr_t *bd_addr, uint8_t* uuid, int num_records, bluetooth_sdp_record *records); +typedef void (*btsdp_search_callback)(bt_status_t status, RawAddress *bd_addr, uint8_t* uuid, int num_records, bluetooth_sdp_record *records); typedef struct { /** Set to sizeof(btsdp_callbacks_t) */ @@ -128,7 +128,7 @@ typedef struct { bt_status_t (*deinit)(); /** Search for SDP records with specific uuid on remote device */ - bt_status_t (*sdp_search)(bt_bdaddr_t *bd_addr, const uint8_t* uuid); + bt_status_t (*sdp_search)(RawAddress *bd_addr, const uint8_t* uuid); /** * Use listen in the socket interface to create rfcomm and/or l2cap PSM channels, diff --git a/include/hardware/bt_sock.h b/include/hardware/bt_sock.h index 8d1a9e0f..4c098f1f 100644 --- a/include/hardware/bt_sock.h +++ b/include/hardware/bt_sock.h @@ -33,7 +33,7 @@ typedef enum { /** Represents the standard BT SOCKET interface. */ typedef struct { short size; - bt_bdaddr_t bd_addr; + RawAddress bd_addr; int channel; int status; @@ -68,7 +68,7 @@ typedef struct { * The callingUid is the UID of the application which is requesting the socket. This is * used for traffic accounting purposes. */ - bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, btsock_type_t type, const uint8_t* uuid, + bt_status_t (*connect)(const RawAddress *bd_addr, btsock_type_t type, const uint8_t* uuid, int channel, int* sock_fd, int flags, int callingUid); } btsock_interface_t;