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_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
49 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
50 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
51 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
53 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
54 a device can support */
56 #define BLUETOOTH_UUID_STRING_MAX 50
57 #define BLUETOOTH_PATH_STRING 50
59 #define BLUETOOTH_OOB_DATA_LENGTH 16
61 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
64 * This is Bluetooth Connected event role
66 #define RFCOMM_ROLE_SERVER 1
67 #define RFCOMM_ROLE_CLIENT 2
70 * This is RFCOMM default Channel Value
72 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
75 * This is maximum length for search value string for PBAP Phonebook Search
77 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
81 * This is Bluetooth error code
83 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
85 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
86 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
88 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
89 /**< Callback error */
90 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
91 /**< invalid paramerror */
92 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
93 /**< invalid data error */
94 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
95 /**< Memory allocation error */
96 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
97 /**< out of memory error */
98 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
100 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
101 /**< No resource error */
102 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
103 /**< internal error */
104 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
105 /**< Not supported error */
106 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
107 /**< Operation is failed because
108 of not enabled BT Adapter */
109 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
110 /**< Enabling is failed because of
111 already enabled BT Adapter */
112 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
113 /**< Operation is failed because of
114 other on going operation */
115 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
116 /**< access denied error */
117 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
118 /**< max client error */
119 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
120 /**< not found error */
121 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
122 /**< service search fail */
123 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
124 /**< pairing failed error */
125 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
126 /**< Not paired error */
127 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
128 /**< no service error */
129 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
130 /**< no connection error */
131 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
132 /**< alread connected error */
133 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
134 /**< connection busy error */
135 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
136 /**< connection error */
137 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
138 /**< max connection error*/
139 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
140 /**< Not in operation */
141 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
142 /**< Cancelled by user */
143 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
144 /**< Service record registration failed */
145 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
146 /**< Operation in progress */
147 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
148 /**< authentication failed error when paring*/
149 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
150 /**< Remote host is down */
151 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
152 /**< End of device list */
154 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
155 /**< Obex agent already exists */
156 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
157 /**< Obex agent does not exist */
159 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
160 /**< Already initialized */
162 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
163 /**< Permission deined */
165 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
166 /**< Nap already done */
168 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
169 /**< Not initialized */
172 * Device disconnect reason
175 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
176 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
177 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
178 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
179 } bluetooth_device_disconnect_reason_t;
182 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
185 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
186 } bluetooth_device_address_t;
189 * This is Bluetooth device address type
193 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
194 BLUETOOTH_DEVICE_RANDOM_ADDRESS
195 } bluetooth_device_address_type_t;
198 * This is Bluetooth version
201 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
202 } bluetooth_version_t;
205 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
208 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
209 } bluetooth_device_name_t;
212 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
215 int data_len; /**< manafacturer specific data length */
216 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
217 } bluetooth_manufacturer_data_t;
220 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
221 } bluetooth_device_pin_code_t;
227 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
228 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
229 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
230 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
231 } bluetooth_adapter_state_t;
237 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
238 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
239 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
240 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
241 } bluetooth_adapter_le_state_t;
247 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
248 /*Changed the order to make it compatable with old method */
249 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
250 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
251 /**< Discoverable mode with time limit
252 After specific timeout, it is changed
253 to non discoverable mode */
254 } bluetooth_discoverable_mode_t;
257 * Network connect mode
260 BLUETOOTH_NETWORK_PANU_ROLE,
262 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
263 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
264 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
265 } bluetooth_network_role_t;
271 BLUETOOTH_RFCOMM_SERVICE = 0x01,
272 BLUETOOTH_A2DP_SERVICE = 0x02,
273 BLUETOOTH_HSP_SERVICE = 0x04,
274 BLUETOOTH_HID_SERVICE = 0x08,
275 BLUETOOTH_NAP_SERVICE = 0x10,
276 BLUETOOTH_HFG_SERVICE = 0x20,
277 BLUETOOTH_GATT_SERVICE = 0x40,
278 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
279 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
280 } bluetooth_service_type_t;
286 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, /* represents that connection
287 * type can both BR/EDR and LE */
288 BLUETOOTH_DEV_CONN_BREDR = 0x00,
289 BLUETOOTH_DEV_CONN_LE = 0x01,
290 } bluetooth_conn_type_t;
296 BLUETOOTH_CODEC_ID_CVSD = 0x01,
297 BLUETOOTH_CODEC_ID_MSBC = 0x02,
298 } bluetooth_codec_type_t;
304 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
305 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
306 } bluetooth_hf_audio_connected_type_t;
312 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
313 } bluetooth_advertising_data_t;
319 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
320 } bluetooth_scan_resp_data_t;
323 * Advertising filter policy
326 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
327 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
328 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
329 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
330 } bluetooth_advertising_filter_policy_t;
336 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
337 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
338 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
339 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
340 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
341 } bluetooth_advertising_type_t;
345 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
346 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
347 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
348 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
349 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
350 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
351 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
352 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0x80
353 }bt_gatt_characteristic_property_t;
356 * Remote device request types for attributes
359 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
360 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
361 } bluetooth_gatt_att_request_tyep_t;
364 * Advertising parameters
369 guint8 filter_policy;
371 } bluetooth_advertising_params_t;
377 int type; /**< passive 0, active 1 */
378 float interval; /**< LE scan interval */
379 float window; /**< LE scan window */
380 } bluetooth_le_scan_params_t;
386 guint16 interval_min;
387 guint16 interval_max;
390 } bluetooth_le_connection_param_t;
393 LE Read Maximum Data Length
396 guint16 max_tx_octets;
398 guint16 max_rx_octets;
400 } bluetooth_le_read_maximum_data_length_t;
403 LE Read Host suggested default Data Length
406 guint16 def_tx_octets;
408 } bluetooth_le_read_host_suggested_data_length_t;
411 * Samsung XSAT Vendor dependent command
416 } bluetooth_vendor_dep_at_cmd_t;
419 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
420 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
421 /**< Base ID for GAP Event */
422 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
423 /**< Base ID for SDP events */
424 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
425 /**< Base ID for RFCOMM events */
426 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
427 /**< Base ID for NETWORK events */
428 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
429 /**< Base ID for HDP events */
430 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
431 /**< Base ID for OPC events */
432 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
433 /**< Base ID for Obex Server events */
434 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
435 /**< Base ID for GATT events */
437 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
438 /**< Base ID for Audio events */
439 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
440 /**< Base ID for HID events */
441 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
442 /**< Base ID for Advertising events */
443 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
444 /**< Base ID for PBAP Client events */
445 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
446 /**< Base ID for AVRCP events */
447 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
448 /**< Base ID for IPSP events */
451 * Bluetooth event type
454 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
456 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
457 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
458 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
459 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
460 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
461 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
462 /**< Bluetooth event Discoverable timeout requested*/
463 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
464 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
465 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
466 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
467 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
468 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
469 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
470 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
471 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
472 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
473 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
474 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
475 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
476 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
477 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
478 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
479 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
480 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
481 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
482 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
483 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
485 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
486 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
487 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
489 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
490 /**< Bluetooth event serice search base id */
491 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
492 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
493 /**< RFCOMM data receive event */
494 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
495 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
497 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
499 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
500 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
502 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
504 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
505 /**< Bluetooth Network event */
506 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
507 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
508 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
509 /**< Network disconnected evnet in server */
511 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
512 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
514 BLUETOOTH_EVENT_HDP_CONNECTED
515 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
516 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
517 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
519 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
520 /* OPC Connected event */
521 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
522 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
523 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
524 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
526 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
527 /* Obex server authorize event*/
528 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
529 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
530 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
531 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
532 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
533 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
535 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
536 /**<Discovered GATT service characteristics event*/
537 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
538 /**<Remote GATT charateristic value changed event*/
539 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
540 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
541 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
542 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
543 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
544 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
545 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
546 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
547 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
548 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
549 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
550 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
551 BLUETOOTH_EVENT_GATT_SERVER_INDICATE_CONFIRMED, /** <GATT Characteristic Notification change event */
553 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
554 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
555 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
556 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
557 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
558 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
559 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
560 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
561 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
562 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
563 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
564 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
565 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
566 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
567 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
568 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
569 BLUETOOTH_EVENT_HF_CONNECTED,
570 BLUETOOTH_EVENT_HF_DISCONNECTED,
571 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
572 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
573 BLUETOOTH_EVENT_HF_RING_INDICATOR,
574 BLUETOOTH_EVENT_HF_CALL_WAITING,
575 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
576 BLUETOOTH_EVENT_HF_CALL_STARTED,
577 BLUETOOTH_EVENT_HF_CALL_ENDED,
578 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
579 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
580 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
581 BLUETOOTH_EVENT_HF_CALL_STATUS,
582 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
583 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
584 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
585 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
587 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
588 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
589 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
590 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
591 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
593 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
594 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
595 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
596 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
597 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
598 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
599 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
600 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
602 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
603 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
604 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
605 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
606 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
607 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
608 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
610 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
611 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
612 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
613 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
614 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
615 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
616 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
617 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
618 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
620 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
621 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
622 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
623 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
624 } bluetooth_event_type_t;
627 * This bt_service_uuid_list_t enum indicates service uuid list .
628 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
632 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
633 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
634 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
635 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
636 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
637 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
638 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
639 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
640 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
641 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
642 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
643 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
645 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
646 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
647 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
648 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
649 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
650 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
651 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
652 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
653 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
654 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
655 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
656 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
657 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
658 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
660 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
661 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
662 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
663 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
664 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
665 /**<DIRECT PRINTING*/
666 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
667 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
668 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
669 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
670 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
671 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
672 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
673 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
674 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
675 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
676 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
677 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
678 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
679 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
680 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
681 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
682 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
683 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
684 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
685 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
686 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
687 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
688 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
689 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
690 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
691 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
692 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
693 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
694 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
695 } bluetooth_service_uuid_list_t;
698 * Service class part of class of device returned from device discovery
701 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
702 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
703 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
704 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
705 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
706 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
707 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
708 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
709 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
710 } bluetooth_device_service_class_t;
714 * Major device mask (For device discovery)
717 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
718 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
719 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
720 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
721 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
722 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
723 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
724 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
725 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
726 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
727 } bluetooth_device_major_mask_t;
731 * Major device class (part of Class of Device)
734 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
735 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
736 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
737 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
738 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
739 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
740 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
741 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
742 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
743 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
744 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
745 } bluetooth_device_major_class_t;
748 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
750 /* About Computer Major class */
751 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
753 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
754 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
755 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
756 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
757 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
759 /* About Phone Major class */
760 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
761 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
762 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
763 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
764 /**< voice gateway minor class */
765 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
767 /* About LAN/Network Access Point Major class */
768 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
769 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
770 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
771 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
772 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
773 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
774 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
775 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
777 /* About Audio/Video Major class */
778 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
779 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
781 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
782 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
783 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
784 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
785 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
786 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
787 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
788 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
789 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
790 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
791 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
792 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
793 /**< Video Display and Loud
794 Speaker minor class */
795 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
798 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
800 /* About Peripheral Major class */
801 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
802 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
803 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
804 /**< Combo Keyboard or pointing
807 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
808 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
809 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
810 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
811 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
812 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
813 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
814 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
815 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
817 /* About Imaging Major class */
818 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
819 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
820 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
821 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
823 /* About Wearable Major class */
824 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
825 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
826 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
827 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
828 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
830 /* About Toy Major class */
831 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
832 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
833 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
834 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
835 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
837 /* About Health Major class */
838 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
839 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
840 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
841 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
842 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
843 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
844 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
845 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
846 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
847 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
848 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
849 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
850 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
851 } bluetooth_device_minor_class_t;
854 * structure to hold the device information
857 bluetooth_device_major_class_t major_class; /**< major device class */
858 bluetooth_device_minor_class_t minor_class; /**< minor device class */
859 bluetooth_device_service_class_t service_class;
860 /**< service device class */
861 } bluetooth_device_class_t;
864 * Discovery Role types
867 DISCOVERY_ROLE_BREDR = 0x1,
869 DISCOVERY_ROLE_LE_BREDR
870 } bt_discovery_role_type_t;
873 * Connected state types
876 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
877 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
878 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
879 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
880 } bluetooth_connected_link_t;
886 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
887 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
888 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
889 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
890 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
891 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
892 } bluetooth_le_scan_filter_feature_t;
898 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
899 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
900 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
901 } bluetooth_le_connection_mode_t;
904 * structure to hold the device information
907 bluetooth_device_address_t device_address; /**< device address */
908 bluetooth_device_name_t device_name; /**< device name */
909 bluetooth_device_class_t device_class; /**< device class */
910 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
911 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
913 int rssi; /**< received strength signal*/
914 gboolean paired; /**< paired flag */
915 bluetooth_connected_link_t connected; /**< connected link type */
916 gboolean trust; /**< trust flag */
917 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
918 } bluetooth_device_info_t;
921 * structure to hold the LE device information
924 int data_len; /**< manafacturer specific data length */
925 bluetooth_advertising_data_t data; /**< manafacturer specific data */
926 } bluetooth_le_advertising_data_t;
929 bluetooth_device_address_t device_address; /**< device address */
930 int addr_type; /**< address type*/
931 int rssi; /**< received strength signal*/
932 bluetooth_le_advertising_data_t adv_ind_data;
933 bluetooth_le_advertising_data_t scan_resp_data;
934 } bluetooth_le_device_info_t;
938 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
939 bluetooth_device_address_t device_address; /**< device address */
940 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
941 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
942 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
943 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
944 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
945 bluetooth_le_advertising_data_t service_data; /**< service data */
946 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
947 int manufacturer_id; /**< manufacturer ID */
948 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
949 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
950 } bluetooth_le_scan_filter_t;
953 * structure to hold the paired device information
956 bluetooth_device_address_t device_address; /**< paired device address */
957 bluetooth_device_name_t device_name; /**< device name */
958 bluetooth_device_class_t device_class; /**< device class */
959 } bluetooth_paired_device_info_t;
962 * structure to hold the paired device information
965 bluetooth_device_address_t device_address;
966 /**< device address */
967 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
968 /**< network interface name */
969 } bluetooth_network_device_info_t;
972 * Authentication event types
976 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
977 BLUETOOTH_AUTH_PIN_REQUEST,
978 BLUETOOTH_AUTH_PASSKEY_REQUEST,
979 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
980 } bluetooth_auth_type_t;
983 * structure to hold the pincode/pass-key req informations
986 bluetooth_device_address_t device_address; /**< remote device address */
987 bluetooth_device_name_t device_name; /**< device name */
988 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
989 } bluetooth_authentication_request_info_t;
992 * Stucture to hold discovery option
995 unsigned short max_response; /**< the number of maximum response */
996 unsigned short discovery_duration;
997 /**< duration of discovery (seconds) */
998 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
999 classOfDevice variable */
1000 } bluetooth_discovery_option_t;
1003 * Stucture to hold event information
1006 int event; /**< event type */
1007 int result; /**< Success or error value */
1009 /**<parameter data pointer */
1011 } bluetooth_event_param_t;
1014 bluetooth_device_address_t device_addr;
1015 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1016 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1017 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1022 bluetooth_device_address_t device_addr;
1023 unsigned char addr_type;
1025 } bt_connection_info_t;
1028 * Stucture to rfcomm receive data
1033 /**< the socket fd */
1034 int buffer_size;/**< the length of the receive buffer */
1036 /**< the receive data buffer */
1037 } bluetooth_rfcomm_received_data_t;
1043 HTYPE_TRANS_HANDSHAKE,
1044 HTYPE_TRANS_HID_CONTROL,
1045 HTYPE_TRANS_GET_REPORT,
1046 HTYPE_TRANS_SET_REPORT,
1047 HTYPE_TRANS_GET_PROTOCOL,
1048 HTYPE_TRANS_SET_PROTOCOL,
1051 }bt_hid_header_type_t;
1057 PTYPE_DATA_RTYPE_INPUT,
1058 PTYPE_DATA_RTYPE_OUTPUT
1059 }bt_hid_param_type_t;
1062 * Stucture to hid receive data
1065 const char *address;
1066 bt_hid_header_type_t type;
1067 /**< Header type containing */
1068 bt_hid_param_type_t param;
1069 /**< Param type in header like INPUT Report or OutPut Report */
1070 int buffer_size;/**< the length of the receive buffer */
1072 /**< the receive data buffer */
1073 } bluetooth_hid_received_data_t;
1076 * Stucture to rfcomm connection
1080 int socket_fd; /**< the socket fd */
1081 int server_id; /* Server id */
1082 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1083 bluetooth_device_address_t device_addr;
1084 /**< device address */
1085 char uuid[BLUETOOTH_UUID_STRING_MAX];
1086 } bluetooth_rfcomm_connection_t;
1089 * Stucture to rfcomm disconnection
1093 /**< the socket fd */
1094 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1095 bluetooth_device_address_t device_addr;
1096 /**< device address */
1097 char uuid[BLUETOOTH_UUID_STRING_MAX];
1098 } bluetooth_rfcomm_disconnection_t;
1102 /**< the socket fd */
1103 bluetooth_device_address_t device_addr;
1104 /**< device address */
1105 } bluetooth_rfcomm_connection_request_t;
1109 /**< the socket fd */
1110 bluetooth_device_address_t device_addr;
1111 /**< device address */
1112 } bluetooth_hid_request_t;
1127 HDP_ROLE_SOURCE = 0x0,
1129 }bt_hdp_role_type_t;
1133 * Stucture to HDP connected
1136 const char *app_handle; /**< the application handle */
1137 unsigned int channel_id; /**< the channel id */
1138 bt_hdp_qos_type_t type; /**< the QOS type */
1139 bluetooth_device_address_t device_address; /**< the remote address */
1140 } bt_hdp_connected_t;
1143 * Stucture to HDP disconnected
1146 unsigned int channel_id; /**< the channel id */
1147 bluetooth_device_address_t device_address; /**< the remote address */
1148 } bt_hdp_disconnected_t;
1151 * Stucture to HDP data indication
1154 unsigned int channel_id; /**< the channel id */
1155 const char *buffer; /**< the RX data buffer */
1156 unsigned int size; /**< the RX data size */
1157 } bt_hdp_data_ind_t;
1160 * Stucture to OPP client transfer information
1166 }bt_opc_transfer_info_t;
1168 /* Obex Server transfer type */
1169 #define TRANSFER_PUT "PUT"
1170 #define TRANSFER_GET "GET"
1172 * Stucture to OPP/FTP Server authorize information
1177 } bt_obex_server_authorize_into_t;
1185 } bt_obex_server_type_t;
1188 * Stucture to OPP/FTP server transfer information
1196 unsigned long file_size;
1198 bt_obex_server_type_t server_type;
1199 } bt_obex_server_transfer_info_t;
1202 * Stucture to OOB data
1206 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1207 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1208 unsigned int hash_len;
1209 unsigned int randomizer_len;
1213 * Structure to GATT attribute handle data
1219 } bt_gatt_handle_info_t;
1222 * Structure to GATT Remote service data
1229 bt_gatt_handle_info_t include_handles;
1230 bt_gatt_handle_info_t char_handle;
1231 } bt_gatt_service_property_t;
1234 * Structure to GATT Remote characteristic data
1238 char *service_handle;
1239 bt_gatt_handle_info_t handle_info;
1240 } bt_gatt_discovered_char_t;
1243 * Structure to format of GATT Characteristic Value
1247 unsigned char format;
1248 unsigned char exponent;
1249 unsigned short unit;
1250 unsigned char name_space;
1251 unsigned short description;
1252 } bt_gatt_char_format_t;
1255 * Structure to GATT Characteristic property
1263 bt_gatt_char_format_t format;
1265 unsigned int val_len;
1266 unsigned int permission;
1267 char *representation;
1268 bt_gatt_handle_info_t char_desc_handle;
1269 } bt_gatt_char_property_t;
1272 * Structure to GATT Characteristic descriptor property
1279 unsigned int val_len;
1280 } bt_gatt_char_descriptor_property_t;
1283 * Structure to GATT Characteristic value
1290 } bt_gatt_char_value_t;
1293 * Structure to GATT Read Request
1297 char *service_handle;
1301 } bt_gatt_read_req_t;
1304 * Structure to GATT Value change
1308 char *service_handle;
1314 } bt_gatt_value_change_t;
1317 * Structure to GATT characteristc Notification change
1321 char *service_handle;
1322 gboolean att_notify;
1323 } bt_gatt_char_notify_change_t;
1326 * Structure to Indication confirmation
1330 char *service_handle;
1333 } bt_gatt_indicate_confirm_t;
1336 * Structure to RSSI Signal Strength Alert
1347 * Structure to RSSI Signal Strength
1357 * Structure for RSSI Enabled or Disabled
1363 gboolean rssi_enabled;
1364 } bt_rssi_enabled_t;
1367 * Structure for RSSI Threshold
1372 int in_range_threshold;
1374 } bt_rssi_threshold_t;
1377 * Structure for PBAP Folder Parameters
1380 unsigned char addressbook;
1381 unsigned char folder_type;
1385 * Structure for PBAP Pull application Parameters
1388 unsigned char format;
1389 unsigned char order;
1390 unsigned short offset;
1391 unsigned short maxlist;
1392 long long unsigned fields;
1393 } bt_pbap_pull_parameters_t;
1396 * Structure for PBAP List application Parameters
1399 unsigned char order;
1400 unsigned short offset;
1401 unsigned short maxlist;
1402 } bt_pbap_list_parameters_t;
1405 * Structure for PBAP Pull vCard application Parameters
1408 unsigned char format;
1409 long long unsigned fields;
1411 } bt_pbap_pull_vcard_parameters_t;
1414 * Structure for PBAP Search application Parameters
1417 unsigned char order;
1418 unsigned short offset;
1419 unsigned short maxlist;
1420 unsigned char search_attribute;
1421 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1422 } bt_pbap_search_parameters_t;
1425 * Structure for PBAP Connection Status
1428 bluetooth_device_address_t btaddr;
1430 } bt_pbap_connected_t;
1433 * Structure for PBAP Phonebook Size
1436 bluetooth_device_address_t btaddr;
1438 } bt_pbap_phonebook_size_t;
1441 * Structure for PBAP Phonebook Pull
1444 bluetooth_device_address_t btaddr;
1447 } bt_pbap_phonebook_pull_t;
1450 * Structure for PBAP vCard List
1453 bluetooth_device_address_t btaddr;
1457 } bt_pbap_vcard_list_t;
1460 * Structure for PBAP vCard Pull
1463 bluetooth_device_address_t btaddr;
1466 } bt_pbap_vcard_pull_t;
1469 * Structure for PBAP Phonebook search List
1472 bluetooth_device_address_t btaddr;
1476 } bt_pbap_phonebook_search_list_t;
1479 * Stucture to HF Call status information
1483 char *number; /*Phone Number */
1484 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1485 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1486 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1487 int idx; /*Call index/ID */
1488 } bt_hf_call_status_info_t;
1493 } bt_hf_call_list_s;
1496 * Structure for LE data length change params
1500 bluetooth_device_address_t device_address;
1501 guint16 max_tx_octets;
1502 guint16 max_tx_time;
1503 guint16 max_rx_octets;
1504 guint16 max_rx_time;
1505 } bt_le_data_length_params_t;
1508 * Callback pointer type
1510 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1513 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1514 * @brief Set the callback function pointer for bluetooth event
1517 * This API will register the callback function, when any response and event are received from
1518 * bluetooth framework. @n
1519 * this registered callback function will be get called with appropriate event and data structures.
1520 * This function is a synchronous call. An application developer can call
1521 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1522 * type. This registered function will receive events of bluetooth_event_type_t type along with
1526 * @param[in] callback_ptr A pointer to the callback function
1527 * @param[in] user_data A pointer to user data
1528 * @return BLUETOOTH_ERROR_NONE - Success
1532 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1534 GMainLoop *main_loop = (GMainLoop*) user_data;
1538 // Code for each event
1540 g_main_loop_quit(main_loop);
1547 GMainLoop *main_loop = NULL;
1550 main_loop = g_main_loop_new(NULL, FALSE);
1551 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1552 if (ret >= BLUETOOTH_ERROR_NONE)
1554 // bluetooth_register_callback returned Success
1558 // bluetooth_register_callback returned failiure
1560 g_main_loop_run(main_loop);
1564 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1567 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1568 * @brief Set the callback function pointer for bluetooth le event
1571 * This API will register the callback function, when any response and event are received from
1572 * bluetooth framework. @n
1573 * this registered callback function will be get called with appropriate event and data structures.
1574 * This function is a synchronous call. An application developer can call
1575 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1576 * type. This registered function will receive events of bluetooth_event_type_t type along with
1580 * @param[in] callback_ptr A pointer to the callback function
1581 * @param[in] user_data A pointer to user data
1582 * @return BLUETOOTH_ERROR_NONE - Success
1586 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1589 * @fn int bluetooth_le_unregister_callback(void)
1590 * @brief Set the callback function pointer for bluetooth le event
1593 * This API will register the callback function, when any response and event are received from
1594 * bluetooth framework. @n
1595 * this registered callback function will be get called with appropriate event and data structures.
1596 * This function is a synchronous call. An application developer can call
1597 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1598 * type. This registered function will receive events of bluetooth_event_type_t type along with
1603 * @return BLUETOOTH_ERROR_NONE - Success
1607 int bluetooth_le_unregister_callback(void);
1610 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1611 * @brief Set the callback function pointer for bluetooth event
1614 * This API will register the callback function, when any response and event are received from
1615 * bluetooth framework. @n
1616 * this registered callback function will be get called with appropriate event and data structures.
1617 * This function is a synchronous call. An application developer can call
1618 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1619 * type. This registered function will receive events of bluetooth_event_type_t type along with
1624 * @return BLUETOOTH_ERROR_NONE - Success
1628 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1630 GMainLoop *main_loop = (GMainLoop*) user_data;
1634 // Code for each event
1636 g_main_loop_quit(main_loop);
1643 GMainLoop *main_loop = NULL;
1646 main_loop = g_main_loop_new(NULL, FALSE);
1647 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1648 if (ret >= BLUETOOTH_ERROR_NONE)
1650 // bluetooth_register_callback returned Success
1654 // bluetooth_register_callback returned failiure
1656 ret = bluetooth_deregister_callback(void);
1657 g_main_loop_run(main_loop);
1661 int bluetooth_unregister_callback(void);
1664 * @fn int bluetooth_enable_adapter(void)
1665 * @brief Enable the Bluetooth H/W
1668 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1669 * send request to bluetooth chip for activation.
1670 * This function is typically called at startup or when Bluetooth services are required. This
1671 * function must be called before calling any other API of Bluetooth operations.
1673 * Before performing any operations like Device discover, service search etc.., the adapter must be
1676 * This function is a asynchronous call.
1677 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1678 * through registered callback function with appropriate result code
1679 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1680 * BLUETOOTH_ERROR_NONE - Success \n
1682 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1683 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1685 * @return BLUETOOTH_ERROR_NONE - Success\n
1686 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1687 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1688 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1689 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1691 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1693 void bt_event_callback(int event, bluetooth_event_param_t *param)
1697 case BLUETOOTH_EVENT_ENABLED:
1698 if (param->result == BLUETOOTH_ERROR_NONE)
1700 // Successfully Enabled
1713 ret = bluetooth_enable_adapter();
1717 int bluetooth_enable_adapter(void);
1720 * @fn int bluetooth_disable_adapter(void)
1721 * @brief Disable the Bluetooth H/W
1724 * This function disables Bluetooth protocol stack and hardware. This function is called when
1725 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1727 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1728 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1729 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1731 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1734 * This function is a asynchronous call.
1735 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1736 * through registered callback function.
1739 * @return BLUETOOTH_ERROR_NONE - Success\n
1740 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1741 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1742 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1744 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1746 void bt_event_callback(int event, bluetooth_event_param_t *param)
1750 case BLUETOOTH_EVENT_DISABLED:
1751 if (param->result == BLUETOOTH_ERROR_NONE)
1753 // Successfully disabled
1766 ret = bluetooth_disable_adapter();
1769 int bluetooth_disable_adapter(void);
1770 int bluetooth_recover_adapter(void);
1771 int bluetooth_check_adapter_le(void);
1772 int bluetooth_enable_adapter_le(void);
1774 int bluetooth_disable_adapter_le(void);
1777 * @fn int bluetooth_reset_adapter(void)
1778 * @brief Reset the Bluetooth H/W and values
1781 * This function resets Bluetooth protocol stack and hardware. This function is called when
1782 * an user want to initialize Bluetooth environment.
1784 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1787 * This function is a synchronous call.
1789 * @return BLUETOOTH_ERROR_NONE - Success\n
1790 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1792 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1797 ret = bluetooth_reset_adapter();
1800 int bluetooth_reset_adapter(void);
1803 * @fn int bluetooth_is_supported(void)
1804 * @brief Check if the bluetooth is supported or not by the current target
1806 * This API checks whether the bluetooth is supported or not.
1807 * This API only run by root permission.
1809 * This function is a synchronous call.
1811 * @return 0 - if bluetooth is not supported\n
1812 * 1 - if bluetooth is supported\n
1813 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
1818 ret = bluetooth_is_supported();
1821 int bluetooth_is_supported(void);
1825 * @fn int bluetooth_check_adapter(void)
1826 * @brief Check the current status of the Bluetooth adapter
1829 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
1830 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
1831 * bluetooth adapter.
1832 * This API get the adapter internal data structure and check current adapter status.
1834 * This function is a synchronous call.
1837 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
1838 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
1840 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
1844 ret = bluetooth_check_adapter();
1847 int bluetooth_check_adapter(void);
1850 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
1851 * @brief Get the local adapter bluetooth address
1854 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
1855 * the adapter should be enabled.
1856 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
1857 * contain Bluetooth address.
1858 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
1859 * friendly name for each device.
1860 * There is no event callback for this API.
1862 * This function is a synchronous call.
1865 * @return BLUETOOTH_ERROR_NONE - Succeess \n
1866 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
1867 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
1868 * @param[out] local_address a device address of local bluetooth adapter
1873 bluetooth_device_address_t local_address={0,};
1876 ret = bluetooth_get_local_address(&local_address);
1879 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
1882 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
1883 * @brief Get the hci version
1886 * This function is used to get the bluetooth hci version
1887 * Before calling this API make sure that the adapter is enabled.
1889 * This function is a synchronous call.
1892 * @return BLUETOOTH_ERROR_NONE - Success \n
1893 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1894 * @param[out] timeout remain visibility timeout value
1897 bluetooth_version_t *version;
1899 ret = bluetooth_get_local_version (&version);
1902 int bluetooth_get_local_version(bluetooth_version_t *version);
1905 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
1906 * @brief Get the local device name
1909 * This function is used, get the local device name. Since its difficult to remember the Adapter
1910 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
1911 * friendly name is retrived by the remote device and displaying.
1912 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
1914 * This function is a synchronous call.
1917 * @return BLUETOOTH_ERROR_NONE - Success \n
1918 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
1919 * @param[out] local_name a local device name
1923 bluetooth_device_name_t local_name={0,}
1925 ret = bluetooth_get_local_name (&local_name);
1928 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
1931 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
1932 * @brief Set the local device name
1935 * This function is used to set the local device name. This is a human friendly name whose
1936 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
1938 * This function is a synchronous call.
1940 * @param[in] local_name bluetooth device name to set local device
1942 * @return BLUETOOTH_ERROR_NONE - Success \n
1943 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1944 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1945 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
1946 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
1947 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1952 bluetooth_device_name_t local_name={0,}
1954 ret = bluetooth_set_local_name (&local_name);
1957 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
1961 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
1962 * @brief Check if the uuid is used or not
1964 * This function is used to check if the uuid is used or not.
1966 * This function is a synchronous call.
1968 * @param[in] service_uuid service uuid (UUID 128 bit as string)
1969 * @param[out] used if the uuid is used or not
1971 * @return BLUETOOTH_ERROR_NONE - Success \n
1972 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1973 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1974 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1979 gboolean used = FALSE;
1980 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
1981 ret = bluetooth_is_service_used(uuid, &used);
1984 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
1987 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
1988 * @brief Check if the device is connected to the specific service
1990 * This function is used to check if if the device is connected to the specific service.
1992 * This function is a synchronous call.
1994 * @param[in] local_address a device address of remote bluetooth device
1995 * @param[in] type the service type
1996 * @param[out] is_connected if the device is connected or not
1998 * @return BLUETOOTH_ERROR_NONE - Success \n
1999 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2000 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2001 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2006 gboolean is_connected = FALSE;
2007 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2008 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2011 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2012 bluetooth_service_type_t type,
2013 gboolean *is_connected);
2016 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2017 * @brief Gets device's connected link type
2019 * This function is used to get device's connected link type
2021 * This function is a synchronous call.
2023 * @param[in] device_address a device address of remote bluetooth device
2024 * @param[out] connected_link a device's connected link type
2026 * @return BLUETOOTH_ERROR_NONE - Success \n
2027 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2028 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2029 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2034 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2035 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2036 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2039 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2040 bluetooth_connected_link_t *connected_link);
2043 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2044 * @brief Get the visibility mode
2047 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2048 * visibity mode, the property of the device is determined whether it can be discoverable, non
2049 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2051 * This function is a synchronous call.
2054 * @return BLUETOOTH_ERROR_NONE - Success \n
2055 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2056 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2057 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2058 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2059 * @param[out] discoverable_mode current bluetooth discoverable mode
2061 * @see bluetooth_set_discoverable_mode
2063 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2065 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2068 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2071 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2073 * @brief Set the visibility mode
2076 * This function is used to set the discoverable mode (Visibility option).
2078 * Many times user may want to keep his device discoverable so that when peer device is performing
2079 * device search, he/she can find user's device. Application programmer can keep the mode as
2080 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2081 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2082 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2083 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2085 * This function is a synchronous call.
2087 * @return BLUETOOTH_ERROR_NONE - Success \n
2088 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2090 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2091 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2093 * @see bluetooth_get_discoverable_mode
2097 bluetooth_discoverable_mode_t mode;
2099 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2100 ret = bluetooth_set_discoverable_mode (mode, 180);
2104 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2109 * @fn int bluetooth_get_timeout_value(int *timeout)
2110 * @brief Get the visibility timeout value
2113 * This function is used to get the visibility timeout
2114 * Before calling this API make sure that the adapter is enabled.
2116 * This function is a synchronous call.
2119 * @return BLUETOOTH_ERROR_NONE - Success \n
2120 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2121 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2122 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2123 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2124 * @param[out] timeout remain visibility timeout value
2126 * @see bluetooth_set_discoverable_mode
2130 ret = bluetooth_get_timeout_value (&timeout);
2133 int bluetooth_get_timeout_value(int *timeout);
2137 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2138 * unsigned int classOfDeviceMask)
2139 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2141 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2142 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2143 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2144 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2145 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2146 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2147 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2148 * please see bluetooth_device_info_t for more details.
2151 * This API provides searching options like max responses, discovery duration in seconds and class
2152 * of device mask to filter device search. some times there may be too many bluetooth devices in
2153 * vicinity of your device.in such scenario, application can request to reduce number of responces
2154 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2155 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2156 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2157 * application defined time. please note that discovery_duration should be mentioned in seconds.
2158 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2161 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2162 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2163 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2165 * This function is a asynchronous call.
2166 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2167 * through registered callback function.
2169 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2170 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2172 * The completion or cancellation of the discovery is indicated by an
2173 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2175 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2178 * @return BLUETOOTH_ERROR_NONE - Success \n
2179 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2180 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2181 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2182 agent is not running \n
2184 * @param[in] max_response define the maximum response of the number of founded devices
2186 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2187 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2188 (refer to class of device)
2190 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2193 void bt_event_callback(int event, bluetooth_event_param_t *param)
2197 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2199 bluetooth_device_info_t *device_info = NULL;
2200 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2202 device_info = (bluetooth_device_info_t *)param->param_data;
2203 memcpy(&searched_device, &device_info->device_address,
2204 sizeof(bluetooth_device_address_t));
2205 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2206 device_info->device_address.addr[0],
2207 device_info->device_address.addr[1],
2208 device_info->device_address.addr[2],
2209 device_info->device_address.addr[3],
2210 device_info->device_address.addr[4],
2211 device_info->device_address.addr[5]);
2214 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2216 bluetooth_device_info_t *device_info = NULL;
2217 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2219 device_info = (bluetooth_device_info_t *)param->param_data;
2220 memcpy(&searched_device, &device_info->device_address,
2221 sizeof(bluetooth_device_address_t));
2222 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2223 device_info->device_name.name,
2224 device_info->device_address.addr[0],
2225 device_info->device_address.addr[1],
2226 device_info->device_address.addr[2],
2227 device_info->device_address.addr[3],
2228 device_info->device_address.addr[4],
2229 device_info->device_address.addr[5]);
2233 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2234 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2239 unsigned short max_response;
2240 unsigned short discovery_duration;
2241 unsigned classOfDeviceMask;
2245 discovery_duration =0;
2246 classOfDeviceMask =0;
2248 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2253 int bluetooth_start_discovery(unsigned short max_response,
2254 unsigned short discovery_duration,
2255 unsigned int classOfDeviceMask);
2258 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2259 * unsigned short max_response,
2260 * unsigned short discovery_duration,
2261 * unsigned int classOfDeviceMask)
2262 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2264 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2265 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2266 * Please see bluetooth_start_discovery() for other parameters description.
2268 * This function is a asynchronous call.
2269 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2270 * through registered callback function.
2272 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2273 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2275 * The completion or cancellation of the discovery is indicated by an
2276 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2278 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2281 * @return BLUETOOTH_ERROR_NONE - Success \n
2282 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2283 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2284 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2285 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2286 agent is not running \n
2288 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2289 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2290 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2291 * @param[in] max_response define the maximum response of the number of founded devices
2293 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2294 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2295 (refer to class of device)
2297 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2300 unsigned short type;
2301 unsigned short max_response;
2302 unsigned short discovery_duration;
2303 unsigned classOfDeviceMask;
2308 discovery_duration =0;
2309 classOfDeviceMask =0;
2311 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2316 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2317 unsigned short max_response,
2318 unsigned short discovery_duration,
2319 unsigned int classOfDeviceMask);
2322 * @fn int bluetooth_cancel_discovery (void)
2323 * @brief Cancel the on-going device discovery operation
2326 * This function stops the on-going device discovery operation. This API has to be called after the
2327 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2328 * the bluetooth_start_discovery API
2330 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2331 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2332 * cancel the discover request once the user received the device to which he wish to connect.
2334 * This function is a asynchronous call.
2335 * If the call is success to cancel discovey then the application will receive
2336 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2337 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2338 * BLUETOOTH_ERROR_NONE
2341 * @return BLUETOOTH_ERROR_NONE - Success \n
2342 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2343 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2344 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2345 other application \n
2346 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2348 * @see bluetooth_start_discovery
2350 void bt_event_callback(int event, bluetooth_event_param_t *param)
2354 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2355 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2364 ret = bluetooth_cancel_discovery();
2367 int bluetooth_cancel_discovery(void);
2370 * @fn int bluetooth_start_le_discovery(void)
2371 * @brief Start the generic device discovery which finds the LE devices.
2373 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2374 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2375 * It try to find LE devices. Bluetooth device address and name are
2376 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2377 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2378 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2379 * please see bluetooth_device_info_t for more details.
2381 * This function is a asynchronous call.
2382 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2383 * through registered callback function.
2385 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2388 * The completion or cancellation of the discovery is indicated by an
2389 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2391 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2394 * @return BLUETOOTH_ERROR_NONE - Success \n
2395 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2396 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2397 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2398 agent is not running \n
2401 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2404 void bt_event_callback(int event, bluetooth_event_param_t *param)
2408 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2410 bluetooth_device_info_t *device_info = NULL;
2411 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2413 device_info = (bluetooth_device_info_t *)param->param_data;
2414 memcpy(&searched_device, &device_info->device_address,
2415 sizeof(bluetooth_device_address_t));
2416 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2417 device_info->device_address.addr[0],
2418 device_info->device_address.addr[1],
2419 device_info->device_address.addr[2],
2420 device_info->device_address.addr[3],
2421 device_info->device_address.addr[4],
2422 device_info->device_address.addr[5]);
2426 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2427 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2433 ret = bluetooth_start_discovery();
2438 int bluetooth_start_le_discovery(void);
2441 * @fn int bluetooth_stop_le_discovery (void)
2442 * @brief Cancel the on-going device LE discovery operation
2445 * This function stops the on-going device discovery operation. This API has to be called after the
2446 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2447 * the bluetooth_start_le_discovery API
2450 * This function is a asynchronous call.
2451 * If the call is success to cancel discovey then the application will receive
2452 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2453 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2454 * BLUETOOTH_ERROR_NONE
2457 * @return BLUETOOTH_ERROR_NONE - Success \n
2458 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2459 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2460 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2461 other application \n
2462 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2464 * @see bluetooth_start_discovery
2466 void bt_event_callback(int event, bluetooth_event_param_t *param)
2470 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2471 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2480 ret = bluetooth_stop_le_discovery();
2483 int bluetooth_stop_le_discovery(void);
2486 * @fn int bluetooth_is_discovering(void)
2487 * @brief Check for the device discovery is in-progress or not.
2489 * This API is used to check the current status of the Discovery operation.If discovery is in\
2490 * progress normally other operations are not allowed.
2491 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2492 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2493 * event before performing other operations. This API is used to get for the current discovery
2494 * operation status and using bluetooth_cancel_discovery()
2495 * we can cancell the ongoing discovery process.
2496 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2499 * This function checks whether the device discovery is started or not.
2501 * This function is a synchronous call.
2504 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2505 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2506 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2509 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2513 ret = bluetooth_is_discovering ();
2516 int bluetooth_is_discovering(void);
2519 * @fn int bluetooth_is_le_discovering(void)
2520 * @brief Check for the device LE discovery is in-progress or not.
2522 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2523 * progress normally other operations are not allowed.
2524 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2525 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2526 * event before performing other operations. This API is used to get for the current discovery
2527 * operation status and using bluetooth_stop_le_discovery()
2528 * we can cancell the ongoing LE discovery process.
2529 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2532 * This function checks whether the device LE discovery is started or not.
2534 * This function is a synchronous call.
2537 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2538 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2539 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2542 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2546 ret = bluetooth_is_le_discovering ();
2549 int bluetooth_is_le_discovering(void);
2552 * @fn int bluetooth_is_le_scanning(void)
2553 * @brief Check for the device LE scan is in-progress or not.
2555 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2556 * progress normally other operations are not allowed.
2558 * This function checks whether the device LE Scan is started or not.
2560 * This function is a synchronous call.
2562 * @return TRUE - LE Scan in progress \n
2563 * FALSE - LE Scan is not in progress \n
2568 gboolean is_le_scanning = 0;
2569 is_le_scanning = bluetooth_is_le_scanning ();
2572 gboolean bluetooth_is_le_scanning(void);
2575 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2576 * @brief Register scan filter.
2578 * This function registers the scan filter.
2580 * This function is a synchronous call.
2582 * @return BLUETOOTH_ERROR_NONE - Success \n
2584 * @param[in] filter scan filter to register
2585 * @param[out] slot_id the slot ID of scan filter
2589 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2592 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2593 * @brief Register scan filter.
2595 * This function unregisters the scan filter.
2597 * This function is a synchronous call.
2599 * @return BLUETOOTH_ERROR_NONE - Success \n
2601 * @param[in] slot_id the slot ID of scan filter
2605 int bluetooth_unregister_scan_filter(int slot_id);
2608 * @fn int bluetooth_unregister_all_scan_filters(void)
2609 * @brief Register scan filter.
2611 * This function usregisters all scan filters.
2613 * This function is a synchronous call.
2615 * @return BLUETOOTH_ERROR_NONE - Success \n
2619 int bluetooth_unregister_all_scan_filters(void);
2622 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2623 int link_type, bt_rssi_threshold_t rssi_threshold)
2624 * @brief Enable RSSI monitoring
2626 * This function enables RSSI monitoring and sets threshold for a connection
2628 * @return BLUETOOTH_ERROR_NONE - Success \n
2631 * @see bluetooth_get_rssi_strength
2633 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2634 int link_type, bt_rssi_threshold_t *rssi_threshold);
2637 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2638 * @brief Gets Raw RSSI signal Strength
2640 * This function gives the Raw RSSI signal strength for a connection.
2642 * @return BLUETOOTH_ERROR_NONE - Success \n
2645 * @see bluetooth_enable_rssi
2647 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2649 int bluetooth_set_connectable(gboolean is_connectable);
2651 int bluetooth_is_connectable(gboolean *is_connectable);
2654 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2655 * @brief Initiate a bonding process
2658 * This function initiates a bonding procedure with a peer device. The bonding procedure
2659 * enables authentication and optionally encryption on the Bluetooth link.
2661 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2662 * inititate the bonding request to the devices already in the paired list.
2664 * Usually we call this API after the device discovery.
2665 * This function is a asynchronous call.
2667 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2668 * mentioed result code
2669 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2670 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2671 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2672 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2673 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2675 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2676 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2679 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2682 * @return BLUETOOTH_ERROR_NONE - Success \n
2683 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2684 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2685 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2686 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2688 * @param[in] device_address This indicates an address of the device with which the pairing
2689 * should be initiated
2691 * @see bluetooth_cancel_bonding
2693 void bt_event_callback(int event, bluetooth_event_param_t *param)
2697 case BLUETOOTH_EVENT_BONDING_FINISHED:
2699 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2700 if (param->result >= BLUETOOTH_ERROR_NONE)
2702 bluetooth_device_info_t *device_info = NULL;
2703 device_info = (bluetooth_device_info_t *)param->param_data;
2704 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
2705 mjr[%#x] min[%#x] srv[%#x]",
2706 device_info->device_name.name,
2707 device_info->device_address.addr[0],
2708 device_info->device_address.addr[1],
2709 device_info->device_address.addr[2],
2710 device_info->device_address.addr[3],
2711 device_info->device_address.addr[4],
2712 device_info->device_address.addr[5],
2713 device_info->device_class.major_class,
2714 device_info->device_class.minor_class,
2715 device_info->device_class.service_class);
2729 bluetooth_device_address_t device_address={{0}};
2731 ret = bluetooth_bond_device(&device_address);
2735 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
2738 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2739 * bluetooth_conn_type_t conn_type)
2740 * @brief Initiate a bonding process
2743 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
2744 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
2746 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2747 * inititate the bonding request to the devices already in the paired list.
2749 * Usually we call this API after the device discovery.
2750 * This function is a asynchronous call.
2752 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2753 * mentioed result code
2754 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2755 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2756 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2757 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2758 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2760 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2761 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2764 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2767 * @return BLUETOOTH_ERROR_NONE - Success \n
2768 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2769 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2770 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2771 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2773 * @param[in] device_address This indicates an address of the device with which pairing
2774 * should be initiated
2775 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
2778 * @see bluetooth_cancel_bonding
2780 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2781 bluetooth_conn_type_t conn_type);
2784 * @fn int bluetooth_cancel_bonding(void)
2785 * @brief Cancel the on-going bonding process
2787 * This API is called to cancel the on-going bonding procedure. It should be called before the
2788 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
2789 * This API is useful when the remote device is not responding to the bond request or we wish to
2790 * cancel the bonding request. In this case we need not wait for the timeout to happen.
2792 * This function is a synchronous call.
2794 * @return BLUETOOTH_ERROR_NONE - Success \n
2795 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
2796 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2799 * @see bluetooth_bond_device
2805 ret = bluetooth_cancel_bonding();
2808 int bluetooth_cancel_bonding(void);
2811 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
2812 * @brief Remove bonding
2815 * To communicate with remote device over bluetooth link, user should bond with peer device.
2816 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
2817 * API is used to remove peer device from the list. Please note that after removing the device
2818 * from bonded device list, you cannot communication with peer device until bonding happens again.
2820 * User can call this function by passing bluetooth device address of any bonded device. Please note
2821 * that after successful return of this function, any bluetooth application running on your device
2822 * will not be able to communicate with unbonded device until bond operation happens again using
2823 * bluetooth_bond_device()
2826 * This function is a asynchronous call. The request to remove the specified device from the bonded
2827 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
2828 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
2829 * in case if there is a problem in locating given bluetooth device address in bonded devices list
2833 * @return BLUETOOTH_ERROR_NONE - Success \n
2834 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
2835 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2836 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2837 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2838 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2839 * agent is not running \n
2840 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
2843 * @param[in] device_address This indicates an address of the device to remove bonding
2847 * @see bluetooth_bond_device, bluetooth_cancel_bonding
2850 void bt_event_callback(int event, bluetooth_event_param_t *param)
2853 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
2854 bluetooth_device_address_t *dev_addr = NULL;
2856 if (param->result == BLUETOOTH_ERROR_NONE) {
2857 dev_addr = (bluetooth_device_address_t *)param->param_data;
2859 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2860 dev_addr->addr[0], dev_addr->addr[1]
2861 dev_addr->addr[2], dev_addr->addr[3]
2862 dev_addr->addr[4], dev_addr->addr[5]
2873 bluetooth_device_address_t *device_address;
2875 // copy valid device address in device_address
2877 ret = bluetooth_unbond_device(device_address);
2880 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
2883 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
2884 * @brief Get bonded(paired) device list
2887 * This API gets all bonded device list.
2888 * The devices in the bonded device list further can be used to perform the authorization by calling
2889 * bluetooth_authorize_device API.
2891 * This function is a synchronous call.
2892 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2893 * there is no valid information in the dev_list.
2894 * The len field in the dev_list represents the number of bonded devices. The data structure for
2895 * bonded device information is bluetooth_device_info_t.
2898 * @return BLUETOOTH_ERROR_NONE - Success \n
2899 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2901 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2903 void bt_get_bonded_devices(void)
2907 GPtrArray *devinfo = NULL;
2908 bluetooth_device_info_t *ptr;
2910 // allocate the g_pointer_array
2911 devinfo = g_ptr_array_new();
2913 ret = bluetooth_get_bonded_device_list(&devinfo);
2914 if (ret != BLUETOOTH_ERROR_NONE)
2916 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
2920 printf("g pointer arrary count : [%d]", devinfo->len);
2921 for (i=0; i<devinfo->len; i++)
2923 ptr = g_ptr_array_index(devinfo, i);
2926 printf("Name [%s]\n", ptr->device_name.name);
2927 printf("Major Class [%d]\n", ptr->device_class.major_class);
2928 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
2929 printf("Service Class [%d]\n", ptr->device_class.service_class);
2930 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2931 ptr->device_address.addr[0],
2932 ptr->device_address.addr[1], ptr->device_address.addr[2],
2933 ptr->device_address.addr[3],
2934 ptr->device_address.addr[4], ptr->device_address.addr[5]);
2941 // free g_pointer_array
2942 g_ptr_array_free(devinfo, TRUE);
2947 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
2950 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2951 * bluetooth_device_info_t *dev_info)
2952 * @brief Get a bonded(paired) device
2955 * This API gets a bonded device.
2957 * This function is a synchronous call.
2958 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2959 * there is no valid information in the dev_info.
2960 * The data structure for bonded device information is bluetooth_device_info_t.
2963 * @return BLUETOOTH_ERROR_NONE - Success \n
2964 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2966 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2968 void bt_get_bonded_device(void)
2972 bluetooth_device_info_t devinfo = {0};
2973 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
2975 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
2976 if (ret != BLUETOOTH_ERROR_NONE)
2978 printf("bluetooth_get_bonded_device failed with [%d]",ret);
2982 printf("Name [%s]\n", devinfo.device_name.name);
2983 printf("Major Class [%d]\n", devinfo.device_class.major_class);
2984 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
2985 printf("Service Class [%d]\n", devinfo.device_class.service_class);
2986 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
2987 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
2988 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
2989 devinfo.device_address.addr[5]);
2998 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2999 bluetooth_device_info_t *dev_info);
3002 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3003 * @brief set alias for bonded device
3006 * This function set alias for bonded device.
3008 * This function is a synchronous call.
3011 * @return BLUETOOTH_ERROR_NONE - Success \n
3012 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3013 * @param[in] device_address This indicates an address of the remote device
3014 * @param[in] alias This indicates an alias to set
3019 ret = bluetooth_set_alias(&remote_address);
3022 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3026 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3027 * @brief Get remote deivice
3030 * This function gets specific remote device.
3032 * This function is a asynchronous call.
3033 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3036 * @return BLUETOOTH_ERROR_NONE - Success \n
3037 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3038 * @param[in] device_address This indicates an address of the remote device
3043 ret = bluetooth_get_remote_device(&remote_address);
3046 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3049 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3050 * gboolean authorized)
3051 * @brief Authorize/Unauthorize a bonded device
3054 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3055 * with/without user confirmation.
3057 * If we select a paired device and make it authorized by calling this API with the authorized
3058 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3059 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3060 * then it will ask for the user conformation before the connection.
3062 * This API supposed to be called on the paired devices. Which means we have to use this API only
3063 * after successful pairing.
3065 * This function is a asynchronous call.
3066 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3068 * @return BLUETOOTH_ERROR_NONE - Success \n
3069 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3070 * @param[in] device_address This indicates an address of the device to authorize \n
3071 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3073 * @see bluetooth_get_bonded_device_list
3075 void bt_event_callback(int event, bluetooth_event_param_t *param)
3079 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3081 if (param->result == BLUETOOTH_ERROR_NONE)
3085 //device authorization failed failure
3093 bluetooth_device_address_t device_address={{0}};
3094 gboolean authorized;
3098 ret = bluetooth_authorize_device(&device_address,authorized);
3101 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3102 gboolean authorized);
3104 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3105 const bluetooth_device_pin_code_t *pin_code);
3107 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3110 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3112 * @brief Receives Legacy Passkey\pin with following authentication response types
3114 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3115 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3118 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3121 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3123 * @brief This API sends user confirmation reply to the local adapter.
3125 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3128 int bluetooth_passkey_confirmation_reply(gboolean reply);
3131 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3132 * @brief Get all services supported by remote device
3135 * This API call initiates the search for the services supported by the specified device. Normally
3136 * the service search will take a couple of seconds to get it completed. Before calling this API
3137 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3138 * perform the service search. We can get the device address by doing a device discovery operation.
3141 * This function is a asynchronous call.
3142 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3144 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3145 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3146 * event is generated with appropriate result code.
3148 * @return BLUETOOTH_ERROR_NONE - Success \n
3149 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3150 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3151 * @param[in] device_address This indicates an address of the device
3152 * whose services need to be found
3154 * @see bluetooth_cancel_service_search
3156 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3159 * @fn int bluetooth_cancel_service_search(void)
3160 * @brief Cancel the ongoing service search operation
3163 * This function cancel the ongoing service search operation. This API is usually calling after the
3164 * bluetooth_search_service API.
3165 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3166 * if the user wish to cancel the Ongoing service search operation.
3168 * This API should be called just after the bluetooth_search_service API and before the
3169 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3171 * This function is a synchronous call.
3173 * @return BLUETOOTH_ERROR_NONE - Success \n
3174 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3175 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3176 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3179 * @see bluetooth_search_service
3184 ret = bluetooth_cancel_service_search();
3187 int bluetooth_cancel_service_search(void);
3190 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3191 * @brief Register rfcomm socket with a specific uuid
3194 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3195 * descriptor of the server.
3196 * This is the first API which is called to create the server. Once we created the server socket,
3197 * we will listen on that return socket.
3198 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3201 * @return socket FD on Success \n
3202 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3203 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3204 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3205 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3206 * @param[in] UUID (128 bits)
3209 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3213 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3214 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3218 int bluetooth_rfcomm_create_socket(const char *uuid);
3221 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3222 * @brief Register rfcomm socket with a specific uuid
3225 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3226 * descriptor of the server.
3227 * This is the first API which is called to create the server. Once we created the server socket,
3228 * we will listen on that return socket.
3229 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3232 * @return socket FD on Success \n
3233 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3234 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3235 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3236 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3237 * @param[in] UUID (128 bits)
3238 * @param[in] bus_name (const char)
3239 * @param[in] path (const char)
3242 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3246 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3247 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3251 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3254 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3255 * @brief De-register the rfcomm socket
3258 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3259 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3260 * descriptor else no event will come. We will call this API only after the
3261 * bluetooth_rfcomm_listen_and_accept.
3262 * This is a synchronous call.
3264 * @return BLUETOOTH_ERROR_NONE - Success \n
3265 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3266 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3267 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3268 * @param[in] int socket_fd
3271 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3274 void bt_event_callback(int event, bluetooth_event_param_t *param)
3278 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3280 bluetooth_rfcomm_connection_t *discon_ind =
3281 (bluetooth_rfcomm_connection_t *)param->param_data;
3283 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3291 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3292 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3294 ret = bluetooth_rfcomm_remove_socket(fd);
3297 int bluetooth_rfcomm_remove_socket(int socket_fd);
3300 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3301 * @brief De-register the rfcomm socket
3304 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3305 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3306 * descriptor else no event will come. We will call this API only after the
3307 * bluetooth_rfcomm_listen_and_accept_ex.
3308 * This is a synchronous call.
3310 * @return BLUETOOTH_ERROR_NONE - Success \n
3311 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3312 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3313 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3314 * @param[in] UUID (128 bits)
3317 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3320 void bt_event_callback(int event, bluetooth_event_param_t *param)
3324 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3326 bluetooth_rfcomm_connection_t *discon_ind =
3327 (bluetooth_rfcomm_connection_t *)param->param_data;
3329 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3337 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3338 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3340 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3343 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3346 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3347 * @brief Disconnect rfcomm connection
3350 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3351 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3354 * @return BLUETOOTH_ERROR_NONE - Success \n
3355 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3356 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3357 * @param[in] int socket_fd the sending socket fd
3363 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3365 printf("Disconnection failed");
3367 printf("Disconnection Success");
3371 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3374 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3375 * @brief Rfcomm socket listen
3378 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3379 * after the bluetooth_rfcomm_create_socket API.
3380 * This API listen for the incomming connection and once it receives a connection, it will give
3381 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3382 * event to the application. This is an Asynchronous API call.
3385 * @return BLUETOOTH_ERROR_NONE - Success \n
3386 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3387 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3389 * @param[in] int socket_fd
3390 * @param[in] max pending connection.
3393 * @see bluetooth_rfcomm_create_socket
3396 void bt_event_callback(int event, bluetooth_event_param_t* param)
3400 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3402 bluetooth_rfcomm_connection_t *conn_ind =
3403 (bluetooth_rfcomm_connection_t *)param->param_data;
3405 printf("\nConnected from FD %d", conn_ind->socket_fd);
3413 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3414 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3418 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3421 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3422 * @brief Rfcomm socket listen
3425 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3426 * after the bluetooth_rfcomm_create_socket API.
3427 * This API listen for the incomming connection and once it receives a connection, it will give
3428 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3429 * event to the application. This is an Asynchronous API call.
3432 * @return BLUETOOTH_ERROR_NONE - Success \n
3433 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3434 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3436 * @param[in] int socket_fd
3437 * @param[in] max pending connection.
3442 * @see bluetooth_rfcomm_create_socket_ex
3445 void bt_event_callback(int event, bluetooth_event_param_t* param)
3449 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3451 bluetooth_rfcomm_connection_t *conn_ind =
3452 (bluetooth_rfcomm_connection_t *)param->param_data;
3454 printf("\nConnected from FD %d", conn_ind->socket_fd);
3462 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3463 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3468 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3471 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3472 * @brief Rfcomm socket listen
3475 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3476 * after the bluetooth_rfcomm_create_socket API.
3477 * This API listen for the incomming connection and once it receives a connection, it will give
3478 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3479 * event to the application. This is an Asynchronous API call.
3482 * @return BLUETOOTH_ERROR_NONE - Success \n
3483 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3484 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3486 * @param[in] int socket_fd
3487 * @param[in] max pending connection.
3490 * @see bluetooth_rfcomm_create_socket
3493 void bt_event_callback(int event, bluetooth_event_param_t* param)
3497 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3499 char *name = (char *)param->param_data;
3501 printf("\nConnected from %s", name);
3503 bluetooth_rfcomm_accept_connection();
3511 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3512 ret = bluetooth_rfcomm_listen(fd, 1);
3516 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3519 * @fn int bluetooth_rfcomm_accept_connection()
3520 * @brief Accepts the authorization request indicated by the event
3521 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3523 * This function is a synchronous call.
3525 * @return BLUETOOTH_ERROR_NONE - Success \n
3526 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3528 * @param[in] the socket fd of the server
3529 * @param[out] the socket fd of the client
3533 * @see bluetooth_rfcomm_reject_connection
3535 int bluetooth_rfcomm_accept_connection(int server_fd);
3538 * @fn int bluetooth_rfcomm_reject_connection()
3539 * @brief Rejects the authorization request indicated by the event
3540 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3542 * This function is a synchronous call.
3544 * @return BLUETOOTH_ERROR_NONE - Success \n
3545 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3547 * @param[in] the socket fd of the server
3551 * @see bluetooth_rfcomm_accept_connection
3553 int bluetooth_rfcomm_reject_connection(int server_fd);
3556 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3557 * @brief Informs whether rfcomm server uuid is available or not.
3559 * This function is a synchronous call.
3561 * @return TRUE - RFCOMM uuid is available \n
3562 * FALSE - RFCOMM uuid is not available \n
3564 * @param[in] uuid UUID string
3570 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3573 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3574 * const char *remote_uuid)
3575 * @brief Connect to the remote device rfcomm *
3577 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3578 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3579 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3580 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3581 * initiating a connection.
3583 * @return BLUETOOTH_ERROR_NONE - Success \n
3584 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3585 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3586 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3587 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3588 * @param[in] bluetooth_device_address_t remote bt_address
3589 * @param[in] char remote uuid
3591 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3595 void bt_event_callback(int event, bluetooth_event_param_t *param)
3599 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3601 if (param->result >= BLUETOOTH_ERROR_NONE)
3603 bt_sdp_info_t *bt_sdp_info=param->param_data;
3605 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3606 bt_sdp_info->device_addr.addr[0],
3607 bt_sdp_info->device_addr.addr[1],
3608 bt_sdp_info->device_addr.addr[2],
3609 bt_sdp_info->device_addr.addr[3],
3610 bt_sdp_info->device_addr.addr[4],
3611 bt_sdp_info->device_addr.addr[5]);
3613 printf("Supported service list:\n");
3614 for(i=0; i<bt_sdp_info->service_index; i++)
3616 bt_sdp_info->service_list_array[i]);
3619 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3620 //rfcomm_test_uuid);
3624 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3626 bluetooth_rfcomm_connection_t *conn_ind =
3627 (bluetooth_rfcomm_connection_t *)param->param_data;
3629 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
3630 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3631 "SERVER" : "CLIENT");
3636 bluetooth_device_address_t remote_address = {{0},};
3637 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3638 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
3639 ret = bluetooth_search_service(&remote_address);
3641 printf("Seach failed, Reason = %d", ret);
3643 printf("Search Success, Ret = %d", ret);
3645 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3647 printf("Connection failed, Reason = %d", ret);
3649 printf("Connection Success, Ret = %d", ret);
3653 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3654 const char *remote_uuid);
3657 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3658 * @brief Disconnect rfcomm connection
3661 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3662 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3665 * @return BLUETOOTH_ERROR_NONE - Success \n
3666 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3667 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3668 * @param[in] char remote bt_address
3671 * @see bluetooth_rfcomm_connect
3675 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3677 printf("Disconnection failed");
3679 printf("Disconnection Success");
3684 int bluetooth_rfcomm_disconnect(int socket_fd);
3687 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3688 * @brief Write to rfcomm connection
3691 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3692 * API is used to send the data for server and the client.
3694 * @return BLUETOOTH_ERROR_NONE - Success \n
3695 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3696 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3698 * @param[in] const char *buff Data buffer to send
3699 * @param[in] int length Length of the data
3702 * @see bluetooth_rfcomm_connect
3705 char *buff = "Test data 123456789"
3706 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
3708 printf("Send failed");
3710 printf("Send success");
3714 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
3717 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
3718 * @brief Informs whether rfcomm client is connected.
3720 * This function is a synchronous call.
3722 * @return TRUE - RFCOMM client is connected \n
3723 * FALSE - RFCOMM client is not connected \n
3729 gboolean bluetooth_rfcomm_is_client_connected(void);
3730 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3731 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3734 * @fn int bluetooth_network_activate_server(void)
3735 * @brief Activate the NAP (Network Access Point) service
3737 * This function is a asynchronous call.
3738 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
3740 * @return BLUETOOTH_ERROR_NONE - Success \n
3741 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3742 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3743 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3746 * @see bluetooth_network_deactivate_server
3749 int bluetooth_network_activate_server(void);
3752 * @fn int bluetooth_network_deactivate_server(void)
3753 * @brief Deactivate the NAP (Network Access Point) service
3755 * This function is a asynchronous call.
3756 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
3758 * @return BLUETOOTH_ERROR_NONE - Success \n
3759 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3760 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3761 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3764 * @see bluetooth_network_activate_server
3767 int bluetooth_network_deactivate_server(void);
3770 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3771 * bluetooth_network_role_t role,
3773 * @brief Connect the network server in the peer
3775 * This function is a asynchronous call.
3776 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3778 * @return BLUETOOTH_ERROR_NONE - Success \n
3779 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3780 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3781 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3784 * @param[in] device_address This indicates an address of the device with which the pairing
3785 * should be initiated
3786 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
3787 * need to use the third parameter.
3788 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
3789 * connect. UUID string
3791 * @see bluetooth_network_disconnect
3793 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3794 bluetooth_network_role_t role, char *custom_uuid);
3797 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
3798 * bluetooth_network_role_t role,
3799 * char *custom_uuid)
3800 * @brief Connect the network server in the peer
3802 * This function is a asynchronous call.
3803 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3805 * @return BLUETOOTH_ERROR_NONE - Success \n
3806 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3807 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3808 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3811 * @param[in] device_address This indicates an address of the device with which the pairing
3812 * should be initiated
3814 * @see bluetooth_network_connect
3816 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
3819 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
3820 * @brief Disconnect the device from the network
3822 * This function is an asynchronous call.
3823 * The network server disconnect request is responded by
3824 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
3826 * @return BLUETOOTH_ERROR_NONE - Success \n
3827 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3828 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3829 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3832 * @param[in] device_address This indicates an address of the connected client device
3834 * @see bluetooth_network_activate_server
3836 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
3841 * @fn int bluetooth_hdp_activate(unsigned short data_type,
3842 * bt_hdp_role_type_t role,
3843 * bt_hdp_qos_type_t channel_type,
3844 * char **app_handle)
3845 * @brief Activate the HDP service for a particular data type
3847 * This function is a synchronous call.
3849 * @return BLUETOOTH_ERROR_NONE - Success \n
3850 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3851 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3852 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3855 * @param[in] data_type The data type against corresponding service
3856 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
3857 * @param[in] channel_type The QOS type for the channel.
3858 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
3859 * For role = HDP_ROLE_SINK, the channel_type
3860 * should be HDP_QOS_ANY.
3861 * @param[out] app_handle The application handler against corresponding service
3863 * @see bluetooth_hdp_deactivate
3865 int bluetooth_hdp_activate(unsigned short data_type,
3866 bt_hdp_role_type_t role,
3867 bt_hdp_qos_type_t channel_type,
3870 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
3871 * @brief Deactivate the HDP service for a particular service using the handler
3873 * This function is a synchronous call.
3875 * @return BLUETOOTH_ERROR_NONE - Success \n
3876 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3877 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3878 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3881 * @param[in] app_handle The application handler against corresponding service
3883 * @see bluetooth_hdp_deactivate
3885 int bluetooth_hdp_deactivate(const char *app_handle);
3888 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
3889 * const char *buffer, unsigned int size)
3890 * @brief Send data to the remote HDP device
3892 * This function is a synchronous call.
3894 * @return BLUETOOTH_ERROR_NONE - Success \n
3895 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3896 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3897 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3898 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
3901 * @param[in] channel_id The channel id for the connection.
3902 * @param[in] buffer The pdu buffer.
3903 * @param[in] size Size of the buffer.
3905 * @see bluetooth_hdp_connect
3907 int bluetooth_hdp_send_data(unsigned int channel_id,
3908 const char *buffer, unsigned int size);
3910 * @fn int bluetooth_hdp_connect(const char *app_handle,
3911 * bt_hdp_qos_type_t channel_type,
3912 * const bluetooth_device_address_t *device_address)
3913 * @brief Connect to the remote device(Mainly used by source)
3915 * This function is a asynchronous call.
3916 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
3918 * @return BLUETOOTH_ERROR_NONE - Success \n
3919 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3920 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3921 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3922 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3925 * @param[in] app_handle The application handler against corresponding service
3926 * @param[in] channel_type The QOS type for the channel.
3927 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
3928 * @param[in] device_address The remote device Bd address.
3931 * @see bluetooth_hdp_disconnect
3933 int bluetooth_hdp_connect(const char *app_handle,
3934 bt_hdp_qos_type_t channel_type,
3935 const bluetooth_device_address_t *device_address);
3937 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
3938 * const bluetooth_device_address_t *device_address)
3939 * @brief Disconnect from the remote device(Mainly used by source)
3941 * This function is a asynchronous call.
3942 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
3944 * @return BLUETOOTH_ERROR_NONE - Success \n
3945 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3946 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3947 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3948 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3951 * @param[in] channel_id The channel id for the connection.
3952 * @param[in] device_address The remote device Bd address.
3955 * @see bluetooth_hdp_connect
3957 int bluetooth_hdp_disconnect(unsigned int channel_id,
3958 const bluetooth_device_address_t *device_address);
3962 * @fn int bluetooth_opc_init(void)
3963 * @brief Initialize OPP client.
3965 * This function is a synchronous call.
3966 * No event corresponding to this api
3968 * @return BLUETOOTH_ERROR_NONE - Success \n
3969 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3970 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3971 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3972 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3977 * @see bluetooth_opc_deinit
3979 int bluetooth_opc_init(void);
3982 * @fn int bluetooth_opc_deinit(void)
3983 * @brief Deinitialize OPP client.
3985 * This function is a synchronous call.
3986 * No event corresponding to this api
3988 * @return BLUETOOTH_ERROR_NONE - Success \n
3989 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3990 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3995 * @see bluetooth_opc_init
3998 int bluetooth_opc_deinit(void);
4001 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4002 char **file_name_array)
4003 * @brief Send multiple files to a remote device.
4005 * This function is a asynchronous call.
4006 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4008 * @return BLUETOOTH_ERROR_NONE - Success \n
4009 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4010 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4011 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4012 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4013 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4014 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4017 * @param[in] device_address The remote device Bd address.
4018 * @param[in] file_name_array Array of filepaths to be sent.
4021 * @see bluetooth_opc_cancel_push
4024 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4025 char **file_name_array);
4028 * @fn int bluetooth_opc_cancel_push(void)
4029 * @brief Cancels the ongoing file push.
4031 * This function is a asynchronous call.
4032 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4033 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4035 * @return BLUETOOTH_ERROR_NONE - Success \n
4036 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4037 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4042 * @see bluetooth_opc_push_files
4045 int bluetooth_opc_cancel_push(void);
4048 * @fn gboolean bluetooth_opc_session_is_exist(void)
4049 * @brief Informs whether opc session exists or not.
4051 * This function is a synchronous call.
4053 * @return TRUE - OPC session exists \n
4054 * FALSE - OPC session does not exist \n
4062 gboolean bluetooth_opc_session_is_exist(void);
4065 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4066 * @brief Informs whether opc session exists or not.
4068 * This function is a synchronous call.
4070 * @return BLUETOOTH_ERROR_NONE - Success \n
4071 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4072 * BLUETOOTH_ERROR_INTERNAL \n
4075 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4080 int bluetooth_opc_is_sending(gboolean *is_sending);
4083 * @fn int bluetooth_obex_server_init(const char *dst_path)
4084 * @brief Initialize OPP and FTP server.
4086 * This function is a synchronous call.
4087 * No event corresponding to this api
4089 * @return BLUETOOTH_ERROR_NONE - Success \n
4090 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4091 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4092 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4093 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4096 * @param[in] dst_path OPS destination file path.
4098 * @see bluetooth_obex_server_deinit
4100 int bluetooth_obex_server_init(const char *dst_path);
4104 * @fn int bluetooth_obex_server_deinit(void)
4105 * @brief Deinitialize OPP and FTP server.
4107 * This function is a synchronous call.
4108 * No event corresponding to this api
4110 * @return BLUETOOTH_ERROR_NONE - Success \n
4111 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4112 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4117 * @see bluetooth_obex_server_init
4119 int bluetooth_obex_server_deinit(void);
4123 * @fn gboolean bluetooth_obex_server_is_activated(void)
4124 * @brief Informs whether obex server is activated or not.
4126 * This function is a synchronous call.
4128 * @return TRUE - OBEX server is activated \n
4129 * FALSE - OBEX server is not activated \n
4136 gboolean bluetooth_obex_server_is_activated(void);
4140 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4141 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4143 * This function is a synchronous call.
4144 * No event corresponding to this api
4146 * @return BLUETOOTH_ERROR_NONE - Success \n
4147 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4148 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4149 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4150 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4154 * @param[in] dst_path OPS destination file path.
4156 * @see bluetooth_obex_server_deinit_without_agent
4158 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4162 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4163 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4165 * This function is a synchronous call.
4166 * No event corresponding to this api
4168 * @return BLUETOOTH_ERROR_NONE - Success \n
4169 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4170 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4175 * @see bluetooth_obex_server_init_without_agent
4177 int bluetooth_obex_server_deinit_without_agent(void);
4181 * @fn int bluetooth_obex_server_accept_connection(void)
4182 * @brief Accepts the authorization request indicated by the event
4183 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4185 * This function is a synchronous call.
4187 * @return BLUETOOTH_ERROR_NONE - Success \n
4188 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4189 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4193 * @see bluetooth_obex_server_reject_authorize
4195 int bluetooth_obex_server_accept_connection(void);
4199 * @fn int bluetooth_obex_server_reject_connection(void)
4200 * @brief Rejects the authorization request indicated by the event
4201 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4203 * This function is a synchronous call.
4205 * @return BLUETOOTH_ERROR_NONE - Success \n
4206 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4207 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4211 * @see bluetooth_obex_server_reject_authorize
4213 int bluetooth_obex_server_reject_connection(void);
4217 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4218 * @brief Accepts the authorization request indicated by the event
4219 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4221 * This function is a asynchronous call.
4222 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4224 * @return BLUETOOTH_ERROR_NONE - Success \n
4225 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4226 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4227 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4230 * @param[in] filename Authorized filename.
4233 * @see bluetooth_obex_server_reject_authorize
4236 int bluetooth_obex_server_accept_authorize(const char *filename);
4239 * @fn int bluetooth_obex_server_reject_authorize(void)
4240 * @brief Reject the authorization request indicated by the event
4241 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4243 * This function is a asynchronous call.
4244 * No event for this api..
4246 * @return BLUETOOTH_ERROR_NONE - Success \n
4247 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4248 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4253 * @see bluetooth_obex_server_accept_authorize
4256 int bluetooth_obex_server_reject_authorize(void);
4259 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4260 * @brief Set the OPS destination file path..
4262 * This function is a asynchronous call.
4263 * No event for this api..
4265 * @return BLUETOOTH_ERROR_NONE - Success \n
4266 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4267 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4268 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4271 * @param[in] dst_path OPS destination file path.
4277 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4280 * @fn int bluetooth_obex_server_set_root(const char *root)
4281 * @brief Set the FTS root folder..
4283 * This function is a asynchronous call.
4284 * No event for this api..
4286 * @return BLUETOOTH_ERROR_NONE - Success \n
4287 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4288 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4289 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4290 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4291 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4294 * @param[in] root FTS root folder.
4300 int bluetooth_obex_server_set_root(const char *root);
4303 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4304 * @brief Cancel the transfer on server
4306 * This function is an asynchronous call.
4307 * If the function call that cancels transfer is successful, the application would receive
4308 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4309 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4310 * the error code will be BLUETOOTH_ERROR_NONE
4312 * @return BLUETOOTH_ERROR_NONE - Success \n
4313 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4314 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4315 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4316 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4319 * @param[in] transfer_id transfer ID
4324 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4328 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4329 * @brief Cancel the transfer on server
4331 * This function is an asynchronous call.
4332 * If the function call that cancels transfer is successful, the application would receive
4333 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4334 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4335 * the error code will be BLUETOOTH_ERROR_NONE
4337 * @return BLUETOOTH_ERROR_NONE - Success \n
4338 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4339 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4340 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4341 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4348 int bluetooth_obex_server_cancel_all_transfers(void);
4352 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4353 * @brief Informs whether obex server is receiving or not.
4355 * This function is a synchronous call.
4357 * @return BLUETOOTH_ERROR_NONE - Success \n
4358 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4359 * BLUETOOTH_ERROR_INTERNAL \n
4362 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4367 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4371 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4372 * @brief Read the local Hash and Randmizer.
4374 * This function is a synchronous call.
4376 * @return BLUETOOTH_ERROR_NONE - Success \n
4377 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4381 * @param[out] local_oob_data - Pointer to the local OOB data
4387 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4391 * @fn int bluetooth_oob_add_remote_data(
4392 * const bluetooth_device_address_t *remote_device_address,
4393 * bt_oob_data_t *oob_data)
4394 * @brief Add/updated the remote device Hash and Randmizer.
4396 * This function is a synchronous call.
4397 * No event for this api..
4399 * @return BLUETOOTH_ERROR_NONE - Success \n
4400 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4403 * @param[in] remote_device_address - Remote device address
4404 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4410 int bluetooth_oob_add_remote_data(
4411 const bluetooth_device_address_t *remote_device_address,
4412 bt_oob_data_t *remote_oob_data);
4416 * @fn int bluetooth_oob_remove_remote_data(
4417 * const bluetooth_device_address_t *remote_device_address)
4418 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4420 * This function is a synchronous call.
4421 * No event for this api..
4423 * @return BLUETOOTH_ERROR_NONE - Success \n
4424 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4427 * @param[in] remote_device_address - Remote device address
4433 int bluetooth_oob_remove_remote_data(
4434 const bluetooth_device_address_t *remote_device_address);
4437 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4438 * bt_gatt_handle_info_t *prim_svc);
4440 * @brief Gets the GATT based primary services handle supported by remote device
4442 * This function is a synchronous call.
4443 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4445 * @return BLUETOOTH_ERROR_NONE - Success \n
4446 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4447 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4448 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4451 * @param[in] address - Remote device address
4452 * @param[out] prim_svc - Structure containing remote service count and handle list.
4455 * @see bluetooth_gatt_free_primary_services()
4457 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4458 bt_gatt_handle_info_t *prim_svc);
4461 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4463 * @brief Discovers the characteristics of GATT based service of remote device
4465 * This function is an asynchronous call.
4466 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4468 * @return BLUETOOTH_ERROR_NONE - Success \n
4469 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4470 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4471 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4474 * @param[in] service_handle - Handle for remote service.
4479 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4482 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4483 * bt_gatt_service_property_t *service);
4485 * @brief Gets the properties of GATT based service of remote device
4487 * This function is a synchronous call.
4488 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4490 * @return BLUETOOTH_ERROR_NONE - Success \n
4491 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4492 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4493 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4496 * @param[in] service_handle - Handle for remote service.
4497 * @param[out] service - Structure containing remote service property.
4500 * @see bluetooth_gatt_free_service_property()
4502 int bluetooth_gatt_get_service_property(const char *service_handle,
4503 bt_gatt_service_property_t *service);
4506 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4508 * @brief Register to GATT based service to receive value change notification/indication.
4510 * This function is a synchronous call.
4511 * No event for this api.
4513 * @return BLUETOOTH_ERROR_NONE - Success \n
4514 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4515 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4516 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4519 * @param[in] service_handle - Handle for remote service.
4524 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4527 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4529 * @brief Unregister GATT based service to receive value change notification/indication.
4531 * This function is a synchronous call.
4532 * No event for this api.
4534 * @return BLUETOOTH_ERROR_NONE - Success \n
4535 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4536 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4537 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4540 * @param[in] service_handle - Handle for remote service.
4545 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4548 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4549 * bt_gatt_char_property_t *characteristic);
4551 * @brief Provides characteristic value along with properties.
4553 * This function is a synchronous call.
4554 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4556 * @return BLUETOOTH_ERROR_NONE - Success \n
4557 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4558 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4559 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4562 * @param[in] char_handle - Handle for Characteristic property.
4563 * @param[out] characteristic - Structure containing remote characteristic property.
4566 * @see bluetooth_gatt_free_char_property()
4568 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4569 bt_gatt_char_property_t *characteristic);
4572 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4573 * bt_gatt_char_property_t *characteristic);
4575 * @brief Provides characteristic descriptor value along with its UUID.
4577 * This function is a synchronous call.
4578 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4580 * @return BLUETOOTH_ERROR_NONE - Success \n
4581 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4582 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4583 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4586 * @param[in] desc_handle - Handle for Characteristic descriptor.
4587 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4590 * @see bluetooth_gatt_free_desc_property()
4592 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4593 bt_gatt_char_descriptor_property_t *descriptor);
4597 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4598 * const guint8 *value, int length)
4600 * @brief Set characteristic value.
4602 * This function is a synchronous call.
4604 * @return BLUETOOTH_ERROR_NONE - Success \n
4605 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4606 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4607 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4610 * @param[in] char_handle - Handle for Characteristic property.
4611 * @param[in] value - New value to set for characteristic property.
4612 * @param[in] length - Length of the value to be set.
4617 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4618 const guint8 *value, int length);
4621 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4622 * const guint8 *value, int length, guint8 write_type)
4624 * @brief Set characteristic value by write type.
4626 * This function is a synchronous call if write type is "write without resonse"
4627 * and it is an asynchronous call if write type is "write with response"
4629 * @return BLUETOOTH_ERROR_NONE - Success \n
4630 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4631 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4632 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4635 * @param[in] char_handle - Handle for Characteristic property.
4636 * @param[in] value - New value to set for characteristic property.
4637 * @param[in] length - Length of the value to be set.
4638 * @param[in] write_type - Type of write.
4643 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4644 const guint8 *value, int length, guint8 write_type);
4648 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4649 * const guint8 *value, int length)
4651 * @brief Set characteristic value request.
4653 * This function is an asynchronous call.
4655 * @return BLUETOOTH_ERROR_NONE - Success \n
4656 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4657 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4658 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4661 * @param[in] char_handle - Handle for Characteristic property.
4662 * @param[in] value - New value to set for characteristic property.
4663 * @param[in] length - Length of the value to be set.
4668 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4669 const guint8 *value, int length);
4672 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4674 * @brief Read characteristic value.
4676 * This function is a asynchronous call.
4678 * @return BLUETOOTH_ERROR_NONE - Success \n
4679 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4680 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4681 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4684 * @param[in] char_handle - Handle for Characteristic property.
4689 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
4692 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4693 * const char *service_uuid,
4694 * bt_gatt_service_property_t *service)
4696 * @brief Gets the service property from a device based on a particular uuid
4698 * This function is a synchronous call.
4700 * @return BLUETOOTH_ERROR_NONE - Success \n
4701 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4702 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4703 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4706 * @param[in] address - BD address of the remote device
4707 * @param[in] service_uuid - uuid of the service.
4708 * @param[out] service - Structure containing the service property.
4713 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4714 const char *service_uuid,
4715 bt_gatt_service_property_t *service);
4718 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4719 * const char *char_uuid)
4721 * @brief Gets the characteristic property from a service based on a particular char uuid
4723 * This function is an asynchronous call.
4724 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
4726 * @return BLUETOOTH_ERROR_NONE - Success \n
4727 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4728 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4729 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4732 * @param[in] service_handle - Service handle.
4733 * @param[in] uuid - Characteristic uuid.
4738 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4739 const char *char_uuid);
4742 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4744 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
4746 * This function is a synchronous call.
4747 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
4749 * @return BLUETOOTH_ERROR_NONE - Success \n
4750 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4753 * @param[in] prim_svc - GATT handle info structure
4756 * @see bluetooth_gatt_get_primary_services()
4758 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4761 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4763 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
4765 * This function is a synchronous call.
4766 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
4768 * @return BLUETOOTH_ERROR_NONE - Success \n
4769 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4772 * @param[in] svc_pty - GATT service property structure.
4775 * @see bluetooth_gatt_get_service_property()
4777 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4780 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4782 * @brief Provides characteristic value along with properties.
4784 * This function is a synchronous call.
4785 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4787 * @return BLUETOOTH_ERROR_NONE - Success \n
4788 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4791 * @param[in] char_pty - GATT characteristics property structure.
4794 * @see bluetooth_gatt_get_characteristics_property()
4796 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4799 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4801 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
4803 * This function is a synchronous call.
4804 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
4806 * @return BLUETOOTH_ERROR_NONE - Success \n
4807 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4810 * @param[in] desc_pty - GATT characteristics descriptor property structure.
4813 * @see bluetooth_gatt_get_char_descriptor_property()
4815 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4818 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
4820 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
4823 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4825 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
4827 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4829 * @return BLUETOOTH_ERROR_NONE - Success \n
4830 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4833 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
4837 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4840 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
4842 * @brief Read characteristic descriptor value.
4844 * This function is a asynchronous call.
4846 * @return BLUETOOTH_ERROR_NONE - Success \n
4847 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4848 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4849 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4852 * @param[in] desc_handle - Handle for Characteristic descriptor
4857 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
4860 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4861 * const guint8 *value, int length);
4863 * @brief Set characteristic descriptor value.
4865 * This function is a asynchronous call.
4867 * @return BLUETOOTH_ERROR_NONE - Success \n
4868 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4869 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4870 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4873 * @param[in] desc_handle - Handle for Characteristic descriptor
4874 * @param[in] value - New value to set for characteristic descriptor
4875 * @param[in] length - Length of the value to be set.
4880 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4881 const guint8 *value, int length);
4883 /* @fn int bluetooth_gatt_init(void)
4885 * @brief Initializes the gatt service.
4887 * This function is a synchronous call.
4888 * @return BLUETOOTH_ERROR_NONE - Success \n
4889 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4890 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4891 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4894 * @remark Adapter should be enabled
4895 * @see bluetooth_gatt_deinit()
4897 int bluetooth_gatt_init(void);
4899 /* @fn int bluetooth_gatt_init(void)
4901 * @brief DeInitializes the gatt service.
4903 * This function is a synchronous call.
4904 * @return BLUETOOTH_ERROR_NONE - Success \n
4905 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4906 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4907 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4910 * @remark Adapter should be enabled
4911 * @see bluetooth_gatt_init()
4913 int bluetooth_gatt_deinit(void);
4915 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
4916 unsigned char **svc_path)
4918 * @brief Exports a new gatt service to the service interface.
4920 * This function is a synchronous call.
4922 * @return BLUETOOTH_ERROR_NONE - Success \n
4923 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4924 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4925 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4928 * @param[in] svc_uuid Gatt service uuid.
4929 * @param[out] svc_path service object path of the exported service.
4930 * @remark Adapter should be enabled
4931 * @see bluetooth_gatt_init()
4933 int bluetooth_gatt_add_service(const char *svc_uuid,
4936 /* @fn int bluetooth_gatt_add_new_characteristic(
4937 const char *svc_path, const char *char_uuid,
4938 bt_gatt_characteristic_property_t *properties,
4939 int flags_length, char **char_path);;
4941 * @brief Exports a new gatt characteristic to the characteristic interface.
4943 * This function is a synchronous call.
4944 * @return BLUETOOTH_ERROR_NONE - Success \n
4945 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4946 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4947 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4949 * @param[in] svc_path service object path of the exported service.
4950 * @param[in] char_uuid Gatt service uuid.
4951 * @param[in] properties GATT characteristic properties.
4952 * @param[out] char_path characteristic object path of the exported characteristic.
4954 * @remark Adapter should be enabled
4955 * @see bluetooth_gatt_add_service()
4957 int bluetooth_gatt_add_new_characteristic(
4958 const char *svc_path, const char *char_uuid,
4959 bt_gatt_characteristic_property_t properties,
4962 /* @fn bluetooth_gatt_set_characteristic_value(
4963 const char *characteristic, const char *char_value,
4966 * @brief adds gatt charactertisic value to the given charactertistic path.
4968 * This function is a synchronous call.
4969 * @return BLUETOOTH_ERROR_NONE - Success \n
4970 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4971 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4972 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4974 * @param[in] char_value Value of the GATT characteristic to be added.
4975 * @param[in] value_length length of the chantacteristic value..
4976 * @param[out] characteristic characteristic object path..
4978 * @remark Adapter should be enabled
4979 * @see bluetooth_gatt_add_service()
4981 int bluetooth_gatt_set_characteristic_value(
4982 const char *characteristic, const char *char_value,
4985 /* @fn int bluetooth_gatt_add_descriptor(const char *desc_uuid,
4986 const char *desc_value, int value_length,
4987 const char *permissions, const char *char_path,
4990 * @brief Exports a new gatt descriptor to the descriptor interface.
4992 * This function is a synchronous call.
4994 * @return BLUETOOTH_ERROR_NONE - Success \n
4995 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4996 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4997 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5000 * @param[in] desc_uuid Gatt descriptor uuid.
5001 * @param[in] desc_value GATT descriptor value.
5002 * @param[in] value_length Length of GATT descriptor value.
5003 * @param[in] permissions descriptor permissions.
5004 * @param[in] char_path characteristics object path of the exported character.
5006 * @remark Adapter should be enabled
5007 * @see bluetooth_gatt_add_service()
5008 * @see bluetooth_gatt_add_characteristics()
5010 int bluetooth_gatt_add_descriptor(const char *char_path,
5011 const char *desc_uuid,
5014 /* @fn int bluetooth_gatt_set_descriptor_value(
5015 const char *desc_path, const char *desc_value,
5018 * @brief Adds value to the given descriptor handle.
5020 * This function is a synchronous call.
5022 * @return BLUETOOTH_ERROR_NONE - Success \n
5023 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5024 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5025 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5028 * @param[in] desc_value GATT descriptor value.
5029 * @param[in] value_length Length of GATT descriptor value.
5030 * @param[in] desc_path descriptor path to which the value needs to be added.
5032 * @remark Adapter should be enabled
5033 * @see bluetooth_gatt_add_service()
5034 * @see bluetooth_gatt_add_characteristics()
5036 int bluetooth_gatt_set_descriptor_value(
5037 const char *desc_path, const char *desc_value,
5040 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5042 * @brief Reads the Service registered on manager interface.
5044 * This function is a synchronous call.
5046 * @return BLUETOOTH_ERROR_NONE - Success \n
5047 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5048 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5049 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5052 * @param[in] svc_uuid Gatt Service uuid.
5054 * @remark Adapter should be enabled and service should be registered.
5055 * @see bluetooth_gatt_register_service()
5057 int bluetooth_gatt_get_service(const char *svc_uuid);
5059 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5061 * @brief Registers the given service path with the bluez gatt server.
5063 * This function is a synchronous call.
5065 * @return BLUETOOTH_ERROR_NONE - Success \n
5066 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5067 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5068 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5071 * @param[in] svc_path service object path of the exported service.
5073 * @remark Adapter should be enabled
5074 * @see bluetooth_gatt_add_service()
5075 * @see bluetooth_gatt_add_characteristics()
5076 * @see bluetooth_gatt_add_descriptor()
5078 int bluetooth_gatt_register_service(const char *svc_path);
5080 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5082 * @brief Removes(unregister) service from the bluez gatt server db.
5084 * This function is a synchronous call.
5086 * @return BLUETOOTH_ERROR_NONE - Success \n
5087 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5088 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5089 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5092 * @param[in] svc_path service object path of the exported service.
5094 * @remark Adapter should be enabled
5095 * @see bluetooth_gatt_add_service()
5096 * @see bluetooth_gatt_add_characteristics()
5097 * @see bluetooth_gatt_add_descriptor()
5098 * @see bluetooth_gatt_register_service()
5100 int bluetooth_gatt_unregister_service(const char *svc_path);
5102 /* @fn int bluetooth_gatt_send_response(int request_id,
5103 * int offset, char *value, int value_length)
5105 * @brief Updates the attribute value in local attribute list.
5107 * This function is a synchronous call.
5109 * @return BLUETOOTH_ERROR_NONE - Success \n
5110 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5111 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5112 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5115 * @param[in] request_id The identification of a read request
5116 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5117 * @param[in] resp_state The identification of response state
5118 * @param[in] offset The offset from where a value is read
5119 * @param[in] value The value to be sent. It will be sent from @a offset.
5120 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5121 * @param[in] value_length Value Length.
5123 * @remark Adapter should be enabled
5124 * @see bluetooth_gatt_add_service()
5125 * @see bluetooth_gatt_add_characteristics()
5126 * @see bluetooth_gatt_add_descriptor()
5127 * @see bluetooth_gatt_register_service()
5129 int bluetooth_gatt_send_response(int request_id, guint req_type,
5130 int resp_state, int offset, char *value, int value_length);
5132 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5134 * @brief Sets the notification property for a characteristic.
5136 * This function is a synchronous call.
5138 * @return BLUETOOTH_ERROR_NONE - Success \n
5139 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5140 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5141 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5144 * @param[in] char_path characteristic object path.
5145 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5147 * @remark Adapter should be enabled
5148 * @see bluetooth_gatt_update_characteristic()
5150 int bluetooth_gatt_server_set_notification(const char *char_path,
5151 bluetooth_device_address_t *unicast_address);
5153 /* @fn int bluetooth_gatt_delete_services(void)
5155 * @brief deletes (unregisters) all services from the gatt server database..
5157 * This function is a synchronous call.
5159 * @return BLUETOOTH_ERROR_NONE - Success \n
5160 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5161 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5162 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5166 * @remark Adapter should be enabled
5167 * @see bluetooth_gatt_add_service()
5168 * @see bluetooth_gatt_add_characteristics()
5169 * @see bluetooth_gatt_add_descriptor()
5170 * @see bluetooth_gatt_register_service()
5171 * @see bluetooth_gatt_unregister_service()
5173 int bluetooth_gatt_delete_services(void);
5175 /* @fn int bluetooth_gatt_update_characteristic(void)
5177 * @brief updates the given characteristic with a new value
5179 * This function is a synchronous call.
5181 * @return BLUETOOTH_ERROR_NONE - Success \n
5182 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5183 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5184 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5188 * @remark Adapter should be enabled
5189 * @see bluetooth_gatt_add_service()
5190 * @see bluetooth_gatt_add_characteristics()
5191 * @see bluetooth_gatt_add_descriptor()
5192 * @see bluetooth_gatt_register_service()
5193 * @see bluetooth_gatt_unregister_service()
5195 int bluetooth_gatt_update_characteristic(const char *char_path,
5196 const char* char_value, int value_length);
5199 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5201 * @brief Set advertising status.
5203 * This function is used to enable or disable LE advertising.
5204 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5206 * This function is a synchronous call.
5208 * @return BLUETOOTH_ERROR_NONE - Success \n
5209 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5210 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5213 * @param[in] enable - The status of advertising
5216 * @see bluetooth_set_advertising_data
5218 int bluetooth_set_advertising(int handle, gboolean enable);
5221 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5223 * @brief Set advertising status along with interval value.
5225 * This function is used to enable or disable LE advertising.
5226 * Interval_min and Interval_max is used to set the best advertising interval.
5227 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5229 * This function is a synchronous call.
5231 * @return BLUETOOTH_ERROR_NONE - Success \n
5232 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5233 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5236 * @param[in] enable - The status of advertising
5237 * @param[in] interval_min - Minimum interval of advertising (msec)
5238 * @param[in] interval_max - Maximum interval of advertising (msec)
5239 * @param[in] filter_policy - Advertising filter policy
5242 * @see bluetooth_set_advertising_data
5244 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5245 bluetooth_advertising_params_t *params);
5248 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5249 * @brief Get the advertising data
5251 * This function is used to get advertising data.
5252 * Before calling this API, the adapter should be enabled.
5254 * This function is a synchronous call.
5256 * @return BLUETOOTH_ERROR_NONE - Success \n
5257 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5258 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5259 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5261 * @param[out] value - Advertising data structure.
5262 * @param[out] length - The length of Advertising data.
5266 bluetooth_advertising_data_t *value = { {0} };
5269 ret = bluetooth_get_advertising_data(&value, &length);
5272 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5275 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5277 * @brief Set advertising data with value
5279 * This function is used to set advertising data and Maximum size of advertising data
5280 * is 28 byte (Except Flag)
5282 * This function is a synchronous call.
5284 * @return BLUETOOTH_ERROR_NONE - Success \n
5285 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5286 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5289 * @param[in] value - Advertising data structure.
5293 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5296 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5298 * @brief Check the privilege for advertising parameter setting
5300 * This function is a synchronous call.
5302 * @return BLUETOOTH_ERROR_NONE - Success \n
5303 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5309 int bluetooth_check_privilege_advertising_parameter(void);
5312 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5313 * @brief Get the LE scan response data
5315 * This function is used to get scan response data.
5316 * Before calling this API, the adapter should be enabled.
5318 * This function is a synchronous call.
5320 * @return BLUETOOTH_ERROR_NONE - Success \n
5321 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5322 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5323 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5325 * @param[out] value - Scan response data structure.
5326 * @param[out] length - The length of Scan response data.
5330 bluetooth_scan_resp_data_t *value = { {0} };
5333 ret = bluetooth_get_scan_response_data(&value, &length);
5336 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5339 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5341 * @brief Set scan response data with value
5343 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5345 * This function is a synchronous call.
5347 * @return BLUETOOTH_ERROR_NONE - Success \n
5348 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5349 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5352 * @param[in] value - LE Scan response data structure.
5356 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5359 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5361 * @brief Set scan interval and window
5363 * This function is used to set LE scan interval and window size
5365 * This function is a synchronous call.
5367 * @return BLUETOOTH_ERROR_NONE - Success \n
5368 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5369 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5372 * @param[in] interval - Interval of LE scan (msec)
5373 * @param[in] window - Window size of LE scan (msec)
5377 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5380 * @fn int bluetooth_is_advertising(void)
5381 * @brief Check for the advertising is in-progress or not.
5383 * This API is used to check the current status of the advertising procedure.
5384 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5387 * This function checks whether the advertising is started or not.
5389 * This function is a synchronous call.
5391 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5393 * @return BLUETOOTH_ERROR_NONE - Success \n
5394 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5397 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5401 gboolean is_advertising = 0;
5403 ret = bluetooth_is_advertising(&is_advertising);
5406 int bluetooth_is_advertising(gboolean *is_advertising);
5409 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5410 * @brief Add LE device to white list
5412 * This API is used to add LE device to white list
5413 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5417 * This function is a synchronous call.
5419 * @param[in] address The address of remote device
5421 * @return BLUETOOTH_ERROR_NONE - Success \n
5422 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5425 * @see bluetooth_set_custom_advertising
5427 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5430 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5431 * @brief Remove LE device from white list
5433 * This API is used to remove LE device from white list
5434 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5438 * This function is a synchronous call.
5440 * @param[in] address The address of remote device
5442 * @return BLUETOOTH_ERROR_NONE - Success \n
5443 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5446 * @see bluetooth_set_custom_advertising
5448 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5451 * @fn int bluetooth_clear_white_list(void)
5452 * @brief Clear white list
5454 * This API is used to clear white list
5455 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5459 * This function is a synchronous call.
5461 * @param[in] address The address of remote device
5463 * @return BLUETOOTH_ERROR_NONE - Success \n
5464 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5467 * @see bluetooth_set_custom_advertising
5469 int bluetooth_clear_white_list(void);
5472 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5473 * const bluetooth_le_connection_param_t *parameters)
5474 * @brief update connection paramter of LE connection.
5476 * This function is a synchronous call.
5478 * @return BLUETOOTH_ERROR_NONE - Success \n
5479 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5482 * @param[in] address - remote device address value.
5483 * @param[in] parameters - new connection parameters.
5486 * @see bluetooth_bond_device
5488 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5489 const bluetooth_le_connection_param_t *parameters);
5493 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5495 * @brief Enable/Disable LE Privacy feature.
5497 * This function is used to enable or disable LE Privacy feature.
5498 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5500 * This function is a synchronous call.
5502 * @return BLUETOOTH_ERROR_NONE - Success \n
5503 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5504 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5507 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5511 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5514 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
5515 * bluetooth_le_connection_mode_t mode)
5516 * @brief update connection paramter of LE connection.
5518 * This function is a synchronous call.
5520 * @return BLUETOOTH_ERROR_NONE - Success \n
5521 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5522 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5525 * @param[in] address - remote device address value.
5526 * @param[in] mode - new connection mode.
5530 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
5531 bluetooth_le_connection_mode_t mode);
5534 * @fn int bluetooth_le_read_maximum_data_length()
5535 * @brief reads the maximum LE data length supported in the controller.
5537 * This function is a synchronous call.
5539 * @return BLUETOOTH_ERROR_NONE - Success \n
5540 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5546 int bluetooth_le_read_maximum_data_length(
5547 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
5549 * @fn int bluetooth_le_write_host_suggested_default_data_length()
5550 * @brief writes the host suggested values for the controllers max transmitted no of payload
5551 * octects to be used for new connections.
5553 * This function is a synchronous call.
5555 * @return BLUETOOTH_ERROR_NONE - Success \n
5556 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5562 int bluetooth_le_write_host_suggested_default_data_length(
5563 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
5565 int bluetooth_le_read_suggested_default_data_length(
5566 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
5568 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
5569 const unsigned int max_tx_octets, const unsigned int max_tx_time);
5571 int bluetooth_pbap_init(void);
5572 int bluetooth_pbap_deinit(void);
5573 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
5574 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
5575 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
5576 bt_pbap_folder_t *folder);
5577 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
5578 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
5579 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
5580 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
5581 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
5582 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
5583 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
5584 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
5587 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5589 * @brief Set manufacturer data with value
5591 * This function is used to set manufacturer data.
5593 * This function is a synchronous call.
5595 * @return BLUETOOTH_ERROR_NONE - Success \n
5596 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5597 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5600 * @param[in] value - Manufacturer data structure.
5604 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5611 #endif /* __cplusplus */
5612 #endif /* _BLUETOOTH_API_H_*/