4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 * Girishashok Joshi <girish.joshi@samsung.com>
8 * Chanyeol Park <chanyeol.park@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 #ifndef _BLUETOOTH_API_H_
25 #define _BLUETOOTH_API_H_
33 #endif /* __cplusplus */
36 * @defgroup BLUETOOTHFW BluetoothFW
38 * A base library for bluetooth framework
40 * @addtogroup BLUETOOTHFW
44 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
45 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
46 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
47 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
48 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
49 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
50 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
52 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
53 a device can support */
55 #define BLUETOOTH_UUID_STRING_MAX 50
56 #define BLUETOOTH_PATH_STRING 50
58 #define BLUETOOTH_OOB_DATA_LENGTH 16
60 * This is Bluetooth Connected event role
62 #define RFCOMM_ROLE_SERVER 1
63 #define RFCOMM_ROLE_CLIENT 2
66 * This is RFCOMM default Channel Value
68 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
71 * This is maximum length for search value string for PBAP Phonebook Search
73 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
77 * This is Bluetooth error code
79 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
81 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
82 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
84 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
85 /**< Callback error */
86 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
87 /**< invalid paramerror */
88 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
89 /**< invalid data error */
90 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
91 /**< Memory allocation error */
92 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
93 /**< out of memory error */
94 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
96 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
97 /**< No resource error */
98 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
99 /**< internal error */
100 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
101 /**< Not supported error */
102 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
103 /**< Operation is failed because
104 of not enabled BT Adapter */
105 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
106 /**< Enabling is failed because of
107 already enabled BT Adapter */
108 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
109 /**< Operation is failed because of
110 other on going operation */
111 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
112 /**< access denied error */
113 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
114 /**< max client error */
115 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
116 /**< not found error */
117 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
118 /**< service search fail */
119 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
120 /**< pairing failed error */
121 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
122 /**< Not paired error */
123 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
124 /**< no service error */
125 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
126 /**< no connection error */
127 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
128 /**< alread connected error */
129 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
130 /**< connection busy error */
131 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
132 /**< connection error */
133 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
134 /**< max connection error*/
135 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
136 /**< Not in operation */
137 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
138 /**< Cancelled by user */
139 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
140 /**< Service record registration failed */
141 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
142 /**< Operation in progress */
143 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
144 /**< authentication failed error when paring*/
145 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
146 /**< Remote host is down */
147 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
148 /**< End of device list */
150 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
151 /**< Obex agent already exists */
152 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
153 /**< Obex agent does not exist */
155 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
156 /**< Already initialized */
158 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
159 /**< Permission deined */
161 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
162 /**< Nap already done */
164 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
165 /**< Not initialized */
168 * Device disconnect reason
171 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
172 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
173 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
174 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
175 } bluetooth_device_disconnect_reason_t;
178 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
181 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
182 } bluetooth_device_address_t;
185 * This is Bluetooth device address type
189 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
190 BLUETOOTH_DEVICE_RANDOM_ADDRESS
191 } bluetooth_device_address_type_t;
194 * This is Bluetooth version
197 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
198 } bluetooth_version_t;
201 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
204 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
205 } bluetooth_device_name_t;
208 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
211 int data_len; /**< manafacturer specific data length */
212 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
213 } bluetooth_manufacturer_data_t;
219 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
220 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
221 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
222 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
223 } bluetooth_adapter_state_t;
229 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
230 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
231 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
232 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
233 } bluetooth_adapter_le_state_t;
239 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
240 /*Changed the order to make it compatable with old method */
241 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
242 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
243 /**< Discoverable mode with time limit
244 After specific timeout, it is changed
245 to non discoverable mode */
246 } bluetooth_discoverable_mode_t;
249 * Network connect mode
252 BLUETOOTH_NETWORK_PANU_ROLE,
254 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
255 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
256 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
257 } bluetooth_network_role_t;
263 BLUETOOTH_RFCOMM_SERVICE = 0x01,
264 BLUETOOTH_A2DP_SERVICE = 0x02,
265 BLUETOOTH_HSP_SERVICE = 0x04,
266 BLUETOOTH_HID_SERVICE = 0x08,
267 BLUETOOTH_NAP_SERVICE = 0x10,
268 BLUETOOTH_HFG_SERVICE = 0x20,
269 BLUETOOTH_GATT_SERVICE = 0x40,
270 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
271 } bluetooth_service_type_t;
277 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, /* represents that connection
278 * type can both BR/EDR and LE */
279 BLUETOOTH_DEV_CONN_BREDR = 0x00,
280 BLUETOOTH_DEV_CONN_LE = 0x01,
281 } bluetooth_conn_type_t;
287 BLUETOOTH_CODEC_ID_CVSD = 0x01,
288 BLUETOOTH_CODEC_ID_MSBC = 0x02,
289 } bluetooth_codec_type_t;
295 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
296 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
297 } bluetooth_hf_audio_connected_type_t;
303 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
304 } bluetooth_advertising_data_t;
310 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
311 } bluetooth_scan_resp_data_t;
314 * Advertising filter policy
317 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
318 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
319 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
320 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
321 } bluetooth_advertising_filter_policy_t;
327 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
328 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
329 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
330 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
331 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
332 } bluetooth_advertising_type_t;
336 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
337 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
338 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
339 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
340 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
341 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
342 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
343 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0x80
344 }bt_gatt_characteristic_property_t;
347 * Advertising parameters
352 guint8 filter_policy;
354 } bluetooth_advertising_params_t;
360 int type; /**< passive 0, active 1 */
361 float interval; /**< LE scan interval */
362 float window; /**< LE scan window */
363 } bluetooth_le_scan_params_t;
369 guint16 interval_min;
370 guint16 interval_max;
373 } bluetooth_le_conn_update_t;
376 * Samsung XSAT Vendor dependent command
381 } bluetooth_vendor_dep_at_cmd_t;
384 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
385 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
386 /**< Base ID for GAP Event */
387 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
388 /**< Base ID for SDP events */
389 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
390 /**< Base ID for RFCOMM events */
391 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
392 /**< Base ID for NETWORK events */
393 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
394 /**< Base ID for HDP events */
395 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
396 /**< Base ID for OPC events */
397 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
398 /**< Base ID for Obex Server events */
399 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
400 /**< Base ID for GATT events */
402 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
403 /**< Base ID for Audio events */
404 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0020))
405 /**< Base ID for HID events */
406 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
407 /**< Base ID for Advertising events */
408 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
409 /**< Base ID for PBAP Client events */
410 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
411 /**< Base ID for AVRCP events */
414 * Bluetooth event type
417 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
419 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
420 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
421 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
422 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
423 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
424 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
425 /**< Bluetooth event Discoverable timeout requested*/
426 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
427 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
428 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
429 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
430 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
431 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
432 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
433 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
434 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
435 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
436 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
437 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
438 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
439 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
440 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
441 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
442 BLUETOOTH_EVENT_REMOTE_DEVICE_DISAPPEARED, /**< Bluetooth event remote device disappeared*/
443 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
445 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
446 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
447 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
449 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
450 /**< Bluetooth event serice search base id */
451 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
452 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
453 /**< RFCOMM data receive event */
454 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
455 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
457 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
459 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
460 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
462 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
464 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
465 /**< Bluetooth Network event */
466 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
467 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
468 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
469 /**< Network disconnected evnet in server */
471 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
472 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
474 BLUETOOTH_EVENT_HDP_CONNECTED
475 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
476 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
477 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
479 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
480 /* OPC Connected event */
481 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
482 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
483 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
484 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
486 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
487 /* Obex server authorize event*/
488 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
489 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
490 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
491 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
492 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
493 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
495 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
496 /**<Discovered GATT service characteristics event*/
497 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
498 /**<Remote GATT charateristic value changed event*/
499 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
500 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
501 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
502 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
503 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
504 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
505 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
506 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
507 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
509 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
510 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
511 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
512 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
513 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
514 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
515 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
516 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
517 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
518 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
519 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
520 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
521 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
522 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
523 BLUETOOTH_EVENT_HF_CONNECTED,
524 BLUETOOTH_EVENT_HF_DISCONNECTED,
525 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
526 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
527 BLUETOOTH_EVENT_HF_RING_INDICATOR,
528 BLUETOOTH_EVENT_HF_CALL_WAITING,
529 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
530 BLUETOOTH_EVENT_HF_CALL_STARTED,
531 BLUETOOTH_EVENT_HF_CALL_ENDED,
532 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
533 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
534 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
535 BLUETOOTH_EVENT_HF_CALL_STATUS,
536 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
537 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
538 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
539 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
541 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
542 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
544 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
545 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
546 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
547 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
548 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
549 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
550 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
551 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
553 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected/disconnectd event*/
554 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
555 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
556 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
557 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
558 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
560 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
561 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
562 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
563 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
564 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
565 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
566 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
567 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
568 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
569 } bluetooth_event_type_t;
572 * This bt_service_uuid_list_t enum indicates service uuid list .
573 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
577 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
578 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
579 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
580 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
581 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
582 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
583 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
584 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
585 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
586 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
587 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
588 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
590 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
591 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
592 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
593 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
594 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
595 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
596 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
597 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
598 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
599 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
600 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
601 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
602 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
603 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
605 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
606 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
607 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
608 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
609 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
610 /**<DIRECT PRINTING*/
611 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
612 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
613 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
614 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
615 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
616 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
617 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
618 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
619 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
620 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
621 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
622 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
623 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
624 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
625 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
626 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
627 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
628 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
629 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
630 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
631 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
632 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
633 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
634 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
635 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
636 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
637 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
638 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
639 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
640 } bluetooth_service_uuid_list_t;
643 * Service class part of class of device returned from device discovery
646 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
647 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
648 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
649 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
650 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
651 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
652 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
653 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
654 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
655 } bluetooth_device_service_class_t;
659 * Major device mask (For device discovery)
662 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
663 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
664 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
665 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
666 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
667 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
668 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
669 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
670 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
671 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
672 } bluetooth_device_major_mask_t;
676 * Major device class (part of Class of Device)
679 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
680 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
681 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
682 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
683 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
684 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
685 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
686 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
687 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
688 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
689 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
690 } bluetooth_device_major_class_t;
693 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
695 /* About Computer Major class */
696 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
698 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
699 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
700 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
701 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
702 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
704 /* About Phone Major class */
705 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
706 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
707 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
708 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
709 /**< voice gateway minor class */
710 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
712 /* About LAN/Network Access Point Major class */
713 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
714 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
715 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
716 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
717 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
718 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
719 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
720 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
722 /* About Audio/Video Major class */
723 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
724 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
726 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
727 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
728 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
729 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
730 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
731 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
732 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
733 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
734 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
735 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
736 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
737 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
738 /**< Video Display and Loud
739 Speaker minor class */
740 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
743 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
745 /* About Peripheral Major class */
746 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
747 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
748 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
749 /**< Combo Keyboard or pointing
752 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
753 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
754 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
755 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
756 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
757 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
758 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
759 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
760 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
762 /* About Imaging Major class */
763 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
764 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
765 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
766 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
768 /* About Wearable Major class */
769 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
770 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
771 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
772 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
773 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
775 /* About Toy Major class */
776 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
777 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
778 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
779 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
780 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
782 /* About Health Major class */
783 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
784 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
785 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
786 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
787 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
788 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
789 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
790 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
791 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
792 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
793 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
794 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
795 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
796 } bluetooth_device_minor_class_t;
799 * structure to hold the device information
802 bluetooth_device_major_class_t major_class; /**< major device class */
803 bluetooth_device_minor_class_t minor_class; /**< minor device class */
804 bluetooth_device_service_class_t service_class;
805 /**< service device class */
806 } bluetooth_device_class_t;
809 * Discovery Role types
812 DISCOVERY_ROLE_BREDR = 0x1,
814 DISCOVERY_ROLE_LE_BREDR
815 } bt_discovery_role_type_t;
818 * structure to hold the device information
821 bluetooth_device_address_t device_address; /**< device address */
822 bluetooth_device_name_t device_name; /**< device name */
823 bluetooth_device_class_t device_class; /**< device class */
824 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
825 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
827 int rssi; /**< received strength signal*/
828 gboolean paired; /**< paired flag */
829 gboolean connected; /**< connected flag */
830 gboolean trust; /**< connected flag */
831 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
832 } bluetooth_device_info_t;
835 * structure to hold the LE device information
838 int data_len; /**< manafacturer specific data length */
839 bluetooth_advertising_data_t data; /**< manafacturer specific data */
840 } bluetooth_le_advertising_data_t;
843 bluetooth_device_address_t device_address; /**< device address */
844 int addr_type; /**< address type*/
845 int rssi; /**< received strength signal*/
846 bluetooth_le_advertising_data_t adv_ind_data;
847 bluetooth_le_advertising_data_t scan_resp_data;
848 } bluetooth_le_device_info_t;
851 * structure to hold the paired device information
854 bluetooth_device_address_t device_address; /**< paired device address */
855 bluetooth_device_name_t device_name; /**< device name */
856 bluetooth_device_class_t device_class; /**< device class */
857 } bluetooth_paired_device_info_t;
860 * structure to hold the paired device information
863 bluetooth_device_address_t device_address;
864 /**< device address */
865 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
866 /**< network interface name */
867 } bluetooth_network_device_info_t;
870 * Stucture to hold discovery option
873 unsigned short max_response; /**< the number of maximum response */
874 unsigned short discovery_duration;
875 /**< duration of discovery (seconds) */
876 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
877 classOfDevice variable */
878 } bluetooth_discovery_option_t;
881 * Stucture to hold event information
884 int event; /**< event type */
885 int result; /**< Success or error value */
887 /**<parameter data pointer */
889 } bluetooth_event_param_t;
892 bluetooth_device_address_t device_addr;
893 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
894 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
895 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
900 bluetooth_device_address_t device_addr;
901 unsigned char addr_type;
903 } bt_connection_info_t;
906 * Stucture to rfcomm receive data
911 /**< the socket fd */
912 int buffer_size;/**< the length of the receive buffer */
914 /**< the receive data buffer */
915 } bluetooth_rfcomm_received_data_t;
918 * Stucture to rfcomm connection
923 /**< the socket fd */
924 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
925 bluetooth_device_address_t device_addr;
926 /**< device address */
927 char uuid[BLUETOOTH_UUID_STRING_MAX];
928 } bluetooth_rfcomm_connection_t;
931 * Stucture to rfcomm disconnection
935 /**< the socket fd */
936 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
937 bluetooth_device_address_t device_addr;
938 /**< device address */
939 char uuid[BLUETOOTH_UUID_STRING_MAX];
940 } bluetooth_rfcomm_disconnection_t;
944 /**< the socket fd */
945 bluetooth_device_address_t device_addr;
946 /**< device address */
947 } bluetooth_rfcomm_connection_request_t;
962 HDP_ROLE_SOURCE = 0x0,
968 * Stucture to HDP connected
971 const char *app_handle; /**< the application handle */
972 unsigned int channel_id; /**< the channel id */
973 bt_hdp_qos_type_t type; /**< the QOS type */
974 bluetooth_device_address_t device_address; /**< the remote address */
975 } bt_hdp_connected_t;
978 * Stucture to HDP disconnected
981 unsigned int channel_id; /**< the channel id */
982 bluetooth_device_address_t device_address; /**< the remote address */
983 } bt_hdp_disconnected_t;
986 * Stucture to HDP data indication
989 unsigned int channel_id; /**< the channel id */
990 const char *buffer; /**< the RX data buffer */
991 unsigned int size; /**< the RX data size */
995 * Stucture to OPP client transfer information
1001 }bt_opc_transfer_info_t;
1003 /* Obex Server transfer type */
1004 #define TRANSFER_PUT "PUT"
1005 #define TRANSFER_GET "GET"
1007 * Stucture to OPP/FTP Server authorize information
1012 } bt_obex_server_authorize_into_t;
1020 } bt_obex_server_type_t;
1023 * Stucture to OPP/FTP server transfer information
1031 unsigned long file_size;
1033 bt_obex_server_type_t server_type;
1034 } bt_obex_server_transfer_info_t;
1037 * Stucture to OOB data
1041 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1042 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1043 unsigned int hash_len;
1044 unsigned int randomizer_len;
1048 * Structure to GATT attribute handle data
1054 } bt_gatt_handle_info_t;
1057 * Structure to GATT Remote service data
1064 bt_gatt_handle_info_t handle_info;
1065 bt_gatt_handle_info_t char_handle;
1066 } bt_gatt_service_property_t;
1069 * Structure to GATT Remote characteristic data
1073 char *service_handle;
1074 bt_gatt_handle_info_t handle_info;
1075 } bt_gatt_discovered_char_t;
1078 * Structure to format of GATT Characteristic Value
1082 unsigned char format;
1083 unsigned char exponent;
1084 unsigned short unit;
1085 unsigned char name_space;
1086 unsigned short description;
1087 } bt_gatt_char_format_t;
1090 * Structure to GATT Characteristic property
1098 bt_gatt_char_format_t format;
1100 unsigned int val_len;
1101 unsigned int permission;
1102 char *representation;
1103 bt_gatt_handle_info_t char_desc_handle;
1104 } bt_gatt_char_property_t;
1107 * Structure to GATT Characteristic descriptor property
1114 unsigned int val_len;
1115 } bt_gatt_char_descriptor_property_t;
1118 * Structure to GATT Characteristic value
1125 } bt_gatt_char_value_t;
1129 * Structure to RSSI Signal Strength Alert
1140 * Structure to RSSI Signal Strength
1150 * Structure for RSSI Enabled or Disabled
1156 gboolean rssi_enabled;
1157 } bt_rssi_enabled_t;
1160 * Structure for RSSI Threshold
1165 int in_range_threshold;
1167 } bt_rssi_threshold_t;
1170 * Structure for PBAP Folder Parameters
1173 unsigned char addressbook;
1174 unsigned char folder_type;
1178 * Structure for PBAP Pull application Parameters
1181 unsigned char format;
1182 unsigned char order;
1183 unsigned short offset;
1184 unsigned short maxlist;
1185 long long unsigned fields;
1186 } bt_pbap_pull_parameters_t;
1189 * Structure for PBAP List application Parameters
1192 unsigned char order;
1193 unsigned short offset;
1194 unsigned short maxlist;
1195 } bt_pbap_list_parameters_t;
1198 * Structure for PBAP Pull vCard application Parameters
1201 unsigned char format;
1202 long long unsigned fields;
1204 } bt_pbap_pull_vcard_parameters_t;
1207 * Structure for PBAP Search application Parameters
1210 unsigned char order;
1211 unsigned short offset;
1212 unsigned short maxlist;
1213 unsigned char search_attribute;
1214 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1215 } bt_pbap_search_parameters_t;
1218 * Structure for PBAP Connection Status
1221 bluetooth_device_address_t btaddr;
1223 } bt_pbap_connected_t;
1226 * Structure for PBAP Phonebook Size
1229 bluetooth_device_address_t btaddr;
1231 } bt_pbap_phonebook_size_t;
1234 * Structure for PBAP Phonebook Pull
1237 bluetooth_device_address_t btaddr;
1240 } bt_pbap_phonebook_pull_t;
1243 * Structure for PBAP vCard List
1246 bluetooth_device_address_t btaddr;
1250 } bt_pbap_vcard_list_t;
1253 * Structure for PBAP vCard Pull
1256 bluetooth_device_address_t btaddr;
1259 } bt_pbap_vcard_pull_t;
1262 * Structure for PBAP Phonebook search List
1265 bluetooth_device_address_t btaddr;
1269 } bt_pbap_phonebook_search_list_t;
1272 * Stucture to HF Call status information
1276 char *number; /*Phone Number */
1277 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1278 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1279 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1280 int idx; /*Call index/ID */
1281 } bt_hf_call_status_info_t;
1286 } bt_hf_call_list_s;
1289 * Callback pointer type
1291 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1294 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1295 * @brief Set the callback function pointer for bluetooth event
1298 * This API will register the callback function, when any response and event are received from
1299 * bluetooth framework. @n
1300 * this registered callback function will be get called with appropriate event and data structures.
1301 * This function is a synchronous call. An application developer can call
1302 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1303 * type. This registered function will receive events of bluetooth_event_type_t type along with
1307 * @param[in] callback_ptr A pointer to the callback function
1308 * @param[in] user_data A pointer to user data
1309 * @return BLUETOOTH_ERROR_NONE - Success
1313 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1315 GMainLoop *main_loop = (GMainLoop*) user_data;
1319 // Code for each event
1321 g_main_loop_quit(main_loop);
1328 GMainLoop *main_loop = NULL;
1331 main_loop = g_main_loop_new(NULL, FALSE);
1332 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1333 if (ret >= BLUETOOTH_ERROR_NONE)
1335 // bluetooth_register_callback returned Success
1339 // bluetooth_register_callback returned failiure
1341 g_main_loop_run(main_loop);
1345 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1348 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1349 * @brief Set the callback function pointer for bluetooth le event
1352 * This API will register the callback function, when any response and event are received from
1353 * bluetooth framework. @n
1354 * this registered callback function will be get called with appropriate event and data structures.
1355 * This function is a synchronous call. An application developer can call
1356 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1357 * type. This registered function will receive events of bluetooth_event_type_t type along with
1361 * @param[in] callback_ptr A pointer to the callback function
1362 * @param[in] user_data A pointer to user data
1363 * @return BLUETOOTH_ERROR_NONE - Success
1367 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1370 * @fn int bluetooth_le_unregister_callback(void)
1371 * @brief Set the callback function pointer for bluetooth le event
1374 * This API will register the callback function, when any response and event are received from
1375 * bluetooth framework. @n
1376 * this registered callback function will be get called with appropriate event and data structures.
1377 * This function is a synchronous call. An application developer can call
1378 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1379 * type. This registered function will receive events of bluetooth_event_type_t type along with
1384 * @return BLUETOOTH_ERROR_NONE - Success
1388 int bluetooth_le_unregister_callback(void);
1391 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1392 * @brief Set the callback function pointer for bluetooth event
1395 * This API will register the callback function, when any response and event are received from
1396 * bluetooth framework. @n
1397 * this registered callback function will be get called with appropriate event and data structures.
1398 * This function is a synchronous call. An application developer can call
1399 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1400 * type. This registered function will receive events of bluetooth_event_type_t type along with
1405 * @return BLUETOOTH_ERROR_NONE - Success
1409 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1411 GMainLoop *main_loop = (GMainLoop*) user_data;
1415 // Code for each event
1417 g_main_loop_quit(main_loop);
1424 GMainLoop *main_loop = NULL;
1427 main_loop = g_main_loop_new(NULL, FALSE);
1428 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1429 if (ret >= BLUETOOTH_ERROR_NONE)
1431 // bluetooth_register_callback returned Success
1435 // bluetooth_register_callback returned failiure
1437 ret = bluetooth_deregister_callback(void);
1438 g_main_loop_run(main_loop);
1442 int bluetooth_unregister_callback(void);
1445 * @fn int bluetooth_enable_adapter(void)
1446 * @brief Enable the Bluetooth H/W
1449 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1450 * send request to bluetooth chip for activation.
1451 * This function is typically called at startup or when Bluetooth services are required. This
1452 * function must be called before calling any other API of Bluetooth operations.
1454 * Before performing any operations like Device discover, service search etc.., the adapter must be
1457 * This function is a asynchronous call.
1458 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1459 * through registered callback function with appropriate result code
1460 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1461 * BLUETOOTH_ERROR_NONE - Success \n
1463 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1464 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1466 * @return BLUETOOTH_ERROR_NONE - Success\n
1467 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1468 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1469 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1470 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1472 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1474 void bt_event_callback(int event, bluetooth_event_param_t *param)
1478 case BLUETOOTH_EVENT_ENABLED:
1479 if (param->result == BLUETOOTH_ERROR_NONE)
1481 // Successfully Enabled
1494 ret = bluetooth_enable_adapter();
1498 int bluetooth_enable_adapter(void);
1501 * @fn int bluetooth_disable_adapter(void)
1502 * @brief Disable the Bluetooth H/W
1505 * This function disables Bluetooth protocol stack and hardware. This function is called when
1506 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1508 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1509 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1510 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1512 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1515 * This function is a asynchronous call.
1516 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1517 * through registered callback function.
1520 * @return BLUETOOTH_ERROR_NONE - Success\n
1521 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1522 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1523 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1525 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1527 void bt_event_callback(int event, bluetooth_event_param_t *param)
1531 case BLUETOOTH_EVENT_DISABLED:
1532 if (param->result == BLUETOOTH_ERROR_NONE)
1534 // Successfully disabled
1547 ret = bluetooth_disable_adapter();
1550 int bluetooth_disable_adapter(void);
1551 int bluetooth_recover_adapter(void);
1552 int bluetooth_check_adapter_le(void);
1553 int bluetooth_enable_adapter_le(void);
1555 int bluetooth_disable_adapter_le(void);
1558 * @fn int bluetooth_reset_adapter(void)
1559 * @brief Reset the Bluetooth H/W and values
1562 * This function resets Bluetooth protocol stack and hardware. This function is called when
1563 * an user want to initialize Bluetooth environment.
1565 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1568 * This function is a synchronous call.
1570 * @return BLUETOOTH_ERROR_NONE - Success\n
1571 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1573 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1578 ret = bluetooth_reset_adapter();
1581 int bluetooth_reset_adapter(void);
1584 * @fn int bluetooth_is_supported(void)
1585 * @brief Check if the bluetooth is supported or not by the current target
1587 * This API checks whether the bluetooth is supported or not.
1588 * This API only run by root permission.
1590 * This function is a synchronous call.
1592 * @return 0 - if bluetooth is not supported\n
1593 * 1 - if bluetooth is supported\n
1594 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
1599 ret = bluetooth_is_supported();
1602 int bluetooth_is_supported(void);
1606 * @fn int bluetooth_check_adapter(void)
1607 * @brief Check the current status of the Bluetooth adapter
1610 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
1611 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
1612 * bluetooth adapter.
1613 * This API get the adapter internal data structure and check current adapter status.
1615 * This function is a synchronous call.
1618 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
1619 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
1621 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
1625 ret = bluetooth_check_adapter();
1628 int bluetooth_check_adapter(void);
1631 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
1632 * @brief Get the local adapter bluetooth address
1635 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
1636 * the adapter should be enabled.
1637 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
1638 * contain Bluetooth address.
1639 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
1640 * friendly name for each device.
1641 * There is no event callback for this API.
1643 * This function is a synchronous call.
1646 * @return BLUETOOTH_ERROR_NONE - Succeess \n
1647 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
1648 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
1649 * @param[out] local_address a device address of local bluetooth adapter
1654 bluetooth_device_address_t local_address={0,};
1657 ret = bluetooth_get_local_address(&local_address);
1660 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
1663 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
1664 * @brief Get the hci version
1667 * This function is used to get the bluetooth hci version
1668 * Before calling this API make sure that the adapter is enabled.
1670 * This function is a synchronous call.
1673 * @return BLUETOOTH_ERROR_NONE - Success \n
1674 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1675 * @param[out] timeout remain visibility timeout value
1678 bluetooth_version_t *version;
1680 ret = bluetooth_get_local_version (&version);
1683 int bluetooth_get_local_version(bluetooth_version_t *version);
1686 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
1687 * @brief Get the local device name
1690 * This function is used, get the local device name. Since its difficult to remember the Adapter
1691 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
1692 * friendly name is retrived by the remote device and displaying.
1693 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
1695 * This function is a synchronous call.
1698 * @return BLUETOOTH_ERROR_NONE - Success \n
1699 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
1700 * @param[out] local_name a local device name
1704 bluetooth_device_name_t local_name={0,}
1706 ret = bluetooth_get_local_name (&local_name);
1709 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
1712 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
1713 * @brief Set the local device name
1716 * This function is used to set the local device name. This is a human friendly name whose
1717 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
1719 * This function is a synchronous call.
1721 * @param[in] local_name bluetooth device name to set local device
1723 * @return BLUETOOTH_ERROR_NONE - Success \n
1724 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1725 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1726 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
1727 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
1728 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1733 bluetooth_device_name_t local_name={0,}
1735 ret = bluetooth_set_local_name (&local_name);
1738 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
1742 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
1743 * @brief Check if the uuid is used or not
1745 * This function is used to check if the uuid is used or not.
1747 * This function is a synchronous call.
1749 * @param[in] service_uuid service uuid (UUID 128 bit as string)
1750 * @param[out] used if the uuid is used or not
1752 * @return BLUETOOTH_ERROR_NONE - Success \n
1753 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1754 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1755 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1760 gboolean used = FALSE;
1761 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
1762 ret = bluetooth_is_service_used(uuid, &used);
1765 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
1768 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
1769 * @brief Check if the device is connected to the specific service
1771 * This function is used to check if if the device is connected to the specific service.
1773 * This function is a synchronous call.
1775 * @param[in] local_address a device address of remote bluetooth device
1776 * @param[in] type the service type
1777 * @param[out] is_connected if the device is connected or not
1779 * @return BLUETOOTH_ERROR_NONE - Success \n
1780 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1781 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1782 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1787 gboolean is_connected = FALSE;
1788 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
1789 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
1792 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
1793 bluetooth_service_type_t type,
1794 gboolean *is_connected);
1797 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
1798 * @brief Get the visibility mode
1801 * This function is used to get the discoverable mode (Visibility option). Depending upon the
1802 * visibity mode, the property of the device is determined whether it can be discoverable, non
1803 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
1805 * This function is a synchronous call.
1808 * @return BLUETOOTH_ERROR_NONE - Success \n
1809 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1810 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
1811 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1812 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1813 * @param[out] discoverable_mode current bluetooth discoverable mode
1815 * @see bluetooth_set_discoverable_mode
1817 bluetooth_discoverable_mode_t discoverable_mode_ptr;
1819 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
1822 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
1825 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
1827 * @brief Set the visibility mode
1830 * This function is used to set the discoverable mode (Visibility option).
1832 * Many times user may want to keep his device discoverable so that when peer device is performing
1833 * device search, he/she can find user's device. Application programmer can keep the mode as
1834 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
1835 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
1836 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
1837 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
1839 * This function is a synchronous call.
1841 * @return BLUETOOTH_ERROR_NONE - Success \n
1842 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
1844 * @param[in] discoverable_mode the bluetooth discoverable mode to set
1845 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
1847 * @see bluetooth_get_discoverable_mode
1851 bluetooth_discoverable_mode_t mode;
1853 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
1854 ret = bluetooth_set_discoverable_mode (mode, 180);
1858 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
1863 * @fn int bluetooth_get_timeout_value(int *timeout)
1864 * @brief Get the visibility timeout value
1867 * This function is used to get the visibility timeout
1868 * Before calling this API make sure that the adapter is enabled.
1870 * This function is a synchronous call.
1873 * @return BLUETOOTH_ERROR_NONE - Success \n
1874 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1875 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
1876 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1877 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1878 * @param[out] timeout remain visibility timeout value
1880 * @see bluetooth_set_discoverable_mode
1884 ret = bluetooth_get_timeout_value (&timeout);
1887 int bluetooth_get_timeout_value(int *timeout);
1891 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
1892 * unsigned int classOfDeviceMask)
1893 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
1895 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
1896 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
1897 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
1898 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
1899 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
1900 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
1901 * You will receive device address, device name, device class, rssi (received signal strength indicator).
1902 * please see bluetooth_device_info_t for more details.
1905 * This API provides searching options like max responses, discovery duration in seconds and class
1906 * of device mask to filter device search. some times there may be too many bluetooth devices in
1907 * vicinity of your device.in such scenario, application can request to reduce number of responces
1908 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
1909 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
1910 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
1911 * application defined time. please note that discovery_duration should be mentioned in seconds.
1912 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
1915 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
1916 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
1917 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
1919 * This function is a asynchronous call.
1920 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
1921 * through registered callback function.
1923 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
1924 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
1926 * The completion or cancellation of the discovery is indicated by an
1927 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
1929 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
1932 * @return BLUETOOTH_ERROR_NONE - Success \n
1933 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
1934 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
1935 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
1936 agent is not running \n
1938 * @param[in] max_response define the maximum response of the number of founded devices
1940 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
1941 * @param[in] classOfDeviceMask define classes of the device mask which user wants
1942 (refer to class of device)
1944 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
1947 void bt_event_callback(int event, bluetooth_event_param_t *param)
1951 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
1953 bluetooth_device_info_t *device_info = NULL;
1954 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
1956 device_info = (bluetooth_device_info_t *)param->param_data;
1957 memcpy(&searched_device, &device_info->device_address,
1958 sizeof(bluetooth_device_address_t));
1959 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
1960 device_info->device_address.addr[0],
1961 device_info->device_address.addr[1],
1962 device_info->device_address.addr[2],
1963 device_info->device_address.addr[3],
1964 device_info->device_address.addr[4],
1965 device_info->device_address.addr[5]);
1968 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
1970 bluetooth_device_info_t *device_info = NULL;
1971 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
1973 device_info = (bluetooth_device_info_t *)param->param_data;
1974 memcpy(&searched_device, &device_info->device_address,
1975 sizeof(bluetooth_device_address_t));
1976 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
1977 device_info->device_name.name,
1978 device_info->device_address.addr[0],
1979 device_info->device_address.addr[1],
1980 device_info->device_address.addr[2],
1981 device_info->device_address.addr[3],
1982 device_info->device_address.addr[4],
1983 device_info->device_address.addr[5]);
1987 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
1988 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
1993 unsigned short max_response;
1994 unsigned short discovery_duration;
1995 unsigned classOfDeviceMask;
1999 discovery_duration =0;
2000 classOfDeviceMask =0;
2002 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2007 int bluetooth_start_discovery(unsigned short max_response,
2008 unsigned short discovery_duration,
2009 unsigned int classOfDeviceMask);
2012 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2013 * unsigned short max_response,
2014 * unsigned short discovery_duration,
2015 * unsigned int classOfDeviceMask)
2016 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2018 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2019 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2020 * Please see bluetooth_start_discovery() for other parameters description.
2022 * This function is a asynchronous call.
2023 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2024 * through registered callback function.
2026 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2027 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2029 * The completion or cancellation of the discovery is indicated by an
2030 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2032 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2035 * @return BLUETOOTH_ERROR_NONE - Success \n
2036 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2037 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2038 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2039 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2040 agent is not running \n
2042 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2043 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2044 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2045 * @param[in] max_response define the maximum response of the number of founded devices
2047 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2048 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2049 (refer to class of device)
2051 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2054 unsigned short type;
2055 unsigned short max_response;
2056 unsigned short discovery_duration;
2057 unsigned classOfDeviceMask;
2062 discovery_duration =0;
2063 classOfDeviceMask =0;
2065 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2070 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2071 unsigned short max_response,
2072 unsigned short discovery_duration,
2073 unsigned int classOfDeviceMask);
2076 * @fn int bluetooth_cancel_discovery (void)
2077 * @brief Cancel the on-going device discovery operation
2080 * This function stops the on-going device discovery operation. This API has to be called after the
2081 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2082 * the bluetooth_start_discovery API
2084 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2085 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2086 * cancel the discover request once the user received the device to which he wish to connect.
2088 * This function is a asynchronous call.
2089 * If the call is success to cancel discovey then the application will receive
2090 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2091 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2092 * BLUETOOTH_ERROR_NONE
2095 * @return BLUETOOTH_ERROR_NONE - Success \n
2096 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2097 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2098 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2099 other application \n
2100 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2102 * @see bluetooth_start_discovery
2104 void bt_event_callback(int event, bluetooth_event_param_t *param)
2108 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2109 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2118 ret = bluetooth_cancel_discovery();
2121 int bluetooth_cancel_discovery(void);
2124 * @fn int bluetooth_start_le_discovery(void)
2125 * @brief Start the generic device discovery which finds the LE devices.
2127 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2128 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2129 * It try to find LE devices. Bluetooth device address and name are
2130 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2131 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2132 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2133 * please see bluetooth_device_info_t for more details.
2135 * This function is a asynchronous call.
2136 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2137 * through registered callback function.
2139 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2142 * The completion or cancellation of the discovery is indicated by an
2143 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2145 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2148 * @return BLUETOOTH_ERROR_NONE - Success \n
2149 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2150 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2151 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2152 agent is not running \n
2155 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2158 void bt_event_callback(int event, bluetooth_event_param_t *param)
2162 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2164 bluetooth_device_info_t *device_info = NULL;
2165 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2167 device_info = (bluetooth_device_info_t *)param->param_data;
2168 memcpy(&searched_device, &device_info->device_address,
2169 sizeof(bluetooth_device_address_t));
2170 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2171 device_info->device_address.addr[0],
2172 device_info->device_address.addr[1],
2173 device_info->device_address.addr[2],
2174 device_info->device_address.addr[3],
2175 device_info->device_address.addr[4],
2176 device_info->device_address.addr[5]);
2180 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2181 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2187 ret = bluetooth_start_discovery();
2192 int bluetooth_start_le_discovery(void);
2195 * @fn int bluetooth_stop_le_discovery (void)
2196 * @brief Cancel the on-going device LE discovery operation
2199 * This function stops the on-going device discovery operation. This API has to be called after the
2200 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2201 * the bluetooth_start_le_discovery API
2204 * This function is a asynchronous call.
2205 * If the call is success to cancel discovey then the application will receive
2206 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2207 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2208 * BLUETOOTH_ERROR_NONE
2211 * @return BLUETOOTH_ERROR_NONE - Success \n
2212 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2213 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2214 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2215 other application \n
2216 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2218 * @see bluetooth_start_discovery
2220 void bt_event_callback(int event, bluetooth_event_param_t *param)
2224 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2225 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2234 ret = bluetooth_stop_le_discovery();
2237 int bluetooth_stop_le_discovery(void);
2240 * @fn int bluetooth_is_discovering(void)
2241 * @brief Check for the device discovery is in-progress or not.
2243 * This API is used to check the current status of the Discovery operation.If discovery is in\
2244 * progress normally other operations are not allowed.
2245 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2246 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2247 * event before performing other operations. This API is used to get for the current discovery
2248 * operation status and using bluetooth_cancel_discovery()
2249 * we can cancell the ongoing discovery process.
2250 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2253 * This function checks whether the device discovery is started or not.
2255 * This function is a synchronous call.
2258 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2259 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2260 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2263 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2267 ret = bluetooth_is_discovering ();
2270 int bluetooth_is_discovering(void);
2273 * @fn int bluetooth_is_le_discovering(void)
2274 * @brief Check for the device LE discovery is in-progress or not.
2276 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2277 * progress normally other operations are not allowed.
2278 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2279 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2280 * event before performing other operations. This API is used to get for the current discovery
2281 * operation status and using bluetooth_stop_le_discovery()
2282 * we can cancell the ongoing LE discovery process.
2283 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2286 * This function checks whether the device LE discovery is started or not.
2288 * This function is a synchronous call.
2291 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2292 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2293 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2296 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2300 ret = bluetooth_is_le_discovering ();
2303 int bluetooth_is_le_discovering(void);
2306 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2307 int link_type, bt_rssi_threshold_t rssi_threshold)
2308 * @brief Enable RSSI monitoring
2310 * This function enables RSSI monitoring and sets threshold for a connection
2312 * @return BLUETOOTH_ERROR_NONE - Success \n
2315 * @see bluetooth_get_rssi_strength
2317 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2318 int link_type, bt_rssi_threshold_t *rssi_threshold);
2321 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2322 * @brief Gets Raw RSSI signal Strength
2324 * This function gives the Raw RSSI signal strength for a connection.
2326 * @return BLUETOOTH_ERROR_NONE - Success \n
2329 * @see bluetooth_enable_rssi
2331 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2333 int bluetooth_set_connectable(gboolean is_connectable);
2335 int bluetooth_is_connectable(gboolean *is_connectable);
2338 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2339 * @brief Initiate a bonding process
2342 * This function initiates a bonding procedure with a peer device. The bonding procedure
2343 * enables authentication and optionally encryption on the Bluetooth link.
2345 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2346 * inititate the bonding request to the devices already in the paired list.
2348 * Usually we call this API after the device discovery.
2349 * This function is a asynchronous call.
2351 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2352 * mentioed result code
2353 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2354 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2355 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2356 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2357 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2359 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2360 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2363 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2366 * @return BLUETOOTH_ERROR_NONE - Success \n
2367 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2368 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2369 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2370 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2372 * @param[in] device_address This indicates an address of the device with which the pairing
2373 * should be initiated
2375 * @see bluetooth_cancel_bonding
2377 void bt_event_callback(int event, bluetooth_event_param_t *param)
2381 case BLUETOOTH_EVENT_BONDING_FINISHED:
2383 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2384 if (param->result >= BLUETOOTH_ERROR_NONE)
2386 bluetooth_device_info_t *device_info = NULL;
2387 device_info = (bluetooth_device_info_t *)param->param_data;
2388 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
2389 mjr[%#x] min[%#x] srv[%#x]",
2390 device_info->device_name.name,
2391 device_info->device_address.addr[0],
2392 device_info->device_address.addr[1],
2393 device_info->device_address.addr[2],
2394 device_info->device_address.addr[3],
2395 device_info->device_address.addr[4],
2396 device_info->device_address.addr[5],
2397 device_info->device_class.major_class,
2398 device_info->device_class.minor_class,
2399 device_info->device_class.service_class);
2413 bluetooth_device_address_t device_address={{0}};
2415 ret = bluetooth_bond_device(&device_address);
2419 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
2422 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2423 * bluetooth_conn_type_t conn_type)
2424 * @brief Initiate a bonding process
2427 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
2428 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
2430 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2431 * inititate the bonding request to the devices already in the paired list.
2433 * Usually we call this API after the device discovery.
2434 * This function is a asynchronous call.
2436 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2437 * mentioed result code
2438 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2439 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2440 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2441 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2442 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2444 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2445 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2448 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2451 * @return BLUETOOTH_ERROR_NONE - Success \n
2452 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2453 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2454 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2455 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2457 * @param[in] device_address This indicates an address of the device with which pairing
2458 * should be initiated
2459 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
2462 * @see bluetooth_cancel_bonding
2464 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2465 bluetooth_conn_type_t conn_type);
2468 * @fn int bluetooth_cancel_bonding(void)
2469 * @brief Cancel the on-going bonding process
2471 * This API is called to cancel the on-going bonding procedure. It should be called before the
2472 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
2473 * This API is useful when the remote device is not responding to the bond request or we wish to
2474 * cancel the bonding request. In this case we need not wait for the timeout to happen.
2476 * This function is a synchronous call.
2478 * @return BLUETOOTH_ERROR_NONE - Success \n
2479 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
2480 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2483 * @see bluetooth_bond_device
2489 ret = bluetooth_cancel_bonding();
2492 int bluetooth_cancel_bonding(void);
2495 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
2496 * @brief Remove bonding
2499 * To communicate with remote device over bluetooth link, user should bond with peer device.
2500 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
2501 * API is used to remove peer device from the list. Please note that after removing the device
2502 * from bonded device list, you cannot communication with peer device until bonding happens again.
2504 * User can call this function by passing bluetooth device address of any bonded device. Please note
2505 * that after successful return of this function, any bluetooth application running on your device
2506 * will not be able to communicate with unbonded device until bond operation happens again using
2507 * bluetooth_bond_device()
2510 * This function is a asynchronous call. The request to remove the specified device from the bonded
2511 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
2512 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
2513 * in case if there is a problem in locating given bluetooth device address in bonded devices list
2517 * @return BLUETOOTH_ERROR_NONE - Success \n
2518 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
2519 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2520 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2521 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2522 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2523 * agent is not running \n
2524 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
2527 * @param[in] device_address This indicates an address of the device to remove bonding
2531 * @see bluetooth_bond_device, bluetooth_cancel_bonding
2534 void bt_event_callback(int event, bluetooth_event_param_t *param)
2537 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
2538 bluetooth_device_address_t *dev_addr = NULL;
2540 if (param->result == BLUETOOTH_ERROR_NONE) {
2541 dev_addr = (bluetooth_device_address_t *)param->param_data;
2543 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2544 dev_addr->addr[0], dev_addr->addr[1]
2545 dev_addr->addr[2], dev_addr->addr[3]
2546 dev_addr->addr[4], dev_addr->addr[5]
2557 bluetooth_device_address_t *device_address;
2559 // copy valid device address in device_address
2561 ret = bluetooth_unbond_device(device_address);
2564 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
2567 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
2568 * @brief Get bonded(paired) device list
2571 * This API gets all bonded device list.
2572 * The devices in the bonded device list further can be used to perform the authorization by calling
2573 * bluetooth_authorize_device API.
2575 * This function is a synchronous call.
2576 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2577 * there is no valid information in the dev_list.
2578 * The len field in the dev_list represents the number of bonded devices. The data structure for
2579 * bonded device information is bluetooth_device_info_t.
2582 * @return BLUETOOTH_ERROR_NONE - Success \n
2583 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2585 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2587 void bt_get_bonded_devices(void)
2591 GPtrArray *devinfo = NULL;
2592 bluetooth_device_info_t *ptr;
2594 // allocate the g_pointer_array
2595 devinfo = g_ptr_array_new();
2597 ret = bluetooth_get_bonded_device_list(&devinfo);
2598 if (ret != BLUETOOTH_ERROR_NONE)
2600 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
2604 printf("g pointer arrary count : [%d]", devinfo->len);
2605 for (i=0; i<devinfo->len; i++)
2607 ptr = g_ptr_array_index(devinfo, i);
2610 printf("Name [%s]\n", ptr->device_name.name);
2611 printf("Major Class [%d]\n", ptr->device_class.major_class);
2612 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
2613 printf("Service Class [%d]\n", ptr->device_class.service_class);
2614 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2615 ptr->device_address.addr[0],
2616 ptr->device_address.addr[1], ptr->device_address.addr[2],
2617 ptr->device_address.addr[3],
2618 ptr->device_address.addr[4], ptr->device_address.addr[5]);
2625 // free g_pointer_array
2626 g_ptr_array_free(devinfo, TRUE);
2631 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
2634 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2635 * bluetooth_device_info_t *dev_info)
2636 * @brief Get a bonded(paired) device
2639 * This API gets a bonded device.
2641 * This function is a synchronous call.
2642 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2643 * there is no valid information in the dev_info.
2644 * The data structure for bonded device information is bluetooth_device_info_t.
2647 * @return BLUETOOTH_ERROR_NONE - Success \n
2648 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2650 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2652 void bt_get_bonded_device(void)
2656 bluetooth_device_info_t devinfo = {0};
2657 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
2659 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
2660 if (ret != BLUETOOTH_ERROR_NONE)
2662 printf("bluetooth_get_bonded_device failed with [%d]",ret);
2666 printf("Name [%s]\n", devinfo.device_name.name);
2667 printf("Major Class [%d]\n", devinfo.device_class.major_class);
2668 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
2669 printf("Service Class [%d]\n", devinfo.device_class.service_class);
2670 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
2671 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
2672 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
2673 devinfo.device_address.addr[5]);
2682 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2683 bluetooth_device_info_t *dev_info);
2686 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
2687 * @brief set alias for bonded device
2690 * This function set alias for bonded device.
2692 * This function is a synchronous call.
2695 * @return BLUETOOTH_ERROR_NONE - Success \n
2696 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2697 * @param[in] device_address This indicates an address of the remote device
2698 * @param[in] alias This indicates an alias to set
2703 ret = bluetooth_set_alias(&remote_address);
2706 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
2710 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
2711 * @brief Get remote deivice
2714 * This function gets specific remote device.
2716 * This function is a asynchronous call.
2717 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
2720 * @return BLUETOOTH_ERROR_NONE - Success \n
2721 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
2722 * @param[in] device_address This indicates an address of the remote device
2727 ret = bluetooth_get_remote_device(&remote_address);
2730 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
2733 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
2734 * gboolean authorized)
2735 * @brief Authorize/Unauthorize a bonded device
2738 * This function authorizes/unauthorize a bonded device. It decides the device to connect
2739 * with/without user confirmation.
2741 * If we select a paired device and make it authorized by calling this API with the authorized
2742 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
2743 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
2744 * then it will ask for the user conformation before the connection.
2746 * This API supposed to be called on the paired devices. Which means we have to use this API only
2747 * after successful pairing.
2749 * This function is a asynchronous call.
2750 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
2752 * @return BLUETOOTH_ERROR_NONE - Success \n
2753 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
2754 * @param[in] device_address This indicates an address of the device to authorize \n
2755 * @param[in] authorized TRUE : authorize FALSE: unauthorize
2757 * @see bluetooth_get_bonded_device_list
2759 void bt_event_callback(int event, bluetooth_event_param_t *param)
2763 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
2765 if (param->result == BLUETOOTH_ERROR_NONE)
2769 //device authorization failed failure
2777 bluetooth_device_address_t device_address={{0}};
2778 gboolean authorized;
2782 ret = bluetooth_authorize_device(&device_address,authorized);
2785 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
2786 gboolean authorized);
2789 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
2790 * @brief Get all services supported by remote device
2793 * This API call initiates the search for the services supported by the specified device. Normally
2794 * the service search will take a couple of seconds to get it completed. Before calling this API
2795 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
2796 * perform the service search. We can get the device address by doing a device discovery operation.
2799 * This function is a asynchronous call.
2800 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
2802 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
2803 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
2804 * event is generated with appropriate result code.
2806 * @return BLUETOOTH_ERROR_NONE - Success \n
2807 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
2808 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2809 * @param[in] device_address This indicates an address of the device
2810 * whose services need to be found
2812 * @see bluetooth_cancel_service_search
2814 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
2817 * @fn int bluetooth_cancel_service_search(void)
2818 * @brief Cancel the ongoing service search operation
2821 * This function cancel the ongoing service search operation. This API is usually calling after the
2822 * bluetooth_search_service API.
2823 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
2824 * if the user wish to cancel the Ongoing service search operation.
2826 * This API should be called just after the bluetooth_search_service API and before the
2827 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
2829 * This function is a synchronous call.
2831 * @return BLUETOOTH_ERROR_NONE - Success \n
2832 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
2833 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
2834 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
2837 * @see bluetooth_search_service
2842 ret = bluetooth_cancel_service_search();
2845 int bluetooth_cancel_service_search(void);
2848 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
2849 * @brief Register rfcomm socket with a specific uuid
2852 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
2853 * descriptor of the server.
2854 * This is the first API which is called to create the server. Once we created the server socket,
2855 * we will listen on that return socket.
2856 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
2859 * @return socket FD on Success \n
2860 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
2861 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
2862 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
2863 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2864 * @param[in] UUID (128 bits)
2867 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
2871 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
2872 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
2876 int bluetooth_rfcomm_create_socket(const char *uuid);
2879 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
2880 * @brief De-register the rfcomm socket
2883 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
2884 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
2885 * descriptor else no event will come. We will call this API only after the
2886 * bluetooth_rfcomm_listen_and_accept.
2887 * This is a synchronous call.
2889 * @return BLUETOOTH_ERROR_NONE - Success \n
2890 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
2891 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
2892 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2893 * @param[in] int socket_fd
2896 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
2899 void bt_event_callback(int event, bluetooth_event_param_t *param)
2903 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
2905 bluetooth_rfcomm_connection_t *discon_ind =
2906 (bluetooth_rfcomm_connection_t *)param->param_data;
2908 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
2916 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
2917 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
2919 ret = bluetooth_rfcomm_remove_socket(fd);
2922 int bluetooth_rfcomm_remove_socket(int socket_fd);
2925 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
2926 * @brief Disconnect rfcomm connection
2929 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
2930 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
2933 * @return BLUETOOTH_ERROR_NONE - Success \n
2934 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2935 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
2936 * @param[in] int socket_fd the sending socket fd
2942 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
2944 printf("Disconnection failed");
2946 printf("Disconnection Success");
2950 int bluetooth_rfcomm_server_disconnect(int socket_fd);
2953 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
2954 * @brief Rfcomm socket listen
2957 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
2958 * after the bluetooth_rfcomm_create_socket API.
2959 * This API listen for the incomming connection and once it receives a connection, it will give
2960 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
2961 * event to the application. This is an Asynchronous API call.
2964 * @return BLUETOOTH_ERROR_NONE - Success \n
2965 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2966 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
2968 * @param[in] int socket_fd
2969 * @param[in] max pending connection.
2972 * @see bluetooth_rfcomm_create_socket
2975 void bt_event_callback(int event, bluetooth_event_param_t* param)
2979 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
2981 bluetooth_rfcomm_connection_t *conn_ind =
2982 (bluetooth_rfcomm_connection_t *)param->param_data;
2984 printf("\nConnected from FD %d", conn_ind->socket_fd);
2992 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
2993 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
2997 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3000 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3001 * @brief Rfcomm socket listen
3004 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3005 * after the bluetooth_rfcomm_create_socket API.
3006 * This API listen for the incomming connection and once it receives a connection, it will give
3007 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3008 * event to the application. This is an Asynchronous API call.
3011 * @return BLUETOOTH_ERROR_NONE - Success \n
3012 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3013 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3015 * @param[in] int socket_fd
3016 * @param[in] max pending connection.
3019 * @see bluetooth_rfcomm_create_socket
3022 void bt_event_callback(int event, bluetooth_event_param_t* param)
3026 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3028 char *name = (char *)param->param_data;
3030 printf("\nConnected from %s", name);
3032 bluetooth_rfcomm_accept_connection();
3040 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3041 ret = bluetooth_rfcomm_listen(fd, 1);
3045 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3048 * @fn int bluetooth_rfcomm_accept_connection()
3049 * @brief Accepts the authorization request indicated by the event
3050 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3052 * This function is a synchronous call.
3054 * @return BLUETOOTH_ERROR_NONE - Success \n
3055 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3057 * @param[in] the socket fd of the server
3058 * @param[out] the socket fd of the client
3062 * @see bluetooth_rfcomm_reject_connection
3064 int bluetooth_rfcomm_accept_connection(int server_fd, int *client_fd);
3067 * @fn int bluetooth_rfcomm_reject_connection()
3068 * @brief Rejects the authorization request indicated by the event
3069 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3071 * This function is a synchronous call.
3073 * @return BLUETOOTH_ERROR_NONE - Success \n
3074 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3076 * @param[in] the socket fd of the server
3080 * @see bluetooth_rfcomm_accept_connection
3082 int bluetooth_rfcomm_reject_connection(int server_fd);
3085 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3086 * @brief Informs whether rfcomm server uuid is available or not.
3088 * This function is a synchronous call.
3090 * @return TRUE - RFCOMM uuid is available \n
3091 * FALSE - RFCOMM uuid is not available \n
3093 * @param[in] uuid UUID string
3099 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3102 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3103 * const char *remote_uuid)
3104 * @brief Connect to the remote device rfcomm *
3106 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3107 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3108 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3109 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3110 * initiating a connection.
3112 * @return BLUETOOTH_ERROR_NONE - Success \n
3113 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3114 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3115 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3116 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3117 * @param[in] bluetooth_device_address_t remote bt_address
3118 * @param[in] char remote uuid
3120 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3124 void bt_event_callback(int event, bluetooth_event_param_t *param)
3128 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3130 if (param->result >= BLUETOOTH_ERROR_NONE)
3132 bt_sdp_info_t *bt_sdp_info=param->param_data;
3134 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3135 bt_sdp_info->device_addr.addr[0],
3136 bt_sdp_info->device_addr.addr[1],
3137 bt_sdp_info->device_addr.addr[2],
3138 bt_sdp_info->device_addr.addr[3],
3139 bt_sdp_info->device_addr.addr[4],
3140 bt_sdp_info->device_addr.addr[5]);
3142 printf("Supported service list:\n");
3143 for(i=0; i<bt_sdp_info->service_index; i++)
3145 bt_sdp_info->service_list_array[i]);
3148 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3149 //rfcomm_test_uuid);
3153 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3155 bluetooth_rfcomm_connection_t *conn_ind =
3156 (bluetooth_rfcomm_connection_t *)param->param_data;
3158 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
3159 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3160 "SERVER" : "CLIENT");
3165 bluetooth_device_address_t remote_address = {{0},};
3166 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3167 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
3168 ret = bluetooth_search_service(&remote_address);
3170 printf("Seach failed, Reason = %d", ret);
3172 printf("Search Success, Ret = %d", ret);
3174 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3176 printf("Connection failed, Reason = %d", ret);
3178 printf("Connection Success, Ret = %d", ret);
3182 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3183 const char *remote_uuid);
3186 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3187 * @brief Disconnect rfcomm connection
3190 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3191 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3194 * @return BLUETOOTH_ERROR_NONE - Success \n
3195 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3196 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3197 * @param[in] char remote bt_address
3200 * @see bluetooth_rfcomm_connect
3204 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3206 printf("Disconnection failed");
3208 printf("Disconnection Success");
3213 int bluetooth_rfcomm_disconnect(int socket_fd);
3216 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3217 * @brief Write to rfcomm connection
3220 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3221 * API is used to send the data for server and the client.
3223 * @return BLUETOOTH_ERROR_NONE - Success \n
3224 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3225 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3227 * @param[in] const char *buff Data buffer to send
3228 * @param[in] int length Length of the data
3231 * @see bluetooth_rfcomm_connect
3234 char *buff = "Test data 123456789"
3235 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
3237 printf("Send failed");
3239 printf("Send success");
3243 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
3246 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
3247 * @brief Informs whether rfcomm client is connected.
3249 * This function is a synchronous call.
3251 * @return TRUE - RFCOMM client is connected \n
3252 * FALSE - RFCOMM client is not connected \n
3258 gboolean bluetooth_rfcomm_is_client_connected(void);
3259 int bluetooth_rfcomm_client_is_connected(bluetooth_device_address_t *device_address, gboolean *connected);
3260 int bluetooth_rfcomm_server_is_connected(bluetooth_device_address_t *device_address, gboolean *connected);
3263 * @fn int bluetooth_network_activate_server(void)
3264 * @brief Activate the NAP (Network Access Point) service
3266 * This function is a asynchronous call.
3267 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
3269 * @return BLUETOOTH_ERROR_NONE - Success \n
3270 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3271 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3272 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3275 * @see bluetooth_network_deactivate_server
3278 int bluetooth_network_activate_server(void);
3281 * @fn int bluetooth_network_deactivate_server(void)
3282 * @brief Deactivate the NAP (Network Access Point) service
3284 * This function is a asynchronous call.
3285 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
3287 * @return BLUETOOTH_ERROR_NONE - Success \n
3288 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3289 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3290 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3293 * @see bluetooth_network_activate_server
3296 int bluetooth_network_deactivate_server(void);
3299 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3300 * bluetooth_network_role_t role,
3302 * @brief Connect the network server in the peer
3304 * This function is a asynchronous call.
3305 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3307 * @return BLUETOOTH_ERROR_NONE - Success \n
3308 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3309 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3310 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3313 * @param[in] device_address This indicates an address of the device with which the pairing
3314 * should be initiated
3315 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
3316 * need to use the third parameter.
3317 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
3318 * connect. UUID string
3320 * @see bluetooth_network_disconnect
3322 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3323 bluetooth_network_role_t role, char *custom_uuid);
3326 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
3327 * bluetooth_network_role_t role,
3328 * char *custom_uuid)
3329 * @brief Connect the network server in the peer
3331 * This function is a asynchronous call.
3332 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3334 * @return BLUETOOTH_ERROR_NONE - Success \n
3335 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3336 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3337 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3340 * @param[in] device_address This indicates an address of the device with which the pairing
3341 * should be initiated
3343 * @see bluetooth_network_connect
3345 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
3348 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
3349 * @brief Disconnect the device from the network
3351 * This function is an asynchronous call.
3352 * The network server disconnect request is responded by
3353 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
3355 * @return BLUETOOTH_ERROR_NONE - Success \n
3356 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3357 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3358 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3361 * @param[in] device_address This indicates an address of the connected client device
3363 * @see bluetooth_network_activate_server
3365 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
3370 * @fn int bluetooth_hdp_activate(unsigned short data_type,
3371 * bt_hdp_role_type_t role,
3372 * bt_hdp_qos_type_t channel_type,
3373 * char **app_handle)
3374 * @brief Activate the HDP service for a particular data type
3376 * This function is a synchronous call.
3378 * @return BLUETOOTH_ERROR_NONE - Success \n
3379 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3380 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3381 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3384 * @param[in] data_type The data type against corresponding service
3385 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
3386 * @param[in] channel_type The QOS type for the channel.
3387 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
3388 * For role = HDP_ROLE_SINK, the channel_type
3389 * should be HDP_QOS_ANY.
3390 * @param[out] app_handle The application handler against corresponding service
3392 * @see bluetooth_hdp_deactivate
3394 int bluetooth_hdp_activate(unsigned short data_type,
3395 bt_hdp_role_type_t role,
3396 bt_hdp_qos_type_t channel_type,
3399 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
3400 * @brief Deactivate the HDP service for a particular service using the handler
3402 * This function is a synchronous call.
3404 * @return BLUETOOTH_ERROR_NONE - Success \n
3405 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3406 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3407 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3410 * @param[in] app_handle The application handler against corresponding service
3412 * @see bluetooth_hdp_deactivate
3414 int bluetooth_hdp_deactivate(const char *app_handle);
3417 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
3418 * const char *buffer, unsigned int size)
3419 * @brief Send data to the remote HDP device
3421 * This function is a synchronous call.
3423 * @return BLUETOOTH_ERROR_NONE - Success \n
3424 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3425 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3426 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3427 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
3430 * @param[in] channel_id The channel id for the connection.
3431 * @param[in] buffer The pdu buffer.
3432 * @param[in] size Size of the buffer.
3434 * @see bluetooth_hdp_connect
3436 int bluetooth_hdp_send_data(unsigned int channel_id,
3437 const char *buffer, unsigned int size);
3439 * @fn int bluetooth_hdp_connect(const char *app_handle,
3440 * bt_hdp_qos_type_t channel_type,
3441 * const bluetooth_device_address_t *device_address)
3442 * @brief Connect to the remote device(Mainly used by source)
3444 * This function is a asynchronous call.
3445 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
3447 * @return BLUETOOTH_ERROR_NONE - Success \n
3448 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3449 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3450 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3451 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3454 * @param[in] app_handle The application handler against corresponding service
3455 * @param[in] channel_type The QOS type for the channel.
3456 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
3457 * @param[in] device_address The remote device Bd address.
3460 * @see bluetooth_hdp_disconnect
3462 int bluetooth_hdp_connect(const char *app_handle,
3463 bt_hdp_qos_type_t channel_type,
3464 const bluetooth_device_address_t *device_address);
3466 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
3467 * const bluetooth_device_address_t *device_address)
3468 * @brief Disconnect from the remote device(Mainly used by source)
3470 * This function is a asynchronous call.
3471 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
3473 * @return BLUETOOTH_ERROR_NONE - Success \n
3474 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3475 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3476 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3477 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3480 * @param[in] channel_id The channel id for the connection.
3481 * @param[in] device_address The remote device Bd address.
3484 * @see bluetooth_hdp_connect
3486 int bluetooth_hdp_disconnect(unsigned int channel_id,
3487 const bluetooth_device_address_t *device_address);
3491 * @fn int bluetooth_opc_init(void)
3492 * @brief Initialize OPP client.
3494 * This function is a synchronous call.
3495 * No event corresponding to this api
3497 * @return BLUETOOTH_ERROR_NONE - Success \n
3498 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3499 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3500 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3501 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3506 * @see bluetooth_opc_deinit
3508 int bluetooth_opc_init(void);
3511 * @fn int bluetooth_opc_deinit(void)
3512 * @brief Deinitialize OPP client.
3514 * This function is a synchronous call.
3515 * No event corresponding to this api
3517 * @return BLUETOOTH_ERROR_NONE - Success \n
3518 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3519 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3524 * @see bluetooth_opc_init
3527 int bluetooth_opc_deinit(void);
3530 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
3531 char **file_name_array)
3532 * @brief Send multiple files to a remote device.
3534 * This function is a asynchronous call.
3535 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
3537 * @return BLUETOOTH_ERROR_NONE - Success \n
3538 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3539 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3540 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3541 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3542 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
3543 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
3546 * @param[in] device_address The remote device Bd address.
3547 * @param[in] file_name_array Array of filepaths to be sent.
3550 * @see bluetooth_opc_cancel_push
3553 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
3554 char **file_name_array);
3557 * @fn int bluetooth_opc_cancel_push(void)
3558 * @brief Cancels the ongoing file push.
3560 * This function is a asynchronous call.
3561 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
3562 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
3564 * @return BLUETOOTH_ERROR_NONE - Success \n
3565 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3566 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
3571 * @see bluetooth_opc_push_files
3574 int bluetooth_opc_cancel_push(void);
3577 * @fn gboolean bluetooth_opc_session_is_exist(void)
3578 * @brief Informs whether opc session exists or not.
3580 * This function is a synchronous call.
3582 * @return TRUE - OPC session exists \n
3583 * FALSE - OPC session does not exist \n
3591 gboolean bluetooth_opc_session_is_exist(void);
3594 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
3595 * @brief Informs whether opc session exists or not.
3597 * This function is a synchronous call.
3599 * @return BLUETOOTH_ERROR_NONE - Success \n
3600 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3601 * BLUETOOTH_ERROR_INTERNAL \n
3604 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
3609 int bluetooth_opc_is_sending(gboolean *is_sending);
3612 * @fn int bluetooth_obex_server_init(const char *dst_path)
3613 * @brief Initialize OPP and FTP server.
3615 * This function is a synchronous call.
3616 * No event corresponding to this api
3618 * @return BLUETOOTH_ERROR_NONE - Success \n
3619 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3620 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3621 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
3622 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3625 * @param[in] dst_path OPS destination file path.
3627 * @see bluetooth_obex_server_deinit
3629 int bluetooth_obex_server_init(const char *dst_path);
3633 * @fn int bluetooth_obex_server_deinit(void)
3634 * @brief Deinitialize OPP and FTP server.
3636 * This function is a synchronous call.
3637 * No event corresponding to this api
3639 * @return BLUETOOTH_ERROR_NONE - Success \n
3640 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3641 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3646 * @see bluetooth_obex_server_init
3648 int bluetooth_obex_server_deinit(void);
3652 * @fn gboolean bluetooth_obex_server_is_activated(void)
3653 * @brief Informs whether obex server is activated or not.
3655 * This function is a synchronous call.
3657 * @return TRUE - OBEX server is activated \n
3658 * FALSE - OBEX server is not activated \n
3665 gboolean bluetooth_obex_server_is_activated(void);
3669 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
3670 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
3672 * This function is a synchronous call.
3673 * No event corresponding to this api
3675 * @return BLUETOOTH_ERROR_NONE - Success \n
3676 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3677 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3678 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
3679 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3683 * @param[in] dst_path OPS destination file path.
3685 * @see bluetooth_obex_server_deinit_without_agent
3687 int bluetooth_obex_server_init_without_agent(const char *dst_path);
3691 * @fn int bluetooth_obex_server_deinit_without_agent(void)
3692 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
3694 * This function is a synchronous call.
3695 * No event corresponding to this api
3697 * @return BLUETOOTH_ERROR_NONE - Success \n
3698 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3699 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3704 * @see bluetooth_obex_server_init_without_agent
3706 int bluetooth_obex_server_deinit_without_agent(void);
3710 * @fn int bluetooth_obex_server_accept_connection(void)
3711 * @brief Accepts the authorization request indicated by the event
3712 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
3714 * This function is a synchronous call.
3716 * @return BLUETOOTH_ERROR_NONE - Success \n
3717 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3718 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3722 * @see bluetooth_obex_server_reject_authorize
3724 int bluetooth_obex_server_accept_connection(void);
3728 * @fn int bluetooth_obex_server_reject_connection(void)
3729 * @brief Rejects the authorization request indicated by the event
3730 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
3732 * This function is a synchronous call.
3734 * @return BLUETOOTH_ERROR_NONE - Success \n
3735 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3736 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3740 * @see bluetooth_obex_server_reject_authorize
3742 int bluetooth_obex_server_reject_connection(void);
3746 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
3747 * @brief Accepts the authorization request indicated by the event
3748 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
3750 * This function is a asynchronous call.
3751 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
3753 * @return BLUETOOTH_ERROR_NONE - Success \n
3754 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3755 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3756 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3759 * @param[in] filename Authorized filename.
3762 * @see bluetooth_obex_server_reject_authorize
3765 int bluetooth_obex_server_accept_authorize(const char *filename);
3768 * @fn int bluetooth_obex_server_reject_authorize(void)
3769 * @brief Reject the authorization request indicated by the event
3770 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
3772 * This function is a asynchronous call.
3773 * No event for this api..
3775 * @return BLUETOOTH_ERROR_NONE - Success \n
3776 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3777 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3782 * @see bluetooth_obex_server_accept_authorize
3785 int bluetooth_obex_server_reject_authorize(void);
3788 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
3789 * @brief Set the OPS destination file path..
3791 * This function is a asynchronous call.
3792 * No event for this api..
3794 * @return BLUETOOTH_ERROR_NONE - Success \n
3795 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3796 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3797 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
3800 * @param[in] dst_path OPS destination file path.
3806 int bluetooth_obex_server_set_destination_path(const char *dst_path);
3809 * @fn int bluetooth_obex_server_set_root(const char *root)
3810 * @brief Set the FTS root folder..
3812 * This function is a asynchronous call.
3813 * No event for this api..
3815 * @return BLUETOOTH_ERROR_NONE - Success \n
3816 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3817 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3818 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
3819 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3820 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3823 * @param[in] root FTS root folder.
3829 int bluetooth_obex_server_set_root(const char *root);
3832 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
3833 * @brief Cancel the transfer on server
3835 * This function is an asynchronous call.
3836 * If the function call that cancels transfer is successful, the application would receive
3837 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
3838 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
3839 * the error code will be BLUETOOTH_ERROR_NONE
3841 * @return BLUETOOTH_ERROR_NONE - Success \n
3842 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3843 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3844 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
3845 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
3848 * @param[in] transfer_id transfer ID
3853 int bluetooth_obex_server_cancel_transfer(int transfer_id);
3857 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
3858 * @brief Cancel the transfer on server
3860 * This function is an asynchronous call.
3861 * If the function call that cancels transfer is successful, the application would receive
3862 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
3863 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
3864 * the error code will be BLUETOOTH_ERROR_NONE
3866 * @return BLUETOOTH_ERROR_NONE - Success \n
3867 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3868 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3869 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
3870 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
3877 int bluetooth_obex_server_cancel_all_transfers(void);
3881 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
3882 * @brief Informs whether obex server is receiving or not.
3884 * This function is a synchronous call.
3886 * @return BLUETOOTH_ERROR_NONE - Success \n
3887 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3888 * BLUETOOTH_ERROR_INTERNAL \n
3891 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
3896 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
3900 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
3901 * @brief Read the local Hash and Randmizer.
3903 * This function is a synchronous call.
3905 * @return BLUETOOTH_ERROR_NONE - Success \n
3906 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3910 * @param[out] local_oob_data - Pointer to the local OOB data
3916 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
3920 * @fn int bluetooth_oob_add_remote_data(
3921 * const bluetooth_device_address_t *remote_device_address,
3922 * bt_oob_data_t *oob_data)
3923 * @brief Add/updated the remote device Hash and Randmizer.
3925 * This function is a synchronous call.
3926 * No event for this api..
3928 * @return BLUETOOTH_ERROR_NONE - Success \n
3929 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3932 * @param[in] remote_device_address - Remote device address
3933 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
3939 int bluetooth_oob_add_remote_data(
3940 const bluetooth_device_address_t *remote_device_address,
3941 bt_oob_data_t *remote_oob_data);
3945 * @fn int bluetooth_oob_remove_remote_data(
3946 * const bluetooth_device_address_t *remote_device_address)
3947 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
3949 * This function is a synchronous call.
3950 * No event for this api..
3952 * @return BLUETOOTH_ERROR_NONE - Success \n
3953 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3956 * @param[in] remote_device_address - Remote device address
3962 int bluetooth_oob_remove_remote_data(
3963 const bluetooth_device_address_t *remote_device_address);
3966 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
3967 * bt_gatt_handle_info_t *prim_svc);
3969 * @brief Gets the GATT based primary services handle supported by remote device
3971 * This function is a synchronous call.
3972 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
3974 * @return BLUETOOTH_ERROR_NONE - Success \n
3975 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3976 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
3977 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
3980 * @param[in] address - Remote device address
3981 * @param[out] prim_svc - Structure containing remote service count and handle list.
3984 * @see bluetooth_gatt_free_primary_services()
3986 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
3987 bt_gatt_handle_info_t *prim_svc);
3990 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
3992 * @brief Discovers the characteristics of GATT based service of remote device
3994 * This function is an asynchronous call.
3995 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
3997 * @return BLUETOOTH_ERROR_NONE - Success \n
3998 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3999 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4000 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4003 * @param[in] service_handle - Handle for remote service.
4008 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4011 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4012 * bt_gatt_service_property_t *service);
4014 * @brief Gets the properties of GATT based service of remote device
4016 * This function is a synchronous call.
4017 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4019 * @return BLUETOOTH_ERROR_NONE - Success \n
4020 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4021 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4022 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4025 * @param[in] service_handle - Handle for remote service.
4026 * @param[out] service - Structure containing remote service property.
4029 * @see bluetooth_gatt_free_service_property()
4031 int bluetooth_gatt_get_service_property(const char *service_handle,
4032 bt_gatt_service_property_t *service);
4035 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4037 * @brief Register to GATT based service to receive value change notification/indication.
4039 * This function is a synchronous call.
4040 * No event for this api.
4042 * @return BLUETOOTH_ERROR_NONE - Success \n
4043 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4044 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4045 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4048 * @param[in] service_handle - Handle for remote service.
4053 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4056 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4058 * @brief Unregister GATT based service to receive value change notification/indication.
4060 * This function is a synchronous call.
4061 * No event for this api.
4063 * @return BLUETOOTH_ERROR_NONE - Success \n
4064 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4065 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4066 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4069 * @param[in] service_handle - Handle for remote service.
4074 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4077 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4078 * bt_gatt_char_property_t *characteristic);
4080 * @brief Provides characteristic value along with properties.
4082 * This function is a synchronous call.
4083 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4085 * @return BLUETOOTH_ERROR_NONE - Success \n
4086 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4087 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4088 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4091 * @param[in] char_handle - Handle for Characteristic property.
4092 * @param[out] characteristic - Structure containing remote characteristic property.
4095 * @see bluetooth_gatt_free_char_property()
4097 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4098 bt_gatt_char_property_t *characteristic);
4101 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4102 * bt_gatt_char_property_t *characteristic);
4104 * @brief Provides characteristic descriptor value along with its UUID.
4106 * This function is a synchronous call.
4107 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4109 * @return BLUETOOTH_ERROR_NONE - Success \n
4110 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4111 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4112 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4115 * @param[in] desc_handle - Handle for Characteristic descriptor.
4116 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4119 * @see bluetooth_gatt_free_desc_property()
4121 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4122 bt_gatt_char_descriptor_property_t *descriptor);
4126 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4127 * const guint8 *value, int length)
4129 * @brief Set characteristic value.
4131 * This function is a synchronous call.
4133 * @return BLUETOOTH_ERROR_NONE - Success \n
4134 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4135 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4136 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4139 * @param[in] char_handle - Handle for Characteristic property.
4140 * @param[in] value - New value to set for characteristic property.
4141 * @param[in] length - Length of the value to be set.
4146 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4147 const guint8 *value, int length);
4150 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4151 * const guint8 *value, int length)
4153 * @brief Set characteristic value request.
4155 * This function is an asynchronous call.
4157 * @return BLUETOOTH_ERROR_NONE - Success \n
4158 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4159 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4160 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4163 * @param[in] char_handle - Handle for Characteristic property.
4164 * @param[in] value - New value to set for characteristic property.
4165 * @param[in] length - Length of the value to be set.
4170 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4171 const guint8 *value, int length);
4174 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4176 * @brief Read characteristic value.
4178 * This function is a asynchronous call.
4180 * @return BLUETOOTH_ERROR_NONE - Success \n
4181 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4182 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4183 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4186 * @param[in] char_handle - Handle for Characteristic property.
4191 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
4194 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4195 * const char *service_uuid,
4196 * bt_gatt_service_property_t *service)
4198 * @brief Gets the service property from a device based on a particular uuid
4200 * This function is a synchronous call.
4202 * @return BLUETOOTH_ERROR_NONE - Success \n
4203 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4204 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4205 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4208 * @param[in] address - BD address of the remote device
4209 * @param[in] service_uuid - uuid of the service.
4210 * @param[out] service - Structure containing the service property.
4215 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4216 const char *service_uuid,
4217 bt_gatt_service_property_t *service);
4220 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4221 * const char *char_uuid)
4223 * @brief Gets the characteristic property from a service based on a particular char uuid
4225 * This function is an asynchronous call.
4226 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
4228 * @return BLUETOOTH_ERROR_NONE - Success \n
4229 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4230 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4231 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4234 * @param[in] service_handle - Service handle.
4235 * @param[in] uuid - Characteristic uuid.
4240 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4241 const char *char_uuid);
4244 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4246 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
4248 * This function is a synchronous call.
4249 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
4251 * @return BLUETOOTH_ERROR_NONE - Success \n
4252 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4255 * @param[in] prim_svc - GATT handle info structure
4258 * @see bluetooth_gatt_get_primary_services()
4260 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4263 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4265 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
4267 * This function is a synchronous call.
4268 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
4270 * @return BLUETOOTH_ERROR_NONE - Success \n
4271 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4274 * @param[in] svc_pty - GATT service property structure.
4277 * @see bluetooth_gatt_get_service_property()
4279 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4282 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4284 * @brief Provides characteristic value along with properties.
4286 * This function is a synchronous call.
4287 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4289 * @return BLUETOOTH_ERROR_NONE - Success \n
4290 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4293 * @param[in] char_pty - GATT characteristics property structure.
4296 * @see bluetooth_gatt_get_characteristics_property()
4298 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4301 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4303 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
4305 * This function is a synchronous call.
4306 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
4308 * @return BLUETOOTH_ERROR_NONE - Success \n
4309 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4312 * @param[in] desc_pty - GATT characteristics descriptor property structure.
4315 * @see bluetooth_gatt_get_char_descriptor_property()
4317 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4320 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
4322 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
4325 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4327 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
4329 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4331 * @return BLUETOOTH_ERROR_NONE - Success \n
4332 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4335 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
4339 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4342 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
4344 * @brief Read characteristic descriptor value.
4346 * This function is a asynchronous call.
4348 * @return BLUETOOTH_ERROR_NONE - Success \n
4349 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4350 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4351 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4354 * @param[in] desc_handle - Handle for Characteristic descriptor
4359 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
4362 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4363 * const guint8 *value, int length);
4365 * @brief Set characteristic descriptor value.
4367 * This function is a asynchronous call.
4369 * @return BLUETOOTH_ERROR_NONE - Success \n
4370 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4371 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4372 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4375 * @param[in] desc_handle - Handle for Characteristic descriptor
4376 * @param[in] value - New value to set for characteristic descriptor
4377 * @param[in] length - Length of the value to be set.
4382 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4383 const guint8 *value, int length);
4385 /* @fn int bluetooth_gatt_init(void)
4387 * @brief Initializes the gatt service.
4389 * This function is a synchronous call.
4390 * @return BLUETOOTH_ERROR_NONE - Success \n
4391 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4392 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4393 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4396 * @remark Adapter should be enabled
4397 * @see bluetooth_gatt_deinit()
4399 int bluetooth_gatt_init(void);
4401 /* @fn int bluetooth_gatt_init(void)
4403 * @brief DeInitializes the gatt service.
4405 * This function is a synchronous call.
4406 * @return BLUETOOTH_ERROR_NONE - Success \n
4407 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4408 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4409 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4412 * @remark Adapter should be enabled
4413 * @see bluetooth_gatt_init()
4415 int bluetooth_gatt_deinit(void);
4417 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
4418 unsigned char **svc_path)
4420 * @brief Exports a new gatt service to the service interface.
4422 * This function is a synchronous call.
4424 * @return BLUETOOTH_ERROR_NONE - Success \n
4425 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4426 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4427 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4430 * @param[in] svc_uuid Gatt service uuid.
4431 * @param[out] svc_path service object path of the exported service.
4432 * @remark Adapter should be enabled
4433 * @see bluetooth_gatt_init()
4435 int bluetooth_gatt_add_service(const char *svc_uuid,
4438 /* @fn int bluetooth_gatt_add_new_characteristic(
4439 const char *svc_path, const char *char_uuid,
4440 bt_gatt_characteristic_property_t *properties,
4441 int flags_length, char **char_path);;
4443 * @brief Exports a new gatt characteristic to the characteristic interface.
4445 * This function is a synchronous call.
4446 * @return BLUETOOTH_ERROR_NONE - Success \n
4447 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4448 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4449 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4451 * @param[in] svc_path service object path of the exported service.
4452 * @param[in] char_uuid Gatt service uuid.
4453 * @param[in] properties GATT characteristic properties.
4454 * @param[out] char_path characteristic object path of the exported characteristic.
4456 * @remark Adapter should be enabled
4457 * @see bluetooth_gatt_add_service()
4459 int bluetooth_gatt_add_new_characteristic(
4460 const char *svc_path, const char *char_uuid,
4461 bt_gatt_characteristic_property_t properties,
4464 /* @fn bluetooth_gatt_set_characteristic_value(
4465 const char *characteristic, const char *char_value,
4468 * @brief adds gatt charactertisic value to the given charactertistic path.
4470 * This function is a synchronous call.
4471 * @return BLUETOOTH_ERROR_NONE - Success \n
4472 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4473 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4474 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4476 * @param[in] char_value Value of the GATT characteristic to be added.
4477 * @param[in] value_length length of the chantacteristic value..
4478 * @param[out] characteristic characteristic object path..
4480 * @remark Adapter should be enabled
4481 * @see bluetooth_gatt_add_service()
4483 int bluetooth_gatt_set_characteristic_value(
4484 const char *characteristic, const char *char_value,
4487 /* @fn int bluetooth_gatt_add_descriptor(const char *desc_uuid,
4488 const char *desc_value, int value_length,
4489 const char *permissions, const char *char_path,
4492 * @brief Exports a new gatt descriptor to the descriptor interface.
4494 * This function is a synchronous call.
4496 * @return BLUETOOTH_ERROR_NONE - Success \n
4497 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4498 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4499 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4502 * @param[in] desc_uuid Gatt descriptor uuid.
4503 * @param[in] desc_value GATT descriptor value.
4504 * @param[in] value_length Length of GATT descriptor value.
4505 * @param[in] permissions descriptor permissions.
4506 * @param[in] char_path characteristics object path of the exported character.
4508 * @remark Adapter should be enabled
4509 * @see bluetooth_gatt_add_service()
4510 * @see bluetooth_gatt_add_characteristics()
4512 int bluetooth_gatt_add_descriptor(const char *char_path,
4513 const char *desc_uuid,
4516 /* @fn int bluetooth_gatt_set_descriptor_value(
4517 const char *desc_path, const char *desc_value,
4520 * @brief Adds value to the given descriptor handle.
4522 * This function is a synchronous call.
4524 * @return BLUETOOTH_ERROR_NONE - Success \n
4525 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4526 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4527 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4530 * @param[in] desc_value GATT descriptor value.
4531 * @param[in] value_length Length of GATT descriptor value.
4532 * @param[in] desc_path descriptor path to which the value needs to be added.
4534 * @remark Adapter should be enabled
4535 * @see bluetooth_gatt_add_service()
4536 * @see bluetooth_gatt_add_characteristics()
4538 int bluetooth_gatt_set_descriptor_value(
4539 const char *desc_path, const char *desc_value,
4542 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
4544 * @brief Reads the Service registered on manager interface.
4546 * This function is a synchronous call.
4548 * @return BLUETOOTH_ERROR_NONE - Success \n
4549 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4550 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4551 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4554 * @param[in] svc_uuid Gatt Service uuid.
4556 * @remark Adapter should be enabled and service should be registered.
4557 * @see bluetooth_gatt_register_service()
4559 int bluetooth_gatt_get_service(const char *svc_uuid);
4561 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
4563 * @brief Registers the given service path with the bluez gatt server.
4565 * This function is a synchronous call.
4567 * @return BLUETOOTH_ERROR_NONE - Success \n
4568 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4569 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4570 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4573 * @param[in] svc_path service object path of the exported service.
4575 * @remark Adapter should be enabled
4576 * @see bluetooth_gatt_add_service()
4577 * @see bluetooth_gatt_add_characteristics()
4578 * @see bluetooth_gatt_add_descriptor()
4580 int bluetooth_gatt_register_service(const char *svc_path);
4582 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
4584 * @brief Removes(unregister) service from the bluez gatt server db.
4586 * This function is a synchronous call.
4588 * @return BLUETOOTH_ERROR_NONE - Success \n
4589 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4590 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4591 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4594 * @param[in] svc_path service object path of the exported service.
4596 * @remark Adapter should be enabled
4597 * @see bluetooth_gatt_add_service()
4598 * @see bluetooth_gatt_add_characteristics()
4599 * @see bluetooth_gatt_add_descriptor()
4600 * @see bluetooth_gatt_register_service()
4602 int bluetooth_gatt_unregister_service(const char *svc_path);
4604 /* @fn int bluetooth_gatt_delete_services(void)
4606 * @brief deletes (unregisters) all services from the gatt server database..
4608 * This function is a synchronous call.
4610 * @return BLUETOOTH_ERROR_NONE - Success \n
4611 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4612 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4613 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4617 * @remark Adapter should be enabled
4618 * @see bluetooth_gatt_add_service()
4619 * @see bluetooth_gatt_add_characteristics()
4620 * @see bluetooth_gatt_add_descriptor()
4621 * @see bluetooth_gatt_register_service()
4622 * @see bluetooth_gatt_unregister_service()
4624 int bluetooth_gatt_delete_services(void);
4626 /* @fn int bluetooth_gatt_update_characteristic(void)
4628 * @brief updates the given characteristic with a new value
4630 * This function is a synchronous call.
4632 * @return BLUETOOTH_ERROR_NONE - Success \n
4633 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4634 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4635 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4639 * @remark Adapter should be enabled
4640 * @see bluetooth_gatt_add_service()
4641 * @see bluetooth_gatt_add_characteristics()
4642 * @see bluetooth_gatt_add_descriptor()
4643 * @see bluetooth_gatt_register_service()
4644 * @see bluetooth_gatt_unregister_service()
4646 int bluetooth_gatt_update_characteristic(const char *char_path,
4647 const char* char_value, int value_length);
4650 * @fn int bluetooth_set_advertising(gboolean enable);
4652 * @brief Set advertising status.
4654 * This function is used to enable or disable LE advertising.
4655 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
4657 * This function is a synchronous call.
4659 * @return BLUETOOTH_ERROR_NONE - Success \n
4660 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4661 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4664 * @param[in] enable - The status of advertising
4667 * @see bluetooth_set_advertising_data
4669 int bluetooth_set_advertising(gboolean enable);
4672 * @fn int bluetooth_set_custom_advertising(gboolean enable, float interval_min, float interval_max,
4673 * guint8 filter_policy);
4675 * @brief Set advertising status along with interval value.
4677 * This function is used to enable or disable LE advertising.
4678 * Interval_min and Interval_max is used to set the best advertising interval.
4679 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
4681 * This function is a synchronous call.
4683 * @return BLUETOOTH_ERROR_NONE - Success \n
4684 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4685 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4688 * @param[in] enable - The status of advertising
4689 * @param[in] interval_min - Minimum interval of advertising (msec)
4690 * @param[in] interval_max - Maximum interval of advertising (msec)
4691 * @param[in] filter_policy - Advertising filter policy
4694 * @see bluetooth_set_advertising_data
4696 int bluetooth_set_custom_advertising(gboolean enable,
4697 bluetooth_advertising_params_t *params);
4700 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
4701 * @brief Get the advertising data
4703 * This function is used to get advertising data.
4704 * Before calling this API, the adapter should be enabled.
4706 * This function is a synchronous call.
4708 * @return BLUETOOTH_ERROR_NONE - Success \n
4709 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4710 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
4711 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4713 * @param[out] value - Advertising data structure.
4714 * @param[out] length - The length of Advertising data.
4718 bluetooth_advertising_data_t *value = { {0} };
4721 ret = bluetooth_get_advertising_data(&value, &length);
4724 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
4727 * @fn int bluetooth_set_advertising_data(const bluetooth_advertising_data_t *value, int length);
4729 * @brief Set advertising data with value
4731 * This function is used to set advertising data and Maximum size of advertising data
4732 * is 28 byte (Except Flag)
4734 * This function is a synchronous call.
4736 * @return BLUETOOTH_ERROR_NONE - Success \n
4737 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4738 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4741 * @param[in] value - Advertising data structure.
4745 int bluetooth_set_advertising_data(const bluetooth_advertising_data_t *value, int length);
4748 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
4749 * @brief Get the LE scan response data
4751 * This function is used to get scan response data.
4752 * Before calling this API, the adapter should be enabled.
4754 * This function is a synchronous call.
4756 * @return BLUETOOTH_ERROR_NONE - Success \n
4757 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4758 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
4759 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4761 * @param[out] value - Scan response data structure.
4762 * @param[out] length - The length of Scan response data.
4766 bluetooth_scan_resp_data_t *value = { {0} };
4769 ret = bluetooth_get_scan_response_data(&value, &length);
4772 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
4775 * @fn int bluetooth_set_scan_response_data(const bluetooth_scan_resp_data_t *value, int length);
4777 * @brief Set scan response data with value
4779 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
4781 * This function is a synchronous call.
4783 * @return BLUETOOTH_ERROR_NONE - Success \n
4784 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4785 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4788 * @param[in] value - LE Scan response data structure.
4792 int bluetooth_set_scan_response_data(const bluetooth_scan_resp_data_t *value, int length);
4795 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
4797 * @brief Set scan interval and window
4799 * This function is used to set LE scan interval and window size
4801 * This function is a synchronous call.
4803 * @return BLUETOOTH_ERROR_NONE - Success \n
4804 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4805 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4808 * @param[in] interval - Interval of LE scan (msec)
4809 * @param[in] window - Window size of LE scan (msec)
4813 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
4816 * @fn int bluetooth_is_advertising(void)
4817 * @brief Check for the advertising is in-progress or not.
4819 * This API is used to check the current status of the advertising procedure.
4820 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
4823 * This function checks whether the advertising is started or not.
4825 * This function is a synchronous call.
4827 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
4829 * @return BLUETOOTH_ERROR_NONE - Success \n
4830 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4833 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
4837 gboolean is_advertising = 0;
4839 ret = bluetooth_is_advertising(&is_advertising);
4842 int bluetooth_is_advertising(gboolean *is_advertising);
4845 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
4846 * @brief Add LE device to white list
4848 * This API is used to add LE device to white list
4849 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
4853 * This function is a synchronous call.
4855 * @param[in] address The address of remote device
4857 * @return BLUETOOTH_ERROR_NONE - Success \n
4858 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4861 * @see bluetooth_set_custom_advertising
4863 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
4866 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
4867 * @brief Remove LE device from white list
4869 * This API is used to remove LE device from white list
4870 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
4874 * This function is a synchronous call.
4876 * @param[in] address The address of remote device
4878 * @return BLUETOOTH_ERROR_NONE - Success \n
4879 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4882 * @see bluetooth_set_custom_advertising
4884 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
4887 * @fn int bluetooth_clear_white_list(void)
4888 * @brief Clear white list
4890 * This API is used to clear white list
4891 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
4895 * This function is a synchronous call.
4897 * @param[in] address The address of remote device
4899 * @return BLUETOOTH_ERROR_NONE - Success \n
4900 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4903 * @see bluetooth_set_custom_advertising
4905 int bluetooth_clear_white_list(void);
4908 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
4909 * const bluetooth_le_conn_update_t *parameters)
4910 * @brief update connection paramter of LE connection.
4912 * This function is a synchronous call.
4914 * @return BLUETOOTH_ERROR_NONE - Success \n
4915 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4918 * @param[in] address - remote device address value.
4919 * @param[in] parameters - new connection parameters.
4922 * @see bluetooth_bond_device
4924 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
4925 const bluetooth_le_conn_update_t *parameters);
4929 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
4931 * @brief Enable/Disable LE Privacy feature.
4933 * This function is used to enable or disable LE Privacy feature.
4934 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
4936 * This function is a synchronous call.
4938 * @return BLUETOOTH_ERROR_NONE - Success \n
4939 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4940 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4943 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
4947 int bluetooth_enable_le_privacy(gboolean enable_privacy);
4949 int bluetooth_pbap_init(void);
4950 int bluetooth_pbap_deinit(void);
4951 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
4952 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
4953 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
4954 bt_pbap_folder_t *folder);
4955 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
4956 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
4957 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
4958 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
4959 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
4960 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
4961 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
4962 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
4965 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
4967 * @brief Set manufacturer data with value
4969 * This function is used to set manufacturer data.
4971 * This function is a synchronous call.
4973 * @return BLUETOOTH_ERROR_NONE - Success \n
4974 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4975 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4978 * @param[in] value - Manufacturer data structure.
4982 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
4989 #endif /* __cplusplus */
4990 #endif /* _BLUETOOTH_API_H_*/