Bluetooth iAP Profile
- group BT_IAP
Provide BT iAP profile interfaces.
Typedefs
-
typedef enum t_bt_iap_identification_info_id T_BT_IAP_IDENTIFICATION_INFO_ID
Define BT iAP identification information id.
-
typedef enum t_bt_iap_transport T_BT_IAP_TRANSPORT
Define BT iAP transport.
-
typedef enum t_bt_iap_eap_session_status T_BT_IAP_EAP_SESSION_STATUS
Define BT iAP External Accessory Protocol session status.
-
typedef enum t_bt_iap_app_launch_method T_BT_IAP_APP_LAUNCH_METHOD
Define BT iAP app launch method.
-
typedef enum t_bt_iap_param_type T_BT_IAP_PARAM_TYPE
Define BT iAP parameter type.
Enums
-
enum t_bt_iap_identification_info_id
Define BT iAP identification information id.
Values:
-
enumerator BT_IAP_ID_NAME
-
enumerator BT_IAP_ID_MODEL_IDENTIFIER
-
enumerator BT_IAP_ID_MANUFACTURER
-
enumerator BT_IAP_ID_SERIAL_NUMBER
-
enumerator BT_IAP_ID_FIRMWARE_VERSION
-
enumerator BT_IAP_ID_HARDWARE_VERSION
-
enumerator BT_IAP_ID_MESSAGES_SENT_BY_ACCESSORY
-
enumerator BT_IAP_ID_MESSAGES_RECEIVED_FROM_DEVICE
-
enumerator BT_IAP_ID_POWER_SOURCETYPE
-
enumerator BT_IAP_ID_MAXIMUM_CURRENT_DRAWN_FROM_DEVICE
-
enumerator BT_IAP_ID_SUPPORTED_EXTERNAL_ACCESSORY_PROTOCOL
-
enumerator BT_IAP_ID_PREFERRED_APP_MATCH_TEAM_ID
-
enumerator BT_IAP_ID_CURRENT_LANGUAGE
-
enumerator BT_IAP_ID_SUPPORTED_LANGUAGE
-
enumerator BT_IAP_ID_SERIAL_TRANSPORT_COMPONENT
-
enumerator BT_IAP_ID_USB_DEVICE_TRANSPORT_COMPONENT
-
enumerator BT_IAP_ID_USB_HOST_TRANSPORT_COMPONENT
-
enumerator BT_IAP_ID_BLUETOOTH_TRANSPORT_COMPONENT
-
enumerator BT_IAP_ID_IAP2_HID_COMPONENT
-
enumerator BT_IAP_ID_USB_HOST_HID_COMPONENT
-
enumerator BT_IAP_ID_PRODUCT_PLAN_UID
-
enumerator BT_IAP_ID_NAME
-
enum t_bt_iap_transport
Define BT iAP transport.
Values:
-
enumerator BT_IAP_TRANSPORT_COMPONENT_IDENTIFIER
-
enumerator BT_IAP_TRANSPORT_COMPONENT_NAME
-
enumerator BT_IAP_TRANSPORT_SUPPORTS_IAP2_CONNECTION
-
enumerator BT_IAP_BLUETOOTH_TRANSPORT_MEDIA_ACCESS_CONTROL_ADDRESS
-
enumerator BT_IAP_TRANSPORT_COMPONENT_IDENTIFIER
-
enum t_bt_iap_eap_session_status
Define BT iAP External Accessory Protocol session status.
Values:
-
enumerator BT_IAP_EAP_SESSION_STATUS_OK
-
enumerator BT_IAP_EAP_SESSION_STATUS_CLOSED
-
enumerator BT_IAP_EAP_SESSION_STATUS_OK
-
enum t_bt_iap_app_launch_method
Define BT iAP app launch method.
Values:
-
enumerator BT_IAP_APP_LAUNCH_WITH_USER_ALERT
-
enumerator BT_IAP_APP_LAUNCH_WITHOUT_USER_ALERT
-
enumerator BT_IAP_APP_LAUNCH_WITH_USER_ALERT
-
enum t_bt_iap_param_type
Define BT iAP parameter type.
Values:
-
enumerator BT_IAP_PARAM_ACC_MAX_PKT_LEN
-
enumerator BT_IAP_PARAM_ACC_RETRANS_TOUT
-
enumerator BT_IAP_PARAM_ACC_CUMULATIVE_ACK_TOUT
-
enumerator BT_IAP_PARAM_ACC_MAX_OUT_PKT_NUM
-
enumerator BT_IAP_PARAM_ACC_MAX_RETRANS_NUM
-
enumerator BT_IAP_PARAM_ACC_MAX_CULUMATIVE_ACK
-
enumerator BT_IAP_PARAM_ACC_START_SEQ_NUM
-
enumerator BT_IAP_PARAM_TX_Q_ELEM_NUM
-
enumerator BT_IAP_PARAM_ACC_MAX_PKT_LEN
Functions
-
bool bt_iap_init(uint8_t rfc_chann_num, P_CP_WRITE_FUNC cp_write, P_CP_READ_FUNC cp_read)
Initialize iAP profile.
- Parameters:
rfc_chann_num – [in] RFCOMM channel number used for iAP.
cp_write – [in] The cp write func.
cp_read – [in] The cp burst read func.
- Return values:
true – iAP profile was initialized successfully.
false – iAP profile was failed to initialize.
- Returns:
The status of initializing iAP profile.
-
bool bt_iap_data_send(uint8_t bd_addr[6], uint16_t session_id, uint8_t *data, uint16_t data_len)
Send iAP data to remote device.
- Parameters:
bd_addr – [in] Remote BT address.
session_id – [in] The session identifier used for sending data.
data – [in] The start address of the data buffer.
data_len – [in] The length of the data.
- Return values:
true – Data was sent successfully.
false – Data was failed to send.
- Returns:
The status of sending data.
-
bool bt_iap_eap_session_status_send(uint8_t bd_addr[6], uint16_t session_id, T_BT_IAP_EAP_SESSION_STATUS status)
Send External Accessory Protocol session status.
- Parameters:
bd_addr – [in] Remote BT address.
session_id – [in] The External Accessory Protocol session identifier.
status – [in] The External Accessory Protocol session status.
- Return values:
true – External Accessory Protocol session status was sent successfully.
false – External Accessory Protocol session status was failed to send.
- Returns:
The result of sending External Accessory Protocol session status.
-
bool bt_iap_app_launch(uint8_t bd_addr[6], char *boundle_id, uint8_t len_boundle_id, T_BT_IAP_APP_LAUNCH_METHOD method)
Send a request to launch specific app which has been installed on the Apple device.
- Parameters:
bd_addr – [in] Remote BT address.
boundle_id – [in] The start address of the AppBundleID buffer.
len_boundle_id – [in] The length of the AppBundleID.
method – [in] APP launch method T_BT_IAP_APP_LAUNCH_METHOD.
- Return values:
true – Request was sent successfully.
false – Request was failed to send.
- Returns:
The status of launching app request.
-
bool bt_iap_connect_req(uint8_t bd_addr[6], uint8_t server_chann, uint16_t frame_size, uint8_t init_credits)
Send an iAP connection request.
- Parameters:
bd_addr – [in] Remote BT address.
server_chann – [in] The remote server_channel which can be found from the SDP info.
frame_size – [in] The maximum frame_size supported by local device.
init_credits – [in] The number of packet that remote can be send. This parameter is used for flow control. A sending entity may send as many frames on an iAP connection as it has credits; if the credit count reaches zero, the sender will stop and wait for further credits from peer.
- Return values:
true – iAP connection request was sent successfully.
false – iAP connection request was failed to send.
- Returns:
The status of sending the iAP connection request.
-
bool bt_iap_connect_cfm(uint8_t bd_addr[6], bool accept, uint16_t frame_size, uint8_t init_credits)
Send an iAP connection confirmation.
- Parameters:
bd_addr – [in] Remote BT address.
accept – [in] Confirmation message.
true Accept the received iAP connection request.
false Reject the received iAP connection request.
frame_size – [in] The maximum frame_size supported by local device.
init_credits – [in] The number of packet that remote can be send. This parameter is used for flow control. A sending entity may send as many frames on an iAP connection as it has credits; if the credit count reaches zero, the sender will stop and wait for further credits from peer.
- Return values:
true – iAP connection confirmation was sent successfully.
false – iAP connection confirmation was failed to send.
- Returns:
The status of sending the iAP connection confirmation.
-
bool bt_iap_disconnect_req(uint8_t bd_addr[6])
Send an iAP disconnection request.
- Parameters:
bd_addr – [in] Remote BT address.
- Return values:
true – iAP disconnection request was sent successfully.
false – iAP disconnection request was failed to send.
- Returns:
The status of sending the iAP disconnection request.
-
uint8_t *bt_iap2_prep_param(uint8_t *param, uint16_t param_id, void *data, uint16_t data_len)
Format the parameter and store in the buffer to be send later.
- Parameters:
param – [in] The start address to store the formatted parameter.
param_id – [in] The parameter ID BT iAP External Protocol, T_BT_IAP_IDENTIFICATION_INFO_ID, T_BT_IAP_TRANSPORT.
data – [in] The parameter data to be formatted.
data_len – [in] Length of the parameter data.
- Returns:
uint8_t * The next address of the buffer which is immediately following the end address of the formatted param.
-
bool bt_iap_ident_info_send(uint8_t bd_addr[6], uint8_t *ident, uint16_t ident_len)
Send identification information.
- Parameters:
bd_addr – [in] Remote BT address.
ident – [in] The start address of the identification information buffer.
ident_len – [in] The length of the identification information.
- Return values:
true – Data was sent successfully.
false – Data was failed to send.
- Returns:
The status of sending identification information.
-
bool bt_iap_param_set(T_BT_IAP_PARAM_TYPE type, uint8_t len, void *value)
Set local iAP parameter.
- Parameters:
type – [in] Parameter type.
len – [in] The length of parameter value.
value – [in] The start address of the parameter value buffer.
- Return values:
true – The parameter was set successfully.
false – The parameter was failed to set.
- Returns:
The result of setting local iAP parameter.
-
bool bt_iap_ack_send(uint8_t bd_addr[6], uint8_t ack_seq)
Send an acknowledge for a specific received packet.
- Parameters:
bd_addr – [in] Remote BT address.
ack_seq – [in] The seq number which can be found from the packet to be acknowledged.
- Return values:
true – The acknowledge was sent successfully.
false – The acknowledge was failed to send.
- Returns:
The result of sending acknowledge.
-
bool bt_iap_comp_info_send(uint8_t bd_addr[6], uint16_t comp_id, bool enable)
Send Bluetooth component information to remote device.
- Parameters:
bd_addr – [in] Remote BT address.
comp_id – [in] The component identifier.
enable – [in] True if the Bluetooth component is ready for connections to the device.
- Return values:
true – The component information was sent successfully.
false – The component information was failed to send.
- Returns:
The result of sending component information.
-
bool bt_iap_conn_update_start(uint8_t bd_addr[6], uint16_t comp_id)
Send bluetooth connection update start message to remote device.
- Parameters:
bd_addr – [in] Remote BT address.
comp_id – [in] The component identifier.
- Return values:
true – The message was sent successfully.
false – The message was failed to send.
- Returns:
The result of sending bluetooth connection update start message.
-
bool bt_iap_comm_update_start(uint8_t bd_addr[6], uint16_t param_id)
Send communications updates start message to remote device.
- Parameters:
bd_addr – [in] Remote BT address.
param_id – [in] The communications sub-features identifier.
- Return values:
true – The message was sent successfully.
false – The message was failed to send.
- Returns:
The result of sending communications updates start message.
-
bool bt_iap_mute_status_update(uint8_t bd_addr[6], bool status)
Send mute status message to remote device.
- Parameters:
bd_addr – [in] Remote BT address.
status – [in] The current mute status of local device.
- Return values:
true – The message was sent successfully.
false – The message was failed to send.
- Returns:
The result of sending mute status message.
-
bool bt_iap_send_cmd(uint8_t bd_addr[6], uint16_t msg_type, uint8_t *param, uint16_t param_len)
Send iAP message to remote device.
- Parameters:
bd_addr – [in] Remote BT address.
msg_type – [in] The message type.
param – [in] The start address of the parameter buffer.
param_len – [in] The param length.
- Return values:
true – The message was sent successfully.
false – The message was failed to send.
- Returns:
The result of sending iAP message.
-
bool bt_iap_hid_start(uint8_t bd_addr[6], uint16_t hid_component_id, uint16_t vid, uint16_t pid, uint8_t *hid_report_desc, uint16_t hid_report_desc_len)
Send a request to start using a HID report descriptor over iAP control session.
- Parameters:
bd_addr – [in] Remote BT address.
hid_component_id – [in] HID component identifier.
vid – [in] HID vender identifier.
pid – [in] HID product identifier.
hid_report_desc – [in] The start address of report descriptor buffer.
hid_report_desc_len – [in] The length of report descriptor.
- Return values:
true – The request was sent successfully.
false – The request was failed to send.
- Returns:
The status of sending request.
-
bool bt_iap_hid_report_send(uint8_t bd_addr[6], uint16_t hid_component_id, uint8_t *hid_report, uint16_t hid_report_len)
Send an HID report message.
- Parameters:
bd_addr – [in] Remote BT address.
hid_component_id – [in] HID component identifier.
hid_report – [in] The start address of report data buffer.
hid_report_len – [in] The length of report data.
- Return values:
true – The report data was sent successfully.
false – The report data was failed to send.
- Returns:
The status of sending report.
-
bool bt_iap_hid_stop(uint8_t bd_addr[6], uint16_t hid_component_id)
Send a request to stop using a HID.
- Parameters:
bd_addr – [in] Remote BT address.
hid_component_id – [in] HID component identifier.
- Return values:
true – The request was sent successfully.
false – The request was failed to send.
- Returns:
The status of sending request.
-
typedef enum t_bt_iap_identification_info_id T_BT_IAP_IDENTIFICATION_INFO_ID