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_
28 #endif /* __cplusplus */
31 * @defgroup BLUETOOTHFW BluetoothFW
33 * A base library for bluetooth framework
35 * @addtogroup BLUETOOTHFW
39 #define BLUETOOTH_ADDRESS_STRING_LENGTH 17 /**< This specifies bluetooth device address length (AA:BB:CC:DD:EE:FF) */
40 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
41 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
42 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
43 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
44 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
45 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
46 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
47 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
49 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
50 a device can support */
52 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
54 #define BLUETOOTH_UUID_STRING_MAX 50
55 #define BLUETOOTH_PATH_STRING 50
57 #define BLUETOOTH_OOB_DATA_LENGTH 16
59 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
62 * This is Bluetooth Connected event role
64 #define RFCOMM_ROLE_SERVER 1
65 #define RFCOMM_ROLE_CLIENT 2
68 * This is RFCOMM default Channel Value
70 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
73 * This is maximum length for search value string for PBAP Phonebook Search
75 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
78 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
81 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
82 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
85 * < This defines the maximum size of OTP server directory name
87 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
90 * This is Bluetooth error code
92 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
94 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
95 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
97 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
98 /**< Callback error */
99 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
100 /**< invalid paramerror */
101 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
102 /**< invalid data error */
103 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
104 /**< Memory allocation error */
105 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
106 /**< out of memory error */
107 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
108 /**< timeout error */
109 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
110 /**< No resource error */
111 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
112 /**< internal error */
113 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
114 /**< Not supported error */
115 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
116 /**< Operation is failed because
117 of not enabled BT Adapter */
118 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
119 /**< Enabling is failed because of
120 already enabled BT Adapter */
121 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
122 /**< Operation is failed because of
123 other on going operation */
124 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
125 /**< access denied error */
126 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
127 /**< max client error */
128 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
129 /**< not found error */
130 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
131 /**< service search fail */
132 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
133 /**< pairing failed error */
134 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
135 /**< Not paired error */
136 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
137 /**< no service error */
138 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
139 /**< no connection error */
140 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
141 /**< alread connected error */
142 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
143 /**< connection busy error */
144 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
145 /**< connection error */
146 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
147 /**< max connection error*/
148 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
149 /**< Not in operation */
150 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
151 /**< Cancelled by user */
152 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
153 /**< Service record registration failed */
154 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
155 /**< Operation in progress */
156 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
157 /**< authentication failed error when paring*/
158 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
159 /**< Remote host is down */
160 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
161 /**< End of device list */
163 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
164 /**< Obex agent already exists */
165 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
166 /**< Obex agent does not exist */
168 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
169 /**< Already initialized */
171 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
172 /**< Permission deined */
174 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
175 /**< Nap already done */
177 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
178 /**< Not initialized */
180 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
181 /**< Authentication rejected */
183 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
184 /**< Device Policy Restricted */
187 * Device disconnection reasons; received from stack
189 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
190 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
191 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
192 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
193 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
194 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
195 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
196 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
197 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
198 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
199 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
200 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
201 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
202 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
203 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
206 * Bluetooth OTP error codes
208 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
209 #define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
210 #define BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED 0x80
211 #define BLUETOOTH_ERROR_OBJECT_NOT_SELECTED 0x81
212 #define BLUETOOTH_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
213 #define BLUETOOTH_ERROR_OBJECT_NAME_EXISITS 0x83
216 * Device disconnect reason
219 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
220 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
221 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
222 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
223 } bluetooth_device_disconnect_reason_t;
226 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
229 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
230 } bluetooth_device_address_t;
233 * This is Bluetooth device address type
236 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
237 BLUETOOTH_DEVICE_RANDOM_ADDRESS
238 } bluetooth_device_address_type_t;
241 * This is BD Address type defined in kernel BT header
244 BLUETOOTH_BDADDR_BREDR = 0x00,
245 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
246 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
247 } bluetooth_bdaddr_type_e;
250 * This is Bluetooth version
253 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
254 } bluetooth_version_t;
257 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
260 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
261 } bluetooth_device_name_t;
264 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
267 int data_len; /**< manafacturer specific data length */
268 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
269 } bluetooth_manufacturer_data_t;
272 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
273 } bluetooth_device_pin_code_t;
279 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
280 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
281 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
282 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
283 } bluetooth_adapter_state_t;
289 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
290 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
291 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
292 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
293 } bluetooth_adapter_le_state_t;
299 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
300 /*Changed the order to make it compatable with old method */
301 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
302 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
303 /**< Discoverable mode with time limit
304 After specific timeout, it is changed
305 to non discoverable mode */
306 } bluetooth_discoverable_mode_t;
309 * Network connect mode
312 BLUETOOTH_NETWORK_PANU_ROLE,
314 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
315 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
316 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
317 } bluetooth_network_role_t;
321 * Service type matched to bt_profile_type_t of bt-service-common.h
324 BLUETOOTH_RFCOMM_SERVICE = 0x01,
325 BLUETOOTH_A2DP_SERVICE = 0x02,
326 BLUETOOTH_HSP_SERVICE = 0x04,
327 BLUETOOTH_HID_SERVICE = 0x08,
328 BLUETOOTH_NAP_SERVICE = 0x10,
329 BLUETOOTH_HFG_SERVICE = 0x20,
330 BLUETOOTH_GATT_SERVICE = 0x40,
331 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
332 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
333 BLUETOOTH_PBAP_SERVICE = 0x200,
334 } bluetooth_service_type_t;
340 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
341 /* represents that connection
342 * type can both BR/EDR and LE */
343 BLUETOOTH_DEV_CONN_BREDR = 0x00,
344 BLUETOOTH_DEV_CONN_LE = 0x01,
345 } bluetooth_conn_type_t;
351 BLUETOOTH_CODEC_ID_CVSD = 0x01,
352 BLUETOOTH_CODEC_ID_MSBC = 0x02,
353 } bluetooth_codec_type_t;
359 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
360 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
361 } bluetooth_hf_audio_connected_type_t;
367 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
368 } bluetooth_advertising_data_t;
374 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
375 } bluetooth_scan_resp_data_t;
378 * Advertising filter policy
381 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
382 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
383 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
384 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
385 } bluetooth_advertising_filter_policy_t;
391 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
392 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
393 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
394 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
395 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
396 } bluetooth_advertising_type_t;
399 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
400 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
401 } bluetooth_gatt_service_change_type_t;
404 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
405 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
406 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
407 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
408 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
409 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
410 } bt_gatt_permission_t;
413 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
414 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
415 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
416 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
417 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
418 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
419 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
420 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
421 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
422 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
423 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
424 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
425 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
426 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
427 } bt_gatt_characteristic_property_t;
430 * Remote device request types for attributes
433 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
434 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
435 } bluetooth_gatt_att_request_tyep_t;
438 * Proximity Property Type
441 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
442 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
443 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
444 } bluetooth_pxp_poperty_t;
450 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
451 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
453 BLUETOOTH_TDS_TRANSPORT_INVALID
454 } bluetooth_tds_transport_t;
457 * TDS transport state
460 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
461 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
462 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
463 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
464 } bluetooth_tds_transport_state_t;
471 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
472 } bluetooth_tds_data_t;
475 * TDS activation request
478 bluetooth_device_address_t rem_addr;
479 bluetooth_tds_transport_t transport;
480 bluetooth_tds_data_t tds_data;
481 } bluetooth_tds_activation_req_t;
484 * TDS Control Point data
487 int length; /**< Control point data length */
488 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
489 } bluetooth_control_point_data_t;
492 * TDS Indication Response data
495 bluetooth_device_address_t rem_addr; /**< Device address */
496 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
497 } bluetooth_tds_indication_res_t;
500 * Structure to hold the TDS Complete data information which is read from remote TDS provider
503 bluetooth_device_address_t device_address; /**< Device address */
504 int data_length; /**< Data length */
505 char *data; /**< Complete Transport Specific data */
506 } bluetooth_tds_transport_data_info_t;
509 * Structure to hold the OTP response data from remote OTP server
512 char *handle; /**< Handle */
513 int data_length; /**< Data length */
514 char *data; /**< Read data */
515 } bluetooth_otp_resp_info_t;
518 * Advertising parameters
523 guint8 filter_policy;
525 } bluetooth_advertising_params_t;
531 int type; /**< passive 0, active 1 */
532 float interval; /**< LE scan interval */
533 float window; /**< LE scan window */
534 } bluetooth_le_scan_params_t;
544 } bluetooth_le_connection_param_t;
547 LE Read Maximum Data Length
550 guint16 max_tx_octets;
552 guint16 max_rx_octets;
554 } bluetooth_le_read_maximum_data_length_t;
557 LE Read Host suggested default Data Length
560 guint16 def_tx_octets;
562 } bluetooth_le_read_host_suggested_data_length_t;
565 * Samsung XSAT Vendor dependent command
570 } bluetooth_vendor_dep_at_cmd_t;
576 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
577 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
578 } bluetooth_opp_transfer_type_t;
583 } bluetooth_hf_ciev_device_event_t;
585 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
586 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
587 /**< Base ID for GAP Event */
588 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
589 /**< Base ID for SDP events */
590 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
591 /**< Base ID for RFCOMM events */
592 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
593 /**< Base ID for NETWORK events */
594 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
595 /**< Base ID for HDP events */
596 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
597 /**< Base ID for OPC events */
598 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
599 /**< Base ID for Obex Server events */
600 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
601 /**< Base ID for GATT events */
603 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
604 /**< Base ID for Audio events */
605 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
606 /**< Base ID for HID events */
607 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
608 /**< Base ID for Advertising events */
609 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
610 /**< Base ID for PBAP Client events */
611 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
612 /**< Base ID for AVRCP events */
613 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
614 /**< Base ID for IPSP events */
615 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
616 /**< Base ID for MAP events */
619 * Bluetooth event type
622 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
624 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
625 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
626 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
627 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
628 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
629 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
630 /**< Bluetooth event Discoverable timeout requested*/
631 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
632 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
633 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
634 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
635 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
636 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
637 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
638 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
639 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
640 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
641 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
642 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
643 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
644 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
645 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
646 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
647 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
648 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
649 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
650 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
651 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
653 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
654 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
655 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
656 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
657 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
659 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
660 /**< Bluetooth event serice search base id */
661 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
662 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
663 /**< RFCOMM data receive event */
664 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
665 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
667 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
669 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
670 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
672 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
674 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
675 /**< Bluetooth Network event */
676 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
677 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
678 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
679 /**< Network disconnected evnet in server */
681 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
682 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
684 BLUETOOTH_EVENT_HDP_CONNECTED
685 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
686 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
687 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
689 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
690 /* OPC Connected event */
691 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
692 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
693 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
694 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
696 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
697 BLUETOOTH_EVENT_MAP_DISCONNECTED,
699 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
700 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
701 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
702 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
703 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
705 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
706 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
707 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
708 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
709 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
710 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
711 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
712 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
713 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
714 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
715 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
716 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
717 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
719 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
720 /* Obex server authorize event*/
721 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
722 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
723 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
724 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
725 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
726 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
728 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
729 /**<Discovered GATT service characteristics event*/
730 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
731 /**<Remote GATT charateristic value changed event*/
732 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
733 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
734 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
735 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
736 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
737 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
738 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
739 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
740 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
741 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
742 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
743 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
744 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
745 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
746 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
748 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
749 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
750 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
751 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
752 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
753 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
754 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
755 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
756 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
757 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
758 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
759 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
760 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
761 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
762 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
763 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
764 BLUETOOTH_EVENT_HF_CONNECTED,
765 BLUETOOTH_EVENT_HF_DISCONNECTED,
766 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
767 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
768 BLUETOOTH_EVENT_HF_RING_INDICATOR,
769 BLUETOOTH_EVENT_HF_CALL_WAITING,
770 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
771 BLUETOOTH_EVENT_HF_CALL_STARTED,
772 BLUETOOTH_EVENT_HF_CALL_ENDED,
773 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
774 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
775 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
776 BLUETOOTH_EVENT_HF_CALL_STATUS,
777 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
778 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
779 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
780 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
781 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
782 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
783 BLUETOOTH_EVENT_HF_CALL_IDLE,
784 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
785 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
786 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
788 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
789 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
790 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
791 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
792 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
794 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
795 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
796 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
797 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
798 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
799 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
800 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
801 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
803 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
804 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
805 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
806 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
807 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
808 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
809 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
811 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
812 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
813 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
814 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
815 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
816 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
817 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
818 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
819 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
821 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
822 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
823 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
824 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
825 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
826 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
827 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
828 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
829 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
830 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
831 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
833 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
834 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
835 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
836 } bluetooth_event_type_t;
839 * This bt_service_uuid_list_t enum indicates service uuid list .
840 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
844 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
845 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
846 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
847 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
848 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
849 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
850 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
851 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
852 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
853 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
854 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
855 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
856 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
858 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
859 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
860 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
861 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
862 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
863 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
864 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
865 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
866 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
867 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
868 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
869 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
870 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
871 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
873 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
874 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
875 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
876 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
877 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
878 /**<DIRECT PRINTING*/
879 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
880 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
881 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
882 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
883 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
884 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
885 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
886 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
887 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
888 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
889 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
890 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
891 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
892 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
893 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
894 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
895 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
896 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
897 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
898 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
899 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
900 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
901 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
902 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
903 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
904 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
905 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
906 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
907 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
908 } bluetooth_service_uuid_list_t;
911 * Service class part of class of device returned from device discovery
914 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
915 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
916 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
917 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
918 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
919 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
920 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
921 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
922 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
923 } bluetooth_device_service_class_t;
927 * Major device mask (For device discovery)
930 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
931 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
932 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
933 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
934 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
935 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
936 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
937 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
938 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
939 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
940 } bluetooth_device_major_mask_t;
944 * Major device class (part of Class of Device)
947 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
948 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
949 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
950 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
951 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
952 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
953 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
954 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
955 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
956 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
957 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
958 } bluetooth_device_major_class_t;
961 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
963 /* About Computer Major class */
964 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
966 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
967 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
968 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
969 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
970 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
972 /* About Phone Major class */
973 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
974 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
975 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
976 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
977 /**< voice gateway minor class */
978 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
980 /* About LAN/Network Access Point Major class */
981 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
982 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
983 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
984 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
985 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
986 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
987 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
988 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
990 /* About Audio/Video Major class */
991 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
992 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
994 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
995 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
996 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
997 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
998 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
999 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1000 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1001 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1002 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1003 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1004 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1005 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1006 /**< Video Display and Loud
1007 Speaker minor class */
1008 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1011 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1013 /* About Peripheral Major class */
1014 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1015 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1016 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1017 /**< Combo Keyboard or pointing
1018 device minorclass */
1020 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1021 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1022 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1023 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1024 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1025 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1026 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1027 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1028 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1030 /* About Imaging Major class */
1031 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1032 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1033 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1034 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1036 /* About Wearable Major class */
1037 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1038 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1039 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1040 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1041 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1043 /* About Toy Major class */
1044 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1045 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1046 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1047 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1048 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1050 /* About Health Major class */
1051 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1052 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1053 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1054 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1055 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1056 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1057 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1058 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1059 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1060 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1061 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1062 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1063 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1064 } bluetooth_device_minor_class_t;
1067 * structure to hold the device information
1070 bluetooth_device_major_class_t major_class; /**< major device class */
1071 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1072 bluetooth_device_service_class_t service_class;
1073 /**< service device class */
1074 } bluetooth_device_class_t;
1077 * Discovery Role types
1080 DISCOVERY_ROLE_BREDR = 0x1,
1082 DISCOVERY_ROLE_LE_BREDR
1083 } bt_discovery_role_type_t;
1086 * Connected state types
1089 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1090 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1091 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1092 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1093 } bluetooth_connected_link_t;
1099 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1100 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1101 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1102 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1103 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1104 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1105 } bluetooth_le_scan_filter_feature_t;
1108 * LE connection mode
1111 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1112 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1113 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1114 } bluetooth_le_connection_mode_t;
1117 * structure to hold the device information
1120 bluetooth_device_address_t device_address; /**< device address */
1121 bluetooth_device_name_t device_name; /**< device name */
1122 bluetooth_device_class_t device_class; /**< device class */
1123 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1124 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1126 int rssi; /**< received strength signal*/
1127 gboolean paired; /**< paired flag */
1128 bluetooth_connected_link_t connected; /**< connected link type */
1129 gboolean trust; /**< trust flag */
1130 gboolean is_alias_set; /** is device alias set flag**/
1131 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1132 } bluetooth_device_info_t;
1135 * structure to hold the LE device information
1138 int data_len; /**< manafacturer specific data length */
1139 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1140 } bluetooth_le_advertising_data_t;
1143 bluetooth_device_address_t device_address; /**< device address */
1144 int addr_type; /**< address type*/
1145 int rssi; /**< received strength signal*/
1146 bluetooth_le_advertising_data_t adv_ind_data;
1147 bluetooth_le_advertising_data_t scan_resp_data;
1148 } bluetooth_le_device_info_t;
1152 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1153 bluetooth_device_address_t device_address; /**< device address */
1154 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1155 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1156 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1157 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1158 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1159 bluetooth_le_advertising_data_t service_data; /**< service data */
1160 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1161 int manufacturer_id; /**< manufacturer ID */
1162 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1163 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1164 } bluetooth_le_scan_filter_t;
1167 bluetooth_device_address_t device_address; /**< device address */
1168 unsigned int mtu; /** < MTU set for the ATT connection */
1169 unsigned int status; /** < status of the MTU exchange */
1170 } bluetooth_le_att_mtu_info_t;
1173 * structure to hold the paired device information
1176 bluetooth_device_address_t device_address; /**< paired device address */
1177 bluetooth_device_name_t device_name; /**< device name */
1178 bluetooth_device_class_t device_class; /**< device class */
1179 } bluetooth_paired_device_info_t;
1182 * structure to hold the paired device information
1185 bluetooth_device_address_t device_address;
1186 /**< device address */
1187 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1188 /**< network interface name */
1189 } bluetooth_network_device_info_t;
1192 * Authentication event types
1196 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1197 BLUETOOTH_AUTH_PIN_REQUEST,
1198 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1199 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1200 } bluetooth_auth_type_t;
1203 * structure to hold the pincode/pass-key req informations
1206 bluetooth_device_address_t device_address; /**< remote device address */
1207 bluetooth_device_name_t device_name; /**< device name */
1208 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1209 } bluetooth_authentication_request_info_t;
1212 * Stucture to hold discovery option
1215 unsigned short max_response; /**< the number of maximum response */
1216 unsigned short discovery_duration;
1217 /**< duration of discovery (seconds) */
1218 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1219 classOfDevice variable */
1220 } bluetooth_discovery_option_t;
1223 * Stucture to hold event information
1226 int event; /**< event type */
1227 int result; /**< Success or error value */
1229 /**<parameter data pointer */
1231 } bluetooth_event_param_t;
1234 bluetooth_device_address_t device_addr;
1235 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1236 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1237 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1242 bluetooth_device_address_t device_addr;
1243 unsigned char addr_type;
1245 } bt_connection_info_t;
1248 * Stucture to rfcomm receive data
1253 /**< the socket fd */
1254 int buffer_size;/**< the length of the receive buffer */
1256 /**< the receive data buffer */
1257 } bluetooth_rfcomm_received_data_t;
1263 HTYPE_TRANS_HANDSHAKE,
1264 HTYPE_TRANS_HID_CONTROL,
1265 HTYPE_TRANS_GET_REPORT,
1266 HTYPE_TRANS_SET_REPORT,
1267 HTYPE_TRANS_GET_PROTOCOL,
1268 HTYPE_TRANS_SET_PROTOCOL,
1271 } bt_hid_header_type_t;
1277 PTYPE_DATA_RTYPE_INPUT,
1278 PTYPE_DATA_RTYPE_OUTPUT
1279 } bt_hid_param_type_t;
1282 * Stucture to hid receive data
1285 const char *address;
1286 bt_hid_header_type_t type;
1287 /**< Header type containing */
1288 bt_hid_param_type_t param;
1289 /**< Param type in header like INPUT Report or OutPut Report */
1290 int buffer_size;/**< the length of the receive buffer */
1292 /**< the receive data buffer */
1293 } bluetooth_hid_received_data_t;
1296 * Stucture to rfcomm connection
1300 int socket_fd; /**< the socket fd */
1301 int server_id; /* Server id */
1302 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1303 bluetooth_device_address_t device_addr;
1304 /**< device address */
1305 char uuid[BLUETOOTH_UUID_STRING_MAX];
1306 } bluetooth_rfcomm_connection_t;
1309 * Stucture to rfcomm disconnection
1313 /**< the socket fd */
1314 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1315 bluetooth_device_address_t device_addr;
1316 /**< device address */
1317 char uuid[BLUETOOTH_UUID_STRING_MAX];
1318 } bluetooth_rfcomm_disconnection_t;
1322 /**< the socket fd */
1323 bluetooth_device_address_t device_addr;
1324 /**< device address */
1325 } bluetooth_rfcomm_connection_request_t;
1329 /**< the socket fd */
1330 bluetooth_device_address_t device_addr;
1331 /**< device address */
1332 } bluetooth_hid_request_t;
1341 } bt_hdp_qos_type_t;
1347 HDP_ROLE_SOURCE = 0x0,
1349 } bt_hdp_role_type_t;
1353 * Stucture to HDP connected
1356 const char *app_handle; /**< the application handle */
1357 unsigned int channel_id; /**< the channel id */
1358 bt_hdp_qos_type_t type; /**< the QOS type */
1359 bluetooth_device_address_t device_address; /**< the remote address */
1360 } bt_hdp_connected_t;
1363 * Stucture to HDP disconnected
1366 unsigned int channel_id; /**< the channel id */
1367 bluetooth_device_address_t device_address; /**< the remote address */
1368 } bt_hdp_disconnected_t;
1371 * Stucture to HDP data indication
1374 unsigned int channel_id; /**< the channel id */
1375 const char *buffer; /**< the RX data buffer */
1376 unsigned int size; /**< the RX data size */
1377 } bt_hdp_data_ind_t;
1380 * Stucture to OPP client transfer information
1387 } bt_opc_transfer_info_t;
1389 /* TODO: MAP client structures, see above */
1391 * Stucture to Map filter fields
1396 } bt_map_list_filter_fields_info_t;
1398 /* Obex Server transfer type */
1399 #define TRANSFER_PUT "PUT"
1400 #define TRANSFER_GET "GET"
1402 * Stucture to OPP/FTP Server authorize information
1409 } bt_obex_server_authorize_into_t;
1417 } bt_obex_server_type_t;
1420 * Stucture to OPP/FTP server transfer information
1428 unsigned long file_size;
1430 bt_obex_server_type_t server_type;
1432 unsigned char *contact_auth_info;
1433 } bt_obex_server_transfer_info_t;
1436 * Stucture to OPP/FTP server connection/disconnection information
1442 } bt_obex_server_connection_info_t;
1446 * Stucture to OOB data
1450 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1451 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1452 unsigned int hash_len;
1453 unsigned int randomizer_len;
1455 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1456 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1457 unsigned int hash256_len;
1458 unsigned int randomizer256_len;
1462 * Structure to GATT attribute handle data
1468 } bt_gatt_handle_info_t;
1471 * Structure to GATT Remote service data
1478 bt_gatt_handle_info_t include_handles;
1479 bt_gatt_handle_info_t char_handle;
1480 } bt_gatt_service_property_t;
1483 * Structure to GATT Remote characteristic data
1487 char *service_handle;
1488 bt_gatt_handle_info_t handle_info;
1489 } bt_gatt_discovered_char_t;
1492 * Structure to format of GATT Characteristic Value
1496 unsigned char format;
1497 unsigned char exponent;
1498 unsigned short unit;
1499 unsigned char name_space;
1500 unsigned short description;
1501 } bt_gatt_char_format_t;
1504 * Structure to GATT Characteristic property
1512 bt_gatt_char_format_t format;
1514 unsigned int val_len;
1515 unsigned int permission;
1516 char *representation;
1517 bt_gatt_handle_info_t char_desc_handle;
1518 } bt_gatt_char_property_t;
1521 * Structure to GATT Characteristic descriptor property
1528 unsigned int val_len;
1529 } bt_gatt_char_descriptor_property_t;
1532 * Structure to GATT Characteristic value
1539 } bt_gatt_char_value_t;
1542 * Structure to GATT Read Request
1546 char *service_handle;
1550 } bt_gatt_read_req_t;
1553 * Structure to GATT Value change
1557 char *service_handle;
1560 gboolean response_needed;
1564 } bt_gatt_value_change_t;
1567 bluetooth_device_address_t device_addr;
1569 bluetooth_gatt_service_change_type_t change_type;
1570 } bt_gatt_service_change_t;
1573 * Structure to GATT characteristc Notification change
1577 char *service_handle;
1578 gboolean att_notify;
1579 } bt_gatt_char_notify_change_t;
1582 * Structure to Indication confirmation
1586 char *service_handle;
1589 } bt_gatt_indicate_confirm_t;
1592 * Structure to RSSI Signal Strength Alert
1603 * Structure to RSSI Signal Strength
1613 * Structure for RSSI Enabled or Disabled
1619 gboolean rssi_enabled;
1620 } bt_rssi_enabled_t;
1623 * Structure for RSSI Threshold
1628 int in_range_threshold;
1630 } bt_rssi_threshold_t;
1634 * Structure for Suppoted Profiles and Trusted Profiles
1641 } bt_supported_profile_trusted_t;
1644 * Structure for PBAP Folder Parameters
1647 unsigned char addressbook;
1648 unsigned char folder_type;
1652 * Structure for PBAP Pull application Parameters
1655 unsigned char format;
1656 unsigned char order;
1657 unsigned short offset;
1658 unsigned short maxlist;
1659 long long unsigned fields;
1660 } bt_pbap_pull_parameters_t;
1663 * Structure for PBAP List application Parameters
1666 unsigned char order;
1667 unsigned short offset;
1668 unsigned short maxlist;
1669 } bt_pbap_list_parameters_t;
1672 * Structure for PBAP Pull vCard application Parameters
1675 unsigned char format;
1676 long long unsigned fields;
1678 } bt_pbap_pull_vcard_parameters_t;
1681 * Structure for PBAP Search application Parameters
1684 unsigned char order;
1685 unsigned short offset;
1686 unsigned short maxlist;
1687 unsigned char search_attribute;
1688 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1689 } bt_pbap_search_parameters_t;
1692 * Structure for PBAP Connection Status
1695 bluetooth_device_address_t btaddr;
1697 } bt_pbap_connected_t;
1700 * Structure for PBAP Phonebook Size
1703 bluetooth_device_address_t btaddr;
1705 } bt_pbap_phonebook_size_t;
1708 * Structure for PBAP Phonebook Pull
1711 bluetooth_device_address_t btaddr;
1714 } bt_pbap_phonebook_pull_t;
1717 * Structure for PBAP vCard List
1720 bluetooth_device_address_t btaddr;
1724 } bt_pbap_vcard_list_t;
1727 * Structure for PBAP vCard Pull
1730 bluetooth_device_address_t btaddr;
1733 } bt_pbap_vcard_pull_t;
1736 * Structure for PBAP Phonebook search List
1739 bluetooth_device_address_t btaddr;
1743 } bt_pbap_phonebook_search_list_t;
1746 * Stucture to HF Call status information
1750 char *number; /*Phone Number */
1751 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1752 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1753 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1754 int idx; /*Call index/ID */
1755 } bt_hf_call_status_info_t;
1760 } bt_hf_call_list_s;
1766 TRUSTED_PROFILE_PBAP = 1,
1767 TRUSTED_PROFILE_MAP,
1768 TRUSTED_PROFILE_SAP,
1769 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1770 } bluetooth_trusted_profile_t;
1773 * Restricted Profile types
1776 RESTRICTED_PROFILE_HFP_HS = 1,
1777 RESTRICTED_PROFILE_A2DP,
1778 } bluetooth_restricted_profile_t;
1781 * Structure for LE data length change params
1784 bluetooth_device_address_t device_address;
1785 guint16 max_tx_octets;
1786 guint16 max_tx_time;
1787 guint16 max_rx_octets;
1788 guint16 max_rx_time;
1789 } bt_le_data_length_params_t;
1792 * Structure for proximity property change params
1795 bluetooth_device_address_t device_address;
1799 } bt_pxp_property_changed_params_t;
1802 * @brief DPM BT allowance state
1806 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1807 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1808 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1809 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1813 * @brief DPM API result
1817 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1818 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1819 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1820 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1821 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1822 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1826 * @brief DPM Policy status
1830 BLUETOOTH_DPM_STATUS_ERROR = -1,
1832 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1833 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1835 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1836 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1838 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1839 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1843 /* policy-group : BLUETOOTH */
1844 BLUETOOTH_DPM_POLICY_ALLOW,
1845 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1846 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1847 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1848 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1849 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1850 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1851 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1852 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1853 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1854 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1855 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1856 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1857 BLUETOOTH_DPM_POLICY_END,
1858 } bt_dpm_policy_cmd_t;
1861 struct bt_dpm_policy {
1867 typedef struct bt_dpm_policy bt_dpm_policy_t;
1870 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1871 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1872 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1873 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1874 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1875 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1876 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1877 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1878 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1879 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1880 BLUETOOTH_DPM_PROFILE_NONE,
1883 struct bt_dpm_profile_val {
1884 int value; /* tells whether the profile is enabled or disabled */
1886 typedef struct dpm_profile_val dpm_profile_state_t;
1889 * Structure to DPM device list
1893 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1894 } bt_dpm_device_list_t;
1897 * Structure to DPM uuid list
1901 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1902 } bt_dpm_uuids_list_t;
1905 * Structure for IPSP Interface Info
1908 bluetooth_device_address_t btaddr;
1910 } bt_ipsp_connection_info_t;
1914 char* remote_address;
1915 } bt_map_client_session_info_s;
1917 typedef char* bt_map_client_message_object_t;
1922 } bt_map_client_list_folders_filter_t;
1927 int8_t subject_length;
1936 } bt_map_client_list_messages_filter_t;
1939 bt_map_client_message_object_t message_object;
1944 char *sender_address;
1947 char *recipient_address;
1952 int64_t attachment_size;
1957 } bt_map_client_message_item_t;
1963 } bt_map_client_push_message_args_t;
1970 char *sender_address;
1973 char *recipient_address;
1982 } bt_map_client_message_t;
1985 char **names; // holding %size null-terminated folder names
1987 } bt_map_client_folders_s;
1990 bt_map_client_message_item_t *message_items;
1992 } bt_map_client_message_items_s;
1995 const char* target_file;
1997 } bt_get_message_callback_data;
2000 * Callback pointer type
2002 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2005 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2006 * @brief Set the callback function pointer for bluetooth event
2009 * This API will register the callback function, when any response and event are received from
2010 * bluetooth framework. @n
2011 * this registered callback function will be get called with appropriate event and data structures.
2012 * This function is a synchronous call. An application developer can call
2013 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2014 * type. This registered function will receive events of bluetooth_event_type_t type along with
2018 * @param[in] callback_ptr A pointer to the callback function
2019 * @param[in] user_data A pointer to user data
2020 * @return BLUETOOTH_ERROR_NONE - Success
2024 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2026 GMainLoop *main_loop = (GMainLoop*) user_data;
2030 // Code for each event
2032 g_main_loop_quit(main_loop);
2039 GMainLoop *main_loop = NULL;
2042 main_loop = g_main_loop_new(NULL, FALSE);
2043 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2044 if (ret >= BLUETOOTH_ERROR_NONE)
2046 // bluetooth_register_callback returned Success
2050 // bluetooth_register_callback returned failiure
2052 g_main_loop_run(main_loop);
2056 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2059 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2060 * @brief Set the callback function pointer for bluetooth le event
2063 * This API will register the callback function, when any response and event are received from
2064 * bluetooth framework. @n
2065 * this registered callback function will be get called with appropriate event and data structures.
2066 * This function is a synchronous call. An application developer can call
2067 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2068 * type. This registered function will receive events of bluetooth_event_type_t type along with
2072 * @param[in] callback_ptr A pointer to the callback function
2073 * @param[in] user_data A pointer to user data
2074 * @return BLUETOOTH_ERROR_NONE - Success
2078 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2081 * @fn int bluetooth_le_unregister_callback(void)
2082 * @brief Set the callback function pointer for bluetooth le event
2085 * This API will register the callback function, when any response and event are received from
2086 * bluetooth framework. @n
2087 * this registered callback function will be get called with appropriate event and data structures.
2088 * This function is a synchronous call. An application developer can call
2089 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2090 * type. This registered function will receive events of bluetooth_event_type_t type along with
2095 * @return BLUETOOTH_ERROR_NONE - Success
2099 int bluetooth_le_unregister_callback(void);
2102 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2103 * @brief Set the callback function pointer for bluetooth event
2106 * This API will register the callback function, when any response and event are received from
2107 * bluetooth framework. @n
2108 * this registered callback function will be get called with appropriate event and data structures.
2109 * This function is a synchronous call. An application developer can call
2110 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2111 * type. This registered function will receive events of bluetooth_event_type_t type along with
2116 * @return BLUETOOTH_ERROR_NONE - Success
2120 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2122 GMainLoop *main_loop = (GMainLoop*) user_data;
2126 // Code for each event
2128 g_main_loop_quit(main_loop);
2135 GMainLoop *main_loop = NULL;
2138 main_loop = g_main_loop_new(NULL, FALSE);
2139 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2140 if (ret >= BLUETOOTH_ERROR_NONE)
2142 // bluetooth_register_callback returned Success
2146 // bluetooth_register_callback returned failiure
2148 ret = bluetooth_deregister_callback(void);
2149 g_main_loop_run(main_loop);
2153 int bluetooth_unregister_callback(void);
2156 * @fn int bluetooth_enable_adapter(void)
2157 * @brief Enable the Bluetooth H/W
2160 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2161 * send request to bluetooth chip for activation.
2162 * This function is typically called at startup or when Bluetooth services are required. This
2163 * function must be called before calling any other API of Bluetooth operations.
2165 * Before performing any operations like Device discover, service search etc.., the adapter must be
2168 * This function is a asynchronous call.
2169 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2170 * through registered callback function with appropriate result code
2171 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2172 * BLUETOOTH_ERROR_NONE - Success \n
2174 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2175 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2177 * @return BLUETOOTH_ERROR_NONE - Success\n
2178 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2179 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2180 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2181 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2183 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2185 void bt_event_callback(int event, bluetooth_event_param_t *param)
2189 case BLUETOOTH_EVENT_ENABLED:
2190 if (param->result == BLUETOOTH_ERROR_NONE)
2192 // Successfully Enabled
2205 ret = bluetooth_enable_adapter();
2209 int bluetooth_enable_adapter(void);
2212 * @fn int bluetooth_disable_adapter(void)
2213 * @brief Disable the Bluetooth H/W
2216 * This function disables Bluetooth protocol stack and hardware. This function is called when
2217 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2219 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2220 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2221 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2223 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2226 * This function is a asynchronous call.
2227 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2228 * through registered callback function.
2231 * @return BLUETOOTH_ERROR_NONE - Success\n
2232 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2233 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2234 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2236 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2238 void bt_event_callback(int event, bluetooth_event_param_t *param)
2242 case BLUETOOTH_EVENT_DISABLED:
2243 if (param->result == BLUETOOTH_ERROR_NONE)
2245 // Successfully disabled
2258 ret = bluetooth_disable_adapter();
2261 int bluetooth_disable_adapter(void);
2262 int bluetooth_recover_adapter(void);
2263 int bluetooth_check_adapter_le(void);
2264 int bluetooth_enable_adapter_le(void);
2266 int bluetooth_disable_adapter_le(void);
2269 * @fn int bluetooth_reset_adapter(void)
2270 * @brief Reset the Bluetooth H/W and values
2273 * This function resets Bluetooth protocol stack and hardware. This function is called when
2274 * an user want to initialize Bluetooth environment.
2276 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2279 * This function is a synchronous call.
2281 * @return BLUETOOTH_ERROR_NONE - Success\n
2282 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2284 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2289 ret = bluetooth_reset_adapter();
2292 int bluetooth_reset_adapter(void);
2295 * @fn int bluetooth_is_supported(void)
2296 * @brief Check if the bluetooth is supported or not by the current target
2298 * This API checks whether the bluetooth is supported or not.
2299 * This API only run by root permission.
2301 * This function is a synchronous call.
2303 * @return 0 - if bluetooth is not supported\n
2304 * 1 - if bluetooth is supported\n
2305 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2310 ret = bluetooth_is_supported();
2313 int bluetooth_is_supported(void);
2317 * @fn int bluetooth_check_adapter(void)
2318 * @brief Check the current status of the Bluetooth adapter
2321 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2322 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2323 * bluetooth adapter.
2324 * This API get the adapter internal data structure and check current adapter status.
2326 * This function is a synchronous call.
2329 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2330 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2332 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2336 ret = bluetooth_check_adapter();
2339 int bluetooth_check_adapter(void);
2342 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2343 * @brief Get the local adapter bluetooth address
2346 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2347 * the adapter should be enabled.
2348 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2349 * contain Bluetooth address.
2350 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2351 * friendly name for each device.
2352 * There is no event callback for this API.
2354 * This function is a synchronous call.
2357 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2358 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2359 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2360 * @param[out] local_address a device address of local bluetooth adapter
2365 bluetooth_device_address_t local_address={0,};
2368 ret = bluetooth_get_local_address(&local_address);
2371 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2374 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2375 * @brief Get the hci version
2378 * This function is used to get the bluetooth hci version
2379 * Before calling this API make sure that the adapter is enabled.
2381 * This function is a synchronous call.
2384 * @return BLUETOOTH_ERROR_NONE - Success \n
2385 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2386 * @param[out] timeout remain visibility timeout value
2389 bluetooth_version_t *version;
2391 ret = bluetooth_get_local_version (&version);
2394 int bluetooth_get_local_version(bluetooth_version_t *version);
2397 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2398 * @brief Get the local device name
2401 * This function is used, get the local device name. Since its difficult to remember the Adapter
2402 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2403 * friendly name is retrived by the remote device and displaying.
2404 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2406 * This function is a synchronous call.
2409 * @return BLUETOOTH_ERROR_NONE - Success \n
2410 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2411 * @param[out] local_name a local device name
2415 bluetooth_device_name_t local_name={0,}
2417 ret = bluetooth_get_local_name (&local_name);
2420 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2423 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2424 * @brief Set the local device name
2427 * This function is used to set the local device name. This is a human friendly name whose
2428 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2430 * This function is a synchronous call.
2432 * @param[in] local_name bluetooth device name to set local device
2434 * @return BLUETOOTH_ERROR_NONE - Success \n
2435 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2436 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2437 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2438 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2439 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2444 bluetooth_device_name_t local_name={0,}
2446 ret = bluetooth_set_local_name (&local_name);
2449 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2453 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2454 * @brief Check if the uuid is used or not
2456 * This function is used to check if the uuid is used or not.
2458 * This function is a synchronous call.
2460 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2461 * @param[out] used if the uuid is used or not
2463 * @return BLUETOOTH_ERROR_NONE - Success \n
2464 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2465 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2466 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2471 gboolean used = FALSE;
2472 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2473 ret = bluetooth_is_service_used(uuid, &used);
2476 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2479 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2480 * @brief Check if the device is connected to the specific service
2482 * This function is used to check if if the device is connected to the specific service.
2484 * This function is a synchronous call.
2486 * @param[in] local_address a device address of remote bluetooth device
2487 * @param[in] type the service type
2488 * @param[out] is_connected if the device is connected or not
2490 * @return BLUETOOTH_ERROR_NONE - Success \n
2491 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2492 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2493 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2498 gboolean is_connected = FALSE;
2499 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2500 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2503 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2504 bluetooth_service_type_t type,
2505 gboolean *is_connected);
2508 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2509 * @brief Gets device's connected link type
2511 * This function is used to get device's connected link type
2513 * This function is a synchronous call.
2515 * @param[in] device_address a device address of remote bluetooth device
2516 * @param[out] connected_link a device's connected link type
2518 * @return BLUETOOTH_ERROR_NONE - Success \n
2519 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2520 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2521 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2526 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2527 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2528 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2531 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2532 bluetooth_connected_link_t *connected_link);
2535 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2536 * @brief Sets a profile trusted for a device
2538 * This function is used to Set a profile as trusted for a device
2540 * This function is a synchronous call.
2542 * @param[in] device_address a device address of remote bluetooth device
2543 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2544 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2546 * @return BLUETOOTH_ERROR_NONE - Success \n
2547 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2548 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2549 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2553 int bluetooth_set_profile_trusted(
2554 const bluetooth_device_address_t *device_address,
2555 int profile, int trust);
2558 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2559 * @brief Gets a profile is trusted for a device
2561 * This function is used to Get a profile is trusted or not for a device
2563 * This function is a synchronous call.
2565 * @param[in] device_address a device address of remote bluetooth device
2566 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2567 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2569 * @return BLUETOOTH_ERROR_NONE - Success \n
2570 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2571 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2572 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2576 int bluetooth_get_profile_trusted(
2577 const bluetooth_device_address_t *device_address,
2578 int profile, int *trust);
2581 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2582 * @brief Sets a profile restricted connection for a device
2584 * This function is used to Set a profile as restricted for a device
2586 * This function is a synchronous call.
2588 * @param[in] device_address a device address of remote bluetooth device
2589 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2590 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2592 * @return BLUETOOTH_ERROR_NONE - Success \n
2593 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2594 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2595 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2599 int bluetooth_set_profile_restricted(
2600 const bluetooth_device_address_t *device_address,
2601 int profile, int restricted);
2604 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2605 * @brief Gets a restricted connection state
2607 * This function is used to Get a profile is restricted or not for a device
2609 * This function is a synchronous call.
2611 * @param[in] device_address a device address of remote bluetooth device
2612 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2613 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2615 * @return BLUETOOTH_ERROR_NONE - Success \n
2616 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2617 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2618 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2622 int bluetooth_get_profile_restricted(
2623 const bluetooth_device_address_t *device_address,
2624 int profile, int *restricted);
2627 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2628 * @brief Get the visibility mode
2631 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2632 * visibity mode, the property of the device is determined whether it can be discoverable, non
2633 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2635 * This function is a synchronous call.
2638 * @return BLUETOOTH_ERROR_NONE - Success \n
2639 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2640 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2641 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2642 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2643 * @param[out] discoverable_mode current bluetooth discoverable mode
2645 * @see bluetooth_set_discoverable_mode
2647 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2649 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2652 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2655 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2657 * @brief Set the visibility mode
2660 * This function is used to set the discoverable mode (Visibility option).
2662 * Many times user may want to keep his device discoverable so that when peer device is performing
2663 * device search, he/she can find user's device. Application programmer can keep the mode as
2664 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2665 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2666 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2667 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2669 * This function is a synchronous call.
2671 * @return BLUETOOTH_ERROR_NONE - Success \n
2672 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2674 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2675 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2677 * @see bluetooth_get_discoverable_mode
2681 bluetooth_discoverable_mode_t mode;
2683 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2684 ret = bluetooth_set_discoverable_mode (mode, 180);
2688 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2693 * @fn int bluetooth_get_timeout_value(int *timeout)
2694 * @brief Get the visibility timeout value
2697 * This function is used to get the visibility timeout
2698 * Before calling this API make sure that the adapter is enabled.
2700 * This function is a synchronous call.
2703 * @return BLUETOOTH_ERROR_NONE - Success \n
2704 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2705 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2706 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2707 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2708 * @param[out] timeout remain visibility timeout value
2710 * @see bluetooth_set_discoverable_mode
2714 ret = bluetooth_get_timeout_value (&timeout);
2717 int bluetooth_get_timeout_value(int *timeout);
2721 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2722 * unsigned int classOfDeviceMask)
2723 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2725 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2726 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2727 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2728 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2729 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2730 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2731 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2732 * please see bluetooth_device_info_t for more details.
2735 * This API provides searching options like max responses, discovery duration in seconds and class
2736 * of device mask to filter device search. some times there may be too many bluetooth devices in
2737 * vicinity of your device.in such scenario, application can request to reduce number of responces
2738 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2739 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2740 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2741 * application defined time. please note that discovery_duration should be mentioned in seconds.
2742 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2745 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2746 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2747 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2749 * This function is a asynchronous call.
2750 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2751 * through registered callback function.
2753 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2754 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2756 * The completion or cancellation of the discovery is indicated by an
2757 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2759 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2762 * @return BLUETOOTH_ERROR_NONE - Success \n
2763 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2764 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2765 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2766 agent is not running \n
2768 * @param[in] max_response define the maximum response of the number of founded devices
2770 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2771 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2772 (refer to class of device)
2774 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2777 void bt_event_callback(int event, bluetooth_event_param_t *param)
2781 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2783 bluetooth_device_info_t *device_info = NULL;
2784 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2786 device_info = (bluetooth_device_info_t *)param->param_data;
2787 memcpy(&searched_device, &device_info->device_address,
2788 sizeof(bluetooth_device_address_t));
2789 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2790 device_info->device_address.addr[0],
2791 device_info->device_address.addr[1],
2792 device_info->device_address.addr[2],
2793 device_info->device_address.addr[3],
2794 device_info->device_address.addr[4],
2795 device_info->device_address.addr[5]);
2798 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2800 bluetooth_device_info_t *device_info = NULL;
2801 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2803 device_info = (bluetooth_device_info_t *)param->param_data;
2804 memcpy(&searched_device, &device_info->device_address,
2805 sizeof(bluetooth_device_address_t));
2806 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2807 device_info->device_name.name,
2808 device_info->device_address.addr[0],
2809 device_info->device_address.addr[1],
2810 device_info->device_address.addr[2],
2811 device_info->device_address.addr[3],
2812 device_info->device_address.addr[4],
2813 device_info->device_address.addr[5]);
2817 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2818 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2823 unsigned short max_response;
2824 unsigned short discovery_duration;
2825 unsigned classOfDeviceMask;
2829 discovery_duration =0;
2830 classOfDeviceMask =0;
2832 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2837 int bluetooth_start_discovery(unsigned short max_response,
2838 unsigned short discovery_duration,
2839 unsigned int classOfDeviceMask);
2842 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2843 * unsigned short max_response,
2844 * unsigned short discovery_duration,
2845 * unsigned int classOfDeviceMask)
2846 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2848 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2849 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2850 * Please see bluetooth_start_discovery() for other parameters description.
2852 * This function is a asynchronous call.
2853 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2854 * through registered callback function.
2856 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2857 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2859 * The completion or cancellation of the discovery is indicated by an
2860 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2862 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2865 * @return BLUETOOTH_ERROR_NONE - Success \n
2866 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2867 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2868 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2869 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2870 agent is not running \n
2872 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2873 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2874 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2875 * @param[in] max_response define the maximum response of the number of founded devices
2877 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2878 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2879 (refer to class of device)
2881 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2884 unsigned short type;
2885 unsigned short max_response;
2886 unsigned short discovery_duration;
2887 unsigned classOfDeviceMask;
2892 discovery_duration =0;
2893 classOfDeviceMask =0;
2895 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2900 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2901 unsigned short max_response,
2902 unsigned short discovery_duration,
2903 unsigned int classOfDeviceMask);
2906 * @fn int bluetooth_cancel_discovery (void)
2907 * @brief Cancel the on-going device discovery operation
2910 * This function stops the on-going device discovery operation. This API has to be called after the
2911 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2912 * the bluetooth_start_discovery API
2914 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2915 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2916 * cancel the discover request once the user received the device to which he wish to connect.
2918 * This function is a asynchronous call.
2919 * If the call is success to cancel discovey then the application will receive
2920 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2921 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2922 * BLUETOOTH_ERROR_NONE
2925 * @return BLUETOOTH_ERROR_NONE - Success \n
2926 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2927 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2928 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2929 other application \n
2930 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2932 * @see bluetooth_start_discovery
2934 void bt_event_callback(int event, bluetooth_event_param_t *param)
2938 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2939 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2948 ret = bluetooth_cancel_discovery();
2951 int bluetooth_cancel_discovery(void);
2954 * @fn int bluetooth_start_le_discovery(void)
2955 * @brief Start the generic device discovery which finds the LE devices.
2957 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2958 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2959 * It try to find LE devices. Bluetooth device address and name are
2960 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2961 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2962 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2963 * please see bluetooth_device_info_t for more details.
2965 * This function is a asynchronous call.
2966 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2967 * through registered callback function.
2969 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2972 * The completion or cancellation of the discovery is indicated by an
2973 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2975 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2978 * @return BLUETOOTH_ERROR_NONE - Success \n
2979 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2980 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2981 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2982 agent is not running \n
2985 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2988 void bt_event_callback(int event, bluetooth_event_param_t *param)
2992 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2994 bluetooth_device_info_t *device_info = NULL;
2995 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2997 device_info = (bluetooth_device_info_t *)param->param_data;
2998 memcpy(&searched_device, &device_info->device_address,
2999 sizeof(bluetooth_device_address_t));
3000 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3001 device_info->device_address.addr[0],
3002 device_info->device_address.addr[1],
3003 device_info->device_address.addr[2],
3004 device_info->device_address.addr[3],
3005 device_info->device_address.addr[4],
3006 device_info->device_address.addr[5]);
3010 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3011 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3017 ret = bluetooth_start_discovery();
3022 int bluetooth_start_le_discovery(void);
3025 * @fn int bluetooth_stop_le_discovery (void)
3026 * @brief Cancel the on-going device LE discovery operation
3029 * This function stops the on-going device discovery operation. This API has to be called after the
3030 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3031 * the bluetooth_start_le_discovery API
3034 * This function is a asynchronous call.
3035 * If the call is success to cancel discovey then the application will receive
3036 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3037 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3038 * BLUETOOTH_ERROR_NONE
3041 * @return BLUETOOTH_ERROR_NONE - Success \n
3042 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3043 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3044 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3045 other application \n
3046 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3048 * @see bluetooth_start_discovery
3050 void bt_event_callback(int event, bluetooth_event_param_t *param)
3054 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3055 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3064 ret = bluetooth_stop_le_discovery();
3067 int bluetooth_stop_le_discovery(void);
3070 * @fn int bluetooth_is_discovering(void)
3071 * @brief Check for the device discovery is in-progress or not.
3073 * This API is used to check the current status of the Discovery operation.If discovery is in\
3074 * progress normally other operations are not allowed.
3075 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3076 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3077 * event before performing other operations. This API is used to get for the current discovery
3078 * operation status and using bluetooth_cancel_discovery()
3079 * we can cancell the ongoing discovery process.
3080 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3083 * This function checks whether the device discovery is started or not.
3085 * This function is a synchronous call.
3088 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3089 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3090 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3093 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3097 ret = bluetooth_is_discovering ();
3100 int bluetooth_is_discovering(void);
3103 * @fn int bluetooth_is_le_discovering(void)
3104 * @brief Check for the device LE discovery is in-progress or not.
3106 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3107 * progress normally other operations are not allowed.
3108 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3109 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3110 * event before performing other operations. This API is used to get for the current discovery
3111 * operation status and using bluetooth_stop_le_discovery()
3112 * we can cancell the ongoing LE discovery process.
3113 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3116 * This function checks whether the device LE discovery is started or not.
3118 * This function is a synchronous call.
3121 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3122 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3123 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3126 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3130 ret = bluetooth_is_le_discovering ();
3133 int bluetooth_is_le_discovering(void);
3136 * @fn int bluetooth_is_le_scanning(void)
3137 * @brief Check for the device LE scan is in-progress or not.
3139 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3140 * progress normally other operations are not allowed.
3142 * This function checks whether the device LE Scan is started or not.
3144 * This function is a synchronous call.
3146 * @return TRUE - LE Scan in progress \n
3147 * FALSE - LE Scan is not in progress \n
3152 gboolean is_le_scanning = 0;
3153 is_le_scanning = bluetooth_is_le_scanning ();
3156 gboolean bluetooth_is_le_scanning(void);
3158 gboolean bluetooth_is_scan_filter_supported(void);
3161 * @fn int bluetooth_force_hcidump(int timeout)
3162 * @brief Enable /disable force-hcidump
3164 * This function control force-hcidump.
3166 * This function is a synchronous call.
3168 * @return BLUETOOTH_ERROR_NONE - Success \n
3169 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3170 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3172 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3177 int bluetooth_force_hcidump(int timeout);
3180 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3181 * @brief Register scan filter.
3183 * This function registers the scan filter.
3185 * This function is a synchronous call.
3187 * @return BLUETOOTH_ERROR_NONE - Success \n
3189 * @param[in] filter scan filter to register
3190 * @param[out] slot_id the slot ID of scan filter
3194 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3197 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3198 * @brief Register scan filter.
3200 * This function unregisters the scan filter.
3202 * This function is a synchronous call.
3204 * @return BLUETOOTH_ERROR_NONE - Success \n
3206 * @param[in] slot_id the slot ID of scan filter
3210 int bluetooth_unregister_scan_filter(int slot_id);
3213 * @fn int bluetooth_unregister_all_scan_filters(void)
3214 * @brief Register scan filter.
3216 * This function usregisters all scan filters.
3218 * This function is a synchronous call.
3220 * @return BLUETOOTH_ERROR_NONE - Success \n
3224 int bluetooth_unregister_all_scan_filters(void);
3227 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3228 int link_type, bt_rssi_threshold_t rssi_threshold)
3229 * @brief Enable RSSI monitoring
3231 * This function enables RSSI monitoring and sets threshold for a connection
3233 * @return BLUETOOTH_ERROR_NONE - Success \n
3236 * @see bluetooth_get_rssi_strength
3238 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3239 int link_type, bt_rssi_threshold_t *rssi_threshold);
3242 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3243 * @brief Gets Raw RSSI signal Strength
3245 * This function gives the Raw RSSI signal strength for a connection.
3247 * @return BLUETOOTH_ERROR_NONE - Success \n
3250 * @see bluetooth_enable_rssi
3252 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3254 int bluetooth_set_connectable(gboolean is_connectable);
3256 int bluetooth_is_connectable(gboolean *is_connectable);
3259 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3260 * @brief Initiate a bonding process
3263 * This function initiates a bonding procedure with a peer device. The bonding procedure
3264 * enables authentication and optionally encryption on the Bluetooth link.
3266 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3267 * inititate the bonding request to the devices already in the paired list.
3269 * Usually we call this API after the device discovery.
3270 * This function is a asynchronous call.
3272 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3273 * mentioed result code
3274 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3275 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3276 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3277 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3278 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3280 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3281 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3284 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3287 * @return BLUETOOTH_ERROR_NONE - Success \n
3288 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3289 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3290 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3291 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3293 * @param[in] device_address This indicates an address of the device with which the pairing
3294 * should be initiated
3296 * @see bluetooth_cancel_bonding
3298 void bt_event_callback(int event, bluetooth_event_param_t *param)
3302 case BLUETOOTH_EVENT_BONDING_FINISHED:
3304 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3305 if (param->result >= BLUETOOTH_ERROR_NONE)
3307 bluetooth_device_info_t *device_info = NULL;
3308 device_info = (bluetooth_device_info_t *)param->param_data;
3309 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3310 mjr[%#x] min[%#x] srv[%#x]",
3311 device_info->device_name.name,
3312 device_info->device_address.addr[0],
3313 device_info->device_address.addr[1],
3314 device_info->device_address.addr[2],
3315 device_info->device_address.addr[3],
3316 device_info->device_address.addr[4],
3317 device_info->device_address.addr[5],
3318 device_info->device_class.major_class,
3319 device_info->device_class.minor_class,
3320 device_info->device_class.service_class);
3334 bluetooth_device_address_t device_address={{0}};
3336 ret = bluetooth_bond_device(&device_address);
3340 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3343 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3344 * bluetooth_conn_type_t conn_type)
3345 * @brief Initiate a bonding process
3348 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3349 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3351 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3352 * inititate the bonding request to the devices already in the paired list.
3354 * Usually we call this API after the device discovery.
3355 * This function is a asynchronous call.
3357 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3358 * mentioed result code
3359 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3360 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3361 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3362 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3363 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3365 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3366 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3369 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3372 * @return BLUETOOTH_ERROR_NONE - Success \n
3373 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3374 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3375 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3376 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3378 * @param[in] device_address This indicates an address of the device with which pairing
3379 * should be initiated
3380 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3383 * @see bluetooth_cancel_bonding
3385 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3386 bluetooth_conn_type_t conn_type);
3389 * @fn int bluetooth_cancel_bonding(void)
3390 * @brief Cancel the on-going bonding process
3392 * This API is called to cancel the on-going bonding procedure. It should be called before the
3393 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3394 * This API is useful when the remote device is not responding to the bond request or we wish to
3395 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3397 * This function is a synchronous call.
3399 * @return BLUETOOTH_ERROR_NONE - Success \n
3400 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3401 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3404 * @see bluetooth_bond_device
3410 ret = bluetooth_cancel_bonding();
3413 int bluetooth_cancel_bonding(void);
3416 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3417 * @brief Remove bonding
3420 * To communicate with remote device over bluetooth link, user should bond with peer device.
3421 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3422 * API is used to remove peer device from the list. Please note that after removing the device
3423 * from bonded device list, you cannot communication with peer device until bonding happens again.
3425 * User can call this function by passing bluetooth device address of any bonded device. Please note
3426 * that after successful return of this function, any bluetooth application running on your device
3427 * will not be able to communicate with unbonded device until bond operation happens again using
3428 * bluetooth_bond_device()
3431 * This function is a asynchronous call. The request to remove the specified device from the bonded
3432 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3433 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3434 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3438 * @return BLUETOOTH_ERROR_NONE - Success \n
3439 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3440 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3441 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3442 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3443 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3444 * agent is not running \n
3445 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3448 * @param[in] device_address This indicates an address of the device to remove bonding
3452 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3455 void bt_event_callback(int event, bluetooth_event_param_t *param)
3458 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3459 bluetooth_device_address_t *dev_addr = NULL;
3461 if (param->result == BLUETOOTH_ERROR_NONE) {
3462 dev_addr = (bluetooth_device_address_t *)param->param_data;
3464 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3465 dev_addr->addr[0], dev_addr->addr[1]
3466 dev_addr->addr[2], dev_addr->addr[3]
3467 dev_addr->addr[4], dev_addr->addr[5]
3478 bluetooth_device_address_t *device_address;
3480 // copy valid device address in device_address
3482 ret = bluetooth_unbond_device(device_address);
3485 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3488 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3489 * @brief Get bonded(paired) device list
3492 * This API gets all bonded device list.
3493 * The devices in the bonded device list further can be used to perform the authorization by calling
3494 * bluetooth_authorize_device API.
3496 * This function is a synchronous call.
3497 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3498 * there is no valid information in the dev_list.
3499 * The len field in the dev_list represents the number of bonded devices. The data structure for
3500 * bonded device information is bluetooth_device_info_t.
3503 * @return BLUETOOTH_ERROR_NONE - Success \n
3504 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3506 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3508 void bt_get_bonded_devices(void)
3512 GPtrArray *devinfo = NULL;
3513 bluetooth_device_info_t *ptr;
3515 // allocate the g_pointer_array
3516 devinfo = g_ptr_array_new();
3518 ret = bluetooth_get_bonded_device_list(&devinfo);
3519 if (ret != BLUETOOTH_ERROR_NONE)
3521 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3525 printf("g pointer arrary count : [%d]", devinfo->len);
3526 for (i=0; i<devinfo->len; i++)
3528 ptr = g_ptr_array_index(devinfo, i);
3531 printf("Name [%s]\n", ptr->device_name.name);
3532 printf("Major Class [%d]\n", ptr->device_class.major_class);
3533 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3534 printf("Service Class [%d]\n", ptr->device_class.service_class);
3535 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3536 ptr->device_address.addr[0],
3537 ptr->device_address.addr[1], ptr->device_address.addr[2],
3538 ptr->device_address.addr[3],
3539 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3546 // free g_pointer_array
3547 g_ptr_array_free(devinfo, TRUE);
3552 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3554 int bluetooth_get_profile_connected_device_list(
3555 const char *profile_uuid, GPtrArray **addr_list);
3558 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3559 * bluetooth_device_info_t *dev_info)
3560 * @brief Get a bonded(paired) device
3563 * This API gets a bonded device.
3565 * This function is a synchronous call.
3566 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3567 * there is no valid information in the dev_info.
3568 * The data structure for bonded device information is bluetooth_device_info_t.
3571 * @return BLUETOOTH_ERROR_NONE - Success \n
3572 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3574 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3576 void bt_get_bonded_device(void)
3580 bluetooth_device_info_t devinfo = {0};
3581 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3583 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3584 if (ret != BLUETOOTH_ERROR_NONE)
3586 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3590 printf("Name [%s]\n", devinfo.device_name.name);
3591 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3592 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3593 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3594 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3595 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3596 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3597 devinfo.device_address.addr[5]);
3606 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3607 bluetooth_device_info_t *dev_info);
3611 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3612 * gboolean *is_alias_set)
3613 * @brief Get is_alias_set property of device
3615 * This API gets is_alias_set property of a bonded device.
3617 * This function is a synchronous call.
3618 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3619 * If not,there is no valid information in the is_alias_set.
3621 * @return BLUETOOTH_ERROR_NONE - Success \n
3622 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3627 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3629 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3632 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3633 gboolean *is_alias_set);
3636 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3637 * @brief set alias for bonded device
3640 * This function set alias for bonded device.
3642 * This function is a synchronous call.
3645 * @return BLUETOOTH_ERROR_NONE - Success \n
3646 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3647 * @param[in] device_address This indicates an address of the remote device
3648 * @param[in] alias This indicates an alias to set
3653 ret = bluetooth_set_alias(&remote_address);
3656 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3660 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3661 * @brief Get remote deivice
3664 * This function gets specific remote device.
3666 * This function is a asynchronous call.
3667 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3670 * @return BLUETOOTH_ERROR_NONE - Success \n
3671 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3672 * @param[in] device_address This indicates an address of the remote device
3677 ret = bluetooth_get_remote_device(&remote_address);
3680 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3683 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3684 * gboolean authorized)
3685 * @brief Authorize/Unauthorize a bonded device
3688 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3689 * with/without user confirmation.
3691 * If we select a paired device and make it authorized by calling this API with the authorized
3692 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3693 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3694 * then it will ask for the user conformation before the connection.
3696 * This API supposed to be called on the paired devices. Which means we have to use this API only
3697 * after successful pairing.
3699 * This function is a asynchronous call.
3700 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3702 * @return BLUETOOTH_ERROR_NONE - Success \n
3703 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3704 * @param[in] device_address This indicates an address of the device to authorize \n
3705 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3707 * @see bluetooth_get_bonded_device_list
3709 void bt_event_callback(int event, bluetooth_event_param_t *param)
3713 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3715 if (param->result == BLUETOOTH_ERROR_NONE)
3719 //device authorization failed failure
3727 bluetooth_device_address_t device_address={{0}};
3728 gboolean authorized;
3732 ret = bluetooth_authorize_device(&device_address,authorized);
3735 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3736 gboolean authorized);
3738 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3739 const bluetooth_device_pin_code_t *pin_code);
3741 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3744 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3746 * @brief Receives Legacy Passkey\pin with following authentication response types
3748 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3749 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3752 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3755 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3757 * @brief This API sends user confirmation reply to the local adapter.
3759 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3762 int bluetooth_passkey_confirmation_reply(gboolean reply);
3765 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3766 * @brief Get all services supported by remote device
3769 * This API call initiates the search for the services supported by the specified device. Normally
3770 * the service search will take a couple of seconds to get it completed. Before calling this API
3771 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3772 * perform the service search. We can get the device address by doing a device discovery operation.
3775 * This function is a asynchronous call.
3776 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3778 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3779 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3780 * event is generated with appropriate result code.
3782 * @return BLUETOOTH_ERROR_NONE - Success \n
3783 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3784 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3785 * @param[in] device_address This indicates an address of the device
3786 * whose services need to be found
3788 * @see bluetooth_cancel_service_search
3790 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3793 * @fn int bluetooth_cancel_service_search(void)
3794 * @brief Cancel the ongoing service search operation
3797 * This function cancel the ongoing service search operation. This API is usually calling after the
3798 * bluetooth_search_service API.
3799 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3800 * if the user wish to cancel the Ongoing service search operation.
3802 * This API should be called just after the bluetooth_search_service API and before the
3803 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3805 * This function is a synchronous call.
3807 * @return BLUETOOTH_ERROR_NONE - Success \n
3808 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3809 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3810 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3813 * @see bluetooth_search_service
3818 ret = bluetooth_cancel_service_search();
3821 int bluetooth_cancel_service_search(void);
3824 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3825 * @brief Register rfcomm socket with a specific uuid
3828 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3829 * descriptor of the server.
3830 * This is the first API which is called to create the server. Once we created the server socket,
3831 * we will listen on that return socket.
3832 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3835 * @return socket FD on Success \n
3836 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3837 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3838 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3839 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3840 * @param[in] UUID (128 bits)
3843 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3847 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3848 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3852 int bluetooth_rfcomm_create_socket(const char *uuid);
3855 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3856 * @brief Register rfcomm socket with a specific uuid
3859 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3860 * descriptor of the server.
3861 * This is the first API which is called to create the server. Once we created the server socket,
3862 * we will listen on that return socket.
3863 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3866 * @return socket FD on Success \n
3867 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3868 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3869 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3870 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3871 * @param[in] UUID (128 bits)
3872 * @param[in] bus_name (const char)
3873 * @param[in] path (const char)
3876 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3880 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3881 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3885 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3888 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3889 * @brief De-register the rfcomm socket
3892 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3893 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3894 * descriptor else no event will come. We will call this API only after the
3895 * bluetooth_rfcomm_listen_and_accept.
3896 * This is a synchronous call.
3898 * @return BLUETOOTH_ERROR_NONE - Success \n
3899 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3900 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3901 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3902 * @param[in] int socket_fd
3905 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3908 void bt_event_callback(int event, bluetooth_event_param_t *param)
3912 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3914 bluetooth_rfcomm_connection_t *discon_ind =
3915 (bluetooth_rfcomm_connection_t *)param->param_data;
3917 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3925 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3926 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3928 ret = bluetooth_rfcomm_remove_socket(fd);
3931 int bluetooth_rfcomm_remove_socket(int socket_fd);
3934 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3935 * @brief De-register the rfcomm socket
3938 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3939 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3940 * descriptor else no event will come. We will call this API only after the
3941 * bluetooth_rfcomm_listen_and_accept_ex.
3942 * This is a synchronous call.
3944 * @return BLUETOOTH_ERROR_NONE - Success \n
3945 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3946 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3947 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3948 * @param[in] UUID (128 bits)
3951 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3954 void bt_event_callback(int event, bluetooth_event_param_t *param)
3958 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3960 bluetooth_rfcomm_connection_t *discon_ind =
3961 (bluetooth_rfcomm_connection_t *)param->param_data;
3963 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3971 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3972 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3974 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3977 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3980 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3981 * @brief Disconnect rfcomm connection
3984 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3985 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3988 * @return BLUETOOTH_ERROR_NONE - Success \n
3989 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3990 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3991 * @param[in] int socket_fd the sending socket fd
3997 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3999 printf("Disconnection failed");
4001 printf("Disconnection Success");
4005 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4008 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4009 * @brief Rfcomm socket listen
4012 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4013 * after the bluetooth_rfcomm_create_socket API.
4014 * This API listen for the incomming connection and once it receives a connection, it will give
4015 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4016 * event to the application. This is an Asynchronous API call.
4019 * @return BLUETOOTH_ERROR_NONE - Success \n
4020 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4021 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4023 * @param[in] int socket_fd
4024 * @param[in] max pending connection.
4027 * @see bluetooth_rfcomm_create_socket
4030 void bt_event_callback(int event, bluetooth_event_param_t* param)
4034 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4036 bluetooth_rfcomm_connection_t *conn_ind =
4037 (bluetooth_rfcomm_connection_t *)param->param_data;
4039 printf("\nConnected from FD %d", conn_ind->socket_fd);
4047 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4048 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4052 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4055 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4056 * @brief Rfcomm socket listen
4059 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4060 * after the bluetooth_rfcomm_create_socket API.
4061 * This API listen for the incomming connection and once it receives a connection, it will give
4062 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4063 * event to the application. This is an Asynchronous API call.
4066 * @return BLUETOOTH_ERROR_NONE - Success \n
4067 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4068 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4070 * @param[in] int socket_fd
4071 * @param[in] max pending connection.
4076 * @see bluetooth_rfcomm_create_socket_ex
4079 void bt_event_callback(int event, bluetooth_event_param_t* param)
4083 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4085 bluetooth_rfcomm_connection_t *conn_ind =
4086 (bluetooth_rfcomm_connection_t *)param->param_data;
4088 printf("\nConnected from FD %d", conn_ind->socket_fd);
4096 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4097 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4102 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4105 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4106 * @brief Rfcomm socket listen
4109 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4110 * after the bluetooth_rfcomm_create_socket API.
4111 * This API listen for the incomming connection and once it receives a connection, it will give
4112 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4113 * event to the application. This is an Asynchronous API call.
4116 * @return BLUETOOTH_ERROR_NONE - Success \n
4117 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4118 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4120 * @param[in] int socket_fd
4121 * @param[in] max pending connection.
4124 * @see bluetooth_rfcomm_create_socket
4127 void bt_event_callback(int event, bluetooth_event_param_t* param)
4131 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4133 char *name = (char *)param->param_data;
4135 printf("\nConnected from %s", name);
4137 bluetooth_rfcomm_accept_connection();
4145 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4146 ret = bluetooth_rfcomm_listen(fd, 1);
4150 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4153 * @fn int bluetooth_rfcomm_accept_connection()
4154 * @brief Accepts the authorization request indicated by the event
4155 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4157 * This function is a synchronous call.
4159 * @return BLUETOOTH_ERROR_NONE - Success \n
4160 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4162 * @param[in] the socket fd of the server
4163 * @param[out] the socket fd of the client
4167 * @see bluetooth_rfcomm_reject_connection
4169 int bluetooth_rfcomm_accept_connection(int server_fd);
4172 * @fn int bluetooth_rfcomm_reject_connection()
4173 * @brief Rejects the authorization request indicated by the event
4174 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4176 * This function is a synchronous call.
4178 * @return BLUETOOTH_ERROR_NONE - Success \n
4179 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4181 * @param[in] the socket fd of the server
4185 * @see bluetooth_rfcomm_accept_connection
4187 int bluetooth_rfcomm_reject_connection(int server_fd);
4190 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4191 * @brief Informs whether rfcomm server uuid is available or not.
4193 * This function is a synchronous call.
4195 * @return TRUE - RFCOMM uuid is available \n
4196 * FALSE - RFCOMM uuid is not available \n
4198 * @param[in] uuid UUID string
4204 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4207 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4208 * const char *remote_uuid)
4209 * @brief Connect to the remote device rfcomm *
4211 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4212 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4213 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4214 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4215 * initiating a connection.
4217 * @return BLUETOOTH_ERROR_NONE - Success \n
4218 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4219 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4220 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4221 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4222 * @param[in] bluetooth_device_address_t remote bt_address
4223 * @param[in] char remote uuid
4225 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4229 void bt_event_callback(int event, bluetooth_event_param_t *param)
4233 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4235 if (param->result >= BLUETOOTH_ERROR_NONE)
4237 bt_sdp_info_t *bt_sdp_info=param->param_data;
4239 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4240 bt_sdp_info->device_addr.addr[0],
4241 bt_sdp_info->device_addr.addr[1],
4242 bt_sdp_info->device_addr.addr[2],
4243 bt_sdp_info->device_addr.addr[3],
4244 bt_sdp_info->device_addr.addr[4],
4245 bt_sdp_info->device_addr.addr[5]);
4247 printf("Supported service list:\n");
4248 for(i=0; i<bt_sdp_info->service_index; i++)
4250 bt_sdp_info->service_list_array[i]);
4253 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4254 //rfcomm_test_uuid);
4258 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4260 bluetooth_rfcomm_connection_t *conn_ind =
4261 (bluetooth_rfcomm_connection_t *)param->param_data;
4263 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4264 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4265 "SERVER" : "CLIENT");
4270 bluetooth_device_address_t remote_address = {{0},};
4271 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4272 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4273 ret = bluetooth_search_service(&remote_address);
4275 printf("Seach failed, Reason = %d", ret);
4277 printf("Search Success, Ret = %d", ret);
4279 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4281 printf("Connection failed, Reason = %d", ret);
4283 printf("Connection Success, Ret = %d", ret);
4287 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4288 const char *remote_uuid);
4291 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4292 * @brief Disconnect rfcomm connection
4295 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4296 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4299 * @return BLUETOOTH_ERROR_NONE - Success \n
4300 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4301 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4302 * @param[in] char remote bt_address
4305 * @see bluetooth_rfcomm_connect
4309 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4311 printf("Disconnection failed");
4313 printf("Disconnection Success");
4318 int bluetooth_rfcomm_disconnect(int socket_fd);
4321 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4322 * @brief Write to rfcomm connection
4325 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4326 * API is used to send the data for server and the client.
4328 * @return BLUETOOTH_ERROR_NONE - Success \n
4329 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4330 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4332 * @param[in] const char *buff Data buffer to send
4333 * @param[in] int length Length of the data
4336 * @see bluetooth_rfcomm_connect
4339 char *buff = "Test data 123456789"
4340 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4342 printf("Send failed");
4344 printf("Send success");
4348 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4351 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4352 * @brief Informs whether rfcomm client is connected.
4354 * This function is a synchronous call.
4356 * @return TRUE - RFCOMM client is connected \n
4357 * FALSE - RFCOMM client is not connected \n
4363 gboolean bluetooth_rfcomm_is_client_connected(void);
4364 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4365 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4368 * @fn int bluetooth_network_activate_server(void)
4369 * @brief Activate the NAP (Network Access Point) service
4371 * This function is a asynchronous call.
4372 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4374 * @return BLUETOOTH_ERROR_NONE - Success \n
4375 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4376 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4377 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4380 * @see bluetooth_network_deactivate_server
4383 int bluetooth_network_activate_server(void);
4386 * @fn int bluetooth_network_deactivate_server(void)
4387 * @brief Deactivate the NAP (Network Access Point) service
4389 * This function is a asynchronous call.
4390 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4392 * @return BLUETOOTH_ERROR_NONE - Success \n
4393 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4394 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4395 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4398 * @see bluetooth_network_activate_server
4401 int bluetooth_network_deactivate_server(void);
4404 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4405 * bluetooth_network_role_t role,
4407 * @brief Connect the network server in the peer
4409 * This function is a asynchronous call.
4410 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4412 * @return BLUETOOTH_ERROR_NONE - Success \n
4413 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4414 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4415 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4418 * @param[in] device_address This indicates an address of the device with which the pairing
4419 * should be initiated
4420 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4421 * need to use the third parameter.
4422 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4423 * connect. UUID string
4425 * @see bluetooth_network_disconnect
4427 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4428 bluetooth_network_role_t role, char *custom_uuid);
4431 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4432 * bluetooth_network_role_t role,
4433 * char *custom_uuid)
4434 * @brief Connect the network server in the peer
4436 * This function is a asynchronous call.
4437 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4439 * @return BLUETOOTH_ERROR_NONE - Success \n
4440 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4441 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4442 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4445 * @param[in] device_address This indicates an address of the device with which the pairing
4446 * should be initiated
4448 * @see bluetooth_network_connect
4450 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4453 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4454 * @brief Disconnect the device from the network
4456 * This function is an asynchronous call.
4457 * The network server disconnect request is responded by
4458 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4460 * @return BLUETOOTH_ERROR_NONE - Success \n
4461 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4462 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4463 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4466 * @param[in] device_address This indicates an address of the connected client device
4468 * @see bluetooth_network_activate_server
4470 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4475 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4476 * bt_hdp_role_type_t role,
4477 * bt_hdp_qos_type_t channel_type,
4478 * char **app_handle)
4479 * @brief Activate the HDP service for a particular data type
4481 * This function is a synchronous call.
4483 * @return BLUETOOTH_ERROR_NONE - Success \n
4484 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4485 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4486 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4489 * @param[in] data_type The data type against corresponding service
4490 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4491 * @param[in] channel_type The QOS type for the channel.
4492 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4493 * For role = HDP_ROLE_SINK, the channel_type
4494 * should be HDP_QOS_ANY.
4495 * @param[out] app_handle The application handler against corresponding service
4497 * @see bluetooth_hdp_deactivate
4499 int bluetooth_hdp_activate(unsigned short data_type,
4500 bt_hdp_role_type_t role,
4501 bt_hdp_qos_type_t channel_type,
4504 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4505 * @brief Deactivate the HDP service for a particular service using the handler
4507 * This function is a synchronous call.
4509 * @return BLUETOOTH_ERROR_NONE - Success \n
4510 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4511 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4512 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4515 * @param[in] app_handle The application handler against corresponding service
4517 * @see bluetooth_hdp_deactivate
4519 int bluetooth_hdp_deactivate(const char *app_handle);
4522 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4523 * const char *buffer, unsigned int size)
4524 * @brief Send data to the remote HDP device
4526 * This function is a synchronous call.
4528 * @return BLUETOOTH_ERROR_NONE - Success \n
4529 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4530 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4531 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4532 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4535 * @param[in] channel_id The channel id for the connection.
4536 * @param[in] buffer The pdu buffer.
4537 * @param[in] size Size of the buffer.
4539 * @see bluetooth_hdp_connect
4541 int bluetooth_hdp_send_data(unsigned int channel_id,
4542 const char *buffer, unsigned int size);
4544 * @fn int bluetooth_hdp_connect(const char *app_handle,
4545 * bt_hdp_qos_type_t channel_type,
4546 * const bluetooth_device_address_t *device_address)
4547 * @brief Connect to the remote device(Mainly used by source)
4549 * This function is a asynchronous call.
4550 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4552 * @return BLUETOOTH_ERROR_NONE - Success \n
4553 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4554 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4555 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4556 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4559 * @param[in] app_handle The application handler against corresponding service
4560 * @param[in] channel_type The QOS type for the channel.
4561 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4562 * @param[in] device_address The remote device Bd address.
4565 * @see bluetooth_hdp_disconnect
4567 int bluetooth_hdp_connect(const char *app_handle,
4568 bt_hdp_qos_type_t channel_type,
4569 const bluetooth_device_address_t *device_address);
4571 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4572 * const bluetooth_device_address_t *device_address)
4573 * @brief Disconnect from the remote device(Mainly used by source)
4575 * This function is a asynchronous call.
4576 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4578 * @return BLUETOOTH_ERROR_NONE - Success \n
4579 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4580 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4581 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4582 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4585 * @param[in] channel_id The channel id for the connection.
4586 * @param[in] device_address The remote device Bd address.
4589 * @see bluetooth_hdp_connect
4591 int bluetooth_hdp_disconnect(unsigned int channel_id,
4592 const bluetooth_device_address_t *device_address);
4596 * @fn int bluetooth_opc_init(void)
4597 * @brief Initialize OPP client.
4599 * This function is a synchronous call.
4600 * No event corresponding to this api
4602 * @return BLUETOOTH_ERROR_NONE - Success \n
4603 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4604 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4605 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4606 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4611 * @see bluetooth_opc_deinit
4613 int bluetooth_opc_init(void);
4616 * @fn int bluetooth_opc_deinit(void)
4617 * @brief Deinitialize OPP client.
4619 * This function is a synchronous call.
4620 * No event corresponding to this api
4622 * @return BLUETOOTH_ERROR_NONE - Success \n
4623 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4624 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4629 * @see bluetooth_opc_init
4632 int bluetooth_opc_deinit(void);
4635 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4636 char **file_name_array)
4637 * @brief Send multiple files to a remote device.
4639 * This function is a asynchronous call.
4640 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4642 * @return BLUETOOTH_ERROR_NONE - Success \n
4643 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4644 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4645 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4646 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4647 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4648 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4651 * @param[in] device_address The remote device Bd address.
4652 * @param[in] file_name_array Array of filepaths to be sent.
4655 * @see bluetooth_opc_cancel_push
4658 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4659 char **file_name_array);
4662 * @fn int bluetooth_opc_cancel_push(void)
4663 * @brief Cancels the ongoing file push.
4665 * This function is a asynchronous call.
4666 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4667 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4669 * @return BLUETOOTH_ERROR_NONE - Success \n
4670 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4671 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4676 * @see bluetooth_opc_push_files
4679 int bluetooth_opc_cancel_push(void);
4682 * @fn gboolean bluetooth_opc_session_is_exist(void)
4683 * @brief Informs whether opc session exists or not.
4685 * This function is a synchronous call.
4687 * @return TRUE - OPC session exists \n
4688 * FALSE - OPC session does not exist \n
4696 gboolean bluetooth_opc_session_is_exist(void);
4699 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4700 * @brief Informs whether opc session exists or not.
4702 * This function is a synchronous call.
4704 * @return BLUETOOTH_ERROR_NONE - Success \n
4705 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4706 * BLUETOOTH_ERROR_INTERNAL \n
4709 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4714 int bluetooth_opc_is_sending(gboolean *is_sending);
4717 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4718 int transfer_id, unsigned char *progress)
4719 * @brief Gets the percentage progress for ongoing transfers.
4721 * This function is a synchronous call.
4723 * @return BLUETOOTH_ERROR_NONE - Success \n
4724 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4725 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4728 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4729 * @param[in] transfer_id Transfer ID
4730 * @param[out] progress Percentage Progress
4734 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4735 int transfer_id, unsigned char *progress);
4738 * @fn int bluetooth_obex_server_init(const char *dst_path)
4739 * @brief Initialize OPP and FTP server.
4741 * This function is a synchronous call.
4742 * No event corresponding to this api
4744 * @return BLUETOOTH_ERROR_NONE - Success \n
4745 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4746 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4747 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4748 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4751 * @param[in] dst_path OPS destination file path.
4753 * @see bluetooth_obex_server_deinit
4755 int bluetooth_obex_server_init(const char *dst_path);
4759 * @fn int bluetooth_obex_server_deinit(void)
4760 * @brief Deinitialize OPP and FTP server.
4762 * This function is a synchronous call.
4763 * No event corresponding to this api
4765 * @return BLUETOOTH_ERROR_NONE - Success \n
4766 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4767 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4772 * @see bluetooth_obex_server_init
4774 int bluetooth_obex_server_deinit(void);
4778 * @fn gboolean bluetooth_obex_server_is_activated(void)
4779 * @brief Informs whether obex server is activated or not.
4781 * This function is a synchronous call.
4783 * @return TRUE - OBEX server is activated \n
4784 * FALSE - OBEX server is not activated \n
4791 gboolean bluetooth_obex_server_is_activated(void);
4795 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4796 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4798 * This function is a synchronous call.
4799 * No event corresponding to this api
4801 * @return BLUETOOTH_ERROR_NONE - Success \n
4802 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4803 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4804 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4805 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4809 * @param[in] dst_path OPS destination file path.
4811 * @see bluetooth_obex_server_deinit_without_agent
4813 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4817 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4818 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4820 * This function is a synchronous call.
4821 * No event corresponding to this api
4823 * @return BLUETOOTH_ERROR_NONE - Success \n
4824 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4825 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4830 * @see bluetooth_obex_server_init_without_agent
4832 int bluetooth_obex_server_deinit_without_agent(void);
4836 * @fn int bluetooth_obex_server_accept_connection(void)
4837 * @brief Accepts the authorization request indicated by the event
4838 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4840 * This function is a synchronous call.
4842 * @return BLUETOOTH_ERROR_NONE - Success \n
4843 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4844 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4848 * @see bluetooth_obex_server_reject_authorize
4850 int bluetooth_obex_server_accept_connection(void);
4854 * @fn int bluetooth_obex_server_reject_connection(void)
4855 * @brief Rejects the authorization request indicated by the event
4856 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4858 * This function is a synchronous call.
4860 * @return BLUETOOTH_ERROR_NONE - Success \n
4861 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4862 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4866 * @see bluetooth_obex_server_reject_authorize
4868 int bluetooth_obex_server_reject_connection(void);
4872 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4873 * @brief Accepts the authorization request indicated by the event
4874 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4876 * This function is a asynchronous call.
4877 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4879 * @return BLUETOOTH_ERROR_NONE - Success \n
4880 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4881 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4882 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4885 * @param[in] filename Authorized filename.
4888 * @see bluetooth_obex_server_reject_authorize
4891 int bluetooth_obex_server_accept_authorize(const char *filename);
4894 * @fn int bluetooth_obex_server_reject_authorize(void)
4895 * @brief Reject the authorization request indicated by the event
4896 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4898 * This function is a asynchronous call.
4899 * No event for this api..
4901 * @return BLUETOOTH_ERROR_NONE - Success \n
4902 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4903 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4908 * @see bluetooth_obex_server_accept_authorize
4911 int bluetooth_obex_server_reject_authorize(void);
4914 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4915 * @brief Set the OPS destination file path..
4917 * This function is a asynchronous call.
4918 * No event for this api..
4920 * @return BLUETOOTH_ERROR_NONE - Success \n
4921 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4922 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4923 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4926 * @param[in] dst_path OPS destination file path.
4932 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4935 * @fn int bluetooth_obex_server_set_root(const char *root)
4936 * @brief Set the FTS root folder..
4938 * This function is a asynchronous call.
4939 * No event for this api..
4941 * @return BLUETOOTH_ERROR_NONE - Success \n
4942 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4943 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4944 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4945 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4946 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4949 * @param[in] root FTS root folder.
4955 int bluetooth_obex_server_set_root(const char *root);
4958 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4959 * @brief Cancel the transfer on server
4961 * This function is an asynchronous call.
4962 * If the function call that cancels transfer is successful, the application would receive
4963 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4964 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4965 * the error code will be BLUETOOTH_ERROR_NONE
4967 * @return BLUETOOTH_ERROR_NONE - Success \n
4968 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4969 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4970 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4971 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4974 * @param[in] transfer_id transfer ID
4979 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4983 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4984 * @brief Cancel the transfer on server
4986 * This function is an asynchronous call.
4987 * If the function call that cancels transfer is successful, the application would receive
4988 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4989 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4990 * the error code will be BLUETOOTH_ERROR_NONE
4992 * @return BLUETOOTH_ERROR_NONE - Success \n
4993 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4994 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4995 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4996 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5003 int bluetooth_obex_server_cancel_all_transfers(void);
5007 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5008 * @brief Informs whether obex server is receiving or not.
5010 * This function is a synchronous call.
5012 * @return BLUETOOTH_ERROR_NONE - Success \n
5013 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5014 * BLUETOOTH_ERROR_INTERNAL \n
5017 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5022 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5026 * @fn int bluetooth_map_client_init(void)
5027 * @brief Initialize MAP client.
5029 * This function is a synchronous call.
5030 * No event corresponding to this api
5032 * @return BLUETOOTH_ERROR_NONE - Success \n
5033 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5034 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5035 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5036 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5041 * @see bluetooth_map_client_deinit
5043 int bluetooth_map_client_init(void);
5045 int bluetooth_map_client_deinit(void);
5047 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5049 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5051 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5053 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5054 bt_map_client_list_folders_filter_t *filter);
5057 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5058 * @brief Return all available fields that can be used in Fields filter.
5060 * This function is a asynchronous call.
5062 * @return BLUETOOTH_ERROR_NONE - Success \n
5063 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5064 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5067 * @param[in] session Information about session.
5070 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5072 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5074 bt_map_client_list_messages_filter_t *filter);
5076 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5078 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5079 const char *source_file,
5081 bt_map_client_push_message_args_t *args);
5083 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5084 const bt_map_client_message_object_t message_object,
5085 const char *target_file,
5090 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5091 * @brief Read the local Hash and Randmizer.
5093 * This function is a synchronous call.
5095 * @return BLUETOOTH_ERROR_NONE - Success \n
5096 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5100 * @param[out] local_oob_data - Pointer to the local OOB data
5106 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5110 * @fn int bluetooth_oob_add_remote_data(
5111 * const bluetooth_device_address_t *remote_device_address,
5112 * bluetooth_bdaddr_type_e address_type,
5113 * bt_oob_data_t *oob_data)
5114 * @brief Add/updated the remote device Hash and Randmizer.
5116 * This function is a synchronous call.
5117 * No event for this api..
5119 * @return BLUETOOTH_ERROR_NONE - Success \n
5120 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5123 * @param[in] remote_device_address - Remote device address
5124 * address_type - bdaddr type
5125 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5131 int bluetooth_oob_add_remote_data(
5132 const bluetooth_device_address_t *remote_device_address,
5133 bluetooth_bdaddr_type_e address_type,
5134 bt_oob_data_t *remote_oob_data);
5138 * @fn int bluetooth_oob_remove_remote_data(
5139 * const bluetooth_device_address_t *remote_device_address)
5140 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5142 * This function is a synchronous call.
5143 * No event for this api..
5145 * @return BLUETOOTH_ERROR_NONE - Success \n
5146 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5149 * @param[in] remote_device_address - Remote device address
5155 int bluetooth_oob_remove_remote_data(
5156 const bluetooth_device_address_t *remote_device_address);
5159 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5160 * bt_gatt_handle_info_t *prim_svc);
5162 * @brief Gets the GATT based primary services handle supported by remote device
5164 * This function is a synchronous call.
5165 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5167 * @return BLUETOOTH_ERROR_NONE - Success \n
5168 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5169 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5170 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5173 * @param[in] address - Remote device address
5174 * @param[out] prim_svc - Structure containing remote service count and handle list.
5177 * @see bluetooth_gatt_free_primary_services()
5179 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5180 bt_gatt_handle_info_t *prim_svc);
5183 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5185 * @brief Discovers the characteristics of GATT based service of remote device
5187 * This function is an asynchronous call.
5188 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5190 * @return BLUETOOTH_ERROR_NONE - Success \n
5191 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5192 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5193 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5196 * @param[in] service_handle - Handle for remote service.
5201 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5203 int bluetooth_gatt_set_service_change_watcher(
5204 const bluetooth_device_address_t *address, gboolean enable);
5207 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5208 * bt_gatt_service_property_t *service);
5210 * @brief Gets the properties of GATT based service of remote device
5212 * This function is a synchronous call.
5213 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5215 * @return BLUETOOTH_ERROR_NONE - Success \n
5216 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5217 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5218 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5221 * @param[in] service_handle - Handle for remote service.
5222 * @param[out] service - Structure containing remote service property.
5225 * @see bluetooth_gatt_free_service_property()
5227 int bluetooth_gatt_get_service_property(const char *service_handle,
5228 bt_gatt_service_property_t *service);
5231 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5233 * @brief Register to GATT based service to receive value change notification/indication.
5235 * This function is a synchronous call.
5236 * No event for this api.
5238 * @return BLUETOOTH_ERROR_NONE - Success \n
5239 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5240 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5241 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5244 * @param[in] service_handle - Handle for remote service.
5249 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5252 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5254 * @brief Unregister GATT based service to receive value change notification/indication.
5256 * This function is a synchronous call.
5257 * No event for this api.
5259 * @return BLUETOOTH_ERROR_NONE - Success \n
5260 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5261 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5262 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5265 * @param[in] service_handle - Handle for remote service.
5270 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5273 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5274 * bt_gatt_char_property_t *characteristic);
5276 * @brief Provides characteristic value along with properties.
5278 * This function is a synchronous call.
5279 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5281 * @return BLUETOOTH_ERROR_NONE - Success \n
5282 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5283 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5284 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5287 * @param[in] char_handle - Handle for Characteristic property.
5288 * @param[out] characteristic - Structure containing remote characteristic property.
5291 * @see bluetooth_gatt_free_char_property()
5293 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5294 bt_gatt_char_property_t *characteristic);
5297 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5298 * bt_gatt_char_property_t *characteristic);
5300 * @brief Provides characteristic descriptor value along with its UUID.
5302 * This function is a synchronous call.
5303 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5305 * @return BLUETOOTH_ERROR_NONE - Success \n
5306 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5307 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5308 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5311 * @param[in] desc_handle - Handle for Characteristic descriptor.
5312 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5315 * @see bluetooth_gatt_free_desc_property()
5317 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5318 bt_gatt_char_descriptor_property_t *descriptor);
5322 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5323 * const guint8 *value, int length)
5325 * @brief Set characteristic value.
5327 * This function is a synchronous call.
5329 * @return BLUETOOTH_ERROR_NONE - Success \n
5330 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5331 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5332 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5335 * @param[in] char_handle - Handle for Characteristic property.
5336 * @param[in] value - New value to set for characteristic property.
5337 * @param[in] length - Length of the value to be set.
5342 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5343 const guint8 *value, int length);
5346 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5347 * const guint8 *value, int length, guint8 write_type)
5349 * @brief Set characteristic value by write type.
5351 * This function is a synchronous call if write type is "write without resonse"
5352 * and it is an asynchronous call if write type is "write with response"
5354 * @return BLUETOOTH_ERROR_NONE - Success \n
5355 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5356 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5357 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5360 * @param[in] char_handle - Handle for Characteristic property.
5361 * @param[in] value - New value to set for characteristic property.
5362 * @param[in] length - Length of the value to be set.
5363 * @param[in] write_type - Type of write.
5368 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5369 const guint8 *value, int length, guint8 write_type);
5373 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5374 * const guint8 *value, int length)
5376 * @brief Set characteristic value request.
5378 * This function is an asynchronous call.
5380 * @return BLUETOOTH_ERROR_NONE - Success \n
5381 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5382 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5383 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5386 * @param[in] char_handle - Handle for Characteristic property.
5387 * @param[in] value - New value to set for characteristic property.
5388 * @param[in] length - Length of the value to be set.
5393 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5394 const guint8 *value, int length);
5397 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5399 * @brief Read characteristic value.
5401 * This function is a asynchronous call.
5403 * @return BLUETOOTH_ERROR_NONE - Success \n
5404 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5405 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5406 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5409 * @param[in] char_handle - Handle for Characteristic property.
5414 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5417 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5418 * const char *service_uuid,
5419 * bt_gatt_service_property_t *service)
5421 * @brief Gets the service property from a device based on a particular uuid
5423 * This function is a synchronous call.
5425 * @return BLUETOOTH_ERROR_NONE - Success \n
5426 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5427 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5428 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5431 * @param[in] address - BD address of the remote device
5432 * @param[in] service_uuid - uuid of the service.
5433 * @param[out] service - Structure containing the service property.
5438 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5439 const char *service_uuid,
5440 bt_gatt_service_property_t *service);
5443 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5444 * const char *char_uuid)
5446 * @brief Gets the characteristic property from a service based on a particular char uuid
5448 * This function is an asynchronous call.
5449 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5451 * @return BLUETOOTH_ERROR_NONE - Success \n
5452 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5453 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5454 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5457 * @param[in] service_handle - Service handle.
5458 * @param[in] uuid - Characteristic uuid.
5463 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5464 const char *char_uuid);
5467 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5469 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5471 * This function is a synchronous call.
5472 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5474 * @return BLUETOOTH_ERROR_NONE - Success \n
5475 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5478 * @param[in] prim_svc - GATT handle info structure
5481 * @see bluetooth_gatt_get_primary_services()
5483 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5486 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5488 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5490 * This function is a synchronous call.
5491 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5493 * @return BLUETOOTH_ERROR_NONE - Success \n
5494 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5497 * @param[in] svc_pty - GATT service property structure.
5500 * @see bluetooth_gatt_get_service_property()
5502 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5505 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5507 * @brief Provides characteristic value along with properties.
5509 * This function is a synchronous call.
5510 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5512 * @return BLUETOOTH_ERROR_NONE - Success \n
5513 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5516 * @param[in] char_pty - GATT characteristics property structure.
5519 * @see bluetooth_gatt_get_characteristics_property()
5521 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5524 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5526 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5528 * This function is a synchronous call.
5529 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5531 * @return BLUETOOTH_ERROR_NONE - Success \n
5532 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5535 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5538 * @see bluetooth_gatt_get_char_descriptor_property()
5540 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5542 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5544 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5547 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5549 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5551 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5553 * @return BLUETOOTH_ERROR_NONE - Success \n
5554 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5557 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5561 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5564 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5566 * @brief Read characteristic descriptor value.
5568 * This function is a asynchronous call.
5570 * @return BLUETOOTH_ERROR_NONE - Success \n
5571 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5572 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5573 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5576 * @param[in] desc_handle - Handle for Characteristic descriptor
5581 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5584 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5585 * const guint8 *value, int length);
5587 * @brief Set characteristic descriptor value.
5589 * This function is a asynchronous call.
5591 * @return BLUETOOTH_ERROR_NONE - Success \n
5592 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5593 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5594 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5597 * @param[in] desc_handle - Handle for Characteristic descriptor
5598 * @param[in] value - New value to set for characteristic descriptor
5599 * @param[in] length - Length of the value to be set.
5604 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5605 const guint8 *value, int length);
5607 /* @fn int bluetooth_gatt_init(void)
5609 * @brief Initializes the gatt service.
5611 * This function is a synchronous call.
5612 * @return BLUETOOTH_ERROR_NONE - Success \n
5613 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5614 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5615 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5618 * @remark Adapter should be enabled
5619 * @see bluetooth_gatt_deinit()
5621 int bluetooth_gatt_init(void);
5623 /* @fn int bluetooth_gatt_init(void)
5625 * @brief DeInitializes the gatt service.
5627 * This function is a synchronous call.
5628 * @return BLUETOOTH_ERROR_NONE - Success \n
5629 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5630 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5631 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5634 * @remark Adapter should be enabled
5635 * @see bluetooth_gatt_init()
5637 int bluetooth_gatt_deinit(void);
5639 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5640 unsigned char **svc_path)
5642 * @brief Exports a new gatt service to the service interface.
5644 * This function is a synchronous call.
5646 * @return BLUETOOTH_ERROR_NONE - Success \n
5647 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5648 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5649 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5652 * @param[in] svc_uuid Gatt service uuid.
5653 * @param[out] svc_path service object path of the exported service.
5654 * @remark Adapter should be enabled
5655 * @see bluetooth_gatt_init()
5657 int bluetooth_gatt_add_service(const char *svc_uuid,
5660 /* @fn int bluetooth_gatt_add_new_characteristic(
5661 const char *svc_path, const char *char_uuid,
5662 bt_gatt_permission_t permissions,
5663 bt_gatt_characteristic_property_t properties,
5664 int flags_length, char **char_path);;
5666 * @brief Exports a new gatt characteristic to the characteristic interface.
5668 * This function is a synchronous call.
5669 * @return BLUETOOTH_ERROR_NONE - Success \n
5670 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5671 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5672 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5674 * @param[in] svc_path service object path of the exported service.
5675 * @param[in] char_uuid Gatt service uuid.
5676 * @param[in] properties GATT characteristic properties.
5677 * @param[out] char_path characteristic object path of the exported characteristic.
5679 * @remark Adapter should be enabled
5680 * @see bluetooth_gatt_add_service()
5682 int bluetooth_gatt_add_new_characteristic(
5683 const char *svc_path, const char *char_uuid,
5684 bt_gatt_permission_t permissions,
5685 bt_gatt_characteristic_property_t properties,
5688 /* @fn bluetooth_gatt_set_characteristic_value(
5689 const char *characteristic, const char *char_value,
5692 * @brief adds gatt charactertisic value to the given charactertistic path.
5694 * This function is a synchronous call.
5695 * @return BLUETOOTH_ERROR_NONE - Success \n
5696 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5697 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5698 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5700 * @param[in] char_value Value of the GATT characteristic to be added.
5701 * @param[in] value_length length of the chantacteristic value..
5702 * @param[out] characteristic characteristic object path..
5704 * @remark Adapter should be enabled
5705 * @see bluetooth_gatt_add_service()
5707 int bluetooth_gatt_set_characteristic_value(
5708 const char *characteristic, const char *char_value,
5711 /* @fn int bluetooth_gatt_add_descriptor(
5712 const char *char_path, const char *desc_uuid,
5713 bt_gatt_permission_t permissions,
5716 * @brief Exports a new gatt descriptor to the descriptor interface.
5718 * This function is a synchronous call.
5720 * @return BLUETOOTH_ERROR_NONE - Success \n
5721 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5722 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5723 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5726 * @param[in] desc_uuid Gatt descriptor uuid.
5727 * @param[in] desc_value GATT descriptor value.
5728 * @param[in] value_length Length of GATT descriptor value.
5729 * @param[in] permissions descriptor permissions.
5730 * @param[in] properties GATT descriptor properties.
5731 * @param[in] char_path characteristics object path of the exported character.
5733 * @remark Adapter should be enabled
5734 * @see bluetooth_gatt_add_service()
5735 * @see bluetooth_gatt_add_characteristics()
5737 int bluetooth_gatt_add_descriptor(
5738 const char *char_path, const char *desc_uuid,
5739 bt_gatt_permission_t permissions,
5742 /* @fn int bluetooth_gatt_set_descriptor_value(
5743 const char *desc_path, const char *desc_value,
5746 * @brief Adds value to the given descriptor handle.
5748 * This function is a synchronous call.
5750 * @return BLUETOOTH_ERROR_NONE - Success \n
5751 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5752 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5753 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5756 * @param[in] desc_value GATT descriptor value.
5757 * @param[in] value_length Length of GATT descriptor value.
5758 * @param[in] desc_path descriptor path to which the value needs to be added.
5760 * @remark Adapter should be enabled
5761 * @see bluetooth_gatt_add_service()
5762 * @see bluetooth_gatt_add_characteristics()
5764 int bluetooth_gatt_set_descriptor_value(
5765 const char *desc_path, const char *desc_value,
5768 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5770 * @brief Reads the Service registered on manager interface.
5772 * This function is a synchronous call.
5774 * @return BLUETOOTH_ERROR_NONE - Success \n
5775 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5776 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5777 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5780 * @param[in] svc_uuid Gatt Service uuid.
5782 * @remark Adapter should be enabled and service should be registered.
5783 * @see bluetooth_gatt_register_service()
5785 int bluetooth_gatt_get_service(const char *svc_uuid);
5787 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5789 * @brief Registers the given service path with the library.
5791 * This function is a synchronous call.
5793 * @return BLUETOOTH_ERROR_NONE - Success \n
5794 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5795 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5796 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5799 * @param[in] svc_path service object path of the exported service.
5801 * @remark Adapter should be enabled
5802 * @see bluetooth_gatt_add_service()
5803 * @see bluetooth_gatt_add_characteristics()
5804 * @see bluetooth_gatt_add_descriptor()
5805 * @see bluetooth_gatt_register_application()
5807 int bluetooth_gatt_register_service(const char *svc_path);
5809 /* @fn int bluetooth_gatt_register_application(void)
5811 * @brief Registers the application with the bluez gatt server.
5813 * This function is a synchronous call.
5815 * @return BLUETOOTH_ERROR_NONE - Success \n
5816 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5817 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5818 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5822 * @remark Adapter should be enabled
5823 * @see bluetooth_gatt_init()
5824 * @see bluetooth_gatt_add_service()
5825 * @see bluetooth_gatt_add_characteristics()
5826 * @see bluetooth_gatt_add_descriptor()
5827 * @see bluetooth_gatt_register_service()
5829 int bluetooth_gatt_register_application(void);
5831 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5833 * @brief Removes(unregister) service from the bluez gatt server db.
5835 * 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 * @param[in] svc_path service object path of the exported service.
5845 * @remark Adapter should be enabled
5846 * @see bluetooth_gatt_add_service()
5847 * @see bluetooth_gatt_add_characteristics()
5848 * @see bluetooth_gatt_add_descriptor()
5849 * @see bluetooth_gatt_register_service()
5851 int bluetooth_gatt_unregister_service(const char *svc_path);
5853 /* @fn int bluetooth_gatt_unregister_application(void)
5855 * @brief Removes(unregister) the application with the bluez gatt server,
5856 * and deletes all the service registered.
5858 * This function is a synchronous call.
5860 * @return BLUETOOTH_ERROR_NONE - Success \n
5861 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5862 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5863 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5867 * @remark Adapter should be enabled
5868 * @see bluetooth_gatt_init()
5869 * @see bluetooth_gatt_add_service()
5870 * @see bluetooth_gatt_add_characteristics()
5871 * @see bluetooth_gatt_add_descriptor()
5872 * @see bluetooth_gatt_register_service()
5873 * @see bluetooth_gatt_unregister_service()
5875 int bluetooth_gatt_unregister_application(void);
5877 /* @fn int bluetooth_gatt_send_response(int request_id,
5878 * int offset, char *value, int value_length)
5880 * @brief Updates the attribute value in local attribute list.
5882 * This function is a synchronous call.
5884 * @return BLUETOOTH_ERROR_NONE - Success \n
5885 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5886 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5887 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5890 * @param[in] request_id The identification of a read request
5891 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5892 * @param[in] resp_state The identification of response state
5893 * @param[in] offset The offset from where a value is read
5894 * @param[in] value The value to be sent. It will be sent from @a offset.
5895 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5896 * @param[in] value_length Value Length.
5898 * @remark Adapter should be enabled
5899 * @see bluetooth_gatt_add_service()
5900 * @see bluetooth_gatt_add_characteristics()
5901 * @see bluetooth_gatt_add_descriptor()
5902 * @see bluetooth_gatt_register_service()
5904 int bluetooth_gatt_send_response(int request_id, guint req_type,
5905 int resp_state, int offset, char *value, int value_length);
5907 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5909 * @brief Sets the notification property for a characteristic.
5911 * This function is a synchronous call.
5913 * @return BLUETOOTH_ERROR_NONE - Success \n
5914 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5915 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5916 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5919 * @param[in] char_path characteristic object path.
5920 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5922 * @remark Adapter should be enabled
5923 * @see bluetooth_gatt_update_characteristic()
5925 int bluetooth_gatt_server_set_notification(const char *char_path,
5926 bluetooth_device_address_t *unicast_address);
5928 /* @fn int bluetooth_gatt_delete_services(void)
5930 * @brief deletes (unregisters) all services from the gatt server database..
5932 * This function is a synchronous call.
5934 * @return BLUETOOTH_ERROR_NONE - Success \n
5935 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5936 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5937 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5941 * @remark Adapter should be enabled
5942 * @see bluetooth_gatt_add_service()
5943 * @see bluetooth_gatt_add_characteristics()
5944 * @see bluetooth_gatt_add_descriptor()
5945 * @see bluetooth_gatt_register_service()
5946 * @see bluetooth_gatt_unregister_service()
5948 int bluetooth_gatt_delete_services(void);
5950 /* @fn int bluetooth_gatt_update_characteristic(void)
5952 * @brief updates the given characteristic with a new value
5954 * This function is a synchronous call.
5956 * @return BLUETOOTH_ERROR_NONE - Success \n
5957 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5958 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5959 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5963 * @remark Adapter should be enabled
5964 * @see bluetooth_gatt_add_service()
5965 * @see bluetooth_gatt_add_characteristics()
5966 * @see bluetooth_gatt_add_descriptor()
5967 * @see bluetooth_gatt_register_service()
5968 * @see bluetooth_gatt_unregister_service()
5970 int bluetooth_gatt_update_characteristic(const char *char_path,
5971 const char* char_value, int value_length);
5974 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5976 * @brief Set advertising status.
5978 * This function is used to enable or disable LE advertising.
5979 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5981 * This function is a synchronous call.
5983 * @return BLUETOOTH_ERROR_NONE - Success \n
5984 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5985 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5988 * @param[in] enable - The status of advertising
5991 * @see bluetooth_set_advertising_data
5993 int bluetooth_set_advertising(int handle, gboolean enable);
5996 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5998 * @brief Set advertising status along with interval value.
6000 * This function is used to enable or disable LE advertising.
6001 * Interval_min and Interval_max is used to set the best advertising interval.
6002 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6004 * This function is a synchronous call.
6006 * @return BLUETOOTH_ERROR_NONE - Success \n
6007 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6008 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6011 * @param[in] enable - The status of advertising
6012 * @param[in] interval_min - Minimum interval of advertising (msec)
6013 * @param[in] interval_max - Maximum interval of advertising (msec)
6014 * @param[in] filter_policy - Advertising filter policy
6017 * @see bluetooth_set_advertising_data
6019 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6020 bluetooth_advertising_params_t *params);
6023 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6024 * @brief Get the advertising data
6026 * This function is used to get advertising data.
6027 * Before calling this API, the adapter should be enabled.
6029 * This function is a synchronous call.
6031 * @return BLUETOOTH_ERROR_NONE - Success \n
6032 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6033 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6034 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6036 * @param[out] value - Advertising data structure.
6037 * @param[out] length - The length of Advertising data.
6041 bluetooth_advertising_data_t *value = { {0} };
6044 ret = bluetooth_get_advertising_data(&value, &length);
6047 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6050 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6052 * @brief Set advertising data with value
6054 * This function is used to set advertising data and Maximum size of advertising data
6055 * is 28 byte (Except Flag)
6057 * This function is a synchronous call.
6059 * @return BLUETOOTH_ERROR_NONE - Success \n
6060 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6061 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6064 * @param[in] value - Advertising data structure.
6068 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6071 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6073 * @brief Check the privilege for advertising parameter setting
6075 * This function is a synchronous call.
6077 * @return BLUETOOTH_ERROR_NONE - Success \n
6078 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6084 int bluetooth_check_privilege_advertising_parameter(void);
6087 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6088 * @brief Get the LE scan response data
6090 * This function is used to get scan response data.
6091 * Before calling this API, the adapter should be enabled.
6093 * This function is a synchronous call.
6095 * @return BLUETOOTH_ERROR_NONE - Success \n
6096 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6097 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6098 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6100 * @param[out] value - Scan response data structure.
6101 * @param[out] length - The length of Scan response data.
6105 bluetooth_scan_resp_data_t *value = { {0} };
6108 ret = bluetooth_get_scan_response_data(&value, &length);
6111 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6114 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6116 * @brief Set scan response data with value
6118 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6120 * This function is a synchronous call.
6122 * @return BLUETOOTH_ERROR_NONE - Success \n
6123 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6124 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6127 * @param[in] value - LE Scan response data structure.
6131 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6134 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6136 * @brief Set scan interval and window
6138 * This function is used to set LE scan interval and window size
6140 * This function is a synchronous call.
6142 * @return BLUETOOTH_ERROR_NONE - Success \n
6143 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6144 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6147 * @param[in] interval - Interval of LE scan (msec)
6148 * @param[in] window - Window size of LE scan (msec)
6152 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6155 * @fn int bluetooth_is_advertising(void)
6156 * @brief Check for the advertising is in-progress or not.
6158 * This API is used to check the current status of the advertising procedure.
6159 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6162 * This function checks whether the advertising is started or not.
6164 * This function is a synchronous call.
6166 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6168 * @return BLUETOOTH_ERROR_NONE - Success \n
6169 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6172 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6176 gboolean is_advertising = 0;
6178 ret = bluetooth_is_advertising(&is_advertising);
6181 int bluetooth_is_advertising(gboolean *is_advertising);
6184 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6185 * @brief Add LE device to white list
6187 * This API is used to add LE device to white list
6188 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6192 * This function is a synchronous call.
6194 * @param[in] address The address of remote device
6196 * @return BLUETOOTH_ERROR_NONE - Success \n
6197 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6200 * @see bluetooth_set_custom_advertising
6202 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6205 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6206 * @brief Remove LE device from white list
6208 * This API is used to remove LE device from white list
6209 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6213 * This function is a synchronous call.
6215 * @param[in] address The address of remote device
6217 * @return BLUETOOTH_ERROR_NONE - Success \n
6218 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6221 * @see bluetooth_set_custom_advertising
6223 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6226 * @fn int bluetooth_clear_white_list(void)
6227 * @brief Clear white list
6229 * This API is used to clear white list
6230 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6234 * This function is a synchronous call.
6236 * @param[in] address The address of remote device
6238 * @return BLUETOOTH_ERROR_NONE - Success \n
6239 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6242 * @see bluetooth_set_custom_advertising
6244 int bluetooth_clear_white_list(void);
6247 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6248 * const bluetooth_le_connection_param_t *parameters)
6249 * @brief update connection paramter of LE connection.
6251 * This function is a synchronous call.
6253 * @return BLUETOOTH_ERROR_NONE - Success \n
6254 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6257 * @param[in] address - remote device address value.
6258 * @param[in] parameters - new connection parameters.
6261 * @see bluetooth_bond_device
6263 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6264 const bluetooth_le_connection_param_t *parameters);
6267 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6269 * @brief Enable/Disable LE Privacy feature.
6271 * This function is used to enable or disable LE Privacy feature.
6272 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6274 * This function is a synchronous call.
6276 * @return BLUETOOTH_ERROR_NONE - Success \n
6277 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6278 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6281 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6285 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6288 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6290 * @brief Enable/Disable LE static random address.
6292 * This function is used to enable or disable LE static random address.
6294 * This function is a synchronous call.
6296 * @return BLUETOOTH_ERROR_NONE - Success \n
6297 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6298 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6301 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6305 int bluetooth_set_le_static_random_address(gboolean enable);
6308 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6309 * bluetooth_le_connection_mode_t mode)
6310 * @brief update connection paramter of LE connection.
6312 * This function is a synchronous call.
6314 * @return BLUETOOTH_ERROR_NONE - Success \n
6315 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6316 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6319 * @param[in] address - remote device address value.
6320 * @param[in] mode - new connection mode.
6324 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6325 bluetooth_le_connection_mode_t mode);
6328 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6329 * @brief Request for new ATT MTU value.
6331 * This function is a asynchronous call.
6333 * @return BLUETOOTH_ERROR_NONE - Success \n
6334 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6335 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6338 * @param[in] address - remote device address value.
6339 * @param[in] mtu - MTU value to be set.
6343 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6346 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6347 * unsigned int *mtu)
6348 * @brief Gets the xisting MTU value set for a connection.
6350 * This function is a synchronous call.
6352 * @return BLUETOOTH_ERROR_NONE - Success \n
6353 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6354 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6357 * @param[in] address - remote device address value.
6358 * @param[out] mtu - MTU value set for the connection.
6362 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6366 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6367 * bluetooth_device_address_t *id_address)
6368 * @brief Gets the Identity address of remote device.
6370 * This function is a synchronous call.
6372 * @return BLUETOOTH_ERROR_NONE - Success \n
6373 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6374 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6377 * @param[in] device_rpa - remote Resolvable private address.
6378 * @param[out] id_address - remote Identity device address value.
6382 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6383 bluetooth_device_address_t *id_address);
6386 * @fn int bluetooth_le_read_maximum_data_length()
6387 * @brief reads the maximum LE data length supported in the controller.
6389 * This function is a synchronous call.
6391 * @return BLUETOOTH_ERROR_NONE - Success \n
6392 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6398 int bluetooth_le_read_maximum_data_length(
6399 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6401 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6402 * @brief writes the host suggested values for the controllers max transmitted no of payload
6403 * octects to be used for new connections.
6405 * This function is a synchronous call.
6407 * @return BLUETOOTH_ERROR_NONE - Success \n
6408 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6414 int bluetooth_le_write_host_suggested_default_data_length(
6415 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6417 int bluetooth_le_read_suggested_default_data_length(
6418 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6420 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6421 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6423 int bluetooth_pbap_init(void);
6424 int bluetooth_pbap_deinit(void);
6425 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6426 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6427 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6428 bt_pbap_folder_t *folder);
6429 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6430 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6431 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6432 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6433 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6434 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6435 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6436 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6439 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6441 * @brief Set manufacturer data with value
6443 * This function is used to set manufacturer data.
6445 * This function is a synchronous call.
6447 * @return BLUETOOTH_ERROR_NONE - Success \n
6448 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6449 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6452 * @param[in] value - Manufacturer data structure.
6456 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6458 int bluetooth_set_passkey_notification(gboolean enable);
6461 * @fn int bluetooth_dpm_is_mode_allowed(void);
6463 * @brief Checks Restriction for BT mode(BT allowed or not)
6465 * This function is a synchronous call.
6467 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6468 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6469 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6476 int bluetooth_dpm_is_mode_allowed(void);
6479 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6481 * @brief Sets Restriction for BT mode(BT allowed or not)
6483 * This function is a synchronous call.
6485 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6486 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6487 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6490 * @param[in] value - BT Allow value.
6491 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6492 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6493 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6494 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6498 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6501 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6503 * @brief Reads the Restriction for BT mode(BT allowed or not)
6505 * This function is a synchronous call.
6507 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6508 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6509 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6513 * @param[out] value - BT Allow value.
6514 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6515 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6516 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6517 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6521 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6524 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6526 * @brief Sets the Restriction for device.
6528 * This function is a synchronous call.
6530 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6531 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6532 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6535 * @param[in] value - State value.
6536 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6537 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6541 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6544 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6546 * @brief Reads the Restriction for device.
6548 * This function is a synchronous call.
6550 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6551 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6552 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6556 * @param[out] value - State value.
6557 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6558 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6562 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6565 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6567 * @brief Sets the Restriction for uuid.
6569 * This function is a synchronous call.
6571 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6572 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6573 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6576 * @param[in] value - State value.
6577 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6578 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6582 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6585 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6587 * @brief Reads the Restriction for uuid.
6589 * This function is a synchronous call.
6591 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6592 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6593 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6597 * @param[out] value - State value.
6598 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6599 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6603 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6606 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6608 * @brief Adds the device to blacklist.
6610 * This function is a synchronous call.
6612 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6613 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6614 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6617 * @param[in] device_address - Device address
6621 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6624 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6626 * @brief Adds the device to whitelist.
6628 * This function is a synchronous call.
6630 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6631 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6632 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6635 * @param[in] device_address - Device address
6639 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6642 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6644 * @brief Adds the Service UUIDS to blacklist.
6646 * This function is a synchronous call.
6648 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6649 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6650 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6653 * @param[in] service_uuids - profile or custom service uuids
6657 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6660 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6662 * @brief Adds the Service UUIDS to whitelist.
6664 * This function is a synchronous call.
6666 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6667 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6668 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6671 * @param[in] service_uuids - profile or custom service uuids
6675 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6678 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6680 * @brief Clears the devices from blacklist.
6682 * This function is a synchronous call.
6684 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6685 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6686 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6693 int bluetooth_dpm_clear_devices_from_blacklist(void);
6696 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6698 * @brief Clears the devices from whitelist.
6700 * This function is a synchronous call.
6702 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6703 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6704 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6711 int bluetooth_dpm_clear_devices_from_whitelist(void);
6714 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6716 * @brief Clears the uuids from blacklist.
6718 * This function is a synchronous call.
6720 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6721 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6722 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6729 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6732 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6734 * @brief Clears the uuids from whitelist.
6736 * This function is a synchronous call.
6738 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6739 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6740 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6747 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6750 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6752 * @brief reads the devices from blacklist.
6754 * This function is a synchronous call.
6756 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6757 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6758 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6761 * @param[out] device_list - list of devices
6765 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6768 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6770 * @brief reads the devices from whitelist.
6772 * This function is a synchronous call.
6774 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6775 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6776 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6779 * @param[out] device_list - list of devices
6783 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6786 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6788 * @brief reads the uuids from blacklist.
6790 * This function is a synchronous call.
6792 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6793 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6794 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6797 * @param[in] uuid_list - list of uuids
6801 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6804 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6806 * @brief reads the uuids from whitelist.
6808 * This function is a synchronous call.
6810 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6811 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6812 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6815 * @param[in] uuid_list - list of uuids
6819 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6822 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6824 * @brief Removes the device from whitelist.
6826 * This function is a synchronous call.
6828 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6829 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6830 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6833 * @param[in] device_address - Device address
6837 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6840 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6842 * @brief Removes the device from blacklist.
6844 * This function is a synchronous call.
6846 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6847 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6848 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6851 * @param[in] device_address - Device address
6855 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6858 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6860 * @brief Removes the Service UUIDS from whitelist.
6862 * This function is a synchronous call.
6864 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6865 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6866 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6869 * @param[in] service_uuids - profile or custom service uuids
6873 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6876 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6878 * @brief Removes the Service UUIDS from blacklist.
6880 * This function is a synchronous call.
6882 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6883 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6884 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6887 * @param[in] service_uuids - profile or custom service uuids
6891 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6894 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6896 * @brief Sets the Restriction for outgoing call.
6898 * This function is a synchronous call.
6900 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6901 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6902 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6905 * @param[in] value - State value.
6906 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6907 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6911 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6914 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6916 * @brief Reads the Restriction for outgoing call.
6918 * This function is a synchronous call.
6920 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6921 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6922 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6926 * @param[out] value - State value.
6927 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6928 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6932 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6935 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6937 * @brief Sets the Restriction for Pairing.
6939 * This function is a synchronous call.
6941 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6942 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6943 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6946 * @param[in] value - State value.
6947 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6948 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6952 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6955 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6957 * @brief Reads the Restriction for Pairing
6959 * This function is a synchronous call.
6961 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6962 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6963 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6967 * @param[out] value - State value.
6968 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6969 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6973 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6976 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6978 * @brief Sets the Restriction for using Profiles.
6980 * This function is a synchronous call.
6982 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6983 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6984 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6987 * @param[in]profile - Profile.
6988 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6989 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6990 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6991 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6992 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6993 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6994 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6995 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6996 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6997 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6998 * BLUETOOTH_DPM_PROFILE_NONE
6999 * @param[in] value - State value.
7000 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7001 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7005 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7008 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7010 * @brief Reads the Restriction for using Profiles.
7012 * This function is a synchronous call.
7014 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7015 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7016 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7019 * @param[in]profile - Profile.
7020 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7021 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7022 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7023 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7024 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7025 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7026 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7027 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7028 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7029 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7030 * BLUETOOTH_DPM_PROFILE_NONE
7031 * @param[out] value - State value.
7032 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7033 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7037 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7040 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7042 * @brief Sets the Restriction for Desktop Connectivity.
7044 * This function is a synchronous call.
7046 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7047 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7048 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7051 * @param[in] value - State value.
7052 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7053 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7057 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7060 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7062 * @brief Reads the Restriction for Desktop Connectivity.
7064 * This function is a synchronous call.
7066 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7067 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7068 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7072 * @param[out] value - State value.
7073 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7074 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7078 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7081 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7083 * @brief Sets the Restriction for Discoverable state.
7085 * This function is a synchronous call.
7087 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7088 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7089 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7092 * @param[in] value - State value.
7093 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7094 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7098 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7101 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7103 * @brief Reads the Restriction for Discoverable state.
7105 * This function is a synchronous call.
7107 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7108 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7109 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7113 * @param[out] value - State value.
7114 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7115 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7119 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7122 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7124 * @brief Sets the Restriction for linited discoverable state..
7126 * This function is a synchronous call.
7128 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7129 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7130 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7133 * @param[in] value - State value.
7134 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7135 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7139 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7142 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7144 * @brief Reads the Restriction for limited discoverable state.
7146 * This function is a synchronous call.
7148 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7149 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7150 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7154 * @param[out] value - State value.
7155 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7156 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7160 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7162 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7164 * @brief Sets the Restriction for Data trasnfer.
7166 * This function is a synchronous call.
7168 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7169 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7170 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7173 * @param[in] value - State value.
7174 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7175 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7179 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7183 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7185 * @brief Reads the Restriction for Data trasnfer.
7187 * This function is a synchronous call.
7189 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7190 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7191 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7195 * @param[out] value - State value.
7196 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7197 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7201 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7204 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7205 * bluetooth_pxp_poperty_t property, int value);
7207 * @brief Sets the Proximity alert level/properties for monitor role.
7209 * This function is a synchronous call.
7211 * @return BLUETOOTH_ERROR_NONE - Success \n
7212 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7213 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7214 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7217 * @param[in] device_address remote device address
7218 * @param[in] property proximity profile property
7219 * @param[in] value alert level/property value to be set
7224 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7225 bluetooth_pxp_poperty_t property, int value);
7228 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7229 * bluetooth_pxp_poperty_t property, int *value);
7231 * @brief Reads the Proximity alert level/properties for monitor role.
7233 * This function is a synchronous call.
7235 * @return BLUETOOTH_ERROR_NONE - Success \n
7236 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7237 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7238 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7241 * @param[in] device_address remote device address
7242 * @param[in] property proximity profile property
7243 * @param[out] value alert level/property value
7247 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7248 bluetooth_pxp_poperty_t property, int *value);
7251 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7252 * int *services_supported);
7254 * @brief Reads the Proximity Monitor profile supported properties/services.
7256 * This function is a synchronous call.
7258 * @return BLUETOOTH_ERROR_NONE - Success \n
7259 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7260 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7261 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7264 * @param[in] device_address remote device address
7265 * @param[out] services_supported proximity profile property/service
7269 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7270 int *services_supported);
7273 * @fn int bluetooth_proximity_reporter_register();
7275 * @brief Register all proximity related services in BlueZ.
7277 * This function is a synchronous call.
7279 * @return BLUETOOTH_ERROR_NONE - Success \n
7280 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7286 int bluetooth_proximity_reporter_register(void);
7289 * @fn int bluetooth_proximity_reporter_unregister();
7291 * @brief Unregister all proximity related services in BlueZ.
7293 * This function is a synchronous call.
7295 * @return BLUETOOTH_ERROR_NONE - Success \n
7296 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7302 int bluetooth_proximity_reporter_unregister(void);
7305 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7306 * bluetooth_pxp_poperty_t property, int *value);
7308 * @brief Reads the Proximity alert level/properties for reporter role.
7310 * This function is a synchronous call.
7312 * @return BLUETOOTH_ERROR_NONE - Success \n
7313 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7314 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7315 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7318 * @param[in] device_address remote device address
7319 * @param[in] property proximity profile property
7320 * @param[out] value alert level/property value
7324 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7325 bluetooth_pxp_poperty_t property, int *value);
7328 * @fn int bluetooth_tds_provider_register(void);
7330 * @brief Register Transport Discovery Provider role.
7332 * This function is a synchronous call.
7334 * @return BLUETOOTH_ERROR_NONE - Success \n
7335 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7336 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7337 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7345 int bluetooth_tds_provider_register(void);
7348 * @fn int bluetooth_tds_provider_unregister(void);
7350 * @brief Unregister Transport Discovery Provider role.
7352 * This function is a synchronous call.
7354 * @return BLUETOOTH_ERROR_NONE - Success \n
7355 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7356 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7357 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7365 int bluetooth_tds_provider_unregister(void);
7368 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7370 * @brief Create Transport Discovery Provider for a transport.
7372 * This function is a synchronous call.
7374 * @return BLUETOOTH_ERROR_NONE - Success \n
7375 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7376 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7377 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7380 * @param[in] Transport (BT, CUSTOM etc.)
7381 * @param[in] Unique handle for TDS provider.
7386 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7389 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7391 * @brief Remove previously created Transport Discovery Provider.
7393 * This function is a synchronous call.
7395 * @return BLUETOOTH_ERROR_NONE - Success \n
7396 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7399 * @param[in] Unique handle for previously created provider.
7404 int bluetooth_tds_provider_destroy(unsigned int handle);
7407 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7409 * @brief Set transport block for in advertisement and gatt db.
7411 * This function is a synchronous call.
7413 * @return BLUETOOTH_ERROR_NONE - Success \n
7414 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7415 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7416 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7419 * @param[in] Provider specific manufacturer data.
7420 * @param[in] Provider specific manufacturer data length.
7425 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7428 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7429 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7431 * @brief Set transport block for in advertisement and gatt db.
7433 * This function is a synchronous call.
7435 * @return BLUETOOTH_ERROR_NONE - Success \n
7436 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7437 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7438 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7441 * @param[in] Unique handle for TDS provider.
7442 * @param[in] Transport state (On/Off/Not Available).
7443 * @param[in] Transport specific data block.
7444 * @param[in] Transport specific data block length.
7449 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7450 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7453 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7454 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7456 * @brief Send response to TDS activation request from remoted device.
7458 * This function is a synchronous call.
7460 * @return BLUETOOTH_ERROR_NONE - Success \n
7461 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7462 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7463 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7466 * @param[in] Remote device BT address.
7467 * @param[in] Unique handle for TDS provider.
7468 * @param[in] Response for TDS activation request.
7469 * @param[in] Transport specific data block to be sent in activation response.
7470 * @param[in] Data block length.
7475 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7476 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7479 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7481 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7483 * This function is an asynchronous call.
7485 * @return BLUETOOTH_ERROR_NONE - Success \n
7486 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7487 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7488 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7489 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7492 * @param[in] device_address remote device address
7493 * @param[in] handle attribute handle
7495 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7496 * when TDS data is received from Remote provider
7498 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7499 const char *handle);
7502 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7504 * @brief Enables CCCD on Remote Provider.
7506 * This function is an asynchronous call.
7508 * @return BLUETOOTH_ERROR_NONE - Success \n
7509 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7510 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7511 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7512 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7515 * @param[in] device_address remote device address
7516 * @param[in] handle attribute handle
7518 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7519 * when Indication is enabled on Remote provider
7521 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7522 const char *handle);
7525 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7526 * unsigned char *buf, int length);
7527 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7529 * This function is an asynchronous call.
7531 * @return BLUETOOTH_ERROR_NONE - Success \n
7532 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7533 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7534 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7535 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7538 * @param[in] device_address remote device address
7539 * @param[in] handle attribute handle
7540 * @param[in] buf Control point activation param
7541 * @param[in] param length
7543 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7544 * is received from remote Provider
7546 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7547 unsigned char *buf, int length);
7550 * @fn int bluetooth_otp_server_init(const char *directory);
7552 * @brief Starts OTP server.
7554 * This function is a synchronous call.
7564 int bluetooth_otp_server_init(const char *directory);
7567 * @fn int bluetooth_otp_server_deinit();
7569 * @brief Stops OTP server.
7571 * This function is a synchronous call.
7581 int bluetooth_otp_server_deinit();
7583 int bluetooth_otp_enable_notification(const char *handle);
7585 int bluetooth_otp_read_characteristic_value(const char *handle);
7593 #endif /* __cplusplus */
7594 #endif /* _BLUETOOTH_API_H_*/