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_PBAP_SERVICE = 0x200,
302 } bluetooth_service_type_t;
308 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
309 /* represents that connection
310 * type can both BR/EDR and LE */
311 BLUETOOTH_DEV_CONN_BREDR = 0x00,
312 BLUETOOTH_DEV_CONN_LE = 0x01,
313 } bluetooth_conn_type_t;
319 BLUETOOTH_CODEC_ID_CVSD = 0x01,
320 BLUETOOTH_CODEC_ID_MSBC = 0x02,
321 } bluetooth_codec_type_t;
327 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
328 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
329 } bluetooth_hf_audio_connected_type_t;
335 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
336 } bluetooth_advertising_data_t;
342 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
343 } bluetooth_scan_resp_data_t;
346 * Advertising filter policy
349 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
350 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
351 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
352 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
353 } bluetooth_advertising_filter_policy_t;
359 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
360 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
361 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
362 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
363 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
364 } bluetooth_advertising_type_t;
367 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
368 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
369 } bluetooth_gatt_service_change_type_t;
372 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
373 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
374 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
375 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
376 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
377 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
378 } bt_gatt_permission_t;
381 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
382 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
383 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
384 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
385 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
386 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
387 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
388 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
389 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
390 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
391 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
392 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
393 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
394 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
395 } bt_gatt_characteristic_property_t;
398 * Remote device request types for attributes
401 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
402 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
403 } bluetooth_gatt_att_request_tyep_t;
406 * Advertising parameters
411 guint8 filter_policy;
413 } bluetooth_advertising_params_t;
419 int type; /**< passive 0, active 1 */
420 float interval; /**< LE scan interval */
421 float window; /**< LE scan window */
422 } bluetooth_le_scan_params_t;
432 } bluetooth_le_connection_param_t;
435 LE Read Maximum Data Length
438 guint16 max_tx_octets;
440 guint16 max_rx_octets;
442 } bluetooth_le_read_maximum_data_length_t;
445 LE Read Host suggested default Data Length
448 guint16 def_tx_octets;
450 } bluetooth_le_read_host_suggested_data_length_t;
453 * Samsung XSAT Vendor dependent command
458 } bluetooth_vendor_dep_at_cmd_t;
464 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
465 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
466 } bluetooth_opp_transfer_type_t;
471 } bluetooth_hf_ciev_device_event_t;
473 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
474 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
475 /**< Base ID for GAP Event */
476 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
477 /**< Base ID for SDP events */
478 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
479 /**< Base ID for RFCOMM events */
480 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
481 /**< Base ID for NETWORK events */
482 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
483 /**< Base ID for HDP events */
484 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
485 /**< Base ID for OPC events */
486 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
487 /**< Base ID for Obex Server events */
488 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
489 /**< Base ID for GATT events */
491 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
492 /**< Base ID for Audio events */
493 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
494 /**< Base ID for HID events */
495 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
496 /**< Base ID for Advertising events */
497 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
498 /**< Base ID for PBAP Client events */
499 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
500 /**< Base ID for AVRCP events */
501 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
502 /**< Base ID for IPSP events */
505 * Bluetooth event type
508 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
510 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
511 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
512 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
513 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
514 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
515 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
516 /**< Bluetooth event Discoverable timeout requested*/
517 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
518 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
519 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
520 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
521 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
522 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
523 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
524 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
525 BLUETOOTH_EVENT_REMOTE_IBEACON_DEVICE_FOUND, /**< Bluetooth event remote ibeacon device found (iBeacon LE dev) */
526 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
527 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
528 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
529 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
530 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
531 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
532 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
533 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
534 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
535 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
536 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
537 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
538 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
540 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
541 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
542 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
543 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
544 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
546 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
547 /**< Bluetooth event serice search base id */
548 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
549 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
550 /**< RFCOMM data receive event */
551 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
552 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
554 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
556 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
557 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
559 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
561 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
562 /**< Bluetooth Network event */
563 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
564 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
565 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
566 /**< Network disconnected evnet in server */
568 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
569 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
571 BLUETOOTH_EVENT_HDP_CONNECTED
572 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
573 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
574 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
576 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
577 /* OPC Connected event */
578 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
579 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
580 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
581 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
583 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
584 /* Obex server authorize event*/
585 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
586 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
587 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
588 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
589 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
590 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
592 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
593 /**<Discovered GATT service characteristics event*/
594 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
595 /**<Remote GATT charateristic value changed event*/
596 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
597 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
598 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
599 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
600 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
601 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
602 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
603 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
604 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
605 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
606 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
607 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
608 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
609 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
610 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
612 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
613 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
614 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
615 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
616 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
617 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
618 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
619 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
620 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
621 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
622 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
623 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
624 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
625 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
626 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
627 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
628 BLUETOOTH_EVENT_HF_CONNECTED,
629 BLUETOOTH_EVENT_HF_DISCONNECTED,
630 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
631 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
632 BLUETOOTH_EVENT_HF_RING_INDICATOR,
633 BLUETOOTH_EVENT_HF_CALL_WAITING,
634 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
635 BLUETOOTH_EVENT_HF_CALL_STARTED,
636 BLUETOOTH_EVENT_HF_CALL_ENDED,
637 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
638 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
639 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
640 BLUETOOTH_EVENT_HF_CALL_STATUS,
641 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
642 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
643 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
644 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
645 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
646 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
647 BLUETOOTH_EVENT_HF_CALL_IDLE,
648 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
649 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
650 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
652 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
653 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
654 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
655 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
656 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
658 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
659 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
660 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
661 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
662 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
663 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
664 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
665 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
667 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
668 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
669 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
670 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
671 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
672 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
673 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
675 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
676 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
677 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
678 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
679 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
680 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
681 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
682 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
683 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
685 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
686 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
687 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
688 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
689 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
690 } bluetooth_event_type_t;
693 * This bt_service_uuid_list_t enum indicates service uuid list .
694 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
698 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
699 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
700 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
701 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
702 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
703 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
704 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
705 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
706 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
707 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
708 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
709 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
711 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
712 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
713 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
714 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
715 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
716 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
717 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
718 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
719 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
720 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
721 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
722 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
723 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
724 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
726 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
727 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
728 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
729 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
730 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
731 /**<DIRECT PRINTING*/
732 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
733 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
734 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
735 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
736 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
737 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
738 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
739 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
740 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
741 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
742 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
743 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
744 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
745 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
746 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
747 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
748 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
749 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
750 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
751 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
752 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
753 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
754 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
755 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
756 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
757 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
758 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
759 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
760 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
761 } bluetooth_service_uuid_list_t;
764 * Service class part of class of device returned from device discovery
767 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
768 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
769 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
770 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
771 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
772 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
773 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
774 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
775 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
776 } bluetooth_device_service_class_t;
780 * Major device mask (For device discovery)
783 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
784 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
785 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
786 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
787 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
788 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
789 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
790 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
791 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
792 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
793 } bluetooth_device_major_mask_t;
797 * Major device class (part of Class of Device)
800 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
801 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
802 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
803 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
804 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
805 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
806 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
807 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
808 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
809 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
810 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
811 } bluetooth_device_major_class_t;
814 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
816 /* About Computer Major class */
817 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
819 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
820 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
821 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
822 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
823 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
825 /* About Phone Major class */
826 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
827 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
828 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
829 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
830 /**< voice gateway minor class */
831 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
833 /* About LAN/Network Access Point Major class */
834 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
835 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
836 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
837 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
838 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
839 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
840 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
841 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
843 /* About Audio/Video Major class */
844 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
845 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
847 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
848 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
849 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
850 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
851 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
852 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
853 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
854 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
855 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
856 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
857 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
858 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
859 /**< Video Display and Loud
860 Speaker minor class */
861 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
864 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
866 /* About Peripheral Major class */
867 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
868 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
869 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
870 /**< Combo Keyboard or pointing
873 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
874 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
875 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
876 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
877 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
878 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
879 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
880 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
881 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
883 /* About Imaging Major class */
884 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
885 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
886 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
887 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
889 /* About Wearable Major class */
890 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
891 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
892 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
893 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
894 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
896 /* About Toy Major class */
897 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
898 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
899 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
900 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
901 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
903 /* About Health Major class */
904 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
905 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
906 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
907 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
908 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
909 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
910 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
911 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
912 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
913 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
914 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
915 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
916 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
917 } bluetooth_device_minor_class_t;
920 * structure to hold the device information
923 bluetooth_device_major_class_t major_class; /**< major device class */
924 bluetooth_device_minor_class_t minor_class; /**< minor device class */
925 bluetooth_device_service_class_t service_class;
926 /**< service device class */
927 } bluetooth_device_class_t;
930 * Discovery Role types
933 DISCOVERY_ROLE_BREDR = 0x1,
935 DISCOVERY_ROLE_LE_BREDR
936 } bt_discovery_role_type_t;
939 * Connected state types
942 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
943 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
944 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
945 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
946 } bluetooth_connected_link_t;
952 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
953 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
954 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
955 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
956 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
957 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
958 } bluetooth_le_scan_filter_feature_t;
964 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
965 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
966 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
967 } bluetooth_le_connection_mode_t;
970 * structure to hold the device information
973 bluetooth_device_address_t device_address; /**< device address */
974 bluetooth_device_name_t device_name; /**< device name */
975 bluetooth_device_class_t device_class; /**< device class */
976 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
977 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
979 int rssi; /**< received strength signal*/
980 gboolean paired; /**< paired flag */
981 bluetooth_connected_link_t connected; /**< connected link type */
982 gboolean trust; /**< trust flag */
983 gboolean is_alias_set; /** is device alias set flag**/
984 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
985 } bluetooth_device_info_t;
988 * structure to hold the LE device information
991 int data_len; /**< manafacturer specific data length */
992 bluetooth_advertising_data_t data; /**< manafacturer specific data */
993 } bluetooth_le_advertising_data_t;
996 bluetooth_device_address_t device_address; /**< device address */
997 int addr_type; /**< address type*/
998 int rssi; /**< received strength signal*/
999 bluetooth_le_advertising_data_t adv_ind_data;
1000 bluetooth_le_advertising_data_t scan_resp_data;
1001 } bluetooth_le_device_info_t;
1004 bluetooth_device_address_t device_address; /**< device address */
1005 int addr_type; /**< address type*/
1006 int rssi; /**< received strength signal*/
1008 int company_id; /** <Company ID> */
1009 int ibeacon_type; /** <iBeacon type> */
1010 int major_id; /** <Major ID> */
1011 int minor_id; /** <Minor ID> */
1012 int measured_power; /** <Measured Power value for proximity> */
1013 int uuid_len; /** <uuid string len> */
1014 char uuid[BLUETOOTH_UUID_STRING_MAX]; /** <customr/specific UUID> */
1015 } bluetooth_ibeacon_device_info_t;
1019 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1020 bluetooth_device_address_t device_address; /**< device address */
1021 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1022 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1023 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1024 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1025 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1026 bluetooth_le_advertising_data_t service_data; /**< service data */
1027 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1028 int manufacturer_id; /**< manufacturer ID */
1029 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1030 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1031 } bluetooth_le_scan_filter_t;
1034 bluetooth_device_address_t device_address; /**< device address */
1035 unsigned int mtu; /** < MTU set for the ATT connection */
1036 unsigned int status; /** < status of the MTU exchange */
1037 } bluetooth_le_att_mtu_info_t;
1040 * structure to hold the paired device information
1043 bluetooth_device_address_t device_address; /**< paired device address */
1044 bluetooth_device_name_t device_name; /**< device name */
1045 bluetooth_device_class_t device_class; /**< device class */
1046 } bluetooth_paired_device_info_t;
1049 * structure to hold the paired device information
1052 bluetooth_device_address_t device_address;
1053 /**< device address */
1054 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1055 /**< network interface name */
1056 } bluetooth_network_device_info_t;
1059 * Authentication event types
1063 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1064 BLUETOOTH_AUTH_PIN_REQUEST,
1065 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1066 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1067 } bluetooth_auth_type_t;
1070 * structure to hold the pincode/pass-key req informations
1073 bluetooth_device_address_t device_address; /**< remote device address */
1074 bluetooth_device_name_t device_name; /**< device name */
1075 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1076 } bluetooth_authentication_request_info_t;
1079 * Stucture to hold discovery option
1082 unsigned short max_response; /**< the number of maximum response */
1083 unsigned short discovery_duration;
1084 /**< duration of discovery (seconds) */
1085 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1086 classOfDevice variable */
1087 } bluetooth_discovery_option_t;
1090 * Stucture to hold event information
1093 int event; /**< event type */
1094 int result; /**< Success or error value */
1096 /**<parameter data pointer */
1098 } bluetooth_event_param_t;
1101 bluetooth_device_address_t device_addr;
1102 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1103 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1104 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1109 bluetooth_device_address_t device_addr;
1110 unsigned char addr_type;
1112 } bt_connection_info_t;
1115 * Stucture to rfcomm receive data
1120 /**< the socket fd */
1121 int buffer_size;/**< the length of the receive buffer */
1123 /**< the receive data buffer */
1124 } bluetooth_rfcomm_received_data_t;
1130 HTYPE_TRANS_HANDSHAKE,
1131 HTYPE_TRANS_HID_CONTROL,
1132 HTYPE_TRANS_GET_REPORT,
1133 HTYPE_TRANS_SET_REPORT,
1134 HTYPE_TRANS_GET_PROTOCOL,
1135 HTYPE_TRANS_SET_PROTOCOL,
1138 } bt_hid_header_type_t;
1144 PTYPE_DATA_RTYPE_INPUT,
1145 PTYPE_DATA_RTYPE_OUTPUT
1146 } bt_hid_param_type_t;
1149 * Stucture to hid receive data
1152 const char *address;
1153 bt_hid_header_type_t type;
1154 /**< Header type containing */
1155 bt_hid_param_type_t param;
1156 /**< Param type in header like INPUT Report or OutPut Report */
1157 int buffer_size;/**< the length of the receive buffer */
1159 /**< the receive data buffer */
1160 } bluetooth_hid_received_data_t;
1163 * Stucture to rfcomm connection
1167 int socket_fd; /**< the socket fd */
1168 int server_id; /* Server id */
1169 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1170 bluetooth_device_address_t device_addr;
1171 /**< device address */
1172 char uuid[BLUETOOTH_UUID_STRING_MAX];
1173 } bluetooth_rfcomm_connection_t;
1176 * Stucture to rfcomm disconnection
1180 /**< the socket fd */
1181 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1182 bluetooth_device_address_t device_addr;
1183 /**< device address */
1184 char uuid[BLUETOOTH_UUID_STRING_MAX];
1185 } bluetooth_rfcomm_disconnection_t;
1189 /**< the socket fd */
1190 bluetooth_device_address_t device_addr;
1191 /**< device address */
1192 } bluetooth_rfcomm_connection_request_t;
1196 /**< the socket fd */
1197 bluetooth_device_address_t device_addr;
1198 /**< device address */
1199 } bluetooth_hid_request_t;
1208 } bt_hdp_qos_type_t;
1214 HDP_ROLE_SOURCE = 0x0,
1216 } bt_hdp_role_type_t;
1220 * Stucture to HDP connected
1223 const char *app_handle; /**< the application handle */
1224 unsigned int channel_id; /**< the channel id */
1225 bt_hdp_qos_type_t type; /**< the QOS type */
1226 bluetooth_device_address_t device_address; /**< the remote address */
1227 } bt_hdp_connected_t;
1230 * Stucture to HDP disconnected
1233 unsigned int channel_id; /**< the channel id */
1234 bluetooth_device_address_t device_address; /**< the remote address */
1235 } bt_hdp_disconnected_t;
1238 * Stucture to HDP data indication
1241 unsigned int channel_id; /**< the channel id */
1242 const char *buffer; /**< the RX data buffer */
1243 unsigned int size; /**< the RX data size */
1244 } bt_hdp_data_ind_t;
1247 * Stucture to OPP client transfer information
1254 } bt_opc_transfer_info_t;
1256 /* Obex Server transfer type */
1257 #define TRANSFER_PUT "PUT"
1258 #define TRANSFER_GET "GET"
1260 * Stucture to OPP/FTP Server authorize information
1267 } bt_obex_server_authorize_into_t;
1275 } bt_obex_server_type_t;
1278 * Stucture to OPP/FTP server transfer information
1286 unsigned long file_size;
1288 bt_obex_server_type_t server_type;
1290 unsigned char *contact_auth_info;
1291 } bt_obex_server_transfer_info_t;
1294 * Stucture to OPP/FTP server connection/disconnection information
1300 } bt_obex_server_connection_info_t;
1304 * Stucture to OOB data
1308 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1309 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1310 unsigned int hash_len;
1311 unsigned int randomizer_len;
1313 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1314 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1315 unsigned int hash256_len;
1316 unsigned int randomizer256_len;
1320 * Structure to GATT attribute handle data
1326 } bt_gatt_handle_info_t;
1329 * Structure to GATT Remote service data
1336 bt_gatt_handle_info_t include_handles;
1337 bt_gatt_handle_info_t char_handle;
1338 } bt_gatt_service_property_t;
1341 * Structure to GATT Remote characteristic data
1345 char *service_handle;
1346 bt_gatt_handle_info_t handle_info;
1347 } bt_gatt_discovered_char_t;
1350 * Structure to format of GATT Characteristic Value
1354 unsigned char format;
1355 unsigned char exponent;
1356 unsigned short unit;
1357 unsigned char name_space;
1358 unsigned short description;
1359 } bt_gatt_char_format_t;
1362 * Structure to GATT Characteristic property
1370 bt_gatt_char_format_t format;
1372 unsigned int val_len;
1373 unsigned int permission;
1374 char *representation;
1375 bt_gatt_handle_info_t char_desc_handle;
1376 } bt_gatt_char_property_t;
1379 * Structure to GATT Characteristic descriptor property
1386 unsigned int val_len;
1387 } bt_gatt_char_descriptor_property_t;
1390 * Structure to GATT Characteristic value
1397 } bt_gatt_char_value_t;
1400 * Structure to GATT Read Request
1404 char *service_handle;
1408 } bt_gatt_read_req_t;
1411 * Structure to GATT Value change
1415 char *service_handle;
1421 } bt_gatt_value_change_t;
1424 bluetooth_device_address_t device_addr;
1426 bluetooth_gatt_service_change_type_t change_type;
1427 } bt_gatt_service_change_t;
1430 * Structure to GATT characteristc Notification change
1434 char *service_handle;
1435 gboolean att_notify;
1436 } bt_gatt_char_notify_change_t;
1439 * Structure to Indication confirmation
1443 char *service_handle;
1446 } bt_gatt_indicate_confirm_t;
1449 * Structure to RSSI Signal Strength Alert
1460 * Structure to RSSI Signal Strength
1470 * Structure for RSSI Enabled or Disabled
1476 gboolean rssi_enabled;
1477 } bt_rssi_enabled_t;
1480 * Structure for RSSI Threshold
1485 int in_range_threshold;
1487 } bt_rssi_threshold_t;
1491 * Structure for Suppoted Profiles and Trusted Profiles
1498 } bt_supported_profile_trusted_t;
1501 * Structure for PBAP Folder Parameters
1504 unsigned char addressbook;
1505 unsigned char folder_type;
1509 * Structure for PBAP Pull application Parameters
1512 unsigned char format;
1513 unsigned char order;
1514 unsigned short offset;
1515 unsigned short maxlist;
1516 long long unsigned fields;
1517 } bt_pbap_pull_parameters_t;
1520 * Structure for PBAP List application Parameters
1523 unsigned char order;
1524 unsigned short offset;
1525 unsigned short maxlist;
1526 } bt_pbap_list_parameters_t;
1529 * Structure for PBAP Pull vCard application Parameters
1532 unsigned char format;
1533 long long unsigned fields;
1535 } bt_pbap_pull_vcard_parameters_t;
1538 * Structure for PBAP Search application Parameters
1541 unsigned char order;
1542 unsigned short offset;
1543 unsigned short maxlist;
1544 unsigned char search_attribute;
1545 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1546 } bt_pbap_search_parameters_t;
1549 * Structure for PBAP Connection Status
1552 bluetooth_device_address_t btaddr;
1554 } bt_pbap_connected_t;
1557 * Structure for PBAP Phonebook Size
1560 bluetooth_device_address_t btaddr;
1562 } bt_pbap_phonebook_size_t;
1565 * Structure for PBAP Phonebook Pull
1568 bluetooth_device_address_t btaddr;
1571 } bt_pbap_phonebook_pull_t;
1574 * Structure for PBAP vCard List
1577 bluetooth_device_address_t btaddr;
1581 } bt_pbap_vcard_list_t;
1584 * Structure for PBAP vCard Pull
1587 bluetooth_device_address_t btaddr;
1590 } bt_pbap_vcard_pull_t;
1593 * Structure for PBAP Phonebook search List
1596 bluetooth_device_address_t btaddr;
1600 } bt_pbap_phonebook_search_list_t;
1603 * Stucture to HF Call status information
1607 char *number; /*Phone Number */
1608 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1609 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1610 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1611 int idx; /*Call index/ID */
1612 } bt_hf_call_status_info_t;
1617 } bt_hf_call_list_s;
1623 TRUSTED_PROFILE_PBAP = 1,
1624 TRUSTED_PROFILE_MAP,
1625 TRUSTED_PROFILE_SAP,
1626 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1627 } bluetooth_trusted_profile_t;
1630 * Restricted Profile types
1633 RESTRICTED_PROFILE_HFP_HS = 1,
1634 RESTRICTED_PROFILE_A2DP,
1635 } bluetooth_restricted_profile_t;
1638 * Structure for LE data length change params
1641 bluetooth_device_address_t device_address;
1642 guint16 max_tx_octets;
1643 guint16 max_tx_time;
1644 guint16 max_rx_octets;
1645 guint16 max_rx_time;
1646 } bt_le_data_length_params_t;
1650 * @brief DPM BT allowance state
1654 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1655 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1656 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1657 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1661 * @brief DPM API result
1665 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1666 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1667 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1668 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1669 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1670 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1674 * @brief DPM Policy status
1678 BLUETOOTH_DPM_STATUS_ERROR = -1,
1680 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1681 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1683 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1684 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1686 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1687 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1691 /* policy-group : BLUETOOTH */
1692 BLUETOOTH_DPM_POLICY_ALLOW,
1693 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1694 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1695 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1696 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1697 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1698 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1699 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1700 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1701 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1702 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1703 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1704 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1705 BLUETOOTH_DPM_POLICY_END,
1706 } bt_dpm_policy_cmd_t;
1709 struct bt_dpm_policy {
1715 typedef struct bt_dpm_policy bt_dpm_policy_t;
1718 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1719 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1720 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1721 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1722 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1723 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1724 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1725 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1726 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1727 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1728 BLUETOOTH_DPM_PROFILE_NONE,
1731 struct bt_dpm_profile_val {
1732 int value; /* tells whether the profile is enabled or disabled */
1734 typedef struct dpm_profile_val dpm_profile_state_t;
1737 * Structure to DPM device list
1741 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1742 } bt_dpm_device_list_t;
1745 * Structure to DPM uuid list
1749 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1750 } bt_dpm_uuids_list_t;
1753 * Structure for IPSP Interface Info
1756 bluetooth_device_address_t btaddr;
1758 } bt_ipsp_connection_info_t;
1761 * Callback pointer type
1763 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1766 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1767 * @brief Set the callback function pointer for bluetooth event
1770 * This API will register the callback function, when any response and event are received from
1771 * bluetooth framework. @n
1772 * this registered callback function will be get called with appropriate event and data structures.
1773 * This function is a synchronous call. An application developer can call
1774 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1775 * type. This registered function will receive events of bluetooth_event_type_t type along with
1779 * @param[in] callback_ptr A pointer to the callback function
1780 * @param[in] user_data A pointer to user data
1781 * @return BLUETOOTH_ERROR_NONE - Success
1785 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1787 GMainLoop *main_loop = (GMainLoop*) user_data;
1791 // Code for each event
1793 g_main_loop_quit(main_loop);
1800 GMainLoop *main_loop = NULL;
1803 main_loop = g_main_loop_new(NULL, FALSE);
1804 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1805 if (ret >= BLUETOOTH_ERROR_NONE)
1807 // bluetooth_register_callback returned Success
1811 // bluetooth_register_callback returned failiure
1813 g_main_loop_run(main_loop);
1817 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1820 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1821 * @brief Set the callback function pointer for bluetooth le event
1824 * This API will register the callback function, when any response and event are received from
1825 * bluetooth framework. @n
1826 * this registered callback function will be get called with appropriate event and data structures.
1827 * This function is a synchronous call. An application developer can call
1828 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1829 * type. This registered function will receive events of bluetooth_event_type_t type along with
1833 * @param[in] callback_ptr A pointer to the callback function
1834 * @param[in] user_data A pointer to user data
1835 * @return BLUETOOTH_ERROR_NONE - Success
1839 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1842 * @fn int bluetooth_le_unregister_callback(void)
1843 * @brief Set the callback function pointer for bluetooth le event
1846 * This API will register the callback function, when any response and event are received from
1847 * bluetooth framework. @n
1848 * this registered callback function will be get called with appropriate event and data structures.
1849 * This function is a synchronous call. An application developer can call
1850 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1851 * type. This registered function will receive events of bluetooth_event_type_t type along with
1856 * @return BLUETOOTH_ERROR_NONE - Success
1860 int bluetooth_le_unregister_callback(void);
1863 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1864 * @brief Set the callback function pointer for bluetooth event
1867 * This API will register the callback function, when any response and event are received from
1868 * bluetooth framework. @n
1869 * this registered callback function will be get called with appropriate event and data structures.
1870 * This function is a synchronous call. An application developer can call
1871 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1872 * type. This registered function will receive events of bluetooth_event_type_t type along with
1877 * @return BLUETOOTH_ERROR_NONE - Success
1881 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1883 GMainLoop *main_loop = (GMainLoop*) user_data;
1887 // Code for each event
1889 g_main_loop_quit(main_loop);
1896 GMainLoop *main_loop = NULL;
1899 main_loop = g_main_loop_new(NULL, FALSE);
1900 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1901 if (ret >= BLUETOOTH_ERROR_NONE)
1903 // bluetooth_register_callback returned Success
1907 // bluetooth_register_callback returned failiure
1909 ret = bluetooth_deregister_callback(void);
1910 g_main_loop_run(main_loop);
1914 int bluetooth_unregister_callback(void);
1917 * @fn int bluetooth_enable_adapter(void)
1918 * @brief Enable the Bluetooth H/W
1921 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1922 * send request to bluetooth chip for activation.
1923 * This function is typically called at startup or when Bluetooth services are required. This
1924 * function must be called before calling any other API of Bluetooth operations.
1926 * Before performing any operations like Device discover, service search etc.., the adapter must be
1929 * This function is a asynchronous call.
1930 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1931 * through registered callback function with appropriate result code
1932 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1933 * BLUETOOTH_ERROR_NONE - Success \n
1935 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1936 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1938 * @return BLUETOOTH_ERROR_NONE - Success\n
1939 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1940 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1941 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1942 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1944 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1946 void bt_event_callback(int event, bluetooth_event_param_t *param)
1950 case BLUETOOTH_EVENT_ENABLED:
1951 if (param->result == BLUETOOTH_ERROR_NONE)
1953 // Successfully Enabled
1966 ret = bluetooth_enable_adapter();
1970 int bluetooth_enable_adapter(void);
1973 * @fn int bluetooth_disable_adapter(void)
1974 * @brief Disable the Bluetooth H/W
1977 * This function disables Bluetooth protocol stack and hardware. This function is called when
1978 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1980 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1981 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1982 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1984 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1987 * This function is a asynchronous call.
1988 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1989 * through registered callback function.
1992 * @return BLUETOOTH_ERROR_NONE - Success\n
1993 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1994 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1995 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1997 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1999 void bt_event_callback(int event, bluetooth_event_param_t *param)
2003 case BLUETOOTH_EVENT_DISABLED:
2004 if (param->result == BLUETOOTH_ERROR_NONE)
2006 // Successfully disabled
2019 ret = bluetooth_disable_adapter();
2022 int bluetooth_disable_adapter(void);
2023 int bluetooth_recover_adapter(void);
2024 int bluetooth_check_adapter_le(void);
2025 int bluetooth_enable_adapter_le(void);
2027 int bluetooth_disable_adapter_le(void);
2030 * @fn int bluetooth_reset_adapter(void)
2031 * @brief Reset the Bluetooth H/W and values
2034 * This function resets Bluetooth protocol stack and hardware. This function is called when
2035 * an user want to initialize Bluetooth environment.
2037 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2040 * This function is a synchronous call.
2042 * @return BLUETOOTH_ERROR_NONE - Success\n
2043 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2045 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2050 ret = bluetooth_reset_adapter();
2053 int bluetooth_reset_adapter(void);
2056 * @fn int bluetooth_is_supported(void)
2057 * @brief Check if the bluetooth is supported or not by the current target
2059 * This API checks whether the bluetooth is supported or not.
2060 * This API only run by root permission.
2062 * This function is a synchronous call.
2064 * @return 0 - if bluetooth is not supported\n
2065 * 1 - if bluetooth is supported\n
2066 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2071 ret = bluetooth_is_supported();
2074 int bluetooth_is_supported(void);
2078 * @fn int bluetooth_check_adapter(void)
2079 * @brief Check the current status of the Bluetooth adapter
2082 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2083 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2084 * bluetooth adapter.
2085 * This API get the adapter internal data structure and check current adapter status.
2087 * This function is a synchronous call.
2090 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2091 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2093 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2097 ret = bluetooth_check_adapter();
2100 int bluetooth_check_adapter(void);
2103 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2104 * @brief Get the local adapter bluetooth address
2107 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2108 * the adapter should be enabled.
2109 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2110 * contain Bluetooth address.
2111 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2112 * friendly name for each device.
2113 * There is no event callback for this API.
2115 * This function is a synchronous call.
2118 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2119 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2120 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2121 * @param[out] local_address a device address of local bluetooth adapter
2126 bluetooth_device_address_t local_address={0,};
2129 ret = bluetooth_get_local_address(&local_address);
2132 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2135 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2136 * @brief Get the hci version
2139 * This function is used to get the bluetooth hci version
2140 * Before calling this API make sure that the adapter is enabled.
2142 * This function is a synchronous call.
2145 * @return BLUETOOTH_ERROR_NONE - Success \n
2146 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2147 * @param[out] timeout remain visibility timeout value
2150 bluetooth_version_t *version;
2152 ret = bluetooth_get_local_version (&version);
2155 int bluetooth_get_local_version(bluetooth_version_t *version);
2158 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2159 * @brief Get the local device name
2162 * This function is used, get the local device name. Since its difficult to remember the Adapter
2163 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2164 * friendly name is retrived by the remote device and displaying.
2165 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2167 * This function is a synchronous call.
2170 * @return BLUETOOTH_ERROR_NONE - Success \n
2171 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2172 * @param[out] local_name a local device name
2176 bluetooth_device_name_t local_name={0,}
2178 ret = bluetooth_get_local_name (&local_name);
2181 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2184 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2185 * @brief Set the local device name
2188 * This function is used to set the local device name. This is a human friendly name whose
2189 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2191 * This function is a synchronous call.
2193 * @param[in] local_name bluetooth device name to set local device
2195 * @return BLUETOOTH_ERROR_NONE - Success \n
2196 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2197 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2198 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2199 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2200 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2205 bluetooth_device_name_t local_name={0,}
2207 ret = bluetooth_set_local_name (&local_name);
2210 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2214 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2215 * @brief Check if the uuid is used or not
2217 * This function is used to check if the uuid is used or not.
2219 * This function is a synchronous call.
2221 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2222 * @param[out] used if the uuid is used or not
2224 * @return BLUETOOTH_ERROR_NONE - Success \n
2225 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2226 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2227 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2232 gboolean used = FALSE;
2233 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2234 ret = bluetooth_is_service_used(uuid, &used);
2237 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2240 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2241 * @brief Check if the device is connected to the specific service
2243 * This function is used to check if if the device is connected to the specific service.
2245 * This function is a synchronous call.
2247 * @param[in] local_address a device address of remote bluetooth device
2248 * @param[in] type the service type
2249 * @param[out] is_connected if the device is connected or not
2251 * @return BLUETOOTH_ERROR_NONE - Success \n
2252 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2253 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2254 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2259 gboolean is_connected = FALSE;
2260 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2261 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2264 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2265 bluetooth_service_type_t type,
2266 gboolean *is_connected);
2269 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2270 * @brief Gets device's connected link type
2272 * This function is used to get device's connected link type
2274 * This function is a synchronous call.
2276 * @param[in] device_address a device address of remote bluetooth device
2277 * @param[out] connected_link a device's connected link type
2279 * @return BLUETOOTH_ERROR_NONE - Success \n
2280 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2281 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2282 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2287 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2288 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2289 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2292 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2293 bluetooth_connected_link_t *connected_link);
2296 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2297 * @brief Sets a profile trusted for a device
2299 * This function is used to Set a profile as trusted for a device
2301 * This function is a synchronous call.
2303 * @param[in] device_address a device address of remote bluetooth device
2304 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2305 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2307 * @return BLUETOOTH_ERROR_NONE - Success \n
2308 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2309 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2310 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2314 int bluetooth_set_profile_trusted(
2315 const bluetooth_device_address_t *device_address,
2316 int profile, int trust);
2319 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2320 * @brief Gets a profile is trusted for a device
2322 * This function is used to Get a profile is trusted or not for a device
2324 * This function is a synchronous call.
2326 * @param[in] device_address a device address of remote bluetooth device
2327 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2328 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2330 * @return BLUETOOTH_ERROR_NONE - Success \n
2331 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2332 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2333 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2337 int bluetooth_get_profile_trusted(
2338 const bluetooth_device_address_t *device_address,
2339 int profile, int *trust);
2342 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2343 * @brief Sets a profile restricted connection for a device
2345 * This function is used to Set a profile as restricted for a device
2347 * This function is a synchronous call.
2349 * @param[in] device_address a device address of remote bluetooth device
2350 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2351 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2353 * @return BLUETOOTH_ERROR_NONE - Success \n
2354 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2355 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2356 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2360 int bluetooth_set_profile_restricted(
2361 const bluetooth_device_address_t *device_address,
2362 int profile, int restricted);
2365 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2366 * @brief Gets a restricted connection state
2368 * This function is used to Get a profile is restricted or not for a device
2370 * This function is a synchronous call.
2372 * @param[in] device_address a device address of remote bluetooth device
2373 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2374 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2376 * @return BLUETOOTH_ERROR_NONE - Success \n
2377 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2378 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2379 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2383 int bluetooth_get_profile_restricted(
2384 const bluetooth_device_address_t *device_address,
2385 int profile, int *restricted);
2388 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2389 * @brief Get the visibility mode
2392 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2393 * visibity mode, the property of the device is determined whether it can be discoverable, non
2394 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2396 * This function is a synchronous call.
2399 * @return BLUETOOTH_ERROR_NONE - Success \n
2400 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2401 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2402 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2403 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2404 * @param[out] discoverable_mode current bluetooth discoverable mode
2406 * @see bluetooth_set_discoverable_mode
2408 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2410 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2413 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2416 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2418 * @brief Set the visibility mode
2421 * This function is used to set the discoverable mode (Visibility option).
2423 * Many times user may want to keep his device discoverable so that when peer device is performing
2424 * device search, he/she can find user's device. Application programmer can keep the mode as
2425 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2426 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2427 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2428 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2430 * This function is a synchronous call.
2432 * @return BLUETOOTH_ERROR_NONE - Success \n
2433 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2435 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2436 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2438 * @see bluetooth_get_discoverable_mode
2442 bluetooth_discoverable_mode_t mode;
2444 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2445 ret = bluetooth_set_discoverable_mode (mode, 180);
2449 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2454 * @fn int bluetooth_get_timeout_value(int *timeout)
2455 * @brief Get the visibility timeout value
2458 * This function is used to get the visibility timeout
2459 * Before calling this API make sure that the adapter is enabled.
2461 * This function is a synchronous call.
2464 * @return BLUETOOTH_ERROR_NONE - Success \n
2465 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2466 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2467 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2468 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2469 * @param[out] timeout remain visibility timeout value
2471 * @see bluetooth_set_discoverable_mode
2475 ret = bluetooth_get_timeout_value (&timeout);
2478 int bluetooth_get_timeout_value(int *timeout);
2482 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2483 * unsigned int classOfDeviceMask)
2484 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2486 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2487 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2488 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2489 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2490 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2491 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2492 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2493 * please see bluetooth_device_info_t for more details.
2496 * This API provides searching options like max responses, discovery duration in seconds and class
2497 * of device mask to filter device search. some times there may be too many bluetooth devices in
2498 * vicinity of your device.in such scenario, application can request to reduce number of responces
2499 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2500 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2501 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2502 * application defined time. please note that discovery_duration should be mentioned in seconds.
2503 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2506 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2507 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2508 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2510 * This function is a asynchronous call.
2511 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2512 * through registered callback function.
2514 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2515 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2517 * The completion or cancellation of the discovery is indicated by an
2518 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2520 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2523 * @return BLUETOOTH_ERROR_NONE - Success \n
2524 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2525 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2526 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2527 agent is not running \n
2529 * @param[in] max_response define the maximum response of the number of founded devices
2531 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2532 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2533 (refer to class of device)
2535 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2538 void bt_event_callback(int event, bluetooth_event_param_t *param)
2542 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2544 bluetooth_device_info_t *device_info = NULL;
2545 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2547 device_info = (bluetooth_device_info_t *)param->param_data;
2548 memcpy(&searched_device, &device_info->device_address,
2549 sizeof(bluetooth_device_address_t));
2550 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2551 device_info->device_address.addr[0],
2552 device_info->device_address.addr[1],
2553 device_info->device_address.addr[2],
2554 device_info->device_address.addr[3],
2555 device_info->device_address.addr[4],
2556 device_info->device_address.addr[5]);
2559 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2561 bluetooth_device_info_t *device_info = NULL;
2562 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2564 device_info = (bluetooth_device_info_t *)param->param_data;
2565 memcpy(&searched_device, &device_info->device_address,
2566 sizeof(bluetooth_device_address_t));
2567 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2568 device_info->device_name.name,
2569 device_info->device_address.addr[0],
2570 device_info->device_address.addr[1],
2571 device_info->device_address.addr[2],
2572 device_info->device_address.addr[3],
2573 device_info->device_address.addr[4],
2574 device_info->device_address.addr[5]);
2578 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2579 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2584 unsigned short max_response;
2585 unsigned short discovery_duration;
2586 unsigned classOfDeviceMask;
2590 discovery_duration =0;
2591 classOfDeviceMask =0;
2593 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2598 int bluetooth_start_discovery(unsigned short max_response,
2599 unsigned short discovery_duration,
2600 unsigned int classOfDeviceMask);
2603 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2604 * unsigned short max_response,
2605 * unsigned short discovery_duration,
2606 * unsigned int classOfDeviceMask)
2607 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2609 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2610 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2611 * Please see bluetooth_start_discovery() for other parameters description.
2613 * This function is a asynchronous call.
2614 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2615 * through registered callback function.
2617 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2618 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2620 * The completion or cancellation of the discovery is indicated by an
2621 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2623 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2626 * @return BLUETOOTH_ERROR_NONE - Success \n
2627 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2628 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2629 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2630 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2631 agent is not running \n
2633 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2634 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2635 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2636 * @param[in] max_response define the maximum response of the number of founded devices
2638 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2639 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2640 (refer to class of device)
2642 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2645 unsigned short type;
2646 unsigned short max_response;
2647 unsigned short discovery_duration;
2648 unsigned classOfDeviceMask;
2653 discovery_duration =0;
2654 classOfDeviceMask =0;
2656 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2661 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2662 unsigned short max_response,
2663 unsigned short discovery_duration,
2664 unsigned int classOfDeviceMask);
2667 * @fn int bluetooth_cancel_discovery (void)
2668 * @brief Cancel the on-going device discovery operation
2671 * This function stops the on-going device discovery operation. This API has to be called after the
2672 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2673 * the bluetooth_start_discovery API
2675 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2676 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2677 * cancel the discover request once the user received the device to which he wish to connect.
2679 * This function is a asynchronous call.
2680 * If the call is success to cancel discovey then the application will receive
2681 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2682 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2683 * BLUETOOTH_ERROR_NONE
2686 * @return BLUETOOTH_ERROR_NONE - Success \n
2687 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2688 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2689 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2690 other application \n
2691 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2693 * @see bluetooth_start_discovery
2695 void bt_event_callback(int event, bluetooth_event_param_t *param)
2699 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2700 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2709 ret = bluetooth_cancel_discovery();
2712 int bluetooth_cancel_discovery(void);
2715 * @fn int bluetooth_start_le_discovery(void)
2716 * @brief Start the generic device discovery which finds the LE devices.
2718 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2719 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2720 * It try to find LE devices. Bluetooth device address and name are
2721 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2722 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2723 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2724 * please see bluetooth_device_info_t for more details.
2726 * This function is a asynchronous call.
2727 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2728 * through registered callback function.
2730 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2733 * The completion or cancellation of the discovery is indicated by an
2734 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2736 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2739 * @return BLUETOOTH_ERROR_NONE - Success \n
2740 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2741 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2742 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2743 agent is not running \n
2746 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2749 void bt_event_callback(int event, bluetooth_event_param_t *param)
2753 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2755 bluetooth_device_info_t *device_info = NULL;
2756 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2758 device_info = (bluetooth_device_info_t *)param->param_data;
2759 memcpy(&searched_device, &device_info->device_address,
2760 sizeof(bluetooth_device_address_t));
2761 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2762 device_info->device_address.addr[0],
2763 device_info->device_address.addr[1],
2764 device_info->device_address.addr[2],
2765 device_info->device_address.addr[3],
2766 device_info->device_address.addr[4],
2767 device_info->device_address.addr[5]);
2771 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2772 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2778 ret = bluetooth_start_discovery();
2783 int bluetooth_start_le_discovery(void);
2786 * @fn int bluetooth_stop_le_discovery (void)
2787 * @brief Cancel the on-going device LE discovery operation
2790 * This function stops the on-going device discovery operation. This API has to be called after the
2791 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2792 * the bluetooth_start_le_discovery API
2795 * This function is a asynchronous call.
2796 * If the call is success to cancel discovey then the application will receive
2797 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2798 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2799 * BLUETOOTH_ERROR_NONE
2802 * @return BLUETOOTH_ERROR_NONE - Success \n
2803 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2804 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2805 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2806 other application \n
2807 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2809 * @see bluetooth_start_discovery
2811 void bt_event_callback(int event, bluetooth_event_param_t *param)
2815 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2816 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2825 ret = bluetooth_stop_le_discovery();
2828 int bluetooth_stop_le_discovery(void);
2831 * @fn int bluetooth_is_discovering(void)
2832 * @brief Check for the device discovery is in-progress or not.
2834 * This API is used to check the current status of the Discovery operation.If discovery is in\
2835 * progress normally other operations are not allowed.
2836 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2837 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2838 * event before performing other operations. This API is used to get for the current discovery
2839 * operation status and using bluetooth_cancel_discovery()
2840 * we can cancell the ongoing discovery process.
2841 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2844 * This function checks whether the device discovery is started or not.
2846 * This function is a synchronous call.
2849 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2850 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2851 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2854 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2858 ret = bluetooth_is_discovering ();
2861 int bluetooth_is_discovering(void);
2864 * @fn int bluetooth_is_le_discovering(void)
2865 * @brief Check for the device LE discovery is in-progress or not.
2867 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2868 * progress normally other operations are not allowed.
2869 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2870 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2871 * event before performing other operations. This API is used to get for the current discovery
2872 * operation status and using bluetooth_stop_le_discovery()
2873 * we can cancell the ongoing LE discovery process.
2874 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2877 * This function checks whether the device LE discovery is started or not.
2879 * This function is a synchronous call.
2882 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2883 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2884 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2887 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2891 ret = bluetooth_is_le_discovering ();
2894 int bluetooth_is_le_discovering(void);
2897 * @fn int bluetooth_is_le_scanning(void)
2898 * @brief Check for the device LE scan is in-progress or not.
2900 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2901 * progress normally other operations are not allowed.
2903 * This function checks whether the device LE Scan is started or not.
2905 * This function is a synchronous call.
2907 * @return TRUE - LE Scan in progress \n
2908 * FALSE - LE Scan is not in progress \n
2913 gboolean is_le_scanning = 0;
2914 is_le_scanning = bluetooth_is_le_scanning ();
2917 gboolean bluetooth_is_le_scanning(void);
2919 gboolean bluetooth_is_scan_filter_supported(void);
2922 * @fn int bluetooth_force_hcidump(int timeout)
2923 * @brief Enable /disable force-hcidump
2925 * This function control force-hcidump.
2927 * This function is a synchronous call.
2929 * @return BLUETOOTH_ERROR_NONE - Success \n
2930 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2931 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2933 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
2938 int bluetooth_force_hcidump(int timeout);
2941 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2942 * @brief Register scan filter.
2944 * This function registers the scan filter.
2946 * This function is a synchronous call.
2948 * @return BLUETOOTH_ERROR_NONE - Success \n
2950 * @param[in] filter scan filter to register
2951 * @param[out] slot_id the slot ID of scan filter
2955 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2958 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2959 * @brief Register scan filter.
2961 * This function unregisters the scan filter.
2963 * This function is a synchronous call.
2965 * @return BLUETOOTH_ERROR_NONE - Success \n
2967 * @param[in] slot_id the slot ID of scan filter
2971 int bluetooth_unregister_scan_filter(int slot_id);
2974 * @fn int bluetooth_unregister_all_scan_filters(void)
2975 * @brief Register scan filter.
2977 * This function usregisters all scan filters.
2979 * This function is a synchronous call.
2981 * @return BLUETOOTH_ERROR_NONE - Success \n
2985 int bluetooth_unregister_all_scan_filters(void);
2988 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2989 int link_type, bt_rssi_threshold_t rssi_threshold)
2990 * @brief Enable RSSI monitoring
2992 * This function enables RSSI monitoring and sets threshold for a connection
2994 * @return BLUETOOTH_ERROR_NONE - Success \n
2997 * @see bluetooth_get_rssi_strength
2999 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3000 int link_type, bt_rssi_threshold_t *rssi_threshold);
3003 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3004 * @brief Gets Raw RSSI signal Strength
3006 * This function gives the Raw RSSI signal strength for a connection.
3008 * @return BLUETOOTH_ERROR_NONE - Success \n
3011 * @see bluetooth_enable_rssi
3013 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3015 int bluetooth_set_connectable(gboolean is_connectable);
3017 int bluetooth_is_connectable(gboolean *is_connectable);
3020 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3021 * @brief Initiate a bonding process
3024 * This function initiates a bonding procedure with a peer device. The bonding procedure
3025 * enables authentication and optionally encryption on the Bluetooth link.
3027 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3028 * inititate the bonding request to the devices already in the paired list.
3030 * Usually we call this API after the device discovery.
3031 * This function is a asynchronous call.
3033 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3034 * mentioed result code
3035 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3036 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3037 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3038 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3039 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3041 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3042 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3045 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3048 * @return BLUETOOTH_ERROR_NONE - Success \n
3049 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3050 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3051 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3052 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3054 * @param[in] device_address This indicates an address of the device with which the pairing
3055 * should be initiated
3057 * @see bluetooth_cancel_bonding
3059 void bt_event_callback(int event, bluetooth_event_param_t *param)
3063 case BLUETOOTH_EVENT_BONDING_FINISHED:
3065 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3066 if (param->result >= BLUETOOTH_ERROR_NONE)
3068 bluetooth_device_info_t *device_info = NULL;
3069 device_info = (bluetooth_device_info_t *)param->param_data;
3070 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3071 mjr[%#x] min[%#x] srv[%#x]",
3072 device_info->device_name.name,
3073 device_info->device_address.addr[0],
3074 device_info->device_address.addr[1],
3075 device_info->device_address.addr[2],
3076 device_info->device_address.addr[3],
3077 device_info->device_address.addr[4],
3078 device_info->device_address.addr[5],
3079 device_info->device_class.major_class,
3080 device_info->device_class.minor_class,
3081 device_info->device_class.service_class);
3095 bluetooth_device_address_t device_address={{0}};
3097 ret = bluetooth_bond_device(&device_address);
3101 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3104 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3105 * bluetooth_conn_type_t conn_type)
3106 * @brief Initiate a bonding process
3109 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3110 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3112 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3113 * inititate the bonding request to the devices already in the paired list.
3115 * Usually we call this API after the device discovery.
3116 * This function is a asynchronous call.
3118 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3119 * mentioed result code
3120 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3121 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3122 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3123 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3124 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3126 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3127 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3130 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3133 * @return BLUETOOTH_ERROR_NONE - Success \n
3134 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3135 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3136 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3137 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3139 * @param[in] device_address This indicates an address of the device with which pairing
3140 * should be initiated
3141 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3144 * @see bluetooth_cancel_bonding
3146 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3147 bluetooth_conn_type_t conn_type);
3150 * @fn int bluetooth_cancel_bonding(void)
3151 * @brief Cancel the on-going bonding process
3153 * This API is called to cancel the on-going bonding procedure. It should be called before the
3154 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3155 * This API is useful when the remote device is not responding to the bond request or we wish to
3156 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3158 * This function is a synchronous call.
3160 * @return BLUETOOTH_ERROR_NONE - Success \n
3161 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3162 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3165 * @see bluetooth_bond_device
3171 ret = bluetooth_cancel_bonding();
3174 int bluetooth_cancel_bonding(void);
3177 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3178 * @brief Remove bonding
3181 * To communicate with remote device over bluetooth link, user should bond with peer device.
3182 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3183 * API is used to remove peer device from the list. Please note that after removing the device
3184 * from bonded device list, you cannot communication with peer device until bonding happens again.
3186 * User can call this function by passing bluetooth device address of any bonded device. Please note
3187 * that after successful return of this function, any bluetooth application running on your device
3188 * will not be able to communicate with unbonded device until bond operation happens again using
3189 * bluetooth_bond_device()
3192 * This function is a asynchronous call. The request to remove the specified device from the bonded
3193 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3194 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3195 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3199 * @return BLUETOOTH_ERROR_NONE - Success \n
3200 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3201 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3202 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3203 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3204 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3205 * agent is not running \n
3206 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3209 * @param[in] device_address This indicates an address of the device to remove bonding
3213 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3216 void bt_event_callback(int event, bluetooth_event_param_t *param)
3219 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3220 bluetooth_device_address_t *dev_addr = NULL;
3222 if (param->result == BLUETOOTH_ERROR_NONE) {
3223 dev_addr = (bluetooth_device_address_t *)param->param_data;
3225 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3226 dev_addr->addr[0], dev_addr->addr[1]
3227 dev_addr->addr[2], dev_addr->addr[3]
3228 dev_addr->addr[4], dev_addr->addr[5]
3239 bluetooth_device_address_t *device_address;
3241 // copy valid device address in device_address
3243 ret = bluetooth_unbond_device(device_address);
3246 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3249 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3250 * @brief Get bonded(paired) device list
3253 * This API gets all bonded device list.
3254 * The devices in the bonded device list further can be used to perform the authorization by calling
3255 * bluetooth_authorize_device API.
3257 * This function is a synchronous call.
3258 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3259 * there is no valid information in the dev_list.
3260 * The len field in the dev_list represents the number of bonded devices. The data structure for
3261 * bonded device information is bluetooth_device_info_t.
3264 * @return BLUETOOTH_ERROR_NONE - Success \n
3265 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3267 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3269 void bt_get_bonded_devices(void)
3273 GPtrArray *devinfo = NULL;
3274 bluetooth_device_info_t *ptr;
3276 // allocate the g_pointer_array
3277 devinfo = g_ptr_array_new();
3279 ret = bluetooth_get_bonded_device_list(&devinfo);
3280 if (ret != BLUETOOTH_ERROR_NONE)
3282 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3286 printf("g pointer arrary count : [%d]", devinfo->len);
3287 for (i=0; i<devinfo->len; i++)
3289 ptr = g_ptr_array_index(devinfo, i);
3292 printf("Name [%s]\n", ptr->device_name.name);
3293 printf("Major Class [%d]\n", ptr->device_class.major_class);
3294 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3295 printf("Service Class [%d]\n", ptr->device_class.service_class);
3296 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3297 ptr->device_address.addr[0],
3298 ptr->device_address.addr[1], ptr->device_address.addr[2],
3299 ptr->device_address.addr[3],
3300 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3307 // free g_pointer_array
3308 g_ptr_array_free(devinfo, TRUE);
3313 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3315 int bluetooth_get_profile_connected_device_list(
3316 const char *profile_uuid, GPtrArray **addr_list);
3319 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3320 * bluetooth_device_info_t *dev_info)
3321 * @brief Get a bonded(paired) device
3324 * This API gets a bonded device.
3326 * This function is a synchronous call.
3327 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3328 * there is no valid information in the dev_info.
3329 * The data structure for bonded device information is bluetooth_device_info_t.
3332 * @return BLUETOOTH_ERROR_NONE - Success \n
3333 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3335 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3337 void bt_get_bonded_device(void)
3341 bluetooth_device_info_t devinfo = {0};
3342 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3344 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3345 if (ret != BLUETOOTH_ERROR_NONE)
3347 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3351 printf("Name [%s]\n", devinfo.device_name.name);
3352 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3353 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3354 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3355 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3356 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3357 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3358 devinfo.device_address.addr[5]);
3367 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3368 bluetooth_device_info_t *dev_info);
3372 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3373 * gboolean *is_alias_set)
3374 * @brief Get is_alias_set property of device
3376 * This API gets is_alias_set property of a bonded device.
3378 * This function is a synchronous call.
3379 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3380 * If not,there is no valid information in the is_alias_set.
3382 * @return BLUETOOTH_ERROR_NONE - Success \n
3383 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3388 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3390 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3393 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3394 gboolean *is_alias_set);
3397 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3398 * @brief set alias for bonded device
3401 * This function set alias for bonded device.
3403 * This function is a synchronous call.
3406 * @return BLUETOOTH_ERROR_NONE - Success \n
3407 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3408 * @param[in] device_address This indicates an address of the remote device
3409 * @param[in] alias This indicates an alias to set
3414 ret = bluetooth_set_alias(&remote_address);
3417 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3421 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3422 * @brief Get remote deivice
3425 * This function gets specific remote device.
3427 * This function is a asynchronous call.
3428 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3431 * @return BLUETOOTH_ERROR_NONE - Success \n
3432 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3433 * @param[in] device_address This indicates an address of the remote device
3438 ret = bluetooth_get_remote_device(&remote_address);
3441 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3444 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3445 * gboolean authorized)
3446 * @brief Authorize/Unauthorize a bonded device
3449 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3450 * with/without user confirmation.
3452 * If we select a paired device and make it authorized by calling this API with the authorized
3453 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3454 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3455 * then it will ask for the user conformation before the connection.
3457 * This API supposed to be called on the paired devices. Which means we have to use this API only
3458 * after successful pairing.
3460 * This function is a asynchronous call.
3461 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3463 * @return BLUETOOTH_ERROR_NONE - Success \n
3464 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3465 * @param[in] device_address This indicates an address of the device to authorize \n
3466 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3468 * @see bluetooth_get_bonded_device_list
3470 void bt_event_callback(int event, bluetooth_event_param_t *param)
3474 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3476 if (param->result == BLUETOOTH_ERROR_NONE)
3480 //device authorization failed failure
3488 bluetooth_device_address_t device_address={{0}};
3489 gboolean authorized;
3493 ret = bluetooth_authorize_device(&device_address,authorized);
3496 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3497 gboolean authorized);
3499 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3500 const bluetooth_device_pin_code_t *pin_code);
3502 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3505 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3507 * @brief Receives Legacy Passkey\pin with following authentication response types
3509 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3510 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3513 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3516 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3518 * @brief This API sends user confirmation reply to the local adapter.
3520 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3523 int bluetooth_passkey_confirmation_reply(gboolean reply);
3526 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3527 * @brief Get all services supported by remote device
3530 * This API call initiates the search for the services supported by the specified device. Normally
3531 * the service search will take a couple of seconds to get it completed. Before calling this API
3532 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3533 * perform the service search. We can get the device address by doing a device discovery operation.
3536 * This function is a asynchronous call.
3537 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3539 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3540 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3541 * event is generated with appropriate result code.
3543 * @return BLUETOOTH_ERROR_NONE - Success \n
3544 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3545 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3546 * @param[in] device_address This indicates an address of the device
3547 * whose services need to be found
3549 * @see bluetooth_cancel_service_search
3551 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3554 * @fn int bluetooth_cancel_service_search(void)
3555 * @brief Cancel the ongoing service search operation
3558 * This function cancel the ongoing service search operation. This API is usually calling after the
3559 * bluetooth_search_service API.
3560 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3561 * if the user wish to cancel the Ongoing service search operation.
3563 * This API should be called just after the bluetooth_search_service API and before the
3564 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3566 * This function is a synchronous call.
3568 * @return BLUETOOTH_ERROR_NONE - Success \n
3569 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3570 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3571 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3574 * @see bluetooth_search_service
3579 ret = bluetooth_cancel_service_search();
3582 int bluetooth_cancel_service_search(void);
3585 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3586 * @brief Register rfcomm socket with a specific uuid
3589 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3590 * descriptor of the server.
3591 * This is the first API which is called to create the server. Once we created the server socket,
3592 * we will listen on that return socket.
3593 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3596 * @return socket FD on Success \n
3597 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3598 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3599 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3600 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3601 * @param[in] UUID (128 bits)
3604 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3608 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3609 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3613 int bluetooth_rfcomm_create_socket(const char *uuid);
3616 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3617 * @brief Register rfcomm socket with a specific uuid
3620 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3621 * descriptor of the server.
3622 * This is the first API which is called to create the server. Once we created the server socket,
3623 * we will listen on that return socket.
3624 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3627 * @return socket FD on Success \n
3628 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3629 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3630 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3631 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3632 * @param[in] UUID (128 bits)
3633 * @param[in] bus_name (const char)
3634 * @param[in] path (const char)
3637 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3641 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3642 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3646 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3649 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3650 * @brief De-register the rfcomm socket
3653 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3654 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3655 * descriptor else no event will come. We will call this API only after the
3656 * bluetooth_rfcomm_listen_and_accept.
3657 * This is a synchronous call.
3659 * @return BLUETOOTH_ERROR_NONE - Success \n
3660 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3661 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3662 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3663 * @param[in] int socket_fd
3666 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3669 void bt_event_callback(int event, bluetooth_event_param_t *param)
3673 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3675 bluetooth_rfcomm_connection_t *discon_ind =
3676 (bluetooth_rfcomm_connection_t *)param->param_data;
3678 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3686 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3687 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3689 ret = bluetooth_rfcomm_remove_socket(fd);
3692 int bluetooth_rfcomm_remove_socket(int socket_fd);
3695 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3696 * @brief De-register the rfcomm socket
3699 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3700 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3701 * descriptor else no event will come. We will call this API only after the
3702 * bluetooth_rfcomm_listen_and_accept_ex.
3703 * This is a synchronous call.
3705 * @return BLUETOOTH_ERROR_NONE - Success \n
3706 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3707 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3708 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3709 * @param[in] UUID (128 bits)
3712 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3715 void bt_event_callback(int event, bluetooth_event_param_t *param)
3719 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3721 bluetooth_rfcomm_connection_t *discon_ind =
3722 (bluetooth_rfcomm_connection_t *)param->param_data;
3724 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3732 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3733 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3735 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3738 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3741 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3742 * @brief Disconnect rfcomm connection
3745 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3746 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3749 * @return BLUETOOTH_ERROR_NONE - Success \n
3750 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3751 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3752 * @param[in] int socket_fd the sending socket fd
3758 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3760 printf("Disconnection failed");
3762 printf("Disconnection Success");
3766 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3769 * @fn int bluetooth_rfcomm_listen_and_accept(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_CONNECTED
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_CONNECTED:
3797 bluetooth_rfcomm_connection_t *conn_ind =
3798 (bluetooth_rfcomm_connection_t *)param->param_data;
3800 printf("\nConnected from FD %d", conn_ind->socket_fd);
3808 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3809 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3813 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3816 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3817 * @brief Rfcomm socket listen
3820 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3821 * after the bluetooth_rfcomm_create_socket API.
3822 * This API listen for the incomming connection and once it receives a connection, it will give
3823 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3824 * event to the application. This is an Asynchronous API call.
3827 * @return BLUETOOTH_ERROR_NONE - Success \n
3828 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3829 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3831 * @param[in] int socket_fd
3832 * @param[in] max pending connection.
3837 * @see bluetooth_rfcomm_create_socket_ex
3840 void bt_event_callback(int event, bluetooth_event_param_t* param)
3844 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3846 bluetooth_rfcomm_connection_t *conn_ind =
3847 (bluetooth_rfcomm_connection_t *)param->param_data;
3849 printf("\nConnected from FD %d", conn_ind->socket_fd);
3857 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3858 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3863 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3866 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3867 * @brief Rfcomm socket listen
3870 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3871 * after the bluetooth_rfcomm_create_socket API.
3872 * This API listen for the incomming connection and once it receives a connection, it will give
3873 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3874 * event to the application. This is an Asynchronous API call.
3877 * @return BLUETOOTH_ERROR_NONE - Success \n
3878 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3879 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3881 * @param[in] int socket_fd
3882 * @param[in] max pending connection.
3885 * @see bluetooth_rfcomm_create_socket
3888 void bt_event_callback(int event, bluetooth_event_param_t* param)
3892 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3894 char *name = (char *)param->param_data;
3896 printf("\nConnected from %s", name);
3898 bluetooth_rfcomm_accept_connection();
3906 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3907 ret = bluetooth_rfcomm_listen(fd, 1);
3911 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3914 * @fn int bluetooth_rfcomm_accept_connection()
3915 * @brief Accepts the authorization request indicated by the event
3916 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3918 * This function is a synchronous call.
3920 * @return BLUETOOTH_ERROR_NONE - Success \n
3921 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3923 * @param[in] the socket fd of the server
3924 * @param[out] the socket fd of the client
3928 * @see bluetooth_rfcomm_reject_connection
3930 int bluetooth_rfcomm_accept_connection(int server_fd);
3933 * @fn int bluetooth_rfcomm_reject_connection()
3934 * @brief Rejects the authorization request indicated by the event
3935 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3937 * This function is a synchronous call.
3939 * @return BLUETOOTH_ERROR_NONE - Success \n
3940 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3942 * @param[in] the socket fd of the server
3946 * @see bluetooth_rfcomm_accept_connection
3948 int bluetooth_rfcomm_reject_connection(int server_fd);
3951 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3952 * @brief Informs whether rfcomm server uuid is available or not.
3954 * This function is a synchronous call.
3956 * @return TRUE - RFCOMM uuid is available \n
3957 * FALSE - RFCOMM uuid is not available \n
3959 * @param[in] uuid UUID string
3965 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3968 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3969 * const char *remote_uuid)
3970 * @brief Connect to the remote device rfcomm *
3972 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3973 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3974 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3975 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3976 * initiating a connection.
3978 * @return BLUETOOTH_ERROR_NONE - Success \n
3979 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3980 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3981 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3982 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3983 * @param[in] bluetooth_device_address_t remote bt_address
3984 * @param[in] char remote uuid
3986 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3990 void bt_event_callback(int event, bluetooth_event_param_t *param)
3994 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3996 if (param->result >= BLUETOOTH_ERROR_NONE)
3998 bt_sdp_info_t *bt_sdp_info=param->param_data;
4000 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4001 bt_sdp_info->device_addr.addr[0],
4002 bt_sdp_info->device_addr.addr[1],
4003 bt_sdp_info->device_addr.addr[2],
4004 bt_sdp_info->device_addr.addr[3],
4005 bt_sdp_info->device_addr.addr[4],
4006 bt_sdp_info->device_addr.addr[5]);
4008 printf("Supported service list:\n");
4009 for(i=0; i<bt_sdp_info->service_index; i++)
4011 bt_sdp_info->service_list_array[i]);
4014 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4015 //rfcomm_test_uuid);
4019 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4021 bluetooth_rfcomm_connection_t *conn_ind =
4022 (bluetooth_rfcomm_connection_t *)param->param_data;
4024 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4025 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4026 "SERVER" : "CLIENT");
4031 bluetooth_device_address_t remote_address = {{0},};
4032 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4033 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4034 ret = bluetooth_search_service(&remote_address);
4036 printf("Seach failed, Reason = %d", ret);
4038 printf("Search Success, Ret = %d", ret);
4040 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4042 printf("Connection failed, Reason = %d", ret);
4044 printf("Connection Success, Ret = %d", ret);
4048 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4049 const char *remote_uuid);
4052 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4053 * @brief Disconnect rfcomm connection
4056 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4057 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4060 * @return BLUETOOTH_ERROR_NONE - Success \n
4061 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4062 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4063 * @param[in] char remote bt_address
4066 * @see bluetooth_rfcomm_connect
4070 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4072 printf("Disconnection failed");
4074 printf("Disconnection Success");
4079 int bluetooth_rfcomm_disconnect(int socket_fd);
4082 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4083 * @brief Write to rfcomm connection
4086 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4087 * API is used to send the data for server and the client.
4089 * @return BLUETOOTH_ERROR_NONE - Success \n
4090 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4091 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4093 * @param[in] const char *buff Data buffer to send
4094 * @param[in] int length Length of the data
4097 * @see bluetooth_rfcomm_connect
4100 char *buff = "Test data 123456789"
4101 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4103 printf("Send failed");
4105 printf("Send success");
4109 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4112 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4113 * @brief Informs whether rfcomm client is connected.
4115 * This function is a synchronous call.
4117 * @return TRUE - RFCOMM client is connected \n
4118 * FALSE - RFCOMM client is not connected \n
4124 gboolean bluetooth_rfcomm_is_client_connected(void);
4125 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4126 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4129 * @fn int bluetooth_network_activate_server(void)
4130 * @brief Activate the NAP (Network Access Point) service
4132 * This function is a asynchronous call.
4133 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4135 * @return BLUETOOTH_ERROR_NONE - Success \n
4136 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4137 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4138 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4141 * @see bluetooth_network_deactivate_server
4144 int bluetooth_network_activate_server(void);
4147 * @fn int bluetooth_network_deactivate_server(void)
4148 * @brief Deactivate the NAP (Network Access Point) service
4150 * This function is a asynchronous call.
4151 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4153 * @return BLUETOOTH_ERROR_NONE - Success \n
4154 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4155 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4156 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4159 * @see bluetooth_network_activate_server
4162 int bluetooth_network_deactivate_server(void);
4165 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4166 * bluetooth_network_role_t role,
4168 * @brief Connect the network server in the peer
4170 * This function is a asynchronous call.
4171 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
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_DEVICE_NOT_ENABLED - Not enabled \n
4179 * @param[in] device_address This indicates an address of the device with which the pairing
4180 * should be initiated
4181 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4182 * need to use the third parameter.
4183 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4184 * connect. UUID string
4186 * @see bluetooth_network_disconnect
4188 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4189 bluetooth_network_role_t role, char *custom_uuid);
4192 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4193 * bluetooth_network_role_t role,
4194 * char *custom_uuid)
4195 * @brief Connect the network server in the peer
4197 * This function is a asynchronous call.
4198 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4200 * @return BLUETOOTH_ERROR_NONE - Success \n
4201 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4202 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4203 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4206 * @param[in] device_address This indicates an address of the device with which the pairing
4207 * should be initiated
4209 * @see bluetooth_network_connect
4211 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4214 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4215 * @brief Disconnect the device from the network
4217 * This function is an asynchronous call.
4218 * The network server disconnect request is responded by
4219 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4221 * @return BLUETOOTH_ERROR_NONE - Success \n
4222 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4223 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4224 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4227 * @param[in] device_address This indicates an address of the connected client device
4229 * @see bluetooth_network_activate_server
4231 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4236 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4237 * bt_hdp_role_type_t role,
4238 * bt_hdp_qos_type_t channel_type,
4239 * char **app_handle)
4240 * @brief Activate the HDP service for a particular data type
4242 * This function is a synchronous call.
4244 * @return BLUETOOTH_ERROR_NONE - Success \n
4245 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4246 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4247 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4250 * @param[in] data_type The data type against corresponding service
4251 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4252 * @param[in] channel_type The QOS type for the channel.
4253 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4254 * For role = HDP_ROLE_SINK, the channel_type
4255 * should be HDP_QOS_ANY.
4256 * @param[out] app_handle The application handler against corresponding service
4258 * @see bluetooth_hdp_deactivate
4260 int bluetooth_hdp_activate(unsigned short data_type,
4261 bt_hdp_role_type_t role,
4262 bt_hdp_qos_type_t channel_type,
4265 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4266 * @brief Deactivate the HDP service for a particular service using the handler
4268 * This function is a synchronous call.
4270 * @return BLUETOOTH_ERROR_NONE - Success \n
4271 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4272 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4273 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4276 * @param[in] app_handle The application handler against corresponding service
4278 * @see bluetooth_hdp_deactivate
4280 int bluetooth_hdp_deactivate(const char *app_handle);
4283 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4284 * const char *buffer, unsigned int size)
4285 * @brief Send data to the remote HDP device
4287 * This function is a synchronous call.
4289 * @return BLUETOOTH_ERROR_NONE - Success \n
4290 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4291 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4292 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4293 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4296 * @param[in] channel_id The channel id for the connection.
4297 * @param[in] buffer The pdu buffer.
4298 * @param[in] size Size of the buffer.
4300 * @see bluetooth_hdp_connect
4302 int bluetooth_hdp_send_data(unsigned int channel_id,
4303 const char *buffer, unsigned int size);
4305 * @fn int bluetooth_hdp_connect(const char *app_handle,
4306 * bt_hdp_qos_type_t channel_type,
4307 * const bluetooth_device_address_t *device_address)
4308 * @brief Connect to the remote device(Mainly used by source)
4310 * This function is a asynchronous call.
4311 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4313 * @return BLUETOOTH_ERROR_NONE - Success \n
4314 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4315 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4316 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4317 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4320 * @param[in] app_handle The application handler against corresponding service
4321 * @param[in] channel_type The QOS type for the channel.
4322 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4323 * @param[in] device_address The remote device Bd address.
4326 * @see bluetooth_hdp_disconnect
4328 int bluetooth_hdp_connect(const char *app_handle,
4329 bt_hdp_qos_type_t channel_type,
4330 const bluetooth_device_address_t *device_address);
4332 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4333 * const bluetooth_device_address_t *device_address)
4334 * @brief Disconnect from the remote device(Mainly used by source)
4336 * This function is a asynchronous call.
4337 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4339 * @return BLUETOOTH_ERROR_NONE - Success \n
4340 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4341 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4342 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4343 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4346 * @param[in] channel_id The channel id for the connection.
4347 * @param[in] device_address The remote device Bd address.
4350 * @see bluetooth_hdp_connect
4352 int bluetooth_hdp_disconnect(unsigned int channel_id,
4353 const bluetooth_device_address_t *device_address);
4357 * @fn int bluetooth_opc_init(void)
4358 * @brief Initialize OPP client.
4360 * This function is a synchronous call.
4361 * No event corresponding to this api
4363 * @return BLUETOOTH_ERROR_NONE - Success \n
4364 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4365 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4366 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4367 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4372 * @see bluetooth_opc_deinit
4374 int bluetooth_opc_init(void);
4377 * @fn int bluetooth_opc_deinit(void)
4378 * @brief Deinitialize OPP client.
4380 * This function is a synchronous call.
4381 * No event corresponding to this api
4383 * @return BLUETOOTH_ERROR_NONE - Success \n
4384 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4385 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4390 * @see bluetooth_opc_init
4393 int bluetooth_opc_deinit(void);
4396 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4397 char **file_name_array)
4398 * @brief Send multiple files to a remote device.
4400 * This function is a asynchronous call.
4401 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4403 * @return BLUETOOTH_ERROR_NONE - Success \n
4404 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4405 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4406 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4407 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4408 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4409 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4412 * @param[in] device_address The remote device Bd address.
4413 * @param[in] file_name_array Array of filepaths to be sent.
4416 * @see bluetooth_opc_cancel_push
4419 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4420 char **file_name_array);
4423 * @fn int bluetooth_opc_cancel_push(void)
4424 * @brief Cancels the ongoing file push.
4426 * This function is a asynchronous call.
4427 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4428 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4430 * @return BLUETOOTH_ERROR_NONE - Success \n
4431 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4432 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4437 * @see bluetooth_opc_push_files
4440 int bluetooth_opc_cancel_push(void);
4443 * @fn gboolean bluetooth_opc_session_is_exist(void)
4444 * @brief Informs whether opc session exists or not.
4446 * This function is a synchronous call.
4448 * @return TRUE - OPC session exists \n
4449 * FALSE - OPC session does not exist \n
4457 gboolean bluetooth_opc_session_is_exist(void);
4460 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4461 * @brief Informs whether opc session exists or not.
4463 * This function is a synchronous call.
4465 * @return BLUETOOTH_ERROR_NONE - Success \n
4466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4467 * BLUETOOTH_ERROR_INTERNAL \n
4470 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4475 int bluetooth_opc_is_sending(gboolean *is_sending);
4478 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4479 int transfer_id, unsigned char *progress)
4480 * @brief Gets the percentage progress for ongoing transfers.
4482 * This function is a synchronous call.
4484 * @return BLUETOOTH_ERROR_NONE - Success \n
4485 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4486 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4489 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4490 * @param[in] transfer_id Transfer ID
4491 * @param[out] progress Percentage Progress
4495 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4496 int transfer_id, unsigned char *progress);
4499 * @fn int bluetooth_obex_server_init(const char *dst_path)
4500 * @brief Initialize OPP and FTP server.
4502 * This function is a synchronous call.
4503 * No event corresponding to this api
4505 * @return BLUETOOTH_ERROR_NONE - Success \n
4506 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4507 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4508 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4509 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4512 * @param[in] dst_path OPS destination file path.
4514 * @see bluetooth_obex_server_deinit
4516 int bluetooth_obex_server_init(const char *dst_path);
4520 * @fn int bluetooth_obex_server_deinit(void)
4521 * @brief Deinitialize OPP and FTP server.
4523 * This function is a synchronous call.
4524 * No event corresponding to this api
4526 * @return BLUETOOTH_ERROR_NONE - Success \n
4527 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4528 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4533 * @see bluetooth_obex_server_init
4535 int bluetooth_obex_server_deinit(void);
4539 * @fn gboolean bluetooth_obex_server_is_activated(void)
4540 * @brief Informs whether obex server is activated or not.
4542 * This function is a synchronous call.
4544 * @return TRUE - OBEX server is activated \n
4545 * FALSE - OBEX server is not activated \n
4552 gboolean bluetooth_obex_server_is_activated(void);
4556 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4557 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4559 * This function is a synchronous call.
4560 * No event corresponding to this api
4562 * @return BLUETOOTH_ERROR_NONE - Success \n
4563 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4564 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4565 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4566 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4570 * @param[in] dst_path OPS destination file path.
4572 * @see bluetooth_obex_server_deinit_without_agent
4574 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4578 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4579 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4581 * This function is a synchronous call.
4582 * No event corresponding to this api
4584 * @return BLUETOOTH_ERROR_NONE - Success \n
4585 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4586 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4591 * @see bluetooth_obex_server_init_without_agent
4593 int bluetooth_obex_server_deinit_without_agent(void);
4597 * @fn int bluetooth_obex_server_accept_connection(void)
4598 * @brief Accepts the authorization request indicated by the event
4599 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4601 * This function is a synchronous call.
4603 * @return BLUETOOTH_ERROR_NONE - Success \n
4604 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4605 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4609 * @see bluetooth_obex_server_reject_authorize
4611 int bluetooth_obex_server_accept_connection(void);
4615 * @fn int bluetooth_obex_server_reject_connection(void)
4616 * @brief Rejects the authorization request indicated by the event
4617 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4619 * This function is a synchronous call.
4621 * @return BLUETOOTH_ERROR_NONE - Success \n
4622 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4623 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4627 * @see bluetooth_obex_server_reject_authorize
4629 int bluetooth_obex_server_reject_connection(void);
4633 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4634 * @brief Accepts the authorization request indicated by the event
4635 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4637 * This function is a asynchronous call.
4638 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4640 * @return BLUETOOTH_ERROR_NONE - Success \n
4641 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4642 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4643 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4646 * @param[in] filename Authorized filename.
4649 * @see bluetooth_obex_server_reject_authorize
4652 int bluetooth_obex_server_accept_authorize(const char *filename);
4655 * @fn int bluetooth_obex_server_reject_authorize(void)
4656 * @brief Reject the authorization request indicated by the event
4657 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4659 * This function is a asynchronous call.
4660 * No event for this api..
4662 * @return BLUETOOTH_ERROR_NONE - Success \n
4663 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4664 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4669 * @see bluetooth_obex_server_accept_authorize
4672 int bluetooth_obex_server_reject_authorize(void);
4675 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4676 * @brief Set the OPS destination file path..
4678 * This function is a asynchronous call.
4679 * No event for this api..
4681 * @return BLUETOOTH_ERROR_NONE - Success \n
4682 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4683 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4684 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4687 * @param[in] dst_path OPS destination file path.
4693 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4696 * @fn int bluetooth_obex_server_set_root(const char *root)
4697 * @brief Set the FTS root folder..
4699 * This function is a asynchronous call.
4700 * No event for this api..
4702 * @return BLUETOOTH_ERROR_NONE - Success \n
4703 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4704 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4705 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4706 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4707 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4710 * @param[in] root FTS root folder.
4716 int bluetooth_obex_server_set_root(const char *root);
4719 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4720 * @brief Cancel the transfer on server
4722 * This function is an asynchronous call.
4723 * If the function call that cancels transfer is successful, the application would receive
4724 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4725 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4726 * the error code will be BLUETOOTH_ERROR_NONE
4728 * @return BLUETOOTH_ERROR_NONE - Success \n
4729 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4730 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4731 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4732 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4735 * @param[in] transfer_id transfer ID
4740 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4744 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4745 * @brief Cancel the transfer on server
4747 * This function is an asynchronous call.
4748 * If the function call that cancels transfer is successful, the application would receive
4749 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4750 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4751 * the error code will be BLUETOOTH_ERROR_NONE
4753 * @return BLUETOOTH_ERROR_NONE - Success \n
4754 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4755 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4756 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4757 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4764 int bluetooth_obex_server_cancel_all_transfers(void);
4768 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4769 * @brief Informs whether obex server is receiving or not.
4771 * This function is a synchronous call.
4773 * @return BLUETOOTH_ERROR_NONE - Success \n
4774 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4775 * BLUETOOTH_ERROR_INTERNAL \n
4778 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4783 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4787 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4788 * @brief Read the local Hash and Randmizer.
4790 * This function is a synchronous call.
4792 * @return BLUETOOTH_ERROR_NONE - Success \n
4793 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4797 * @param[out] local_oob_data - Pointer to the local OOB data
4803 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4807 * @fn int bluetooth_oob_add_remote_data(
4808 * const bluetooth_device_address_t *remote_device_address,
4809 * bt_oob_data_t *oob_data)
4810 * @brief Add/updated the remote device Hash and Randmizer.
4812 * This function is a synchronous call.
4813 * No event for this api..
4815 * @return BLUETOOTH_ERROR_NONE - Success \n
4816 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4819 * @param[in] remote_device_address - Remote device address
4820 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4826 int bluetooth_oob_add_remote_data(
4827 const bluetooth_device_address_t *remote_device_address,
4828 bt_oob_data_t *remote_oob_data);
4832 * @fn int bluetooth_oob_remove_remote_data(
4833 * const bluetooth_device_address_t *remote_device_address)
4834 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4836 * This function is a synchronous call.
4837 * No event for this api..
4839 * @return BLUETOOTH_ERROR_NONE - Success \n
4840 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4843 * @param[in] remote_device_address - Remote device address
4849 int bluetooth_oob_remove_remote_data(
4850 const bluetooth_device_address_t *remote_device_address);
4853 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4854 * bt_gatt_handle_info_t *prim_svc);
4856 * @brief Gets the GATT based primary services handle supported by remote device
4858 * This function is a synchronous call.
4859 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4861 * @return BLUETOOTH_ERROR_NONE - Success \n
4862 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4863 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4864 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4867 * @param[in] address - Remote device address
4868 * @param[out] prim_svc - Structure containing remote service count and handle list.
4871 * @see bluetooth_gatt_free_primary_services()
4873 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4874 bt_gatt_handle_info_t *prim_svc);
4877 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4879 * @brief Discovers the characteristics of GATT based service of remote device
4881 * This function is an asynchronous call.
4882 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4884 * @return BLUETOOTH_ERROR_NONE - Success \n
4885 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4886 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4887 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4890 * @param[in] service_handle - Handle for remote service.
4895 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4897 int bluetooth_gatt_set_service_change_watcher(
4898 const bluetooth_device_address_t *address, gboolean enable);
4901 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4902 * bt_gatt_service_property_t *service);
4904 * @brief Gets the properties of GATT based service of remote device
4906 * This function is a synchronous call.
4907 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4909 * @return BLUETOOTH_ERROR_NONE - Success \n
4910 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4911 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4912 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4915 * @param[in] service_handle - Handle for remote service.
4916 * @param[out] service - Structure containing remote service property.
4919 * @see bluetooth_gatt_free_service_property()
4921 int bluetooth_gatt_get_service_property(const char *service_handle,
4922 bt_gatt_service_property_t *service);
4925 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4927 * @brief Register to GATT based service to receive value change notification/indication.
4929 * This function is a synchronous call.
4930 * No event for this api.
4932 * @return BLUETOOTH_ERROR_NONE - Success \n
4933 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4934 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4935 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4938 * @param[in] service_handle - Handle for remote service.
4943 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4946 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4948 * @brief Unregister GATT based service to receive value change notification/indication.
4950 * This function is a synchronous call.
4951 * No event for this api.
4953 * @return BLUETOOTH_ERROR_NONE - Success \n
4954 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4955 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4956 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4959 * @param[in] service_handle - Handle for remote service.
4964 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4967 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4968 * bt_gatt_char_property_t *characteristic);
4970 * @brief Provides characteristic value along with properties.
4972 * This function is a synchronous call.
4973 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4975 * @return BLUETOOTH_ERROR_NONE - Success \n
4976 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4977 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4978 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4981 * @param[in] char_handle - Handle for Characteristic property.
4982 * @param[out] characteristic - Structure containing remote characteristic property.
4985 * @see bluetooth_gatt_free_char_property()
4987 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4988 bt_gatt_char_property_t *characteristic);
4991 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4992 * bt_gatt_char_property_t *characteristic);
4994 * @brief Provides characteristic descriptor value along with its UUID.
4996 * This function is a synchronous call.
4997 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4999 * @return BLUETOOTH_ERROR_NONE - Success \n
5000 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5001 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5002 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5005 * @param[in] desc_handle - Handle for Characteristic descriptor.
5006 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5009 * @see bluetooth_gatt_free_desc_property()
5011 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5012 bt_gatt_char_descriptor_property_t *descriptor);
5016 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5017 * const guint8 *value, int length)
5019 * @brief Set characteristic value.
5021 * This function is a synchronous call.
5023 * @return BLUETOOTH_ERROR_NONE - Success \n
5024 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5025 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5026 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5029 * @param[in] char_handle - Handle for Characteristic property.
5030 * @param[in] value - New value to set for characteristic property.
5031 * @param[in] length - Length of the value to be set.
5036 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5037 const guint8 *value, int length);
5040 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5041 * const guint8 *value, int length, guint8 write_type)
5043 * @brief Set characteristic value by write type.
5045 * This function is a synchronous call if write type is "write without resonse"
5046 * and it is an asynchronous call if write type is "write with response"
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] char_handle - Handle for Characteristic property.
5055 * @param[in] value - New value to set for characteristic property.
5056 * @param[in] length - Length of the value to be set.
5057 * @param[in] write_type - Type of write.
5062 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5063 const guint8 *value, int length, guint8 write_type);
5067 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5068 * const guint8 *value, int length)
5070 * @brief Set characteristic value request.
5072 * This function is an asynchronous call.
5074 * @return BLUETOOTH_ERROR_NONE - Success \n
5075 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5076 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5077 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5080 * @param[in] char_handle - Handle for Characteristic property.
5081 * @param[in] value - New value to set for characteristic property.
5082 * @param[in] length - Length of the value to be set.
5087 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5088 const guint8 *value, int length);
5091 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5093 * @brief Read characteristic value.
5095 * This function is a asynchronous call.
5097 * @return BLUETOOTH_ERROR_NONE - Success \n
5098 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5099 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5100 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5103 * @param[in] char_handle - Handle for Characteristic property.
5108 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5111 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5112 * const char *service_uuid,
5113 * bt_gatt_service_property_t *service)
5115 * @brief Gets the service property from a device based on a particular uuid
5117 * This function is a synchronous call.
5119 * @return BLUETOOTH_ERROR_NONE - Success \n
5120 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5121 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5122 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5125 * @param[in] address - BD address of the remote device
5126 * @param[in] service_uuid - uuid of the service.
5127 * @param[out] service - Structure containing the service property.
5132 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5133 const char *service_uuid,
5134 bt_gatt_service_property_t *service);
5137 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5138 * const char *char_uuid)
5140 * @brief Gets the characteristic property from a service based on a particular char uuid
5142 * This function is an asynchronous call.
5143 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5145 * @return BLUETOOTH_ERROR_NONE - Success \n
5146 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5147 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5148 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5151 * @param[in] service_handle - Service handle.
5152 * @param[in] uuid - Characteristic uuid.
5157 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5158 const char *char_uuid);
5161 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5163 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5165 * This function is a synchronous call.
5166 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5168 * @return BLUETOOTH_ERROR_NONE - Success \n
5169 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5172 * @param[in] prim_svc - GATT handle info structure
5175 * @see bluetooth_gatt_get_primary_services()
5177 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5180 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5182 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5184 * This function is a synchronous call.
5185 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5187 * @return BLUETOOTH_ERROR_NONE - Success \n
5188 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5191 * @param[in] svc_pty - GATT service property structure.
5194 * @see bluetooth_gatt_get_service_property()
5196 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5199 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5201 * @brief Provides characteristic value along with properties.
5203 * This function is a synchronous call.
5204 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5206 * @return BLUETOOTH_ERROR_NONE - Success \n
5207 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5210 * @param[in] char_pty - GATT characteristics property structure.
5213 * @see bluetooth_gatt_get_characteristics_property()
5215 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5218 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5220 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5222 * This function is a synchronous call.
5223 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5225 * @return BLUETOOTH_ERROR_NONE - Success \n
5226 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5229 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5232 * @see bluetooth_gatt_get_char_descriptor_property()
5234 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5236 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5238 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5241 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5243 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5245 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5247 * @return BLUETOOTH_ERROR_NONE - Success \n
5248 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5251 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5255 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5258 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5260 * @brief Read characteristic descriptor value.
5262 * This function is a asynchronous call.
5264 * @return BLUETOOTH_ERROR_NONE - Success \n
5265 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5266 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5267 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5270 * @param[in] desc_handle - Handle for Characteristic descriptor
5275 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5278 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5279 * const guint8 *value, int length);
5281 * @brief Set characteristic descriptor value.
5283 * This function is a asynchronous call.
5285 * @return BLUETOOTH_ERROR_NONE - Success \n
5286 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5287 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5288 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5291 * @param[in] desc_handle - Handle for Characteristic descriptor
5292 * @param[in] value - New value to set for characteristic descriptor
5293 * @param[in] length - Length of the value to be set.
5298 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5299 const guint8 *value, int length);
5301 /* @fn int bluetooth_gatt_init(void)
5303 * @brief Initializes the gatt service.
5305 * This function is a synchronous call.
5306 * @return BLUETOOTH_ERROR_NONE - Success \n
5307 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5308 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5309 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5312 * @remark Adapter should be enabled
5313 * @see bluetooth_gatt_deinit()
5315 int bluetooth_gatt_init(void);
5317 /* @fn int bluetooth_gatt_init(void)
5319 * @brief DeInitializes the gatt service.
5321 * This function is a synchronous call.
5322 * @return BLUETOOTH_ERROR_NONE - Success \n
5323 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5324 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5325 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5328 * @remark Adapter should be enabled
5329 * @see bluetooth_gatt_init()
5331 int bluetooth_gatt_deinit(void);
5333 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5334 unsigned char **svc_path)
5336 * @brief Exports a new gatt service to the service interface.
5338 * This function is a synchronous call.
5340 * @return BLUETOOTH_ERROR_NONE - Success \n
5341 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5342 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5343 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5346 * @param[in] svc_uuid Gatt service uuid.
5347 * @param[out] svc_path service object path of the exported service.
5348 * @remark Adapter should be enabled
5349 * @see bluetooth_gatt_init()
5351 int bluetooth_gatt_add_service(const char *svc_uuid,
5354 /* @fn int bluetooth_gatt_add_new_characteristic(
5355 const char *svc_path, const char *char_uuid,
5356 bt_gatt_permission_t permissions,
5357 bt_gatt_characteristic_property_t properties,
5358 int flags_length, char **char_path);;
5360 * @brief Exports a new gatt characteristic to the characteristic interface.
5362 * This function is a synchronous call.
5363 * @return BLUETOOTH_ERROR_NONE - Success \n
5364 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5365 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5366 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5368 * @param[in] svc_path service object path of the exported service.
5369 * @param[in] char_uuid Gatt service uuid.
5370 * @param[in] properties GATT characteristic properties.
5371 * @param[out] char_path characteristic object path of the exported characteristic.
5373 * @remark Adapter should be enabled
5374 * @see bluetooth_gatt_add_service()
5376 int bluetooth_gatt_add_new_characteristic(
5377 const char *svc_path, const char *char_uuid,
5378 bt_gatt_permission_t permissions,
5379 bt_gatt_characteristic_property_t properties,
5382 /* @fn bluetooth_gatt_set_characteristic_value(
5383 const char *characteristic, const char *char_value,
5386 * @brief adds gatt charactertisic value to the given charactertistic path.
5388 * This function is a synchronous call.
5389 * @return BLUETOOTH_ERROR_NONE - Success \n
5390 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5391 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5392 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5394 * @param[in] char_value Value of the GATT characteristic to be added.
5395 * @param[in] value_length length of the chantacteristic value..
5396 * @param[out] characteristic characteristic object path..
5398 * @remark Adapter should be enabled
5399 * @see bluetooth_gatt_add_service()
5401 int bluetooth_gatt_set_characteristic_value(
5402 const char *characteristic, const char *char_value,
5405 /* @fn int bluetooth_gatt_add_descriptor(
5406 const char *char_path, const char *desc_uuid,
5407 bt_gatt_permission_t permissions,
5410 * @brief Exports a new gatt descriptor to the descriptor interface.
5412 * This function is a synchronous call.
5414 * @return BLUETOOTH_ERROR_NONE - Success \n
5415 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5416 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5417 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5420 * @param[in] desc_uuid Gatt descriptor uuid.
5421 * @param[in] desc_value GATT descriptor value.
5422 * @param[in] value_length Length of GATT descriptor value.
5423 * @param[in] permissions descriptor permissions.
5424 * @param[in] properties GATT descriptor properties.
5425 * @param[in] char_path characteristics object path of the exported character.
5427 * @remark Adapter should be enabled
5428 * @see bluetooth_gatt_add_service()
5429 * @see bluetooth_gatt_add_characteristics()
5431 int bluetooth_gatt_add_descriptor(
5432 const char *char_path, const char *desc_uuid,
5433 bt_gatt_permission_t permissions,
5436 /* @fn int bluetooth_gatt_set_descriptor_value(
5437 const char *desc_path, const char *desc_value,
5440 * @brief Adds value to the given descriptor handle.
5442 * This function is a synchronous call.
5444 * @return BLUETOOTH_ERROR_NONE - Success \n
5445 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5446 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5447 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5450 * @param[in] desc_value GATT descriptor value.
5451 * @param[in] value_length Length of GATT descriptor value.
5452 * @param[in] desc_path descriptor path to which the value needs to be added.
5454 * @remark Adapter should be enabled
5455 * @see bluetooth_gatt_add_service()
5456 * @see bluetooth_gatt_add_characteristics()
5458 int bluetooth_gatt_set_descriptor_value(
5459 const char *desc_path, const char *desc_value,
5462 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5464 * @brief Reads the Service registered on manager interface.
5466 * This function is a synchronous call.
5468 * @return BLUETOOTH_ERROR_NONE - Success \n
5469 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5470 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5471 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5474 * @param[in] svc_uuid Gatt Service uuid.
5476 * @remark Adapter should be enabled and service should be registered.
5477 * @see bluetooth_gatt_register_service()
5479 int bluetooth_gatt_get_service(const char *svc_uuid);
5481 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5483 * @brief Registers the given service path with the library.
5485 * This function is a synchronous call.
5487 * @return BLUETOOTH_ERROR_NONE - Success \n
5488 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5489 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5490 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5493 * @param[in] svc_path service object path of the exported service.
5495 * @remark Adapter should be enabled
5496 * @see bluetooth_gatt_add_service()
5497 * @see bluetooth_gatt_add_characteristics()
5498 * @see bluetooth_gatt_add_descriptor()
5499 * @see bluetooth_gatt_register_application()
5501 int bluetooth_gatt_register_service(const char *svc_path);
5503 /* @fn int bluetooth_gatt_register_application(void)
5505 * @brief Registers the application with the bluez gatt server.
5507 * This function is a synchronous call.
5509 * @return BLUETOOTH_ERROR_NONE - Success \n
5510 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5511 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5512 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5516 * @remark Adapter should be enabled
5517 * @see bluetooth_gatt_init()
5518 * @see bluetooth_gatt_add_service()
5519 * @see bluetooth_gatt_add_characteristics()
5520 * @see bluetooth_gatt_add_descriptor()
5521 * @see bluetooth_gatt_register_service()
5523 int bluetooth_gatt_register_application(void);
5525 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5527 * @brief Removes(unregister) service from the bluez gatt server db.
5529 * This function is a synchronous call.
5531 * @return BLUETOOTH_ERROR_NONE - Success \n
5532 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5533 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5534 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5537 * @param[in] svc_path service object path of the exported service.
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()
5545 int bluetooth_gatt_unregister_service(const char *svc_path);
5547 /* @fn int bluetooth_gatt_unregister_application(void)
5549 * @brief Removes(unregister) the application with the bluez gatt server,
5550 * and deletes all the service registered.
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_init()
5563 * @see bluetooth_gatt_add_service()
5564 * @see bluetooth_gatt_add_characteristics()
5565 * @see bluetooth_gatt_add_descriptor()
5566 * @see bluetooth_gatt_register_service()
5567 * @see bluetooth_gatt_unregister_service()
5569 int bluetooth_gatt_unregister_application(void);
5571 /* @fn int bluetooth_gatt_send_response(int request_id,
5572 * int offset, char *value, int value_length)
5574 * @brief Updates the attribute value in local attribute list.
5576 * This function is a synchronous call.
5578 * @return BLUETOOTH_ERROR_NONE - Success \n
5579 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5580 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5581 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5584 * @param[in] request_id The identification of a read request
5585 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5586 * @param[in] resp_state The identification of response state
5587 * @param[in] offset The offset from where a value is read
5588 * @param[in] value The value to be sent. It will be sent from @a offset.
5589 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5590 * @param[in] value_length Value Length.
5592 * @remark Adapter should be enabled
5593 * @see bluetooth_gatt_add_service()
5594 * @see bluetooth_gatt_add_characteristics()
5595 * @see bluetooth_gatt_add_descriptor()
5596 * @see bluetooth_gatt_register_service()
5598 int bluetooth_gatt_send_response(int request_id, guint req_type,
5599 int resp_state, int offset, char *value, int value_length);
5601 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5603 * @brief Sets the notification property for a characteristic.
5605 * This function is a synchronous call.
5607 * @return BLUETOOTH_ERROR_NONE - Success \n
5608 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5609 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5610 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5613 * @param[in] char_path characteristic object path.
5614 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5616 * @remark Adapter should be enabled
5617 * @see bluetooth_gatt_update_characteristic()
5619 int bluetooth_gatt_server_set_notification(const char *char_path,
5620 bluetooth_device_address_t *unicast_address);
5622 /* @fn int bluetooth_gatt_delete_services(void)
5624 * @brief deletes (unregisters) all services from the gatt server database..
5626 * This function is a synchronous call.
5628 * @return BLUETOOTH_ERROR_NONE - Success \n
5629 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5630 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5631 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5635 * @remark Adapter should be enabled
5636 * @see bluetooth_gatt_add_service()
5637 * @see bluetooth_gatt_add_characteristics()
5638 * @see bluetooth_gatt_add_descriptor()
5639 * @see bluetooth_gatt_register_service()
5640 * @see bluetooth_gatt_unregister_service()
5642 int bluetooth_gatt_delete_services(void);
5644 /* @fn int bluetooth_gatt_update_characteristic(void)
5646 * @brief updates the given characteristic with a new value
5648 * This function is a synchronous call.
5650 * @return BLUETOOTH_ERROR_NONE - Success \n
5651 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5652 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5653 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5657 * @remark Adapter should be enabled
5658 * @see bluetooth_gatt_add_service()
5659 * @see bluetooth_gatt_add_characteristics()
5660 * @see bluetooth_gatt_add_descriptor()
5661 * @see bluetooth_gatt_register_service()
5662 * @see bluetooth_gatt_unregister_service()
5664 int bluetooth_gatt_update_characteristic(const char *char_path,
5665 const char* char_value, int value_length);
5668 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5670 * @brief Set advertising status.
5672 * This function is used to enable or disable LE advertising.
5673 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5675 * This function is a synchronous call.
5677 * @return BLUETOOTH_ERROR_NONE - Success \n
5678 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5679 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5682 * @param[in] enable - The status of advertising
5685 * @see bluetooth_set_advertising_data
5687 int bluetooth_set_advertising(int handle, gboolean enable);
5690 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5692 * @brief Set advertising status along with interval value.
5694 * This function is used to enable or disable LE advertising.
5695 * Interval_min and Interval_max is used to set the best advertising interval.
5696 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5698 * This function is a synchronous call.
5700 * @return BLUETOOTH_ERROR_NONE - Success \n
5701 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5702 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5705 * @param[in] enable - The status of advertising
5706 * @param[in] interval_min - Minimum interval of advertising (msec)
5707 * @param[in] interval_max - Maximum interval of advertising (msec)
5708 * @param[in] filter_policy - Advertising filter policy
5711 * @see bluetooth_set_advertising_data
5713 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5714 bluetooth_advertising_params_t *params);
5717 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5718 * @brief Get the advertising data
5720 * This function is used to get advertising data.
5721 * Before calling this API, the adapter should be enabled.
5723 * This function is a synchronous call.
5725 * @return BLUETOOTH_ERROR_NONE - Success \n
5726 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5727 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5728 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5730 * @param[out] value - Advertising data structure.
5731 * @param[out] length - The length of Advertising data.
5735 bluetooth_advertising_data_t *value = { {0} };
5738 ret = bluetooth_get_advertising_data(&value, &length);
5741 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5744 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5746 * @brief Set advertising data with value
5748 * This function is used to set advertising data and Maximum size of advertising data
5749 * is 28 byte (Except Flag)
5751 * This function is a synchronous call.
5753 * @return BLUETOOTH_ERROR_NONE - Success \n
5754 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5755 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5758 * @param[in] value - Advertising data structure.
5762 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5765 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5767 * @brief Check the privilege for advertising parameter setting
5769 * This function is a synchronous call.
5771 * @return BLUETOOTH_ERROR_NONE - Success \n
5772 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5778 int bluetooth_check_privilege_advertising_parameter(void);
5781 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5782 * @brief Get the LE scan response data
5784 * This function is used to get scan response data.
5785 * Before calling this API, the adapter should be enabled.
5787 * This function is a synchronous call.
5789 * @return BLUETOOTH_ERROR_NONE - Success \n
5790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5791 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5792 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5794 * @param[out] value - Scan response data structure.
5795 * @param[out] length - The length of Scan response data.
5799 bluetooth_scan_resp_data_t *value = { {0} };
5802 ret = bluetooth_get_scan_response_data(&value, &length);
5805 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5808 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5810 * @brief Set scan response data with value
5812 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5814 * This function is a synchronous call.
5816 * @return BLUETOOTH_ERROR_NONE - Success \n
5817 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5818 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5821 * @param[in] value - LE Scan response data structure.
5825 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5828 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5830 * @brief Set scan interval and window
5832 * This function is used to set LE scan interval and window size
5834 * This function is a synchronous call.
5836 * @return BLUETOOTH_ERROR_NONE - Success \n
5837 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5838 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5841 * @param[in] interval - Interval of LE scan (msec)
5842 * @param[in] window - Window size of LE scan (msec)
5846 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5849 * @fn int bluetooth_is_advertising(void)
5850 * @brief Check for the advertising is in-progress or not.
5852 * This API is used to check the current status of the advertising procedure.
5853 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5856 * This function checks whether the advertising is started or not.
5858 * This function is a synchronous call.
5860 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5862 * @return BLUETOOTH_ERROR_NONE - Success \n
5863 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5866 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5870 gboolean is_advertising = 0;
5872 ret = bluetooth_is_advertising(&is_advertising);
5875 int bluetooth_is_advertising(gboolean *is_advertising);
5878 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5879 * @brief Add LE device to white list
5881 * This API is used to add LE device to white list
5882 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5886 * This function is a synchronous call.
5888 * @param[in] address The address of remote device
5890 * @return BLUETOOTH_ERROR_NONE - Success \n
5891 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5894 * @see bluetooth_set_custom_advertising
5896 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5899 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5900 * @brief Remove LE device from white list
5902 * This API is used to remove LE device from white list
5903 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5907 * This function is a synchronous call.
5909 * @param[in] address The address of remote device
5911 * @return BLUETOOTH_ERROR_NONE - Success \n
5912 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5915 * @see bluetooth_set_custom_advertising
5917 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5920 * @fn int bluetooth_clear_white_list(void)
5921 * @brief Clear white list
5923 * This API is used to clear white list
5924 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5928 * This function is a synchronous call.
5930 * @param[in] address The address of remote device
5932 * @return BLUETOOTH_ERROR_NONE - Success \n
5933 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5936 * @see bluetooth_set_custom_advertising
5938 int bluetooth_clear_white_list(void);
5941 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5942 * const bluetooth_le_connection_param_t *parameters)
5943 * @brief update connection paramter of LE connection.
5945 * This function is a synchronous call.
5947 * @return BLUETOOTH_ERROR_NONE - Success \n
5948 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5951 * @param[in] address - remote device address value.
5952 * @param[in] parameters - new connection parameters.
5955 * @see bluetooth_bond_device
5957 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5958 const bluetooth_le_connection_param_t *parameters);
5961 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5963 * @brief Enable/Disable LE Privacy feature.
5965 * This function is used to enable or disable LE Privacy feature.
5966 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5968 * This function is a synchronous call.
5970 * @return BLUETOOTH_ERROR_NONE - Success \n
5971 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5972 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5975 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5979 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5982 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
5984 * @brief Enable/Disable LE static random address.
5986 * This function is used to enable or disable LE static random address.
5988 * This function is a synchronous call.
5990 * @return BLUETOOTH_ERROR_NONE - Success \n
5991 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5992 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5995 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
5999 int bluetooth_set_le_static_random_address(gboolean enable);
6002 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6003 * bluetooth_le_connection_mode_t mode)
6004 * @brief update connection paramter of LE connection.
6006 * This function is a synchronous call.
6008 * @return BLUETOOTH_ERROR_NONE - Success \n
6009 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6010 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6013 * @param[in] address - remote device address value.
6014 * @param[in] mode - new connection mode.
6018 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6019 bluetooth_le_connection_mode_t mode);
6022 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6023 * @brief Request for new ATT MTU value.
6025 * This function is a asynchronous call.
6027 * @return BLUETOOTH_ERROR_NONE - Success \n
6028 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6029 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6032 * @param[in] address - remote device address value.
6033 * @param[in] mtu - MTU value to be set.
6037 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6040 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6041 * unsigned int *mtu)
6042 * @brief Gets the xisting MTU value set for a connection.
6044 * This function is a synchronous call.
6046 * @return BLUETOOTH_ERROR_NONE - Success \n
6047 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6048 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6051 * @param[in] address - remote device address value.
6052 * @param[out] mtu - MTU value set for the connection.
6056 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6060 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6061 * bluetooth_device_address_t *id_address)
6062 * @brief Gets the Identity address of remote device.
6064 * This function is a synchronous call.
6066 * @return BLUETOOTH_ERROR_NONE - Success \n
6067 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6068 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6071 * @param[in] device_rpa - remote Resolvable private address.
6072 * @param[out] id_address - remote Identity device address value.
6076 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6077 bluetooth_device_address_t *id_address);
6080 * @fn int bluetooth_le_read_maximum_data_length()
6081 * @brief reads the maximum LE data length supported in the controller.
6083 * This function is a synchronous call.
6085 * @return BLUETOOTH_ERROR_NONE - Success \n
6086 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6092 int bluetooth_le_read_maximum_data_length(
6093 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6095 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6096 * @brief writes the host suggested values for the controllers max transmitted no of payload
6097 * octects to be used for new connections.
6099 * This function is a synchronous call.
6101 * @return BLUETOOTH_ERROR_NONE - Success \n
6102 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6108 int bluetooth_le_write_host_suggested_default_data_length(
6109 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6111 int bluetooth_le_read_suggested_default_data_length(
6112 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6114 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6115 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6117 int bluetooth_pbap_init(void);
6118 int bluetooth_pbap_deinit(void);
6119 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6120 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6121 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6122 bt_pbap_folder_t *folder);
6123 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6124 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6125 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6126 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6127 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6128 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6129 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6130 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6133 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6135 * @brief Set manufacturer data with value
6137 * This function is used to set manufacturer data.
6139 * This function is a synchronous call.
6141 * @return BLUETOOTH_ERROR_NONE - Success \n
6142 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6143 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6146 * @param[in] value - Manufacturer data structure.
6150 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6152 int bluetooth_set_passkey_notification(gboolean enable);
6154 #ifdef TIZEN_DPM_VCONF_ENABLE
6156 * @fn int bluetooth_dpm_is_mode_allowed(void);
6158 * @brief Checks Restriction for BT mode(BT allowed or not)
6160 * This function is a synchronous call.
6162 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6163 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6164 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6171 int bluetooth_dpm_is_mode_allowed(void);
6175 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6177 * @brief Sets Restriction for BT mode(BT allowed or not)
6179 * This function is a synchronous call.
6181 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6182 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6183 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6186 * @param[in] value - BT Allow value.
6187 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6188 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6189 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6190 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6194 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6197 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6199 * @brief Reads the Restriction for BT mode(BT allowed or not)
6201 * This function is a synchronous call.
6203 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6204 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6205 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6209 * @param[out] value - BT Allow value.
6210 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6211 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6212 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6213 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6217 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6220 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6222 * @brief Sets the Restriction for device.
6224 * This function is a synchronous call.
6226 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6227 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6228 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6231 * @param[in] value - State value.
6232 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6233 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6237 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6240 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6242 * @brief Reads the Restriction for device.
6244 * This function is a synchronous call.
6246 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6247 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6248 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6252 * @param[out] value - State value.
6253 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6254 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6258 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6261 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6263 * @brief Sets the Restriction for uuid.
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] value - State value.
6273 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6274 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6278 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6281 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6283 * @brief Reads the Restriction for uuid.
6285 * This function is a synchronous call.
6287 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6288 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6289 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6293 * @param[out] value - State value.
6294 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6295 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6299 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6302 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6304 * @brief Adds the device to blacklist.
6306 * This function is a synchronous call.
6308 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6309 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6310 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6313 * @param[in] device_address - Device address
6317 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6320 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6322 * @brief Adds the device to whitelist.
6324 * This function is a synchronous call.
6326 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6327 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6328 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6331 * @param[in] device_address - Device address
6335 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6338 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6340 * @brief Adds the Service UUIDS to blacklist.
6342 * This function is a synchronous call.
6344 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6345 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6346 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6349 * @param[in] service_uuids - profile or custom service uuids
6353 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6356 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6358 * @brief Adds the Service UUIDS to whitelist.
6360 * This function is a synchronous call.
6362 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6363 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6364 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6367 * @param[in] service_uuids - profile or custom service uuids
6371 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6374 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6376 * @brief Clears the devices from blacklist.
6378 * This function is a synchronous call.
6380 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6381 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6382 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6389 int bluetooth_dpm_clear_devices_from_blacklist(void);
6392 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6394 * @brief Clears the devices from whitelist.
6396 * This function is a synchronous call.
6398 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6399 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6400 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6407 int bluetooth_dpm_clear_devices_from_whitelist(void);
6410 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6412 * @brief Clears the uuids from blacklist.
6414 * This function is a synchronous call.
6416 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6417 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6418 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6425 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6428 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6430 * @brief Clears the uuids from whitelist.
6432 * This function is a synchronous call.
6434 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6435 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6436 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6443 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6446 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6448 * @brief reads the devices from blacklist.
6450 * This function is a synchronous call.
6452 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6453 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6454 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6457 * @param[out] device_list - list of devices
6461 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6464 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6466 * @brief reads the devices from whitelist.
6468 * This function is a synchronous call.
6470 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6471 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6472 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6475 * @param[out] device_list - list of devices
6479 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6482 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6484 * @brief reads the uuids from blacklist.
6486 * This function is a synchronous call.
6488 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6489 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6490 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6493 * @param[in] uuid_list - list of uuids
6497 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6500 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6502 * @brief reads the uuids from whitelist.
6504 * This function is a synchronous call.
6506 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6507 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6508 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6511 * @param[in] uuid_list - list of uuids
6515 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6518 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6520 * @brief Removes the device from whitelist.
6522 * This function is a synchronous call.
6524 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6525 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6526 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6529 * @param[in] device_address - Device address
6533 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6536 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6538 * @brief Removes the device from blacklist.
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] device_address - Device address
6551 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6554 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6556 * @brief Removes the Service UUIDS from whitelist.
6558 * This function is a synchronous call.
6560 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6561 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6562 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6565 * @param[in] service_uuids - profile or custom service uuids
6569 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6572 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6574 * @brief Removes the Service UUIDS from blacklist.
6576 * This function is a synchronous call.
6578 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6579 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6580 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6583 * @param[in] service_uuids - profile or custom service uuids
6587 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6590 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6592 * @brief Sets the Restriction for outgoing call.
6594 * This function is a synchronous call.
6596 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6597 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6598 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6601 * @param[in] value - State value.
6602 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6603 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6607 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6610 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6612 * @brief Reads the Restriction for outgoing call.
6614 * This function is a synchronous call.
6616 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6617 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6618 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6622 * @param[out] value - State value.
6623 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6624 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6628 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6631 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6633 * @brief Sets the Restriction for Pairing.
6635 * This function is a synchronous call.
6637 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6638 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6639 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6642 * @param[in] value - State value.
6643 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6644 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6648 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6651 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6653 * @brief Reads the Restriction for Pairing
6655 * This function is a synchronous call.
6657 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6658 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6659 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6663 * @param[out] value - State value.
6664 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6665 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6669 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6672 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6674 * @brief Sets the Restriction for using Profiles.
6676 * This function is a synchronous call.
6678 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6679 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6680 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6683 * @param[in]profile - Profile.
6684 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6685 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6686 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6687 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6688 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6689 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6690 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6691 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6692 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6693 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6694 * BLUETOOTH_DPM_PROFILE_NONE
6695 * @param[in] value - State value.
6696 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6697 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6701 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6704 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6706 * @brief Reads the Restriction for using Profiles.
6708 * This function is a synchronous call.
6710 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6711 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6712 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6715 * @param[in]profile - Profile.
6716 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6717 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6718 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6719 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6720 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6721 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6722 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6723 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6724 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6725 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6726 * BLUETOOTH_DPM_PROFILE_NONE
6727 * @param[out] value - State value.
6728 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6729 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6733 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6736 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6738 * @brief Sets the Restriction for Desktop Connectivity.
6740 * This function is a synchronous call.
6742 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6743 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6744 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6747 * @param[in] value - State value.
6748 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6749 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6753 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6756 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6758 * @brief Reads the Restriction for Desktop Connectivity.
6760 * This function is a synchronous call.
6762 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6763 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6764 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6768 * @param[out] value - State value.
6769 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6770 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6774 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6777 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6779 * @brief Sets the Restriction for Discoverable state.
6781 * This function is a synchronous call.
6783 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6784 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6785 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6788 * @param[in] value - State value.
6789 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6790 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6794 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6797 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6799 * @brief Reads the Restriction for Discoverable state.
6801 * This function is a synchronous call.
6803 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6804 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6805 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6809 * @param[out] value - State value.
6810 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6811 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6815 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6818 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6820 * @brief Sets the Restriction for linited discoverable state..
6822 * This function is a synchronous call.
6824 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6825 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6826 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6829 * @param[in] value - State value.
6830 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6831 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6835 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6838 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6840 * @brief Reads the Restriction for limited discoverable state.
6842 * This function is a synchronous call.
6844 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6845 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6846 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6850 * @param[out] value - State value.
6851 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6852 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6856 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6858 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6860 * @brief Sets the Restriction for Data trasnfer.
6862 * This function is a synchronous call.
6864 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6865 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6866 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6869 * @param[in] value - State value.
6870 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6871 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6875 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6879 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6881 * @brief Reads the Restriction for Data trasnfer.
6883 * This function is a synchronous call.
6885 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6886 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6887 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6891 * @param[out] value - State value.
6892 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6893 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6897 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6905 #endif /* __cplusplus */
6906 #endif /* _BLUETOOTH_API_H_*/