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_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
52 #define BLUETOOTH_UUID_STRING_MAX 50
53 #define BLUETOOTH_PATH_STRING 50
55 #define BLUETOOTH_OOB_DATA_LENGTH 16
57 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
60 * This is Bluetooth Connected event role
62 #define RFCOMM_ROLE_SERVER 1
63 #define RFCOMM_ROLE_CLIENT 2
66 * This is RFCOMM default Channel Value
68 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
71 * This is maximum length for search value string for PBAP Phonebook Search
73 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
76 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
80 * This is Bluetooth error code
82 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
84 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
85 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
87 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
88 /**< Callback error */
89 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
90 /**< invalid paramerror */
91 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
92 /**< invalid data error */
93 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
94 /**< Memory allocation error */
95 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
96 /**< out of memory error */
97 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
99 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
100 /**< No resource error */
101 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
102 /**< internal error */
103 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
104 /**< Not supported error */
105 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
106 /**< Operation is failed because
107 of not enabled BT Adapter */
108 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
109 /**< Enabling is failed because of
110 already enabled BT Adapter */
111 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
112 /**< Operation is failed because of
113 other on going operation */
114 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
115 /**< access denied error */
116 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
117 /**< max client error */
118 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
119 /**< not found error */
120 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
121 /**< service search fail */
122 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
123 /**< pairing failed error */
124 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
125 /**< Not paired error */
126 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
127 /**< no service error */
128 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
129 /**< no connection error */
130 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
131 /**< alread connected error */
132 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
133 /**< connection busy error */
134 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
135 /**< connection error */
136 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
137 /**< max connection error*/
138 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
139 /**< Not in operation */
140 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
141 /**< Cancelled by user */
142 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
143 /**< Service record registration failed */
144 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
145 /**< Operation in progress */
146 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
147 /**< authentication failed error when paring*/
148 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
149 /**< Remote host is down */
150 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
151 /**< End of device list */
153 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
154 /**< Obex agent already exists */
155 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
156 /**< Obex agent does not exist */
158 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
159 /**< Already initialized */
161 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
162 /**< Permission deined */
164 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
165 /**< Nap already done */
167 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
168 /**< Not initialized */
170 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
171 /**< Authentication rejected */
173 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
174 /**< Device Policy Restricted */
177 * Device disconnection reasons; received from stack
179 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
180 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
181 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
182 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
183 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
184 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
185 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
186 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
187 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
188 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
189 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
194 * Device disconnect reason
197 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
198 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
199 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
200 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
201 } bluetooth_device_disconnect_reason_t;
204 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
207 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
208 } bluetooth_device_address_t;
211 * This is Bluetooth device address type
214 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
215 BLUETOOTH_DEVICE_RANDOM_ADDRESS
216 } bluetooth_device_address_type_t;
219 * This is Bluetooth version
222 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
223 } bluetooth_version_t;
226 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
229 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
230 } bluetooth_device_name_t;
233 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
236 int data_len; /**< manafacturer specific data length */
237 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
238 } bluetooth_manufacturer_data_t;
241 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
242 } bluetooth_device_pin_code_t;
248 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
249 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
250 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
251 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
252 } bluetooth_adapter_state_t;
258 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
259 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
260 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
261 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
262 } bluetooth_adapter_le_state_t;
268 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
269 /*Changed the order to make it compatable with old method */
270 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
271 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
272 /**< Discoverable mode with time limit
273 After specific timeout, it is changed
274 to non discoverable mode */
275 } bluetooth_discoverable_mode_t;
278 * Network connect mode
281 BLUETOOTH_NETWORK_PANU_ROLE,
283 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
284 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
285 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
286 } bluetooth_network_role_t;
292 BLUETOOTH_RFCOMM_SERVICE = 0x01,
293 BLUETOOTH_A2DP_SERVICE = 0x02,
294 BLUETOOTH_HSP_SERVICE = 0x04,
295 BLUETOOTH_HID_SERVICE = 0x08,
296 BLUETOOTH_NAP_SERVICE = 0x10,
297 BLUETOOTH_HFG_SERVICE = 0x20,
298 BLUETOOTH_GATT_SERVICE = 0x40,
299 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
300 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
301 } bluetooth_service_type_t;
307 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, /* represents that connection
308 * type can both BR/EDR and LE */
309 BLUETOOTH_DEV_CONN_BREDR = 0x00,
310 BLUETOOTH_DEV_CONN_LE = 0x01,
311 } bluetooth_conn_type_t;
317 BLUETOOTH_CODEC_ID_CVSD = 0x01,
318 BLUETOOTH_CODEC_ID_MSBC = 0x02,
319 } bluetooth_codec_type_t;
325 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
326 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
327 } bluetooth_hf_audio_connected_type_t;
333 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
334 } bluetooth_advertising_data_t;
340 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
341 } bluetooth_scan_resp_data_t;
344 * Advertising filter policy
347 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
348 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
349 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
350 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
351 } bluetooth_advertising_filter_policy_t;
357 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
358 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
359 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
360 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
361 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
362 } bluetooth_advertising_type_t;
365 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
366 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
367 } bluetooth_gatt_service_change_type_t;
370 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
371 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
372 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
373 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
374 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
375 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
376 } bt_gatt_permission_t;
379 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
380 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
381 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
382 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
383 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
384 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
385 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
386 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
387 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
388 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
389 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
390 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
391 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
392 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
393 } bt_gatt_characteristic_property_t;
396 * Remote device request types for attributes
399 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
400 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
401 } bluetooth_gatt_att_request_tyep_t;
404 * Advertising parameters
409 guint8 filter_policy;
411 } bluetooth_advertising_params_t;
417 int type; /**< passive 0, active 1 */
418 float interval; /**< LE scan interval */
419 float window; /**< LE scan window */
420 } bluetooth_le_scan_params_t;
430 } bluetooth_le_connection_param_t;
433 LE Read Maximum Data Length
436 guint16 max_tx_octets;
438 guint16 max_rx_octets;
440 } bluetooth_le_read_maximum_data_length_t;
443 LE Read Host suggested default Data Length
446 guint16 def_tx_octets;
448 } bluetooth_le_read_host_suggested_data_length_t;
451 * Samsung XSAT Vendor dependent command
456 } bluetooth_vendor_dep_at_cmd_t;
462 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
463 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
464 } bluetooth_opp_transfer_type_t;
469 } bluetooth_hf_ciev_device_event_t;
471 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
472 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
473 /**< Base ID for GAP Event */
474 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
475 /**< Base ID for SDP events */
476 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
477 /**< Base ID for RFCOMM events */
478 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
479 /**< Base ID for NETWORK events */
480 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
481 /**< Base ID for HDP events */
482 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
483 /**< Base ID for OPC events */
484 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
485 /**< Base ID for Obex Server events */
486 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
487 /**< Base ID for GATT events */
489 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
490 /**< Base ID for Audio events */
491 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
492 /**< Base ID for HID events */
493 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
494 /**< Base ID for Advertising events */
495 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
496 /**< Base ID for PBAP Client events */
497 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
498 /**< Base ID for AVRCP events */
499 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
500 /**< Base ID for IPSP events */
503 * Bluetooth event type
506 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
508 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
509 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
510 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
511 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
512 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
513 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
514 /**< Bluetooth event Discoverable timeout requested*/
515 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
516 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
517 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
518 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
519 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
520 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
521 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
522 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
523 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
524 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
525 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
526 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
527 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
528 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
529 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
530 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
531 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
532 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
533 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
534 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
535 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
537 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
538 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
539 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
540 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
541 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
543 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
544 /**< Bluetooth event serice search base id */
545 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
546 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
547 /**< RFCOMM data receive event */
548 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
549 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
551 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
553 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
554 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
556 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
558 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
559 /**< Bluetooth Network event */
560 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
561 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
562 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
563 /**< Network disconnected evnet in server */
565 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
566 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
568 BLUETOOTH_EVENT_HDP_CONNECTED
569 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
570 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
571 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
573 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
574 /* OPC Connected event */
575 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
576 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
577 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
578 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
580 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
581 /* Obex server authorize event*/
582 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
583 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
584 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
585 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
586 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
587 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
589 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
590 /**<Discovered GATT service characteristics event*/
591 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
592 /**<Remote GATT charateristic value changed event*/
593 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
594 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
595 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
596 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
597 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
598 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
599 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
600 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
601 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
602 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
603 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
604 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
605 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
606 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
607 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
609 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
610 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
611 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
612 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
613 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
614 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
615 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
616 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
617 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
618 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
619 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
620 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
621 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
622 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
623 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
624 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
625 BLUETOOTH_EVENT_HF_CONNECTED,
626 BLUETOOTH_EVENT_HF_DISCONNECTED,
627 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
628 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
629 BLUETOOTH_EVENT_HF_RING_INDICATOR,
630 BLUETOOTH_EVENT_HF_CALL_WAITING,
631 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
632 BLUETOOTH_EVENT_HF_CALL_STARTED,
633 BLUETOOTH_EVENT_HF_CALL_ENDED,
634 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
635 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
636 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
637 BLUETOOTH_EVENT_HF_CALL_STATUS,
638 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
639 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
640 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
641 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
642 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
643 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
644 BLUETOOTH_EVENT_HF_CALL_IDLE,
645 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
646 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
647 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
649 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
650 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
651 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
652 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
653 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
655 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
656 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
657 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
658 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
659 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
660 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
661 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
662 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
664 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
665 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
666 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
667 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
668 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
669 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
670 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
672 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
673 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
674 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
675 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
676 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
677 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
678 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
679 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
680 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
682 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
683 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
684 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
685 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
686 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
687 } bluetooth_event_type_t;
690 * This bt_service_uuid_list_t enum indicates service uuid list .
691 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
695 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
696 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
697 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
698 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
699 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
700 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
701 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
702 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
703 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
704 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
705 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
706 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
708 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
709 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
710 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
711 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
712 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
713 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
714 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
715 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
716 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
717 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
718 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
719 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
720 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
721 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
723 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
724 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
725 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
726 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
727 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
728 /**<DIRECT PRINTING*/
729 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
730 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
731 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
732 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
733 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
734 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
735 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
736 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
737 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
738 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
739 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
740 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
741 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
742 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
743 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
744 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
745 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
746 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
747 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
748 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
749 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
750 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
751 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
752 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
753 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
754 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
755 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
756 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
757 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
758 } bluetooth_service_uuid_list_t;
761 * Service class part of class of device returned from device discovery
764 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
765 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
766 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
767 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
768 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
769 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
770 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
771 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
772 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
773 } bluetooth_device_service_class_t;
777 * Major device mask (For device discovery)
780 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
781 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
782 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
783 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
784 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
785 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
786 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
787 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
788 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
789 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
790 } bluetooth_device_major_mask_t;
794 * Major device class (part of Class of Device)
797 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
798 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
799 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
800 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
801 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
802 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
803 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
804 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
805 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
806 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
807 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
808 } bluetooth_device_major_class_t;
811 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
813 /* About Computer Major class */
814 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
816 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
817 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
818 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
819 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
820 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
822 /* About Phone Major class */
823 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
824 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
825 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
826 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
827 /**< voice gateway minor class */
828 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
830 /* About LAN/Network Access Point Major class */
831 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
832 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
833 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
834 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
835 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
836 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
837 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
838 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
840 /* About Audio/Video Major class */
841 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
842 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
844 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
845 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
846 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
847 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
848 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
849 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
850 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
851 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
852 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
853 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
854 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
855 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
856 /**< Video Display and Loud
857 Speaker minor class */
858 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
861 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
863 /* About Peripheral Major class */
864 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
865 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
866 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
867 /**< Combo Keyboard or pointing
870 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
871 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
872 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
873 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
874 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
875 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
876 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
877 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
878 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
880 /* About Imaging Major class */
881 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
882 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
883 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
884 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
886 /* About Wearable Major class */
887 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
888 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
889 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
890 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
891 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
893 /* About Toy Major class */
894 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
895 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
896 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
897 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
898 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
900 /* About Health Major class */
901 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
902 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
903 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
904 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
905 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
906 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
907 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
908 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
909 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
910 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
911 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
912 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
913 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
914 } bluetooth_device_minor_class_t;
917 * structure to hold the device information
920 bluetooth_device_major_class_t major_class; /**< major device class */
921 bluetooth_device_minor_class_t minor_class; /**< minor device class */
922 bluetooth_device_service_class_t service_class;
923 /**< service device class */
924 } bluetooth_device_class_t;
927 * Discovery Role types
930 DISCOVERY_ROLE_BREDR = 0x1,
932 DISCOVERY_ROLE_LE_BREDR
933 } bt_discovery_role_type_t;
936 * Connected state types
939 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
940 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
941 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
942 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
943 } bluetooth_connected_link_t;
949 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
950 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
951 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
952 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
953 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
954 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
955 } bluetooth_le_scan_filter_feature_t;
961 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
962 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
963 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
964 } bluetooth_le_connection_mode_t;
967 * structure to hold the device information
970 bluetooth_device_address_t device_address; /**< device address */
971 bluetooth_device_name_t device_name; /**< device name */
972 bluetooth_device_class_t device_class; /**< device class */
973 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
974 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
976 int rssi; /**< received strength signal*/
977 gboolean paired; /**< paired flag */
978 bluetooth_connected_link_t connected; /**< connected link type */
979 gboolean trust; /**< trust flag */
980 gboolean is_alias_set; /** is device alias set flag**/
981 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
982 } bluetooth_device_info_t;
985 * structure to hold the LE device information
988 int data_len; /**< manafacturer specific data length */
989 bluetooth_advertising_data_t data; /**< manafacturer specific data */
990 } bluetooth_le_advertising_data_t;
993 bluetooth_device_address_t device_address; /**< device address */
994 int addr_type; /**< address type*/
995 int rssi; /**< received strength signal*/
996 bluetooth_le_advertising_data_t adv_ind_data;
997 bluetooth_le_advertising_data_t scan_resp_data;
998 } bluetooth_le_device_info_t;
1002 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1003 bluetooth_device_address_t device_address; /**< device address */
1004 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1005 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1006 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1007 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1008 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1009 bluetooth_le_advertising_data_t service_data; /**< service data */
1010 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1011 int manufacturer_id; /**< manufacturer ID */
1012 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1013 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1014 } bluetooth_le_scan_filter_t;
1017 bluetooth_device_address_t device_address; /**< device address */
1018 unsigned int mtu; /** < MTU set for the ATT connection */
1019 unsigned int status; /** < status of the MTU exchange */
1020 } bluetooth_le_att_mtu_info_t;
1023 * structure to hold the paired device information
1026 bluetooth_device_address_t device_address; /**< paired device address */
1027 bluetooth_device_name_t device_name; /**< device name */
1028 bluetooth_device_class_t device_class; /**< device class */
1029 } bluetooth_paired_device_info_t;
1032 * structure to hold the paired device information
1035 bluetooth_device_address_t device_address;
1036 /**< device address */
1037 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1038 /**< network interface name */
1039 } bluetooth_network_device_info_t;
1042 * Authentication event types
1046 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1047 BLUETOOTH_AUTH_PIN_REQUEST,
1048 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1049 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1050 } bluetooth_auth_type_t;
1053 * structure to hold the pincode/pass-key req informations
1056 bluetooth_device_address_t device_address; /**< remote device address */
1057 bluetooth_device_name_t device_name; /**< device name */
1058 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1059 } bluetooth_authentication_request_info_t;
1062 * Stucture to hold discovery option
1065 unsigned short max_response; /**< the number of maximum response */
1066 unsigned short discovery_duration;
1067 /**< duration of discovery (seconds) */
1068 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1069 classOfDevice variable */
1070 } bluetooth_discovery_option_t;
1073 * Stucture to hold event information
1076 int event; /**< event type */
1077 int result; /**< Success or error value */
1079 /**<parameter data pointer */
1081 } bluetooth_event_param_t;
1084 bluetooth_device_address_t device_addr;
1085 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1086 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1087 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1092 bluetooth_device_address_t device_addr;
1093 unsigned char addr_type;
1095 } bt_connection_info_t;
1098 * Stucture to rfcomm receive data
1103 /**< the socket fd */
1104 int buffer_size;/**< the length of the receive buffer */
1106 /**< the receive data buffer */
1107 } bluetooth_rfcomm_received_data_t;
1113 HTYPE_TRANS_HANDSHAKE,
1114 HTYPE_TRANS_HID_CONTROL,
1115 HTYPE_TRANS_GET_REPORT,
1116 HTYPE_TRANS_SET_REPORT,
1117 HTYPE_TRANS_GET_PROTOCOL,
1118 HTYPE_TRANS_SET_PROTOCOL,
1121 }bt_hid_header_type_t;
1127 PTYPE_DATA_RTYPE_INPUT,
1128 PTYPE_DATA_RTYPE_OUTPUT
1129 }bt_hid_param_type_t;
1132 * Stucture to hid receive data
1135 const char *address;
1136 bt_hid_header_type_t type;
1137 /**< Header type containing */
1138 bt_hid_param_type_t param;
1139 /**< Param type in header like INPUT Report or OutPut Report */
1140 int buffer_size;/**< the length of the receive buffer */
1142 /**< the receive data buffer */
1143 } bluetooth_hid_received_data_t;
1146 * Stucture to rfcomm connection
1150 int socket_fd; /**< the socket fd */
1151 int server_id; /* Server id */
1152 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1153 bluetooth_device_address_t device_addr;
1154 /**< device address */
1155 char uuid[BLUETOOTH_UUID_STRING_MAX];
1156 } bluetooth_rfcomm_connection_t;
1159 * Stucture to rfcomm disconnection
1163 /**< the socket fd */
1164 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1165 bluetooth_device_address_t device_addr;
1166 /**< device address */
1167 char uuid[BLUETOOTH_UUID_STRING_MAX];
1168 } bluetooth_rfcomm_disconnection_t;
1172 /**< the socket fd */
1173 bluetooth_device_address_t device_addr;
1174 /**< device address */
1175 } bluetooth_rfcomm_connection_request_t;
1179 /**< the socket fd */
1180 bluetooth_device_address_t device_addr;
1181 /**< device address */
1182 } bluetooth_hid_request_t;
1191 } bt_hdp_qos_type_t;
1197 HDP_ROLE_SOURCE = 0x0,
1199 } bt_hdp_role_type_t;
1203 * Stucture to HDP connected
1206 const char *app_handle; /**< the application handle */
1207 unsigned int channel_id; /**< the channel id */
1208 bt_hdp_qos_type_t type; /**< the QOS type */
1209 bluetooth_device_address_t device_address; /**< the remote address */
1210 } bt_hdp_connected_t;
1213 * Stucture to HDP disconnected
1216 unsigned int channel_id; /**< the channel id */
1217 bluetooth_device_address_t device_address; /**< the remote address */
1218 } bt_hdp_disconnected_t;
1221 * Stucture to HDP data indication
1224 unsigned int channel_id; /**< the channel id */
1225 const char *buffer; /**< the RX data buffer */
1226 unsigned int size; /**< the RX data size */
1227 } bt_hdp_data_ind_t;
1230 * Stucture to OPP client transfer information
1237 } bt_opc_transfer_info_t;
1239 /* Obex Server transfer type */
1240 #define TRANSFER_PUT "PUT"
1241 #define TRANSFER_GET "GET"
1243 * Stucture to OPP/FTP Server authorize information
1250 } bt_obex_server_authorize_into_t;
1258 } bt_obex_server_type_t;
1261 * Stucture to OPP/FTP server transfer information
1269 unsigned long file_size;
1271 bt_obex_server_type_t server_type;
1273 unsigned char *contact_auth_info;
1274 } bt_obex_server_transfer_info_t;
1277 * Stucture to OPP/FTP server connection/disconnection information
1283 } bt_obex_server_connection_info_t;
1287 * Stucture to OOB data
1291 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1292 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1293 unsigned int hash_len;
1294 unsigned int randomizer_len;
1296 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1297 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1298 unsigned int hash256_len;
1299 unsigned int randomizer256_len;
1303 * Structure to GATT attribute handle data
1309 } bt_gatt_handle_info_t;
1312 * Structure to GATT Remote service data
1319 bt_gatt_handle_info_t include_handles;
1320 bt_gatt_handle_info_t char_handle;
1321 } bt_gatt_service_property_t;
1324 * Structure to GATT Remote characteristic data
1328 char *service_handle;
1329 bt_gatt_handle_info_t handle_info;
1330 } bt_gatt_discovered_char_t;
1333 * Structure to format of GATT Characteristic Value
1337 unsigned char format;
1338 unsigned char exponent;
1339 unsigned short unit;
1340 unsigned char name_space;
1341 unsigned short description;
1342 } bt_gatt_char_format_t;
1345 * Structure to GATT Characteristic property
1353 bt_gatt_char_format_t format;
1355 unsigned int val_len;
1356 unsigned int permission;
1357 char *representation;
1358 bt_gatt_handle_info_t char_desc_handle;
1359 } bt_gatt_char_property_t;
1362 * Structure to GATT Characteristic descriptor property
1369 unsigned int val_len;
1370 } bt_gatt_char_descriptor_property_t;
1373 * Structure to GATT Characteristic value
1380 } bt_gatt_char_value_t;
1383 * Structure to GATT Read Request
1387 char *service_handle;
1391 } bt_gatt_read_req_t;
1394 * Structure to GATT Value change
1398 char *service_handle;
1404 } bt_gatt_value_change_t;
1407 bluetooth_device_address_t device_addr;
1409 bluetooth_gatt_service_change_type_t change_type;
1410 } bt_gatt_service_change_t;
1413 * Structure to GATT characteristc Notification change
1417 char *service_handle;
1418 gboolean att_notify;
1419 } bt_gatt_char_notify_change_t;
1422 * Structure to Indication confirmation
1426 char *service_handle;
1429 } bt_gatt_indicate_confirm_t;
1432 * Structure to RSSI Signal Strength Alert
1443 * Structure to RSSI Signal Strength
1453 * Structure for RSSI Enabled or Disabled
1459 gboolean rssi_enabled;
1460 } bt_rssi_enabled_t;
1463 * Structure for RSSI Threshold
1468 int in_range_threshold;
1470 } bt_rssi_threshold_t;
1474 * Structure for Suppoted Profiles and Trusted Profiles
1481 } bt_supported_profile_trusted_t;
1484 * Structure for PBAP Folder Parameters
1487 unsigned char addressbook;
1488 unsigned char folder_type;
1492 * Structure for PBAP Pull application Parameters
1495 unsigned char format;
1496 unsigned char order;
1497 unsigned short offset;
1498 unsigned short maxlist;
1499 long long unsigned fields;
1500 } bt_pbap_pull_parameters_t;
1503 * Structure for PBAP List application Parameters
1506 unsigned char order;
1507 unsigned short offset;
1508 unsigned short maxlist;
1509 } bt_pbap_list_parameters_t;
1512 * Structure for PBAP Pull vCard application Parameters
1515 unsigned char format;
1516 long long unsigned fields;
1518 } bt_pbap_pull_vcard_parameters_t;
1521 * Structure for PBAP Search application Parameters
1524 unsigned char order;
1525 unsigned short offset;
1526 unsigned short maxlist;
1527 unsigned char search_attribute;
1528 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1529 } bt_pbap_search_parameters_t;
1532 * Structure for PBAP Connection Status
1535 bluetooth_device_address_t btaddr;
1537 } bt_pbap_connected_t;
1540 * Structure for PBAP Phonebook Size
1543 bluetooth_device_address_t btaddr;
1545 } bt_pbap_phonebook_size_t;
1548 * Structure for PBAP Phonebook Pull
1551 bluetooth_device_address_t btaddr;
1554 } bt_pbap_phonebook_pull_t;
1557 * Structure for PBAP vCard List
1560 bluetooth_device_address_t btaddr;
1564 } bt_pbap_vcard_list_t;
1567 * Structure for PBAP vCard Pull
1570 bluetooth_device_address_t btaddr;
1573 } bt_pbap_vcard_pull_t;
1576 * Structure for PBAP Phonebook search List
1579 bluetooth_device_address_t btaddr;
1583 } bt_pbap_phonebook_search_list_t;
1586 * Stucture to HF Call status information
1590 char *number; /*Phone Number */
1591 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1592 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1593 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1594 int idx; /*Call index/ID */
1595 } bt_hf_call_status_info_t;
1600 } bt_hf_call_list_s;
1606 TRUSTED_PROFILE_PBAP = 1,
1607 TRUSTED_PROFILE_MAP,
1608 TRUSTED_PROFILE_SAP,
1609 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1610 } bluetooth_trusted_profile_t;
1613 * Structure for LE data length change params
1616 bluetooth_device_address_t device_address;
1617 guint16 max_tx_octets;
1618 guint16 max_tx_time;
1619 guint16 max_rx_octets;
1620 guint16 max_rx_time;
1621 } bt_le_data_length_params_t;
1625 * @brief DPM BT allowance state
1629 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1630 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1631 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1632 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1636 * @brief DPM API result
1640 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1641 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1642 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1643 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1644 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1645 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1649 * @brief DPM Policy status
1653 BLUETOOTH_DPM_STATUS_ERROR = -1,
1655 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1656 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1658 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1659 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1661 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1662 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1666 /* policy-group : BLUETOOTH */
1667 BLUETOOTH_DPM_POLICY_ALLOW,
1668 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1669 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1670 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1671 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1672 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1673 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1674 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1675 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1676 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1677 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1678 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1679 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1680 BLUETOOTH_DPM_POLICY_END,
1681 } bt_dpm_policy_cmd_t;
1684 struct bt_dpm_policy {
1690 typedef struct bt_dpm_policy bt_dpm_policy_t;
1693 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1694 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1695 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1696 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1697 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1698 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1699 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1700 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1701 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1702 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1703 BLUETOOTH_DPM_PROFILE_NONE,
1706 struct bt_dpm_profile_val {
1707 int value; /* tells whether the profile is enabled or disabled */
1709 typedef struct dpm_profile_val dpm_profile_state_t;
1712 * Structure to DPM device list
1716 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1717 } bt_dpm_device_list_t;
1720 * Structure to DPM uuid list
1724 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1725 } bt_dpm_uuids_list_t;
1728 * Structure for IPSP Interface Info
1731 bluetooth_device_address_t btaddr;
1733 } bt_ipsp_connection_info_t;
1736 * Callback pointer type
1738 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1741 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1742 * @brief Set the callback function pointer for bluetooth event
1745 * This API will register the callback function, when any response and event are received from
1746 * bluetooth framework. @n
1747 * this registered callback function will be get called with appropriate event and data structures.
1748 * This function is a synchronous call. An application developer can call
1749 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1750 * type. This registered function will receive events of bluetooth_event_type_t type along with
1754 * @param[in] callback_ptr A pointer to the callback function
1755 * @param[in] user_data A pointer to user data
1756 * @return BLUETOOTH_ERROR_NONE - Success
1760 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1762 GMainLoop *main_loop = (GMainLoop*) user_data;
1766 // Code for each event
1768 g_main_loop_quit(main_loop);
1775 GMainLoop *main_loop = NULL;
1778 main_loop = g_main_loop_new(NULL, FALSE);
1779 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1780 if (ret >= BLUETOOTH_ERROR_NONE)
1782 // bluetooth_register_callback returned Success
1786 // bluetooth_register_callback returned failiure
1788 g_main_loop_run(main_loop);
1792 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1795 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1796 * @brief Set the callback function pointer for bluetooth le event
1799 * This API will register the callback function, when any response and event are received from
1800 * bluetooth framework. @n
1801 * this registered callback function will be get called with appropriate event and data structures.
1802 * This function is a synchronous call. An application developer can call
1803 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1804 * type. This registered function will receive events of bluetooth_event_type_t type along with
1808 * @param[in] callback_ptr A pointer to the callback function
1809 * @param[in] user_data A pointer to user data
1810 * @return BLUETOOTH_ERROR_NONE - Success
1814 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1817 * @fn int bluetooth_le_unregister_callback(void)
1818 * @brief Set the callback function pointer for bluetooth le event
1821 * This API will register the callback function, when any response and event are received from
1822 * bluetooth framework. @n
1823 * this registered callback function will be get called with appropriate event and data structures.
1824 * This function is a synchronous call. An application developer can call
1825 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1826 * type. This registered function will receive events of bluetooth_event_type_t type along with
1831 * @return BLUETOOTH_ERROR_NONE - Success
1835 int bluetooth_le_unregister_callback(void);
1838 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1839 * @brief Set the callback function pointer for bluetooth event
1842 * This API will register the callback function, when any response and event are received from
1843 * bluetooth framework. @n
1844 * this registered callback function will be get called with appropriate event and data structures.
1845 * This function is a synchronous call. An application developer can call
1846 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1847 * type. This registered function will receive events of bluetooth_event_type_t type along with
1852 * @return BLUETOOTH_ERROR_NONE - Success
1856 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1858 GMainLoop *main_loop = (GMainLoop*) user_data;
1862 // Code for each event
1864 g_main_loop_quit(main_loop);
1871 GMainLoop *main_loop = NULL;
1874 main_loop = g_main_loop_new(NULL, FALSE);
1875 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1876 if (ret >= BLUETOOTH_ERROR_NONE)
1878 // bluetooth_register_callback returned Success
1882 // bluetooth_register_callback returned failiure
1884 ret = bluetooth_deregister_callback(void);
1885 g_main_loop_run(main_loop);
1889 int bluetooth_unregister_callback(void);
1892 * @fn int bluetooth_enable_adapter(void)
1893 * @brief Enable the Bluetooth H/W
1896 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1897 * send request to bluetooth chip for activation.
1898 * This function is typically called at startup or when Bluetooth services are required. This
1899 * function must be called before calling any other API of Bluetooth operations.
1901 * Before performing any operations like Device discover, service search etc.., the adapter must be
1904 * This function is a asynchronous call.
1905 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1906 * through registered callback function with appropriate result code
1907 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1908 * BLUETOOTH_ERROR_NONE - Success \n
1910 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1911 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1913 * @return BLUETOOTH_ERROR_NONE - Success\n
1914 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1915 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1916 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1917 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1919 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1921 void bt_event_callback(int event, bluetooth_event_param_t *param)
1925 case BLUETOOTH_EVENT_ENABLED:
1926 if (param->result == BLUETOOTH_ERROR_NONE)
1928 // Successfully Enabled
1941 ret = bluetooth_enable_adapter();
1945 int bluetooth_enable_adapter(void);
1948 * @fn int bluetooth_disable_adapter(void)
1949 * @brief Disable the Bluetooth H/W
1952 * This function disables Bluetooth protocol stack and hardware. This function is called when
1953 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1955 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1956 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1957 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1959 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1962 * This function is a asynchronous call.
1963 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1964 * through registered callback function.
1967 * @return BLUETOOTH_ERROR_NONE - Success\n
1968 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1969 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1970 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1972 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1974 void bt_event_callback(int event, bluetooth_event_param_t *param)
1978 case BLUETOOTH_EVENT_DISABLED:
1979 if (param->result == BLUETOOTH_ERROR_NONE)
1981 // Successfully disabled
1994 ret = bluetooth_disable_adapter();
1997 int bluetooth_disable_adapter(void);
1998 int bluetooth_recover_adapter(void);
1999 int bluetooth_check_adapter_le(void);
2000 int bluetooth_enable_adapter_le(void);
2002 int bluetooth_disable_adapter_le(void);
2005 * @fn int bluetooth_reset_adapter(void)
2006 * @brief Reset the Bluetooth H/W and values
2009 * This function resets Bluetooth protocol stack and hardware. This function is called when
2010 * an user want to initialize Bluetooth environment.
2012 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2015 * This function is a synchronous call.
2017 * @return BLUETOOTH_ERROR_NONE - Success\n
2018 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2020 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2025 ret = bluetooth_reset_adapter();
2028 int bluetooth_reset_adapter(void);
2031 * @fn int bluetooth_is_supported(void)
2032 * @brief Check if the bluetooth is supported or not by the current target
2034 * This API checks whether the bluetooth is supported or not.
2035 * This API only run by root permission.
2037 * This function is a synchronous call.
2039 * @return 0 - if bluetooth is not supported\n
2040 * 1 - if bluetooth is supported\n
2041 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2046 ret = bluetooth_is_supported();
2049 int bluetooth_is_supported(void);
2053 * @fn int bluetooth_check_adapter(void)
2054 * @brief Check the current status of the Bluetooth adapter
2057 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2058 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2059 * bluetooth adapter.
2060 * This API get the adapter internal data structure and check current adapter status.
2062 * This function is a synchronous call.
2065 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2066 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2068 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2072 ret = bluetooth_check_adapter();
2075 int bluetooth_check_adapter(void);
2078 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2079 * @brief Get the local adapter bluetooth address
2082 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2083 * the adapter should be enabled.
2084 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2085 * contain Bluetooth address.
2086 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2087 * friendly name for each device.
2088 * There is no event callback for this API.
2090 * This function is a synchronous call.
2093 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2094 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2095 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2096 * @param[out] local_address a device address of local bluetooth adapter
2101 bluetooth_device_address_t local_address={0,};
2104 ret = bluetooth_get_local_address(&local_address);
2107 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2110 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2111 * @brief Get the hci version
2114 * This function is used to get the bluetooth hci version
2115 * Before calling this API make sure that the adapter is enabled.
2117 * This function is a synchronous call.
2120 * @return BLUETOOTH_ERROR_NONE - Success \n
2121 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2122 * @param[out] timeout remain visibility timeout value
2125 bluetooth_version_t *version;
2127 ret = bluetooth_get_local_version (&version);
2130 int bluetooth_get_local_version(bluetooth_version_t *version);
2133 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2134 * @brief Get the local device name
2137 * This function is used, get the local device name. Since its difficult to remember the Adapter
2138 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2139 * friendly name is retrived by the remote device and displaying.
2140 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2142 * This function is a synchronous call.
2145 * @return BLUETOOTH_ERROR_NONE - Success \n
2146 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2147 * @param[out] local_name a local device name
2151 bluetooth_device_name_t local_name={0,}
2153 ret = bluetooth_get_local_name (&local_name);
2156 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2159 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2160 * @brief Set the local device name
2163 * This function is used to set the local device name. This is a human friendly name whose
2164 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2166 * This function is a synchronous call.
2168 * @param[in] local_name bluetooth device name to set local device
2170 * @return BLUETOOTH_ERROR_NONE - Success \n
2171 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2172 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2173 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2174 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2175 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2180 bluetooth_device_name_t local_name={0,}
2182 ret = bluetooth_set_local_name (&local_name);
2185 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2189 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2190 * @brief Check if the uuid is used or not
2192 * This function is used to check if the uuid is used or not.
2194 * This function is a synchronous call.
2196 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2197 * @param[out] used if the uuid is used or not
2199 * @return BLUETOOTH_ERROR_NONE - Success \n
2200 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2201 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2202 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2207 gboolean used = FALSE;
2208 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2209 ret = bluetooth_is_service_used(uuid, &used);
2212 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2215 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2216 * @brief Check if the device is connected to the specific service
2218 * This function is used to check if if the device is connected to the specific service.
2220 * This function is a synchronous call.
2222 * @param[in] local_address a device address of remote bluetooth device
2223 * @param[in] type the service type
2224 * @param[out] is_connected if the device is connected or not
2226 * @return BLUETOOTH_ERROR_NONE - Success \n
2227 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2228 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2229 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2234 gboolean is_connected = FALSE;
2235 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2236 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2239 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2240 bluetooth_service_type_t type,
2241 gboolean *is_connected);
2244 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2245 * @brief Gets device's connected link type
2247 * This function is used to get device's connected link type
2249 * This function is a synchronous call.
2251 * @param[in] device_address a device address of remote bluetooth device
2252 * @param[out] connected_link a device's connected link type
2254 * @return BLUETOOTH_ERROR_NONE - Success \n
2255 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2256 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2257 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2262 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2263 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2264 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2267 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2268 bluetooth_connected_link_t *connected_link);
2271 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2272 * @brief Sets a profile trusted for a device
2274 * This function is used to Set a profile as trusted for a device
2276 * This function is a synchronous call.
2278 * @param[in] device_address a device address of remote bluetooth device
2279 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2280 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2282 * @return BLUETOOTH_ERROR_NONE - Success \n
2283 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2284 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2285 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2289 int bluetooth_set_profile_trusted(
2290 const bluetooth_device_address_t *device_address,
2291 int profile, int trust);
2294 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2295 * @brief Gets a profile is trusted for a device
2297 * This function is used to Get a profile is trusted or not for a device
2299 * This function is a synchronous call.
2301 * @param[in] device_address a device address of remote bluetooth device
2302 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2303 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2305 * @return BLUETOOTH_ERROR_NONE - Success \n
2306 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2307 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2308 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2312 int bluetooth_get_profile_trusted(
2313 const bluetooth_device_address_t *device_address,
2314 int profile, int *trust);
2317 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2318 * @brief Get the visibility mode
2321 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2322 * visibity mode, the property of the device is determined whether it can be discoverable, non
2323 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2325 * This function is a synchronous call.
2328 * @return BLUETOOTH_ERROR_NONE - Success \n
2329 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2330 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2331 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2332 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2333 * @param[out] discoverable_mode current bluetooth discoverable mode
2335 * @see bluetooth_set_discoverable_mode
2337 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2339 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2342 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2345 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2347 * @brief Set the visibility mode
2350 * This function is used to set the discoverable mode (Visibility option).
2352 * Many times user may want to keep his device discoverable so that when peer device is performing
2353 * device search, he/she can find user's device. Application programmer can keep the mode as
2354 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2355 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2356 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2357 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2359 * This function is a synchronous call.
2361 * @return BLUETOOTH_ERROR_NONE - Success \n
2362 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2364 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2365 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2367 * @see bluetooth_get_discoverable_mode
2371 bluetooth_discoverable_mode_t mode;
2373 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2374 ret = bluetooth_set_discoverable_mode (mode, 180);
2378 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2383 * @fn int bluetooth_get_timeout_value(int *timeout)
2384 * @brief Get the visibility timeout value
2387 * This function is used to get the visibility timeout
2388 * Before calling this API make sure that the adapter is enabled.
2390 * This function is a synchronous call.
2393 * @return BLUETOOTH_ERROR_NONE - Success \n
2394 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2395 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2396 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2397 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2398 * @param[out] timeout remain visibility timeout value
2400 * @see bluetooth_set_discoverable_mode
2404 ret = bluetooth_get_timeout_value (&timeout);
2407 int bluetooth_get_timeout_value(int *timeout);
2411 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2412 * unsigned int classOfDeviceMask)
2413 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2415 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2416 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2417 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2418 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2419 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2420 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2421 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2422 * please see bluetooth_device_info_t for more details.
2425 * This API provides searching options like max responses, discovery duration in seconds and class
2426 * of device mask to filter device search. some times there may be too many bluetooth devices in
2427 * vicinity of your device.in such scenario, application can request to reduce number of responces
2428 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2429 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2430 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2431 * application defined time. please note that discovery_duration should be mentioned in seconds.
2432 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2435 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2436 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2437 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2439 * This function is a asynchronous call.
2440 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2441 * through registered callback function.
2443 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2444 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2446 * The completion or cancellation of the discovery is indicated by an
2447 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2449 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2452 * @return BLUETOOTH_ERROR_NONE - Success \n
2453 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2454 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2455 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2456 agent is not running \n
2458 * @param[in] max_response define the maximum response of the number of founded devices
2460 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2461 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2462 (refer to class of device)
2464 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2467 void bt_event_callback(int event, bluetooth_event_param_t *param)
2471 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2473 bluetooth_device_info_t *device_info = NULL;
2474 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2476 device_info = (bluetooth_device_info_t *)param->param_data;
2477 memcpy(&searched_device, &device_info->device_address,
2478 sizeof(bluetooth_device_address_t));
2479 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2480 device_info->device_address.addr[0],
2481 device_info->device_address.addr[1],
2482 device_info->device_address.addr[2],
2483 device_info->device_address.addr[3],
2484 device_info->device_address.addr[4],
2485 device_info->device_address.addr[5]);
2488 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2490 bluetooth_device_info_t *device_info = NULL;
2491 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2493 device_info = (bluetooth_device_info_t *)param->param_data;
2494 memcpy(&searched_device, &device_info->device_address,
2495 sizeof(bluetooth_device_address_t));
2496 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2497 device_info->device_name.name,
2498 device_info->device_address.addr[0],
2499 device_info->device_address.addr[1],
2500 device_info->device_address.addr[2],
2501 device_info->device_address.addr[3],
2502 device_info->device_address.addr[4],
2503 device_info->device_address.addr[5]);
2507 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2508 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2513 unsigned short max_response;
2514 unsigned short discovery_duration;
2515 unsigned classOfDeviceMask;
2519 discovery_duration =0;
2520 classOfDeviceMask =0;
2522 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2527 int bluetooth_start_discovery(unsigned short max_response,
2528 unsigned short discovery_duration,
2529 unsigned int classOfDeviceMask);
2532 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2533 * unsigned short max_response,
2534 * unsigned short discovery_duration,
2535 * unsigned int classOfDeviceMask)
2536 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2538 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2539 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2540 * Please see bluetooth_start_discovery() for other parameters description.
2542 * This function is a asynchronous call.
2543 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2544 * through registered callback function.
2546 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2547 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2549 * The completion or cancellation of the discovery is indicated by an
2550 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2552 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2555 * @return BLUETOOTH_ERROR_NONE - Success \n
2556 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2557 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2558 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2559 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2560 agent is not running \n
2562 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2563 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2564 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2565 * @param[in] max_response define the maximum response of the number of founded devices
2567 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2568 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2569 (refer to class of device)
2571 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2574 unsigned short type;
2575 unsigned short max_response;
2576 unsigned short discovery_duration;
2577 unsigned classOfDeviceMask;
2582 discovery_duration =0;
2583 classOfDeviceMask =0;
2585 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2590 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2591 unsigned short max_response,
2592 unsigned short discovery_duration,
2593 unsigned int classOfDeviceMask);
2596 * @fn int bluetooth_cancel_discovery (void)
2597 * @brief Cancel the on-going device discovery operation
2600 * This function stops the on-going device discovery operation. This API has to be called after the
2601 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2602 * the bluetooth_start_discovery API
2604 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2605 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2606 * cancel the discover request once the user received the device to which he wish to connect.
2608 * This function is a asynchronous call.
2609 * If the call is success to cancel discovey then the application will receive
2610 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2611 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2612 * BLUETOOTH_ERROR_NONE
2615 * @return BLUETOOTH_ERROR_NONE - Success \n
2616 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2617 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2618 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2619 other application \n
2620 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2622 * @see bluetooth_start_discovery
2624 void bt_event_callback(int event, bluetooth_event_param_t *param)
2628 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2629 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2638 ret = bluetooth_cancel_discovery();
2641 int bluetooth_cancel_discovery(void);
2644 * @fn int bluetooth_start_le_discovery(void)
2645 * @brief Start the generic device discovery which finds the LE devices.
2647 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2648 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2649 * It try to find LE devices. Bluetooth device address and name are
2650 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2651 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2652 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2653 * please see bluetooth_device_info_t for more details.
2655 * This function is a asynchronous call.
2656 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2657 * through registered callback function.
2659 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2662 * The completion or cancellation of the discovery is indicated by an
2663 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2665 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2668 * @return BLUETOOTH_ERROR_NONE - Success \n
2669 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2670 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2671 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2672 agent is not running \n
2675 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2678 void bt_event_callback(int event, bluetooth_event_param_t *param)
2682 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2684 bluetooth_device_info_t *device_info = NULL;
2685 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2687 device_info = (bluetooth_device_info_t *)param->param_data;
2688 memcpy(&searched_device, &device_info->device_address,
2689 sizeof(bluetooth_device_address_t));
2690 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2691 device_info->device_address.addr[0],
2692 device_info->device_address.addr[1],
2693 device_info->device_address.addr[2],
2694 device_info->device_address.addr[3],
2695 device_info->device_address.addr[4],
2696 device_info->device_address.addr[5]);
2700 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2701 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2707 ret = bluetooth_start_discovery();
2712 int bluetooth_start_le_discovery(void);
2715 * @fn int bluetooth_stop_le_discovery (void)
2716 * @brief Cancel the on-going device LE discovery operation
2719 * This function stops the on-going device discovery operation. This API has to be called after the
2720 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2721 * the bluetooth_start_le_discovery API
2724 * This function is a asynchronous call.
2725 * If the call is success to cancel discovey then the application will receive
2726 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2727 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2728 * BLUETOOTH_ERROR_NONE
2731 * @return BLUETOOTH_ERROR_NONE - Success \n
2732 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2733 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2734 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2735 other application \n
2736 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2738 * @see bluetooth_start_discovery
2740 void bt_event_callback(int event, bluetooth_event_param_t *param)
2744 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2745 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2754 ret = bluetooth_stop_le_discovery();
2757 int bluetooth_stop_le_discovery(void);
2760 * @fn int bluetooth_is_discovering(void)
2761 * @brief Check for the device discovery is in-progress or not.
2763 * This API is used to check the current status of the Discovery operation.If discovery is in\
2764 * progress normally other operations are not allowed.
2765 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2766 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2767 * event before performing other operations. This API is used to get for the current discovery
2768 * operation status and using bluetooth_cancel_discovery()
2769 * we can cancell the ongoing discovery process.
2770 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2773 * This function checks whether the device discovery is started or not.
2775 * This function is a synchronous call.
2778 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2779 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2780 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2783 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2787 ret = bluetooth_is_discovering ();
2790 int bluetooth_is_discovering(void);
2793 * @fn int bluetooth_is_le_discovering(void)
2794 * @brief Check for the device LE discovery is in-progress or not.
2796 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2797 * progress normally other operations are not allowed.
2798 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2799 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2800 * event before performing other operations. This API is used to get for the current discovery
2801 * operation status and using bluetooth_stop_le_discovery()
2802 * we can cancell the ongoing LE discovery process.
2803 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2806 * This function checks whether the device LE discovery is started or not.
2808 * This function is a synchronous call.
2811 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2812 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2813 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2816 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2820 ret = bluetooth_is_le_discovering ();
2823 int bluetooth_is_le_discovering(void);
2826 * @fn int bluetooth_is_le_scanning(void)
2827 * @brief Check for the device LE scan is in-progress or not.
2829 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2830 * progress normally other operations are not allowed.
2832 * This function checks whether the device LE Scan is started or not.
2834 * This function is a synchronous call.
2836 * @return TRUE - LE Scan in progress \n
2837 * FALSE - LE Scan is not in progress \n
2842 gboolean is_le_scanning = 0;
2843 is_le_scanning = bluetooth_is_le_scanning ();
2846 gboolean bluetooth_is_le_scanning(void);
2848 gboolean bluetooth_is_scan_filter_supported(void);
2851 * @fn int bluetooth_force_hcidump(int timeout)
2852 * @brief Enable /disable force-hcidump
2854 * This function control force-hcidump.
2856 * This function is a synchronous call.
2858 * @return BLUETOOTH_ERROR_NONE - Success \n
2859 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2860 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2862 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
2867 int bluetooth_force_hcidump(int timeout);
2870 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2871 * @brief Register scan filter.
2873 * This function registers the scan filter.
2875 * This function is a synchronous call.
2877 * @return BLUETOOTH_ERROR_NONE - Success \n
2879 * @param[in] filter scan filter to register
2880 * @param[out] slot_id the slot ID of scan filter
2884 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2887 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2888 * @brief Register scan filter.
2890 * This function unregisters the scan filter.
2892 * This function is a synchronous call.
2894 * @return BLUETOOTH_ERROR_NONE - Success \n
2896 * @param[in] slot_id the slot ID of scan filter
2900 int bluetooth_unregister_scan_filter(int slot_id);
2903 * @fn int bluetooth_unregister_all_scan_filters(void)
2904 * @brief Register scan filter.
2906 * This function usregisters all scan filters.
2908 * This function is a synchronous call.
2910 * @return BLUETOOTH_ERROR_NONE - Success \n
2914 int bluetooth_unregister_all_scan_filters(void);
2917 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2918 int link_type, bt_rssi_threshold_t rssi_threshold)
2919 * @brief Enable RSSI monitoring
2921 * This function enables RSSI monitoring and sets threshold for a connection
2923 * @return BLUETOOTH_ERROR_NONE - Success \n
2926 * @see bluetooth_get_rssi_strength
2928 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2929 int link_type, bt_rssi_threshold_t *rssi_threshold);
2932 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2933 * @brief Gets Raw RSSI signal Strength
2935 * This function gives the Raw RSSI signal strength for a connection.
2937 * @return BLUETOOTH_ERROR_NONE - Success \n
2940 * @see bluetooth_enable_rssi
2942 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2944 int bluetooth_set_connectable(gboolean is_connectable);
2946 int bluetooth_is_connectable(gboolean *is_connectable);
2949 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2950 * @brief Initiate a bonding process
2953 * This function initiates a bonding procedure with a peer device. The bonding procedure
2954 * enables authentication and optionally encryption on the Bluetooth link.
2956 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2957 * inititate the bonding request to the devices already in the paired list.
2959 * Usually we call this API after the device discovery.
2960 * This function is a asynchronous call.
2962 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2963 * mentioed result code
2964 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2965 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2966 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2967 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2968 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2970 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2971 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2974 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2977 * @return BLUETOOTH_ERROR_NONE - Success \n
2978 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2979 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2980 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2981 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2983 * @param[in] device_address This indicates an address of the device with which the pairing
2984 * should be initiated
2986 * @see bluetooth_cancel_bonding
2988 void bt_event_callback(int event, bluetooth_event_param_t *param)
2992 case BLUETOOTH_EVENT_BONDING_FINISHED:
2994 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2995 if (param->result >= BLUETOOTH_ERROR_NONE)
2997 bluetooth_device_info_t *device_info = NULL;
2998 device_info = (bluetooth_device_info_t *)param->param_data;
2999 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3000 mjr[%#x] min[%#x] srv[%#x]",
3001 device_info->device_name.name,
3002 device_info->device_address.addr[0],
3003 device_info->device_address.addr[1],
3004 device_info->device_address.addr[2],
3005 device_info->device_address.addr[3],
3006 device_info->device_address.addr[4],
3007 device_info->device_address.addr[5],
3008 device_info->device_class.major_class,
3009 device_info->device_class.minor_class,
3010 device_info->device_class.service_class);
3024 bluetooth_device_address_t device_address={{0}};
3026 ret = bluetooth_bond_device(&device_address);
3030 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3033 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3034 * bluetooth_conn_type_t conn_type)
3035 * @brief Initiate a bonding process
3038 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3039 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3041 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3042 * inititate the bonding request to the devices already in the paired list.
3044 * Usually we call this API after the device discovery.
3045 * This function is a asynchronous call.
3047 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3048 * mentioed result code
3049 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3050 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3051 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3052 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3053 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3055 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3056 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3059 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3062 * @return BLUETOOTH_ERROR_NONE - Success \n
3063 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3064 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3065 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3066 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3068 * @param[in] device_address This indicates an address of the device with which pairing
3069 * should be initiated
3070 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3073 * @see bluetooth_cancel_bonding
3075 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3076 bluetooth_conn_type_t conn_type);
3079 * @fn int bluetooth_cancel_bonding(void)
3080 * @brief Cancel the on-going bonding process
3082 * This API is called to cancel the on-going bonding procedure. It should be called before the
3083 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3084 * This API is useful when the remote device is not responding to the bond request or we wish to
3085 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3087 * This function is a synchronous call.
3089 * @return BLUETOOTH_ERROR_NONE - Success \n
3090 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3091 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3094 * @see bluetooth_bond_device
3100 ret = bluetooth_cancel_bonding();
3103 int bluetooth_cancel_bonding(void);
3106 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3107 * @brief Remove bonding
3110 * To communicate with remote device over bluetooth link, user should bond with peer device.
3111 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3112 * API is used to remove peer device from the list. Please note that after removing the device
3113 * from bonded device list, you cannot communication with peer device until bonding happens again.
3115 * User can call this function by passing bluetooth device address of any bonded device. Please note
3116 * that after successful return of this function, any bluetooth application running on your device
3117 * will not be able to communicate with unbonded device until bond operation happens again using
3118 * bluetooth_bond_device()
3121 * This function is a asynchronous call. The request to remove the specified device from the bonded
3122 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3123 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3124 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3128 * @return BLUETOOTH_ERROR_NONE - Success \n
3129 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3130 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3131 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3132 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3133 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3134 * agent is not running \n
3135 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3138 * @param[in] device_address This indicates an address of the device to remove bonding
3142 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3145 void bt_event_callback(int event, bluetooth_event_param_t *param)
3148 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3149 bluetooth_device_address_t *dev_addr = NULL;
3151 if (param->result == BLUETOOTH_ERROR_NONE) {
3152 dev_addr = (bluetooth_device_address_t *)param->param_data;
3154 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3155 dev_addr->addr[0], dev_addr->addr[1]
3156 dev_addr->addr[2], dev_addr->addr[3]
3157 dev_addr->addr[4], dev_addr->addr[5]
3168 bluetooth_device_address_t *device_address;
3170 // copy valid device address in device_address
3172 ret = bluetooth_unbond_device(device_address);
3175 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3178 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3179 * @brief Get bonded(paired) device list
3182 * This API gets all bonded device list.
3183 * The devices in the bonded device list further can be used to perform the authorization by calling
3184 * bluetooth_authorize_device API.
3186 * This function is a synchronous call.
3187 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3188 * there is no valid information in the dev_list.
3189 * The len field in the dev_list represents the number of bonded devices. The data structure for
3190 * bonded device information is bluetooth_device_info_t.
3193 * @return BLUETOOTH_ERROR_NONE - Success \n
3194 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3196 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3198 void bt_get_bonded_devices(void)
3202 GPtrArray *devinfo = NULL;
3203 bluetooth_device_info_t *ptr;
3205 // allocate the g_pointer_array
3206 devinfo = g_ptr_array_new();
3208 ret = bluetooth_get_bonded_device_list(&devinfo);
3209 if (ret != BLUETOOTH_ERROR_NONE)
3211 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3215 printf("g pointer arrary count : [%d]", devinfo->len);
3216 for (i=0; i<devinfo->len; i++)
3218 ptr = g_ptr_array_index(devinfo, i);
3221 printf("Name [%s]\n", ptr->device_name.name);
3222 printf("Major Class [%d]\n", ptr->device_class.major_class);
3223 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3224 printf("Service Class [%d]\n", ptr->device_class.service_class);
3225 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3226 ptr->device_address.addr[0],
3227 ptr->device_address.addr[1], ptr->device_address.addr[2],
3228 ptr->device_address.addr[3],
3229 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3236 // free g_pointer_array
3237 g_ptr_array_free(devinfo, TRUE);
3242 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3244 int bluetooth_get_profile_connected_device_list(
3245 const char *profile_uuid, GPtrArray **addr_list);
3248 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3249 * bluetooth_device_info_t *dev_info)
3250 * @brief Get a bonded(paired) device
3253 * This API gets a bonded device.
3255 * This function is a synchronous call.
3256 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3257 * there is no valid information in the dev_info.
3258 * The data structure for bonded device information is bluetooth_device_info_t.
3261 * @return BLUETOOTH_ERROR_NONE - Success \n
3262 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3264 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3266 void bt_get_bonded_device(void)
3270 bluetooth_device_info_t devinfo = {0};
3271 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3273 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3274 if (ret != BLUETOOTH_ERROR_NONE)
3276 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3280 printf("Name [%s]\n", devinfo.device_name.name);
3281 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3282 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3283 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3284 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3285 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3286 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3287 devinfo.device_address.addr[5]);
3296 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3297 bluetooth_device_info_t *dev_info);
3300 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3301 * @brief set alias for bonded device
3304 * This function set alias for bonded device.
3306 * This function is a synchronous call.
3309 * @return BLUETOOTH_ERROR_NONE - Success \n
3310 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3311 * @param[in] device_address This indicates an address of the remote device
3312 * @param[in] alias This indicates an alias to set
3317 ret = bluetooth_set_alias(&remote_address);
3320 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3324 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3325 * @brief Get remote deivice
3328 * This function gets specific remote device.
3330 * This function is a asynchronous call.
3331 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3334 * @return BLUETOOTH_ERROR_NONE - Success \n
3335 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3336 * @param[in] device_address This indicates an address of the remote device
3341 ret = bluetooth_get_remote_device(&remote_address);
3344 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3347 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3348 * gboolean authorized)
3349 * @brief Authorize/Unauthorize a bonded device
3352 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3353 * with/without user confirmation.
3355 * If we select a paired device and make it authorized by calling this API with the authorized
3356 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3357 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3358 * then it will ask for the user conformation before the connection.
3360 * This API supposed to be called on the paired devices. Which means we have to use this API only
3361 * after successful pairing.
3363 * This function is a asynchronous call.
3364 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3366 * @return BLUETOOTH_ERROR_NONE - Success \n
3367 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3368 * @param[in] device_address This indicates an address of the device to authorize \n
3369 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3371 * @see bluetooth_get_bonded_device_list
3373 void bt_event_callback(int event, bluetooth_event_param_t *param)
3377 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3379 if (param->result == BLUETOOTH_ERROR_NONE)
3383 //device authorization failed failure
3391 bluetooth_device_address_t device_address={{0}};
3392 gboolean authorized;
3396 ret = bluetooth_authorize_device(&device_address,authorized);
3399 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3400 gboolean authorized);
3402 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3403 const bluetooth_device_pin_code_t *pin_code);
3405 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3408 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3410 * @brief Receives Legacy Passkey\pin with following authentication response types
3412 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3413 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3416 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3419 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3421 * @brief This API sends user confirmation reply to the local adapter.
3423 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3426 int bluetooth_passkey_confirmation_reply(gboolean reply);
3429 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3430 * @brief Get all services supported by remote device
3433 * This API call initiates the search for the services supported by the specified device. Normally
3434 * the service search will take a couple of seconds to get it completed. Before calling this API
3435 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3436 * perform the service search. We can get the device address by doing a device discovery operation.
3439 * This function is a asynchronous call.
3440 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3442 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3443 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3444 * event is generated with appropriate result code.
3446 * @return BLUETOOTH_ERROR_NONE - Success \n
3447 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3448 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3449 * @param[in] device_address This indicates an address of the device
3450 * whose services need to be found
3452 * @see bluetooth_cancel_service_search
3454 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3457 * @fn int bluetooth_cancel_service_search(void)
3458 * @brief Cancel the ongoing service search operation
3461 * This function cancel the ongoing service search operation. This API is usually calling after the
3462 * bluetooth_search_service API.
3463 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3464 * if the user wish to cancel the Ongoing service search operation.
3466 * This API should be called just after the bluetooth_search_service API and before the
3467 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3469 * This function is a synchronous call.
3471 * @return BLUETOOTH_ERROR_NONE - Success \n
3472 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3473 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3474 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3477 * @see bluetooth_search_service
3482 ret = bluetooth_cancel_service_search();
3485 int bluetooth_cancel_service_search(void);
3488 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3489 * @brief Register rfcomm socket with a specific uuid
3492 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3493 * descriptor of the server.
3494 * This is the first API which is called to create the server. Once we created the server socket,
3495 * we will listen on that return socket.
3496 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3499 * @return socket FD on Success \n
3500 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3501 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3502 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3503 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3504 * @param[in] UUID (128 bits)
3507 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3511 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3512 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3516 int bluetooth_rfcomm_create_socket(const char *uuid);
3519 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3520 * @brief Register rfcomm socket with a specific uuid
3523 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3524 * descriptor of the server.
3525 * This is the first API which is called to create the server. Once we created the server socket,
3526 * we will listen on that return socket.
3527 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3530 * @return socket FD on Success \n
3531 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3532 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3533 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3534 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3535 * @param[in] UUID (128 bits)
3536 * @param[in] bus_name (const char)
3537 * @param[in] path (const char)
3540 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3544 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3545 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3549 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3552 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3553 * @brief De-register the rfcomm socket
3556 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3557 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3558 * descriptor else no event will come. We will call this API only after the
3559 * bluetooth_rfcomm_listen_and_accept.
3560 * This is a synchronous call.
3562 * @return BLUETOOTH_ERROR_NONE - Success \n
3563 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3564 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3565 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3566 * @param[in] int socket_fd
3569 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3572 void bt_event_callback(int event, bluetooth_event_param_t *param)
3576 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3578 bluetooth_rfcomm_connection_t *discon_ind =
3579 (bluetooth_rfcomm_connection_t *)param->param_data;
3581 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3589 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3590 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3592 ret = bluetooth_rfcomm_remove_socket(fd);
3595 int bluetooth_rfcomm_remove_socket(int socket_fd);
3598 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3599 * @brief De-register the rfcomm socket
3602 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3603 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3604 * descriptor else no event will come. We will call this API only after the
3605 * bluetooth_rfcomm_listen_and_accept_ex.
3606 * This is a synchronous call.
3608 * @return BLUETOOTH_ERROR_NONE - Success \n
3609 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3610 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3611 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3612 * @param[in] UUID (128 bits)
3615 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3618 void bt_event_callback(int event, bluetooth_event_param_t *param)
3622 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3624 bluetooth_rfcomm_connection_t *discon_ind =
3625 (bluetooth_rfcomm_connection_t *)param->param_data;
3627 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3635 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3636 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3638 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3641 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3644 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3645 * @brief Disconnect rfcomm connection
3648 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3649 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3652 * @return BLUETOOTH_ERROR_NONE - Success \n
3653 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3654 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3655 * @param[in] int socket_fd the sending socket fd
3661 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3663 printf("Disconnection failed");
3665 printf("Disconnection Success");
3669 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3672 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3673 * @brief Rfcomm socket listen
3676 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3677 * after the bluetooth_rfcomm_create_socket API.
3678 * This API listen for the incomming connection and once it receives a connection, it will give
3679 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3680 * event to the application. This is an Asynchronous API call.
3683 * @return BLUETOOTH_ERROR_NONE - Success \n
3684 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3685 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3687 * @param[in] int socket_fd
3688 * @param[in] max pending connection.
3691 * @see bluetooth_rfcomm_create_socket
3694 void bt_event_callback(int event, bluetooth_event_param_t* param)
3698 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3700 bluetooth_rfcomm_connection_t *conn_ind =
3701 (bluetooth_rfcomm_connection_t *)param->param_data;
3703 printf("\nConnected from FD %d", conn_ind->socket_fd);
3711 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3712 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3716 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3719 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3720 * @brief Rfcomm socket listen
3723 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3724 * after the bluetooth_rfcomm_create_socket API.
3725 * This API listen for the incomming connection and once it receives a connection, it will give
3726 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3727 * event to the application. This is an Asynchronous API call.
3730 * @return BLUETOOTH_ERROR_NONE - Success \n
3731 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3732 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3734 * @param[in] int socket_fd
3735 * @param[in] max pending connection.
3740 * @see bluetooth_rfcomm_create_socket_ex
3743 void bt_event_callback(int event, bluetooth_event_param_t* param)
3747 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3749 bluetooth_rfcomm_connection_t *conn_ind =
3750 (bluetooth_rfcomm_connection_t *)param->param_data;
3752 printf("\nConnected from FD %d", conn_ind->socket_fd);
3760 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3761 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3766 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3769 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3770 * @brief Rfcomm socket listen
3773 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3774 * after the bluetooth_rfcomm_create_socket API.
3775 * This API listen for the incomming connection and once it receives a connection, it will give
3776 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3777 * event to the application. This is an Asynchronous API call.
3780 * @return BLUETOOTH_ERROR_NONE - Success \n
3781 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3782 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3784 * @param[in] int socket_fd
3785 * @param[in] max pending connection.
3788 * @see bluetooth_rfcomm_create_socket
3791 void bt_event_callback(int event, bluetooth_event_param_t* param)
3795 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3797 char *name = (char *)param->param_data;
3799 printf("\nConnected from %s", name);
3801 bluetooth_rfcomm_accept_connection();
3809 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3810 ret = bluetooth_rfcomm_listen(fd, 1);
3814 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3817 * @fn int bluetooth_rfcomm_accept_connection()
3818 * @brief Accepts the authorization request indicated by the event
3819 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3821 * This function is a synchronous call.
3823 * @return BLUETOOTH_ERROR_NONE - Success \n
3824 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3826 * @param[in] the socket fd of the server
3827 * @param[out] the socket fd of the client
3831 * @see bluetooth_rfcomm_reject_connection
3833 int bluetooth_rfcomm_accept_connection(int server_fd);
3836 * @fn int bluetooth_rfcomm_reject_connection()
3837 * @brief Rejects the authorization request indicated by the event
3838 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3840 * This function is a synchronous call.
3842 * @return BLUETOOTH_ERROR_NONE - Success \n
3843 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3845 * @param[in] the socket fd of the server
3849 * @see bluetooth_rfcomm_accept_connection
3851 int bluetooth_rfcomm_reject_connection(int server_fd);
3854 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3855 * @brief Informs whether rfcomm server uuid is available or not.
3857 * This function is a synchronous call.
3859 * @return TRUE - RFCOMM uuid is available \n
3860 * FALSE - RFCOMM uuid is not available \n
3862 * @param[in] uuid UUID string
3868 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3871 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3872 * const char *remote_uuid)
3873 * @brief Connect to the remote device rfcomm *
3875 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3876 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3877 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3878 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3879 * initiating a connection.
3881 * @return BLUETOOTH_ERROR_NONE - Success \n
3882 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3883 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3884 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3885 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3886 * @param[in] bluetooth_device_address_t remote bt_address
3887 * @param[in] char remote uuid
3889 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3893 void bt_event_callback(int event, bluetooth_event_param_t *param)
3897 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3899 if (param->result >= BLUETOOTH_ERROR_NONE)
3901 bt_sdp_info_t *bt_sdp_info=param->param_data;
3903 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3904 bt_sdp_info->device_addr.addr[0],
3905 bt_sdp_info->device_addr.addr[1],
3906 bt_sdp_info->device_addr.addr[2],
3907 bt_sdp_info->device_addr.addr[3],
3908 bt_sdp_info->device_addr.addr[4],
3909 bt_sdp_info->device_addr.addr[5]);
3911 printf("Supported service list:\n");
3912 for(i=0; i<bt_sdp_info->service_index; i++)
3914 bt_sdp_info->service_list_array[i]);
3917 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3918 //rfcomm_test_uuid);
3922 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3924 bluetooth_rfcomm_connection_t *conn_ind =
3925 (bluetooth_rfcomm_connection_t *)param->param_data;
3927 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
3928 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3929 "SERVER" : "CLIENT");
3934 bluetooth_device_address_t remote_address = {{0},};
3935 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3936 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
3937 ret = bluetooth_search_service(&remote_address);
3939 printf("Seach failed, Reason = %d", ret);
3941 printf("Search Success, Ret = %d", ret);
3943 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3945 printf("Connection failed, Reason = %d", ret);
3947 printf("Connection Success, Ret = %d", ret);
3951 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3952 const char *remote_uuid);
3955 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3956 * @brief Disconnect rfcomm connection
3959 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3960 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3963 * @return BLUETOOTH_ERROR_NONE - Success \n
3964 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3965 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3966 * @param[in] char remote bt_address
3969 * @see bluetooth_rfcomm_connect
3973 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3975 printf("Disconnection failed");
3977 printf("Disconnection Success");
3982 int bluetooth_rfcomm_disconnect(int socket_fd);
3985 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3986 * @brief Write to rfcomm connection
3989 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3990 * API is used to send the data for server and the client.
3992 * @return BLUETOOTH_ERROR_NONE - Success \n
3993 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3994 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3996 * @param[in] const char *buff Data buffer to send
3997 * @param[in] int length Length of the data
4000 * @see bluetooth_rfcomm_connect
4003 char *buff = "Test data 123456789"
4004 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4006 printf("Send failed");
4008 printf("Send success");
4012 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4015 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4016 * @brief Informs whether rfcomm client is connected.
4018 * This function is a synchronous call.
4020 * @return TRUE - RFCOMM client is connected \n
4021 * FALSE - RFCOMM client is not connected \n
4027 gboolean bluetooth_rfcomm_is_client_connected(void);
4028 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4029 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4032 * @fn int bluetooth_network_activate_server(void)
4033 * @brief Activate the NAP (Network Access Point) service
4035 * This function is a asynchronous call.
4036 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4038 * @return BLUETOOTH_ERROR_NONE - Success \n
4039 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4040 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4041 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4044 * @see bluetooth_network_deactivate_server
4047 int bluetooth_network_activate_server(void);
4050 * @fn int bluetooth_network_deactivate_server(void)
4051 * @brief Deactivate the NAP (Network Access Point) service
4053 * This function is a asynchronous call.
4054 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4056 * @return BLUETOOTH_ERROR_NONE - Success \n
4057 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4058 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4059 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4062 * @see bluetooth_network_activate_server
4065 int bluetooth_network_deactivate_server(void);
4068 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4069 * bluetooth_network_role_t role,
4071 * @brief Connect the network server in the peer
4073 * This function is a asynchronous call.
4074 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4076 * @return BLUETOOTH_ERROR_NONE - Success \n
4077 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4078 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4079 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4082 * @param[in] device_address This indicates an address of the device with which the pairing
4083 * should be initiated
4084 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4085 * need to use the third parameter.
4086 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4087 * connect. UUID string
4089 * @see bluetooth_network_disconnect
4091 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4092 bluetooth_network_role_t role, char *custom_uuid);
4095 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4096 * bluetooth_network_role_t role,
4097 * char *custom_uuid)
4098 * @brief Connect the network server in the peer
4100 * This function is a asynchronous call.
4101 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4103 * @return BLUETOOTH_ERROR_NONE - Success \n
4104 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4105 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4106 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4109 * @param[in] device_address This indicates an address of the device with which the pairing
4110 * should be initiated
4112 * @see bluetooth_network_connect
4114 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4117 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4118 * @brief Disconnect the device from the network
4120 * This function is an asynchronous call.
4121 * The network server disconnect request is responded by
4122 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4124 * @return BLUETOOTH_ERROR_NONE - Success \n
4125 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4126 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4127 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4130 * @param[in] device_address This indicates an address of the connected client device
4132 * @see bluetooth_network_activate_server
4134 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4139 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4140 * bt_hdp_role_type_t role,
4141 * bt_hdp_qos_type_t channel_type,
4142 * char **app_handle)
4143 * @brief Activate the HDP service for a particular data type
4145 * This function is a synchronous call.
4147 * @return BLUETOOTH_ERROR_NONE - Success \n
4148 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4149 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4150 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4153 * @param[in] data_type The data type against corresponding service
4154 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4155 * @param[in] channel_type The QOS type for the channel.
4156 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4157 * For role = HDP_ROLE_SINK, the channel_type
4158 * should be HDP_QOS_ANY.
4159 * @param[out] app_handle The application handler against corresponding service
4161 * @see bluetooth_hdp_deactivate
4163 int bluetooth_hdp_activate(unsigned short data_type,
4164 bt_hdp_role_type_t role,
4165 bt_hdp_qos_type_t channel_type,
4168 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4169 * @brief Deactivate the HDP service for a particular service using the handler
4171 * This function is a synchronous call.
4173 * @return BLUETOOTH_ERROR_NONE - Success \n
4174 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4175 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4176 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4179 * @param[in] app_handle The application handler against corresponding service
4181 * @see bluetooth_hdp_deactivate
4183 int bluetooth_hdp_deactivate(const char *app_handle);
4186 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4187 * const char *buffer, unsigned int size)
4188 * @brief Send data to the remote HDP device
4190 * This function is a synchronous call.
4192 * @return BLUETOOTH_ERROR_NONE - Success \n
4193 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4194 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4195 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4196 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4199 * @param[in] channel_id The channel id for the connection.
4200 * @param[in] buffer The pdu buffer.
4201 * @param[in] size Size of the buffer.
4203 * @see bluetooth_hdp_connect
4205 int bluetooth_hdp_send_data(unsigned int channel_id,
4206 const char *buffer, unsigned int size);
4208 * @fn int bluetooth_hdp_connect(const char *app_handle,
4209 * bt_hdp_qos_type_t channel_type,
4210 * const bluetooth_device_address_t *device_address)
4211 * @brief Connect to the remote device(Mainly used by source)
4213 * This function is a asynchronous call.
4214 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4216 * @return BLUETOOTH_ERROR_NONE - Success \n
4217 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4218 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4219 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4220 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4223 * @param[in] app_handle The application handler against corresponding service
4224 * @param[in] channel_type The QOS type for the channel.
4225 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4226 * @param[in] device_address The remote device Bd address.
4229 * @see bluetooth_hdp_disconnect
4231 int bluetooth_hdp_connect(const char *app_handle,
4232 bt_hdp_qos_type_t channel_type,
4233 const bluetooth_device_address_t *device_address);
4235 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4236 * const bluetooth_device_address_t *device_address)
4237 * @brief Disconnect from the remote device(Mainly used by source)
4239 * This function is a asynchronous call.
4240 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4242 * @return BLUETOOTH_ERROR_NONE - Success \n
4243 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4244 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4245 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4246 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4249 * @param[in] channel_id The channel id for the connection.
4250 * @param[in] device_address The remote device Bd address.
4253 * @see bluetooth_hdp_connect
4255 int bluetooth_hdp_disconnect(unsigned int channel_id,
4256 const bluetooth_device_address_t *device_address);
4260 * @fn int bluetooth_opc_init(void)
4261 * @brief Initialize OPP client.
4263 * This function is a synchronous call.
4264 * No event corresponding to this api
4266 * @return BLUETOOTH_ERROR_NONE - Success \n
4267 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4268 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4269 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4270 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4275 * @see bluetooth_opc_deinit
4277 int bluetooth_opc_init(void);
4280 * @fn int bluetooth_opc_deinit(void)
4281 * @brief Deinitialize OPP client.
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_ACCESS_DENIED -Memory allocation failed \n
4293 * @see bluetooth_opc_init
4296 int bluetooth_opc_deinit(void);
4299 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4300 char **file_name_array)
4301 * @brief Send multiple files to a remote device.
4303 * This function is a asynchronous call.
4304 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4306 * @return BLUETOOTH_ERROR_NONE - Success \n
4307 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4308 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4309 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4310 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4311 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4312 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4315 * @param[in] device_address The remote device Bd address.
4316 * @param[in] file_name_array Array of filepaths to be sent.
4319 * @see bluetooth_opc_cancel_push
4322 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4323 char **file_name_array);
4326 * @fn int bluetooth_opc_cancel_push(void)
4327 * @brief Cancels the ongoing file push.
4329 * This function is a asynchronous call.
4330 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4331 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4333 * @return BLUETOOTH_ERROR_NONE - Success \n
4334 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4335 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4340 * @see bluetooth_opc_push_files
4343 int bluetooth_opc_cancel_push(void);
4346 * @fn gboolean bluetooth_opc_session_is_exist(void)
4347 * @brief Informs whether opc session exists or not.
4349 * This function is a synchronous call.
4351 * @return TRUE - OPC session exists \n
4352 * FALSE - OPC session does not exist \n
4360 gboolean bluetooth_opc_session_is_exist(void);
4363 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4364 * @brief Informs whether opc session exists or not.
4366 * This function is a synchronous call.
4368 * @return BLUETOOTH_ERROR_NONE - Success \n
4369 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4370 * BLUETOOTH_ERROR_INTERNAL \n
4373 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4378 int bluetooth_opc_is_sending(gboolean *is_sending);
4381 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4382 int transfer_id, unsigned char *progress)
4383 * @brief Gets the percentage progress for ongoing transfers.
4385 * This function is a synchronous call.
4387 * @return BLUETOOTH_ERROR_NONE - Success \n
4388 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4389 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4392 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4393 * @param[in] transfer_id Transfer ID
4394 * @param[out] progress Percentage Progress
4398 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4399 int transfer_id, unsigned char *progress);
4402 * @fn int bluetooth_obex_server_init(const char *dst_path)
4403 * @brief Initialize OPP and FTP server.
4405 * This function is a synchronous call.
4406 * No event corresponding to this api
4408 * @return BLUETOOTH_ERROR_NONE - Success \n
4409 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4410 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4411 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4412 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4415 * @param[in] dst_path OPS destination file path.
4417 * @see bluetooth_obex_server_deinit
4419 int bluetooth_obex_server_init(const char *dst_path);
4423 * @fn int bluetooth_obex_server_deinit(void)
4424 * @brief Deinitialize OPP and FTP server.
4426 * This function is a synchronous call.
4427 * No event corresponding to this api
4429 * @return BLUETOOTH_ERROR_NONE - Success \n
4430 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4431 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4436 * @see bluetooth_obex_server_init
4438 int bluetooth_obex_server_deinit(void);
4442 * @fn gboolean bluetooth_obex_server_is_activated(void)
4443 * @brief Informs whether obex server is activated or not.
4445 * This function is a synchronous call.
4447 * @return TRUE - OBEX server is activated \n
4448 * FALSE - OBEX server is not activated \n
4455 gboolean bluetooth_obex_server_is_activated(void);
4459 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4460 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4462 * This function is a synchronous call.
4463 * No event corresponding to this api
4465 * @return BLUETOOTH_ERROR_NONE - Success \n
4466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4467 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4468 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4469 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4473 * @param[in] dst_path OPS destination file path.
4475 * @see bluetooth_obex_server_deinit_without_agent
4477 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4481 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4482 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4484 * This function is a synchronous call.
4485 * No event corresponding to this api
4487 * @return BLUETOOTH_ERROR_NONE - Success \n
4488 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4489 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4494 * @see bluetooth_obex_server_init_without_agent
4496 int bluetooth_obex_server_deinit_without_agent(void);
4500 * @fn int bluetooth_obex_server_accept_connection(void)
4501 * @brief Accepts the authorization request indicated by the event
4502 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4504 * This function is a synchronous call.
4506 * @return BLUETOOTH_ERROR_NONE - Success \n
4507 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4508 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4512 * @see bluetooth_obex_server_reject_authorize
4514 int bluetooth_obex_server_accept_connection(void);
4518 * @fn int bluetooth_obex_server_reject_connection(void)
4519 * @brief Rejects the authorization request indicated by the event
4520 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4522 * This function is a synchronous call.
4524 * @return BLUETOOTH_ERROR_NONE - Success \n
4525 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4526 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4530 * @see bluetooth_obex_server_reject_authorize
4532 int bluetooth_obex_server_reject_connection(void);
4536 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4537 * @brief Accepts the authorization request indicated by the event
4538 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4540 * This function is a asynchronous call.
4541 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4543 * @return BLUETOOTH_ERROR_NONE - Success \n
4544 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4545 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4546 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4549 * @param[in] filename Authorized filename.
4552 * @see bluetooth_obex_server_reject_authorize
4555 int bluetooth_obex_server_accept_authorize(const char *filename);
4558 * @fn int bluetooth_obex_server_reject_authorize(void)
4559 * @brief Reject the authorization request indicated by the event
4560 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4562 * This function is a asynchronous call.
4563 * No event for this api..
4565 * @return BLUETOOTH_ERROR_NONE - Success \n
4566 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4567 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4572 * @see bluetooth_obex_server_accept_authorize
4575 int bluetooth_obex_server_reject_authorize(void);
4578 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4579 * @brief Set the OPS destination file path..
4581 * This function is a asynchronous call.
4582 * No event for this api..
4584 * @return BLUETOOTH_ERROR_NONE - Success \n
4585 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4586 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4587 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4590 * @param[in] dst_path OPS destination file path.
4596 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4599 * @fn int bluetooth_obex_server_set_root(const char *root)
4600 * @brief Set the FTS root folder..
4602 * This function is a asynchronous call.
4603 * No event for this api..
4605 * @return BLUETOOTH_ERROR_NONE - Success \n
4606 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4607 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4608 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4609 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4610 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4613 * @param[in] root FTS root folder.
4619 int bluetooth_obex_server_set_root(const char *root);
4622 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4623 * @brief Cancel the transfer on server
4625 * This function is an asynchronous call.
4626 * If the function call that cancels transfer is successful, the application would receive
4627 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4628 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4629 * the error code will be BLUETOOTH_ERROR_NONE
4631 * @return BLUETOOTH_ERROR_NONE - Success \n
4632 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4633 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4634 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4635 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4638 * @param[in] transfer_id transfer ID
4643 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4647 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4648 * @brief Cancel the transfer on server
4650 * This function is an asynchronous call.
4651 * If the function call that cancels transfer is successful, the application would receive
4652 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4653 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4654 * the error code will be BLUETOOTH_ERROR_NONE
4656 * @return BLUETOOTH_ERROR_NONE - Success \n
4657 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4658 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4659 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4660 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4667 int bluetooth_obex_server_cancel_all_transfers(void);
4671 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4672 * @brief Informs whether obex server is receiving or not.
4674 * This function is a synchronous call.
4676 * @return BLUETOOTH_ERROR_NONE - Success \n
4677 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4678 * BLUETOOTH_ERROR_INTERNAL \n
4681 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4686 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4690 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4691 * @brief Read the local Hash and Randmizer.
4693 * This function is a synchronous call.
4695 * @return BLUETOOTH_ERROR_NONE - Success \n
4696 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4700 * @param[out] local_oob_data - Pointer to the local OOB data
4706 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4710 * @fn int bluetooth_oob_add_remote_data(
4711 * const bluetooth_device_address_t *remote_device_address,
4712 * bt_oob_data_t *oob_data)
4713 * @brief Add/updated the remote device Hash and Randmizer.
4715 * This function is a synchronous call.
4716 * No event for this api..
4718 * @return BLUETOOTH_ERROR_NONE - Success \n
4719 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4722 * @param[in] remote_device_address - Remote device address
4723 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4729 int bluetooth_oob_add_remote_data(
4730 const bluetooth_device_address_t *remote_device_address,
4731 bt_oob_data_t *remote_oob_data);
4735 * @fn int bluetooth_oob_remove_remote_data(
4736 * const bluetooth_device_address_t *remote_device_address)
4737 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4739 * This function is a synchronous call.
4740 * No event for this api..
4742 * @return BLUETOOTH_ERROR_NONE - Success \n
4743 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4746 * @param[in] remote_device_address - Remote device address
4752 int bluetooth_oob_remove_remote_data(
4753 const bluetooth_device_address_t *remote_device_address);
4756 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4757 * bt_gatt_handle_info_t *prim_svc);
4759 * @brief Gets the GATT based primary services handle supported by remote device
4761 * This function is a synchronous call.
4762 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4764 * @return BLUETOOTH_ERROR_NONE - Success \n
4765 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4766 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4767 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4770 * @param[in] address - Remote device address
4771 * @param[out] prim_svc - Structure containing remote service count and handle list.
4774 * @see bluetooth_gatt_free_primary_services()
4776 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4777 bt_gatt_handle_info_t *prim_svc);
4780 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4782 * @brief Discovers the characteristics of GATT based service of remote device
4784 * This function is an asynchronous call.
4785 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4787 * @return BLUETOOTH_ERROR_NONE - Success \n
4788 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4789 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4793 * @param[in] service_handle - Handle for remote service.
4798 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4800 int bluetooth_gatt_set_service_change_watcher(
4801 const bluetooth_device_address_t *address, gboolean enable);
4804 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4805 * bt_gatt_service_property_t *service);
4807 * @brief Gets the properties of GATT based service of remote device
4809 * This function is a synchronous call.
4810 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4812 * @return BLUETOOTH_ERROR_NONE - Success \n
4813 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4814 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4815 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4818 * @param[in] service_handle - Handle for remote service.
4819 * @param[out] service - Structure containing remote service property.
4822 * @see bluetooth_gatt_free_service_property()
4824 int bluetooth_gatt_get_service_property(const char *service_handle,
4825 bt_gatt_service_property_t *service);
4828 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4830 * @brief Register to GATT based service to receive value change notification/indication.
4832 * This function is a synchronous call.
4833 * No event for this api.
4835 * @return BLUETOOTH_ERROR_NONE - Success \n
4836 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4837 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4838 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4841 * @param[in] service_handle - Handle for remote service.
4846 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4849 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4851 * @brief Unregister GATT based service to receive value change notification/indication.
4853 * This function is a synchronous call.
4854 * No event for this api.
4856 * @return BLUETOOTH_ERROR_NONE - Success \n
4857 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4858 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4859 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4862 * @param[in] service_handle - Handle for remote service.
4867 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4870 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4871 * bt_gatt_char_property_t *characteristic);
4873 * @brief Provides characteristic value along with properties.
4875 * This function is a synchronous call.
4876 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4878 * @return BLUETOOTH_ERROR_NONE - Success \n
4879 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4880 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4881 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4884 * @param[in] char_handle - Handle for Characteristic property.
4885 * @param[out] characteristic - Structure containing remote characteristic property.
4888 * @see bluetooth_gatt_free_char_property()
4890 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4891 bt_gatt_char_property_t *characteristic);
4894 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4895 * bt_gatt_char_property_t *characteristic);
4897 * @brief Provides characteristic descriptor value along with its UUID.
4899 * This function is a synchronous call.
4900 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4902 * @return BLUETOOTH_ERROR_NONE - Success \n
4903 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4904 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4905 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4908 * @param[in] desc_handle - Handle for Characteristic descriptor.
4909 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4912 * @see bluetooth_gatt_free_desc_property()
4914 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4915 bt_gatt_char_descriptor_property_t *descriptor);
4919 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4920 * const guint8 *value, int length)
4922 * @brief Set characteristic value.
4924 * This function is a synchronous call.
4926 * @return BLUETOOTH_ERROR_NONE - Success \n
4927 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4928 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4929 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4932 * @param[in] char_handle - Handle for Characteristic property.
4933 * @param[in] value - New value to set for characteristic property.
4934 * @param[in] length - Length of the value to be set.
4939 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4940 const guint8 *value, int length);
4943 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4944 * const guint8 *value, int length, guint8 write_type)
4946 * @brief Set characteristic value by write type.
4948 * This function is a synchronous call if write type is "write without resonse"
4949 * and it is an asynchronous call if write type is "write with response"
4951 * @return BLUETOOTH_ERROR_NONE - Success \n
4952 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4953 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4954 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4957 * @param[in] char_handle - Handle for Characteristic property.
4958 * @param[in] value - New value to set for characteristic property.
4959 * @param[in] length - Length of the value to be set.
4960 * @param[in] write_type - Type of write.
4965 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4966 const guint8 *value, int length, guint8 write_type);
4970 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4971 * const guint8 *value, int length)
4973 * @brief Set characteristic value request.
4975 * This function is an asynchronous call.
4977 * @return BLUETOOTH_ERROR_NONE - Success \n
4978 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4979 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4980 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4983 * @param[in] char_handle - Handle for Characteristic property.
4984 * @param[in] value - New value to set for characteristic property.
4985 * @param[in] length - Length of the value to be set.
4990 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4991 const guint8 *value, int length);
4994 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4996 * @brief Read characteristic value.
4998 * This function is a asynchronous call.
5000 * @return BLUETOOTH_ERROR_NONE - Success \n
5001 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5002 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5003 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5006 * @param[in] char_handle - Handle for Characteristic property.
5011 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5014 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5015 * const char *service_uuid,
5016 * bt_gatt_service_property_t *service)
5018 * @brief Gets the service property from a device based on a particular uuid
5020 * This function is a synchronous call.
5022 * @return BLUETOOTH_ERROR_NONE - Success \n
5023 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5024 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5025 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5028 * @param[in] address - BD address of the remote device
5029 * @param[in] service_uuid - uuid of the service.
5030 * @param[out] service - Structure containing the service property.
5035 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5036 const char *service_uuid,
5037 bt_gatt_service_property_t *service);
5040 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5041 * const char *char_uuid)
5043 * @brief Gets the characteristic property from a service based on a particular char uuid
5045 * This function is an asynchronous call.
5046 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5048 * @return BLUETOOTH_ERROR_NONE - Success \n
5049 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5050 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5051 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5054 * @param[in] service_handle - Service handle.
5055 * @param[in] uuid - Characteristic uuid.
5060 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5061 const char *char_uuid);
5064 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5066 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5068 * This function is a synchronous call.
5069 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5071 * @return BLUETOOTH_ERROR_NONE - Success \n
5072 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5075 * @param[in] prim_svc - GATT handle info structure
5078 * @see bluetooth_gatt_get_primary_services()
5080 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5083 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5085 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5087 * This function is a synchronous call.
5088 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5090 * @return BLUETOOTH_ERROR_NONE - Success \n
5091 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5094 * @param[in] svc_pty - GATT service property structure.
5097 * @see bluetooth_gatt_get_service_property()
5099 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5102 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5104 * @brief Provides characteristic value along with properties.
5106 * This function is a synchronous call.
5107 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5109 * @return BLUETOOTH_ERROR_NONE - Success \n
5110 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5113 * @param[in] char_pty - GATT characteristics property structure.
5116 * @see bluetooth_gatt_get_characteristics_property()
5118 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5121 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5123 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5125 * This function is a synchronous call.
5126 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5128 * @return BLUETOOTH_ERROR_NONE - Success \n
5129 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5132 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5135 * @see bluetooth_gatt_get_char_descriptor_property()
5137 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5140 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5142 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5145 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5147 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5149 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5151 * @return BLUETOOTH_ERROR_NONE - Success \n
5152 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5155 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5159 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5162 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5164 * @brief Read characteristic descriptor value.
5166 * This function is a asynchronous 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] desc_handle - Handle for Characteristic descriptor
5179 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5182 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5183 * const guint8 *value, int length);
5185 * @brief Set characteristic descriptor value.
5187 * This function is a asynchronous call.
5189 * @return BLUETOOTH_ERROR_NONE - Success \n
5190 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5191 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5192 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5195 * @param[in] desc_handle - Handle for Characteristic descriptor
5196 * @param[in] value - New value to set for characteristic descriptor
5197 * @param[in] length - Length of the value to be set.
5202 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5203 const guint8 *value, int length);
5205 /* @fn int bluetooth_gatt_init(void)
5207 * @brief Initializes the gatt service.
5209 * This function is a synchronous call.
5210 * @return BLUETOOTH_ERROR_NONE - Success \n
5211 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5212 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5213 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5216 * @remark Adapter should be enabled
5217 * @see bluetooth_gatt_deinit()
5219 int bluetooth_gatt_init(void);
5221 /* @fn int bluetooth_gatt_init(void)
5223 * @brief DeInitializes the gatt service.
5225 * This function is a synchronous call.
5226 * @return BLUETOOTH_ERROR_NONE - Success \n
5227 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5228 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5229 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5232 * @remark Adapter should be enabled
5233 * @see bluetooth_gatt_init()
5235 int bluetooth_gatt_deinit(void);
5237 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5238 unsigned char **svc_path)
5240 * @brief Exports a new gatt service to the service interface.
5242 * This function is a synchronous call.
5244 * @return BLUETOOTH_ERROR_NONE - Success \n
5245 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5246 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5247 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5250 * @param[in] svc_uuid Gatt service uuid.
5251 * @param[out] svc_path service object path of the exported service.
5252 * @remark Adapter should be enabled
5253 * @see bluetooth_gatt_init()
5255 int bluetooth_gatt_add_service(const char *svc_uuid,
5258 /* @fn int bluetooth_gatt_add_new_characteristic(
5259 const char *svc_path, const char *char_uuid,
5260 bt_gatt_permission_t permissions,
5261 bt_gatt_characteristic_property_t properties,
5262 int flags_length, char **char_path);;
5264 * @brief Exports a new gatt characteristic to the characteristic interface.
5266 * This function is a synchronous call.
5267 * @return BLUETOOTH_ERROR_NONE - Success \n
5268 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5269 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5270 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5272 * @param[in] svc_path service object path of the exported service.
5273 * @param[in] char_uuid Gatt service uuid.
5274 * @param[in] properties GATT characteristic properties.
5275 * @param[out] char_path characteristic object path of the exported characteristic.
5277 * @remark Adapter should be enabled
5278 * @see bluetooth_gatt_add_service()
5280 int bluetooth_gatt_add_new_characteristic(
5281 const char *svc_path, const char *char_uuid,
5282 bt_gatt_permission_t permissions,
5283 bt_gatt_characteristic_property_t properties,
5286 /* @fn bluetooth_gatt_set_characteristic_value(
5287 const char *characteristic, const char *char_value,
5290 * @brief adds gatt charactertisic value to the given charactertistic path.
5292 * This function is a synchronous call.
5293 * @return BLUETOOTH_ERROR_NONE - Success \n
5294 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5295 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5296 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5298 * @param[in] char_value Value of the GATT characteristic to be added.
5299 * @param[in] value_length length of the chantacteristic value..
5300 * @param[out] characteristic characteristic object path..
5302 * @remark Adapter should be enabled
5303 * @see bluetooth_gatt_add_service()
5305 int bluetooth_gatt_set_characteristic_value(
5306 const char *characteristic, const char *char_value,
5309 /* @fn int bluetooth_gatt_add_descriptor(
5310 const char *char_path, const char *desc_uuid,
5311 bt_gatt_permission_t permissions,
5314 * @brief Exports a new gatt descriptor to the descriptor interface.
5316 * This function is a synchronous call.
5318 * @return BLUETOOTH_ERROR_NONE - Success \n
5319 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5320 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5321 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5324 * @param[in] desc_uuid Gatt descriptor uuid.
5325 * @param[in] desc_value GATT descriptor value.
5326 * @param[in] value_length Length of GATT descriptor value.
5327 * @param[in] permissions descriptor permissions.
5328 * @param[in] properties GATT descriptor properties.
5329 * @param[in] char_path characteristics object path of the exported character.
5331 * @remark Adapter should be enabled
5332 * @see bluetooth_gatt_add_service()
5333 * @see bluetooth_gatt_add_characteristics()
5335 int bluetooth_gatt_add_descriptor(
5336 const char *char_path, const char *desc_uuid,
5337 bt_gatt_permission_t permissions,
5340 /* @fn int bluetooth_gatt_set_descriptor_value(
5341 const char *desc_path, const char *desc_value,
5344 * @brief Adds value to the given descriptor handle.
5346 * This function is a synchronous call.
5348 * @return BLUETOOTH_ERROR_NONE - Success \n
5349 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5350 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5351 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5354 * @param[in] desc_value GATT descriptor value.
5355 * @param[in] value_length Length of GATT descriptor value.
5356 * @param[in] desc_path descriptor path to which the value needs to be added.
5358 * @remark Adapter should be enabled
5359 * @see bluetooth_gatt_add_service()
5360 * @see bluetooth_gatt_add_characteristics()
5362 int bluetooth_gatt_set_descriptor_value(
5363 const char *desc_path, const char *desc_value,
5366 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5368 * @brief Reads the Service registered on manager interface.
5370 * This function is a synchronous call.
5372 * @return BLUETOOTH_ERROR_NONE - Success \n
5373 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5374 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5375 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5378 * @param[in] svc_uuid Gatt Service uuid.
5380 * @remark Adapter should be enabled and service should be registered.
5381 * @see bluetooth_gatt_register_service()
5383 int bluetooth_gatt_get_service(const char *svc_uuid);
5385 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5387 * @brief Registers the given service path with the library.
5389 * This function is a synchronous call.
5391 * @return BLUETOOTH_ERROR_NONE - Success \n
5392 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5393 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5394 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5397 * @param[in] svc_path service object path of the exported service.
5399 * @remark Adapter should be enabled
5400 * @see bluetooth_gatt_add_service()
5401 * @see bluetooth_gatt_add_characteristics()
5402 * @see bluetooth_gatt_add_descriptor()
5403 * @see bluetooth_gatt_register_application()
5405 int bluetooth_gatt_register_service(const char *svc_path);
5407 /* @fn int bluetooth_gatt_register_application(void)
5409 * @brief Registers the application with the bluez gatt server.
5411 * This function is a synchronous call.
5413 * @return BLUETOOTH_ERROR_NONE - Success \n
5414 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5415 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5416 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5420 * @remark Adapter should be enabled
5421 * @see bluetooth_gatt_init()
5422 * @see bluetooth_gatt_add_service()
5423 * @see bluetooth_gatt_add_characteristics()
5424 * @see bluetooth_gatt_add_descriptor()
5425 * @see bluetooth_gatt_register_service()
5427 int bluetooth_gatt_register_application(void);
5429 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5431 * @brief Removes(unregister) service from the bluez gatt server db.
5433 * This function is a synchronous call.
5435 * @return BLUETOOTH_ERROR_NONE - Success \n
5436 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5437 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5438 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5441 * @param[in] svc_path service object path of the exported service.
5443 * @remark Adapter should be enabled
5444 * @see bluetooth_gatt_add_service()
5445 * @see bluetooth_gatt_add_characteristics()
5446 * @see bluetooth_gatt_add_descriptor()
5447 * @see bluetooth_gatt_register_service()
5449 int bluetooth_gatt_unregister_service(const char *svc_path);
5451 /* @fn int bluetooth_gatt_unregister_application(void)
5453 * @brief Removes(unregister) the application with the bluez gatt server,
5454 * and deletes all the service registered.
5456 * This function is a synchronous call.
5458 * @return BLUETOOTH_ERROR_NONE - Success \n
5459 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5460 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5461 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5465 * @remark Adapter should be enabled
5466 * @see bluetooth_gatt_init()
5467 * @see bluetooth_gatt_add_service()
5468 * @see bluetooth_gatt_add_characteristics()
5469 * @see bluetooth_gatt_add_descriptor()
5470 * @see bluetooth_gatt_register_service()
5471 * @see bluetooth_gatt_unregister_service()
5473 int bluetooth_gatt_unregister_application(void);
5475 /* @fn int bluetooth_gatt_send_response(int request_id,
5476 * int offset, char *value, int value_length)
5478 * @brief Updates the attribute value in local attribute list.
5480 * This function is a synchronous call.
5482 * @return BLUETOOTH_ERROR_NONE - Success \n
5483 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5484 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5485 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5488 * @param[in] request_id The identification of a read request
5489 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5490 * @param[in] resp_state The identification of response state
5491 * @param[in] offset The offset from where a value is read
5492 * @param[in] value The value to be sent. It will be sent from @a offset.
5493 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5494 * @param[in] value_length Value Length.
5496 * @remark Adapter should be enabled
5497 * @see bluetooth_gatt_add_service()
5498 * @see bluetooth_gatt_add_characteristics()
5499 * @see bluetooth_gatt_add_descriptor()
5500 * @see bluetooth_gatt_register_service()
5502 int bluetooth_gatt_send_response(int request_id, guint req_type,
5503 int resp_state, int offset, char *value, int value_length);
5505 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5507 * @brief Sets the notification property for a characteristic.
5509 * This function is a synchronous call.
5511 * @return BLUETOOTH_ERROR_NONE - Success \n
5512 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5513 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5514 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5517 * @param[in] char_path characteristic object path.
5518 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5520 * @remark Adapter should be enabled
5521 * @see bluetooth_gatt_update_characteristic()
5523 int bluetooth_gatt_server_set_notification(const char *char_path,
5524 bluetooth_device_address_t *unicast_address);
5526 /* @fn int bluetooth_gatt_delete_services(void)
5528 * @brief deletes (unregisters) all services from the gatt server database..
5530 * This function is a synchronous call.
5532 * @return BLUETOOTH_ERROR_NONE - Success \n
5533 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5534 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5535 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5539 * @remark Adapter should be enabled
5540 * @see bluetooth_gatt_add_service()
5541 * @see bluetooth_gatt_add_characteristics()
5542 * @see bluetooth_gatt_add_descriptor()
5543 * @see bluetooth_gatt_register_service()
5544 * @see bluetooth_gatt_unregister_service()
5546 int bluetooth_gatt_delete_services(void);
5548 /* @fn int bluetooth_gatt_update_characteristic(void)
5550 * @brief updates the given characteristic with a new value
5552 * This function is a synchronous call.
5554 * @return BLUETOOTH_ERROR_NONE - Success \n
5555 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5556 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5557 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5561 * @remark Adapter should be enabled
5562 * @see bluetooth_gatt_add_service()
5563 * @see bluetooth_gatt_add_characteristics()
5564 * @see bluetooth_gatt_add_descriptor()
5565 * @see bluetooth_gatt_register_service()
5566 * @see bluetooth_gatt_unregister_service()
5568 int bluetooth_gatt_update_characteristic(const char *char_path,
5569 const char* char_value, int value_length);
5572 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5574 * @brief Set advertising status.
5576 * This function is used to enable or disable LE advertising.
5577 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5579 * This function is a synchronous call.
5581 * @return BLUETOOTH_ERROR_NONE - Success \n
5582 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5583 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5586 * @param[in] enable - The status of advertising
5589 * @see bluetooth_set_advertising_data
5591 int bluetooth_set_advertising(int handle, gboolean enable);
5594 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5596 * @brief Set advertising status along with interval value.
5598 * This function is used to enable or disable LE advertising.
5599 * Interval_min and Interval_max is used to set the best advertising interval.
5600 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5602 * This function is a synchronous call.
5604 * @return BLUETOOTH_ERROR_NONE - Success \n
5605 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5606 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5609 * @param[in] enable - The status of advertising
5610 * @param[in] interval_min - Minimum interval of advertising (msec)
5611 * @param[in] interval_max - Maximum interval of advertising (msec)
5612 * @param[in] filter_policy - Advertising filter policy
5615 * @see bluetooth_set_advertising_data
5617 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5618 bluetooth_advertising_params_t *params);
5621 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5622 * @brief Get the advertising data
5624 * This function is used to get advertising data.
5625 * Before calling this API, the adapter should be enabled.
5627 * This function is a synchronous call.
5629 * @return BLUETOOTH_ERROR_NONE - Success \n
5630 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5631 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5632 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5634 * @param[out] value - Advertising data structure.
5635 * @param[out] length - The length of Advertising data.
5639 bluetooth_advertising_data_t *value = { {0} };
5642 ret = bluetooth_get_advertising_data(&value, &length);
5645 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5648 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5650 * @brief Set advertising data with value
5652 * This function is used to set advertising data and Maximum size of advertising data
5653 * is 28 byte (Except Flag)
5655 * This function is a synchronous call.
5657 * @return BLUETOOTH_ERROR_NONE - Success \n
5658 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5659 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5662 * @param[in] value - Advertising data structure.
5666 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5669 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5671 * @brief Check the privilege for advertising parameter setting
5673 * This function is a synchronous call.
5675 * @return BLUETOOTH_ERROR_NONE - Success \n
5676 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5682 int bluetooth_check_privilege_advertising_parameter(void);
5685 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5686 * @brief Get the LE scan response data
5688 * This function is used to get scan response data.
5689 * Before calling this API, the adapter should be enabled.
5691 * This function is a synchronous call.
5693 * @return BLUETOOTH_ERROR_NONE - Success \n
5694 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5695 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5696 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5698 * @param[out] value - Scan response data structure.
5699 * @param[out] length - The length of Scan response data.
5703 bluetooth_scan_resp_data_t *value = { {0} };
5706 ret = bluetooth_get_scan_response_data(&value, &length);
5709 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5712 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5714 * @brief Set scan response data with value
5716 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5718 * This function is a synchronous call.
5720 * @return BLUETOOTH_ERROR_NONE - Success \n
5721 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5722 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5725 * @param[in] value - LE Scan response data structure.
5729 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5732 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5734 * @brief Set scan interval and window
5736 * This function is used to set LE scan interval and window size
5738 * This function is a synchronous call.
5740 * @return BLUETOOTH_ERROR_NONE - Success \n
5741 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5742 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5745 * @param[in] interval - Interval of LE scan (msec)
5746 * @param[in] window - Window size of LE scan (msec)
5750 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5753 * @fn int bluetooth_is_advertising(void)
5754 * @brief Check for the advertising is in-progress or not.
5756 * This API is used to check the current status of the advertising procedure.
5757 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5760 * This function checks whether the advertising is started or not.
5762 * This function is a synchronous call.
5764 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5766 * @return BLUETOOTH_ERROR_NONE - Success \n
5767 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5770 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5774 gboolean is_advertising = 0;
5776 ret = bluetooth_is_advertising(&is_advertising);
5779 int bluetooth_is_advertising(gboolean *is_advertising);
5782 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5783 * @brief Add LE device to white list
5785 * This API is used to add LE device to white list
5786 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5790 * This function is a synchronous call.
5792 * @param[in] address The address of remote device
5794 * @return BLUETOOTH_ERROR_NONE - Success \n
5795 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5798 * @see bluetooth_set_custom_advertising
5800 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5803 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5804 * @brief Remove LE device from white list
5806 * This API is used to remove LE device from white list
5807 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5811 * This function is a synchronous call.
5813 * @param[in] address The address of remote device
5815 * @return BLUETOOTH_ERROR_NONE - Success \n
5816 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5819 * @see bluetooth_set_custom_advertising
5821 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5824 * @fn int bluetooth_clear_white_list(void)
5825 * @brief Clear white list
5827 * This API is used to clear white list
5828 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5832 * This function is a synchronous call.
5834 * @param[in] address The address of remote device
5836 * @return BLUETOOTH_ERROR_NONE - Success \n
5837 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5840 * @see bluetooth_set_custom_advertising
5842 int bluetooth_clear_white_list(void);
5845 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5846 * const bluetooth_le_connection_param_t *parameters)
5847 * @brief update connection paramter of LE connection.
5849 * This function is a synchronous call.
5851 * @return BLUETOOTH_ERROR_NONE - Success \n
5852 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5855 * @param[in] address - remote device address value.
5856 * @param[in] parameters - new connection parameters.
5859 * @see bluetooth_bond_device
5861 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5862 const bluetooth_le_connection_param_t *parameters);
5866 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5868 * @brief Enable/Disable LE Privacy feature.
5870 * This function is used to enable or disable LE Privacy feature.
5871 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5873 * This function is a synchronous call.
5875 * @return BLUETOOTH_ERROR_NONE - Success \n
5876 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5877 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5880 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5884 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5887 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
5889 * @brief Enable/Disable LE static random address.
5891 * This function is used to enable or disable LE static random address.
5893 * This function is a synchronous call.
5895 * @return BLUETOOTH_ERROR_NONE - Success \n
5896 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5897 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5900 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
5904 int bluetooth_set_le_static_random_address(gboolean enable);
5907 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
5908 * bluetooth_le_connection_mode_t mode)
5909 * @brief update connection paramter of LE connection.
5911 * This function is a synchronous call.
5913 * @return BLUETOOTH_ERROR_NONE - Success \n
5914 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5915 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5918 * @param[in] address - remote device address value.
5919 * @param[in] mode - new connection mode.
5923 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
5924 bluetooth_le_connection_mode_t mode);
5927 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
5928 * @brief Request for new ATT MTU value.
5930 * This function is a asynchronous call.
5932 * @return BLUETOOTH_ERROR_NONE - Success \n
5933 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5934 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5937 * @param[in] address - remote device address value.
5938 * @param[in] mtu - MTU value to be set.
5942 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
5945 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
5946 * unsigned int *mtu)
5947 * @brief Gets the xisting MTU value set for a connection.
5949 * This function is a synchronous call.
5951 * @return BLUETOOTH_ERROR_NONE - Success \n
5952 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5953 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5956 * @param[in] address - remote device address value.
5957 * @param[out] mtu - MTU value set for the connection.
5961 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
5965 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
5966 * bluetooth_device_address_t *id_address)
5967 * @brief Gets the Identity address of remote device.
5969 * This function is a synchronous call.
5971 * @return BLUETOOTH_ERROR_NONE - Success \n
5972 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5973 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5976 * @param[in] device_rpa - remote Resolvable private address.
5977 * @param[out] id_address - remote Identity device address value.
5981 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
5982 bluetooth_device_address_t *id_address);
5985 * @fn int bluetooth_le_read_maximum_data_length()
5986 * @brief reads the maximum LE data length supported in the controller.
5988 * This function is a synchronous call.
5990 * @return BLUETOOTH_ERROR_NONE - Success \n
5991 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5997 int bluetooth_le_read_maximum_data_length(
5998 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6000 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6001 * @brief writes the host suggested values for the controllers max transmitted no of payload
6002 * octects to be used for new connections.
6004 * This function is a synchronous call.
6006 * @return BLUETOOTH_ERROR_NONE - Success \n
6007 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6013 int bluetooth_le_write_host_suggested_default_data_length(
6014 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6016 int bluetooth_le_read_suggested_default_data_length(
6017 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6019 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6020 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6022 int bluetooth_pbap_init(void);
6023 int bluetooth_pbap_deinit(void);
6024 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6025 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6026 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6027 bt_pbap_folder_t *folder);
6028 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6029 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6030 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6031 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6032 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6033 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6034 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6035 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6038 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6040 * @brief Set manufacturer data with value
6042 * This function is used to set manufacturer data.
6044 * This function is a synchronous call.
6046 * @return BLUETOOTH_ERROR_NONE - Success \n
6047 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6048 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6051 * @param[in] value - Manufacturer data structure.
6055 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6057 int bluetooth_set_passkey_notification(gboolean enable);
6059 #ifdef TIZEN_DPM_VCONF_ENABLE
6061 * @fn int bluetooth_dpm_is_mode_allowed(void);
6063 * @brief Checks Restriction for BT mode(BT allowed or not)
6065 * This function is a synchronous call.
6067 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6068 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6069 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6076 int bluetooth_dpm_is_mode_allowed(void);
6080 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6082 * @brief Sets Restriction for BT mode(BT allowed or not)
6084 * This function is a synchronous call.
6086 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6087 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6088 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6091 * @param[in] value - BT Allow value.
6092 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6093 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6094 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6095 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6099 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6102 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6104 * @brief Reads the Restriction for BT mode(BT allowed or not)
6106 * This function is a synchronous call.
6108 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6109 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6110 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6114 * @param[out] value - BT Allow value.
6115 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6116 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6117 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6118 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6122 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6125 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6127 * @brief Sets the Restriction for device.
6129 * This function is a synchronous call.
6131 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6132 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6133 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6136 * @param[in] value - State value.
6137 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6138 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6142 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6145 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6147 * @brief Reads the Restriction for device.
6149 * This function is a synchronous call.
6151 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6152 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6153 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6157 * @param[out] value - State value.
6158 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6159 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6163 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6166 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6168 * @brief Sets the Restriction for uuid.
6170 * This function is a synchronous call.
6172 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6173 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6174 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6177 * @param[in] value - State value.
6178 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6179 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6183 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6186 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6188 * @brief Reads the Restriction for uuid.
6190 * This function is a synchronous call.
6192 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6193 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6194 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6198 * @param[out] value - State value.
6199 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6200 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6204 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6207 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6209 * @brief Adds the device to blacklist.
6211 * This function is a synchronous call.
6213 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6214 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6215 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6218 * @param[in] device_address - Device address
6222 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6225 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6227 * @brief Adds the device to whitelist.
6229 * This function is a synchronous call.
6231 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6232 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6233 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6236 * @param[in] device_address - Device address
6240 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6243 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6245 * @brief Adds the Service UUIDS to blacklist.
6247 * This function is a synchronous call.
6249 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6250 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6251 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6254 * @param[in] service_uuids - profile or custom service uuids
6258 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6261 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6263 * @brief Adds the Service UUIDS to whitelist.
6265 * This function is a synchronous call.
6267 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6268 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6269 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6272 * @param[in] service_uuids - profile or custom service uuids
6276 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6279 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6281 * @brief Clears the devices from blacklist.
6283 * This function is a synchronous call.
6285 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6286 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6287 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6294 int bluetooth_dpm_clear_devices_from_blacklist(void);
6297 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6299 * @brief Clears the devices from whitelist.
6301 * This function is a synchronous call.
6303 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6304 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6305 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6312 int bluetooth_dpm_clear_devices_from_whitelist(void);
6315 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6317 * @brief Clears the uuids from blacklist.
6319 * This function is a synchronous call.
6321 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6322 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6323 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6330 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6333 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6335 * @brief Clears the uuids from whitelist.
6337 * This function is a synchronous call.
6339 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6340 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6341 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6348 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6351 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6353 * @brief reads the devices from blacklist.
6355 * This function is a synchronous call.
6357 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6358 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6359 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6362 * @param[out] device_list - list of devices
6366 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6369 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6371 * @brief reads the devices from whitelist.
6373 * This function is a synchronous call.
6375 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6376 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6377 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6380 * @param[out] device_list - list of devices
6384 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6387 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6389 * @brief reads the uuids from blacklist.
6391 * This function is a synchronous call.
6393 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6394 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6395 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6398 * @param[in] uuid_list - list of uuids
6402 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6405 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6407 * @brief reads the uuids from whitelist.
6409 * This function is a synchronous call.
6411 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6412 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6413 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6416 * @param[in] uuid_list - list of uuids
6420 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6423 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6425 * @brief Removes the device from whitelist.
6427 * This function is a synchronous call.
6429 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6430 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6431 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6434 * @param[in] device_address - Device address
6438 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6441 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6443 * @brief Removes the device from blacklist.
6445 * This function is a synchronous call.
6447 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6448 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6449 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6452 * @param[in] device_address - Device address
6456 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6459 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6461 * @brief Removes the Service UUIDS from whitelist.
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
6470 * @param[in] service_uuids - profile or custom service uuids
6474 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6477 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6479 * @brief Removes the Service UUIDS from blacklist.
6481 * This function is a synchronous call.
6483 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6484 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6485 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6488 * @param[in] service_uuids - profile or custom service uuids
6492 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6495 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6497 * @brief Sets the Restriction for outgoing call.
6499 * This function is a synchronous call.
6501 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6502 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6503 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6506 * @param[in] value - State value.
6507 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6508 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6512 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6515 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6517 * @brief Reads the Restriction for outgoing call.
6519 * This function is a synchronous call.
6521 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6522 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6523 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6527 * @param[out] value - State value.
6528 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6529 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6533 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6536 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6538 * @brief Sets the Restriction for Pairing.
6540 * This function is a synchronous call.
6542 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6543 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6544 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6547 * @param[in] value - State value.
6548 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6549 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6553 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6556 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6558 * @brief Reads the Restriction for Pairing
6560 * This function is a synchronous call.
6562 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6563 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6564 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6568 * @param[out] value - State value.
6569 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6570 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6574 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6577 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6579 * @brief Sets the Restriction for using Profiles.
6581 * This function is a synchronous call.
6583 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6584 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6585 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6588 * @param[in]profile - Profile.
6589 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6590 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6591 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6592 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6593 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6594 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6595 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6596 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6597 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6598 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6599 * BLUETOOTH_DPM_PROFILE_NONE
6600 * @param[in] value - State value.
6601 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6602 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6606 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6609 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6611 * @brief Reads the Restriction for using Profiles.
6613 * This function is a synchronous call.
6615 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6616 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6617 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6620 * @param[in]profile - Profile.
6621 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6622 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6623 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6624 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6625 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6626 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6627 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6628 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6629 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6630 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6631 * BLUETOOTH_DPM_PROFILE_NONE
6632 * @param[out] value - State value.
6633 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6634 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6638 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6641 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6643 * @brief Sets the Restriction for Desktop Connectivity.
6645 * This function is a synchronous call.
6647 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6648 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6649 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6652 * @param[in] value - State value.
6653 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6654 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6658 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6661 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6663 * @brief Reads the Restriction for Desktop Connectivity.
6665 * This function is a synchronous call.
6667 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6668 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6669 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6673 * @param[out] value - State value.
6674 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6675 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6679 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6682 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6684 * @brief Sets the Restriction for Discoverable state.
6686 * This function is a synchronous call.
6688 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6689 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6690 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6693 * @param[in] value - State value.
6694 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6695 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6699 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6702 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6704 * @brief Reads the Restriction for Discoverable state.
6706 * This function is a synchronous call.
6708 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6709 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6710 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6714 * @param[out] value - State value.
6715 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6716 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6720 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6723 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6725 * @brief Sets the Restriction for linited discoverable state..
6727 * This function is a synchronous call.
6729 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6730 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6731 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6734 * @param[in] value - State value.
6735 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6736 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6740 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6743 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6745 * @brief Reads the Restriction for limited discoverable state.
6747 * This function is a synchronous call.
6749 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6750 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6751 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6755 * @param[out] value - State value.
6756 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6757 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6761 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6763 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6765 * @brief Sets the Restriction for Data trasnfer.
6767 * This function is a synchronous call.
6769 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6770 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6771 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6774 * @param[in] value - State value.
6775 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6776 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6780 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6784 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6786 * @brief Reads the Restriction for Data trasnfer.
6788 * This function is a synchronous call.
6790 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6791 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6792 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6796 * @param[out] value - State value.
6797 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6798 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6802 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6810 #endif /* __cplusplus */
6811 #endif /* _BLUETOOTH_API_H_*/