2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef _BLUETOOTH_API_H_
19 #define _BLUETOOTH_API_H_
30 #endif /* __cplusplus */
33 * @defgroup BLUETOOTHFW BluetoothFW
35 * A base library for bluetooth framework
37 * @addtogroup BLUETOOTHFW
41 #define BLUETOOTH_ADDRESS_STRING_LENGTH 18 /**< This specifies bluetooth device address length (AA:BB:CC:DD:EE:FF) */
42 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
43 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
44 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
45 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
46 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
47 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
48 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
49 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
50 #define BLUETOOTH_APPEARANCE_LENGTH 2 /**< This specifies bluetooth device appearance characteristic length */
52 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
53 a device can support */
55 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
57 #define BLUETOOTH_UUID_STRING_MAX 50
58 #define BLUETOOTH_PATH_STRING 50
60 #define BLUETOOTH_OOB_DATA_LENGTH 16
62 #define BLUETOOTH_LE_OOB_DATA_LENGTH 100
64 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
66 #define BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX 610 /**< GATT ATT value max len */
69 * This is Bluetooth Connected event role
71 #define RFCOMM_ROLE_SERVER 1
72 #define RFCOMM_ROLE_CLIENT 2
75 * This is RFCOMM default Channel Value
77 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
78 #define RFCOMM_ROBOT_PROFILE_CHANNEL 22
81 * This is L2cap LE Socket Connected event role
83 #define L2CAP_LE_ROLE_SERVER 1
84 #define L2CAP_LE_ROLE_CLIENT 2
87 * This is maximum length for search value string for PBAP Phonebook Search
89 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
92 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
95 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
96 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
99 * < This defines the maximum size of OTP server directory name
101 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
103 #define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH 500 /**< OTP Characteristics Value Max length */
106 * This is Bluetooth error code
108 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
110 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
111 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
113 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
114 /**< Callback error */
115 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
116 /**< invalid paramerror */
117 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
118 /**< invalid data error */
119 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
120 /**< Memory allocation error */
121 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
122 /**< out of memory error */
123 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
124 /**< timeout error */
125 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
126 /**< No resource error */
127 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
128 /**< internal error */
129 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
130 /**< Not supported error */
131 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
132 /**< Operation is failed because
133 of not enabled BT Adapter */
134 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
135 /**< Enabling is failed because of
136 already enabled BT Adapter */
137 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
138 /**< Operation is failed because of
139 other on going operation */
140 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
141 /**< access denied error */
142 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
143 /**< max client error */
144 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
145 /**< not found error */
146 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
147 /**< service search fail */
148 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
149 /**< pairing failed error */
150 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
151 /**< Not paired error */
152 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
153 /**< no service error */
154 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
155 /**< no connection error */
156 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
157 /**< alread connected error */
158 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
159 /**< connection busy error */
160 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
161 /**< connection error */
162 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
163 /**< max connection error*/
164 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
165 /**< Not in operation */
166 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
167 /**< Cancelled by user */
168 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
169 /**< Service record registration failed */
170 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
171 /**< Operation in progress */
172 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
173 /**< authentication failed error when paring*/
174 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
175 /**< Remote host is down */
176 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
177 /**< End of device list */
179 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
180 /**< Obex agent already exists */
181 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
182 /**< Obex agent does not exist */
184 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
185 /**< Already initialized */
187 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
188 /**< Permission deined */
190 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
191 /**< Nap already done */
193 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
194 /**< Not initialized */
196 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
197 /**< Authentication rejected */
199 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
200 /**< Device Policy Restricted */
202 #define BLUETOOTH_ERROR_NO_DATA ((int)BLUETOOTH_ERROR_BASE - 0x29)
205 #define BLUETOOTH_ERROR_AUTHORIZATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x2a)
206 /**< Authorization rejected */
209 * Error codes for ATT Error response *
211 #define BLUETOOTH_ATT_ERROR_INTERNAL -1
212 #define BLUETOOTH_ATT_ERROR_NONE 0x00
213 #define BLUETOOTH_ATT_ERROR_INVALID_HANDLE 0x01
214 #define BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED 0x02
215 #define BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED 0x03
216 #define BLUETOOTH_ATT_ERROR_INVALID_PDU 0x04
217 #define BLUETOOTH_ATT_ERROR_AUTHENTICATION 0x05
218 #define BLUETOOTH_ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06
219 #define BLUETOOTH_ATT_ERROR_INVALID_OFFSET 0x07
220 #define BLUETOOTH_ATT_ERROR_AUTHORIZATION 0x08
221 #define BLUETOOTH_ATT_ERROR_PREPARE_QUEUE_FULL 0x09
222 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0A
223 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0B
224 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0C
225 #define BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN 0x0D
226 #define BLUETOOTH_ATT_ERROR_UNLIKELY 0x0E
227 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0F
228 #define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10
229 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
230 /* Common profile error codes */
231 #define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED 0xFC
232 #define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED 0xFD
233 #define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS 0xFE
234 #define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE 0xFF
237 * Bluetooth ATT error codes specific to OTP
239 #define BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED 0x80
240 #define BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED 0x81
241 #define BLUETOOTH_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
242 #define BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS 0x83
245 * Bluetooth OTP error codes
246 * TODO: Check error code conflict
248 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
249 #define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
252 * Device disconnection reasons; received from stack
254 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
255 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
256 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
257 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
258 #define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e
259 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
260 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
261 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
262 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
263 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
264 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
265 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
266 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
267 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
268 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
269 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
272 * Device disconnect reason
275 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
276 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
277 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
278 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
279 } bluetooth_device_disconnect_reason_t;
282 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
285 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
286 } bluetooth_device_address_t;
289 * This is Bluetooth device address type
292 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
293 BLUETOOTH_DEVICE_RANDOM_ADDRESS
294 } bluetooth_device_address_type_t;
297 * This is BD Address type defined in kernel BT header
300 BLUETOOTH_BDADDR_BREDR = 0x00,
301 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
302 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
303 } bluetooth_bdaddr_type_e;
306 * This is Bluetooth version
309 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
310 } bluetooth_version_t;
313 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
316 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
317 } bluetooth_device_name_t;
320 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
323 int data_len; /**< manafacturer specific data length */
324 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
325 } bluetooth_manufacturer_data_t;
328 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
329 } bluetooth_device_pin_code_t;
332 * This is data for battery usage monitoring
336 time_t session_start_time;
337 time_t session_end_time;
341 uint32_t session_connected_time;
342 uint32_t session_scan_time;
352 } bt_battery_app_data;
358 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
359 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
360 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
361 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
362 } bluetooth_adapter_state_t;
368 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
369 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
370 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
371 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
372 } bluetooth_adapter_le_state_t;
378 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
379 /*Changed the order to make it compatable with old method */
380 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
381 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
382 /**< Discoverable mode with time limit
383 After specific timeout, it is changed
384 to non discoverable mode */
385 } bluetooth_discoverable_mode_t;
388 * Network connect mode
391 BLUETOOTH_NETWORK_PANU_ROLE,
393 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
394 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
395 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
396 } bluetooth_network_role_t;
400 * Service type matched to bt_profile_type_t of bt-service-common.h
403 BLUETOOTH_RFCOMM_SERVICE = 0x01,
404 BLUETOOTH_A2DP_SERVICE = 0x02,
405 BLUETOOTH_HSP_SERVICE = 0x04,
406 BLUETOOTH_HID_SERVICE = 0x08,
407 BLUETOOTH_NAP_SERVICE = 0x10,
408 BLUETOOTH_HFG_SERVICE = 0x20,
409 BLUETOOTH_GATT_SERVICE = 0x40,
410 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
411 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
412 BLUETOOTH_PBAP_SERVICE = 0x200,
413 } bluetooth_service_type_t;
419 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
420 /* represents that connection
421 * type can both BR/EDR and LE */
422 BLUETOOTH_DEV_CONN_BREDR = 0x00,
423 BLUETOOTH_DEV_CONN_LE = 0x01,
424 } bluetooth_conn_type_t;
430 BLUETOOTH_CODEC_ID_CVSD = 0x01,
431 BLUETOOTH_CODEC_ID_MSBC = 0x02,
432 } bluetooth_codec_type_t;
438 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
439 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
440 } bluetooth_hf_audio_connected_type_t;
446 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
447 } bluetooth_advertising_data_t;
453 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
454 } bluetooth_scan_resp_data_t;
457 * Advertising filter policy
460 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
461 BLUETOOTH_ALLOW_CONN_ALL_SCAN_ALLOW_LIST = 0x01,
462 BLUETOOTH_ALLOW_SCAN_ALL_CONN_ALLOW_LIST = 0x02,
463 BLUETOOTH_ALLOW_SCAN_CONN_ALLOW_LIST = 0x03,
464 } bluetooth_advertising_filter_policy_t;
470 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
471 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
472 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
473 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
474 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
475 } bluetooth_advertising_type_t;
478 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
479 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
480 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_RESYNC = 0x03,
481 } bluetooth_gatt_service_change_type_t;
484 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
485 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
486 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
487 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
488 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
489 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
490 } bt_gatt_permission_t;
493 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
494 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
495 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
496 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
497 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
498 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
499 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
500 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
501 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
502 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
503 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
504 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
505 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
506 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
507 } bt_gatt_characteristic_property_t;
510 * Remote device request types for attributes
513 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
514 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
515 } bluetooth_gatt_att_request_tyep_t;
518 * Proximity Property Type
521 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
522 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
523 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
524 } bluetooth_pxp_poperty_t;
530 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
531 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
532 BLUETOOTH_TDS_TRANSPORT_WIFI_NAN, /* Wi-Fi Alliance Neighbor Awareness Networking */
533 BLUETOOTH_TDS_TRANSPORT_WIFI_SVC_ADV, /* Wi-Fi Alliance Service Advertisement */
535 BLUETOOTH_TDS_TRANSPORT_INVALID
536 } bluetooth_tds_transport_t;
539 * TDS transport state
542 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
543 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
544 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
545 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
546 } bluetooth_tds_transport_state_t;
553 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
554 } bluetooth_tds_data_t;
557 * TDS activation request
560 bluetooth_device_address_t rem_addr;
561 bluetooth_tds_transport_t transport;
562 bluetooth_tds_data_t tds_data;
563 } bluetooth_tds_activation_req_t;
566 * TDS Control Point data
569 int length; /**< Control point data length */
570 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
571 } bluetooth_control_point_data_t;
574 * TDS Indication Response data
577 bluetooth_device_address_t rem_addr; /**< Device address */
578 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
579 } bluetooth_tds_indication_res_t;
582 * Structure to hold the TDS Complete data information which is read from remote TDS provider
585 bluetooth_device_address_t device_address; /**< Device address */
586 int data_length; /**< Data length */
587 char *data; /**< Complete Transport Specific data */
588 } bluetooth_tds_transport_data_info_t;
591 * OTP Characteristics Value
594 int length; /**< Characteristics value length */
595 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
596 } bluetooth_otp_charc_data_t;
599 * Structure to hold the OTP response data from remote OTP server
602 char *handle; /**< Handle */
603 int data_length; /**< Data length */
604 char *data; /**< Read data */
605 } bluetooth_otp_resp_info_t;
608 * Structure to hold the OTC Channel Info
611 gboolean connected; /**< Connection Status */
613 char *address; /**< Remote address */
614 } bluetooth_otc_info_t;
617 * Advertising parameters
622 guint8 filter_policy;
625 } bluetooth_advertising_params_t;
631 int type; /**< passive 0, active 1 */
632 float interval; /**< LE scan interval */
633 float window; /**< LE scan window */
634 } bluetooth_le_scan_params_t;
640 BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
641 BLUETOOTH_LE_ACTIVE_SCAN
642 } bluetooth_le_scan_type_t;
652 } bluetooth_le_connection_param_t;
655 LE Read Maximum Data Length
658 guint16 max_tx_octets;
660 guint16 max_rx_octets;
662 } bluetooth_le_read_maximum_data_length_t;
665 LE Read Host suggested default Data Length
668 guint16 def_tx_octets;
670 } bluetooth_le_read_host_suggested_data_length_t;
673 * Samsung XSAT Vendor dependent command
678 } bluetooth_vendor_dep_at_cmd_t;
684 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
685 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
686 } bluetooth_opp_transfer_type_t;
691 } bluetooth_hf_ciev_device_event_t;
693 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
694 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
695 /**< Base ID for GAP Event */
696 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
697 /**< Base ID for SDP events */
698 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
699 /**< Base ID for RFCOMM events */
700 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
701 /**< Base ID for NETWORK events */
702 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
703 /**< Base ID for HDP events */
704 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
705 /**< Base ID for OPC events */
706 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
707 /**< Base ID for Obex Server events */
708 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
709 /**< Base ID for GATT events */
711 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
712 /**< Base ID for Audio events */
713 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
714 /**< Base ID for HID events */
715 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
716 /**< Base ID for Advertising events */
717 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
718 /**< Base ID for PBAP Client events */
719 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
720 /**< Base ID for AVRCP events */
721 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
722 /**< Base ID for IPSP events */
723 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
724 /**< Base ID for MAP events */
725 #define BLUETOOTH_EVENT_MESH_BASE ((int)(BLUETOOTH_EVENT_MAP_BASE + 0x0020))
726 /**< Base ID for MAP events */
727 #define BLUETOOTH_EVENT_L2CAP_LE_BASE ((int)(BLUETOOTH_EVENT_MESH_BASE + 0x0040))
728 /**< Base ID for L2CAP_LE events */
731 * Bluetooth event type
734 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
736 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
737 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
738 BLUETOOTH_EVENT_DISABLED_BATTERY_DATA, /**< Bluetooth event adapter disabled battery data*/
739 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
740 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
741 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
742 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
743 /**< Bluetooth event Discoverable timeout requested*/
744 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
745 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
746 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
747 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
748 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
749 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
750 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
751 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
752 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
753 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
754 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
755 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
756 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
757 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
758 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
759 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
760 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
761 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
762 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
763 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
764 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
766 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
767 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
768 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
769 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
770 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
772 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
773 /**< Bluetooth event serice search base id */
774 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
775 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
776 /**< RFCOMM data receive event */
777 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
778 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
780 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
782 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
783 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
785 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
787 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
788 /**< Bluetooth Network event */
789 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
790 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
791 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
792 /**< Network disconnected evnet in server */
794 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
795 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
797 BLUETOOTH_EVENT_HDP_CONNECTED
798 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
799 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
800 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
802 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
803 /* OPC Connected event */
804 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
805 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
806 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
807 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
809 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
810 BLUETOOTH_EVENT_MAP_DISCONNECTED,
812 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
813 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
814 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
815 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
816 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
818 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
819 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
820 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
821 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
822 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
823 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
824 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
825 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
826 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
827 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
828 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
829 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
830 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
832 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
833 /* Obex server authorize event*/
834 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
835 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
836 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
837 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
838 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
839 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
841 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
842 /**<Discovered GATT service characteristics event*/
843 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
844 /**<Remote GATT charateristic value changed event*/
845 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
846 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
847 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
848 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
849 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
850 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
851 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
852 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
853 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
854 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
855 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
856 BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
857 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
858 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
859 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
860 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
861 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
862 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
863 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
864 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
865 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
866 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
867 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
868 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
869 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
870 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
871 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
872 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
873 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
874 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
875 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
876 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
877 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
878 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
879 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
880 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
881 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
882 BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
883 BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
884 BLUETOOTH_EVENT_HF_CONNECTED,
885 BLUETOOTH_EVENT_HF_DISCONNECTED,
886 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
887 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
888 BLUETOOTH_EVENT_HF_RING_INDICATOR,
889 BLUETOOTH_EVENT_HF_CALL_WAITING,
890 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
891 BLUETOOTH_EVENT_HF_CALL_STARTED,
892 BLUETOOTH_EVENT_HF_CALL_ENDED,
893 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
894 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
895 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
896 BLUETOOTH_EVENT_HF_CALL_STATUS,
897 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
898 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
899 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
900 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
901 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
902 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
903 BLUETOOTH_EVENT_HF_CALL_IDLE,
904 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
905 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
906 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
907 BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
909 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
910 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
911 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
912 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
913 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
915 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
916 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
917 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
918 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
919 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
920 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
921 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
922 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
924 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
925 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
926 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
927 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
928 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
929 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
930 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
932 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
933 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
934 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
935 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
936 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
937 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
938 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
939 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
940 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
942 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
943 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
944 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
945 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
946 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
947 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
948 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
949 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
950 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
951 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
952 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
954 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
955 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
956 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
957 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
958 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
959 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
960 BLUETOOTH_EVENT_MESH_SCAN_STARTED = BLUETOOTH_EVENT_MESH_BASE,
961 BLUETOOTH_EVENT_MESH_SCAN_FINISHED,
962 BLUETOOTH_EVENT_MESH_SCAN_RESULT,
963 BLUETOOTH_EVENT_MESH_AUTHENTICATION_REQUEST,
964 BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED,
965 BLUETOOTH_EVENT_MESH_NODE_BROWSED,
966 BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES,
967 BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
968 BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED,
969 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
970 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST,
971 BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
972 BLUETOOTH_EVENT_MESH_MODEL_MSG_RECEIVED,
973 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST,
974 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED,
975 BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED,
976 BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
977 BLUETOOTH_EVENT_MESH_JOIN_COMPLETED,
978 BLUETOOTH_EVENT_L2CAP_LE_DATA_RECEIVED = BLUETOOTH_EVENT_L2CAP_LE_BASE,
979 /**< L2CAP_LE data receive event */
980 BLUETOOTH_EVENT_L2CAP_LE_CONNECTED, /**< L2CAP_LE server/client connect */
981 BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED, /**< L2CAP_LE server/client disconnect */
982 BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE,
983 BLUETOOTH_EVENT_L2CAP_LE_SERVER_REMOVED
984 } bluetooth_event_type_t;
987 * This bt_service_uuid_list_t enum indicates service uuid list .
988 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
992 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
993 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
994 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
995 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
996 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
997 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
998 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
999 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
1000 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
1001 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
1002 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
1003 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
1004 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
1006 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
1007 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
1008 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
1009 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
1010 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
1011 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
1012 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
1013 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
1014 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
1015 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
1016 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
1017 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
1018 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
1019 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
1021 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
1022 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
1023 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
1024 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
1025 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
1026 /**<DIRECT PRINTING*/
1027 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
1028 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
1029 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
1030 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
1031 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
1032 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
1033 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
1034 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
1035 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
1036 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
1037 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
1038 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
1039 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
1040 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
1041 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
1042 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
1043 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
1044 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
1045 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
1046 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
1047 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
1048 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
1049 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
1050 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
1051 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
1052 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
1053 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
1054 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
1055 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
1056 } bluetooth_service_uuid_list_t;
1059 * Service class part of class of device returned from device discovery
1062 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1063 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1064 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1065 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1066 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1067 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1068 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1069 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1070 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1071 } bluetooth_device_service_class_t;
1075 * Major device mask (For device discovery)
1078 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1079 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1080 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1081 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1082 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1083 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1084 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1085 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1086 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1087 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1088 } bluetooth_device_major_mask_t;
1092 * Major device class (part of Class of Device)
1095 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1096 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1097 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1098 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1099 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1100 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1101 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1102 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1103 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1104 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1105 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1106 } bluetooth_device_major_class_t;
1109 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1111 /* About Computer Major class */
1112 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1114 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1115 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1116 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1117 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1118 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1120 /* About Phone Major class */
1121 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1122 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1123 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1124 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1125 /**< voice gateway minor class */
1126 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1128 /* About LAN/Network Access Point Major class */
1129 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1130 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1131 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1132 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1133 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1134 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1135 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1136 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1138 /* About Audio/Video Major class */
1139 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1140 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1142 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1143 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1144 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1145 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1146 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1147 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1149 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1150 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1151 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1153 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1154 /**< Video Display and Loud
1155 Speaker minor class */
1156 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1159 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1161 /* About Peripheral Major class */
1162 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1163 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1164 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1165 /**< Combo Keyboard or pointing
1166 device minorclass */
1168 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1169 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1170 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1171 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1172 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1173 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1174 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1175 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1176 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1178 /* About Imaging Major class */
1179 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1180 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1181 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1182 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1184 /* About Wearable Major class */
1185 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1186 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1187 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1188 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1189 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1191 /* About Toy Major class */
1192 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1193 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1194 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1195 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1196 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1198 /* About Health Major class */
1199 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1200 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1201 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1202 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1203 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1204 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1205 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1206 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1207 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1208 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1209 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1210 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1211 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1212 } bluetooth_device_minor_class_t;
1215 * structure to hold the device information
1218 bluetooth_device_major_class_t major_class; /**< major device class */
1219 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1220 bluetooth_device_service_class_t service_class;
1221 /**< service device class */
1222 } bluetooth_device_class_t;
1225 * Discovery Role types
1228 DISCOVERY_ROLE_BREDR = 0x1,
1230 DISCOVERY_ROLE_LE_BREDR
1231 } bt_discovery_role_type_t;
1234 * Connected state types
1237 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1238 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1239 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1240 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1241 } bluetooth_connected_link_t;
1247 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1248 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1249 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1250 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1251 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1252 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1253 BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80, /**< rssi high threshold */
1254 } bluetooth_le_scan_filter_feature_t;
1257 * LE connection mode
1260 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1261 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1262 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1263 } bluetooth_le_connection_mode_t;
1266 * structure to hold the device information
1269 bluetooth_device_address_t device_address; /**< device address */
1270 bluetooth_device_name_t device_name; /**< device name */
1271 bluetooth_device_class_t device_class; /**< device class */
1272 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1273 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1275 int rssi; /**< received strength signal*/
1276 gboolean paired; /**< paired flag */
1277 bluetooth_connected_link_t connected; /**< connected link type */
1278 gboolean trust; /**< trust flag */
1279 gboolean is_alias_set; /** is device alias set flag**/
1280 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1281 } bluetooth_device_info_t;
1284 * structure to hold the LE device information
1287 int data_len; /**< manafacturer specific data length */
1288 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1289 } bluetooth_le_advertising_data_t;
1292 bluetooth_device_address_t device_address; /**< device address */
1293 int addr_type; /**< address type*/
1294 int rssi; /**< received strength signal*/
1295 bluetooth_le_advertising_data_t adv_ind_data;
1296 bluetooth_le_advertising_data_t scan_resp_data;
1297 } bluetooth_le_device_info_t;
1301 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1302 bluetooth_device_address_t device_address; /**< device address */
1303 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1304 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1305 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1306 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1307 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1308 bluetooth_le_advertising_data_t service_data; /**< service data */
1309 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1310 int manufacturer_id; /**< manufacturer ID */
1311 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1312 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1313 int rssi_high_threshold; /**< rssi high threshold */
1314 } bluetooth_le_scan_filter_t;
1317 bluetooth_device_address_t device_address; /**< device address */
1318 unsigned int mtu; /** < MTU set for the ATT connection */
1319 unsigned int status; /** < status of the MTU exchange */
1320 } bluetooth_le_att_mtu_info_t;
1323 * structure to hold the paired device information
1326 bluetooth_device_address_t device_address; /**< paired device address */
1327 bluetooth_device_name_t device_name; /**< device name */
1328 bluetooth_device_class_t device_class; /**< device class */
1329 } bluetooth_paired_device_info_t;
1332 * structure to hold the paired device information
1335 bluetooth_device_address_t device_address;
1336 /**< device address */
1337 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1338 /**< network interface name */
1339 } bluetooth_network_device_info_t;
1342 * Authentication event types
1346 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1347 BLUETOOTH_AUTH_PIN_REQUEST,
1348 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1349 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1350 } bluetooth_auth_type_t;
1353 * structure to hold the pincode/pass-key req informations
1356 bluetooth_device_address_t device_address; /**< remote device address */
1357 bluetooth_device_name_t device_name; /**< device name */
1358 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1359 bool incoming; /**< stores if bonding request is incoming */
1360 } bluetooth_authentication_request_info_t;
1363 * Stucture to hold discovery option
1366 unsigned short max_response; /**< the number of maximum response */
1367 unsigned short discovery_duration;
1368 /**< duration of discovery (seconds) */
1369 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1370 classOfDevice variable */
1371 } bluetooth_discovery_option_t;
1374 * Stucture to hold event information
1377 int event; /**< event type */
1378 int result; /**< Success or error value */
1380 /**<parameter data pointer */
1382 } bluetooth_event_param_t;
1385 bluetooth_device_address_t device_addr;
1386 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1387 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1388 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1393 bluetooth_device_address_t device_addr;
1394 unsigned char addr_type;
1397 } bt_connection_info_t;
1400 * Stucture to rfcomm receive data
1405 /**< the socket fd */
1406 int buffer_size;/**< the length of the receive buffer */
1408 /**< the receive data buffer */
1409 } bluetooth_rfcomm_received_data_t;
1412 * Stucture to l2cap_le receive data
1415 int socket_fd; /**< the socket fd */
1416 int buffer_size; /**< the length of the receive buffer */
1417 char *buffer; /**< the receive data buffer */
1418 } bluetooth_l2cap_le_received_data_t;
1424 HTYPE_TRANS_HANDSHAKE,
1425 HTYPE_TRANS_HID_CONTROL,
1426 HTYPE_TRANS_GET_REPORT,
1427 HTYPE_TRANS_SET_REPORT,
1428 HTYPE_TRANS_GET_PROTOCOL,
1429 HTYPE_TRANS_SET_PROTOCOL,
1431 HTYPE_TRANS_UNKNOWN,
1432 HTYPE_TRANS_GET_IDLE = 0xF0,
1433 HTYPE_TRANS_SET_IDLE = 0xF1,
1434 } bt_hid_header_type_t;
1440 PTYPE_DATA_RTYPE_INPUT,
1441 PTYPE_DATA_RTYPE_OUTPUT
1442 } bt_hid_param_type_t;
1445 * Stucture to hid receive data
1448 const char *address;
1449 bt_hid_header_type_t type;
1450 /**< Header type containing */
1451 bt_hid_param_type_t param;
1452 /**< Param type in header like INPUT Report or OutPut Report */
1453 int buffer_size;/**< the length of the receive buffer */
1455 /**< the receive data buffer */
1456 } bluetooth_hid_received_data_t;
1459 * Stucture to rfcomm connection
1463 int socket_fd; /**< the socket fd */
1464 int server_id; /* Server id */
1465 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1466 bluetooth_device_address_t device_addr;
1467 /**< device address */
1468 char uuid[BLUETOOTH_UUID_STRING_MAX];
1469 } bluetooth_rfcomm_connection_t;
1472 * Stucture to rfcomm disconnection
1476 /**< the socket fd */
1477 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1478 bluetooth_device_address_t device_addr;
1479 /**< device address */
1480 char uuid[BLUETOOTH_UUID_STRING_MAX];
1481 } bluetooth_rfcomm_disconnection_t;
1485 /**< the socket fd */
1486 bluetooth_device_address_t device_addr;
1487 /**< device address */
1488 } bluetooth_rfcomm_connection_request_t;
1491 * Stucture to l2cap_le connection
1494 int socket_fd; /**< the socket fd */
1495 int server_id; /* Server id */
1496 int device_role; /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1497 bluetooth_device_address_t device_addr; /**< device address */
1499 } bluetooth_l2cap_le_connection_t;
1502 * Stucture to l2cap_le disconnection
1505 int socket_fd; /**< the socket fd */
1507 /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1508 bluetooth_device_address_t device_addr; /**< device address */
1510 } bluetooth_l2cap_le_disconnection_t;
1513 * Stucture to l2cap_le connection request
1516 int socket_fd; /**< the socket fd */
1517 bluetooth_device_address_t device_addr; /**< device address */
1518 } bluetooth_l2cap_le_connection_request_t;
1527 } bt_hdp_qos_type_t;
1533 HDP_ROLE_SOURCE = 0x0,
1535 } bt_hdp_role_type_t;
1539 * Stucture to HDP connected
1542 const char *app_handle; /**< the application handle */
1543 unsigned int channel_id; /**< the channel id */
1544 bt_hdp_qos_type_t type; /**< the QOS type */
1545 bluetooth_device_address_t device_address; /**< the remote address */
1546 } bt_hdp_connected_t;
1549 * Stucture to HDP disconnected
1552 unsigned int channel_id; /**< the channel id */
1553 bluetooth_device_address_t device_address; /**< the remote address */
1554 } bt_hdp_disconnected_t;
1557 * Stucture to HDP data indication
1560 unsigned int channel_id; /**< the channel id */
1561 const char *buffer; /**< the RX data buffer */
1562 unsigned int size; /**< the RX data size */
1563 } bt_hdp_data_ind_t;
1566 * Stucture to OPP client transfer information
1573 } bt_opc_transfer_info_t;
1575 /* TODO: MAP client structures, see above */
1577 * Stucture to Map filter fields
1582 } bt_map_list_filter_fields_info_t;
1584 /* Obex Server transfer type */
1585 #define TRANSFER_PUT "PUT"
1586 #define TRANSFER_GET "GET"
1588 * Stucture to OPP/FTP Server authorize information
1595 } bt_obex_server_authorize_into_t;
1603 } bt_obex_server_type_t;
1606 * Stucture to OPP/FTP server transfer information
1614 unsigned long file_size;
1616 bt_obex_server_type_t server_type;
1618 unsigned char *contact_auth_info;
1619 } bt_obex_server_transfer_info_t;
1622 * Stucture to OPP/FTP server connection/disconnection information
1628 } bt_obex_server_connection_info_t;
1632 * Stucture to OOB data
1636 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1637 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1638 unsigned int hash_len;
1639 unsigned int randomizer_len;
1641 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1642 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1643 unsigned int hash256_len;
1644 unsigned int randomizer256_len;
1646 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1647 unsigned int eir_len;
1651 * Structure to GATT attribute handle data
1657 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1658 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1659 } bt_gatt_handle_info_t;
1662 * Structure to a most basic GATT attribute handle data
1666 unsigned char uuid[16];
1667 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1668 } bt_gatt_handle_property_t;
1671 * Structure to GATT Remote service data
1678 bt_gatt_handle_info_t include_handles;
1679 bt_gatt_handle_info_t char_handle;
1680 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1681 } bt_gatt_service_property_t;
1684 * Structure to GATT Remote characteristic data
1688 char *service_handle;
1689 bt_gatt_handle_info_t handle_info;
1690 } bt_gatt_discovered_char_t;
1693 * Structure to format of GATT Characteristic Value
1697 unsigned char format;
1698 unsigned char exponent;
1699 unsigned short unit;
1700 unsigned char name_space;
1701 unsigned short description;
1702 } bt_gatt_char_format_t;
1705 * Structure to GATT Characteristic property
1713 bt_gatt_char_format_t format;
1715 unsigned int val_len;
1716 unsigned int permission;
1717 char *representation;
1718 bt_gatt_handle_info_t char_desc_handle;
1719 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1720 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1721 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1722 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1723 } bt_gatt_char_property_t;
1726 * Structure to GATT Characteristic descriptor property
1733 unsigned int val_len;
1734 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1735 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1736 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1737 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1738 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1739 } bt_gatt_char_descriptor_property_t;
1742 * Structure to GATT Characteristic value
1749 } bt_gatt_char_value_t;
1752 unsigned char UUID[16];
1756 } bt_gatt_notify_req_t ;
1759 * Structure to GATT Read Request
1763 char *service_handle;
1767 } bt_gatt_read_req_t;
1770 * Structure to GATT Value change
1774 char *service_handle;
1777 gboolean response_needed;
1781 } bt_gatt_value_change_t;
1784 bluetooth_device_address_t device_addr;
1786 bluetooth_gatt_service_change_type_t change_type;
1789 } bt_gatt_service_change_t;
1792 * Structure to GATT characteristc Notification change
1796 char *service_handle;
1797 gboolean att_notify;
1798 } bt_gatt_char_notify_change_t;
1801 * Structure to Indication confirmation
1805 char *service_handle;
1808 } bt_gatt_indicate_confirm_t;
1811 * Structure for GATT response data
1818 } bt_gatt_resp_data_t;
1821 * Structure to RSSI Signal Strength Alert
1832 * Structure to RSSI Signal Strength
1842 * Structure for RSSI Enabled or Disabled
1848 gboolean rssi_enabled;
1849 } bt_rssi_enabled_t;
1852 * Structure for RSSI Threshold
1857 int in_range_threshold;
1859 } bt_rssi_threshold_t;
1863 * Structure for Suppoted Profiles and Trusted Profiles
1870 } bt_supported_profile_trusted_t;
1873 * Structure for PBAP Folder Parameters
1876 unsigned char addressbook;
1877 unsigned char folder_type;
1881 * Structure for PBAP Pull application Parameters
1884 unsigned char format;
1885 unsigned char order;
1886 unsigned short offset;
1887 unsigned short maxlist;
1888 long long unsigned fields;
1889 } bt_pbap_pull_parameters_t;
1892 * Structure for PBAP List application Parameters
1895 unsigned char order;
1896 unsigned short offset;
1897 unsigned short maxlist;
1898 } bt_pbap_list_parameters_t;
1901 * Structure for PBAP Pull vCard application Parameters
1904 unsigned char format;
1905 long long unsigned fields;
1907 } bt_pbap_pull_vcard_parameters_t;
1910 * Structure for PBAP Search application Parameters
1913 unsigned char order;
1914 unsigned short offset;
1915 unsigned short maxlist;
1916 unsigned char search_attribute;
1917 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1918 } bt_pbap_search_parameters_t;
1921 * Structure for PBAP Connection Status
1924 bluetooth_device_address_t btaddr;
1926 } bt_pbap_connected_t;
1929 * Structure for PBAP Phonebook Size
1932 bluetooth_device_address_t btaddr;
1934 } bt_pbap_phonebook_size_t;
1937 * Structure for PBAP Phonebook Pull
1940 bluetooth_device_address_t btaddr;
1943 } bt_pbap_phonebook_pull_t;
1946 * Structure for PBAP vCard List
1949 bluetooth_device_address_t btaddr;
1953 } bt_pbap_vcard_list_t;
1956 * Structure for PBAP vCard Pull
1959 bluetooth_device_address_t btaddr;
1962 } bt_pbap_vcard_pull_t;
1965 * Structure for PBAP Phonebook search List
1968 bluetooth_device_address_t btaddr;
1972 } bt_pbap_phonebook_search_list_t;
1975 * Stucture to HF Call status information
1979 char *number; /*Phone Number */
1980 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1981 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1982 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1983 int idx; /*Call index/ID */
1984 } bt_hf_call_status_info_t;
1989 } bt_hf_call_list_s;
1995 TRUSTED_PROFILE_PBAP = 1,
1996 TRUSTED_PROFILE_MAP,
1997 TRUSTED_PROFILE_SAP,
1998 TRUSTED_PROFILE_HFP_HF,
1999 TRUSTED_PROFILE_A2DP,
2000 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
2001 } bluetooth_trusted_profile_t;
2004 * Structure for LE data length change params
2007 bluetooth_device_address_t device_address;
2008 guint16 max_tx_octets;
2009 guint16 max_tx_time;
2010 guint16 max_rx_octets;
2011 guint16 max_rx_time;
2012 } bt_le_data_length_params_t;
2015 * Structure for proximity property change params
2018 bluetooth_device_address_t device_address;
2022 } bt_pxp_property_changed_params_t;
2025 * @brief DPM BT allowance state
2029 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
2030 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
2031 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
2032 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
2036 * @brief DPM API result
2040 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
2041 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
2042 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
2043 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
2044 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
2045 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
2049 * @brief DPM Policy status
2053 BLUETOOTH_DPM_STATUS_ERROR = -1,
2055 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
2056 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
2058 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
2059 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
2061 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2062 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2066 /* policy-group : BLUETOOTH */
2067 BLUETOOTH_DPM_POLICY_ALLOW,
2068 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2069 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2070 BLUETOOTH_DPM_POLICY_DEVICES_ALLOWLIST,
2071 BLUETOOTH_DPM_POLICY_DEVICES_BLOCKLIST,
2072 BLUETOOTH_DPM_POLICY_UUIDS_ALLOWLIST,
2073 BLUETOOTH_DPM_POLICY_UUIDS_BLOCKLIST,
2074 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2075 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2076 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2077 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2078 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2079 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2080 BLUETOOTH_DPM_POLICY_END,
2081 } bt_dpm_policy_cmd_t;
2084 struct bt_dpm_policy {
2090 typedef struct bt_dpm_policy bt_dpm_policy_t;
2093 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2094 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2095 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2096 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2097 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2098 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2099 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2100 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2101 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2102 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2103 BLUETOOTH_DPM_PROFILE_NONE,
2106 struct bt_dpm_profile_val {
2107 int value; /* tells whether the profile is enabled or disabled */
2109 typedef struct dpm_profile_val dpm_profile_state_t;
2112 * Structure to DPM device list
2116 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2117 } bt_dpm_device_list_t;
2120 * Structure to DPM uuid list
2124 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2125 } bt_dpm_uuids_list_t;
2128 * Structure for IPSP Interface Info
2131 bluetooth_device_address_t btaddr;
2133 } bt_ipsp_connection_info_t;
2137 char* remote_address;
2138 } bt_map_client_session_info_s;
2140 typedef char* bt_map_client_message_object_t;
2145 } bt_map_client_list_folders_filter_t;
2150 int8_t subject_length;
2159 } bt_map_client_list_messages_filter_t;
2162 bt_map_client_message_object_t message_object;
2167 char *sender_address;
2170 char *recipient_address;
2175 int64_t attachment_size;
2180 } bt_map_client_message_item_t;
2186 } bt_map_client_push_message_args_t;
2193 char *sender_address;
2196 char *recipient_address;
2205 } bt_map_client_message_t;
2208 char **names; // holding %size null-terminated folder names
2210 } bt_map_client_folders_s;
2213 bt_map_client_message_item_t *message_items;
2215 } bt_map_client_message_items_s;
2218 const char* target_file;
2220 } bt_get_message_callback_data;
2223 * Callback pointer type
2225 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2228 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2229 * @brief Set the callback function pointer for bluetooth event
2232 * This API will register the callback function, when any response and event are received from
2233 * bluetooth framework. @n
2234 * this registered callback function will be get called with appropriate event and data structures.
2235 * This function is a synchronous call. An application developer can call
2236 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2237 * type. This registered function will receive events of bluetooth_event_type_t type along with
2241 * @param[in] callback_ptr A pointer to the callback function
2242 * @param[in] user_data A pointer to user data
2243 * @return BLUETOOTH_ERROR_NONE - Success
2247 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2249 GMainLoop *main_loop = (GMainLoop*) user_data;
2253 // Code for each event
2255 g_main_loop_quit(main_loop);
2262 GMainLoop *main_loop = NULL;
2265 main_loop = g_main_loop_new(NULL, FALSE);
2266 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2267 if (ret >= BLUETOOTH_ERROR_NONE)
2269 // bluetooth_register_callback returned Success
2273 // bluetooth_register_callback returned failiure
2275 g_main_loop_run(main_loop);
2279 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2282 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2283 * @brief Set the callback function pointer for bluetooth le event
2286 * This API will register the callback function, when any response and event are received from
2287 * bluetooth framework. @n
2288 * this registered callback function will be get called with appropriate event and data structures.
2289 * This function is a synchronous call. An application developer can call
2290 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2291 * type. This registered function will receive events of bluetooth_event_type_t type along with
2295 * @param[in] callback_ptr A pointer to the callback function
2296 * @param[in] user_data A pointer to user data
2297 * @return BLUETOOTH_ERROR_NONE - Success
2301 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2304 * @fn int bluetooth_le_unregister_callback(void)
2305 * @brief Set the callback function pointer for bluetooth le event
2308 * This API will register the callback function, when any response and event are received from
2309 * bluetooth framework. @n
2310 * this registered callback function will be get called with appropriate event and data structures.
2311 * This function is a synchronous call. An application developer can call
2312 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2313 * type. This registered function will receive events of bluetooth_event_type_t type along with
2318 * @return BLUETOOTH_ERROR_NONE - Success
2322 int bluetooth_le_unregister_callback(void);
2325 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2326 * @brief Set the callback function pointer for bluetooth event
2329 * This API will register the callback function, when any response and event are received from
2330 * bluetooth framework. @n
2331 * this registered callback function will be get called with appropriate event and data structures.
2332 * This function is a synchronous call. An application developer can call
2333 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2334 * type. This registered function will receive events of bluetooth_event_type_t type along with
2339 * @return BLUETOOTH_ERROR_NONE - Success
2343 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2345 GMainLoop *main_loop = (GMainLoop*) user_data;
2349 // Code for each event
2351 g_main_loop_quit(main_loop);
2358 GMainLoop *main_loop = NULL;
2361 main_loop = g_main_loop_new(NULL, FALSE);
2362 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2363 if (ret >= BLUETOOTH_ERROR_NONE)
2365 // bluetooth_register_callback returned Success
2369 // bluetooth_register_callback returned failiure
2371 ret = bluetooth_deregister_callback(void);
2372 g_main_loop_run(main_loop);
2376 int bluetooth_unregister_callback(void);
2379 * @fn int bluetooth_enable_adapter(void)
2380 * @brief Enable the Bluetooth H/W
2383 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2384 * send request to bluetooth chip for activation.
2385 * This function is typically called at startup or when Bluetooth services are required. This
2386 * function must be called before calling any other API of Bluetooth operations.
2388 * Before performing any operations like Device discover, service search etc.., the adapter must be
2391 * This function is a asynchronous call.
2392 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2393 * through registered callback function with appropriate result code
2394 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2395 * BLUETOOTH_ERROR_NONE - Success \n
2397 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2398 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2400 * @return BLUETOOTH_ERROR_NONE - Success\n
2401 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2402 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2403 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2404 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2406 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2408 void bt_event_callback(int event, bluetooth_event_param_t *param)
2412 case BLUETOOTH_EVENT_ENABLED:
2413 if (param->result == BLUETOOTH_ERROR_NONE)
2415 // Successfully Enabled
2428 ret = bluetooth_enable_adapter();
2432 int bluetooth_enable_adapter(void);
2435 * @fn int bluetooth_disable_adapter(void)
2436 * @brief Disable the Bluetooth H/W
2439 * This function disables Bluetooth protocol stack and hardware. This function is called when
2440 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2442 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2443 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2444 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2446 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2449 * This function is a asynchronous call.
2450 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2451 * through registered callback function.
2454 * @return BLUETOOTH_ERROR_NONE - Success\n
2455 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2456 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2457 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2459 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2461 void bt_event_callback(int event, bluetooth_event_param_t *param)
2465 case BLUETOOTH_EVENT_DISABLED:
2466 if (param->result == BLUETOOTH_ERROR_NONE)
2468 // Successfully disabled
2481 ret = bluetooth_disable_adapter();
2484 int bluetooth_disable_adapter(void);
2485 int bluetooth_read_battery_data(bt_battery_data *latest);
2486 int bluetooth_set_battery_monitor_state(bool state);
2487 int bluetooth_get_battery_monitor_state(void);
2488 int bluetooth_recover_adapter(void);
2489 int bluetooth_check_adapter_le(void);
2490 int bluetooth_enable_adapter_le(void);
2492 int bluetooth_disable_adapter_le(void);
2493 int bluetooth_get_uuid_name(const char *uuid, char **name);
2496 * @fn int bluetooth_reset_adapter(void)
2497 * @brief Reset the Bluetooth H/W and values
2500 * This function resets Bluetooth protocol stack and hardware. This function is called when
2501 * an user want to initialize Bluetooth environment.
2503 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2506 * This function is a synchronous call.
2508 * @return BLUETOOTH_ERROR_NONE - Success\n
2509 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2511 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2516 ret = bluetooth_reset_adapter();
2519 int bluetooth_reset_adapter(void);
2522 * @fn int bluetooth_is_supported(void)
2523 * @brief Check if the bluetooth is supported or not by the current target
2525 * This API checks whether the bluetooth is supported or not.
2526 * This API only run by root permission.
2528 * This function is a synchronous call.
2530 * @return 0 - if bluetooth is not supported\n
2531 * 1 - if bluetooth is supported\n
2532 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2537 ret = bluetooth_is_supported();
2540 int bluetooth_is_supported(void);
2544 * @fn int bluetooth_check_adapter(void)
2545 * @brief Check the current status of the Bluetooth adapter
2548 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2549 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2550 * bluetooth adapter.
2551 * This API get the adapter internal data structure and check current adapter status.
2553 * This function is a synchronous call.
2556 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2557 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2559 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2563 ret = bluetooth_check_adapter();
2566 int bluetooth_check_adapter(void);
2569 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2570 * @brief Get the local adapter bluetooth address
2573 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2574 * the adapter should be enabled.
2575 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2576 * contain Bluetooth address.
2577 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2578 * friendly name for each device.
2579 * There is no event callback for this API.
2581 * This function is a synchronous call.
2584 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2585 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2586 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2587 * @param[out] local_address a device address of local bluetooth adapter
2592 bluetooth_device_address_t local_address={0,};
2595 ret = bluetooth_get_local_address(&local_address);
2598 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2601 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2602 * @brief Get the hci version
2605 * This function is used to get the bluetooth hci version
2606 * Before calling this API make sure that the adapter is enabled.
2608 * This function is a synchronous call.
2611 * @return BLUETOOTH_ERROR_NONE - Success \n
2612 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2613 * @param[out] timeout remain visibility timeout value
2616 bluetooth_version_t *version;
2618 ret = bluetooth_get_local_version (&version);
2621 int bluetooth_get_local_version(bluetooth_version_t *version);
2624 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2625 * @brief Get the local device name
2628 * This function is used, get the local device name. Since its difficult to remember the Adapter
2629 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2630 * friendly name is retrived by the remote device and displaying.
2631 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2633 * This function is a synchronous call.
2636 * @return BLUETOOTH_ERROR_NONE - Success \n
2637 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2638 * @param[out] local_name a local device name
2642 bluetooth_device_name_t local_name={0,}
2644 ret = bluetooth_get_local_name (&local_name);
2647 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2650 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2651 * @brief Set the local device name
2654 * This function is used to set the local device name. This is a human friendly name whose
2655 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2657 * This function is a synchronous call.
2659 * @param[in] local_name bluetooth device name to set local device
2661 * @return BLUETOOTH_ERROR_NONE - Success \n
2662 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2663 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2664 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2665 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2666 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2671 bluetooth_device_name_t local_name={0,}
2673 ret = bluetooth_set_local_name (&local_name);
2676 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2680 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2681 * @brief Check if the uuid is used or not
2683 * This function is used to check if the uuid is used or not.
2685 * This function is a synchronous call.
2687 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2688 * @param[out] used if the uuid is used or not
2690 * @return BLUETOOTH_ERROR_NONE - Success \n
2691 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2692 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2693 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2698 gboolean used = FALSE;
2699 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2700 ret = bluetooth_is_service_used(uuid, &used);
2703 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2706 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2707 * @brief Check if the device is connected to the specific service
2709 * This function is used to check if if the device is connected to the specific service.
2711 * This function is a synchronous call.
2713 * @param[in] local_address a device address of remote bluetooth device
2714 * @param[in] type the service type
2715 * @param[out] is_connected if the device is connected or not
2717 * @return BLUETOOTH_ERROR_NONE - Success \n
2718 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2719 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2720 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2725 gboolean is_connected = FALSE;
2726 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2727 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2730 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2731 bluetooth_service_type_t type,
2732 gboolean *is_connected);
2735 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2736 * @brief Gets device's connected link type
2738 * This function is used to get device's connected link type
2740 * This function is a synchronous call.
2742 * @param[in] device_address a device address of remote bluetooth device
2743 * @param[out] connected_link a device's connected link type
2745 * @return BLUETOOTH_ERROR_NONE - Success \n
2746 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2747 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2748 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2753 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2754 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2755 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2758 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2759 bluetooth_connected_link_t *connected_link);
2762 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2763 * @brief Sets a profile trusted for a device
2765 * This function is used to Set a profile as trusted for a device
2767 * This function is a synchronous call.
2769 * @param[in] device_address a device address of remote bluetooth device
2770 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2771 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2773 * @return BLUETOOTH_ERROR_NONE - Success \n
2774 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2775 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2776 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2780 int bluetooth_set_profile_trusted(
2781 const bluetooth_device_address_t *device_address,
2782 int profile, int trust);
2785 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2786 * @brief Gets a profile is trusted for a device
2788 * This function is used to Get a profile is trusted or not for a device
2790 * This function is a synchronous call.
2792 * @param[in] device_address a device address of remote bluetooth device
2793 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2794 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2796 * @return BLUETOOTH_ERROR_NONE - Success \n
2797 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2798 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2799 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2803 int bluetooth_get_profile_trusted(
2804 const bluetooth_device_address_t *device_address,
2805 int profile, int *trust);
2808 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2809 * @brief Get the visibility mode
2812 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2813 * visibity mode, the property of the device is determined whether it can be discoverable, non
2814 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2816 * This function is a synchronous call.
2819 * @return BLUETOOTH_ERROR_NONE - Success \n
2820 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2821 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2822 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2823 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2824 * @param[out] discoverable_mode current bluetooth discoverable mode
2826 * @see bluetooth_set_discoverable_mode
2828 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2830 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2833 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2836 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2838 * @brief Set the visibility mode
2841 * This function is used to set the discoverable mode (Visibility option).
2843 * Many times user may want to keep his device discoverable so that when peer device is performing
2844 * device search, he/she can find user's device. Application programmer can keep the mode as
2845 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2846 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2847 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2848 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2850 * This function is a synchronous call.
2852 * @return BLUETOOTH_ERROR_NONE - Success \n
2853 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2855 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2856 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2858 * @see bluetooth_get_discoverable_mode
2862 bluetooth_discoverable_mode_t mode;
2864 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2865 ret = bluetooth_set_discoverable_mode (mode, 180);
2869 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2874 * @fn int bluetooth_get_timeout_value(int *timeout)
2875 * @brief Get the visibility timeout value
2878 * This function is used to get the visibility timeout
2879 * Before calling this API make sure that the adapter is enabled.
2881 * This function is a synchronous call.
2884 * @return BLUETOOTH_ERROR_NONE - Success \n
2885 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2886 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2887 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2888 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2889 * @param[out] timeout remain visibility timeout value
2891 * @see bluetooth_set_discoverable_mode
2895 ret = bluetooth_get_timeout_value (&timeout);
2898 int bluetooth_get_timeout_value(int *timeout);
2902 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2903 * unsigned int classOfDeviceMask)
2904 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2906 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2907 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2908 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2909 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2910 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2911 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2912 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2913 * please see bluetooth_device_info_t for more details.
2916 * This API provides searching options like max responses, discovery duration in seconds and class
2917 * of device mask to filter device search. some times there may be too many bluetooth devices in
2918 * vicinity of your device.in such scenario, application can request to reduce number of responces
2919 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2920 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2921 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2922 * application defined time. please note that discovery_duration should be mentioned in seconds.
2923 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2926 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2927 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2928 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2930 * This function is a asynchronous call.
2931 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2932 * through registered callback function.
2934 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2935 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2937 * The completion or cancellation of the discovery is indicated by an
2938 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2940 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2943 * @return BLUETOOTH_ERROR_NONE - Success \n
2944 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2945 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2946 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2947 agent is not running \n
2949 * @param[in] max_response define the maximum response of the number of founded devices
2951 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2952 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2953 (refer to class of device)
2955 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2958 void bt_event_callback(int event, bluetooth_event_param_t *param)
2962 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2964 bluetooth_device_info_t *device_info = NULL;
2965 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2967 device_info = (bluetooth_device_info_t *)param->param_data;
2968 memcpy(&searched_device, &device_info->device_address,
2969 sizeof(bluetooth_device_address_t));
2970 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2971 device_info->device_address.addr[0],
2972 device_info->device_address.addr[1],
2973 device_info->device_address.addr[2],
2974 device_info->device_address.addr[3],
2975 device_info->device_address.addr[4],
2976 device_info->device_address.addr[5]);
2979 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2981 bluetooth_device_info_t *device_info = NULL;
2982 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2984 device_info = (bluetooth_device_info_t *)param->param_data;
2985 memcpy(&searched_device, &device_info->device_address,
2986 sizeof(bluetooth_device_address_t));
2987 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2988 device_info->device_name.name,
2989 device_info->device_address.addr[0],
2990 device_info->device_address.addr[1],
2991 device_info->device_address.addr[2],
2992 device_info->device_address.addr[3],
2993 device_info->device_address.addr[4],
2994 device_info->device_address.addr[5]);
2998 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2999 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3004 unsigned short max_response;
3005 unsigned short discovery_duration;
3006 unsigned classOfDeviceMask;
3010 discovery_duration =0;
3011 classOfDeviceMask =0;
3013 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
3018 int bluetooth_start_discovery(unsigned short max_response,
3019 unsigned short discovery_duration,
3020 unsigned int classOfDeviceMask);
3023 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
3024 * unsigned short max_response,
3025 * unsigned short discovery_duration,
3026 * unsigned int classOfDeviceMask)
3027 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
3029 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
3030 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
3031 * Please see bluetooth_start_discovery() for other parameters description.
3033 * This function is a asynchronous call.
3034 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
3035 * through registered callback function.
3037 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
3038 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
3040 * The completion or cancellation of the discovery is indicated by an
3041 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
3043 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
3046 * @return BLUETOOTH_ERROR_NONE - Success \n
3047 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3048 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3049 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
3050 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3051 agent is not running \n
3053 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
3054 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
3055 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
3056 * @param[in] max_response define the maximum response of the number of founded devices
3058 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3059 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3060 (refer to class of device)
3062 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3065 unsigned short type;
3066 unsigned short max_response;
3067 unsigned short discovery_duration;
3068 unsigned classOfDeviceMask;
3073 discovery_duration =0;
3074 classOfDeviceMask =0;
3076 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3081 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3082 unsigned short max_response,
3083 unsigned short discovery_duration,
3084 unsigned int classOfDeviceMask);
3087 * @fn int bluetooth_cancel_discovery (void)
3088 * @brief Cancel the on-going device discovery operation
3091 * This function stops the on-going device discovery operation. This API has to be called after the
3092 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3093 * the bluetooth_start_discovery API
3095 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3096 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3097 * cancel the discover request once the user received the device to which he wish to connect.
3099 * This function is a asynchronous call.
3100 * If the call is success to cancel discovey then the application will receive
3101 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3102 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3103 * BLUETOOTH_ERROR_NONE
3106 * @return BLUETOOTH_ERROR_NONE - Success \n
3107 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3108 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3109 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3110 other application \n
3111 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3113 * @see bluetooth_start_discovery
3115 void bt_event_callback(int event, bluetooth_event_param_t *param)
3119 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3120 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3129 ret = bluetooth_cancel_discovery();
3132 int bluetooth_cancel_discovery(void);
3135 * @fn int bluetooth_start_le_discovery(void)
3136 * @brief Start the generic device discovery which finds the LE devices.
3138 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3139 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3140 * It try to find LE devices. Bluetooth device address and name are
3141 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3142 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3143 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3144 * please see bluetooth_device_info_t for more details.
3146 * This function is a asynchronous call.
3147 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3148 * through registered callback function.
3150 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3153 * The completion or cancellation of the discovery is indicated by an
3154 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3156 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3159 * @return BLUETOOTH_ERROR_NONE - Success \n
3160 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3161 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3162 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3163 agent is not running \n
3166 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3169 void bt_event_callback(int event, bluetooth_event_param_t *param)
3173 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3175 bluetooth_device_info_t *device_info = NULL;
3176 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3178 device_info = (bluetooth_device_info_t *)param->param_data;
3179 memcpy(&searched_device, &device_info->device_address,
3180 sizeof(bluetooth_device_address_t));
3181 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3182 device_info->device_address.addr[0],
3183 device_info->device_address.addr[1],
3184 device_info->device_address.addr[2],
3185 device_info->device_address.addr[3],
3186 device_info->device_address.addr[4],
3187 device_info->device_address.addr[5]);
3191 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3192 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3198 ret = bluetooth_start_discovery();
3203 int bluetooth_start_le_discovery(void);
3206 * @fn int bluetooth_stop_le_discovery (void)
3207 * @brief Cancel the on-going device LE discovery operation
3210 * This function stops the on-going device discovery operation. This API has to be called after the
3211 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3212 * the bluetooth_start_le_discovery API
3215 * This function is a asynchronous call.
3216 * If the call is success to cancel discovey then the application will receive
3217 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3218 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3219 * BLUETOOTH_ERROR_NONE
3222 * @return BLUETOOTH_ERROR_NONE - Success \n
3223 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3224 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3225 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3226 other application \n
3227 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3229 * @see bluetooth_start_discovery
3231 void bt_event_callback(int event, bluetooth_event_param_t *param)
3235 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3236 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3245 ret = bluetooth_stop_le_discovery();
3248 int bluetooth_stop_le_discovery(void);
3251 * @fn int bluetooth_is_discovering(void)
3252 * @brief Check for the device discovery is in-progress or not.
3254 * This API is used to check the current status of the Discovery operation.If discovery is in\
3255 * progress normally other operations are not allowed.
3256 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3257 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3258 * event before performing other operations. This API is used to get for the current discovery
3259 * operation status and using bluetooth_cancel_discovery()
3260 * we can cancell the ongoing discovery process.
3261 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3264 * This function checks whether the device discovery is started or not.
3266 * This function is a synchronous call.
3269 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3270 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3271 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3274 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3278 ret = bluetooth_is_discovering ();
3281 int bluetooth_is_discovering(void);
3284 * @fn int bluetooth_is_le_discovering(void)
3285 * @brief Check for the device LE discovery is in-progress or not.
3287 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3288 * progress normally other operations are not allowed.
3289 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3290 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3291 * event before performing other operations. This API is used to get for the current discovery
3292 * operation status and using bluetooth_stop_le_discovery()
3293 * we can cancell the ongoing LE discovery process.
3294 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3297 * This function checks whether the device LE discovery is started or not.
3299 * This function is a synchronous call.
3302 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3303 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3304 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3307 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3311 ret = bluetooth_is_le_discovering ();
3314 int bluetooth_is_le_discovering(void);
3317 * @fn int bluetooth_is_le_scanning(void)
3318 * @brief Check for the device LE scan is in-progress or not.
3320 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3321 * progress normally other operations are not allowed.
3323 * This function checks whether the device LE Scan is started or not.
3325 * This function is a synchronous call.
3327 * @return TRUE - LE Scan in progress \n
3328 * FALSE - LE Scan is not in progress \n
3333 gboolean is_le_scanning = 0;
3334 is_le_scanning = bluetooth_is_le_scanning ();
3337 gboolean bluetooth_is_le_scanning(void);
3339 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3342 * @fn int bluetooth_force_hcidump(int timeout)
3343 * @brief Enable /disable force-hcidump
3345 * This function control force-hcidump.
3347 * This function is a synchronous call.
3349 * @return BLUETOOTH_ERROR_NONE - Success \n
3350 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3351 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3353 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3358 int bluetooth_force_hcidump(int timeout);
3361 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3362 * @brief Register scan filter.
3364 * This function registers the scan filter.
3366 * This function is a synchronous call.
3368 * @return BLUETOOTH_ERROR_NONE - Success \n
3370 * @param[in] filter scan filter to register
3374 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3377 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3378 int link_type, bt_rssi_threshold_t rssi_threshold)
3379 * @brief Enable RSSI monitoring
3381 * This function enables RSSI monitoring and sets threshold for a connection
3383 * @return BLUETOOTH_ERROR_NONE - Success \n
3386 * @see bluetooth_get_rssi_strength
3388 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3389 int link_type, bt_rssi_threshold_t *rssi_threshold);
3392 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3393 * @brief Gets Raw RSSI signal Strength
3395 * This function gives the Raw RSSI signal strength for a connection.
3397 * @return BLUETOOTH_ERROR_NONE - Success \n
3400 * @see bluetooth_enable_rssi
3402 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3404 int bluetooth_set_connectable(gboolean is_connectable);
3406 int bluetooth_is_connectable(gboolean *is_connectable);
3408 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3411 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3412 * @brief Initiate a bonding process
3415 * This function initiates a bonding procedure with a peer device. The bonding procedure
3416 * enables authentication and optionally encryption on the Bluetooth link.
3418 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3419 * inititate the bonding request to the devices already in the paired list.
3421 * Usually we call this API after the device discovery.
3422 * This function is a asynchronous call.
3424 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3425 * mentioed result code
3426 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3427 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3428 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3429 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3430 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3432 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3433 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3436 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3439 * @return BLUETOOTH_ERROR_NONE - Success \n
3440 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3441 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3442 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3443 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3445 * @param[in] device_address This indicates an address of the device with which the pairing
3446 * should be initiated
3448 * @see bluetooth_cancel_bonding
3450 void bt_event_callback(int event, bluetooth_event_param_t *param)
3454 case BLUETOOTH_EVENT_BONDING_FINISHED:
3456 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3457 if (param->result >= BLUETOOTH_ERROR_NONE)
3459 bluetooth_device_info_t *device_info = NULL;
3460 device_info = (bluetooth_device_info_t *)param->param_data;
3461 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3462 mjr[%#x] min[%#x] srv[%#x]",
3463 device_info->device_name.name,
3464 device_info->device_address.addr[0],
3465 device_info->device_address.addr[1],
3466 device_info->device_address.addr[2],
3467 device_info->device_address.addr[3],
3468 device_info->device_address.addr[4],
3469 device_info->device_address.addr[5],
3470 device_info->device_class.major_class,
3471 device_info->device_class.minor_class,
3472 device_info->device_class.service_class);
3486 bluetooth_device_address_t device_address={{0}};
3488 ret = bluetooth_bond_device(&device_address);
3492 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3495 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3496 * bluetooth_conn_type_t conn_type)
3497 * @brief Initiate a bonding process
3500 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3501 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3503 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3504 * inititate the bonding request to the devices already in the paired list.
3506 * Usually we call this API after the device discovery.
3507 * This function is a asynchronous call.
3509 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3510 * mentioed result code
3511 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3512 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3513 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3514 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3515 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3517 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3518 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3521 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3524 * @return BLUETOOTH_ERROR_NONE - Success \n
3525 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3526 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3527 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3528 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3530 * @param[in] device_address This indicates an address of the device with which pairing
3531 * should be initiated
3532 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3535 * @see bluetooth_cancel_bonding
3537 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3538 bluetooth_conn_type_t conn_type);
3541 * @fn int bluetooth_cancel_bonding(void)
3542 * @brief Cancel the on-going bonding process
3544 * This API is called to cancel the on-going bonding procedure. It should be called before the
3545 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3546 * This API is useful when the remote device is not responding to the bond request or we wish to
3547 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3549 * This function is a synchronous call.
3551 * @return BLUETOOTH_ERROR_NONE - Success \n
3552 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3553 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3556 * @see bluetooth_bond_device
3562 ret = bluetooth_cancel_bonding();
3565 int bluetooth_cancel_bonding(void);
3568 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3569 * @brief Remove bonding
3572 * To communicate with remote device over bluetooth link, user should bond with peer device.
3573 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3574 * API is used to remove peer device from the list. Please note that after removing the device
3575 * from bonded device list, you cannot communication with peer device until bonding happens again.
3577 * User can call this function by passing bluetooth device address of any bonded device. Please note
3578 * that after successful return of this function, any bluetooth application running on your device
3579 * will not be able to communicate with unbonded device until bond operation happens again using
3580 * bluetooth_bond_device()
3583 * This function is a asynchronous call. The request to remove the specified device from the bonded
3584 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3585 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3586 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3590 * @return BLUETOOTH_ERROR_NONE - Success \n
3591 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3592 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3593 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3594 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3595 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3596 * agent is not running \n
3597 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3600 * @param[in] device_address This indicates an address of the device to remove bonding
3604 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3607 void bt_event_callback(int event, bluetooth_event_param_t *param)
3610 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3611 bluetooth_device_address_t *dev_addr = NULL;
3613 if (param->result == BLUETOOTH_ERROR_NONE) {
3614 dev_addr = (bluetooth_device_address_t *)param->param_data;
3616 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3617 dev_addr->addr[0], dev_addr->addr[1]
3618 dev_addr->addr[2], dev_addr->addr[3]
3619 dev_addr->addr[4], dev_addr->addr[5]
3630 bluetooth_device_address_t *device_address;
3632 // copy valid device address in device_address
3634 ret = bluetooth_unbond_device(device_address);
3637 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3640 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3641 * @brief Get bonded(paired) device list
3644 * This API gets all bonded device list.
3645 * The devices in the bonded device list further can be used to perform the authorization by calling
3646 * bluetooth_authorize_device API.
3648 * This function is a synchronous call.
3649 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3650 * there is no valid information in the dev_list.
3651 * The len field in the dev_list represents the number of bonded devices. The data structure for
3652 * bonded device information is bluetooth_device_info_t.
3655 * @return BLUETOOTH_ERROR_NONE - Success \n
3656 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3658 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3660 void bt_get_bonded_devices(void)
3664 GPtrArray *devinfo = NULL;
3665 bluetooth_device_info_t *ptr;
3667 // allocate the g_pointer_array
3668 devinfo = g_ptr_array_new();
3670 ret = bluetooth_get_bonded_device_list(&devinfo);
3671 if (ret != BLUETOOTH_ERROR_NONE)
3673 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3677 printf("g pointer arrary count : [%d]", devinfo->len);
3678 for (i=0; i<devinfo->len; i++)
3680 ptr = g_ptr_array_index(devinfo, i);
3683 printf("Name [%s]\n", ptr->device_name.name);
3684 printf("Major Class [%d]\n", ptr->device_class.major_class);
3685 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3686 printf("Service Class [%d]\n", ptr->device_class.service_class);
3687 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3688 ptr->device_address.addr[0],
3689 ptr->device_address.addr[1], ptr->device_address.addr[2],
3690 ptr->device_address.addr[3],
3691 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3698 // free g_pointer_array
3699 g_ptr_array_free(devinfo, TRUE);
3704 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3706 int bluetooth_get_profile_connected_device_list(
3707 const char *profile_uuid, GPtrArray **addr_list);
3710 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3711 * bluetooth_device_info_t *dev_info)
3712 * @brief Get a bonded(paired) device
3715 * This API gets a bonded device.
3717 * This function is a synchronous call.
3718 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3719 * there is no valid information in the dev_info.
3720 * The data structure for bonded device information is bluetooth_device_info_t.
3723 * @return BLUETOOTH_ERROR_NONE - Success \n
3724 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3726 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3728 void bt_get_bonded_device(void)
3732 bluetooth_device_info_t devinfo = {0};
3733 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3735 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3736 if (ret != BLUETOOTH_ERROR_NONE)
3738 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3742 printf("Name [%s]\n", devinfo.device_name.name);
3743 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3744 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3745 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3746 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3747 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3748 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3749 devinfo.device_address.addr[5]);
3758 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3759 bluetooth_device_info_t *dev_info);
3762 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3763 * gboolean *is_alias_set)
3764 * @brief Get is_alias_set property of device
3766 * This API gets is_alias_set property of a bonded device.
3768 * This function is a synchronous call.
3769 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3770 * If not,there is no valid information in the is_alias_set.
3772 * @return BLUETOOTH_ERROR_NONE - Success \n
3773 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3778 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3780 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3783 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3784 gboolean *is_alias_set);
3787 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3788 * @brief set alias for bonded device
3791 * This function set alias for bonded device.
3793 * This function is a synchronous call.
3796 * @return BLUETOOTH_ERROR_NONE - Success \n
3797 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3798 * @param[in] device_address This indicates an address of the remote device
3799 * @param[in] alias This indicates an alias to set
3804 ret = bluetooth_set_alias(&remote_address);
3807 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3811 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3812 * @brief Get remote deivice
3815 * This function gets specific remote device.
3817 * This function is a asynchronous call.
3818 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3821 * @return BLUETOOTH_ERROR_NONE - Success \n
3822 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3823 * @param[in] device_address This indicates an address of the remote device
3828 ret = bluetooth_get_remote_device(&remote_address);
3831 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3834 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3835 * gboolean authorized)
3836 * @brief Authorize/Unauthorize a bonded device
3839 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3840 * with/without user confirmation.
3842 * If we select a paired device and make it authorized by calling this API with the authorized
3843 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3844 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3845 * then it will ask for the user conformation before the connection.
3847 * This API supposed to be called on the paired devices. Which means we have to use this API only
3848 * after successful pairing.
3850 * This function is a asynchronous call.
3851 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3853 * @return BLUETOOTH_ERROR_NONE - Success \n
3854 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3855 * @param[in] device_address This indicates an address of the device to authorize \n
3856 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3858 * @see bluetooth_get_bonded_device_list
3860 void bt_event_callback(int event, bluetooth_event_param_t *param)
3864 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3866 if (param->result == BLUETOOTH_ERROR_NONE)
3870 //device authorization failed failure
3878 bluetooth_device_address_t device_address={{0}};
3879 gboolean authorized;
3883 ret = bluetooth_authorize_device(&device_address,authorized);
3886 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3887 gboolean authorized);
3889 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3890 const bluetooth_device_pin_code_t *pin_code);
3892 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3895 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3897 * @brief Receives Legacy Passkey\pin with following authentication response types
3899 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3900 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3903 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3906 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3908 * @brief This API sends user confirmation reply to the local adapter.
3910 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3913 int bluetooth_passkey_confirmation_reply(gboolean reply);
3916 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3917 * @brief Get all services supported by remote device
3920 * This API call initiates the search for the services supported by the specified device. Normally
3921 * the service search will take a couple of seconds to get it completed. Before calling this API
3922 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3923 * perform the service search. We can get the device address by doing a device discovery operation.
3926 * This function is a asynchronous call.
3927 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3929 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3930 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3931 * event is generated with appropriate result code.
3933 * @return BLUETOOTH_ERROR_NONE - Success \n
3934 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3935 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3936 * @param[in] device_address This indicates an address of the device
3937 * whose services need to be found
3939 * @see bluetooth_cancel_service_search
3941 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3944 * @fn int bluetooth_cancel_service_search(void)
3945 * @brief Cancel the ongoing service search operation
3948 * This function cancel the ongoing service search operation. This API is usually calling after the
3949 * bluetooth_search_service API.
3950 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3951 * if the user wish to cancel the Ongoing service search operation.
3953 * This API should be called just after the bluetooth_search_service API and before the
3954 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3956 * This function is a synchronous call.
3958 * @return BLUETOOTH_ERROR_NONE - Success \n
3959 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3960 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3961 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3964 * @see bluetooth_search_service
3969 ret = bluetooth_cancel_service_search();
3972 int bluetooth_cancel_service_search(void);
3975 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3976 * @brief Register rfcomm socket with a specific uuid
3979 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3980 * descriptor of the server.
3981 * This is the first API which is called to create the server. Once we created the server socket,
3982 * we will listen on that return socket.
3983 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3986 * @return socket FD on Success \n
3987 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3988 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3989 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3990 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3991 * @param[in] UUID (128 bits)
3994 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3998 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3999 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4003 int bluetooth_rfcomm_create_socket(const char *uuid);
4006 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
4007 * @brief Register rfcomm socket with a specific uuid
4010 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4011 * descriptor of the server.
4012 * This is the first API which is called to create the server. Once we created the server socket,
4013 * we will listen on that return socket.
4014 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
4017 * @return socket FD on Success \n
4018 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4019 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4020 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4021 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4022 * @param[in] UUID (128 bits)
4023 * @param[in] bus_name (const char)
4024 * @param[in] path (const char)
4027 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
4031 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4032 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
4036 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
4039 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
4040 * @brief De-register the rfcomm socket
4043 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
4044 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4045 * descriptor else no event will come. We will call this API only after the
4046 * bluetooth_rfcomm_listen_and_accept.
4047 * This is a synchronous call.
4049 * @return BLUETOOTH_ERROR_NONE - Success \n
4050 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4051 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4052 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4053 * @param[in] int socket_fd
4056 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
4059 void bt_event_callback(int event, bluetooth_event_param_t *param)
4063 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4065 bluetooth_rfcomm_connection_t *discon_ind =
4066 (bluetooth_rfcomm_connection_t *)param->param_data;
4068 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4076 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4077 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4079 ret = bluetooth_rfcomm_remove_socket(fd);
4082 int bluetooth_rfcomm_remove_socket(int socket_fd);
4085 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4086 * @brief De-register the rfcomm socket
4089 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4090 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4091 * descriptor else no event will come. We will call this API only after the
4092 * bluetooth_rfcomm_listen_and_accept_ex.
4093 * This is a synchronous call.
4095 * @return BLUETOOTH_ERROR_NONE - Success \n
4096 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4097 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4098 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4099 * @param[in] UUID (128 bits)
4102 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4105 void bt_event_callback(int event, bluetooth_event_param_t *param)
4109 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4111 bluetooth_rfcomm_connection_t *discon_ind =
4112 (bluetooth_rfcomm_connection_t *)param->param_data;
4114 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4122 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4123 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4125 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4128 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4131 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4132 * @brief Disconnect rfcomm connection
4135 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4136 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4139 * @return BLUETOOTH_ERROR_NONE - Success \n
4140 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4141 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4142 * @param[in] int socket_fd the sending socket fd
4148 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4150 printf("Disconnection failed");
4152 printf("Disconnection Success");
4156 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4159 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4160 * @brief Rfcomm socket listen
4163 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4164 * after the bluetooth_rfcomm_create_socket API.
4165 * This API listen for the incomming connection and once it receives a connection, it will give
4166 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4167 * event to the application. This is an Asynchronous API call.
4170 * @return BLUETOOTH_ERROR_NONE - Success \n
4171 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4172 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4174 * @param[in] int socket_fd
4175 * @param[in] max pending connection.
4178 * @see bluetooth_rfcomm_create_socket
4181 void bt_event_callback(int event, bluetooth_event_param_t* param)
4185 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4187 bluetooth_rfcomm_connection_t *conn_ind =
4188 (bluetooth_rfcomm_connection_t *)param->param_data;
4190 printf("\nConnected from FD %d", conn_ind->socket_fd);
4198 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4199 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4203 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4206 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4207 * @brief Rfcomm socket listen
4210 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4211 * after the bluetooth_rfcomm_create_socket API.
4212 * This API listen for the incomming connection and once it receives a connection, it will give
4213 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4214 * event to the application. This is an Asynchronous API call.
4217 * @return BLUETOOTH_ERROR_NONE - Success \n
4218 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4219 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4221 * @param[in] int socket_fd
4222 * @param[in] max pending connection.
4227 * @see bluetooth_rfcomm_create_socket_ex
4230 void bt_event_callback(int event, bluetooth_event_param_t* param)
4234 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4236 bluetooth_rfcomm_connection_t *conn_ind =
4237 (bluetooth_rfcomm_connection_t *)param->param_data;
4239 printf("\nConnected from FD %d", conn_ind->socket_fd);
4247 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4248 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4253 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4256 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4257 * @brief Rfcomm socket listen
4260 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4261 * after the bluetooth_rfcomm_create_socket API.
4262 * This API listen for the incomming connection and once it receives a connection, it will give
4263 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4264 * event to the application. This is an Asynchronous API call.
4267 * @return BLUETOOTH_ERROR_NONE - Success \n
4268 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4269 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4271 * @param[in] int socket_fd
4272 * @param[in] max pending connection.
4275 * @see bluetooth_rfcomm_create_socket
4278 void bt_event_callback(int event, bluetooth_event_param_t* param)
4282 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4284 char *name = (char *)param->param_data;
4286 printf("\nConnected from %s", name);
4288 bluetooth_rfcomm_accept_connection();
4296 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4297 ret = bluetooth_rfcomm_listen(fd, 1);
4301 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4304 * @fn int bluetooth_rfcomm_accept_connection()
4305 * @brief Accepts the authorization request indicated by the event
4306 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4308 * This function is a synchronous call.
4310 * @return BLUETOOTH_ERROR_NONE - Success \n
4311 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4313 * @param[in] the socket fd of the server
4314 * @param[out] the socket fd of the client
4318 * @see bluetooth_rfcomm_reject_connection
4320 int bluetooth_rfcomm_accept_connection(int server_fd);
4323 * @fn int bluetooth_rfcomm_reject_connection()
4324 * @brief Rejects the authorization request indicated by the event
4325 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4327 * This function is a synchronous call.
4329 * @return BLUETOOTH_ERROR_NONE - Success \n
4330 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4332 * @param[in] the socket fd of the server
4336 * @see bluetooth_rfcomm_accept_connection
4338 int bluetooth_rfcomm_reject_connection(int server_fd);
4341 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4342 * @brief Informs whether rfcomm server uuid is available or not.
4344 * This function is a synchronous call.
4346 * @return TRUE - RFCOMM uuid is available \n
4347 * FALSE - RFCOMM uuid is not available \n
4349 * @param[in] uuid UUID string
4355 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4358 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4359 * const char *remote_uuid)
4360 * @brief Connect to the remote device rfcomm *
4362 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4363 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4364 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4365 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4366 * initiating a connection.
4368 * @return BLUETOOTH_ERROR_NONE - Success \n
4369 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4370 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4371 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4372 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4373 * @param[in] bluetooth_device_address_t remote bt_address
4374 * @param[in] char remote uuid
4376 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4380 void bt_event_callback(int event, bluetooth_event_param_t *param)
4384 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4386 if (param->result >= BLUETOOTH_ERROR_NONE)
4388 bt_sdp_info_t *bt_sdp_info=param->param_data;
4390 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4391 bt_sdp_info->device_addr.addr[0],
4392 bt_sdp_info->device_addr.addr[1],
4393 bt_sdp_info->device_addr.addr[2],
4394 bt_sdp_info->device_addr.addr[3],
4395 bt_sdp_info->device_addr.addr[4],
4396 bt_sdp_info->device_addr.addr[5]);
4398 printf("Supported service list:\n");
4399 for(i=0; i<bt_sdp_info->service_index; i++)
4401 bt_sdp_info->service_list_array[i]);
4404 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4405 //rfcomm_test_uuid);
4409 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4411 bluetooth_rfcomm_connection_t *conn_ind =
4412 (bluetooth_rfcomm_connection_t *)param->param_data;
4414 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4415 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4416 "SERVER" : "CLIENT");
4421 bluetooth_device_address_t remote_address = {{0},};
4422 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4423 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4424 ret = bluetooth_search_service(&remote_address);
4426 printf("Seach failed, Reason = %d", ret);
4428 printf("Search Success, Ret = %d", ret);
4430 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4432 printf("Connection failed, Reason = %d", ret);
4434 printf("Connection Success, Ret = %d", ret);
4438 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4439 const char *remote_uuid);
4442 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4443 * @brief Disconnect rfcomm connection
4446 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4447 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4450 * @return BLUETOOTH_ERROR_NONE - Success \n
4451 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4452 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4453 * @param[in] char remote bt_address
4456 * @see bluetooth_rfcomm_connect
4460 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4462 printf("Disconnection failed");
4464 printf("Disconnection Success");
4469 int bluetooth_rfcomm_disconnect(int socket_fd);
4472 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4473 * @brief Write to rfcomm connection
4476 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4477 * API is used to send the data for server and the client.
4479 * @return BLUETOOTH_ERROR_NONE - Success \n
4480 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4481 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4483 * @param[in] const char *buff Data buffer to send
4484 * @param[in] int length Length of the data
4487 * @see bluetooth_rfcomm_connect
4490 char *buff = "Test data 123456789"
4491 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4493 printf("Send failed");
4495 printf("Send success");
4499 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4502 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4503 * @brief Informs whether rfcomm client is connected.
4505 * This function is a synchronous call.
4507 * @return TRUE - RFCOMM client is connected \n
4508 * FALSE - RFCOMM client is not connected \n
4514 gboolean bluetooth_rfcomm_is_client_connected(void);
4515 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4516 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4519 * @fn int bluetooth_network_activate_server(void)
4520 * @brief Activate the NAP (Network Access Point) service
4522 * This function is a asynchronous call.
4523 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4525 * @return BLUETOOTH_ERROR_NONE - Success \n
4526 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4527 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4528 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4531 * @see bluetooth_network_deactivate_server
4534 int bluetooth_network_activate_server(void);
4537 * @fn int bluetooth_network_deactivate_server(void)
4538 * @brief Deactivate the NAP (Network Access Point) service
4540 * This function is a asynchronous call.
4541 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4543 * @return BLUETOOTH_ERROR_NONE - Success \n
4544 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4545 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4546 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4549 * @see bluetooth_network_activate_server
4552 int bluetooth_network_deactivate_server(void);
4555 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4556 * bluetooth_network_role_t role,
4558 * @brief Connect the network server in the peer
4560 * This function is a asynchronous call.
4561 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4563 * @return BLUETOOTH_ERROR_NONE - Success \n
4564 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4565 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4566 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4569 * @param[in] device_address This indicates an address of the device with which the pairing
4570 * should be initiated
4571 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4572 * need to use the third parameter.
4573 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4574 * connect. UUID string
4576 * @see bluetooth_network_disconnect
4578 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4579 bluetooth_network_role_t role, char *custom_uuid);
4582 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4583 * bluetooth_network_role_t role,
4584 * char *custom_uuid)
4585 * @brief Connect the network server in the peer
4587 * This function is a asynchronous call.
4588 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4590 * @return BLUETOOTH_ERROR_NONE - Success \n
4591 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4592 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4593 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4596 * @param[in] device_address This indicates an address of the device with which the pairing
4597 * should be initiated
4599 * @see bluetooth_network_connect
4601 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4604 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4605 * @brief Disconnect the device from the network
4607 * This function is an asynchronous call.
4608 * The network server disconnect request is responded by
4609 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4611 * @return BLUETOOTH_ERROR_NONE - Success \n
4612 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4613 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4614 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4617 * @param[in] device_address This indicates an address of the connected client device
4619 * @see bluetooth_network_activate_server
4621 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4626 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4627 * bt_hdp_role_type_t role,
4628 * bt_hdp_qos_type_t channel_type,
4629 * char **app_handle)
4630 * @brief Activate the HDP service for a particular data type
4632 * This function is a synchronous call.
4634 * @return BLUETOOTH_ERROR_NONE - Success \n
4635 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4636 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4637 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4640 * @param[in] data_type The data type against corresponding service
4641 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4642 * @param[in] channel_type The QOS type for the channel.
4643 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4644 * For role = HDP_ROLE_SINK, the channel_type
4645 * should be HDP_QOS_ANY.
4646 * @param[out] app_handle The application handler against corresponding service
4648 * @see bluetooth_hdp_deactivate
4650 int bluetooth_hdp_activate(unsigned short data_type,
4651 bt_hdp_role_type_t role,
4652 bt_hdp_qos_type_t channel_type,
4655 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4656 * @brief Deactivate the HDP service for a particular service using the handler
4658 * This function is a synchronous call.
4660 * @return BLUETOOTH_ERROR_NONE - Success \n
4661 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4662 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4663 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4666 * @param[in] app_handle The application handler against corresponding service
4668 * @see bluetooth_hdp_deactivate
4670 int bluetooth_hdp_deactivate(const char *app_handle);
4673 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4674 * const char *buffer, unsigned int size)
4675 * @brief Send data to the remote HDP device
4677 * This function is a synchronous call.
4679 * @return BLUETOOTH_ERROR_NONE - Success \n
4680 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4681 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4682 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4683 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4686 * @param[in] channel_id The channel id for the connection.
4687 * @param[in] buffer The pdu buffer.
4688 * @param[in] size Size of the buffer.
4690 * @see bluetooth_hdp_connect
4692 int bluetooth_hdp_send_data(unsigned int channel_id,
4693 const char *buffer, unsigned int size);
4695 * @fn int bluetooth_hdp_connect(const char *app_handle,
4696 * bt_hdp_qos_type_t channel_type,
4697 * const bluetooth_device_address_t *device_address)
4698 * @brief Connect to the remote device(Mainly used by source)
4700 * This function is a asynchronous call.
4701 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4703 * @return BLUETOOTH_ERROR_NONE - Success \n
4704 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4705 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4706 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4707 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4710 * @param[in] app_handle The application handler against corresponding service
4711 * @param[in] channel_type The QOS type for the channel.
4712 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4713 * @param[in] device_address The remote device Bd address.
4716 * @see bluetooth_hdp_disconnect
4718 int bluetooth_hdp_connect(const char *app_handle,
4719 bt_hdp_qos_type_t channel_type,
4720 const bluetooth_device_address_t *device_address);
4722 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4723 * const bluetooth_device_address_t *device_address)
4724 * @brief Disconnect from the remote device(Mainly used by source)
4726 * This function is a asynchronous call.
4727 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4729 * @return BLUETOOTH_ERROR_NONE - Success \n
4730 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4731 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4732 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4733 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4736 * @param[in] channel_id The channel id for the connection.
4737 * @param[in] device_address The remote device Bd address.
4740 * @see bluetooth_hdp_connect
4742 int bluetooth_hdp_disconnect(unsigned int channel_id,
4743 const bluetooth_device_address_t *device_address);
4747 * @fn int bluetooth_opc_init(void)
4748 * @brief Initialize OPP client.
4750 * This function is a synchronous call.
4751 * No event corresponding to this api
4753 * @return BLUETOOTH_ERROR_NONE - Success \n
4754 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4755 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4756 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4757 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4762 * @see bluetooth_opc_deinit
4764 int bluetooth_opc_init(void);
4767 * @fn int bluetooth_opc_deinit(void)
4768 * @brief Deinitialize OPP client.
4770 * This function is a synchronous call.
4771 * No event corresponding to this api
4773 * @return BLUETOOTH_ERROR_NONE - Success \n
4774 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4775 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4780 * @see bluetooth_opc_init
4783 int bluetooth_opc_deinit(void);
4786 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4787 char **file_name_array)
4788 * @brief Send multiple files to a remote device.
4790 * This function is a asynchronous call.
4791 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4793 * @return BLUETOOTH_ERROR_NONE - Success \n
4794 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4795 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4796 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4797 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4798 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4799 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4802 * @param[in] device_address The remote device Bd address.
4803 * @param[in] file_name_array Array of filepaths to be sent.
4806 * @see bluetooth_opc_cancel_push
4809 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4810 char **file_name_array);
4813 * @fn int bluetooth_opc_cancel_push(void)
4814 * @brief Cancels the ongoing file push.
4816 * This function is a asynchronous call.
4817 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4818 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4820 * @return BLUETOOTH_ERROR_NONE - Success \n
4821 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4822 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4827 * @see bluetooth_opc_push_files
4830 int bluetooth_opc_cancel_push(void);
4833 * @fn gboolean bluetooth_opc_session_is_exist(void)
4834 * @brief Informs whether opc session exists or not.
4836 * This function is a synchronous call.
4838 * @return TRUE - OPC session exists \n
4839 * FALSE - OPC session does not exist \n
4847 gboolean bluetooth_opc_session_is_exist(void);
4850 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4851 * @brief Informs whether opc session exists or not.
4853 * This function is a synchronous call.
4855 * @return BLUETOOTH_ERROR_NONE - Success \n
4856 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4857 * BLUETOOTH_ERROR_INTERNAL \n
4860 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4865 int bluetooth_opc_is_sending(gboolean *is_sending);
4868 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4869 int transfer_id, unsigned char *progress)
4870 * @brief Gets the percentage progress for ongoing transfers.
4872 * This function is a synchronous call.
4874 * @return BLUETOOTH_ERROR_NONE - Success \n
4875 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4876 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4879 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4880 * @param[in] transfer_id Transfer ID
4881 * @param[out] progress Percentage Progress
4885 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4886 int transfer_id, unsigned char *progress);
4889 * @fn int bluetooth_obex_server_init(const char *dst_path)
4890 * @brief Initialize OPP and FTP server.
4892 * This function is a synchronous call.
4893 * No event corresponding to this api
4895 * @return BLUETOOTH_ERROR_NONE - Success \n
4896 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4897 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4898 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4899 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4902 * @param[in] dst_path OPS destination file path.
4904 * @see bluetooth_obex_server_deinit
4906 int bluetooth_obex_server_init(const char *dst_path);
4910 * @fn int bluetooth_obex_server_deinit(void)
4911 * @brief Deinitialize OPP and FTP server.
4913 * This function is a synchronous call.
4914 * No event corresponding to this api
4916 * @return BLUETOOTH_ERROR_NONE - Success \n
4917 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4918 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4923 * @see bluetooth_obex_server_init
4925 int bluetooth_obex_server_deinit(void);
4929 * @fn gboolean bluetooth_obex_server_is_activated(void)
4930 * @brief Informs whether obex server is activated or not.
4932 * This function is a synchronous call.
4934 * @return TRUE - OBEX server is activated \n
4935 * FALSE - OBEX server is not activated \n
4942 gboolean bluetooth_obex_server_is_activated(void);
4946 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4947 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4949 * This function is a synchronous call.
4950 * No event corresponding to this api
4952 * @return BLUETOOTH_ERROR_NONE - Success \n
4953 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4954 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4955 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4956 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4960 * @param[in] dst_path OPS destination file path.
4962 * @see bluetooth_obex_server_deinit_without_agent
4964 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4968 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4969 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4971 * This function is a synchronous call.
4972 * No event corresponding to this api
4974 * @return BLUETOOTH_ERROR_NONE - Success \n
4975 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4976 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4981 * @see bluetooth_obex_server_init_without_agent
4983 int bluetooth_obex_server_deinit_without_agent(void);
4987 * @fn int bluetooth_obex_server_accept_connection(void)
4988 * @brief Accepts the authorization request indicated by the event
4989 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4991 * This function is a synchronous call.
4993 * @return BLUETOOTH_ERROR_NONE - Success \n
4994 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4995 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4999 * @see bluetooth_obex_server_reject_authorize
5001 int bluetooth_obex_server_accept_connection(void);
5005 * @fn int bluetooth_obex_server_reject_connection(void)
5006 * @brief Rejects the authorization request indicated by the event
5007 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5009 * This function is a synchronous call.
5011 * @return BLUETOOTH_ERROR_NONE - Success \n
5012 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5013 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5017 * @see bluetooth_obex_server_reject_authorize
5019 int bluetooth_obex_server_reject_connection(void);
5023 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
5024 * @brief Accepts the authorization request indicated by the event
5025 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5027 * This function is a asynchronous call.
5028 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
5030 * @return BLUETOOTH_ERROR_NONE - Success \n
5031 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5032 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5033 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5036 * @param[in] filename Authorized filename.
5039 * @see bluetooth_obex_server_reject_authorize
5042 int bluetooth_obex_server_accept_authorize(const char *filename);
5045 * @fn int bluetooth_obex_server_reject_authorize(void)
5046 * @brief Reject the authorization request indicated by the event
5047 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5049 * This function is a asynchronous call.
5050 * No event for this api..
5052 * @return BLUETOOTH_ERROR_NONE - Success \n
5053 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5054 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5059 * @see bluetooth_obex_server_accept_authorize
5062 int bluetooth_obex_server_reject_authorize(void);
5065 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5066 * @brief Set the OPS destination file path..
5068 * This function is a asynchronous call.
5069 * No event for this api..
5071 * @return BLUETOOTH_ERROR_NONE - Success \n
5072 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5073 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5074 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5077 * @param[in] dst_path OPS destination file path.
5083 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5086 * @fn int bluetooth_obex_server_set_root(const char *root)
5087 * @brief Set the FTS root folder..
5089 * This function is a asynchronous call.
5090 * No event for this api..
5092 * @return BLUETOOTH_ERROR_NONE - Success \n
5093 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5094 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5095 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5096 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5097 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5100 * @param[in] root FTS root folder.
5106 int bluetooth_obex_server_set_root(const char *root);
5109 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5110 * @brief Cancel the transfer on server
5112 * This function is an asynchronous call.
5113 * If the function call that cancels transfer is successful, the application would receive
5114 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5115 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5116 * the error code will be BLUETOOTH_ERROR_NONE
5118 * @return BLUETOOTH_ERROR_NONE - Success \n
5119 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5120 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5121 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5122 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5125 * @param[in] transfer_id transfer ID
5130 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5134 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5135 * @brief Cancel the transfer on server
5137 * This function is an asynchronous call.
5138 * If the function call that cancels transfer is successful, the application would receive
5139 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5140 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5141 * the error code will be BLUETOOTH_ERROR_NONE
5143 * @return BLUETOOTH_ERROR_NONE - Success \n
5144 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5145 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5146 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5147 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5154 int bluetooth_obex_server_cancel_all_transfers(void);
5158 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5159 * @brief Informs whether obex server is receiving or not.
5161 * This function is a synchronous call.
5163 * @return BLUETOOTH_ERROR_NONE - Success \n
5164 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5165 * BLUETOOTH_ERROR_INTERNAL \n
5168 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5173 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5177 * @fn int bluetooth_map_client_init(void)
5178 * @brief Initialize MAP client.
5180 * This function is a synchronous call.
5181 * No event corresponding to this api
5183 * @return BLUETOOTH_ERROR_NONE - Success \n
5184 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5185 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5186 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5187 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5192 * @see bluetooth_map_client_deinit
5194 int bluetooth_map_client_init(void);
5196 int bluetooth_map_client_deinit(void);
5198 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5200 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5202 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5204 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5205 bt_map_client_list_folders_filter_t *filter);
5208 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5209 * @brief Return all available fields that can be used in Fields filter.
5211 * This function is a asynchronous call.
5213 * @return BLUETOOTH_ERROR_NONE - Success \n
5214 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5215 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5218 * @param[in] session Information about session.
5221 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5223 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5225 bt_map_client_list_messages_filter_t *filter);
5227 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5229 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5230 const char *source_file,
5232 bt_map_client_push_message_args_t *args);
5234 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5235 const bt_map_client_message_object_t message_object,
5236 const char *target_file,
5241 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5242 * @brief Read the local Hash and Randmizer.
5244 * This function is a synchronous call.
5246 * @return BLUETOOTH_ERROR_NONE - Success \n
5247 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5251 * @param[out] local_oob_data - Pointer to the local OOB data
5257 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5261 * @fn int bluetooth_oob_add_remote_data(
5262 * const bluetooth_device_address_t *remote_device_address,
5263 * bluetooth_bdaddr_type_e address_type,
5264 * bt_oob_data_t *oob_data)
5265 * @brief Add/updated the remote device Hash and Randmizer.
5267 * This function is a synchronous call.
5268 * No event for this api..
5270 * @return BLUETOOTH_ERROR_NONE - Success \n
5271 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5274 * @param[in] remote_device_address - Remote device address
5275 * address_type - bdaddr type
5276 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5282 int bluetooth_oob_add_remote_data(
5283 const bluetooth_device_address_t *remote_device_address,
5284 bluetooth_bdaddr_type_e address_type,
5285 bt_oob_data_t *remote_oob_data);
5289 * @fn int bluetooth_oob_remove_remote_data(
5290 * const bluetooth_device_address_t *remote_device_address)
5291 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5293 * This function is a synchronous call.
5294 * No event for this api..
5296 * @return BLUETOOTH_ERROR_NONE - Success \n
5297 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5300 * @param[in] remote_device_address - Remote device address
5306 int bluetooth_oob_remove_remote_data(
5307 const bluetooth_device_address_t *remote_device_address);
5311 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5312 * @brief Read the local Hash and Randmizer.
5314 * This function is a synchronous call.
5316 * @return BLUETOOTH_ERROR_NONE - Success \n
5317 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5321 * @param[out] local_oob_data - Pointer to the local OOB data
5326 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5329 * @fn int bluetooth_le_oob_add_remote_data(
5330 * const bluetooth_device_address_t *remote_device_address,
5331 * bluetooth_bdaddr_type_e address_type,
5332 * bt_oob_data_t *oob_data)
5333 * @brief Add/updated the remote device Hash and Randmizer.
5335 * This function is a synchronous call.
5336 * No event for this api..
5338 * @return BLUETOOTH_ERROR_NONE - Success \n
5339 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5342 * @param[in] remote_device_address - Remote device address
5343 * address_type - bdaddr type
5344 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5349 int bluetooth_le_oob_add_remote_data(
5350 const bluetooth_device_address_t *remote_device_address,
5351 bluetooth_bdaddr_type_e address_type,
5352 bt_oob_data_t *remote_oob_data);
5355 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5356 * bt_gatt_handle_info_t *prim_svc);
5358 * @brief Gets the GATT based primary services handle supported by remote device
5360 * This function is a synchronous call.
5361 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5363 * @return BLUETOOTH_ERROR_NONE - Success \n
5364 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5365 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5366 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5369 * @param[in] address - Remote device address
5370 * @param[out] prim_svc - Structure containing remote service count and handle list.
5373 * @see bluetooth_gatt_free_primary_services()
5375 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5376 bt_gatt_handle_info_t *prim_svc);
5379 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5381 * @brief Discovers the characteristics of GATT based service of remote device
5383 * This function is an asynchronous call.
5384 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5386 * @return BLUETOOTH_ERROR_NONE - Success \n
5387 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5388 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5389 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5392 * @param[in] service_handle - Handle for remote service.
5397 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5399 int bluetooth_gatt_set_service_change_watcher(
5400 const bluetooth_device_address_t *address, gboolean enable);
5403 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5404 * bt_gatt_service_property_t *service);
5406 * @brief Gets the properties of GATT based service of remote device
5408 * This function is a synchronous call.
5409 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5411 * @return BLUETOOTH_ERROR_NONE - Success \n
5412 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5413 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5414 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5417 * @param[in] service_handle - Handle for remote service.
5418 * @param[out] service - Structure containing remote service property.
5421 * @see bluetooth_gatt_free_service_property()
5423 int bluetooth_gatt_get_service_property(const char *service_handle,
5424 bt_gatt_service_property_t *service);
5427 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5429 * @brief Register to GATT based service to receive value change notification/indication.
5431 * This function is a synchronous call.
5432 * No event for this api.
5434 * @return BLUETOOTH_ERROR_NONE - Success \n
5435 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5436 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5437 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5440 * @param[in] service_handle - Handle for remote service.
5441 * @param[in] service_name - Friednly name of service uuid.
5446 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5449 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5451 * @brief Unregister GATT based service to receive value change notification/indication.
5453 * This function is a synchronous call.
5454 * No event for this api.
5456 * @return BLUETOOTH_ERROR_NONE - Success \n
5457 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5458 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5459 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5462 * @param[in] service_handle - Handle for remote service.
5467 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5470 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5471 * bt_gatt_char_property_t *characteristic);
5473 * @brief Provides characteristic value along with properties.
5475 * This function is a synchronous call.
5476 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5478 * @return BLUETOOTH_ERROR_NONE - Success \n
5479 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5480 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5481 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5484 * @param[in] char_handle - Handle for Characteristic property.
5485 * @param[out] characteristic - Structure containing remote characteristic property.
5488 * @see bluetooth_gatt_free_char_property()
5490 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5491 bt_gatt_char_property_t *characteristic);
5494 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5495 * bt_gatt_char_property_t *characteristic);
5497 * @brief Provides characteristic descriptor value along with its UUID.
5499 * This function is a synchronous call.
5500 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5502 * @return BLUETOOTH_ERROR_NONE - Success \n
5503 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5504 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5505 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5508 * @param[in] desc_handle - Handle for Characteristic descriptor.
5509 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5512 * @see bluetooth_gatt_free_desc_property()
5514 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5515 bt_gatt_char_descriptor_property_t *descriptor);
5519 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5520 * const guint8 *value, int length)
5522 * @brief Set characteristic value.
5524 * This function is a synchronous call.
5526 * @return BLUETOOTH_ERROR_NONE - Success \n
5527 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5528 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5529 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5532 * @param[in] char_handle - Handle for Characteristic property.
5533 * @param[in] value - New value to set for characteristic property.
5534 * @param[in] length - Length of the value to be set.
5539 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5540 const guint8 *value, int length);
5543 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5544 * const guint8 *value, int length, guint8 write_type)
5546 * @brief Set characteristic value by write type.
5548 * This function is a synchronous call if write type is "write without resonse"
5549 * and it is an asynchronous call if write type is "write with response"
5551 * @return BLUETOOTH_ERROR_NONE - Success \n
5552 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5553 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5554 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5557 * @param[in] char_handle - Handle for Characteristic property.
5558 * @param[in] value - New value to set for characteristic property.
5559 * @param[in] length - Length of the value to be set.
5560 * @param[in] write_type - Type of write.
5565 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5566 const guint8 *value, int length,
5567 guint8 write_type, gpointer app_data);
5571 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5572 * const guint8 *value, int length)
5574 * @brief Set characteristic value request.
5576 * This function is an asynchronous call.
5578 * @return BLUETOOTH_ERROR_NONE - Success \n
5579 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5580 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5581 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5584 * @param[in] char_handle - Handle for Characteristic property.
5585 * @param[in] value - New value to set for characteristic property.
5586 * @param[in] length - Length of the value to be set.
5591 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5592 const guint8 *value, int length);
5595 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5597 * @brief Read characteristic value.
5599 * This function is a asynchronous call.
5601 * @return BLUETOOTH_ERROR_NONE - Success \n
5602 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5603 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5604 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5607 * @param[in] char_handle - Handle for Characteristic property.
5612 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5615 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5616 * const char *service_uuid,
5617 * bt_gatt_service_property_t *service)
5619 * @brief Gets the service property from a device based on a particular uuid
5621 * This function is a synchronous call.
5623 * @return BLUETOOTH_ERROR_NONE - Success \n
5624 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5625 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5626 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5629 * @param[in] address - BD address of the remote device
5630 * @param[in] service_uuid - uuid of the service.
5631 * @param[out] service - Structure containing the service property.
5636 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5637 const char *service_uuid,
5638 bt_gatt_service_property_t *service);
5641 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5642 * const char *char_uuid)
5644 * @brief Gets the characteristic property from a service based on a particular char uuid
5646 * This function is an asynchronous call.
5647 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5649 * @return BLUETOOTH_ERROR_NONE - Success \n
5650 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5651 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5652 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5655 * @param[in] service_handle - Service handle.
5656 * @param[in] uuid - Characteristic uuid.
5661 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5662 const char *char_uuid);
5665 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5667 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5669 * This function is a synchronous call.
5670 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5672 * @return BLUETOOTH_ERROR_NONE - Success \n
5673 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5676 * @param[in] prim_svc - GATT handle info structure
5679 * @see bluetooth_gatt_get_primary_services()
5681 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5684 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5686 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5688 * This function is a synchronous call.
5689 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5691 * @return BLUETOOTH_ERROR_NONE - Success \n
5692 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5695 * @param[in] svc_pty - GATT service property structure.
5698 * @see bluetooth_gatt_get_service_property()
5700 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5703 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5705 * @brief Provides characteristic value along with properties.
5707 * This function is a synchronous call.
5708 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5710 * @return BLUETOOTH_ERROR_NONE - Success \n
5711 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5714 * @param[in] char_pty - GATT characteristics property structure.
5717 * @see bluetooth_gatt_get_characteristics_property()
5719 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5722 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5724 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5726 * This function is a synchronous call.
5727 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5729 * @return BLUETOOTH_ERROR_NONE - Success \n
5730 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5733 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5736 * @see bluetooth_gatt_get_char_descriptor_property()
5738 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5740 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5741 gboolean auto_connect, int client_id);
5743 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5746 int bluetooth_get_gatt_data_batching_available_packets(
5747 int *available_packets);
5749 int bluetooth_enable_gatt_data_batching(
5750 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5752 int bluetooth_disable_gatt_data_batching(
5753 const bluetooth_device_address_t *device_address);
5756 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5758 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5760 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5762 * @return BLUETOOTH_ERROR_NONE - Success \n
5763 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5766 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5770 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5773 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5775 * @brief Read characteristic descriptor value.
5777 * This function is a asynchronous call.
5779 * @return BLUETOOTH_ERROR_NONE - Success \n
5780 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5781 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5782 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5785 * @param[in] desc_handle - Handle for Characteristic descriptor
5790 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5793 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5794 * const guint8 *value, int length);
5796 * @brief Set characteristic descriptor value.
5798 * This function is a asynchronous call.
5800 * @return BLUETOOTH_ERROR_NONE - Success \n
5801 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5802 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5803 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5806 * @param[in] desc_handle - Handle for Characteristic descriptor
5807 * @param[in] value - New value to set for characteristic descriptor
5808 * @param[in] length - Length of the value to be set.
5813 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5814 const guint8 *value, int length, gpointer app_data);
5816 /* @fn int bluetooth_gatt_init(void)
5818 * @brief Initializes the gatt service.
5820 * This function is a synchronous call.
5821 * @return BLUETOOTH_ERROR_NONE - Success \n
5822 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5823 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5824 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5827 * @remark Adapter should be enabled
5828 * @see bluetooth_gatt_deinit()
5830 int bluetooth_gatt_init(void);
5832 /* @fn int bluetooth_gatt_init(void)
5834 * @brief DeInitializes the gatt service.
5836 * This function is a synchronous call.
5837 * @return BLUETOOTH_ERROR_NONE - Success \n
5838 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5839 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5840 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5843 * @remark Adapter should be enabled
5844 * @see bluetooth_gatt_init()
5846 int bluetooth_gatt_deinit(void);
5848 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5849 unsigned char **svc_path)
5851 * @brief Exports a new gatt service to the service interface.
5853 * This function is a synchronous call.
5855 * @return BLUETOOTH_ERROR_NONE - Success \n
5856 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5857 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5858 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5861 * @param[in] svc_uuid Gatt service uuid.
5862 * @param[out] svc_path service object path of the exported service.
5863 * @remark Adapter should be enabled
5864 * @see bluetooth_gatt_init()
5866 int bluetooth_gatt_add_service(const char *svc_uuid,
5869 /* @fn int bluetooth_gatt_add_new_characteristic(
5870 const char *svc_path, const char *char_uuid,
5871 bt_gatt_permission_t permissions,
5872 bt_gatt_characteristic_property_t properties,
5873 int flags_length, char **char_path);;
5875 * @brief Exports a new gatt characteristic to the characteristic interface.
5877 * This function is a synchronous call.
5878 * @return BLUETOOTH_ERROR_NONE - Success \n
5879 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5880 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5881 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5883 * @param[in] svc_path service object path of the exported service.
5884 * @param[in] char_uuid Gatt service uuid.
5885 * @param[in] properties GATT characteristic properties.
5886 * @param[out] char_path characteristic object path of the exported characteristic.
5888 * @remark Adapter should be enabled
5889 * @see bluetooth_gatt_add_service()
5891 int bluetooth_gatt_add_new_characteristic(
5892 const char *svc_path, const char *char_uuid,
5893 bt_gatt_permission_t permissions,
5894 bt_gatt_characteristic_property_t properties,
5897 /* @fn bluetooth_gatt_set_characteristic_value(
5898 const char *characteristic, const char *char_value,
5901 * @brief adds gatt charactertisic value to the given charactertistic path.
5903 * This function is a synchronous call.
5904 * @return BLUETOOTH_ERROR_NONE - Success \n
5905 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5906 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5907 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5909 * @param[in] char_value Value of the GATT characteristic to be added.
5910 * @param[in] value_length length of the chantacteristic value..
5911 * @param[out] characteristic characteristic object path..
5913 * @remark Adapter should be enabled
5914 * @see bluetooth_gatt_add_service()
5916 int bluetooth_gatt_set_characteristic_value(
5917 const char *characteristic, const char *char_value,
5920 /* @fn int bluetooth_gatt_add_descriptor(
5921 const char *char_path, const char *desc_uuid,
5922 bt_gatt_permission_t permissions,
5925 * @brief Exports a new gatt descriptor to the descriptor interface.
5927 * This function is a synchronous call.
5929 * @return BLUETOOTH_ERROR_NONE - Success \n
5930 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5931 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5932 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5935 * @param[in] desc_uuid Gatt descriptor uuid.
5936 * @param[in] desc_value GATT descriptor value.
5937 * @param[in] value_length Length of GATT descriptor value.
5938 * @param[in] permissions descriptor permissions.
5939 * @param[in] properties GATT descriptor properties.
5940 * @param[in] char_path characteristics object path of the exported character.
5942 * @remark Adapter should be enabled
5943 * @see bluetooth_gatt_add_service()
5944 * @see bluetooth_gatt_add_characteristics()
5946 int bluetooth_gatt_add_descriptor(
5947 const char *char_path, const char *desc_uuid,
5948 bt_gatt_permission_t permissions,
5951 /* @fn int bluetooth_gatt_set_descriptor_value(
5952 const char *desc_path, const char *desc_value,
5955 * @brief Adds value to the given descriptor handle.
5957 * This function is a synchronous call.
5959 * @return BLUETOOTH_ERROR_NONE - Success \n
5960 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5961 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5962 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5965 * @param[in] desc_value GATT descriptor value.
5966 * @param[in] value_length Length of GATT descriptor value.
5967 * @param[in] desc_path descriptor path to which the value needs to be added.
5969 * @remark Adapter should be enabled
5970 * @see bluetooth_gatt_add_service()
5971 * @see bluetooth_gatt_add_characteristics()
5973 int bluetooth_gatt_set_descriptor_value(
5974 const char *desc_path, const char *desc_value,
5977 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5979 * @brief Reads the Service registered on manager interface.
5981 * This function is a synchronous call.
5983 * @return BLUETOOTH_ERROR_NONE - Success \n
5984 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5985 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5986 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5989 * @param[in] svc_uuid Gatt Service uuid.
5991 * @remark Adapter should be enabled and service should be registered.
5992 * @see bluetooth_gatt_register_service()
5994 int bluetooth_gatt_get_service(const char *svc_uuid);
5996 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5998 * @brief Registers the given service path with the library.
6000 * This function is a synchronous call.
6002 * @return BLUETOOTH_ERROR_NONE - Success \n
6003 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6004 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6005 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6008 * @param[in] svc_path service object path of the exported service.
6010 * @remark Adapter should be enabled
6011 * @see bluetooth_gatt_add_service()
6012 * @see bluetooth_gatt_add_characteristics()
6013 * @see bluetooth_gatt_add_descriptor()
6014 * @see bluetooth_gatt_register_application()
6016 int bluetooth_gatt_register_service(const char *svc_path);
6018 /* @fn int bluetooth_gatt_register_application(void)
6020 * @brief Registers the application with the bluez gatt server.
6022 * This function is a synchronous call.
6024 * @return BLUETOOTH_ERROR_NONE - Success \n
6025 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6026 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6027 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6031 * @remark Adapter should be enabled
6032 * @see bluetooth_gatt_init()
6033 * @see bluetooth_gatt_add_service()
6034 * @see bluetooth_gatt_add_characteristics()
6035 * @see bluetooth_gatt_add_descriptor()
6036 * @see bluetooth_gatt_register_service()
6038 int bluetooth_gatt_register_application(void);
6040 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
6042 * @brief Removes(unregister) service from the bluez gatt server db.
6044 * This function is a synchronous call.
6046 * @return BLUETOOTH_ERROR_NONE - Success \n
6047 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6048 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6049 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6052 * @param[in] svc_path service object path of the exported service.
6054 * @remark Adapter should be enabled
6055 * @see bluetooth_gatt_add_service()
6056 * @see bluetooth_gatt_add_characteristics()
6057 * @see bluetooth_gatt_add_descriptor()
6058 * @see bluetooth_gatt_register_service()
6060 int bluetooth_gatt_unregister_service(const char *svc_path);
6062 /* @fn int bluetooth_gatt_unregister_application(void)
6064 * @brief Removes(unregister) the application with the bluez gatt server,
6065 * and deletes all the service registered.
6067 * This function is a synchronous call.
6069 * @return BLUETOOTH_ERROR_NONE - Success \n
6070 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6071 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6072 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6076 * @remark Adapter should be enabled
6077 * @see bluetooth_gatt_init()
6078 * @see bluetooth_gatt_add_service()
6079 * @see bluetooth_gatt_add_characteristics()
6080 * @see bluetooth_gatt_add_descriptor()
6081 * @see bluetooth_gatt_register_service()
6082 * @see bluetooth_gatt_unregister_service()
6084 int bluetooth_gatt_unregister_application(void);
6086 /* @fn int bluetooth_gatt_send_response(int request_id,
6087 * int offset, char *value, int value_length)
6089 * @brief Updates the attribute value in local attribute list.
6091 * This function is a synchronous call.
6093 * @return BLUETOOTH_ERROR_NONE - Success \n
6094 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6095 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6096 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6099 * @param[in] request_id The identification of a read request
6100 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6101 * @param[in] resp_state The identification of response state
6102 * @param[in] offset The offset from where a value is read
6103 * @param[in] value The value to be sent. It will be sent from @a offset.
6104 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6105 * @param[in] value_length Value Length.
6107 * @remark Adapter should be enabled
6108 * @see bluetooth_gatt_add_service()
6109 * @see bluetooth_gatt_add_characteristics()
6110 * @see bluetooth_gatt_add_descriptor()
6111 * @see bluetooth_gatt_register_service()
6113 int bluetooth_gatt_send_response(int request_id, guint req_type,
6114 int resp_state, int offset, char *value, int value_length);
6116 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6118 * @brief Sets the notification property for a characteristic.
6120 * This function is a synchronous call.
6122 * @return BLUETOOTH_ERROR_NONE - Success \n
6123 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6124 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6125 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6128 * @param[in] char_path characteristic object path.
6129 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6131 * @remark Adapter should be enabled
6132 * @see bluetooth_gatt_update_characteristic()
6134 int bluetooth_gatt_server_set_notification(const char *char_path,
6135 bluetooth_device_address_t *unicast_address);
6137 /* @fn int bluetooth_gatt_delete_services(void)
6139 * @brief deletes (unregisters) all services from the gatt server database..
6141 * This function is a synchronous call.
6143 * @return BLUETOOTH_ERROR_NONE - Success \n
6144 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6145 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6146 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6150 * @remark Adapter should be enabled
6151 * @see bluetooth_gatt_add_service()
6152 * @see bluetooth_gatt_add_characteristics()
6153 * @see bluetooth_gatt_add_descriptor()
6154 * @see bluetooth_gatt_register_service()
6155 * @see bluetooth_gatt_unregister_service()
6157 int bluetooth_gatt_delete_services(void);
6159 /* @fn int bluetooth_gatt_update_characteristic(void)
6161 * @brief updates the given characteristic with a new value
6163 * This function is a synchronous call.
6165 * @return BLUETOOTH_ERROR_NONE - Success \n
6166 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6167 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6168 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6172 * @remark Adapter should be enabled
6173 * @see bluetooth_gatt_add_service()
6174 * @see bluetooth_gatt_add_characteristics()
6175 * @see bluetooth_gatt_add_descriptor()
6176 * @see bluetooth_gatt_register_service()
6177 * @see bluetooth_gatt_unregister_service()
6179 int bluetooth_gatt_update_characteristic(const char *char_path,
6180 const char* char_value, int value_length);
6183 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6185 * @brief Set advertising status.
6187 * This function is used to enable or disable LE advertising.
6188 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6190 * This function is a synchronous call.
6192 * @return BLUETOOTH_ERROR_NONE - Success \n
6193 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6194 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6197 * @param[in] enable - The status of advertising
6200 * @see bluetooth_set_advertising_data
6202 int bluetooth_set_advertising(int handle, gboolean enable);
6205 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6207 * @brief Set advertising status along with interval value.
6209 * This function is used to enable or disable LE advertising.
6210 * Interval_min and Interval_max is used to set the best advertising interval.
6211 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6213 * This function is a synchronous call.
6215 * @return BLUETOOTH_ERROR_NONE - Success \n
6216 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6217 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6220 * @param[in] enable - The status of advertising
6221 * @param[in] interval_min - Minimum interval of advertising (msec)
6222 * @param[in] interval_max - Maximum interval of advertising (msec)
6223 * @param[in] filter_policy - Advertising filter policy
6226 * @see bluetooth_set_advertising_data
6228 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6229 bluetooth_advertising_params_t *params);
6232 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6233 * @brief Get the advertising data
6235 * This function is used to get advertising data.
6236 * Before calling this API, the adapter should be enabled.
6238 * This function is a synchronous call.
6240 * @return BLUETOOTH_ERROR_NONE - Success \n
6241 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6242 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6243 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6245 * @param[out] value - Advertising data structure.
6246 * @param[out] length - The length of Advertising data.
6250 bluetooth_advertising_data_t *value = { {0} };
6253 ret = bluetooth_get_advertising_data(&value, &length);
6256 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6259 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6261 * @brief Set advertising data with value
6263 * This function is used to set advertising data and Maximum size of advertising data
6264 * is 28 byte (Except Flag)
6266 * This function is a synchronous call.
6268 * @return BLUETOOTH_ERROR_NONE - Success \n
6269 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6270 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6273 * @param[in] value - Advertising data structure.
6277 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6280 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6282 * @brief Check the privilege for advertising parameter setting
6284 * This function is a synchronous call.
6286 * @return BLUETOOTH_ERROR_NONE - Success \n
6287 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6293 int bluetooth_check_privilege_advertising_parameter(void);
6296 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6297 * @brief Get the LE scan response data
6299 * This function is used to get scan response data.
6300 * Before calling this API, the adapter should be enabled.
6302 * This function is a synchronous call.
6304 * @return BLUETOOTH_ERROR_NONE - Success \n
6305 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6306 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6307 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6309 * @param[out] value - Scan response data structure.
6310 * @param[out] length - The length of Scan response data.
6314 bluetooth_scan_resp_data_t *value = { {0} };
6317 ret = bluetooth_get_scan_response_data(&value, &length);
6320 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6323 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6325 * @brief Set scan response data with value
6327 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6329 * This function is a synchronous call.
6331 * @return BLUETOOTH_ERROR_NONE - Success \n
6332 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6333 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6336 * @param[in] value - LE Scan response data structure.
6340 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6343 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6345 * @brief Set scan interval and window
6347 * This function is used to set LE scan interval and window size
6349 * This function is a synchronous call.
6351 * @return BLUETOOTH_ERROR_NONE - Success \n
6352 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6353 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6356 * @param[in] interval - Interval of LE scan (msec)
6357 * @param[in] window - Window size of LE scan (msec)
6361 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6364 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6366 * @brief Set scan type
6368 * This function is used to set LE scan type
6370 * This function is a synchronous call.
6372 * @return BLUETOOTH_ERROR_NONE - Success \n
6373 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6374 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6377 * @param[in] scan_type - LE scan type
6381 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6384 * @fn int bluetooth_is_advertising(void)
6385 * @brief Check for the advertising is in-progress or not.
6387 * This API is used to check the current status of the advertising procedure.
6388 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6391 * This function checks whether the advertising is started or not.
6393 * This function is a synchronous call.
6395 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6397 * @return BLUETOOTH_ERROR_NONE - Success \n
6398 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6401 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6405 gboolean is_advertising = 0;
6407 ret = bluetooth_is_advertising(&is_advertising);
6410 int bluetooth_is_advertising(gboolean *is_advertising);
6413 * @fn int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6414 * @brief Add LE device to allow list
6416 * This API is used to add LE device to allow list
6417 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6421 * This function is a synchronous call.
6423 * @param[in] address The address of remote device
6425 * @return BLUETOOTH_ERROR_NONE - Success \n
6426 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6429 * @see bluetooth_set_custom_advertising
6431 int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6434 * @fn int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6435 * @brief Remove LE device from allow list
6437 * This API is used to remove LE device from allow list
6438 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6442 * This function is a synchronous call.
6444 * @param[in] address The address of remote device
6446 * @return BLUETOOTH_ERROR_NONE - Success \n
6447 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6450 * @see bluetooth_set_custom_advertising
6452 int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6455 * @fn int bluetooth_clear_allow_list(void)
6456 * @brief Clear allow list
6458 * This API is used to clear allow list
6459 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6463 * This function is a synchronous call.
6465 * @param[in] address The address of remote device
6467 * @return BLUETOOTH_ERROR_NONE - Success \n
6468 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6471 * @see bluetooth_set_custom_advertising
6473 int bluetooth_clear_allow_list(void);
6476 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6477 * const bluetooth_le_connection_param_t *parameters)
6478 * @brief update connection paramter of LE connection.
6480 * This function is a synchronous call.
6482 * @return BLUETOOTH_ERROR_NONE - Success \n
6483 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6486 * @param[in] address - remote device address value.
6487 * @param[in] parameters - new connection parameters.
6490 * @see bluetooth_bond_device
6492 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6493 const bluetooth_le_connection_param_t *parameters);
6496 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6498 * @brief Enable/Disable LE Privacy feature.
6500 * This function is used to enable or disable LE Privacy feature.
6501 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6503 * This function is a synchronous call.
6505 * @return BLUETOOTH_ERROR_NONE - Success \n
6506 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6507 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6510 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6514 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6517 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6519 * @brief Enable/Disable LE static random address.
6521 * This function is used to enable or disable LE static random address.
6523 * This function is a synchronous call.
6525 * @return BLUETOOTH_ERROR_NONE - Success \n
6526 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6527 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6530 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6534 int bluetooth_set_le_static_random_address(gboolean enable);
6537 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6538 * bluetooth_le_connection_mode_t mode)
6539 * @brief update connection paramter of LE connection.
6541 * This function is a synchronous call.
6543 * @return BLUETOOTH_ERROR_NONE - Success \n
6544 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6545 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6548 * @param[in] address - remote device address value.
6549 * @param[in] mode - new connection mode.
6553 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6554 bluetooth_le_connection_mode_t mode);
6557 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6558 * @brief Request for new ATT MTU value.
6560 * This function is a asynchronous call.
6562 * @return BLUETOOTH_ERROR_NONE - Success \n
6563 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6564 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6567 * @param[in] address - remote device address value.
6568 * @param[in] mtu - MTU value to be set.
6572 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6575 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6576 * unsigned int *mtu)
6577 * @brief Gets the xisting MTU value set for a connection.
6579 * This function is a synchronous call.
6581 * @return BLUETOOTH_ERROR_NONE - Success \n
6582 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6583 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6586 * @param[in] address - remote device address value.
6587 * @param[out] mtu - MTU value set for the connection.
6591 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6595 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6596 * bluetooth_device_address_t *id_address)
6597 * @brief Gets the Identity address of remote device.
6599 * This function is a synchronous call.
6601 * @return BLUETOOTH_ERROR_NONE - Success \n
6602 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6603 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6606 * @param[in] device_rpa - remote Resolvable private address.
6607 * @param[out] id_address - remote Identity device address value.
6611 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6612 bluetooth_device_address_t *id_address);
6615 * @fn int bluetooth_le_read_maximum_data_length()
6616 * @brief reads the maximum LE data length supported in the controller.
6618 * This function is a synchronous call.
6620 * @return BLUETOOTH_ERROR_NONE - Success \n
6621 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6627 int bluetooth_le_read_maximum_data_length(
6628 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6630 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6631 * @brief writes the host suggested values for the controllers max transmitted no of payload
6632 * octects to be used for new connections.
6634 * This function is a synchronous call.
6636 * @return BLUETOOTH_ERROR_NONE - Success \n
6637 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6643 int bluetooth_le_write_host_suggested_default_data_length(
6644 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6646 int bluetooth_le_read_suggested_default_data_length(
6647 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6649 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6650 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6652 int bluetooth_pbap_init(void);
6653 int bluetooth_pbap_deinit(void);
6654 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6655 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6656 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6657 bt_pbap_folder_t *folder);
6658 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6659 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6660 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6661 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6662 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6663 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6664 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6665 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6668 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6670 * @brief Set manufacturer data with value
6672 * This function is used to set manufacturer data.
6674 * This function is a synchronous call.
6676 * @return BLUETOOTH_ERROR_NONE - Success \n
6677 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6678 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6681 * @param[in] value - Manufacturer data structure.
6685 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6687 int bluetooth_set_passkey_notification(gboolean enable);
6690 * @fn int bluetooth_dpm_is_mode_allowed(void);
6692 * @brief Checks Restriction for BT mode(BT allowed or not)
6694 * This function is a synchronous call.
6696 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6697 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6698 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6705 int bluetooth_dpm_is_mode_allowed(void);
6708 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6710 * @brief Sets Restriction for BT mode(BT allowed or not)
6712 * This function is a synchronous call.
6714 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6715 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6716 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6719 * @param[in] value - BT Allow value.
6720 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6721 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6722 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6723 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6727 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6730 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6732 * @brief Reads the Restriction for BT mode(BT allowed or not)
6734 * This function is a synchronous call.
6736 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6737 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6738 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6742 * @param[out] value - BT Allow value.
6743 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6744 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6745 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6746 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6750 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6753 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6755 * @brief Sets the Restriction for device.
6757 * This function is a synchronous call.
6759 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6760 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6761 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6764 * @param[in] value - State value.
6765 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6766 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6770 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6773 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6775 * @brief Reads the Restriction for device.
6777 * This function is a synchronous call.
6779 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6780 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6781 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6785 * @param[out] value - State value.
6786 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6787 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6791 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6794 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6796 * @brief Sets the Restriction for uuid.
6798 * This function is a synchronous call.
6800 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6801 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6802 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6805 * @param[in] value - State value.
6806 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6807 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6811 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6814 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6816 * @brief Reads the Restriction for uuid.
6818 * This function is a synchronous call.
6820 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6821 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6822 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6826 * @param[out] value - State value.
6827 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6828 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6832 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6835 * @fn int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
6837 * @brief Adds the device to blocklist.
6839 * This function is a synchronous call.
6841 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6842 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6843 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6846 * @param[in] device_address - Device address
6850 int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
6853 * @fn int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
6855 * @brief Adds the device to allowlist.
6857 * This function is a synchronous call.
6859 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6860 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6861 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6864 * @param[in] device_address - Device address
6868 int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
6871 * @fn int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
6873 * @brief Adds the Service UUIDS to blocklist.
6875 * This function is a synchronous call.
6877 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6878 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6879 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6882 * @param[in] service_uuids - profile or custom service uuids
6886 int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
6889 * @fn int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
6891 * @brief Adds the Service UUIDS to allowlist.
6893 * This function is a synchronous call.
6895 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6896 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6897 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6900 * @param[in] service_uuids - profile or custom service uuids
6904 int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
6907 * @fn int bluetooth_dpm_clear_devices_from_blocklist();
6909 * @brief Clears the devices from blocklist.
6911 * This function is a synchronous call.
6913 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6914 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6915 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6922 int bluetooth_dpm_clear_devices_from_blocklist(void);
6925 * @fn int bluetooth_dpm_clear_devices_from_allowlist();
6927 * @brief Clears the devices from allowlist.
6929 * This function is a synchronous call.
6931 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6932 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6933 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6940 int bluetooth_dpm_clear_devices_from_allowlist(void);
6943 * @fn int bluetooth_dpm_clear_uuids_from_blocklist();
6945 * @brief Clears the uuids from blocklist.
6947 * This function is a synchronous call.
6949 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6950 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6951 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6958 int bluetooth_dpm_clear_uuids_from_blocklist(void);
6961 * @fn int bluetooth_dpm_clear_uuids_from_allowlist();
6963 * @brief Clears the uuids from allowlist.
6965 * This function is a synchronous call.
6967 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6968 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6969 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6976 int bluetooth_dpm_clear_uuids_from_allowlist(void);
6979 * @fn int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
6981 * @brief reads the devices from blocklist.
6983 * This function is a synchronous call.
6985 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6986 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6987 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6990 * @param[out] device_list - list of devices
6994 int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
6997 * @fn int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
6999 * @brief reads the devices from allowlist.
7001 * This function is a synchronous call.
7003 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7004 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7005 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7008 * @param[out] device_list - list of devices
7012 int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7015 * @fn int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7017 * @brief reads the uuids from blocklist.
7019 * This function is a synchronous call.
7021 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7022 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7023 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7026 * @param[in] uuid_list - list of uuids
7030 int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7033 * @fn int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7035 * @brief reads the uuids from allowlist.
7037 * This function is a synchronous call.
7039 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7040 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7041 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7044 * @param[in] uuid_list - list of uuids
7048 int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7051 * @fn int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7053 * @brief Removes the device from allowlist.
7055 * This function is a synchronous call.
7057 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7058 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7059 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7062 * @param[in] device_address - Device address
7066 int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7069 * @fn int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7071 * @brief Removes the device from blocklist.
7073 * This function is a synchronous call.
7075 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7076 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7077 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7080 * @param[in] device_address - Device address
7084 int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7087 * @fn int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7089 * @brief Removes the Service UUIDS from allowlist.
7091 * This function is a synchronous call.
7093 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7094 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7095 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7098 * @param[in] service_uuids - profile or custom service uuids
7102 int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7105 * @fn int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7108 * @brief Removes the Service UUIDS from blocklist.
7110 * This function is a synchronous call.
7112 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7113 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7114 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7117 * @param[in] service_uuids - profile or custom service uuids
7121 int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7124 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7126 * @brief Sets the Restriction for outgoing call.
7128 * This function is a synchronous call.
7130 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7131 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7132 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7135 * @param[in] value - State value.
7136 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7137 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7141 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7144 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7146 * @brief Reads the Restriction for outgoing call.
7148 * This function is a synchronous call.
7150 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7151 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7152 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7156 * @param[out] value - State value.
7157 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7158 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7162 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7165 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7167 * @brief Sets the Restriction for Pairing.
7169 * This function is a synchronous call.
7171 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7172 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7173 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7176 * @param[in] value - State value.
7177 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7178 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7182 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7185 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7187 * @brief Reads the Restriction for Pairing
7189 * This function is a synchronous call.
7191 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7192 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7193 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7197 * @param[out] value - State value.
7198 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7199 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7203 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7206 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7208 * @brief Sets the Restriction for using Profiles.
7210 * This function is a synchronous call.
7212 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7213 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7214 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7217 * @param[in]profile - Profile.
7218 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7219 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7220 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7221 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7222 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7223 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7224 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7225 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7226 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7227 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7228 * BLUETOOTH_DPM_PROFILE_NONE
7229 * @param[in] value - State value.
7230 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7231 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7235 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7238 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7240 * @brief Reads the Restriction for using Profiles.
7242 * This function is a synchronous call.
7244 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7245 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7246 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7249 * @param[in]profile - Profile.
7250 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7251 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7252 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7253 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7254 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7255 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7256 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7257 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7258 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7259 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7260 * BLUETOOTH_DPM_PROFILE_NONE
7261 * @param[out] value - State value.
7262 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7263 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7267 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7270 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7272 * @brief Sets the Restriction for Desktop Connectivity.
7274 * This function is a synchronous call.
7276 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7277 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7278 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7281 * @param[in] value - State value.
7282 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7283 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7287 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7290 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7292 * @brief Reads the Restriction for Desktop Connectivity.
7294 * This function is a synchronous call.
7296 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7297 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7298 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7302 * @param[out] value - State value.
7303 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7304 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7308 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7311 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7313 * @brief Sets the Restriction for Discoverable state.
7315 * This function is a synchronous call.
7317 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7318 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7319 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7322 * @param[in] value - State value.
7323 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7324 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7328 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7331 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7333 * @brief Reads the Restriction for Discoverable state.
7335 * This function is a synchronous call.
7337 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7338 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7339 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7343 * @param[out] value - State value.
7344 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7345 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7349 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7352 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7354 * @brief Sets the Restriction for linited discoverable state..
7356 * This function is a synchronous call.
7358 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7359 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7360 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7363 * @param[in] value - State value.
7364 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7365 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7369 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7372 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7374 * @brief Reads the Restriction for limited discoverable state.
7376 * This function is a synchronous call.
7378 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7379 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7380 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7384 * @param[out] value - State value.
7385 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7386 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7390 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7392 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7394 * @brief Sets the Restriction for Data trasnfer.
7396 * This function is a synchronous call.
7398 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7399 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7400 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7403 * @param[in] value - State value.
7404 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7405 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7409 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7413 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7415 * @brief Reads the Restriction for Data trasnfer.
7417 * This function is a synchronous call.
7419 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7420 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7421 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7425 * @param[out] value - State value.
7426 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7427 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7431 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7434 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7435 * bluetooth_pxp_poperty_t property, int value);
7437 * @brief Sets the Proximity alert level/properties for monitor role.
7439 * This function is a synchronous call.
7441 * @return BLUETOOTH_ERROR_NONE - Success \n
7442 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7443 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7444 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7447 * @param[in] device_address remote device address
7448 * @param[in] property proximity profile property
7449 * @param[in] value alert level/property value to be set
7454 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7455 bluetooth_pxp_poperty_t property, int value);
7458 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7459 * bluetooth_pxp_poperty_t property, int *value);
7461 * @brief Reads the Proximity alert level/properties for monitor role.
7463 * This function is a synchronous call.
7465 * @return BLUETOOTH_ERROR_NONE - Success \n
7466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7467 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7468 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7471 * @param[in] device_address remote device address
7472 * @param[in] property proximity profile property
7473 * @param[out] value alert level/property value
7477 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7478 bluetooth_pxp_poperty_t property, int *value);
7481 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7482 * int *services_supported);
7484 * @brief Reads the Proximity Monitor profile supported properties/services.
7486 * This function is a synchronous call.
7488 * @return BLUETOOTH_ERROR_NONE - Success \n
7489 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7490 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7491 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7494 * @param[in] device_address remote device address
7495 * @param[out] services_supported proximity profile property/service
7499 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7500 int *services_supported);
7503 * @fn int bluetooth_proximity_reporter_register();
7505 * @brief Register all proximity related services in BlueZ.
7507 * This function is a synchronous call.
7509 * @return BLUETOOTH_ERROR_NONE - Success \n
7510 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7516 int bluetooth_proximity_reporter_register(void);
7519 * @fn int bluetooth_proximity_reporter_unregister();
7521 * @brief Unregister all proximity related services in BlueZ.
7523 * This function is a synchronous call.
7525 * @return BLUETOOTH_ERROR_NONE - Success \n
7526 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7532 int bluetooth_proximity_reporter_unregister(void);
7535 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7536 * bluetooth_pxp_poperty_t property, int *value);
7538 * @brief Reads the Proximity alert level/properties for reporter role.
7540 * This function is a synchronous call.
7542 * @return BLUETOOTH_ERROR_NONE - Success \n
7543 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7544 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7545 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7548 * @param[in] device_address remote device address
7549 * @param[in] property proximity profile property
7550 * @param[out] value alert level/property value
7554 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7555 bluetooth_pxp_poperty_t property, int *value);
7558 * @fn int bluetooth_tds_provider_register(void);
7560 * @brief Register Transport Discovery Provider role.
7562 * This function is a synchronous call.
7564 * @return BLUETOOTH_ERROR_NONE - Success \n
7565 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7566 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7567 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7575 int bluetooth_tds_provider_register(void);
7578 * @fn int bluetooth_tds_provider_unregister(void);
7580 * @brief Unregister Transport Discovery Provider role.
7582 * This function is a synchronous call.
7584 * @return BLUETOOTH_ERROR_NONE - Success \n
7585 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7586 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7587 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7595 int bluetooth_tds_provider_unregister(void);
7598 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7600 * @brief Create Transport Discovery Provider for a transport.
7602 * This function is a synchronous call.
7604 * @return BLUETOOTH_ERROR_NONE - Success \n
7605 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7606 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7607 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7610 * @param[in] Transport (BT, CUSTOM etc.)
7611 * @param[in] Unique handle for TDS provider.
7616 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7619 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7621 * @brief Remove previously created Transport Discovery Provider.
7623 * This function is a synchronous call.
7625 * @return BLUETOOTH_ERROR_NONE - Success \n
7626 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7629 * @param[in] Unique handle for previously created provider.
7634 int bluetooth_tds_provider_destroy(unsigned int handle);
7637 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7639 * @brief Set transport block for in advertisement and gatt db.
7641 * This function is a synchronous call.
7643 * @return BLUETOOTH_ERROR_NONE - Success \n
7644 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7645 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7646 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7649 * @param[in] Provider specific manufacturer data.
7650 * @param[in] Provider specific manufacturer data length.
7655 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7658 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7659 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7661 * @brief Set transport block for in advertisement and gatt db.
7663 * This function is a synchronous call.
7665 * @return BLUETOOTH_ERROR_NONE - Success \n
7666 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7667 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7668 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7671 * @param[in] Unique handle for TDS provider.
7672 * @param[in] Transport state (On/Off/Not Available).
7673 * @param[in] Transport specific data block.
7674 * @param[in] Transport specific data block length.
7679 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7680 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7683 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7684 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7686 * @brief Send response to TDS activation request from remoted device.
7688 * This function is a synchronous call.
7690 * @return BLUETOOTH_ERROR_NONE - Success \n
7691 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7692 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7693 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7696 * @param[in] Remote device BT address.
7697 * @param[in] Unique handle for TDS provider.
7698 * @param[in] Response for TDS activation request.
7699 * @param[in] Transport specific data block to be sent in activation response.
7700 * @param[in] Data block length.
7705 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7706 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7709 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7711 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7713 * This function is an asynchronous call.
7715 * @return BLUETOOTH_ERROR_NONE - Success \n
7716 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7717 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7718 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7719 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7722 * @param[in] device_address remote device address
7723 * @param[in] handle attribute handle
7725 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7726 * when TDS data is received from Remote provider
7728 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7729 const char *handle);
7732 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7734 * @brief Enables CCCD on Remote Provider.
7736 * This function is an asynchronous call.
7738 * @return BLUETOOTH_ERROR_NONE - Success \n
7739 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7740 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7741 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7742 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7745 * @param[in] device_address remote device address
7746 * @param[in] handle attribute handle
7748 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7749 * when Indication is enabled on Remote provider
7751 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7752 const char *handle);
7755 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7756 * unsigned char *buf, int length);
7757 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7759 * This function is an asynchronous call.
7761 * @return BLUETOOTH_ERROR_NONE - Success \n
7762 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7763 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7764 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7765 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7768 * @param[in] device_address remote device address
7769 * @param[in] handle attribute handle
7770 * @param[in] buf Control point activation param
7771 * @param[in] param length
7773 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7774 * is received from remote Provider
7776 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7777 unsigned char *buf, int length);
7780 * @fn int bluetooth_otp_server_init(const char *directory);
7782 * @brief Starts OTP server.
7784 * This function is a synchronous call.
7794 int bluetooth_otp_server_init(const char *directory);
7797 * @fn int bluetooth_otp_server_deinit();
7799 * @brief Stops OTP server.
7801 * This function is a synchronous call.
7811 int bluetooth_otp_server_deinit();
7814 * @fn int bluetooth_otp_enable_notification(const char *handle);
7816 * @brief Enable notification for remote OACP & OLCP characteristics.
7818 * This function is a synchronous call.
7828 int bluetooth_otp_enable_notification(const char *handle);
7831 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7832 * unsigned char *buf, int length);
7834 * @brief Write value on remote characteristics.
7836 * This function is a synchronous call.
7846 int bluetooth_otp_write_characteristics_value(const char *handle,
7847 unsigned char *buf, int length);
7850 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7852 * @brief Read value for remote characteristics.
7854 * This function is a synchronous call.
7864 int bluetooth_otp_read_characteristic_value(const char *handle);
7867 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7869 * @brief Read value for remote characteristics.
7871 * This function is a synchronous call.
7881 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7884 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7886 * @brief Read value for remote characteristics.
7888 * This function is a synchronous call.
7898 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7901 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7902 * @brief Check if Adapter supports LE 2M PHY feature or not.
7904 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7905 * in BT 5.0 specification.
7907 * This function is a synchronous call.
7909 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7910 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7911 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7912 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7913 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7917 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7920 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7921 * @brief Check if Adapter supports LE 2M CODED feature or not.
7923 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7924 * in BT 5.0 specification.
7926 * This function is a synchronous call.
7928 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7929 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7930 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7931 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7932 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
7936 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
7939 * @fn int bluetooth_l2cap_le_create_socket(int psm)
7940 * @brief Register l2cap_le socket with a specific PSM
7943 * This API register l2cap_le socket with the given PSM. The return value of this API is the socket
7944 * descriptor of the server.
7945 * This is the first API which is called to create the server. Once we created the server socket,
7946 * we will listen on that return socket.
7947 * So a bluetooth_l2cap_le_listen_and_accept should follow this API call. This is a synchronous call.
7950 * @return socket FD on Success \n
7951 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7952 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
7953 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
7954 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7955 * @param[in] int psm
7958 * @see bluetooth_l2cap_le_listen_and_accept, bluetooth_l2cap_le_remove_socket
7963 fd = bluetooth_l2cap_le_create_socket(test_psm);
7967 int bluetooth_l2cap_le_create_socket(int psm);
7970 * @fn int bluetooth_l2cap_le_remove_socket(int socket_fd)
7971 * @brief De-register the l2cap_le socket
7974 * This API deregister l2cap_le socket with the given socket fd. If the remote device is
7975 * already connected then we will receive the BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED with socket
7976 * descriptor else no event will come. We will call this API only after the
7977 * bluetooth_l2cap_le_listen_and_accept.
7978 * This is a synchronous call.
7980 * @return BLUETOOTH_ERROR_NONE - Success \n
7981 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7982 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7983 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7984 * @param[in] int socket_fd
7987 * @see bluetooth_l2cap_le_create_socket, bluetooth_l2cap_le_listen_and_accept
7990 void bt_event_callback(int event, bluetooth_event_param_t *param)
7994 case BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED:
7996 bluetooth_l2cap_le_connection_t *discon_ind =
7997 (bluetooth_l2cap_le_connection_t *)param->param_data;
7999 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
8007 fd = bluetooth_l2cap_le_create_socket(test_psm);
8008 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8010 ret = bluetooth_l2cap_le_remove_socket(fd);
8013 int bluetooth_l2cap_le_remove_socket(int socket_fd);
8016 * @fn int bluetooth_l2cap_le_server_disconnect(int socket_fd)
8017 * @brief Disconnect l2cap_le connection
8020 * Disconnect a specific(device node fd) l2cap_le connection. This is a Synchronous call and there
8021 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8024 * @return BLUETOOTH_ERROR_NONE - Success \n
8025 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8026 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8027 * @param[in] int socket_fd
8033 ret = bluetooth_l2cap_le_server_disconnect(g_ret_fd);
8035 printf("Disconnection failed");
8037 printf("Disconnection Success");
8041 int bluetooth_l2cap_le_server_disconnect(int socket_fd);
8044 * @fn int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection)
8045 * @brief L2CAP_LE socket listen
8048 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8049 * after the bluetooth_l2cap_le_create_socket API.
8050 * This API listen for the incoming connection and once it receives a connection, it will give
8051 * BLUETOOTH_EVENT_L2CAP_LE_CONNECTED
8052 * event to the application. This is an Asynchronous API call.
8055 * @return BLUETOOTH_ERROR_NONE - Success \n
8056 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8057 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8059 * @param[in] int socket_fd
8060 * @param[in] max pending connection.
8063 * @see bluetooth_l2cap_le_create_socket
8066 void bt_event_callback(int event, bluetooth_event_param_t* param)
8070 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8072 bluetooth_l2cap_le_connection_t *conn_ind =
8073 (bluetooth_l2cap_le_connection_t *)param->param_data;
8075 printf("\nConnected from FD %d", conn_ind->socket_fd);
8083 fd = bluetooth_l2cap_le_create_socket(test_psm);
8084 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8088 int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection);
8091 * @fn int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection)
8092 * @brief L2cap_le socket listen
8095 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8096 * after the bluetooth_l2cap_le_create_socket API.
8097 * This API listen for the incoming connection and once it receives a connection, it will give
8098 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE
8099 * event to the application. This is an Asynchronous API call.
8102 * @return BLUETOOTH_ERROR_NONE - Success \n
8103 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8104 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8106 * @param[in] int socket_fd
8107 * @param[in] max pending connection.
8110 * @see bluetooth_l2cap_le_create_socket
8113 void bt_event_callback(int event, bluetooth_event_param_t* param)
8117 case BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE:
8119 char *name = (char *)param->param_data;
8121 printf("\nConnected from %s", name);
8123 bluetooth_l2cap_le_accept_connection();
8131 fd = bluetooth_l2cap_le_create_socket(test_psm);
8132 ret = bluetooth_l2cap_le_listen(fd, 1);
8136 int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection);
8139 * @fn int bluetooth_l2cap_le_accept_connection()
8140 * @brief Accepts the authorization request indicated by the event
8141 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8143 * This function is a synchronous call.
8145 * @return BLUETOOTH_ERROR_NONE - Success \n
8146 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8148 * @param[in] the socket fd of the server
8149 * @param[out] the socket fd of the client
8153 * @see bluetooth_l2cap_le_reject_connection
8155 int bluetooth_l2cap_le_accept_connection(int server_fd);
8158 * @fn int bluetooth_l2cap_le_reject_connection()
8159 * @brief Rejects the authorization request indicated by the event
8160 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8162 * This function is a synchronous call.
8164 * @return BLUETOOTH_ERROR_NONE - Success \n
8165 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8167 * @param[in] the socket fd of the server
8171 * @see bluetooth_l2cap_le_accept_connection
8173 int bluetooth_l2cap_le_reject_connection(int server_fd);
8176 * @fn gboolean bluetooth_l2cap_le_is_server_psm_available(int psm)
8177 * @brief Informs whether l2cap_le server psm is available or not.
8179 * This function is a synchronous call.
8181 * @return TRUE - L2CAP_LE PSM is available \n
8182 * FALSE - L2CAP_LE PSM is not available \n
8184 * @param[in] psm (int)
8190 gboolean bluetooth_l2cap_le_is_server_psm_available(int psm);
8193 * @fn int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8195 * @brief Connect to the remote device l2cap_le *
8197 * Connect to a specific l2cap_le socket on a remote device psm. This is a Async call. Once
8198 * the connection is successful callback BLUETOOTH_EVENT_L2CAP_LE_CONNECTED events is generated,
8199 * which contains the socket_fd, device role (L2CAP_LE_ROLE_SERVER/L2CAP_LE_ROLE_CLIENT), device addess
8200 * etc. The socket_fd can be further used to send the data. It better to do a ble scanning before
8201 * initiating a connection.
8203 * @return BLUETOOTH_ERROR_NONE - Success \n
8204 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8205 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8206 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
8207 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
8208 * @param[in] bluetooth_device_address_t remote bt_address
8209 * @param[in] int psm
8211 * @see bluetooth_l2cap_le_disconnect, bluetooth_l2cap_le_write
8215 void bt_event_callback(int event, bluetooth_event_param_t *param)
8219 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8221 bluetooth_l2cap_le_connection_t *conn_ind =
8222 (bluetooth_l2cap_le_connection_t *)param->param_data;
8224 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
8225 (conn_ind->device_role == L2CAP_LE_ROLE_SERVER) ?
8226 "SERVER" : "CLIENT");
8231 bluetooth_device_address_t remote_address = {{0},};
8232 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
8233 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
8235 ret = bluetooth_l2cap_le_connect(&remote_address, test_psm);
8237 printf("Connection failed, Reason = %d", ret);
8239 printf("Connection Success, Ret = %d", ret);
8243 int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8247 * @fn int bluetooth_l2cap_le_disconnect(int socket_fd)
8248 * @brief Disconnect l2cap_le connection
8251 * Disconnect a specific(device node fd) L2CAP_LE connection. This is a Synchronous call and there
8252 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8255 * @return BLUETOOTH_ERROR_NONE - Success \n
8256 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8257 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8258 * @param[in] int remote socket_fd
8261 * @see bluetooth_l2cap_le_connect
8265 ret = bluetooth_l2cap_le_disconnect(g_ret_fd);
8267 printf("Disconnection failed");
8269 printf("Disconnection Success");
8274 int bluetooth_l2cap_le_disconnect(int socket_fd);
8277 * @fn int bluetooth_l2cap_le_write (int fd, const char *buf, int length)
8278 * @brief Write to l2cap_le connection
8281 * This API is used to send the data over the l2cap_le connection. This is a
8282 * synchronous API. The same API is used to send the data for server and the client.
8284 * @return BLUETOOTH_ERROR_NONE - Success \n
8285 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8286 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
8288 * @param[in] const char *buff Data buffer to send
8289 * @param[in] int length Length of the data
8292 * @see bluetooth_l2cap_le_connect
8295 char *buff = "Test data 123456789"
8296 ret = bluetooth_l2cap_le_write(g_ret_fd, buff, 15);
8298 printf("Send failed");
8300 printf("Send success");
8304 int bluetooth_l2cap_le_write(int fd, const char *buf, int length);
8307 * @fn gboolean bluetooth_l2cap_le_client_is_connected(
8308 * const bluetooth_device_address_t *device_address, gboolean *connected)
8309 * @brief Informs whether l2cap_le client is connected.
8311 * This function is a synchronous call.
8313 * @return TRUE - L2CAP_LE client is connected \n
8314 * FALSE - L2CAP_LE client is not connected \n
8320 int bluetooth_l2cap_le_client_is_connected(
8321 const bluetooth_device_address_t *device_address, gboolean *connected);
8324 * @fn gboolean bluetooth_l2cap_le_server_is_connected(
8325 * const bluetooth_device_address_t *device_address, gboolean *connected)
8326 * @brief Informs whether l2cap_le server is connected.
8328 * This function is a synchronous call.
8330 * @return TRUE - L2CAP_LE server is connected \n
8331 * FALSE - L2CAP_LE server is not connected \n
8337 int bluetooth_l2cap_le_server_is_connected(
8338 const bluetooth_device_address_t *device_address, gboolean *connected);
8341 * @fn gboolean bluetooth_l2cap_le_get_psm(int server_fd, int *psm)
8342 * @brief gives the psm of the specific l2cap_le socket connection.
8344 * This function is a synchronous call.
8346 * @return BLUETOOTH_ERROR_NONE - Success \n
8347 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8348 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8350 * @param[in] the socket fd of the server
8351 * @param[out] int *psm
8357 int bluetooth_l2cap_le_get_psm(int id, int *psm);
8366 #endif /* __cplusplus */
8367 #endif /* _BLUETOOTH_API_H_*/