2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef _BLUETOOTH_API_H_
19 #define _BLUETOOTH_API_H_
27 #endif /* __cplusplus */
30 * @defgroup BLUETOOTHFW BluetoothFW
32 * A base library for bluetooth framework
34 * @addtogroup BLUETOOTHFW
38 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
39 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
40 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
41 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
42 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
43 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
44 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
45 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
47 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
48 a device can support */
50 #define BLUETOOTH_UUID_STRING_MAX 50
51 #define BLUETOOTH_PATH_STRING 50
53 #define BLUETOOTH_OOB_DATA_LENGTH 16
55 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
58 * This is Bluetooth Connected event role
60 #define RFCOMM_ROLE_SERVER 1
61 #define RFCOMM_ROLE_CLIENT 2
64 * This is RFCOMM default Channel Value
66 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
69 * This is maximum length for search value string for PBAP Phonebook Search
71 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
74 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
78 * This is Bluetooth error code
80 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
82 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
83 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
85 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
86 /**< Callback error */
87 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
88 /**< invalid paramerror */
89 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
90 /**< invalid data error */
91 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
92 /**< Memory allocation error */
93 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
94 /**< out of memory error */
95 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
97 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
98 /**< No resource error */
99 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
100 /**< internal error */
101 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
102 /**< Not supported error */
103 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
104 /**< Operation is failed because
105 of not enabled BT Adapter */
106 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
107 /**< Enabling is failed because of
108 already enabled BT Adapter */
109 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
110 /**< Operation is failed because of
111 other on going operation */
112 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
113 /**< access denied error */
114 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
115 /**< max client error */
116 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
117 /**< not found error */
118 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
119 /**< service search fail */
120 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
121 /**< pairing failed error */
122 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
123 /**< Not paired error */
124 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
125 /**< no service error */
126 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
127 /**< no connection error */
128 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
129 /**< alread connected error */
130 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
131 /**< connection busy error */
132 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
133 /**< connection error */
134 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
135 /**< max connection error*/
136 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
137 /**< Not in operation */
138 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
139 /**< Cancelled by user */
140 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
141 /**< Service record registration failed */
142 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
143 /**< Operation in progress */
144 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
145 /**< authentication failed error when paring*/
146 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
147 /**< Remote host is down */
148 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
149 /**< End of device list */
151 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
152 /**< Obex agent already exists */
153 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
154 /**< Obex agent does not exist */
156 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
157 /**< Already initialized */
159 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
160 /**< Permission deined */
162 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
163 /**< Nap already done */
165 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
166 /**< Not initialized */
168 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x27)
169 /**< Device Policy Restricted */
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_PERMISSION_READ = 0x01,
346 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
347 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
348 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
349 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
350 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
351 } bt_gatt_permission_t;
355 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
356 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
357 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
358 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
359 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
360 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
361 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
362 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
363 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
364 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
365 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
366 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
367 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
368 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
369 }bt_gatt_characteristic_property_t;
372 * Remote device request types for attributes
375 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
376 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
377 } bluetooth_gatt_att_request_tyep_t;
380 * Advertising parameters
385 guint8 filter_policy;
387 } bluetooth_advertising_params_t;
393 int type; /**< passive 0, active 1 */
394 float interval; /**< LE scan interval */
395 float window; /**< LE scan window */
396 } bluetooth_le_scan_params_t;
402 guint16 interval_min;
403 guint16 interval_max;
406 } bluetooth_le_connection_param_t;
409 LE Read Maximum Data Length
412 guint16 max_tx_octets;
414 guint16 max_rx_octets;
416 } bluetooth_le_read_maximum_data_length_t;
419 LE Read Host suggested default Data Length
422 guint16 def_tx_octets;
424 } bluetooth_le_read_host_suggested_data_length_t;
427 * Samsung XSAT Vendor dependent command
432 } bluetooth_vendor_dep_at_cmd_t;
435 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
436 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
437 /**< Base ID for GAP Event */
438 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
439 /**< Base ID for SDP events */
440 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
441 /**< Base ID for RFCOMM events */
442 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
443 /**< Base ID for NETWORK events */
444 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
445 /**< Base ID for HDP events */
446 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
447 /**< Base ID for OPC events */
448 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
449 /**< Base ID for Obex Server events */
450 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
451 /**< Base ID for GATT events */
453 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
454 /**< Base ID for Audio events */
455 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
456 /**< Base ID for HID events */
457 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
458 /**< Base ID for Advertising events */
459 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
460 /**< Base ID for PBAP Client events */
461 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
462 /**< Base ID for AVRCP events */
463 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
464 /**< Base ID for IPSP events */
467 * Bluetooth event type
470 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
472 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
473 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
474 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
475 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
476 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
477 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
478 /**< Bluetooth event Discoverable timeout requested*/
479 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
480 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
481 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
482 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
483 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
484 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
485 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
486 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
487 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
488 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
489 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
490 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
491 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
492 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
493 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
494 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
495 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
496 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
497 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
498 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
499 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
501 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
502 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
503 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
505 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
506 /**< Bluetooth event serice search base id */
507 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
508 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
509 /**< RFCOMM data receive event */
510 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
511 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
513 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
515 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
516 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
518 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
520 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
521 /**< Bluetooth Network event */
522 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
523 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
524 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
525 /**< Network disconnected evnet in server */
527 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
528 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
530 BLUETOOTH_EVENT_HDP_CONNECTED
531 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
532 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
533 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
535 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
536 /* OPC Connected event */
537 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
538 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
539 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
540 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
542 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
543 /* Obex server authorize event*/
544 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
545 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
546 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
547 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
548 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
549 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
551 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
552 /**<Discovered GATT service characteristics event*/
553 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
554 /**<Remote GATT charateristic value changed event*/
555 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
556 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
557 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
558 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
559 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
560 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
561 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
562 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
563 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
564 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
565 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
566 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
567 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
569 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
570 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
571 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
572 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
573 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
574 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
575 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
576 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
577 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
578 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
579 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
580 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
581 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
582 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
583 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
584 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
585 BLUETOOTH_EVENT_HF_CONNECTED,
586 BLUETOOTH_EVENT_HF_DISCONNECTED,
587 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
588 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
589 BLUETOOTH_EVENT_HF_RING_INDICATOR,
590 BLUETOOTH_EVENT_HF_CALL_WAITING,
591 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
592 BLUETOOTH_EVENT_HF_CALL_STARTED,
593 BLUETOOTH_EVENT_HF_CALL_ENDED,
594 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
595 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
596 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
597 BLUETOOTH_EVENT_HF_CALL_STATUS,
598 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
599 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
600 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
601 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
603 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
604 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
605 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
606 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
607 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
609 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
610 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
611 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
612 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
613 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
614 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
615 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
616 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
618 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
619 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
620 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
621 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
622 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
623 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
624 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
626 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
627 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
628 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
629 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
630 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
631 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
632 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
633 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
634 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
636 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
637 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
638 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
639 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
640 } bluetooth_event_type_t;
643 * This bt_service_uuid_list_t enum indicates service uuid list .
644 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
648 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
649 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
650 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
651 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
652 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
653 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
654 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
655 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
656 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
657 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
658 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
659 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
661 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
662 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
663 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
664 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
665 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
666 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
667 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
668 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
669 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
670 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
671 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
672 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
673 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
674 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
676 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
677 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
678 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
679 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
680 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
681 /**<DIRECT PRINTING*/
682 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
683 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
684 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
685 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
686 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
687 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
688 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
689 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
690 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
691 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
692 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
693 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
694 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
695 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
696 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
697 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
698 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
699 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
700 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
701 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
702 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
703 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
704 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
705 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
706 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
707 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
708 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
709 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
710 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
711 } bluetooth_service_uuid_list_t;
714 * Service class part of class of device returned from device discovery
717 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
718 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
719 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
720 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
721 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
722 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
723 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
724 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
725 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
726 } bluetooth_device_service_class_t;
730 * Major device mask (For device discovery)
733 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
734 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
735 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
736 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
737 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
738 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
739 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
740 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
741 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
742 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
743 } bluetooth_device_major_mask_t;
747 * Major device class (part of Class of Device)
750 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
751 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
752 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
753 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
754 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
755 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
756 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
757 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
758 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
759 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
760 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
761 } bluetooth_device_major_class_t;
764 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
766 /* About Computer Major class */
767 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
769 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
770 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
771 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
772 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
773 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
775 /* About Phone Major class */
776 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
777 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
778 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
779 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
780 /**< voice gateway minor class */
781 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
783 /* About LAN/Network Access Point Major class */
784 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
785 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
786 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
787 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
788 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
789 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
790 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
791 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
793 /* About Audio/Video Major class */
794 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
795 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
797 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
798 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
799 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
800 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
801 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
802 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
803 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
804 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
805 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
806 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
807 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
808 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
809 /**< Video Display and Loud
810 Speaker minor class */
811 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
814 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
816 /* About Peripheral Major class */
817 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
818 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
819 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
820 /**< Combo Keyboard or pointing
823 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
824 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
825 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
826 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
827 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
828 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
829 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
830 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
831 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
833 /* About Imaging Major class */
834 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
835 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
836 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
837 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
839 /* About Wearable Major class */
840 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
841 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
842 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
843 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
844 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
846 /* About Toy Major class */
847 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
848 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
849 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
850 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
851 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
853 /* About Health Major class */
854 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
855 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
856 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
857 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
858 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
859 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
860 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
861 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
862 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
863 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
864 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
865 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
866 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
867 } bluetooth_device_minor_class_t;
870 * structure to hold the device information
873 bluetooth_device_major_class_t major_class; /**< major device class */
874 bluetooth_device_minor_class_t minor_class; /**< minor device class */
875 bluetooth_device_service_class_t service_class;
876 /**< service device class */
877 } bluetooth_device_class_t;
880 * Discovery Role types
883 DISCOVERY_ROLE_BREDR = 0x1,
885 DISCOVERY_ROLE_LE_BREDR
886 } bt_discovery_role_type_t;
889 * Connected state types
892 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
893 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
894 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
895 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
896 } bluetooth_connected_link_t;
902 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
903 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
904 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
905 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
906 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
907 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
908 } bluetooth_le_scan_filter_feature_t;
914 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
915 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
916 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
917 } bluetooth_le_connection_mode_t;
920 * structure to hold the device information
923 bluetooth_device_address_t device_address; /**< device address */
924 bluetooth_device_name_t device_name; /**< device name */
925 bluetooth_device_class_t device_class; /**< device class */
926 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
927 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
929 int rssi; /**< received strength signal*/
930 gboolean paired; /**< paired flag */
931 bluetooth_connected_link_t connected; /**< connected link type */
932 gboolean trust; /**< trust flag */
933 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
934 } bluetooth_device_info_t;
937 * structure to hold the LE device information
940 int data_len; /**< manafacturer specific data length */
941 bluetooth_advertising_data_t data; /**< manafacturer specific data */
942 } bluetooth_le_advertising_data_t;
945 bluetooth_device_address_t device_address; /**< device address */
946 int addr_type; /**< address type*/
947 int rssi; /**< received strength signal*/
948 bluetooth_le_advertising_data_t adv_ind_data;
949 bluetooth_le_advertising_data_t scan_resp_data;
950 } bluetooth_le_device_info_t;
954 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
955 bluetooth_device_address_t device_address; /**< device address */
956 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
957 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
958 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
959 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
960 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
961 bluetooth_le_advertising_data_t service_data; /**< service data */
962 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
963 int manufacturer_id; /**< manufacturer ID */
964 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
965 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
966 } bluetooth_le_scan_filter_t;
969 * structure to hold the paired device information
972 bluetooth_device_address_t device_address; /**< paired device address */
973 bluetooth_device_name_t device_name; /**< device name */
974 bluetooth_device_class_t device_class; /**< device class */
975 } bluetooth_paired_device_info_t;
978 * structure to hold the paired device information
981 bluetooth_device_address_t device_address;
982 /**< device address */
983 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
984 /**< network interface name */
985 } bluetooth_network_device_info_t;
988 * Authentication event types
992 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
993 BLUETOOTH_AUTH_PIN_REQUEST,
994 BLUETOOTH_AUTH_PASSKEY_REQUEST,
995 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
996 } bluetooth_auth_type_t;
999 * structure to hold the pincode/pass-key req informations
1002 bluetooth_device_address_t device_address; /**< remote device address */
1003 bluetooth_device_name_t device_name; /**< device name */
1004 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1005 } bluetooth_authentication_request_info_t;
1008 * Stucture to hold discovery option
1011 unsigned short max_response; /**< the number of maximum response */
1012 unsigned short discovery_duration;
1013 /**< duration of discovery (seconds) */
1014 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1015 classOfDevice variable */
1016 } bluetooth_discovery_option_t;
1019 * Stucture to hold event information
1022 int event; /**< event type */
1023 int result; /**< Success or error value */
1025 /**<parameter data pointer */
1027 } bluetooth_event_param_t;
1030 bluetooth_device_address_t device_addr;
1031 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1032 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1033 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1038 bluetooth_device_address_t device_addr;
1039 unsigned char addr_type;
1041 } bt_connection_info_t;
1044 * Stucture to rfcomm receive data
1049 /**< the socket fd */
1050 int buffer_size;/**< the length of the receive buffer */
1052 /**< the receive data buffer */
1053 } bluetooth_rfcomm_received_data_t;
1059 HTYPE_TRANS_HANDSHAKE,
1060 HTYPE_TRANS_HID_CONTROL,
1061 HTYPE_TRANS_GET_REPORT,
1062 HTYPE_TRANS_SET_REPORT,
1063 HTYPE_TRANS_GET_PROTOCOL,
1064 HTYPE_TRANS_SET_PROTOCOL,
1067 }bt_hid_header_type_t;
1073 PTYPE_DATA_RTYPE_INPUT,
1074 PTYPE_DATA_RTYPE_OUTPUT
1075 }bt_hid_param_type_t;
1078 * Stucture to hid receive data
1081 const char *address;
1082 bt_hid_header_type_t type;
1083 /**< Header type containing */
1084 bt_hid_param_type_t param;
1085 /**< Param type in header like INPUT Report or OutPut Report */
1086 int buffer_size;/**< the length of the receive buffer */
1088 /**< the receive data buffer */
1089 } bluetooth_hid_received_data_t;
1092 * Stucture to rfcomm connection
1096 int socket_fd; /**< the socket fd */
1097 int server_id; /* Server id */
1098 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1099 bluetooth_device_address_t device_addr;
1100 /**< device address */
1101 char uuid[BLUETOOTH_UUID_STRING_MAX];
1102 } bluetooth_rfcomm_connection_t;
1105 * Stucture to rfcomm disconnection
1109 /**< the socket fd */
1110 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1111 bluetooth_device_address_t device_addr;
1112 /**< device address */
1113 char uuid[BLUETOOTH_UUID_STRING_MAX];
1114 } bluetooth_rfcomm_disconnection_t;
1118 /**< the socket fd */
1119 bluetooth_device_address_t device_addr;
1120 /**< device address */
1121 } bluetooth_rfcomm_connection_request_t;
1125 /**< the socket fd */
1126 bluetooth_device_address_t device_addr;
1127 /**< device address */
1128 } bluetooth_hid_request_t;
1143 HDP_ROLE_SOURCE = 0x0,
1145 }bt_hdp_role_type_t;
1149 * Stucture to HDP connected
1152 const char *app_handle; /**< the application handle */
1153 unsigned int channel_id; /**< the channel id */
1154 bt_hdp_qos_type_t type; /**< the QOS type */
1155 bluetooth_device_address_t device_address; /**< the remote address */
1156 } bt_hdp_connected_t;
1159 * Stucture to HDP disconnected
1162 unsigned int channel_id; /**< the channel id */
1163 bluetooth_device_address_t device_address; /**< the remote address */
1164 } bt_hdp_disconnected_t;
1167 * Stucture to HDP data indication
1170 unsigned int channel_id; /**< the channel id */
1171 const char *buffer; /**< the RX data buffer */
1172 unsigned int size; /**< the RX data size */
1173 } bt_hdp_data_ind_t;
1176 * Stucture to OPP client transfer information
1182 }bt_opc_transfer_info_t;
1184 /* Obex Server transfer type */
1185 #define TRANSFER_PUT "PUT"
1186 #define TRANSFER_GET "GET"
1188 * Stucture to OPP/FTP Server authorize information
1193 } bt_obex_server_authorize_into_t;
1201 } bt_obex_server_type_t;
1204 * Stucture to OPP/FTP server transfer information
1212 unsigned long file_size;
1214 bt_obex_server_type_t server_type;
1215 } bt_obex_server_transfer_info_t;
1218 * Stucture to OOB data
1222 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1223 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1224 unsigned int hash_len;
1225 unsigned int randomizer_len;
1229 * Structure to GATT attribute handle data
1235 } bt_gatt_handle_info_t;
1238 * Structure to GATT Remote service data
1245 bt_gatt_handle_info_t include_handles;
1246 bt_gatt_handle_info_t char_handle;
1247 } bt_gatt_service_property_t;
1250 * Structure to GATT Remote characteristic data
1254 char *service_handle;
1255 bt_gatt_handle_info_t handle_info;
1256 } bt_gatt_discovered_char_t;
1259 * Structure to format of GATT Characteristic Value
1263 unsigned char format;
1264 unsigned char exponent;
1265 unsigned short unit;
1266 unsigned char name_space;
1267 unsigned short description;
1268 } bt_gatt_char_format_t;
1271 * Structure to GATT Characteristic property
1279 bt_gatt_char_format_t format;
1281 unsigned int val_len;
1282 unsigned int permission;
1283 char *representation;
1284 bt_gatt_handle_info_t char_desc_handle;
1285 } bt_gatt_char_property_t;
1288 * Structure to GATT Characteristic descriptor property
1295 unsigned int val_len;
1296 } bt_gatt_char_descriptor_property_t;
1299 * Structure to GATT Characteristic value
1306 } bt_gatt_char_value_t;
1309 * Structure to GATT Read Request
1313 char *service_handle;
1317 } bt_gatt_read_req_t;
1320 * Structure to GATT Value change
1324 char *service_handle;
1330 } bt_gatt_value_change_t;
1333 * Structure to GATT characteristc Notification change
1337 char *service_handle;
1338 gboolean att_notify;
1339 } bt_gatt_char_notify_change_t;
1342 * Structure to Indication confirmation
1346 char *service_handle;
1349 } bt_gatt_indicate_confirm_t;
1352 * Structure to RSSI Signal Strength Alert
1363 * Structure to RSSI Signal Strength
1373 * Structure for RSSI Enabled or Disabled
1379 gboolean rssi_enabled;
1380 } bt_rssi_enabled_t;
1383 * Structure for RSSI Threshold
1388 int in_range_threshold;
1390 } bt_rssi_threshold_t;
1393 * Structure for PBAP Folder Parameters
1396 unsigned char addressbook;
1397 unsigned char folder_type;
1401 * Structure for PBAP Pull application Parameters
1404 unsigned char format;
1405 unsigned char order;
1406 unsigned short offset;
1407 unsigned short maxlist;
1408 long long unsigned fields;
1409 } bt_pbap_pull_parameters_t;
1412 * Structure for PBAP List application Parameters
1415 unsigned char order;
1416 unsigned short offset;
1417 unsigned short maxlist;
1418 } bt_pbap_list_parameters_t;
1421 * Structure for PBAP Pull vCard application Parameters
1424 unsigned char format;
1425 long long unsigned fields;
1427 } bt_pbap_pull_vcard_parameters_t;
1430 * Structure for PBAP Search application Parameters
1433 unsigned char order;
1434 unsigned short offset;
1435 unsigned short maxlist;
1436 unsigned char search_attribute;
1437 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1438 } bt_pbap_search_parameters_t;
1441 * Structure for PBAP Connection Status
1444 bluetooth_device_address_t btaddr;
1446 } bt_pbap_connected_t;
1449 * Structure for PBAP Phonebook Size
1452 bluetooth_device_address_t btaddr;
1454 } bt_pbap_phonebook_size_t;
1457 * Structure for PBAP Phonebook Pull
1460 bluetooth_device_address_t btaddr;
1463 } bt_pbap_phonebook_pull_t;
1466 * Structure for PBAP vCard List
1469 bluetooth_device_address_t btaddr;
1473 } bt_pbap_vcard_list_t;
1476 * Structure for PBAP vCard Pull
1479 bluetooth_device_address_t btaddr;
1482 } bt_pbap_vcard_pull_t;
1485 * Structure for PBAP Phonebook search List
1488 bluetooth_device_address_t btaddr;
1492 } bt_pbap_phonebook_search_list_t;
1495 * Stucture to HF Call status information
1499 char *number; /*Phone Number */
1500 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1501 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1502 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1503 int idx; /*Call index/ID */
1504 } bt_hf_call_status_info_t;
1509 } bt_hf_call_list_s;
1512 * Structure for LE data length change params
1516 bluetooth_device_address_t device_address;
1517 guint16 max_tx_octets;
1518 guint16 max_tx_time;
1519 guint16 max_rx_octets;
1520 guint16 max_rx_time;
1521 } bt_le_data_length_params_t;
1525 * @brief DPM BT allowance state
1529 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1530 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1531 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1532 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1536 * @brief DPM API result
1540 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1541 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1542 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1543 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1544 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1545 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1549 * @brief DPM Policy status
1553 BLUETOOTH_DPM_STATUS_ERROR = -1,
1555 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1556 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1558 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1559 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1561 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1562 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1566 /* policy-group : BLUETOOTH */
1567 BLUETOOTH_DPM_POLICY_ALLOW,
1568 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1569 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1570 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1571 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1572 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1573 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1574 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1575 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1576 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1577 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1578 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1579 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1580 BLUETOOTH_DPM_POLICY_END,
1581 } bt_dpm_policy_cmd_t;
1584 struct bt_dpm_policy {
1590 typedef struct bt_dpm_policy bt_dpm_policy_t;
1593 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1594 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1595 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1596 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1597 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1598 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1599 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1600 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1601 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1602 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1603 BLUETOOTH_DPM_PROFILE_NONE,
1606 struct bt_dpm_profile_val {
1607 int value; /* tells whether the profile is enabled or disabled */
1609 typedef struct dpm_profile_val dpm_profile_state_t;
1612 * Structure to DPM device list
1616 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1617 } bt_dpm_device_list_t;
1620 * Structure to DPM uuid list
1624 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1625 } bt_dpm_uuids_list_t;
1628 * Callback pointer type
1630 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1633 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1634 * @brief Set the callback function pointer for bluetooth event
1637 * This API will register the callback function, when any response and event are received from
1638 * bluetooth framework. @n
1639 * this registered callback function will be get called with appropriate event and data structures.
1640 * This function is a synchronous call. An application developer can call
1641 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1642 * type. This registered function will receive events of bluetooth_event_type_t type along with
1646 * @param[in] callback_ptr A pointer to the callback function
1647 * @param[in] user_data A pointer to user data
1648 * @return BLUETOOTH_ERROR_NONE - Success
1652 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1654 GMainLoop *main_loop = (GMainLoop*) user_data;
1658 // Code for each event
1660 g_main_loop_quit(main_loop);
1667 GMainLoop *main_loop = NULL;
1669 main_loop = g_main_loop_new(NULL, FALSE);
1670 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1671 if (ret >= BLUETOOTH_ERROR_NONE)
1673 // bluetooth_register_callback returned Success
1677 // bluetooth_register_callback returned failiure
1679 g_main_loop_run(main_loop);
1683 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1686 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1687 * @brief Set the callback function pointer for bluetooth le event
1690 * This API will register the callback function, when any response and event are received from
1691 * bluetooth framework. @n
1692 * this registered callback function will be get called with appropriate event and data structures.
1693 * This function is a synchronous call. An application developer can call
1694 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1695 * type. This registered function will receive events of bluetooth_event_type_t type along with
1699 * @param[in] callback_ptr A pointer to the callback function
1700 * @param[in] user_data A pointer to user data
1701 * @return BLUETOOTH_ERROR_NONE - Success
1705 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1708 * @fn int bluetooth_le_unregister_callback(void)
1709 * @brief Set the callback function pointer for bluetooth le event
1712 * This API will register the callback function, when any response and event are received from
1713 * bluetooth framework. @n
1714 * this registered callback function will be get called with appropriate event and data structures.
1715 * This function is a synchronous call. An application developer can call
1716 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1717 * type. This registered function will receive events of bluetooth_event_type_t type along with
1722 * @return BLUETOOTH_ERROR_NONE - Success
1726 int bluetooth_le_unregister_callback(void);
1729 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1730 * @brief Set the callback function pointer for bluetooth event
1733 * This API will register the callback function, when any response and event are received from
1734 * bluetooth framework. @n
1735 * this registered callback function will be get called with appropriate event and data structures.
1736 * This function is a synchronous call. An application developer can call
1737 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1738 * type. This registered function will receive events of bluetooth_event_type_t type along with
1743 * @return BLUETOOTH_ERROR_NONE - Success
1747 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1749 GMainLoop *main_loop = (GMainLoop*) user_data;
1753 // Code for each event
1755 g_main_loop_quit(main_loop);
1762 GMainLoop *main_loop = NULL;
1764 main_loop = g_main_loop_new(NULL, FALSE);
1765 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1766 if (ret >= BLUETOOTH_ERROR_NONE)
1768 // bluetooth_register_callback returned Success
1772 // bluetooth_register_callback returned failiure
1774 ret = bluetooth_deregister_callback(void);
1775 g_main_loop_run(main_loop);
1779 int bluetooth_unregister_callback(void);
1782 * @fn int bluetooth_enable_adapter(void)
1783 * @brief Enable the Bluetooth H/W
1786 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1787 * send request to bluetooth chip for activation.
1788 * This function is typically called at startup or when Bluetooth services are required. This
1789 * function must be called before calling any other API of Bluetooth operations.
1791 * Before performing any operations like Device discover, service search etc.., the adapter must be
1794 * This function is a asynchronous call.
1795 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1796 * through registered callback function with appropriate result code
1797 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1798 * BLUETOOTH_ERROR_NONE - Success \n
1800 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1801 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1803 * @return BLUETOOTH_ERROR_NONE - Success\n
1804 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1805 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1806 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1807 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1809 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1811 void bt_event_callback(int event, bluetooth_event_param_t *param)
1815 case BLUETOOTH_EVENT_ENABLED:
1816 if (param->result == BLUETOOTH_ERROR_NONE)
1818 // Successfully Enabled
1831 ret = bluetooth_enable_adapter();
1835 int bluetooth_enable_adapter(void);
1838 * @fn int bluetooth_disable_adapter(void)
1839 * @brief Disable the Bluetooth H/W
1842 * This function disables Bluetooth protocol stack and hardware. This function is called when
1843 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1845 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1846 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1847 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1849 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1852 * This function is a asynchronous call.
1853 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1854 * through registered callback function.
1857 * @return BLUETOOTH_ERROR_NONE - Success\n
1858 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1859 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1860 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1862 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1864 void bt_event_callback(int event, bluetooth_event_param_t *param)
1868 case BLUETOOTH_EVENT_DISABLED:
1869 if (param->result == BLUETOOTH_ERROR_NONE)
1871 // Successfully disabled
1884 ret = bluetooth_disable_adapter();
1887 int bluetooth_disable_adapter(void);
1888 int bluetooth_recover_adapter(void);
1889 int bluetooth_check_adapter_le(void);
1890 int bluetooth_enable_adapter_le(void);
1892 int bluetooth_disable_adapter_le(void);
1895 * @fn int bluetooth_reset_adapter(void)
1896 * @brief Reset the Bluetooth H/W and values
1899 * This function resets Bluetooth protocol stack and hardware. This function is called when
1900 * an user want to initialize Bluetooth environment.
1902 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1905 * This function is a synchronous call.
1907 * @return BLUETOOTH_ERROR_NONE - Success\n
1908 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1910 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1915 ret = bluetooth_reset_adapter();
1918 int bluetooth_reset_adapter(void);
1921 * @fn int bluetooth_is_supported(void)
1922 * @brief Check if the bluetooth is supported or not by the current target
1924 * This API checks whether the bluetooth is supported or not.
1925 * This API only run by root permission.
1927 * This function is a synchronous call.
1929 * @return 0 - if bluetooth is not supported\n
1930 * 1 - if bluetooth is supported\n
1931 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
1936 ret = bluetooth_is_supported();
1939 int bluetooth_is_supported(void);
1943 * @fn int bluetooth_check_adapter(void)
1944 * @brief Check the current status of the Bluetooth adapter
1947 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
1948 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
1949 * bluetooth adapter.
1950 * This API get the adapter internal data structure and check current adapter status.
1952 * This function is a synchronous call.
1955 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
1956 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
1958 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
1962 ret = bluetooth_check_adapter();
1965 int bluetooth_check_adapter(void);
1968 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
1969 * @brief Get the local adapter bluetooth address
1972 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
1973 * the adapter should be enabled.
1974 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
1975 * contain Bluetooth address.
1976 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
1977 * friendly name for each device.
1978 * There is no event callback for this API.
1980 * This function is a synchronous call.
1983 * @return BLUETOOTH_ERROR_NONE - Succeess \n
1984 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
1985 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
1986 * @param[out] local_address a device address of local bluetooth adapter
1991 bluetooth_device_address_t local_address={0,};
1994 ret = bluetooth_get_local_address(&local_address);
1997 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2000 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2001 * @brief Get the hci version
2004 * This function is used to get the bluetooth hci version
2005 * Before calling this API make sure that the adapter is enabled.
2007 * This function is a synchronous call.
2010 * @return BLUETOOTH_ERROR_NONE - Success \n
2011 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2012 * @param[out] timeout remain visibility timeout value
2015 bluetooth_version_t *version;
2017 ret = bluetooth_get_local_version (&version);
2020 int bluetooth_get_local_version(bluetooth_version_t *version);
2023 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2024 * @brief Get the local device name
2027 * This function is used, get the local device name. Since its difficult to remember the Adapter
2028 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2029 * friendly name is retrived by the remote device and displaying.
2030 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2032 * This function is a synchronous call.
2035 * @return BLUETOOTH_ERROR_NONE - Success \n
2036 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2037 * @param[out] local_name a local device name
2041 bluetooth_device_name_t local_name={0,}
2043 ret = bluetooth_get_local_name (&local_name);
2046 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2049 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2050 * @brief Set the local device name
2053 * This function is used to set the local device name. This is a human friendly name whose
2054 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2056 * This function is a synchronous call.
2058 * @param[in] local_name bluetooth device name to set local device
2060 * @return BLUETOOTH_ERROR_NONE - Success \n
2061 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2062 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2063 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2064 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2065 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2070 bluetooth_device_name_t local_name={0,}
2072 ret = bluetooth_set_local_name (&local_name);
2075 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2079 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2080 * @brief Check if the uuid is used or not
2082 * This function is used to check if the uuid is used or not.
2084 * This function is a synchronous call.
2086 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2087 * @param[out] used if the uuid is used or not
2089 * @return BLUETOOTH_ERROR_NONE - Success \n
2090 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2091 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2092 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2097 gboolean used = FALSE;
2098 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2099 ret = bluetooth_is_service_used(uuid, &used);
2102 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2105 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2106 * @brief Check if the device is connected to the specific service
2108 * This function is used to check if if the device is connected to the specific service.
2110 * This function is a synchronous call.
2112 * @param[in] local_address a device address of remote bluetooth device
2113 * @param[in] type the service type
2114 * @param[out] is_connected if the device is connected or not
2116 * @return BLUETOOTH_ERROR_NONE - Success \n
2117 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2118 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2119 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2124 gboolean is_connected = FALSE;
2125 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2126 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2129 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2130 bluetooth_service_type_t type,
2131 gboolean *is_connected);
2134 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2135 * @brief Gets device's connected link type
2137 * This function is used to get device's connected link type
2139 * This function is a synchronous call.
2141 * @param[in] device_address a device address of remote bluetooth device
2142 * @param[out] connected_link a device's connected link type
2144 * @return BLUETOOTH_ERROR_NONE - Success \n
2145 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2146 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2147 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2152 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2153 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2154 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2157 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2158 bluetooth_connected_link_t *connected_link);
2161 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2162 * @brief Get the visibility mode
2165 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2166 * visibity mode, the property of the device is determined whether it can be discoverable, non
2167 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2169 * This function is a synchronous call.
2172 * @return BLUETOOTH_ERROR_NONE - Success \n
2173 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2174 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2175 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2176 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2177 * @param[out] discoverable_mode current bluetooth discoverable mode
2179 * @see bluetooth_set_discoverable_mode
2181 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2183 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2186 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2189 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2191 * @brief Set the visibility mode
2194 * This function is used to set the discoverable mode (Visibility option).
2196 * Many times user may want to keep his device discoverable so that when peer device is performing
2197 * device search, he/she can find user's device. Application programmer can keep the mode as
2198 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2199 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2200 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2201 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2203 * This function is a synchronous call.
2205 * @return BLUETOOTH_ERROR_NONE - Success \n
2206 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2208 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2209 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2211 * @see bluetooth_get_discoverable_mode
2215 bluetooth_discoverable_mode_t mode;
2217 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2218 ret = bluetooth_set_discoverable_mode (mode, 180);
2222 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2227 * @fn int bluetooth_get_timeout_value(int *timeout)
2228 * @brief Get the visibility timeout value
2231 * This function is used to get the visibility timeout
2232 * Before calling this API make sure that the adapter is enabled.
2234 * This function is a synchronous call.
2237 * @return BLUETOOTH_ERROR_NONE - Success \n
2238 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2239 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2240 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2241 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2242 * @param[out] timeout remain visibility timeout value
2244 * @see bluetooth_set_discoverable_mode
2248 ret = bluetooth_get_timeout_value (&timeout);
2251 int bluetooth_get_timeout_value(int *timeout);
2255 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2256 * unsigned int classOfDeviceMask)
2257 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2259 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2260 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2261 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2262 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2263 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2264 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2265 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2266 * please see bluetooth_device_info_t for more details.
2269 * This API provides searching options like max responses, discovery duration in seconds and class
2270 * of device mask to filter device search. some times there may be too many bluetooth devices in
2271 * vicinity of your device.in such scenario, application can request to reduce number of responces
2272 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2273 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2274 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2275 * application defined time. please note that discovery_duration should be mentioned in seconds.
2276 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2279 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2280 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2281 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2283 * This function is a asynchronous call.
2284 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2285 * through registered callback function.
2287 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2288 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2290 * The completion or cancellation of the discovery is indicated by an
2291 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2293 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2296 * @return BLUETOOTH_ERROR_NONE - Success \n
2297 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2298 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2299 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2300 agent is not running \n
2302 * @param[in] max_response define the maximum response of the number of founded devices
2304 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2305 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2306 (refer to class of device)
2308 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2311 void bt_event_callback(int event, bluetooth_event_param_t *param)
2315 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2317 bluetooth_device_info_t *device_info = NULL;
2318 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2320 device_info = (bluetooth_device_info_t *)param->param_data;
2321 memcpy(&searched_device, &device_info->device_address,
2322 sizeof(bluetooth_device_address_t));
2323 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2324 device_info->device_address.addr[0],
2325 device_info->device_address.addr[1],
2326 device_info->device_address.addr[2],
2327 device_info->device_address.addr[3],
2328 device_info->device_address.addr[4],
2329 device_info->device_address.addr[5]);
2332 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2334 bluetooth_device_info_t *device_info = NULL;
2335 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2337 device_info = (bluetooth_device_info_t *)param->param_data;
2338 memcpy(&searched_device, &device_info->device_address,
2339 sizeof(bluetooth_device_address_t));
2340 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2341 device_info->device_name.name,
2342 device_info->device_address.addr[0],
2343 device_info->device_address.addr[1],
2344 device_info->device_address.addr[2],
2345 device_info->device_address.addr[3],
2346 device_info->device_address.addr[4],
2347 device_info->device_address.addr[5]);
2351 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2352 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2357 unsigned short max_response;
2358 unsigned short discovery_duration;
2359 unsigned classOfDeviceMask;
2363 discovery_duration =0;
2364 classOfDeviceMask =0;
2366 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2371 int bluetooth_start_discovery(unsigned short max_response,
2372 unsigned short discovery_duration,
2373 unsigned int classOfDeviceMask);
2376 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2377 * unsigned short max_response,
2378 * unsigned short discovery_duration,
2379 * unsigned int classOfDeviceMask)
2380 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2382 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2383 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2384 * Please see bluetooth_start_discovery() for other parameters description.
2386 * This function is a asynchronous call.
2387 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2388 * through registered callback function.
2390 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2391 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2393 * The completion or cancellation of the discovery is indicated by an
2394 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2396 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2399 * @return BLUETOOTH_ERROR_NONE - Success \n
2400 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2401 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2402 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2403 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2404 agent is not running \n
2406 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2407 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2408 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2409 * @param[in] max_response define the maximum response of the number of founded devices
2411 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2412 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2413 (refer to class of device)
2415 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2418 unsigned short type;
2419 unsigned short max_response;
2420 unsigned short discovery_duration;
2421 unsigned classOfDeviceMask;
2426 discovery_duration =0;
2427 classOfDeviceMask =0;
2429 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2434 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2435 unsigned short max_response,
2436 unsigned short discovery_duration,
2437 unsigned int classOfDeviceMask);
2440 * @fn int bluetooth_cancel_discovery (void)
2441 * @brief Cancel the on-going device discovery operation
2444 * This function stops the on-going device discovery operation. This API has to be called after the
2445 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2446 * the bluetooth_start_discovery API
2448 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2449 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2450 * cancel the discover request once the user received the device to which he wish to connect.
2452 * This function is a asynchronous call.
2453 * If the call is success to cancel discovey then the application will receive
2454 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2455 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2456 * BLUETOOTH_ERROR_NONE
2459 * @return BLUETOOTH_ERROR_NONE - Success \n
2460 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2461 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2462 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2463 other application \n
2464 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2466 * @see bluetooth_start_discovery
2468 void bt_event_callback(int event, bluetooth_event_param_t *param)
2472 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2473 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2482 ret = bluetooth_cancel_discovery();
2485 int bluetooth_cancel_discovery(void);
2488 * @fn int bluetooth_start_le_discovery(void)
2489 * @brief Start the generic device discovery which finds the LE devices.
2491 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2492 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2493 * It try to find LE devices. Bluetooth device address and name are
2494 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2495 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2496 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2497 * please see bluetooth_device_info_t for more details.
2499 * This function is a asynchronous call.
2500 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2501 * through registered callback function.
2503 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2506 * The completion or cancellation of the discovery is indicated by an
2507 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2509 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2512 * @return BLUETOOTH_ERROR_NONE - Success \n
2513 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2514 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2515 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2516 agent is not running \n
2519 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2522 void bt_event_callback(int event, bluetooth_event_param_t *param)
2526 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2528 bluetooth_device_info_t *device_info = NULL;
2529 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2531 device_info = (bluetooth_device_info_t *)param->param_data;
2532 memcpy(&searched_device, &device_info->device_address,
2533 sizeof(bluetooth_device_address_t));
2534 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2535 device_info->device_address.addr[0],
2536 device_info->device_address.addr[1],
2537 device_info->device_address.addr[2],
2538 device_info->device_address.addr[3],
2539 device_info->device_address.addr[4],
2540 device_info->device_address.addr[5]);
2544 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2545 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2551 ret = bluetooth_start_discovery();
2556 int bluetooth_start_le_discovery(void);
2559 * @fn int bluetooth_stop_le_discovery (void)
2560 * @brief Cancel the on-going device LE discovery operation
2563 * This function stops the on-going device discovery operation. This API has to be called after the
2564 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2565 * the bluetooth_start_le_discovery API
2568 * This function is a asynchronous call.
2569 * If the call is success to cancel discovey then the application will receive
2570 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2571 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2572 * BLUETOOTH_ERROR_NONE
2575 * @return BLUETOOTH_ERROR_NONE - Success \n
2576 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2577 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2578 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2579 other application \n
2580 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2582 * @see bluetooth_start_discovery
2584 void bt_event_callback(int event, bluetooth_event_param_t *param)
2588 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2589 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2598 ret = bluetooth_stop_le_discovery();
2601 int bluetooth_stop_le_discovery(void);
2604 * @fn int bluetooth_is_discovering(void)
2605 * @brief Check for the device discovery is in-progress or not.
2607 * This API is used to check the current status of the Discovery operation.If discovery is in\
2608 * progress normally other operations are not allowed.
2609 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2610 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2611 * event before performing other operations. This API is used to get for the current discovery
2612 * operation status and using bluetooth_cancel_discovery()
2613 * we can cancell the ongoing discovery process.
2614 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2617 * This function checks whether the device discovery is started or not.
2619 * This function is a synchronous call.
2622 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2623 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2624 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2627 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2631 ret = bluetooth_is_discovering ();
2634 int bluetooth_is_discovering(void);
2637 * @fn int bluetooth_is_le_discovering(void)
2638 * @brief Check for the device LE discovery is in-progress or not.
2640 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2641 * progress normally other operations are not allowed.
2642 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2643 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2644 * event before performing other operations. This API is used to get for the current discovery
2645 * operation status and using bluetooth_stop_le_discovery()
2646 * we can cancell the ongoing LE discovery process.
2647 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2650 * This function checks whether the device LE discovery is started or not.
2652 * This function is a synchronous call.
2655 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2656 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2657 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2660 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2664 ret = bluetooth_is_le_discovering ();
2667 int bluetooth_is_le_discovering(void);
2670 * @fn int bluetooth_is_le_scanning(void)
2671 * @brief Check for the device LE scan is in-progress or not.
2673 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2674 * progress normally other operations are not allowed.
2676 * This function checks whether the device LE Scan is started or not.
2678 * This function is a synchronous call.
2680 * @return TRUE - LE Scan in progress \n
2681 * FALSE - LE Scan is not in progress \n
2686 gboolean is_le_scanning = 0;
2687 is_le_scanning = bluetooth_is_le_scanning ();
2690 gboolean bluetooth_is_le_scanning(void);
2693 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2694 * @brief Register scan filter.
2696 * This function registers the scan filter.
2698 * This function is a synchronous call.
2700 * @return BLUETOOTH_ERROR_NONE - Success \n
2702 * @param[in] filter scan filter to register
2703 * @param[out] slot_id the slot ID of scan filter
2707 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2710 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2711 * @brief Register scan filter.
2713 * This function unregisters the scan filter.
2715 * This function is a synchronous call.
2717 * @return BLUETOOTH_ERROR_NONE - Success \n
2719 * @param[in] slot_id the slot ID of scan filter
2723 int bluetooth_unregister_scan_filter(int slot_id);
2726 * @fn int bluetooth_unregister_all_scan_filters(void)
2727 * @brief Register scan filter.
2729 * This function usregisters all scan filters.
2731 * This function is a synchronous call.
2733 * @return BLUETOOTH_ERROR_NONE - Success \n
2737 int bluetooth_unregister_all_scan_filters(void);
2740 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2741 int link_type, bt_rssi_threshold_t rssi_threshold)
2742 * @brief Enable RSSI monitoring
2744 * This function enables RSSI monitoring and sets threshold for a connection
2746 * @return BLUETOOTH_ERROR_NONE - Success \n
2749 * @see bluetooth_get_rssi_strength
2751 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2752 int link_type, bt_rssi_threshold_t *rssi_threshold);
2755 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2756 * @brief Gets Raw RSSI signal Strength
2758 * This function gives the Raw RSSI signal strength for a connection.
2760 * @return BLUETOOTH_ERROR_NONE - Success \n
2763 * @see bluetooth_enable_rssi
2765 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2767 int bluetooth_set_connectable(gboolean is_connectable);
2769 int bluetooth_is_connectable(gboolean *is_connectable);
2772 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2773 * @brief Initiate a bonding process
2776 * This function initiates a bonding procedure with a peer device. The bonding procedure
2777 * enables authentication and optionally encryption on the Bluetooth link.
2779 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2780 * inititate the bonding request to the devices already in the paired list.
2782 * Usually we call this API after the device discovery.
2783 * This function is a asynchronous call.
2785 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2786 * mentioed result code
2787 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2788 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2789 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2790 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2791 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2793 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2794 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2797 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2800 * @return BLUETOOTH_ERROR_NONE - Success \n
2801 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2802 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2803 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2804 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2806 * @param[in] device_address This indicates an address of the device with which the pairing
2807 * should be initiated
2809 * @see bluetooth_cancel_bonding
2811 void bt_event_callback(int event, bluetooth_event_param_t *param)
2815 case BLUETOOTH_EVENT_BONDING_FINISHED:
2817 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2818 if (param->result >= BLUETOOTH_ERROR_NONE)
2820 bluetooth_device_info_t *device_info = NULL;
2821 device_info = (bluetooth_device_info_t *)param->param_data;
2822 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
2823 mjr[%#x] min[%#x] srv[%#x]",
2824 device_info->device_name.name,
2825 device_info->device_address.addr[0],
2826 device_info->device_address.addr[1],
2827 device_info->device_address.addr[2],
2828 device_info->device_address.addr[3],
2829 device_info->device_address.addr[4],
2830 device_info->device_address.addr[5],
2831 device_info->device_class.major_class,
2832 device_info->device_class.minor_class,
2833 device_info->device_class.service_class);
2847 bluetooth_device_address_t device_address={{0}};
2849 ret = bluetooth_bond_device(&device_address);
2853 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
2856 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2857 * bluetooth_conn_type_t conn_type)
2858 * @brief Initiate a bonding process
2861 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
2862 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
2864 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2865 * inititate the bonding request to the devices already in the paired list.
2867 * Usually we call this API after the device discovery.
2868 * This function is a asynchronous call.
2870 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2871 * mentioed result code
2872 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2873 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2874 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2875 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2876 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2878 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2879 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2882 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2885 * @return BLUETOOTH_ERROR_NONE - Success \n
2886 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2887 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2888 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2889 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2891 * @param[in] device_address This indicates an address of the device with which pairing
2892 * should be initiated
2893 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
2896 * @see bluetooth_cancel_bonding
2898 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2899 bluetooth_conn_type_t conn_type);
2902 * @fn int bluetooth_cancel_bonding(void)
2903 * @brief Cancel the on-going bonding process
2905 * This API is called to cancel the on-going bonding procedure. It should be called before the
2906 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
2907 * This API is useful when the remote device is not responding to the bond request or we wish to
2908 * cancel the bonding request. In this case we need not wait for the timeout to happen.
2910 * This function is a synchronous call.
2912 * @return BLUETOOTH_ERROR_NONE - Success \n
2913 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
2914 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2917 * @see bluetooth_bond_device
2923 ret = bluetooth_cancel_bonding();
2926 int bluetooth_cancel_bonding(void);
2929 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
2930 * @brief Remove bonding
2933 * To communicate with remote device over bluetooth link, user should bond with peer device.
2934 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
2935 * API is used to remove peer device from the list. Please note that after removing the device
2936 * from bonded device list, you cannot communication with peer device until bonding happens again.
2938 * User can call this function by passing bluetooth device address of any bonded device. Please note
2939 * that after successful return of this function, any bluetooth application running on your device
2940 * will not be able to communicate with unbonded device until bond operation happens again using
2941 * bluetooth_bond_device()
2944 * This function is a asynchronous call. The request to remove the specified device from the bonded
2945 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
2946 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
2947 * in case if there is a problem in locating given bluetooth device address in bonded devices list
2951 * @return BLUETOOTH_ERROR_NONE - Success \n
2952 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
2953 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2954 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2955 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2956 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2957 * agent is not running \n
2958 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
2961 * @param[in] device_address This indicates an address of the device to remove bonding
2965 * @see bluetooth_bond_device, bluetooth_cancel_bonding
2968 void bt_event_callback(int event, bluetooth_event_param_t *param)
2971 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
2972 bluetooth_device_address_t *dev_addr = NULL;
2974 if (param->result == BLUETOOTH_ERROR_NONE) {
2975 dev_addr = (bluetooth_device_address_t *)param->param_data;
2977 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2978 dev_addr->addr[0], dev_addr->addr[1]
2979 dev_addr->addr[2], dev_addr->addr[3]
2980 dev_addr->addr[4], dev_addr->addr[5]
2991 bluetooth_device_address_t *device_address;
2993 // copy valid device address in device_address
2995 ret = bluetooth_unbond_device(device_address);
2998 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3001 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3002 * @brief Get bonded(paired) device list
3005 * This API gets all bonded device list.
3006 * The devices in the bonded device list further can be used to perform the authorization by calling
3007 * bluetooth_authorize_device API.
3009 * This function is a synchronous call.
3010 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3011 * there is no valid information in the dev_list.
3012 * The len field in the dev_list represents the number of bonded devices. The data structure for
3013 * bonded device information is bluetooth_device_info_t.
3016 * @return BLUETOOTH_ERROR_NONE - Success \n
3017 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3019 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3021 void bt_get_bonded_devices(void)
3025 GPtrArray *devinfo = NULL;
3026 bluetooth_device_info_t *ptr;
3028 // allocate the g_pointer_array
3029 devinfo = g_ptr_array_new();
3031 ret = bluetooth_get_bonded_device_list(&devinfo);
3032 if (ret != BLUETOOTH_ERROR_NONE)
3034 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3038 printf("g pointer arrary count : [%d]", devinfo->len);
3039 for (i=0; i<devinfo->len; i++)
3041 ptr = g_ptr_array_index(devinfo, i);
3044 printf("Name [%s]\n", ptr->device_name.name);
3045 printf("Major Class [%d]\n", ptr->device_class.major_class);
3046 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3047 printf("Service Class [%d]\n", ptr->device_class.service_class);
3048 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3049 ptr->device_address.addr[0],
3050 ptr->device_address.addr[1], ptr->device_address.addr[2],
3051 ptr->device_address.addr[3],
3052 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3059 // free g_pointer_array
3060 g_ptr_array_free(devinfo, TRUE);
3065 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3068 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3069 * bluetooth_device_info_t *dev_info)
3070 * @brief Get a bonded(paired) device
3073 * This API gets a bonded device.
3075 * This function is a synchronous call.
3076 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3077 * there is no valid information in the dev_info.
3078 * The data structure for bonded device information is bluetooth_device_info_t.
3081 * @return BLUETOOTH_ERROR_NONE - Success \n
3082 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3084 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3086 void bt_get_bonded_device(void)
3090 bluetooth_device_info_t devinfo = {0};
3091 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3093 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3094 if (ret != BLUETOOTH_ERROR_NONE)
3096 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3100 printf("Name [%s]\n", devinfo.device_name.name);
3101 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3102 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3103 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3104 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3105 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3106 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3107 devinfo.device_address.addr[5]);
3116 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3117 bluetooth_device_info_t *dev_info);
3120 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3121 * @brief set alias for bonded device
3124 * This function set alias for bonded device.
3126 * This function is a synchronous call.
3129 * @return BLUETOOTH_ERROR_NONE - Success \n
3130 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3131 * @param[in] device_address This indicates an address of the remote device
3132 * @param[in] alias This indicates an alias to set
3137 ret = bluetooth_set_alias(&remote_address);
3140 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3144 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3145 * @brief Get remote deivice
3148 * This function gets specific remote device.
3150 * This function is a asynchronous call.
3151 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3154 * @return BLUETOOTH_ERROR_NONE - Success \n
3155 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3156 * @param[in] device_address This indicates an address of the remote device
3161 ret = bluetooth_get_remote_device(&remote_address);
3164 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3167 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3168 * gboolean authorized)
3169 * @brief Authorize/Unauthorize a bonded device
3172 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3173 * with/without user confirmation.
3175 * If we select a paired device and make it authorized by calling this API with the authorized
3176 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3177 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3178 * then it will ask for the user conformation before the connection.
3180 * This API supposed to be called on the paired devices. Which means we have to use this API only
3181 * after successful pairing.
3183 * This function is a asynchronous call.
3184 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3186 * @return BLUETOOTH_ERROR_NONE - Success \n
3187 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3188 * @param[in] device_address This indicates an address of the device to authorize \n
3189 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3191 * @see bluetooth_get_bonded_device_list
3193 void bt_event_callback(int event, bluetooth_event_param_t *param)
3197 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3199 if (param->result == BLUETOOTH_ERROR_NONE)
3203 //device authorization failed failure
3211 bluetooth_device_address_t device_address={{0}};
3212 gboolean authorized;
3216 ret = bluetooth_authorize_device(&device_address,authorized);
3219 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3220 gboolean authorized);
3222 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3223 const bluetooth_device_pin_code_t *pin_code);
3225 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3228 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3230 * @brief Receives Legacy Passkey\pin with following authentication response types
3232 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3233 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3236 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3239 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3241 * @brief This API sends user confirmation reply to the local adapter.
3243 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3246 int bluetooth_passkey_confirmation_reply(gboolean reply);
3249 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3250 * @brief Get all services supported by remote device
3253 * This API call initiates the search for the services supported by the specified device. Normally
3254 * the service search will take a couple of seconds to get it completed. Before calling this API
3255 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3256 * perform the service search. We can get the device address by doing a device discovery operation.
3259 * This function is a asynchronous call.
3260 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3262 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3263 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3264 * event is generated with appropriate result code.
3266 * @return BLUETOOTH_ERROR_NONE - Success \n
3267 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3268 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3269 * @param[in] device_address This indicates an address of the device
3270 * whose services need to be found
3272 * @see bluetooth_cancel_service_search
3274 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3277 * @fn int bluetooth_cancel_service_search(void)
3278 * @brief Cancel the ongoing service search operation
3281 * This function cancel the ongoing service search operation. This API is usually calling after the
3282 * bluetooth_search_service API.
3283 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3284 * if the user wish to cancel the Ongoing service search operation.
3286 * This API should be called just after the bluetooth_search_service API and before the
3287 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3289 * This function is a synchronous call.
3291 * @return BLUETOOTH_ERROR_NONE - Success \n
3292 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3293 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3294 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3297 * @see bluetooth_search_service
3302 ret = bluetooth_cancel_service_search();
3305 int bluetooth_cancel_service_search(void);
3308 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3309 * @brief Register rfcomm socket with a specific uuid
3312 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3313 * descriptor of the server.
3314 * This is the first API which is called to create the server. Once we created the server socket,
3315 * we will listen on that return socket.
3316 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3319 * @return socket FD on Success \n
3320 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3321 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3322 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3323 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3324 * @param[in] UUID (128 bits)
3327 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3331 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3332 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3336 int bluetooth_rfcomm_create_socket(const char *uuid);
3339 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3340 * @brief Register rfcomm socket with a specific uuid
3343 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3344 * descriptor of the server.
3345 * This is the first API which is called to create the server. Once we created the server socket,
3346 * we will listen on that return socket.
3347 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3350 * @return socket FD on Success \n
3351 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3352 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3353 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3354 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3355 * @param[in] UUID (128 bits)
3356 * @param[in] bus_name (const char)
3357 * @param[in] path (const char)
3360 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3364 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3365 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3369 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3372 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3373 * @brief De-register the rfcomm socket
3376 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3377 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3378 * descriptor else no event will come. We will call this API only after the
3379 * bluetooth_rfcomm_listen_and_accept.
3380 * This is a synchronous call.
3382 * @return BLUETOOTH_ERROR_NONE - Success \n
3383 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3384 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3385 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3386 * @param[in] int socket_fd
3389 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3392 void bt_event_callback(int event, bluetooth_event_param_t *param)
3396 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3398 bluetooth_rfcomm_connection_t *discon_ind =
3399 (bluetooth_rfcomm_connection_t *)param->param_data;
3401 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3409 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3410 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3412 ret = bluetooth_rfcomm_remove_socket(fd);
3415 int bluetooth_rfcomm_remove_socket(int socket_fd);
3418 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3419 * @brief De-register the rfcomm socket
3422 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3423 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3424 * descriptor else no event will come. We will call this API only after the
3425 * bluetooth_rfcomm_listen_and_accept_ex.
3426 * This is a synchronous call.
3428 * @return BLUETOOTH_ERROR_NONE - Success \n
3429 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3430 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3431 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3432 * @param[in] UUID (128 bits)
3435 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3438 void bt_event_callback(int event, bluetooth_event_param_t *param)
3442 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3444 bluetooth_rfcomm_connection_t *discon_ind =
3445 (bluetooth_rfcomm_connection_t *)param->param_data;
3447 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3455 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3456 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3458 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3461 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3464 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3465 * @brief Disconnect rfcomm connection
3468 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3469 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3472 * @return BLUETOOTH_ERROR_NONE - Success \n
3473 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3474 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3475 * @param[in] int socket_fd the sending socket fd
3481 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3483 printf("Disconnection failed");
3485 printf("Disconnection Success");
3489 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3492 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3493 * @brief Rfcomm socket listen
3496 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3497 * after the bluetooth_rfcomm_create_socket API.
3498 * This API listen for the incomming connection and once it receives a connection, it will give
3499 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3500 * event to the application. This is an Asynchronous API call.
3503 * @return BLUETOOTH_ERROR_NONE - Success \n
3504 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3505 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3507 * @param[in] int socket_fd
3508 * @param[in] max pending connection.
3511 * @see bluetooth_rfcomm_create_socket
3514 void bt_event_callback(int event, bluetooth_event_param_t* param)
3518 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3520 bluetooth_rfcomm_connection_t *conn_ind =
3521 (bluetooth_rfcomm_connection_t *)param->param_data;
3523 printf("\nConnected from FD %d", conn_ind->socket_fd);
3531 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3532 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3536 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3539 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3540 * @brief Rfcomm socket listen
3543 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3544 * after the bluetooth_rfcomm_create_socket API.
3545 * This API listen for the incomming connection and once it receives a connection, it will give
3546 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3547 * event to the application. This is an Asynchronous API call.
3550 * @return BLUETOOTH_ERROR_NONE - Success \n
3551 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3552 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3554 * @param[in] int socket_fd
3555 * @param[in] max pending connection.
3560 * @see bluetooth_rfcomm_create_socket_ex
3563 void bt_event_callback(int event, bluetooth_event_param_t* param)
3567 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3569 bluetooth_rfcomm_connection_t *conn_ind =
3570 (bluetooth_rfcomm_connection_t *)param->param_data;
3572 printf("\nConnected from FD %d", conn_ind->socket_fd);
3580 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3581 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3586 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3589 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3590 * @brief Rfcomm socket listen
3593 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3594 * after the bluetooth_rfcomm_create_socket API.
3595 * This API listen for the incomming connection and once it receives a connection, it will give
3596 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3597 * event to the application. This is an Asynchronous API call.
3600 * @return BLUETOOTH_ERROR_NONE - Success \n
3601 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3602 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3604 * @param[in] int socket_fd
3605 * @param[in] max pending connection.
3608 * @see bluetooth_rfcomm_create_socket
3611 void bt_event_callback(int event, bluetooth_event_param_t* param)
3615 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3617 char *name = (char *)param->param_data;
3619 printf("\nConnected from %s", name);
3621 bluetooth_rfcomm_accept_connection();
3629 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3630 ret = bluetooth_rfcomm_listen(fd, 1);
3634 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3637 * @fn int bluetooth_rfcomm_accept_connection()
3638 * @brief Accepts the authorization request indicated by the event
3639 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3641 * This function is a synchronous call.
3643 * @return BLUETOOTH_ERROR_NONE - Success \n
3644 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3646 * @param[in] the socket fd of the server
3647 * @param[out] the socket fd of the client
3651 * @see bluetooth_rfcomm_reject_connection
3653 int bluetooth_rfcomm_accept_connection(int server_fd);
3656 * @fn int bluetooth_rfcomm_reject_connection()
3657 * @brief Rejects the authorization request indicated by the event
3658 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3660 * This function is a synchronous call.
3662 * @return BLUETOOTH_ERROR_NONE - Success \n
3663 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3665 * @param[in] the socket fd of the server
3669 * @see bluetooth_rfcomm_accept_connection
3671 int bluetooth_rfcomm_reject_connection(int server_fd);
3674 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3675 * @brief Informs whether rfcomm server uuid is available or not.
3677 * This function is a synchronous call.
3679 * @return TRUE - RFCOMM uuid is available \n
3680 * FALSE - RFCOMM uuid is not available \n
3682 * @param[in] uuid UUID string
3688 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3691 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3692 * const char *remote_uuid)
3693 * @brief Connect to the remote device rfcomm *
3695 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3696 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3697 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3698 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3699 * initiating a connection.
3701 * @return BLUETOOTH_ERROR_NONE - Success \n
3702 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3703 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3704 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3705 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3706 * @param[in] bluetooth_device_address_t remote bt_address
3707 * @param[in] char remote uuid
3709 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3713 void bt_event_callback(int event, bluetooth_event_param_t *param)
3717 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3719 if (param->result >= BLUETOOTH_ERROR_NONE)
3721 bt_sdp_info_t *bt_sdp_info=param->param_data;
3723 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3724 bt_sdp_info->device_addr.addr[0],
3725 bt_sdp_info->device_addr.addr[1],
3726 bt_sdp_info->device_addr.addr[2],
3727 bt_sdp_info->device_addr.addr[3],
3728 bt_sdp_info->device_addr.addr[4],
3729 bt_sdp_info->device_addr.addr[5]);
3731 printf("Supported service list:\n");
3732 for(i=0; i<bt_sdp_info->service_index; i++)
3734 bt_sdp_info->service_list_array[i]);
3737 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3738 //rfcomm_test_uuid);
3742 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3744 bluetooth_rfcomm_connection_t *conn_ind =
3745 (bluetooth_rfcomm_connection_t *)param->param_data;
3747 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
3748 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3749 "SERVER" : "CLIENT");
3754 bluetooth_device_address_t remote_address = {{0},};
3755 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3756 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
3757 ret = bluetooth_search_service(&remote_address);
3759 printf("Seach failed, Reason = %d", ret);
3761 printf("Search Success, Ret = %d", ret);
3763 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3765 printf("Connection failed, Reason = %d", ret);
3767 printf("Connection Success, Ret = %d", ret);
3771 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3772 const char *remote_uuid);
3775 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3776 * @brief Disconnect rfcomm connection
3779 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3780 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3783 * @return BLUETOOTH_ERROR_NONE - Success \n
3784 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3785 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3786 * @param[in] char remote bt_address
3789 * @see bluetooth_rfcomm_connect
3793 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3795 printf("Disconnection failed");
3797 printf("Disconnection Success");
3802 int bluetooth_rfcomm_disconnect(int socket_fd);
3805 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3806 * @brief Write to rfcomm connection
3809 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3810 * API is used to send the data for server and the client.
3812 * @return BLUETOOTH_ERROR_NONE - Success \n
3813 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3814 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3816 * @param[in] const char *buff Data buffer to send
3817 * @param[in] int length Length of the data
3820 * @see bluetooth_rfcomm_connect
3823 char *buff = "Test data 123456789"
3824 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
3826 printf("Send failed");
3828 printf("Send success");
3832 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
3835 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
3836 * @brief Informs whether rfcomm client is connected.
3838 * This function is a synchronous call.
3840 * @return TRUE - RFCOMM client is connected \n
3841 * FALSE - RFCOMM client is not connected \n
3847 gboolean bluetooth_rfcomm_is_client_connected(void);
3848 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3849 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3852 * @fn int bluetooth_network_activate_server(void)
3853 * @brief Activate the NAP (Network Access Point) service
3855 * This function is a asynchronous call.
3856 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
3858 * @return BLUETOOTH_ERROR_NONE - Success \n
3859 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3860 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3861 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3864 * @see bluetooth_network_deactivate_server
3867 int bluetooth_network_activate_server(void);
3870 * @fn int bluetooth_network_deactivate_server(void)
3871 * @brief Deactivate the NAP (Network Access Point) service
3873 * This function is a asynchronous call.
3874 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
3876 * @return BLUETOOTH_ERROR_NONE - Success \n
3877 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3878 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3879 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3882 * @see bluetooth_network_activate_server
3885 int bluetooth_network_deactivate_server(void);
3888 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3889 * bluetooth_network_role_t role,
3891 * @brief Connect the network server in the peer
3893 * This function is a asynchronous call.
3894 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3896 * @return BLUETOOTH_ERROR_NONE - Success \n
3897 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3898 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3899 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3902 * @param[in] device_address This indicates an address of the device with which the pairing
3903 * should be initiated
3904 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
3905 * need to use the third parameter.
3906 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
3907 * connect. UUID string
3909 * @see bluetooth_network_disconnect
3911 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3912 bluetooth_network_role_t role, char *custom_uuid);
3915 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
3916 * bluetooth_network_role_t role,
3917 * char *custom_uuid)
3918 * @brief Connect the network server in the peer
3920 * This function is a asynchronous call.
3921 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3923 * @return BLUETOOTH_ERROR_NONE - Success \n
3924 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3925 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3926 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3929 * @param[in] device_address This indicates an address of the device with which the pairing
3930 * should be initiated
3932 * @see bluetooth_network_connect
3934 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
3937 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
3938 * @brief Disconnect the device from the network
3940 * This function is an asynchronous call.
3941 * The network server disconnect request is responded by
3942 * BLUETOOTH_EVENT_NETWORK_SERVER_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_DEVICE_NOT_ENABLED - Not enabled \n
3950 * @param[in] device_address This indicates an address of the connected client device
3952 * @see bluetooth_network_activate_server
3954 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
3959 * @fn int bluetooth_hdp_activate(unsigned short data_type,
3960 * bt_hdp_role_type_t role,
3961 * bt_hdp_qos_type_t channel_type,
3962 * char **app_handle)
3963 * @brief Activate the HDP service for a particular data type
3965 * This function is a synchronous call.
3967 * @return BLUETOOTH_ERROR_NONE - Success \n
3968 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3969 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3970 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3973 * @param[in] data_type The data type against corresponding service
3974 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
3975 * @param[in] channel_type The QOS type for the channel.
3976 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
3977 * For role = HDP_ROLE_SINK, the channel_type
3978 * should be HDP_QOS_ANY.
3979 * @param[out] app_handle The application handler against corresponding service
3981 * @see bluetooth_hdp_deactivate
3983 int bluetooth_hdp_activate(unsigned short data_type,
3984 bt_hdp_role_type_t role,
3985 bt_hdp_qos_type_t channel_type,
3988 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
3989 * @brief Deactivate the HDP service for a particular service using the handler
3991 * This function is a synchronous call.
3993 * @return BLUETOOTH_ERROR_NONE - Success \n
3994 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3995 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3996 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3999 * @param[in] app_handle The application handler against corresponding service
4001 * @see bluetooth_hdp_deactivate
4003 int bluetooth_hdp_deactivate(const char *app_handle);
4006 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4007 * const char *buffer, unsigned int size)
4008 * @brief Send data to the remote HDP device
4010 * This function is a synchronous call.
4012 * @return BLUETOOTH_ERROR_NONE - Success \n
4013 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4014 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4015 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4016 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4019 * @param[in] channel_id The channel id for the connection.
4020 * @param[in] buffer The pdu buffer.
4021 * @param[in] size Size of the buffer.
4023 * @see bluetooth_hdp_connect
4025 int bluetooth_hdp_send_data(unsigned int channel_id,
4026 const char *buffer, unsigned int size);
4028 * @fn int bluetooth_hdp_connect(const char *app_handle,
4029 * bt_hdp_qos_type_t channel_type,
4030 * const bluetooth_device_address_t *device_address)
4031 * @brief Connect to the remote device(Mainly used by source)
4033 * This function is a asynchronous call.
4034 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4036 * @return BLUETOOTH_ERROR_NONE - Success \n
4037 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4038 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4039 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4040 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4043 * @param[in] app_handle The application handler against corresponding service
4044 * @param[in] channel_type The QOS type for the channel.
4045 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4046 * @param[in] device_address The remote device Bd address.
4049 * @see bluetooth_hdp_disconnect
4051 int bluetooth_hdp_connect(const char *app_handle,
4052 bt_hdp_qos_type_t channel_type,
4053 const bluetooth_device_address_t *device_address);
4055 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4056 * const bluetooth_device_address_t *device_address)
4057 * @brief Disconnect from the remote device(Mainly used by source)
4059 * This function is a asynchronous call.
4060 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4062 * @return BLUETOOTH_ERROR_NONE - Success \n
4063 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4064 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4065 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4066 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4069 * @param[in] channel_id The channel id for the connection.
4070 * @param[in] device_address The remote device Bd address.
4073 * @see bluetooth_hdp_connect
4075 int bluetooth_hdp_disconnect(unsigned int channel_id,
4076 const bluetooth_device_address_t *device_address);
4080 * @fn int bluetooth_opc_init(void)
4081 * @brief Initialize OPP client.
4083 * This function is a synchronous call.
4084 * No event corresponding to this api
4086 * @return BLUETOOTH_ERROR_NONE - Success \n
4087 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4088 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4089 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4090 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4095 * @see bluetooth_opc_deinit
4097 int bluetooth_opc_init(void);
4100 * @fn int bluetooth_opc_deinit(void)
4101 * @brief Deinitialize OPP client.
4103 * This function is a synchronous call.
4104 * No event corresponding to this api
4106 * @return BLUETOOTH_ERROR_NONE - Success \n
4107 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4108 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4113 * @see bluetooth_opc_init
4116 int bluetooth_opc_deinit(void);
4119 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4120 char **file_name_array)
4121 * @brief Send multiple files to a remote device.
4123 * This function is a asynchronous call.
4124 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4126 * @return BLUETOOTH_ERROR_NONE - Success \n
4127 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4128 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4129 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4130 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4131 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4132 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4135 * @param[in] device_address The remote device Bd address.
4136 * @param[in] file_name_array Array of filepaths to be sent.
4139 * @see bluetooth_opc_cancel_push
4142 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4143 char **file_name_array);
4146 * @fn int bluetooth_opc_cancel_push(void)
4147 * @brief Cancels the ongoing file push.
4149 * This function is a asynchronous call.
4150 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4151 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4153 * @return BLUETOOTH_ERROR_NONE - Success \n
4154 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4155 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4160 * @see bluetooth_opc_push_files
4163 int bluetooth_opc_cancel_push(void);
4166 * @fn gboolean bluetooth_opc_session_is_exist(void)
4167 * @brief Informs whether opc session exists or not.
4169 * This function is a synchronous call.
4171 * @return TRUE - OPC session exists \n
4172 * FALSE - OPC session does not exist \n
4180 gboolean bluetooth_opc_session_is_exist(void);
4183 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4184 * @brief Informs whether opc session exists or not.
4186 * This function is a synchronous call.
4188 * @return BLUETOOTH_ERROR_NONE - Success \n
4189 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4190 * BLUETOOTH_ERROR_INTERNAL \n
4193 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4198 int bluetooth_opc_is_sending(gboolean *is_sending);
4201 * @fn int bluetooth_obex_server_init(const char *dst_path)
4202 * @brief Initialize OPP and FTP server.
4204 * This function is a synchronous call.
4205 * No event corresponding to this api
4207 * @return BLUETOOTH_ERROR_NONE - Success \n
4208 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4209 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4210 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4211 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4214 * @param[in] dst_path OPS destination file path.
4216 * @see bluetooth_obex_server_deinit
4218 int bluetooth_obex_server_init(const char *dst_path);
4222 * @fn int bluetooth_obex_server_deinit(void)
4223 * @brief Deinitialize OPP and FTP server.
4225 * This function is a synchronous call.
4226 * No event corresponding to this api
4228 * @return BLUETOOTH_ERROR_NONE - Success \n
4229 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4230 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4235 * @see bluetooth_obex_server_init
4237 int bluetooth_obex_server_deinit(void);
4241 * @fn gboolean bluetooth_obex_server_is_activated(void)
4242 * @brief Informs whether obex server is activated or not.
4244 * This function is a synchronous call.
4246 * @return TRUE - OBEX server is activated \n
4247 * FALSE - OBEX server is not activated \n
4254 gboolean bluetooth_obex_server_is_activated(void);
4258 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4259 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4261 * This function is a synchronous call.
4262 * No event corresponding to this api
4264 * @return BLUETOOTH_ERROR_NONE - Success \n
4265 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4266 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4267 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4268 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4272 * @param[in] dst_path OPS destination file path.
4274 * @see bluetooth_obex_server_deinit_without_agent
4276 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4280 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4281 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4283 * This function is a synchronous call.
4284 * No event corresponding to this api
4286 * @return BLUETOOTH_ERROR_NONE - Success \n
4287 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4288 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4293 * @see bluetooth_obex_server_init_without_agent
4295 int bluetooth_obex_server_deinit_without_agent(void);
4299 * @fn int bluetooth_obex_server_accept_connection(void)
4300 * @brief Accepts the authorization request indicated by the event
4301 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4303 * This function is a synchronous call.
4305 * @return BLUETOOTH_ERROR_NONE - Success \n
4306 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4307 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4311 * @see bluetooth_obex_server_reject_authorize
4313 int bluetooth_obex_server_accept_connection(void);
4317 * @fn int bluetooth_obex_server_reject_connection(void)
4318 * @brief Rejects the authorization request indicated by the event
4319 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4321 * This function is a synchronous call.
4323 * @return BLUETOOTH_ERROR_NONE - Success \n
4324 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4325 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4329 * @see bluetooth_obex_server_reject_authorize
4331 int bluetooth_obex_server_reject_connection(void);
4335 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4336 * @brief Accepts the authorization request indicated by the event
4337 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4339 * This function is a asynchronous call.
4340 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4342 * @return BLUETOOTH_ERROR_NONE - Success \n
4343 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4344 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4345 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4348 * @param[in] filename Authorized filename.
4351 * @see bluetooth_obex_server_reject_authorize
4354 int bluetooth_obex_server_accept_authorize(const char *filename);
4357 * @fn int bluetooth_obex_server_reject_authorize(void)
4358 * @brief Reject the authorization request indicated by the event
4359 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4361 * This function is a asynchronous call.
4362 * No event for this api..
4364 * @return BLUETOOTH_ERROR_NONE - Success \n
4365 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4366 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4371 * @see bluetooth_obex_server_accept_authorize
4374 int bluetooth_obex_server_reject_authorize(void);
4377 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4378 * @brief Set the OPS destination file path..
4380 * This function is a asynchronous call.
4381 * No event for this api..
4383 * @return BLUETOOTH_ERROR_NONE - Success \n
4384 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4385 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4386 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4389 * @param[in] dst_path OPS destination file path.
4395 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4398 * @fn int bluetooth_obex_server_set_root(const char *root)
4399 * @brief Set the FTS root folder..
4401 * This function is a asynchronous call.
4402 * No event for this api..
4404 * @return BLUETOOTH_ERROR_NONE - Success \n
4405 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4406 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4407 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4408 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4409 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4412 * @param[in] root FTS root folder.
4418 int bluetooth_obex_server_set_root(const char *root);
4421 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4422 * @brief Cancel the transfer on server
4424 * This function is an asynchronous call.
4425 * If the function call that cancels transfer is successful, the application would receive
4426 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4427 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4428 * the error code will be BLUETOOTH_ERROR_NONE
4430 * @return BLUETOOTH_ERROR_NONE - Success \n
4431 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4432 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4433 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4434 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4437 * @param[in] transfer_id transfer ID
4442 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4446 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4447 * @brief Cancel the transfer on server
4449 * This function is an asynchronous call.
4450 * If the function call that cancels transfer is successful, the application would receive
4451 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4452 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4453 * the error code will be BLUETOOTH_ERROR_NONE
4455 * @return BLUETOOTH_ERROR_NONE - Success \n
4456 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4457 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4458 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4459 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4466 int bluetooth_obex_server_cancel_all_transfers(void);
4470 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4471 * @brief Informs whether obex server is receiving or not.
4473 * This function is a synchronous call.
4475 * @return BLUETOOTH_ERROR_NONE - Success \n
4476 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4477 * BLUETOOTH_ERROR_INTERNAL \n
4480 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4485 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4489 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4490 * @brief Read the local Hash and Randmizer.
4492 * This function is a synchronous call.
4494 * @return BLUETOOTH_ERROR_NONE - Success \n
4495 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4499 * @param[out] local_oob_data - Pointer to the local OOB data
4505 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4509 * @fn int bluetooth_oob_add_remote_data(
4510 * const bluetooth_device_address_t *remote_device_address,
4511 * bt_oob_data_t *oob_data)
4512 * @brief Add/updated the remote device Hash and Randmizer.
4514 * This function is a synchronous call.
4515 * No event for this api..
4517 * @return BLUETOOTH_ERROR_NONE - Success \n
4518 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4521 * @param[in] remote_device_address - Remote device address
4522 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4528 int bluetooth_oob_add_remote_data(
4529 const bluetooth_device_address_t *remote_device_address,
4530 bt_oob_data_t *remote_oob_data);
4534 * @fn int bluetooth_oob_remove_remote_data(
4535 * const bluetooth_device_address_t *remote_device_address)
4536 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4538 * This function is a synchronous call.
4539 * No event for this api..
4541 * @return BLUETOOTH_ERROR_NONE - Success \n
4542 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4545 * @param[in] remote_device_address - Remote device address
4551 int bluetooth_oob_remove_remote_data(
4552 const bluetooth_device_address_t *remote_device_address);
4555 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4556 * bt_gatt_handle_info_t *prim_svc);
4558 * @brief Gets the GATT based primary services handle supported by remote device
4560 * This function is a synchronous call.
4561 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4563 * @return BLUETOOTH_ERROR_NONE - Success \n
4564 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4565 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4566 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4569 * @param[in] address - Remote device address
4570 * @param[out] prim_svc - Structure containing remote service count and handle list.
4573 * @see bluetooth_gatt_free_primary_services()
4575 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4576 bt_gatt_handle_info_t *prim_svc);
4579 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4581 * @brief Discovers the characteristics of GATT based service of remote device
4583 * This function is an asynchronous call.
4584 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4586 * @return BLUETOOTH_ERROR_NONE - Success \n
4587 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4588 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4589 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4592 * @param[in] service_handle - Handle for remote service.
4597 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4600 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4601 * bt_gatt_service_property_t *service);
4603 * @brief Gets the properties of GATT based service of remote device
4605 * This function is a synchronous call.
4606 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4608 * @return BLUETOOTH_ERROR_NONE - Success \n
4609 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4610 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4611 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4614 * @param[in] service_handle - Handle for remote service.
4615 * @param[out] service - Structure containing remote service property.
4618 * @see bluetooth_gatt_free_service_property()
4620 int bluetooth_gatt_get_service_property(const char *service_handle,
4621 bt_gatt_service_property_t *service);
4624 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4626 * @brief Register to GATT based service to receive value change notification/indication.
4628 * This function is a synchronous call.
4629 * No event for this api.
4631 * @return BLUETOOTH_ERROR_NONE - Success \n
4632 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4633 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4634 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4637 * @param[in] service_handle - Handle for remote service.
4642 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4645 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4647 * @brief Unregister GATT based service to receive value change notification/indication.
4649 * This function is a synchronous call.
4650 * No event for this api.
4652 * @return BLUETOOTH_ERROR_NONE - Success \n
4653 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4654 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4655 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4658 * @param[in] service_handle - Handle for remote service.
4663 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4666 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4667 * bt_gatt_char_property_t *characteristic);
4669 * @brief Provides characteristic value along with properties.
4671 * This function is a synchronous call.
4672 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4674 * @return BLUETOOTH_ERROR_NONE - Success \n
4675 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4676 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4677 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4680 * @param[in] char_handle - Handle for Characteristic property.
4681 * @param[out] characteristic - Structure containing remote characteristic property.
4684 * @see bluetooth_gatt_free_char_property()
4686 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4687 bt_gatt_char_property_t *characteristic);
4690 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4691 * bt_gatt_char_property_t *characteristic);
4693 * @brief Provides characteristic descriptor value along with its UUID.
4695 * This function is a synchronous call.
4696 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4698 * @return BLUETOOTH_ERROR_NONE - Success \n
4699 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4700 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4701 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4704 * @param[in] desc_handle - Handle for Characteristic descriptor.
4705 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4708 * @see bluetooth_gatt_free_desc_property()
4710 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4711 bt_gatt_char_descriptor_property_t *descriptor);
4715 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4716 * const guint8 *value, int length)
4718 * @brief Set characteristic value.
4720 * This function is a synchronous call.
4722 * @return BLUETOOTH_ERROR_NONE - Success \n
4723 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4724 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4725 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4728 * @param[in] char_handle - Handle for Characteristic property.
4729 * @param[in] value - New value to set for characteristic property.
4730 * @param[in] length - Length of the value to be set.
4735 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4736 const guint8 *value, int length);
4739 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4740 * const guint8 *value, int length, guint8 write_type)
4742 * @brief Set characteristic value by write type.
4744 * This function is a synchronous call if write type is "write without resonse"
4745 * and it is an asynchronous call if write type is "write with response"
4747 * @return BLUETOOTH_ERROR_NONE - Success \n
4748 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4749 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4750 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4753 * @param[in] char_handle - Handle for Characteristic property.
4754 * @param[in] value - New value to set for characteristic property.
4755 * @param[in] length - Length of the value to be set.
4756 * @param[in] write_type - Type of write.
4761 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4762 const guint8 *value, int length, guint8 write_type);
4766 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4767 * const guint8 *value, int length)
4769 * @brief Set characteristic value request.
4771 * This function is an asynchronous call.
4773 * @return BLUETOOTH_ERROR_NONE - Success \n
4774 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4775 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4776 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4779 * @param[in] char_handle - Handle for Characteristic property.
4780 * @param[in] value - New value to set for characteristic property.
4781 * @param[in] length - Length of the value to be set.
4786 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4787 const guint8 *value, int length);
4790 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4792 * @brief Read characteristic value.
4794 * This function is a asynchronous call.
4796 * @return BLUETOOTH_ERROR_NONE - Success \n
4797 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4798 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4799 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4802 * @param[in] char_handle - Handle for Characteristic property.
4807 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
4810 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4811 * const char *service_uuid,
4812 * bt_gatt_service_property_t *service)
4814 * @brief Gets the service property from a device based on a particular uuid
4816 * This function is a synchronous call.
4818 * @return BLUETOOTH_ERROR_NONE - Success \n
4819 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4820 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4821 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4824 * @param[in] address - BD address of the remote device
4825 * @param[in] service_uuid - uuid of the service.
4826 * @param[out] service - Structure containing the service property.
4831 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4832 const char *service_uuid,
4833 bt_gatt_service_property_t *service);
4836 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4837 * const char *char_uuid)
4839 * @brief Gets the characteristic property from a service based on a particular char uuid
4841 * This function is an asynchronous call.
4842 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
4844 * @return BLUETOOTH_ERROR_NONE - Success \n
4845 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4846 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4847 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4850 * @param[in] service_handle - Service handle.
4851 * @param[in] uuid - Characteristic uuid.
4856 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4857 const char *char_uuid);
4860 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4862 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
4864 * This function is a synchronous call.
4865 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
4867 * @return BLUETOOTH_ERROR_NONE - Success \n
4868 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4871 * @param[in] prim_svc - GATT handle info structure
4874 * @see bluetooth_gatt_get_primary_services()
4876 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4879 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4881 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
4883 * This function is a synchronous call.
4884 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
4886 * @return BLUETOOTH_ERROR_NONE - Success \n
4887 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4890 * @param[in] svc_pty - GATT service property structure.
4893 * @see bluetooth_gatt_get_service_property()
4895 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4898 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4900 * @brief Provides characteristic value along with properties.
4902 * This function is a synchronous call.
4903 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4905 * @return BLUETOOTH_ERROR_NONE - Success \n
4906 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4909 * @param[in] char_pty - GATT characteristics property structure.
4912 * @see bluetooth_gatt_get_characteristics_property()
4914 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4917 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4919 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
4921 * This function is a synchronous call.
4922 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
4924 * @return BLUETOOTH_ERROR_NONE - Success \n
4925 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4928 * @param[in] desc_pty - GATT characteristics descriptor property structure.
4931 * @see bluetooth_gatt_get_char_descriptor_property()
4933 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4936 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
4938 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
4941 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4943 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
4945 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4947 * @return BLUETOOTH_ERROR_NONE - Success \n
4948 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4951 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
4955 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4958 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
4960 * @brief Read characteristic descriptor value.
4962 * This function is a asynchronous call.
4964 * @return BLUETOOTH_ERROR_NONE - Success \n
4965 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4966 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4967 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4970 * @param[in] desc_handle - Handle for Characteristic descriptor
4975 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
4978 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4979 * const guint8 *value, int length);
4981 * @brief Set characteristic descriptor value.
4983 * This function is a asynchronous call.
4985 * @return BLUETOOTH_ERROR_NONE - Success \n
4986 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4987 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4988 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4991 * @param[in] desc_handle - Handle for Characteristic descriptor
4992 * @param[in] value - New value to set for characteristic descriptor
4993 * @param[in] length - Length of the value to be set.
4998 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4999 const guint8 *value, int length);
5001 /* @fn int bluetooth_gatt_init(void)
5003 * @brief Initializes the gatt service.
5005 * This function is a synchronous call.
5006 * @return BLUETOOTH_ERROR_NONE - Success \n
5007 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5008 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5009 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5012 * @remark Adapter should be enabled
5013 * @see bluetooth_gatt_deinit()
5015 int bluetooth_gatt_init(void);
5017 /* @fn int bluetooth_gatt_init(void)
5019 * @brief DeInitializes the gatt service.
5021 * 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 * @remark Adapter should be enabled
5029 * @see bluetooth_gatt_init()
5031 int bluetooth_gatt_deinit(void);
5033 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5034 unsigned char **svc_path)
5036 * @brief Exports a new gatt service to the service interface.
5038 * This function is a synchronous call.
5040 * @return BLUETOOTH_ERROR_NONE - Success \n
5041 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5042 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5043 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5046 * @param[in] svc_uuid Gatt service uuid.
5047 * @param[out] svc_path service object path of the exported service.
5048 * @remark Adapter should be enabled
5049 * @see bluetooth_gatt_init()
5051 int bluetooth_gatt_add_service(const char *svc_uuid,
5054 /* @fn int bluetooth_gatt_add_new_characteristic(
5055 const char *svc_path, const char *char_uuid,
5056 bt_gatt_permission_t permissions,
5057 bt_gatt_characteristic_property_t properties,
5058 int flags_length, char **char_path);;
5060 * @brief Exports a new gatt characteristic to the characteristic interface.
5062 * This function is a synchronous call.
5063 * @return BLUETOOTH_ERROR_NONE - Success \n
5064 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5065 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5066 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5068 * @param[in] svc_path service object path of the exported service.
5069 * @param[in] char_uuid Gatt service uuid.
5070 * @param[in] properties GATT characteristic properties.
5071 * @param[out] char_path characteristic object path of the exported characteristic.
5073 * @remark Adapter should be enabled
5074 * @see bluetooth_gatt_add_service()
5076 int bluetooth_gatt_add_new_characteristic(
5077 const char *svc_path, const char *char_uuid,
5078 bt_gatt_permission_t permissions,
5079 bt_gatt_characteristic_property_t properties,
5082 /* @fn bluetooth_gatt_set_characteristic_value(
5083 const char *characteristic, const char *char_value,
5086 * @brief adds gatt charactertisic value to the given charactertistic path.
5088 * This function is a synchronous call.
5089 * @return BLUETOOTH_ERROR_NONE - Success \n
5090 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5091 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5092 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5094 * @param[in] char_value Value of the GATT characteristic to be added.
5095 * @param[in] value_length length of the chantacteristic value..
5096 * @param[out] characteristic characteristic object path..
5098 * @remark Adapter should be enabled
5099 * @see bluetooth_gatt_add_service()
5101 int bluetooth_gatt_set_characteristic_value(
5102 const char *characteristic, const char *char_value,
5105 /* @fn int bluetooth_gatt_add_descriptor(
5106 const char *char_path, const char *desc_uuid,
5107 bt_gatt_permission_t permissions,
5110 * @brief Exports a new gatt descriptor to the descriptor interface.
5112 * This function is a synchronous call.
5114 * @return BLUETOOTH_ERROR_NONE - Success \n
5115 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5116 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5117 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5120 * @param[in] desc_uuid Gatt descriptor uuid.
5121 * @param[in] desc_value GATT descriptor value.
5122 * @param[in] value_length Length of GATT descriptor value.
5123 * @param[in] permissions descriptor permissions.
5124 * @param[in] properties GATT descriptor properties.
5125 * @param[in] char_path characteristics object path of the exported character.
5127 * @remark Adapter should be enabled
5128 * @see bluetooth_gatt_add_service()
5129 * @see bluetooth_gatt_add_characteristics()
5131 int bluetooth_gatt_add_descriptor(
5132 const char *char_path, const char *desc_uuid,
5133 bt_gatt_permission_t permissions,
5136 /* @fn int bluetooth_gatt_set_descriptor_value(
5137 const char *desc_path, const char *desc_value,
5140 * @brief Adds value to the given descriptor handle.
5142 * This function is a synchronous call.
5144 * @return BLUETOOTH_ERROR_NONE - Success \n
5145 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5146 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5147 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5150 * @param[in] desc_value GATT descriptor value.
5151 * @param[in] value_length Length of GATT descriptor value.
5152 * @param[in] desc_path descriptor path to which the value needs to be added.
5154 * @remark Adapter should be enabled
5155 * @see bluetooth_gatt_add_service()
5156 * @see bluetooth_gatt_add_characteristics()
5158 int bluetooth_gatt_set_descriptor_value(
5159 const char *desc_path, const char *desc_value,
5162 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5164 * @brief Reads the Service registered on manager interface.
5166 * This function is a synchronous call.
5168 * @return BLUETOOTH_ERROR_NONE - Success \n
5169 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5170 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5171 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5174 * @param[in] svc_uuid Gatt Service uuid.
5176 * @remark Adapter should be enabled and service should be registered.
5177 * @see bluetooth_gatt_register_service()
5179 int bluetooth_gatt_get_service(const char *svc_uuid);
5181 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5183 * @brief Registers the given service path with the bluez gatt server.
5185 * This function is a synchronous call.
5187 * @return BLUETOOTH_ERROR_NONE - Success \n
5188 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5189 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5190 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5193 * @param[in] svc_path service object path of the exported service.
5195 * @remark Adapter should be enabled
5196 * @see bluetooth_gatt_add_service()
5197 * @see bluetooth_gatt_add_characteristics()
5198 * @see bluetooth_gatt_add_descriptor()
5199 * @see bluetooth_gatt_register_application()
5201 int bluetooth_gatt_register_service(const char *svc_path);
5203 /* @fn int bluetooth_gatt_register_application(void)
5205 * @brief Registers the application with the bluez gatt server.
5207 * This function is a synchronous call.
5209 * @return BLUETOOTH_ERROR_NONE - Success \n
5210 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5211 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5212 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5216 * @remark Adapter should be enabled
5217 * @see bluetooth_gatt_init()
5218 * @see bluetooth_gatt_add_service()
5219 * @see bluetooth_gatt_add_characteristics()
5220 * @see bluetooth_gatt_add_descriptor()
5221 * @see bluetooth_gatt_register_service()
5223 int bluetooth_gatt_register_application(void);
5225 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5227 * @brief Removes(unregister) service from the bluez gatt server db.
5229 * This function is a synchronous call.
5231 * @return BLUETOOTH_ERROR_NONE - Success \n
5232 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5233 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5234 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5237 * @param[in] svc_path service object path of the exported service.
5239 * @remark Adapter should be enabled
5240 * @see bluetooth_gatt_add_service()
5241 * @see bluetooth_gatt_add_characteristics()
5242 * @see bluetooth_gatt_add_descriptor()
5243 * @see bluetooth_gatt_register_service()
5245 int bluetooth_gatt_unregister_service(const char *svc_path);
5247 /* @fn int bluetooth_gatt_unregister_application(void)
5249 * @brief Removes(unregister) the application with the bluez gatt server,
5250 * and deletes all the service registered.
5252 * This function is a synchronous call.
5254 * @return BLUETOOTH_ERROR_NONE - Success \n
5255 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5256 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5257 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5261 * @remark Adapter should be enabled
5262 * @see bluetooth_gatt_init()
5263 * @see bluetooth_gatt_add_service()
5264 * @see bluetooth_gatt_add_characteristics()
5265 * @see bluetooth_gatt_add_descriptor()
5266 * @see bluetooth_gatt_register_service()
5267 * @see bluetooth_gatt_unregister_service()
5269 int bluetooth_gatt_unregister_application(void);
5271 /* @fn int bluetooth_gatt_send_response(int request_id,
5272 * int offset, char *value, int value_length)
5274 * @brief Updates the attribute value in local attribute list.
5276 * This function is a synchronous call.
5278 * @return BLUETOOTH_ERROR_NONE - Success \n
5279 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5280 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5281 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5284 * @param[in] request_id The identification of a read request
5285 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5286 * @param[in] resp_state The identification of response state
5287 * @param[in] offset The offset from where a value is read
5288 * @param[in] value The value to be sent. It will be sent from @a offset.
5289 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5290 * @param[in] value_length Value Length.
5292 * @remark Adapter should be enabled
5293 * @see bluetooth_gatt_add_service()
5294 * @see bluetooth_gatt_add_characteristics()
5295 * @see bluetooth_gatt_add_descriptor()
5296 * @see bluetooth_gatt_register_service()
5298 int bluetooth_gatt_send_response(int request_id, guint req_type,
5299 int resp_state, int offset, char *value, int value_length);
5301 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5303 * @brief Sets the notification property for a characteristic.
5305 * This function is a synchronous call.
5307 * @return BLUETOOTH_ERROR_NONE - Success \n
5308 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5309 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5310 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5313 * @param[in] char_path characteristic object path.
5314 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5316 * @remark Adapter should be enabled
5317 * @see bluetooth_gatt_update_characteristic()
5319 int bluetooth_gatt_server_set_notification(const char *char_path,
5320 bluetooth_device_address_t *unicast_address);
5322 /* @fn int bluetooth_gatt_delete_services(void)
5324 * @brief deletes (unregisters) all services from the gatt server database..
5326 * This function is a synchronous call.
5328 * @return BLUETOOTH_ERROR_NONE - Success \n
5329 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5330 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5331 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5335 * @remark Adapter should be enabled
5336 * @see bluetooth_gatt_add_service()
5337 * @see bluetooth_gatt_add_characteristics()
5338 * @see bluetooth_gatt_add_descriptor()
5339 * @see bluetooth_gatt_register_service()
5340 * @see bluetooth_gatt_unregister_service()
5342 int bluetooth_gatt_delete_services(void);
5344 /* @fn int bluetooth_gatt_update_characteristic(void)
5346 * @brief updates the given characteristic with a new value
5348 * This function is a synchronous call.
5350 * @return BLUETOOTH_ERROR_NONE - Success \n
5351 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5352 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5353 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5357 * @remark Adapter should be enabled
5358 * @see bluetooth_gatt_add_service()
5359 * @see bluetooth_gatt_add_characteristics()
5360 * @see bluetooth_gatt_add_descriptor()
5361 * @see bluetooth_gatt_register_service()
5362 * @see bluetooth_gatt_unregister_service()
5364 int bluetooth_gatt_update_characteristic(const char *char_path,
5365 const char* char_value, int value_length);
5368 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5370 * @brief Set advertising status.
5372 * This function is used to enable or disable LE advertising.
5373 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5375 * This function is a synchronous call.
5377 * @return BLUETOOTH_ERROR_NONE - Success \n
5378 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5379 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5382 * @param[in] enable - The status of advertising
5385 * @see bluetooth_set_advertising_data
5387 int bluetooth_set_advertising(int handle, gboolean enable);
5390 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5392 * @brief Set advertising status along with interval value.
5394 * This function is used to enable or disable LE advertising.
5395 * Interval_min and Interval_max is used to set the best advertising interval.
5396 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5398 * This function is a synchronous call.
5400 * @return BLUETOOTH_ERROR_NONE - Success \n
5401 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5402 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5405 * @param[in] enable - The status of advertising
5406 * @param[in] interval_min - Minimum interval of advertising (msec)
5407 * @param[in] interval_max - Maximum interval of advertising (msec)
5408 * @param[in] filter_policy - Advertising filter policy
5411 * @see bluetooth_set_advertising_data
5413 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5414 bluetooth_advertising_params_t *params);
5417 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5418 * @brief Get the advertising data
5420 * This function is used to get advertising data.
5421 * Before calling this API, the adapter should be enabled.
5423 * This function is a synchronous call.
5425 * @return BLUETOOTH_ERROR_NONE - Success \n
5426 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5427 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5428 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5430 * @param[out] value - Advertising data structure.
5431 * @param[out] length - The length of Advertising data.
5435 bluetooth_advertising_data_t *value = { {0} };
5438 ret = bluetooth_get_advertising_data(&value, &length);
5441 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5444 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5446 * @brief Set advertising data with value
5448 * This function is used to set advertising data and Maximum size of advertising data
5449 * is 28 byte (Except Flag)
5451 * This function is a synchronous call.
5453 * @return BLUETOOTH_ERROR_NONE - Success \n
5454 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5455 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5458 * @param[in] value - Advertising data structure.
5462 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5465 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5467 * @brief Check the privilege for advertising parameter setting
5469 * This function is a synchronous call.
5471 * @return BLUETOOTH_ERROR_NONE - Success \n
5472 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5478 int bluetooth_check_privilege_advertising_parameter(void);
5481 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5482 * @brief Get the LE scan response data
5484 * This function is used to get scan response data.
5485 * Before calling this API, the adapter should be enabled.
5487 * This function is a synchronous call.
5489 * @return BLUETOOTH_ERROR_NONE - Success \n
5490 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5491 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5492 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5494 * @param[out] value - Scan response data structure.
5495 * @param[out] length - The length of Scan response data.
5499 bluetooth_scan_resp_data_t *value = { {0} };
5502 ret = bluetooth_get_scan_response_data(&value, &length);
5505 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5508 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5510 * @brief Set scan response data with value
5512 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5514 * This function is a synchronous call.
5516 * @return BLUETOOTH_ERROR_NONE - Success \n
5517 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5518 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5521 * @param[in] value - LE Scan response data structure.
5525 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5528 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5530 * @brief Set scan interval and window
5532 * This function is used to set LE scan interval and window size
5534 * This function is a synchronous call.
5536 * @return BLUETOOTH_ERROR_NONE - Success \n
5537 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5538 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5541 * @param[in] interval - Interval of LE scan (msec)
5542 * @param[in] window - Window size of LE scan (msec)
5546 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5549 * @fn int bluetooth_is_advertising(void)
5550 * @brief Check for the advertising is in-progress or not.
5552 * This API is used to check the current status of the advertising procedure.
5553 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5556 * This function checks whether the advertising is started or not.
5558 * This function is a synchronous call.
5560 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5562 * @return BLUETOOTH_ERROR_NONE - Success \n
5563 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5566 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5570 gboolean is_advertising = 0;
5572 ret = bluetooth_is_advertising(&is_advertising);
5575 int bluetooth_is_advertising(gboolean *is_advertising);
5578 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5579 * @brief Add LE device to white list
5581 * This API is used to add LE device to white list
5582 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5586 * This function is a synchronous call.
5588 * @param[in] address The address of remote device
5590 * @return BLUETOOTH_ERROR_NONE - Success \n
5591 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5594 * @see bluetooth_set_custom_advertising
5596 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5599 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5600 * @brief Remove LE device from white list
5602 * This API is used to remove LE device from white list
5603 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5607 * This function is a synchronous call.
5609 * @param[in] address The address of remote device
5611 * @return BLUETOOTH_ERROR_NONE - Success \n
5612 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5615 * @see bluetooth_set_custom_advertising
5617 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5620 * @fn int bluetooth_clear_white_list(void)
5621 * @brief Clear white list
5623 * This API is used to clear white list
5624 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5628 * This function is a synchronous call.
5630 * @param[in] address The address of remote device
5632 * @return BLUETOOTH_ERROR_NONE - Success \n
5633 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5636 * @see bluetooth_set_custom_advertising
5638 int bluetooth_clear_white_list(void);
5641 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5642 * const bluetooth_le_connection_param_t *parameters)
5643 * @brief update connection paramter of LE connection.
5645 * This function is a synchronous call.
5647 * @return BLUETOOTH_ERROR_NONE - Success \n
5648 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5651 * @param[in] address - remote device address value.
5652 * @param[in] parameters - new connection parameters.
5655 * @see bluetooth_bond_device
5657 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5658 const bluetooth_le_connection_param_t *parameters);
5662 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5664 * @brief Enable/Disable LE Privacy feature.
5666 * This function is used to enable or disable LE Privacy feature.
5667 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5669 * This function is a synchronous call.
5671 * @return BLUETOOTH_ERROR_NONE - Success \n
5672 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5673 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5676 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5680 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5683 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
5684 * bluetooth_le_connection_mode_t mode)
5685 * @brief update connection paramter of LE connection.
5687 * This function is a synchronous call.
5689 * @return BLUETOOTH_ERROR_NONE - Success \n
5690 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5691 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5694 * @param[in] address - remote device address value.
5695 * @param[in] mode - new connection mode.
5699 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
5700 bluetooth_le_connection_mode_t mode);
5703 * @fn int bluetooth_le_read_maximum_data_length()
5704 * @brief reads the maximum LE data length supported in the controller.
5706 * This function is a synchronous call.
5708 * @return BLUETOOTH_ERROR_NONE - Success \n
5709 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5715 int bluetooth_le_read_maximum_data_length(
5716 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
5718 * @fn int bluetooth_le_write_host_suggested_default_data_length()
5719 * @brief writes the host suggested values for the controllers max transmitted no of payload
5720 * octects to be used for new connections.
5722 * This function is a synchronous call.
5724 * @return BLUETOOTH_ERROR_NONE - Success \n
5725 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5731 int bluetooth_le_write_host_suggested_default_data_length(
5732 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
5734 int bluetooth_le_read_suggested_default_data_length(
5735 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
5737 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
5738 const unsigned int max_tx_octets, const unsigned int max_tx_time);
5740 int bluetooth_pbap_init(void);
5741 int bluetooth_pbap_deinit(void);
5742 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
5743 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
5744 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
5745 bt_pbap_folder_t *folder);
5746 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
5747 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
5748 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
5749 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
5750 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
5751 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
5752 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
5753 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
5756 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5758 * @brief Set manufacturer data with value
5760 * This function is used to set manufacturer data.
5762 * This function is a synchronous call.
5764 * @return BLUETOOTH_ERROR_NONE - Success \n
5765 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5766 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5769 * @param[in] value - Manufacturer data structure.
5773 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5775 #ifdef TIZEN_DPM_VCONF_ENABLE
5777 * @fn int bluetooth_dpm_is_mode_allowed(void);
5779 * @brief Checks Restriction for BT mode(BT allowed or not)
5781 * This function is a synchronous call.
5783 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5784 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5785 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5792 int bluetooth_dpm_is_mode_allowed(void);
5796 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
5798 * @brief Sets Restriction for BT mode(BT allowed or not)
5800 * This function is a synchronous call.
5802 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5803 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5804 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5807 * @param[in] value - BT Allow value.
5808 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
5809 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
5810 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
5811 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
5815 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
5818 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
5820 * @brief Reads the Restriction for BT mode(BT allowed or not)
5822 * This function is a synchronous call.
5824 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5825 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5826 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5830 * @param[out] value - BT Allow value.
5831 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
5832 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
5833 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
5834 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
5838 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
5841 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
5843 * @brief Sets the Restriction for device.
5845 * This function is a synchronous call.
5847 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5848 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5849 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5852 * @param[in] value - State value.
5853 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5854 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5858 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
5861 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
5863 * @brief Reads the Restriction for device.
5865 * This function is a synchronous call.
5867 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5868 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5869 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5873 * @param[out] value - State value.
5874 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5875 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5879 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
5882 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
5884 * @brief Sets the Restriction for uuid.
5886 * This function is a synchronous call.
5888 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5889 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5890 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5893 * @param[in] value - State value.
5894 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5895 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5899 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
5902 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
5904 * @brief Reads the Restriction for uuid.
5906 * This function is a synchronous call.
5908 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5909 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5910 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5914 * @param[out] value - State value.
5915 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5916 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5920 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
5923 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
5925 * @brief Adds the device to blacklist.
5927 * This function is a synchronous call.
5929 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5930 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5931 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5934 * @param[in] device_address - Device address
5938 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
5941 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
5943 * @brief Adds the device to whitelist.
5945 * This function is a synchronous call.
5947 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5948 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5949 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5952 * @param[in] device_address - Device address
5956 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
5959 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
5961 * @brief Adds the Service UUIDS to blacklist.
5963 * This function is a synchronous call.
5965 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5966 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5967 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5970 * @param[in] service_uuids - profile or custom service uuids
5974 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
5977 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
5979 * @brief Adds the Service UUIDS to whitelist.
5981 * This function is a synchronous call.
5983 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5984 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5985 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5988 * @param[in] service_uuids - profile or custom service uuids
5992 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
5995 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
5997 * @brief Clears the devices from blacklist.
5999 * This function is a synchronous call.
6001 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6002 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6003 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6010 int bluetooth_dpm_clear_devices_from_blacklist(void);
6013 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6015 * @brief Clears the devices from whitelist.
6017 * This function is a synchronous call.
6019 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6020 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6021 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6028 int bluetooth_dpm_clear_devices_from_whitelist(void);
6031 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6033 * @brief Clears the uuids from blacklist.
6035 * This function is a synchronous call.
6037 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6038 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6039 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6046 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6049 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6051 * @brief Clears the uuids from whitelist.
6053 * This function is a synchronous call.
6055 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6056 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6057 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6064 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6067 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6069 * @brief reads the devices from blacklist.
6071 * This function is a synchronous call.
6073 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6074 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6075 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6078 * @param[out] device_list - list of devices
6082 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6085 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6087 * @brief reads the devices from whitelist.
6089 * This function is a synchronous call.
6091 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6092 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6093 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6096 * @param[out] device_list - list of devices
6100 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6103 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6105 * @brief reads the uuids from blacklist.
6107 * This function is a synchronous call.
6109 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6110 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6111 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6114 * @param[in] uuid_list - list of uuids
6118 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6121 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6123 * @brief reads the uuids from whitelist.
6125 * This function is a synchronous call.
6127 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6128 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6129 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6132 * @param[in] uuid_list - list of uuids
6136 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6139 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6141 * @brief Removes the device from whitelist.
6143 * This function is a synchronous call.
6145 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6146 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6147 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6150 * @param[in] device_address - Device address
6154 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6157 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6159 * @brief Removes the device from blacklist.
6161 * This function is a synchronous call.
6163 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6164 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6165 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6168 * @param[in] device_address - Device address
6172 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6175 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6177 * @brief Removes the Service UUIDS from whitelist.
6179 * This function is a synchronous call.
6181 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6182 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6183 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6186 * @param[in] service_uuids - profile or custom service uuids
6190 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6193 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6195 * @brief Removes the Service UUIDS from blacklist.
6197 * This function is a synchronous call.
6199 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6200 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6201 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6204 * @param[in] service_uuids - profile or custom service uuids
6208 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6211 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6213 * @brief Sets the Restriction for outgoing call.
6215 * This function is a synchronous call.
6217 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6218 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6219 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6222 * @param[in] value - State value.
6223 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6224 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6228 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6231 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6233 * @brief Reads the Restriction for outgoing call.
6235 * This function is a synchronous call.
6237 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6238 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6239 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6243 * @param[out] value - State value.
6244 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6245 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6249 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6252 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6254 * @brief Sets the Restriction for Pairing.
6256 * This function is a synchronous call.
6258 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6259 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6260 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6263 * @param[in] value - State value.
6264 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6265 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6269 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6272 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6274 * @brief Reads the Restriction for Pairing
6276 * This function is a synchronous call.
6278 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6279 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6280 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6284 * @param[out] value - State value.
6285 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6286 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6290 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6293 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6295 * @brief Sets the Restriction for using Profiles.
6297 * This function is a synchronous call.
6299 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6300 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6301 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6304 * @param[in]profile - Profile.
6305 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6306 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6307 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6308 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6309 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6310 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6311 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6312 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6313 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6314 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6315 * BLUETOOTH_DPM_PROFILE_NONE
6316 * @param[in] value - State value.
6317 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6318 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6322 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6325 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6327 * @brief Reads the Restriction for using Profiles.
6329 * This function is a synchronous call.
6331 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6332 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6333 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6336 * @param[in]profile - Profile.
6337 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6338 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6339 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6340 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6341 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6342 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6343 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6344 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6345 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6346 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6347 * BLUETOOTH_DPM_PROFILE_NONE
6348 * @param[out] value - State value.
6349 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6350 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6354 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6357 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6359 * @brief Sets the Restriction for Desktop Connectivity.
6361 * This function is a synchronous call.
6363 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6364 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6365 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6368 * @param[in] value - State value.
6369 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6370 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6374 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6377 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6379 * @brief Reads the Restriction for Desktop Connectivity.
6381 * This function is a synchronous call.
6383 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6384 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6385 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6389 * @param[out] value - State value.
6390 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6391 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6395 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6398 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6400 * @brief Sets the Restriction for Discoverable state.
6402 * This function is a synchronous call.
6404 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6405 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6406 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6409 * @param[in] value - State value.
6410 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6411 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6415 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6418 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6420 * @brief Reads the Restriction for Discoverable state.
6422 * This function is a synchronous call.
6424 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6425 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6426 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6430 * @param[out] value - State value.
6431 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6432 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6436 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6439 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6441 * @brief Sets the Restriction for linited discoverable state..
6443 * This function is a synchronous call.
6445 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6446 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6447 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6450 * @param[in] value - State value.
6451 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6452 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6456 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6459 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6461 * @brief Reads the Restriction for limited discoverable state.
6463 * This function is a synchronous call.
6465 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6466 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6467 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6471 * @param[out] value - State value.
6472 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6473 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6477 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6479 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6481 * @brief Sets the Restriction for Data trasnfer.
6483 * This function is a synchronous call.
6485 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6486 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6487 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6490 * @param[in] value - State value.
6491 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6492 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6496 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6500 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6502 * @brief Reads the Restriction for Data trasnfer.
6504 * This function is a synchronous call.
6506 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6507 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6508 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6512 * @param[out] value - State value.
6513 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6514 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6518 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6526 #endif /* __cplusplus */
6527 #endif /* _BLUETOOTH_API_H_*/