2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef _BLUETOOTH_API_H_
19 #define _BLUETOOTH_API_H_
27 #endif /* __cplusplus */
30 * @defgroup BLUETOOTHFW BluetoothFW
32 * A base library for bluetooth framework
34 * @addtogroup BLUETOOTHFW
38 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
39 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
40 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
41 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
42 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
43 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
44 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
45 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
47 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
48 a device can support */
50 #define BLUETOOTH_UUID_STRING_MAX 50
51 #define BLUETOOTH_PATH_STRING 50
53 #define BLUETOOTH_OOB_DATA_LENGTH 16
55 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
58 * This is Bluetooth Connected event role
60 #define RFCOMM_ROLE_SERVER 1
61 #define RFCOMM_ROLE_CLIENT 2
64 * This is RFCOMM default Channel Value
66 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
69 * This is maximum length for search value string for PBAP Phonebook Search
71 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
74 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
78 * This is Bluetooth error code
80 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
82 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
83 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
85 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
86 /**< Callback error */
87 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
88 /**< invalid paramerror */
89 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
90 /**< invalid data error */
91 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
92 /**< Memory allocation error */
93 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
94 /**< out of memory error */
95 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
97 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
98 /**< No resource error */
99 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
100 /**< internal error */
101 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
102 /**< Not supported error */
103 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
104 /**< Operation is failed because
105 of not enabled BT Adapter */
106 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
107 /**< Enabling is failed because of
108 already enabled BT Adapter */
109 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
110 /**< Operation is failed because of
111 other on going operation */
112 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
113 /**< access denied error */
114 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
115 /**< max client error */
116 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
117 /**< not found error */
118 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
119 /**< service search fail */
120 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
121 /**< pairing failed error */
122 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
123 /**< Not paired error */
124 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
125 /**< no service error */
126 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
127 /**< no connection error */
128 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
129 /**< alread connected error */
130 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
131 /**< connection busy error */
132 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
133 /**< connection error */
134 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
135 /**< max connection error*/
136 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
137 /**< Not in operation */
138 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
139 /**< Cancelled by user */
140 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
141 /**< Service record registration failed */
142 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
143 /**< Operation in progress */
144 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
145 /**< authentication failed error when paring*/
146 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
147 /**< Remote host is down */
148 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
149 /**< End of device list */
151 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
152 /**< Obex agent already exists */
153 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
154 /**< Obex agent does not exist */
156 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
157 /**< Already initialized */
159 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
160 /**< Permission deined */
162 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
163 /**< Nap already done */
165 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
166 /**< Not initialized */
168 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x27)
169 /**< Device Policy Restricted */
172 * Device disconnect reason
175 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
176 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
177 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
178 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
179 } bluetooth_device_disconnect_reason_t;
182 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
185 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
186 } bluetooth_device_address_t;
189 * This is Bluetooth device address type
192 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
193 BLUETOOTH_DEVICE_RANDOM_ADDRESS
194 } bluetooth_device_address_type_t;
197 * This is Bluetooth version
200 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
201 } bluetooth_version_t;
204 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
207 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
208 } bluetooth_device_name_t;
211 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
214 int data_len; /**< manafacturer specific data length */
215 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
216 } bluetooth_manufacturer_data_t;
219 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
220 } bluetooth_device_pin_code_t;
226 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
227 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
228 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
229 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
230 } bluetooth_adapter_state_t;
236 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
237 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
238 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
239 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
240 } bluetooth_adapter_le_state_t;
246 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
247 /*Changed the order to make it compatable with old method */
248 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
249 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
250 /**< Discoverable mode with time limit
251 After specific timeout, it is changed
252 to non discoverable mode */
253 } bluetooth_discoverable_mode_t;
256 * Network connect mode
259 BLUETOOTH_NETWORK_PANU_ROLE,
261 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
262 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
263 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
264 } bluetooth_network_role_t;
270 BLUETOOTH_RFCOMM_SERVICE = 0x01,
271 BLUETOOTH_A2DP_SERVICE = 0x02,
272 BLUETOOTH_HSP_SERVICE = 0x04,
273 BLUETOOTH_HID_SERVICE = 0x08,
274 BLUETOOTH_NAP_SERVICE = 0x10,
275 BLUETOOTH_HFG_SERVICE = 0x20,
276 BLUETOOTH_GATT_SERVICE = 0x40,
277 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
278 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
279 } bluetooth_service_type_t;
285 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, /* represents that connection
286 * type can both BR/EDR and LE */
287 BLUETOOTH_DEV_CONN_BREDR = 0x00,
288 BLUETOOTH_DEV_CONN_LE = 0x01,
289 } bluetooth_conn_type_t;
295 BLUETOOTH_CODEC_ID_CVSD = 0x01,
296 BLUETOOTH_CODEC_ID_MSBC = 0x02,
297 } bluetooth_codec_type_t;
303 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
304 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
305 } bluetooth_hf_audio_connected_type_t;
311 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
312 } bluetooth_advertising_data_t;
318 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
319 } bluetooth_scan_resp_data_t;
322 * Advertising filter policy
325 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
326 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
327 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
328 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
329 } bluetooth_advertising_filter_policy_t;
335 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
336 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
337 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
338 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
339 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
340 } bluetooth_advertising_type_t;
343 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
344 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
345 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
346 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
347 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
348 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
349 } bt_gatt_permission_t;
352 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
353 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
354 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
355 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
356 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
357 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
358 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
359 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
360 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
361 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
362 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
363 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
364 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
365 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
366 } bt_gatt_characteristic_property_t;
369 * Remote device request types for attributes
372 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
373 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
374 } bluetooth_gatt_att_request_tyep_t;
377 * Advertising parameters
382 guint8 filter_policy;
384 } bluetooth_advertising_params_t;
390 int type; /**< passive 0, active 1 */
391 float interval; /**< LE scan interval */
392 float window; /**< LE scan window */
393 } bluetooth_le_scan_params_t;
399 guint16 interval_min;
400 guint16 interval_max;
403 } bluetooth_le_connection_param_t;
406 LE Read Maximum Data Length
409 guint16 max_tx_octets;
411 guint16 max_rx_octets;
413 } bluetooth_le_read_maximum_data_length_t;
416 LE Read Host suggested default Data Length
419 guint16 def_tx_octets;
421 } bluetooth_le_read_host_suggested_data_length_t;
424 * Samsung XSAT Vendor dependent command
429 } bluetooth_vendor_dep_at_cmd_t;
432 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
433 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
434 /**< Base ID for GAP Event */
435 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
436 /**< Base ID for SDP events */
437 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
438 /**< Base ID for RFCOMM events */
439 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
440 /**< Base ID for NETWORK events */
441 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
442 /**< Base ID for HDP events */
443 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
444 /**< Base ID for OPC events */
445 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
446 /**< Base ID for Obex Server events */
447 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
448 /**< Base ID for GATT events */
450 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
451 /**< Base ID for Audio events */
452 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
453 /**< Base ID for HID events */
454 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
455 /**< Base ID for Advertising events */
456 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
457 /**< Base ID for PBAP Client events */
458 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
459 /**< Base ID for AVRCP events */
460 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
461 /**< Base ID for IPSP events */
464 * Bluetooth event type
467 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
469 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
470 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
471 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
472 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
473 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
474 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
475 /**< Bluetooth event Discoverable timeout requested*/
476 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
477 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
478 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
479 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
480 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
481 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
482 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
483 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
484 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
485 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
486 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
487 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
488 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
489 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
490 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
491 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
492 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
493 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
494 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
495 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
496 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
498 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
499 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
500 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
502 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
503 /**< Bluetooth event serice search base id */
504 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
505 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
506 /**< RFCOMM data receive event */
507 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
508 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
510 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
512 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
513 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
515 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
517 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
518 /**< Bluetooth Network event */
519 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
520 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
521 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
522 /**< Network disconnected evnet in server */
524 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
525 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
527 BLUETOOTH_EVENT_HDP_CONNECTED
528 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
529 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
530 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
532 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
533 /* OPC Connected event */
534 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
535 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
536 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
537 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
539 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
540 /* Obex server authorize event*/
541 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
542 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
543 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
544 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
545 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
546 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
548 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
549 /**<Discovered GATT service characteristics event*/
550 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
551 /**<Remote GATT charateristic value changed event*/
552 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
553 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
554 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
555 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
556 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
557 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
558 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
559 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
560 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
561 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
562 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
563 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
564 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
566 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
567 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
568 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
569 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
570 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
571 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
572 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
573 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
574 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
575 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
576 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
577 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
578 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
579 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
580 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
581 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
582 BLUETOOTH_EVENT_HF_CONNECTED,
583 BLUETOOTH_EVENT_HF_DISCONNECTED,
584 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
585 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
586 BLUETOOTH_EVENT_HF_RING_INDICATOR,
587 BLUETOOTH_EVENT_HF_CALL_WAITING,
588 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
589 BLUETOOTH_EVENT_HF_CALL_STARTED,
590 BLUETOOTH_EVENT_HF_CALL_ENDED,
591 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
592 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
593 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
594 BLUETOOTH_EVENT_HF_CALL_STATUS,
595 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
596 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
597 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
598 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
600 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
601 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
602 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
603 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
604 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
606 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
607 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
608 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
609 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
610 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
611 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
612 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
613 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
615 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
616 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
617 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
618 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
619 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
620 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
621 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
623 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
624 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
625 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
626 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
627 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
628 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
629 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
630 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
631 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
633 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
634 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
635 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
636 BLUETOOTH_EVENT_IPSP_BT_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
637 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
638 } bluetooth_event_type_t;
641 * This bt_service_uuid_list_t enum indicates service uuid list .
642 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
646 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
647 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
648 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
649 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
650 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
651 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
652 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
653 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
654 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
655 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
656 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
657 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
659 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
660 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
661 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
662 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
663 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
664 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
665 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
666 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
667 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
668 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
669 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
670 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
671 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
672 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
674 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
675 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
676 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
677 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
678 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
679 /**<DIRECT PRINTING*/
680 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
681 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
682 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
683 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
684 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
685 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
686 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
687 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
688 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
689 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
690 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
691 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
692 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
693 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
694 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
695 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
696 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
697 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
698 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
699 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
700 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
701 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
702 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
703 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
704 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
705 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
706 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
707 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
708 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
709 } bluetooth_service_uuid_list_t;
712 * Service class part of class of device returned from device discovery
715 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
716 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
717 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
718 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
719 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
720 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
721 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
722 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
723 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
724 } bluetooth_device_service_class_t;
728 * Major device mask (For device discovery)
731 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
732 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
733 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
734 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
735 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
736 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
737 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
738 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
739 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
740 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
741 } bluetooth_device_major_mask_t;
745 * Major device class (part of Class of Device)
748 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
749 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
750 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
751 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
752 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
753 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
754 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
755 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
756 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
757 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
758 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
759 } bluetooth_device_major_class_t;
762 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
764 /* About Computer Major class */
765 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
767 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
768 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
769 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
770 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
771 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
773 /* About Phone Major class */
774 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
775 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
776 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
777 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
778 /**< voice gateway minor class */
779 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
781 /* About LAN/Network Access Point Major class */
782 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
783 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
784 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
785 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
786 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
787 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
788 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
789 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
791 /* About Audio/Video Major class */
792 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
793 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
795 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
796 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
797 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
798 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
799 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
800 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
801 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
802 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
803 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
804 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
805 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
806 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
807 /**< Video Display and Loud
808 Speaker minor class */
809 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
812 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
814 /* About Peripheral Major class */
815 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
816 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
817 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
818 /**< Combo Keyboard or pointing
821 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
822 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
823 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
824 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
825 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
826 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
827 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
828 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
829 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
831 /* About Imaging Major class */
832 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
833 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
834 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
835 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
837 /* About Wearable Major class */
838 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
839 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
840 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
841 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
842 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
844 /* About Toy Major class */
845 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
846 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
847 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
848 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
849 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
851 /* About Health Major class */
852 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
853 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
854 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
855 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
856 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
857 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
858 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
859 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
860 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
861 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
862 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
863 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
864 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
865 } bluetooth_device_minor_class_t;
868 * structure to hold the device information
871 bluetooth_device_major_class_t major_class; /**< major device class */
872 bluetooth_device_minor_class_t minor_class; /**< minor device class */
873 bluetooth_device_service_class_t service_class;
874 /**< service device class */
875 } bluetooth_device_class_t;
878 * Discovery Role types
881 DISCOVERY_ROLE_BREDR = 0x1,
883 DISCOVERY_ROLE_LE_BREDR
884 } bt_discovery_role_type_t;
887 * Connected state types
890 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
891 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
892 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
893 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
894 } bluetooth_connected_link_t;
900 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
901 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
902 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
903 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
904 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
905 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
906 } bluetooth_le_scan_filter_feature_t;
912 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
913 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
914 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
915 } bluetooth_le_connection_mode_t;
918 * structure to hold the device information
921 bluetooth_device_address_t device_address; /**< device address */
922 bluetooth_device_name_t device_name; /**< device name */
923 bluetooth_device_class_t device_class; /**< device class */
924 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
925 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
927 int rssi; /**< received strength signal*/
928 gboolean paired; /**< paired flag */
929 bluetooth_connected_link_t connected; /**< connected link type */
930 gboolean trust; /**< trust flag */
931 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
932 } bluetooth_device_info_t;
935 * structure to hold the LE device information
938 int data_len; /**< manafacturer specific data length */
939 bluetooth_advertising_data_t data; /**< manafacturer specific data */
940 } bluetooth_le_advertising_data_t;
943 bluetooth_device_address_t device_address; /**< device address */
944 int addr_type; /**< address type*/
945 int rssi; /**< received strength signal*/
946 bluetooth_le_advertising_data_t adv_ind_data;
947 bluetooth_le_advertising_data_t scan_resp_data;
948 } bluetooth_le_device_info_t;
952 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
953 bluetooth_device_address_t device_address; /**< device address */
954 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
955 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
956 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
957 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
958 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
959 bluetooth_le_advertising_data_t service_data; /**< service data */
960 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
961 int manufacturer_id; /**< manufacturer ID */
962 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
963 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
964 } bluetooth_le_scan_filter_t;
967 * structure to hold the paired device information
970 bluetooth_device_address_t device_address; /**< paired device address */
971 bluetooth_device_name_t device_name; /**< device name */
972 bluetooth_device_class_t device_class; /**< device class */
973 } bluetooth_paired_device_info_t;
976 * structure to hold the paired device information
979 bluetooth_device_address_t device_address;
980 /**< device address */
981 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
982 /**< network interface name */
983 } bluetooth_network_device_info_t;
986 * Authentication event types
990 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
991 BLUETOOTH_AUTH_PIN_REQUEST,
992 BLUETOOTH_AUTH_PASSKEY_REQUEST,
993 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
994 } bluetooth_auth_type_t;
997 * structure to hold the pincode/pass-key req informations
1000 bluetooth_device_address_t device_address; /**< remote device address */
1001 bluetooth_device_name_t device_name; /**< device name */
1002 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1003 } bluetooth_authentication_request_info_t;
1006 * Stucture to hold discovery option
1009 unsigned short max_response; /**< the number of maximum response */
1010 unsigned short discovery_duration;
1011 /**< duration of discovery (seconds) */
1012 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1013 classOfDevice variable */
1014 } bluetooth_discovery_option_t;
1017 * Stucture to hold event information
1020 int event; /**< event type */
1021 int result; /**< Success or error value */
1023 /**<parameter data pointer */
1025 } bluetooth_event_param_t;
1028 bluetooth_device_address_t device_addr;
1029 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1030 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1031 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1036 bluetooth_device_address_t device_addr;
1037 unsigned char addr_type;
1039 } bt_connection_info_t;
1042 * Stucture to rfcomm receive data
1047 /**< the socket fd */
1048 int buffer_size;/**< the length of the receive buffer */
1050 /**< the receive data buffer */
1051 } bluetooth_rfcomm_received_data_t;
1057 HTYPE_TRANS_HANDSHAKE,
1058 HTYPE_TRANS_HID_CONTROL,
1059 HTYPE_TRANS_GET_REPORT,
1060 HTYPE_TRANS_SET_REPORT,
1061 HTYPE_TRANS_GET_PROTOCOL,
1062 HTYPE_TRANS_SET_PROTOCOL,
1065 } bt_hid_header_type_t;
1071 PTYPE_DATA_RTYPE_INPUT,
1072 PTYPE_DATA_RTYPE_OUTPUT
1073 } bt_hid_param_type_t;
1076 * Stucture to hid receive data
1079 const char *address;
1080 bt_hid_header_type_t type;
1081 /**< Header type containing */
1082 bt_hid_param_type_t param;
1083 /**< Param type in header like INPUT Report or OutPut Report */
1084 int buffer_size;/**< the length of the receive buffer */
1086 /**< the receive data buffer */
1087 } bluetooth_hid_received_data_t;
1090 * Stucture to rfcomm connection
1094 int socket_fd; /**< the socket fd */
1095 int server_id; /* Server id */
1096 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1097 bluetooth_device_address_t device_addr;
1098 /**< device address */
1099 char uuid[BLUETOOTH_UUID_STRING_MAX];
1100 } bluetooth_rfcomm_connection_t;
1103 * Stucture to rfcomm disconnection
1107 /**< the socket fd */
1108 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1109 bluetooth_device_address_t device_addr;
1110 /**< device address */
1111 char uuid[BLUETOOTH_UUID_STRING_MAX];
1112 } bluetooth_rfcomm_disconnection_t;
1116 /**< the socket fd */
1117 bluetooth_device_address_t device_addr;
1118 /**< device address */
1119 } bluetooth_rfcomm_connection_request_t;
1123 /**< the socket fd */
1124 bluetooth_device_address_t device_addr;
1125 /**< device address */
1126 } bluetooth_hid_request_t;
1135 } bt_hdp_qos_type_t;
1141 HDP_ROLE_SOURCE = 0x0,
1143 } bt_hdp_role_type_t;
1147 * Stucture to HDP connected
1150 const char *app_handle; /**< the application handle */
1151 unsigned int channel_id; /**< the channel id */
1152 bt_hdp_qos_type_t type; /**< the QOS type */
1153 bluetooth_device_address_t device_address; /**< the remote address */
1154 } bt_hdp_connected_t;
1157 * Stucture to HDP disconnected
1160 unsigned int channel_id; /**< the channel id */
1161 bluetooth_device_address_t device_address; /**< the remote address */
1162 } bt_hdp_disconnected_t;
1165 * Stucture to HDP data indication
1168 unsigned int channel_id; /**< the channel id */
1169 const char *buffer; /**< the RX data buffer */
1170 unsigned int size; /**< the RX data size */
1171 } bt_hdp_data_ind_t;
1174 * Stucture to OPP client transfer information
1180 } bt_opc_transfer_info_t;
1182 /* Obex Server transfer type */
1183 #define TRANSFER_PUT "PUT"
1184 #define TRANSFER_GET "GET"
1186 * Stucture to OPP/FTP Server authorize information
1191 } bt_obex_server_authorize_into_t;
1199 } bt_obex_server_type_t;
1202 * Stucture to OPP/FTP server transfer information
1210 unsigned long file_size;
1212 bt_obex_server_type_t server_type;
1213 } bt_obex_server_transfer_info_t;
1216 * Stucture to OOB data
1220 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1221 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1222 unsigned int hash_len;
1223 unsigned int randomizer_len;
1227 * Structure to GATT attribute handle data
1233 } bt_gatt_handle_info_t;
1236 * Structure to GATT Remote service data
1243 bt_gatt_handle_info_t include_handles;
1244 bt_gatt_handle_info_t char_handle;
1245 } bt_gatt_service_property_t;
1248 * Structure to GATT Remote characteristic data
1252 char *service_handle;
1253 bt_gatt_handle_info_t handle_info;
1254 } bt_gatt_discovered_char_t;
1257 * Structure to format of GATT Characteristic Value
1261 unsigned char format;
1262 unsigned char exponent;
1263 unsigned short unit;
1264 unsigned char name_space;
1265 unsigned short description;
1266 } bt_gatt_char_format_t;
1269 * Structure to GATT Characteristic property
1277 bt_gatt_char_format_t format;
1279 unsigned int val_len;
1280 unsigned int permission;
1281 char *representation;
1282 bt_gatt_handle_info_t char_desc_handle;
1283 } bt_gatt_char_property_t;
1286 * Structure to GATT Characteristic descriptor property
1293 unsigned int val_len;
1294 } bt_gatt_char_descriptor_property_t;
1297 * Structure to GATT Characteristic value
1304 } bt_gatt_char_value_t;
1307 * Structure to GATT Read Request
1311 char *service_handle;
1315 } bt_gatt_read_req_t;
1318 * Structure to GATT Value change
1322 char *service_handle;
1328 } bt_gatt_value_change_t;
1331 * Structure to GATT characteristc Notification change
1335 char *service_handle;
1336 gboolean att_notify;
1337 } bt_gatt_char_notify_change_t;
1340 * Structure to Indication confirmation
1344 char *service_handle;
1347 } bt_gatt_indicate_confirm_t;
1350 * Structure to RSSI Signal Strength Alert
1361 * Structure to RSSI Signal Strength
1371 * Structure for RSSI Enabled or Disabled
1377 gboolean rssi_enabled;
1378 } bt_rssi_enabled_t;
1381 * Structure for RSSI Threshold
1386 int in_range_threshold;
1388 } bt_rssi_threshold_t;
1391 * Structure for PBAP Folder Parameters
1394 unsigned char addressbook;
1395 unsigned char folder_type;
1399 * Structure for PBAP Pull application Parameters
1402 unsigned char format;
1403 unsigned char order;
1404 unsigned short offset;
1405 unsigned short maxlist;
1406 long long unsigned fields;
1407 } bt_pbap_pull_parameters_t;
1410 * Structure for PBAP List application Parameters
1413 unsigned char order;
1414 unsigned short offset;
1415 unsigned short maxlist;
1416 } bt_pbap_list_parameters_t;
1419 * Structure for PBAP Pull vCard application Parameters
1422 unsigned char format;
1423 long long unsigned fields;
1425 } bt_pbap_pull_vcard_parameters_t;
1428 * Structure for PBAP Search application Parameters
1431 unsigned char order;
1432 unsigned short offset;
1433 unsigned short maxlist;
1434 unsigned char search_attribute;
1435 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1436 } bt_pbap_search_parameters_t;
1439 * Structure for PBAP Connection Status
1442 bluetooth_device_address_t btaddr;
1444 } bt_pbap_connected_t;
1447 * Structure for PBAP Phonebook Size
1450 bluetooth_device_address_t btaddr;
1452 } bt_pbap_phonebook_size_t;
1455 * Structure for PBAP Phonebook Pull
1458 bluetooth_device_address_t btaddr;
1461 } bt_pbap_phonebook_pull_t;
1464 * Structure for PBAP vCard List
1467 bluetooth_device_address_t btaddr;
1471 } bt_pbap_vcard_list_t;
1474 * Structure for PBAP vCard Pull
1477 bluetooth_device_address_t btaddr;
1480 } bt_pbap_vcard_pull_t;
1483 * Structure for PBAP Phonebook search List
1486 bluetooth_device_address_t btaddr;
1490 } bt_pbap_phonebook_search_list_t;
1493 * Stucture to HF Call status information
1497 char *number; /*Phone Number */
1498 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1499 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1500 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1501 int idx; /*Call index/ID */
1502 } bt_hf_call_status_info_t;
1507 } bt_hf_call_list_s;
1510 * Structure for LE data length change params
1514 bluetooth_device_address_t device_address;
1515 guint16 max_tx_octets;
1516 guint16 max_tx_time;
1517 guint16 max_rx_octets;
1518 guint16 max_rx_time;
1519 } bt_le_data_length_params_t;
1523 * @brief DPM BT allowance state
1527 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1528 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1529 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1530 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1534 * @brief DPM API result
1538 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1539 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1540 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1541 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1542 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1543 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1547 * @brief DPM Policy status
1551 BLUETOOTH_DPM_STATUS_ERROR = -1,
1553 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1554 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1556 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1557 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1559 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1560 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1564 /* policy-group : BLUETOOTH */
1565 BLUETOOTH_DPM_POLICY_ALLOW,
1566 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1567 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1568 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1569 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1570 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1571 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1572 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1573 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1574 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1575 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1576 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1577 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1578 BLUETOOTH_DPM_POLICY_END,
1579 } bt_dpm_policy_cmd_t;
1582 struct bt_dpm_policy {
1588 typedef struct bt_dpm_policy bt_dpm_policy_t;
1591 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1592 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1593 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1594 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1595 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1596 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1597 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1598 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1599 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1600 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1601 BLUETOOTH_DPM_PROFILE_NONE,
1604 struct bt_dpm_profile_val {
1605 int value; /* tells whether the profile is enabled or disabled */
1607 typedef struct dpm_profile_val dpm_profile_state_t;
1610 * Structure to DPM device list
1614 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1615 } bt_dpm_device_list_t;
1618 * Structure to DPM uuid list
1622 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1623 } bt_dpm_uuids_list_t;
1626 * Structure for IPSP Interface Info
1629 bluetooth_device_address_t btaddr;
1631 } bt_ipsp_interface_info_t;
1634 * Callback pointer type
1636 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1639 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1640 * @brief Set the callback function pointer for bluetooth event
1643 * This API will register the callback function, when any response and event are received from
1644 * bluetooth framework. @n
1645 * this registered callback function will be get called with appropriate event and data structures.
1646 * This function is a synchronous call. An application developer can call
1647 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1648 * type. This registered function will receive events of bluetooth_event_type_t type along with
1652 * @param[in] callback_ptr A pointer to the callback function
1653 * @param[in] user_data A pointer to user data
1654 * @return BLUETOOTH_ERROR_NONE - Success
1658 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1660 GMainLoop *main_loop = (GMainLoop*) user_data;
1664 // Code for each event
1666 g_main_loop_quit(main_loop);
1673 GMainLoop *main_loop = NULL;
1675 main_loop = g_main_loop_new(NULL, FALSE);
1676 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1677 if (ret >= BLUETOOTH_ERROR_NONE)
1679 // bluetooth_register_callback returned Success
1683 // bluetooth_register_callback returned failiure
1685 g_main_loop_run(main_loop);
1689 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1692 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1693 * @brief Set the callback function pointer for bluetooth le event
1696 * This API will register the callback function, when any response and event are received from
1697 * bluetooth framework. @n
1698 * this registered callback function will be get called with appropriate event and data structures.
1699 * This function is a synchronous call. An application developer can call
1700 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1701 * type. This registered function will receive events of bluetooth_event_type_t type along with
1705 * @param[in] callback_ptr A pointer to the callback function
1706 * @param[in] user_data A pointer to user data
1707 * @return BLUETOOTH_ERROR_NONE - Success
1711 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1714 * @fn int bluetooth_le_unregister_callback(void)
1715 * @brief Set the callback function pointer for bluetooth le event
1718 * This API will register the callback function, when any response and event are received from
1719 * bluetooth framework. @n
1720 * this registered callback function will be get called with appropriate event and data structures.
1721 * This function is a synchronous call. An application developer can call
1722 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1723 * type. This registered function will receive events of bluetooth_event_type_t type along with
1728 * @return BLUETOOTH_ERROR_NONE - Success
1732 int bluetooth_le_unregister_callback(void);
1735 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1736 * @brief Set the callback function pointer for bluetooth event
1739 * This API will register the callback function, when any response and event are received from
1740 * bluetooth framework. @n
1741 * this registered callback function will be get called with appropriate event and data structures.
1742 * This function is a synchronous call. An application developer can call
1743 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1744 * type. This registered function will receive events of bluetooth_event_type_t type along with
1749 * @return BLUETOOTH_ERROR_NONE - Success
1753 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1755 GMainLoop *main_loop = (GMainLoop*) user_data;
1759 // Code for each event
1761 g_main_loop_quit(main_loop);
1768 GMainLoop *main_loop = NULL;
1770 main_loop = g_main_loop_new(NULL, FALSE);
1771 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1772 if (ret >= BLUETOOTH_ERROR_NONE)
1774 // bluetooth_register_callback returned Success
1778 // bluetooth_register_callback returned failiure
1780 ret = bluetooth_deregister_callback(void);
1781 g_main_loop_run(main_loop);
1785 int bluetooth_unregister_callback(void);
1788 * @fn int bluetooth_enable_adapter(void)
1789 * @brief Enable the Bluetooth H/W
1792 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1793 * send request to bluetooth chip for activation.
1794 * This function is typically called at startup or when Bluetooth services are required. This
1795 * function must be called before calling any other API of Bluetooth operations.
1797 * Before performing any operations like Device discover, service search etc.., the adapter must be
1800 * This function is a asynchronous call.
1801 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1802 * through registered callback function with appropriate result code
1803 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1804 * BLUETOOTH_ERROR_NONE - Success \n
1806 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1807 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1809 * @return BLUETOOTH_ERROR_NONE - Success\n
1810 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1811 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1812 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1813 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1815 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1817 void bt_event_callback(int event, bluetooth_event_param_t *param)
1821 case BLUETOOTH_EVENT_ENABLED:
1822 if (param->result == BLUETOOTH_ERROR_NONE)
1824 // Successfully Enabled
1837 ret = bluetooth_enable_adapter();
1841 int bluetooth_enable_adapter(void);
1844 * @fn int bluetooth_disable_adapter(void)
1845 * @brief Disable the Bluetooth H/W
1848 * This function disables Bluetooth protocol stack and hardware. This function is called when
1849 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1851 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1852 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1853 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1855 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1858 * This function is a asynchronous call.
1859 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1860 * through registered callback function.
1863 * @return BLUETOOTH_ERROR_NONE - Success\n
1864 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1865 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1866 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1868 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1870 void bt_event_callback(int event, bluetooth_event_param_t *param)
1874 case BLUETOOTH_EVENT_DISABLED:
1875 if (param->result == BLUETOOTH_ERROR_NONE)
1877 // Successfully disabled
1890 ret = bluetooth_disable_adapter();
1893 int bluetooth_disable_adapter(void);
1894 int bluetooth_recover_adapter(void);
1895 int bluetooth_check_adapter_le(void);
1896 int bluetooth_enable_adapter_le(void);
1898 int bluetooth_disable_adapter_le(void);
1901 * @fn int bluetooth_reset_adapter(void)
1902 * @brief Reset the Bluetooth H/W and values
1905 * This function resets Bluetooth protocol stack and hardware. This function is called when
1906 * an user want to initialize Bluetooth environment.
1908 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1911 * This function is a synchronous call.
1913 * @return BLUETOOTH_ERROR_NONE - Success\n
1914 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1916 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1921 ret = bluetooth_reset_adapter();
1924 int bluetooth_reset_adapter(void);
1927 * @fn int bluetooth_is_supported(void)
1928 * @brief Check if the bluetooth is supported or not by the current target
1930 * This API checks whether the bluetooth is supported or not.
1931 * This API only run by root permission.
1933 * This function is a synchronous call.
1935 * @return 0 - if bluetooth is not supported\n
1936 * 1 - if bluetooth is supported\n
1937 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
1942 ret = bluetooth_is_supported();
1945 int bluetooth_is_supported(void);
1949 * @fn int bluetooth_check_adapter(void)
1950 * @brief Check the current status of the Bluetooth adapter
1953 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
1954 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
1955 * bluetooth adapter.
1956 * This API get the adapter internal data structure and check current adapter status.
1958 * This function is a synchronous call.
1961 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
1962 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
1964 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
1968 ret = bluetooth_check_adapter();
1971 int bluetooth_check_adapter(void);
1974 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
1975 * @brief Get the local adapter bluetooth address
1978 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
1979 * the adapter should be enabled.
1980 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
1981 * contain Bluetooth address.
1982 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
1983 * friendly name for each device.
1984 * There is no event callback for this API.
1986 * This function is a synchronous call.
1989 * @return BLUETOOTH_ERROR_NONE - Succeess \n
1990 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
1991 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
1992 * @param[out] local_address a device address of local bluetooth adapter
1997 bluetooth_device_address_t local_address={0,};
2000 ret = bluetooth_get_local_address(&local_address);
2003 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2006 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2007 * @brief Get the hci version
2010 * This function is used to get the bluetooth hci version
2011 * Before calling this API make sure that the adapter is enabled.
2013 * This function is a synchronous call.
2016 * @return BLUETOOTH_ERROR_NONE - Success \n
2017 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2018 * @param[out] timeout remain visibility timeout value
2021 bluetooth_version_t *version;
2023 ret = bluetooth_get_local_version (&version);
2026 int bluetooth_get_local_version(bluetooth_version_t *version);
2029 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2030 * @brief Get the local device name
2033 * This function is used, get the local device name. Since its difficult to remember the Adapter
2034 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2035 * friendly name is retrived by the remote device and displaying.
2036 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2038 * This function is a synchronous call.
2041 * @return BLUETOOTH_ERROR_NONE - Success \n
2042 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2043 * @param[out] local_name a local device name
2047 bluetooth_device_name_t local_name={0,}
2049 ret = bluetooth_get_local_name (&local_name);
2052 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2055 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2056 * @brief Set the local device name
2059 * This function is used to set the local device name. This is a human friendly name whose
2060 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2062 * This function is a synchronous call.
2064 * @param[in] local_name bluetooth device name to set local device
2066 * @return BLUETOOTH_ERROR_NONE - Success \n
2067 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2068 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2069 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2070 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2071 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2076 bluetooth_device_name_t local_name={0,}
2078 ret = bluetooth_set_local_name (&local_name);
2081 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2085 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2086 * @brief Check if the uuid is used or not
2088 * This function is used to check if the uuid is used or not.
2090 * This function is a synchronous call.
2092 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2093 * @param[out] used if the uuid is used or not
2095 * @return BLUETOOTH_ERROR_NONE - Success \n
2096 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2097 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2098 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2103 gboolean used = FALSE;
2104 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2105 ret = bluetooth_is_service_used(uuid, &used);
2108 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2111 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2112 * @brief Check if the device is connected to the specific service
2114 * This function is used to check if if the device is connected to the specific service.
2116 * This function is a synchronous call.
2118 * @param[in] local_address a device address of remote bluetooth device
2119 * @param[in] type the service type
2120 * @param[out] is_connected if the device is connected or not
2122 * @return BLUETOOTH_ERROR_NONE - Success \n
2123 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2124 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2125 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2130 gboolean is_connected = FALSE;
2131 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2132 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2135 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2136 bluetooth_service_type_t type,
2137 gboolean *is_connected);
2140 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2141 * @brief Gets device's connected link type
2143 * This function is used to get device's connected link type
2145 * This function is a synchronous call.
2147 * @param[in] device_address a device address of remote bluetooth device
2148 * @param[out] connected_link a device's connected link type
2150 * @return BLUETOOTH_ERROR_NONE - Success \n
2151 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2152 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2153 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2158 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2159 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2160 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2163 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2164 bluetooth_connected_link_t *connected_link);
2167 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2168 * @brief Get the visibility mode
2171 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2172 * visibity mode, the property of the device is determined whether it can be discoverable, non
2173 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2175 * This function is a synchronous call.
2178 * @return BLUETOOTH_ERROR_NONE - Success \n
2179 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2180 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2181 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2182 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2183 * @param[out] discoverable_mode current bluetooth discoverable mode
2185 * @see bluetooth_set_discoverable_mode
2187 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2189 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2192 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2195 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2197 * @brief Set the visibility mode
2200 * This function is used to set the discoverable mode (Visibility option).
2202 * Many times user may want to keep his device discoverable so that when peer device is performing
2203 * device search, he/she can find user's device. Application programmer can keep the mode as
2204 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2205 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2206 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2207 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2209 * This function is a synchronous call.
2211 * @return BLUETOOTH_ERROR_NONE - Success \n
2212 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2214 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2215 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2217 * @see bluetooth_get_discoverable_mode
2221 bluetooth_discoverable_mode_t mode;
2223 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2224 ret = bluetooth_set_discoverable_mode (mode, 180);
2228 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2233 * @fn int bluetooth_get_timeout_value(int *timeout)
2234 * @brief Get the visibility timeout value
2237 * This function is used to get the visibility timeout
2238 * Before calling this API make sure that the adapter is enabled.
2240 * This function is a synchronous call.
2243 * @return BLUETOOTH_ERROR_NONE - Success \n
2244 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2245 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2246 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2247 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2248 * @param[out] timeout remain visibility timeout value
2250 * @see bluetooth_set_discoverable_mode
2254 ret = bluetooth_get_timeout_value (&timeout);
2257 int bluetooth_get_timeout_value(int *timeout);
2261 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2262 * unsigned int classOfDeviceMask)
2263 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2265 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2266 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2267 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2268 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2269 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2270 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2271 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2272 * please see bluetooth_device_info_t for more details.
2275 * This API provides searching options like max responses, discovery duration in seconds and class
2276 * of device mask to filter device search. some times there may be too many bluetooth devices in
2277 * vicinity of your device.in such scenario, application can request to reduce number of responces
2278 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2279 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2280 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2281 * application defined time. please note that discovery_duration should be mentioned in seconds.
2282 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2285 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2286 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2287 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2289 * This function is a asynchronous call.
2290 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2291 * through registered callback function.
2293 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2294 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2296 * The completion or cancellation of the discovery is indicated by an
2297 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2299 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2302 * @return BLUETOOTH_ERROR_NONE - Success \n
2303 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2304 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2305 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2306 agent is not running \n
2308 * @param[in] max_response define the maximum response of the number of founded devices
2310 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2311 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2312 (refer to class of device)
2314 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2317 void bt_event_callback(int event, bluetooth_event_param_t *param)
2321 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2323 bluetooth_device_info_t *device_info = NULL;
2324 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2326 device_info = (bluetooth_device_info_t *)param->param_data;
2327 memcpy(&searched_device, &device_info->device_address,
2328 sizeof(bluetooth_device_address_t));
2329 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2330 device_info->device_address.addr[0],
2331 device_info->device_address.addr[1],
2332 device_info->device_address.addr[2],
2333 device_info->device_address.addr[3],
2334 device_info->device_address.addr[4],
2335 device_info->device_address.addr[5]);
2338 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2340 bluetooth_device_info_t *device_info = NULL;
2341 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2343 device_info = (bluetooth_device_info_t *)param->param_data;
2344 memcpy(&searched_device, &device_info->device_address,
2345 sizeof(bluetooth_device_address_t));
2346 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2347 device_info->device_name.name,
2348 device_info->device_address.addr[0],
2349 device_info->device_address.addr[1],
2350 device_info->device_address.addr[2],
2351 device_info->device_address.addr[3],
2352 device_info->device_address.addr[4],
2353 device_info->device_address.addr[5]);
2357 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2358 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2363 unsigned short max_response;
2364 unsigned short discovery_duration;
2365 unsigned classOfDeviceMask;
2369 discovery_duration =0;
2370 classOfDeviceMask =0;
2372 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2377 int bluetooth_start_discovery(unsigned short max_response,
2378 unsigned short discovery_duration,
2379 unsigned int classOfDeviceMask);
2382 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2383 * unsigned short max_response,
2384 * unsigned short discovery_duration,
2385 * unsigned int classOfDeviceMask)
2386 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2388 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2389 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2390 * Please see bluetooth_start_discovery() for other parameters description.
2392 * This function is a asynchronous call.
2393 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2394 * through registered callback function.
2396 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2397 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2399 * The completion or cancellation of the discovery is indicated by an
2400 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2402 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2405 * @return BLUETOOTH_ERROR_NONE - Success \n
2406 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2407 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2408 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2409 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2410 agent is not running \n
2412 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2413 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2414 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2415 * @param[in] max_response define the maximum response of the number of founded devices
2417 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2418 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2419 (refer to class of device)
2421 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2424 unsigned short type;
2425 unsigned short max_response;
2426 unsigned short discovery_duration;
2427 unsigned classOfDeviceMask;
2432 discovery_duration =0;
2433 classOfDeviceMask =0;
2435 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2440 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2441 unsigned short max_response,
2442 unsigned short discovery_duration,
2443 unsigned int classOfDeviceMask);
2446 * @fn int bluetooth_cancel_discovery (void)
2447 * @brief Cancel the on-going device discovery operation
2450 * This function stops the on-going device discovery operation. This API has to be called after the
2451 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2452 * the bluetooth_start_discovery API
2454 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2455 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2456 * cancel the discover request once the user received the device to which he wish to connect.
2458 * This function is a asynchronous call.
2459 * If the call is success to cancel discovey then the application will receive
2460 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2461 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2462 * BLUETOOTH_ERROR_NONE
2465 * @return BLUETOOTH_ERROR_NONE - Success \n
2466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2467 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2468 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2469 other application \n
2470 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2472 * @see bluetooth_start_discovery
2474 void bt_event_callback(int event, bluetooth_event_param_t *param)
2478 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2479 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2488 ret = bluetooth_cancel_discovery();
2491 int bluetooth_cancel_discovery(void);
2494 * @fn int bluetooth_start_le_discovery(void)
2495 * @brief Start the generic device discovery which finds the LE devices.
2497 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2498 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2499 * It try to find LE devices. Bluetooth device address and name are
2500 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2501 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2502 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2503 * please see bluetooth_device_info_t for more details.
2505 * This function is a asynchronous call.
2506 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2507 * through registered callback function.
2509 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2512 * The completion or cancellation of the discovery is indicated by an
2513 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2515 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2518 * @return BLUETOOTH_ERROR_NONE - Success \n
2519 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2520 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2521 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2522 agent is not running \n
2525 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2528 void bt_event_callback(int event, bluetooth_event_param_t *param)
2532 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2534 bluetooth_device_info_t *device_info = NULL;
2535 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2537 device_info = (bluetooth_device_info_t *)param->param_data;
2538 memcpy(&searched_device, &device_info->device_address,
2539 sizeof(bluetooth_device_address_t));
2540 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2541 device_info->device_address.addr[0],
2542 device_info->device_address.addr[1],
2543 device_info->device_address.addr[2],
2544 device_info->device_address.addr[3],
2545 device_info->device_address.addr[4],
2546 device_info->device_address.addr[5]);
2550 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2551 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2557 ret = bluetooth_start_discovery();
2562 int bluetooth_start_le_discovery(void);
2565 * @fn int bluetooth_stop_le_discovery (void)
2566 * @brief Cancel the on-going device LE discovery operation
2569 * This function stops the on-going device discovery operation. This API has to be called after the
2570 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2571 * the bluetooth_start_le_discovery API
2574 * This function is a asynchronous call.
2575 * If the call is success to cancel discovey then the application will receive
2576 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2577 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2578 * BLUETOOTH_ERROR_NONE
2581 * @return BLUETOOTH_ERROR_NONE - Success \n
2582 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2583 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2584 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2585 other application \n
2586 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2588 * @see bluetooth_start_discovery
2590 void bt_event_callback(int event, bluetooth_event_param_t *param)
2594 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2595 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2604 ret = bluetooth_stop_le_discovery();
2607 int bluetooth_stop_le_discovery(void);
2610 * @fn int bluetooth_is_discovering(void)
2611 * @brief Check for the device discovery is in-progress or not.
2613 * This API is used to check the current status of the Discovery operation.If discovery is in\
2614 * progress normally other operations are not allowed.
2615 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2616 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2617 * event before performing other operations. This API is used to get for the current discovery
2618 * operation status and using bluetooth_cancel_discovery()
2619 * we can cancell the ongoing discovery process.
2620 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2623 * This function checks whether the device discovery is started or not.
2625 * This function is a synchronous call.
2628 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2629 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2630 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2633 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2637 ret = bluetooth_is_discovering ();
2640 int bluetooth_is_discovering(void);
2643 * @fn int bluetooth_is_le_discovering(void)
2644 * @brief Check for the device LE discovery is in-progress or not.
2646 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2647 * progress normally other operations are not allowed.
2648 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2649 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2650 * event before performing other operations. This API is used to get for the current discovery
2651 * operation status and using bluetooth_stop_le_discovery()
2652 * we can cancell the ongoing LE discovery process.
2653 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2656 * This function checks whether the device LE discovery is started or not.
2658 * This function is a synchronous call.
2661 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2662 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2663 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2666 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2670 ret = bluetooth_is_le_discovering ();
2673 int bluetooth_is_le_discovering(void);
2676 * @fn int bluetooth_is_le_scanning(void)
2677 * @brief Check for the device LE scan is in-progress or not.
2679 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2680 * progress normally other operations are not allowed.
2682 * This function checks whether the device LE Scan is started or not.
2684 * This function is a synchronous call.
2686 * @return TRUE - LE Scan in progress \n
2687 * FALSE - LE Scan is not in progress \n
2692 gboolean is_le_scanning = 0;
2693 is_le_scanning = bluetooth_is_le_scanning ();
2696 gboolean bluetooth_is_le_scanning(void);
2699 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2700 * @brief Register scan filter.
2702 * This function registers the scan filter.
2704 * This function is a synchronous call.
2706 * @return BLUETOOTH_ERROR_NONE - Success \n
2708 * @param[in] filter scan filter to register
2709 * @param[out] slot_id the slot ID of scan filter
2713 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2716 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2717 * @brief Register scan filter.
2719 * This function unregisters the scan filter.
2721 * This function is a synchronous call.
2723 * @return BLUETOOTH_ERROR_NONE - Success \n
2725 * @param[in] slot_id the slot ID of scan filter
2729 int bluetooth_unregister_scan_filter(int slot_id);
2732 * @fn int bluetooth_unregister_all_scan_filters(void)
2733 * @brief Register scan filter.
2735 * This function usregisters all scan filters.
2737 * This function is a synchronous call.
2739 * @return BLUETOOTH_ERROR_NONE - Success \n
2743 int bluetooth_unregister_all_scan_filters(void);
2746 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2747 int link_type, bt_rssi_threshold_t rssi_threshold)
2748 * @brief Enable RSSI monitoring
2750 * This function enables RSSI monitoring and sets threshold for a connection
2752 * @return BLUETOOTH_ERROR_NONE - Success \n
2755 * @see bluetooth_get_rssi_strength
2757 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2758 int link_type, bt_rssi_threshold_t *rssi_threshold);
2761 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2762 * @brief Gets Raw RSSI signal Strength
2764 * This function gives the Raw RSSI signal strength for a connection.
2766 * @return BLUETOOTH_ERROR_NONE - Success \n
2769 * @see bluetooth_enable_rssi
2771 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2773 int bluetooth_set_connectable(gboolean is_connectable);
2775 int bluetooth_is_connectable(gboolean *is_connectable);
2778 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2779 * @brief Initiate a bonding process
2782 * This function initiates a bonding procedure with a peer device. The bonding procedure
2783 * enables authentication and optionally encryption on the Bluetooth link.
2785 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2786 * inititate the bonding request to the devices already in the paired list.
2788 * Usually we call this API after the device discovery.
2789 * This function is a asynchronous call.
2791 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2792 * mentioed result code
2793 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2794 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2795 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2796 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2797 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2799 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2800 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2803 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2806 * @return BLUETOOTH_ERROR_NONE - Success \n
2807 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2808 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2809 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2810 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2812 * @param[in] device_address This indicates an address of the device with which the pairing
2813 * should be initiated
2815 * @see bluetooth_cancel_bonding
2817 void bt_event_callback(int event, bluetooth_event_param_t *param)
2821 case BLUETOOTH_EVENT_BONDING_FINISHED:
2823 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2824 if (param->result >= BLUETOOTH_ERROR_NONE)
2826 bluetooth_device_info_t *device_info = NULL;
2827 device_info = (bluetooth_device_info_t *)param->param_data;
2828 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
2829 mjr[%#x] min[%#x] srv[%#x]",
2830 device_info->device_name.name,
2831 device_info->device_address.addr[0],
2832 device_info->device_address.addr[1],
2833 device_info->device_address.addr[2],
2834 device_info->device_address.addr[3],
2835 device_info->device_address.addr[4],
2836 device_info->device_address.addr[5],
2837 device_info->device_class.major_class,
2838 device_info->device_class.minor_class,
2839 device_info->device_class.service_class);
2853 bluetooth_device_address_t device_address={{0}};
2855 ret = bluetooth_bond_device(&device_address);
2859 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
2862 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2863 * bluetooth_conn_type_t conn_type)
2864 * @brief Initiate a bonding process
2867 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
2868 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
2870 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2871 * inititate the bonding request to the devices already in the paired list.
2873 * Usually we call this API after the device discovery.
2874 * This function is a asynchronous call.
2876 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2877 * mentioed result code
2878 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2879 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2880 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2881 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2882 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2884 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2885 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2888 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2891 * @return BLUETOOTH_ERROR_NONE - Success \n
2892 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2893 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2894 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2895 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2897 * @param[in] device_address This indicates an address of the device with which pairing
2898 * should be initiated
2899 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
2902 * @see bluetooth_cancel_bonding
2904 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2905 bluetooth_conn_type_t conn_type);
2908 * @fn int bluetooth_cancel_bonding(void)
2909 * @brief Cancel the on-going bonding process
2911 * This API is called to cancel the on-going bonding procedure. It should be called before the
2912 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
2913 * This API is useful when the remote device is not responding to the bond request or we wish to
2914 * cancel the bonding request. In this case we need not wait for the timeout to happen.
2916 * This function is a synchronous call.
2918 * @return BLUETOOTH_ERROR_NONE - Success \n
2919 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
2920 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2923 * @see bluetooth_bond_device
2929 ret = bluetooth_cancel_bonding();
2932 int bluetooth_cancel_bonding(void);
2935 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
2936 * @brief Remove bonding
2939 * To communicate with remote device over bluetooth link, user should bond with peer device.
2940 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
2941 * API is used to remove peer device from the list. Please note that after removing the device
2942 * from bonded device list, you cannot communication with peer device until bonding happens again.
2944 * User can call this function by passing bluetooth device address of any bonded device. Please note
2945 * that after successful return of this function, any bluetooth application running on your device
2946 * will not be able to communicate with unbonded device until bond operation happens again using
2947 * bluetooth_bond_device()
2950 * This function is a asynchronous call. The request to remove the specified device from the bonded
2951 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
2952 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
2953 * in case if there is a problem in locating given bluetooth device address in bonded devices list
2957 * @return BLUETOOTH_ERROR_NONE - Success \n
2958 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
2959 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2960 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2961 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2962 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2963 * agent is not running \n
2964 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
2967 * @param[in] device_address This indicates an address of the device to remove bonding
2971 * @see bluetooth_bond_device, bluetooth_cancel_bonding
2974 void bt_event_callback(int event, bluetooth_event_param_t *param)
2977 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
2978 bluetooth_device_address_t *dev_addr = NULL;
2980 if (param->result == BLUETOOTH_ERROR_NONE) {
2981 dev_addr = (bluetooth_device_address_t *)param->param_data;
2983 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2984 dev_addr->addr[0], dev_addr->addr[1]
2985 dev_addr->addr[2], dev_addr->addr[3]
2986 dev_addr->addr[4], dev_addr->addr[5]
2997 bluetooth_device_address_t *device_address;
2999 // copy valid device address in device_address
3001 ret = bluetooth_unbond_device(device_address);
3004 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3007 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3008 * @brief Get bonded(paired) device list
3011 * This API gets all bonded device list.
3012 * The devices in the bonded device list further can be used to perform the authorization by calling
3013 * bluetooth_authorize_device API.
3015 * This function is a synchronous call.
3016 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3017 * there is no valid information in the dev_list.
3018 * The len field in the dev_list represents the number of bonded devices. The data structure for
3019 * bonded device information is bluetooth_device_info_t.
3022 * @return BLUETOOTH_ERROR_NONE - Success \n
3023 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3025 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3027 void bt_get_bonded_devices(void)
3031 GPtrArray *devinfo = NULL;
3032 bluetooth_device_info_t *ptr;
3034 // allocate the g_pointer_array
3035 devinfo = g_ptr_array_new();
3037 ret = bluetooth_get_bonded_device_list(&devinfo);
3038 if (ret != BLUETOOTH_ERROR_NONE)
3040 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3044 printf("g pointer arrary count : [%d]", devinfo->len);
3045 for (i=0; i<devinfo->len; i++)
3047 ptr = g_ptr_array_index(devinfo, i);
3050 printf("Name [%s]\n", ptr->device_name.name);
3051 printf("Major Class [%d]\n", ptr->device_class.major_class);
3052 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3053 printf("Service Class [%d]\n", ptr->device_class.service_class);
3054 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3055 ptr->device_address.addr[0],
3056 ptr->device_address.addr[1], ptr->device_address.addr[2],
3057 ptr->device_address.addr[3],
3058 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3065 // free g_pointer_array
3066 g_ptr_array_free(devinfo, TRUE);
3071 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3074 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3075 * bluetooth_device_info_t *dev_info)
3076 * @brief Get a bonded(paired) device
3079 * This API gets a bonded device.
3081 * This function is a synchronous call.
3082 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3083 * there is no valid information in the dev_info.
3084 * The data structure for bonded device information is bluetooth_device_info_t.
3087 * @return BLUETOOTH_ERROR_NONE - Success \n
3088 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3090 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3092 void bt_get_bonded_device(void)
3096 bluetooth_device_info_t devinfo = {0};
3097 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3099 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3100 if (ret != BLUETOOTH_ERROR_NONE)
3102 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3106 printf("Name [%s]\n", devinfo.device_name.name);
3107 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3108 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3109 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3110 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3111 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3112 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3113 devinfo.device_address.addr[5]);
3122 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3123 bluetooth_device_info_t *dev_info);
3126 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3127 * @brief set alias for bonded device
3130 * This function set alias for bonded device.
3132 * This function is a synchronous call.
3135 * @return BLUETOOTH_ERROR_NONE - Success \n
3136 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3137 * @param[in] device_address This indicates an address of the remote device
3138 * @param[in] alias This indicates an alias to set
3143 ret = bluetooth_set_alias(&remote_address);
3146 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3150 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3151 * @brief Get remote deivice
3154 * This function gets specific remote device.
3156 * This function is a asynchronous call.
3157 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3160 * @return BLUETOOTH_ERROR_NONE - Success \n
3161 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3162 * @param[in] device_address This indicates an address of the remote device
3167 ret = bluetooth_get_remote_device(&remote_address);
3170 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3173 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3174 * gboolean authorized)
3175 * @brief Authorize/Unauthorize a bonded device
3178 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3179 * with/without user confirmation.
3181 * If we select a paired device and make it authorized by calling this API with the authorized
3182 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3183 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3184 * then it will ask for the user conformation before the connection.
3186 * This API supposed to be called on the paired devices. Which means we have to use this API only
3187 * after successful pairing.
3189 * This function is a asynchronous call.
3190 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3192 * @return BLUETOOTH_ERROR_NONE - Success \n
3193 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3194 * @param[in] device_address This indicates an address of the device to authorize \n
3195 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3197 * @see bluetooth_get_bonded_device_list
3199 void bt_event_callback(int event, bluetooth_event_param_t *param)
3203 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3205 if (param->result == BLUETOOTH_ERROR_NONE)
3209 //device authorization failed failure
3217 bluetooth_device_address_t device_address={{0}};
3218 gboolean authorized;
3222 ret = bluetooth_authorize_device(&device_address,authorized);
3225 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3226 gboolean authorized);
3228 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3229 const bluetooth_device_pin_code_t *pin_code);
3231 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3234 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3236 * @brief Receives Legacy Passkey\pin with following authentication response types
3238 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3239 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3242 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3245 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3247 * @brief This API sends user confirmation reply to the local adapter.
3249 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3252 int bluetooth_passkey_confirmation_reply(gboolean reply);
3255 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3256 * @brief Get all services supported by remote device
3259 * This API call initiates the search for the services supported by the specified device. Normally
3260 * the service search will take a couple of seconds to get it completed. Before calling this API
3261 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3262 * perform the service search. We can get the device address by doing a device discovery operation.
3265 * This function is a asynchronous call.
3266 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3268 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3269 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3270 * event is generated with appropriate result code.
3272 * @return BLUETOOTH_ERROR_NONE - Success \n
3273 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3274 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3275 * @param[in] device_address This indicates an address of the device
3276 * whose services need to be found
3278 * @see bluetooth_cancel_service_search
3280 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3283 * @fn int bluetooth_cancel_service_search(void)
3284 * @brief Cancel the ongoing service search operation
3287 * This function cancel the ongoing service search operation. This API is usually calling after the
3288 * bluetooth_search_service API.
3289 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3290 * if the user wish to cancel the Ongoing service search operation.
3292 * This API should be called just after the bluetooth_search_service API and before the
3293 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3295 * This function is a synchronous call.
3297 * @return BLUETOOTH_ERROR_NONE - Success \n
3298 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3299 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3300 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3303 * @see bluetooth_search_service
3308 ret = bluetooth_cancel_service_search();
3311 int bluetooth_cancel_service_search(void);
3314 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3315 * @brief Register rfcomm socket with a specific uuid
3318 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3319 * descriptor of the server.
3320 * This is the first API which is called to create the server. Once we created the server socket,
3321 * we will listen on that return socket.
3322 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3325 * @return socket FD on Success \n
3326 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3327 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3328 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3329 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3330 * @param[in] UUID (128 bits)
3333 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3337 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3338 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3342 int bluetooth_rfcomm_create_socket(const char *uuid);
3345 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3346 * @brief Register rfcomm socket with a specific uuid
3349 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3350 * descriptor of the server.
3351 * This is the first API which is called to create the server. Once we created the server socket,
3352 * we will listen on that return socket.
3353 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3356 * @return socket FD on Success \n
3357 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3358 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3359 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3360 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3361 * @param[in] UUID (128 bits)
3362 * @param[in] bus_name (const char)
3363 * @param[in] path (const char)
3366 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3370 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3371 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3375 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3378 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3379 * @brief De-register the rfcomm socket
3382 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3383 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3384 * descriptor else no event will come. We will call this API only after the
3385 * bluetooth_rfcomm_listen_and_accept.
3386 * This is a synchronous call.
3388 * @return BLUETOOTH_ERROR_NONE - Success \n
3389 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3390 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3391 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3392 * @param[in] int socket_fd
3395 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3398 void bt_event_callback(int event, bluetooth_event_param_t *param)
3402 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3404 bluetooth_rfcomm_connection_t *discon_ind =
3405 (bluetooth_rfcomm_connection_t *)param->param_data;
3407 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3415 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3416 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3418 ret = bluetooth_rfcomm_remove_socket(fd);
3421 int bluetooth_rfcomm_remove_socket(int socket_fd);
3424 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3425 * @brief De-register the rfcomm socket
3428 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3429 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3430 * descriptor else no event will come. We will call this API only after the
3431 * bluetooth_rfcomm_listen_and_accept_ex.
3432 * This is a synchronous call.
3434 * @return BLUETOOTH_ERROR_NONE - Success \n
3435 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3436 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3437 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3438 * @param[in] UUID (128 bits)
3441 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3444 void bt_event_callback(int event, bluetooth_event_param_t *param)
3448 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3450 bluetooth_rfcomm_connection_t *discon_ind =
3451 (bluetooth_rfcomm_connection_t *)param->param_data;
3453 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3461 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3462 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3464 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3467 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3470 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3471 * @brief Disconnect rfcomm connection
3474 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3475 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3478 * @return BLUETOOTH_ERROR_NONE - Success \n
3479 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3480 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3481 * @param[in] int socket_fd the sending socket fd
3487 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3489 printf("Disconnection failed");
3491 printf("Disconnection Success");
3495 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3498 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3499 * @brief Rfcomm socket listen
3502 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3503 * after the bluetooth_rfcomm_create_socket API.
3504 * This API listen for the incomming connection and once it receives a connection, it will give
3505 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3506 * event to the application. This is an Asynchronous API call.
3509 * @return BLUETOOTH_ERROR_NONE - Success \n
3510 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3511 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3513 * @param[in] int socket_fd
3514 * @param[in] max pending connection.
3517 * @see bluetooth_rfcomm_create_socket
3520 void bt_event_callback(int event, bluetooth_event_param_t* param)
3524 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3526 bluetooth_rfcomm_connection_t *conn_ind =
3527 (bluetooth_rfcomm_connection_t *)param->param_data;
3529 printf("\nConnected from FD %d", conn_ind->socket_fd);
3537 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3538 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3542 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3545 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3546 * @brief Rfcomm socket listen
3549 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3550 * after the bluetooth_rfcomm_create_socket API.
3551 * This API listen for the incomming connection and once it receives a connection, it will give
3552 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3553 * event to the application. This is an Asynchronous API call.
3556 * @return BLUETOOTH_ERROR_NONE - Success \n
3557 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3558 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3560 * @param[in] int socket_fd
3561 * @param[in] max pending connection.
3566 * @see bluetooth_rfcomm_create_socket_ex
3569 void bt_event_callback(int event, bluetooth_event_param_t* param)
3573 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3575 bluetooth_rfcomm_connection_t *conn_ind =
3576 (bluetooth_rfcomm_connection_t *)param->param_data;
3578 printf("\nConnected from FD %d", conn_ind->socket_fd);
3586 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3587 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3592 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3595 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3596 * @brief Rfcomm socket listen
3599 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3600 * after the bluetooth_rfcomm_create_socket API.
3601 * This API listen for the incomming connection and once it receives a connection, it will give
3602 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3603 * event to the application. This is an Asynchronous API call.
3606 * @return BLUETOOTH_ERROR_NONE - Success \n
3607 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3608 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3610 * @param[in] int socket_fd
3611 * @param[in] max pending connection.
3614 * @see bluetooth_rfcomm_create_socket
3617 void bt_event_callback(int event, bluetooth_event_param_t* param)
3621 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3623 char *name = (char *)param->param_data;
3625 printf("\nConnected from %s", name);
3627 bluetooth_rfcomm_accept_connection();
3635 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3636 ret = bluetooth_rfcomm_listen(fd, 1);
3640 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3643 * @fn int bluetooth_rfcomm_accept_connection()
3644 * @brief Accepts the authorization request indicated by the event
3645 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3647 * This function is a synchronous call.
3649 * @return BLUETOOTH_ERROR_NONE - Success \n
3650 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3652 * @param[in] the socket fd of the server
3653 * @param[out] the socket fd of the client
3657 * @see bluetooth_rfcomm_reject_connection
3659 int bluetooth_rfcomm_accept_connection(int server_fd);
3662 * @fn int bluetooth_rfcomm_reject_connection()
3663 * @brief Rejects the authorization request indicated by the event
3664 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3666 * This function is a synchronous call.
3668 * @return BLUETOOTH_ERROR_NONE - Success \n
3669 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3671 * @param[in] the socket fd of the server
3675 * @see bluetooth_rfcomm_accept_connection
3677 int bluetooth_rfcomm_reject_connection(int server_fd);
3680 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3681 * @brief Informs whether rfcomm server uuid is available or not.
3683 * This function is a synchronous call.
3685 * @return TRUE - RFCOMM uuid is available \n
3686 * FALSE - RFCOMM uuid is not available \n
3688 * @param[in] uuid UUID string
3694 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3697 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3698 * const char *remote_uuid)
3699 * @brief Connect to the remote device rfcomm *
3701 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3702 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3703 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3704 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3705 * initiating a connection.
3707 * @return BLUETOOTH_ERROR_NONE - Success \n
3708 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3709 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3710 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3711 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3712 * @param[in] bluetooth_device_address_t remote bt_address
3713 * @param[in] char remote uuid
3715 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3719 void bt_event_callback(int event, bluetooth_event_param_t *param)
3723 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3725 if (param->result >= BLUETOOTH_ERROR_NONE)
3727 bt_sdp_info_t *bt_sdp_info=param->param_data;
3729 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3730 bt_sdp_info->device_addr.addr[0],
3731 bt_sdp_info->device_addr.addr[1],
3732 bt_sdp_info->device_addr.addr[2],
3733 bt_sdp_info->device_addr.addr[3],
3734 bt_sdp_info->device_addr.addr[4],
3735 bt_sdp_info->device_addr.addr[5]);
3737 printf("Supported service list:\n");
3738 for(i=0; i<bt_sdp_info->service_index; i++)
3740 bt_sdp_info->service_list_array[i]);
3743 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3744 //rfcomm_test_uuid);
3748 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3750 bluetooth_rfcomm_connection_t *conn_ind =
3751 (bluetooth_rfcomm_connection_t *)param->param_data;
3753 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
3754 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3755 "SERVER" : "CLIENT");
3760 bluetooth_device_address_t remote_address = {{0},};
3761 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3762 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
3763 ret = bluetooth_search_service(&remote_address);
3765 printf("Seach failed, Reason = %d", ret);
3767 printf("Search Success, Ret = %d", ret);
3769 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3771 printf("Connection failed, Reason = %d", ret);
3773 printf("Connection Success, Ret = %d", ret);
3777 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3778 const char *remote_uuid);
3781 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3782 * @brief Disconnect rfcomm connection
3785 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3786 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3789 * @return BLUETOOTH_ERROR_NONE - Success \n
3790 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3791 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3792 * @param[in] char remote bt_address
3795 * @see bluetooth_rfcomm_connect
3799 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3801 printf("Disconnection failed");
3803 printf("Disconnection Success");
3808 int bluetooth_rfcomm_disconnect(int socket_fd);
3811 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3812 * @brief Write to rfcomm connection
3815 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3816 * API is used to send the data for server and the client.
3818 * @return BLUETOOTH_ERROR_NONE - Success \n
3819 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3820 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3822 * @param[in] const char *buff Data buffer to send
3823 * @param[in] int length Length of the data
3826 * @see bluetooth_rfcomm_connect
3829 char *buff = "Test data 123456789"
3830 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
3832 printf("Send failed");
3834 printf("Send success");
3838 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
3841 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
3842 * @brief Informs whether rfcomm client is connected.
3844 * This function is a synchronous call.
3846 * @return TRUE - RFCOMM client is connected \n
3847 * FALSE - RFCOMM client is not connected \n
3853 gboolean bluetooth_rfcomm_is_client_connected(void);
3854 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3855 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3858 * @fn int bluetooth_network_activate_server(void)
3859 * @brief Activate the NAP (Network Access Point) service
3861 * This function is a asynchronous call.
3862 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
3864 * @return BLUETOOTH_ERROR_NONE - Success \n
3865 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3866 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3867 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3870 * @see bluetooth_network_deactivate_server
3873 int bluetooth_network_activate_server(void);
3876 * @fn int bluetooth_network_deactivate_server(void)
3877 * @brief Deactivate the NAP (Network Access Point) service
3879 * This function is a asynchronous call.
3880 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
3882 * @return BLUETOOTH_ERROR_NONE - Success \n
3883 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3884 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3885 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3888 * @see bluetooth_network_activate_server
3891 int bluetooth_network_deactivate_server(void);
3894 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3895 * bluetooth_network_role_t role,
3897 * @brief Connect the network server in the peer
3899 * This function is a asynchronous call.
3900 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3902 * @return BLUETOOTH_ERROR_NONE - Success \n
3903 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3904 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3905 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3908 * @param[in] device_address This indicates an address of the device with which the pairing
3909 * should be initiated
3910 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
3911 * need to use the third parameter.
3912 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
3913 * connect. UUID string
3915 * @see bluetooth_network_disconnect
3917 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3918 bluetooth_network_role_t role, char *custom_uuid);
3921 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
3922 * bluetooth_network_role_t role,
3923 * char *custom_uuid)
3924 * @brief Connect the network server in the peer
3926 * This function is a asynchronous call.
3927 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3929 * @return BLUETOOTH_ERROR_NONE - Success \n
3930 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3931 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3932 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3935 * @param[in] device_address This indicates an address of the device with which the pairing
3936 * should be initiated
3938 * @see bluetooth_network_connect
3940 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
3943 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
3944 * @brief Disconnect the device from the network
3946 * This function is an asynchronous call.
3947 * The network server disconnect request is responded by
3948 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
3950 * @return BLUETOOTH_ERROR_NONE - Success \n
3951 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3952 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3953 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3956 * @param[in] device_address This indicates an address of the connected client device
3958 * @see bluetooth_network_activate_server
3960 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
3965 * @fn int bluetooth_hdp_activate(unsigned short data_type,
3966 * bt_hdp_role_type_t role,
3967 * bt_hdp_qos_type_t channel_type,
3968 * char **app_handle)
3969 * @brief Activate the HDP service for a particular data type
3971 * This function is a synchronous call.
3973 * @return BLUETOOTH_ERROR_NONE - Success \n
3974 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3975 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3976 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3979 * @param[in] data_type The data type against corresponding service
3980 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
3981 * @param[in] channel_type The QOS type for the channel.
3982 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
3983 * For role = HDP_ROLE_SINK, the channel_type
3984 * should be HDP_QOS_ANY.
3985 * @param[out] app_handle The application handler against corresponding service
3987 * @see bluetooth_hdp_deactivate
3989 int bluetooth_hdp_activate(unsigned short data_type,
3990 bt_hdp_role_type_t role,
3991 bt_hdp_qos_type_t channel_type,
3994 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
3995 * @brief Deactivate the HDP service for a particular service using the handler
3997 * This function is a synchronous call.
3999 * @return BLUETOOTH_ERROR_NONE - Success \n
4000 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4001 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4002 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4005 * @param[in] app_handle The application handler against corresponding service
4007 * @see bluetooth_hdp_deactivate
4009 int bluetooth_hdp_deactivate(const char *app_handle);
4012 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4013 * const char *buffer, unsigned int size)
4014 * @brief Send data to the remote HDP device
4016 * This function is a synchronous call.
4018 * @return BLUETOOTH_ERROR_NONE - Success \n
4019 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4020 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4021 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4022 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4025 * @param[in] channel_id The channel id for the connection.
4026 * @param[in] buffer The pdu buffer.
4027 * @param[in] size Size of the buffer.
4029 * @see bluetooth_hdp_connect
4031 int bluetooth_hdp_send_data(unsigned int channel_id,
4032 const char *buffer, unsigned int size);
4034 * @fn int bluetooth_hdp_connect(const char *app_handle,
4035 * bt_hdp_qos_type_t channel_type,
4036 * const bluetooth_device_address_t *device_address)
4037 * @brief Connect to the remote device(Mainly used by source)
4039 * This function is a asynchronous call.
4040 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4042 * @return BLUETOOTH_ERROR_NONE - Success \n
4043 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4044 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4045 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4046 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4049 * @param[in] app_handle The application handler against corresponding service
4050 * @param[in] channel_type The QOS type for the channel.
4051 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4052 * @param[in] device_address The remote device Bd address.
4055 * @see bluetooth_hdp_disconnect
4057 int bluetooth_hdp_connect(const char *app_handle,
4058 bt_hdp_qos_type_t channel_type,
4059 const bluetooth_device_address_t *device_address);
4061 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4062 * const bluetooth_device_address_t *device_address)
4063 * @brief Disconnect from the remote device(Mainly used by source)
4065 * This function is a asynchronous call.
4066 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4068 * @return BLUETOOTH_ERROR_NONE - Success \n
4069 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4070 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4071 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4072 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4075 * @param[in] channel_id The channel id for the connection.
4076 * @param[in] device_address The remote device Bd address.
4079 * @see bluetooth_hdp_connect
4081 int bluetooth_hdp_disconnect(unsigned int channel_id,
4082 const bluetooth_device_address_t *device_address);
4086 * @fn int bluetooth_opc_init(void)
4087 * @brief Initialize OPP client.
4089 * This function is a synchronous call.
4090 * No event corresponding to this api
4092 * @return BLUETOOTH_ERROR_NONE - Success \n
4093 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4094 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4095 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4096 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4101 * @see bluetooth_opc_deinit
4103 int bluetooth_opc_init(void);
4106 * @fn int bluetooth_opc_deinit(void)
4107 * @brief Deinitialize OPP client.
4109 * This function is a synchronous call.
4110 * No event corresponding to this api
4112 * @return BLUETOOTH_ERROR_NONE - Success \n
4113 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4114 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4119 * @see bluetooth_opc_init
4122 int bluetooth_opc_deinit(void);
4125 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4126 char **file_name_array)
4127 * @brief Send multiple files to a remote device.
4129 * This function is a asynchronous call.
4130 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4132 * @return BLUETOOTH_ERROR_NONE - Success \n
4133 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4134 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4135 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4136 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4137 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4138 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4141 * @param[in] device_address The remote device Bd address.
4142 * @param[in] file_name_array Array of filepaths to be sent.
4145 * @see bluetooth_opc_cancel_push
4148 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4149 char **file_name_array);
4152 * @fn int bluetooth_opc_cancel_push(void)
4153 * @brief Cancels the ongoing file push.
4155 * This function is a asynchronous call.
4156 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4157 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4159 * @return BLUETOOTH_ERROR_NONE - Success \n
4160 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4161 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4166 * @see bluetooth_opc_push_files
4169 int bluetooth_opc_cancel_push(void);
4172 * @fn gboolean bluetooth_opc_session_is_exist(void)
4173 * @brief Informs whether opc session exists or not.
4175 * This function is a synchronous call.
4177 * @return TRUE - OPC session exists \n
4178 * FALSE - OPC session does not exist \n
4186 gboolean bluetooth_opc_session_is_exist(void);
4189 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4190 * @brief Informs whether opc session exists or not.
4192 * This function is a synchronous call.
4194 * @return BLUETOOTH_ERROR_NONE - Success \n
4195 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4196 * BLUETOOTH_ERROR_INTERNAL \n
4199 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4204 int bluetooth_opc_is_sending(gboolean *is_sending);
4207 * @fn int bluetooth_obex_server_init(const char *dst_path)
4208 * @brief Initialize OPP and FTP server.
4210 * This function is a synchronous call.
4211 * No event corresponding to this api
4213 * @return BLUETOOTH_ERROR_NONE - Success \n
4214 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4215 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4216 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4217 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4220 * @param[in] dst_path OPS destination file path.
4222 * @see bluetooth_obex_server_deinit
4224 int bluetooth_obex_server_init(const char *dst_path);
4228 * @fn int bluetooth_obex_server_deinit(void)
4229 * @brief Deinitialize OPP and FTP server.
4231 * This function is a synchronous call.
4232 * No event corresponding to this api
4234 * @return BLUETOOTH_ERROR_NONE - Success \n
4235 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4236 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4241 * @see bluetooth_obex_server_init
4243 int bluetooth_obex_server_deinit(void);
4247 * @fn gboolean bluetooth_obex_server_is_activated(void)
4248 * @brief Informs whether obex server is activated or not.
4250 * This function is a synchronous call.
4252 * @return TRUE - OBEX server is activated \n
4253 * FALSE - OBEX server is not activated \n
4260 gboolean bluetooth_obex_server_is_activated(void);
4264 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4265 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4267 * This function is a synchronous call.
4268 * No event corresponding to this api
4270 * @return BLUETOOTH_ERROR_NONE - Success \n
4271 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4272 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4273 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4274 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4278 * @param[in] dst_path OPS destination file path.
4280 * @see bluetooth_obex_server_deinit_without_agent
4282 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4286 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4287 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4289 * This function is a synchronous call.
4290 * No event corresponding to this api
4292 * @return BLUETOOTH_ERROR_NONE - Success \n
4293 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4294 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4299 * @see bluetooth_obex_server_init_without_agent
4301 int bluetooth_obex_server_deinit_without_agent(void);
4305 * @fn int bluetooth_obex_server_accept_connection(void)
4306 * @brief Accepts the authorization request indicated by the event
4307 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4309 * This function is a synchronous call.
4311 * @return BLUETOOTH_ERROR_NONE - Success \n
4312 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4313 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4317 * @see bluetooth_obex_server_reject_authorize
4319 int bluetooth_obex_server_accept_connection(void);
4323 * @fn int bluetooth_obex_server_reject_connection(void)
4324 * @brief Rejects the authorization request indicated by the event
4325 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4327 * This function is a synchronous call.
4329 * @return BLUETOOTH_ERROR_NONE - Success \n
4330 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4331 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4335 * @see bluetooth_obex_server_reject_authorize
4337 int bluetooth_obex_server_reject_connection(void);
4341 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4342 * @brief Accepts the authorization request indicated by the event
4343 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4345 * This function is a asynchronous call.
4346 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4348 * @return BLUETOOTH_ERROR_NONE - Success \n
4349 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4350 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4351 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4354 * @param[in] filename Authorized filename.
4357 * @see bluetooth_obex_server_reject_authorize
4360 int bluetooth_obex_server_accept_authorize(const char *filename);
4363 * @fn int bluetooth_obex_server_reject_authorize(void)
4364 * @brief Reject the authorization request indicated by the event
4365 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4367 * This function is a asynchronous call.
4368 * No event for this api..
4370 * @return BLUETOOTH_ERROR_NONE - Success \n
4371 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4372 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4377 * @see bluetooth_obex_server_accept_authorize
4380 int bluetooth_obex_server_reject_authorize(void);
4383 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4384 * @brief Set the OPS destination file path..
4386 * This function is a asynchronous call.
4387 * No event for this api..
4389 * @return BLUETOOTH_ERROR_NONE - Success \n
4390 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4391 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4392 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4395 * @param[in] dst_path OPS destination file path.
4401 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4404 * @fn int bluetooth_obex_server_set_root(const char *root)
4405 * @brief Set the FTS root folder..
4407 * This function is a asynchronous call.
4408 * No event for this api..
4410 * @return BLUETOOTH_ERROR_NONE - Success \n
4411 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4412 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4413 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4414 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4415 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4418 * @param[in] root FTS root folder.
4424 int bluetooth_obex_server_set_root(const char *root);
4427 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4428 * @brief Cancel the transfer on server
4430 * This function is an asynchronous call.
4431 * If the function call that cancels transfer is successful, the application would receive
4432 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4433 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4434 * the error code will be BLUETOOTH_ERROR_NONE
4436 * @return BLUETOOTH_ERROR_NONE - Success \n
4437 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4438 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4439 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4440 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4443 * @param[in] transfer_id transfer ID
4448 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4452 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4453 * @brief Cancel the transfer on server
4455 * This function is an asynchronous call.
4456 * If the function call that cancels transfer is successful, the application would receive
4457 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4458 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4459 * the error code will be BLUETOOTH_ERROR_NONE
4461 * @return BLUETOOTH_ERROR_NONE - Success \n
4462 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4463 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4464 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4465 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4472 int bluetooth_obex_server_cancel_all_transfers(void);
4476 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4477 * @brief Informs whether obex server is receiving or not.
4479 * This function is a synchronous call.
4481 * @return BLUETOOTH_ERROR_NONE - Success \n
4482 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4483 * BLUETOOTH_ERROR_INTERNAL \n
4486 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4491 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4495 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4496 * @brief Read the local Hash and Randmizer.
4498 * This function is a synchronous call.
4500 * @return BLUETOOTH_ERROR_NONE - Success \n
4501 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4505 * @param[out] local_oob_data - Pointer to the local OOB data
4511 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4515 * @fn int bluetooth_oob_add_remote_data(
4516 * const bluetooth_device_address_t *remote_device_address,
4517 * bt_oob_data_t *oob_data)
4518 * @brief Add/updated the remote device Hash and Randmizer.
4520 * This function is a synchronous call.
4521 * No event for this api..
4523 * @return BLUETOOTH_ERROR_NONE - Success \n
4524 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4527 * @param[in] remote_device_address - Remote device address
4528 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4534 int bluetooth_oob_add_remote_data(
4535 const bluetooth_device_address_t *remote_device_address,
4536 bt_oob_data_t *remote_oob_data);
4540 * @fn int bluetooth_oob_remove_remote_data(
4541 * const bluetooth_device_address_t *remote_device_address)
4542 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4544 * This function is a synchronous call.
4545 * No event for this api..
4547 * @return BLUETOOTH_ERROR_NONE - Success \n
4548 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4551 * @param[in] remote_device_address - Remote device address
4557 int bluetooth_oob_remove_remote_data(
4558 const bluetooth_device_address_t *remote_device_address);
4561 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4562 * bt_gatt_handle_info_t *prim_svc);
4564 * @brief Gets the GATT based primary services handle supported by remote device
4566 * This function is a synchronous call.
4567 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4569 * @return BLUETOOTH_ERROR_NONE - Success \n
4570 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4571 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4572 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4575 * @param[in] address - Remote device address
4576 * @param[out] prim_svc - Structure containing remote service count and handle list.
4579 * @see bluetooth_gatt_free_primary_services()
4581 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4582 bt_gatt_handle_info_t *prim_svc);
4585 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4587 * @brief Discovers the characteristics of GATT based service of remote device
4589 * This function is an asynchronous call.
4590 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4592 * @return BLUETOOTH_ERROR_NONE - Success \n
4593 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4594 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4595 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4598 * @param[in] service_handle - Handle for remote service.
4603 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4606 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4607 * bt_gatt_service_property_t *service);
4609 * @brief Gets the properties of GATT based service of remote device
4611 * This function is a synchronous call.
4612 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4614 * @return BLUETOOTH_ERROR_NONE - Success \n
4615 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4616 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4617 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4620 * @param[in] service_handle - Handle for remote service.
4621 * @param[out] service - Structure containing remote service property.
4624 * @see bluetooth_gatt_free_service_property()
4626 int bluetooth_gatt_get_service_property(const char *service_handle,
4627 bt_gatt_service_property_t *service);
4630 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4632 * @brief Register to GATT based service to receive value change notification/indication.
4634 * This function is a synchronous call.
4635 * No event for this api.
4637 * @return BLUETOOTH_ERROR_NONE - Success \n
4638 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4639 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4640 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4643 * @param[in] service_handle - Handle for remote service.
4648 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4651 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4653 * @brief Unregister GATT based service to receive value change notification/indication.
4655 * This function is a synchronous call.
4656 * No event for this api.
4658 * @return BLUETOOTH_ERROR_NONE - Success \n
4659 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4660 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4661 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4664 * @param[in] service_handle - Handle for remote service.
4669 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4672 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4673 * bt_gatt_char_property_t *characteristic);
4675 * @brief Provides characteristic value along with properties.
4677 * This function is a synchronous call.
4678 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4680 * @return BLUETOOTH_ERROR_NONE - Success \n
4681 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4682 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4683 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4686 * @param[in] char_handle - Handle for Characteristic property.
4687 * @param[out] characteristic - Structure containing remote characteristic property.
4690 * @see bluetooth_gatt_free_char_property()
4692 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4693 bt_gatt_char_property_t *characteristic);
4696 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4697 * bt_gatt_char_property_t *characteristic);
4699 * @brief Provides characteristic descriptor value along with its UUID.
4701 * This function is a synchronous call.
4702 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4704 * @return BLUETOOTH_ERROR_NONE - Success \n
4705 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4706 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4707 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4710 * @param[in] desc_handle - Handle for Characteristic descriptor.
4711 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4714 * @see bluetooth_gatt_free_desc_property()
4716 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4717 bt_gatt_char_descriptor_property_t *descriptor);
4721 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4722 * const guint8 *value, int length)
4724 * @brief Set characteristic value.
4726 * This function is a synchronous call.
4728 * @return BLUETOOTH_ERROR_NONE - Success \n
4729 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4730 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4731 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4734 * @param[in] char_handle - Handle for Characteristic property.
4735 * @param[in] value - New value to set for characteristic property.
4736 * @param[in] length - Length of the value to be set.
4741 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4742 const guint8 *value, int length);
4745 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4746 * const guint8 *value, int length, guint8 write_type)
4748 * @brief Set characteristic value by write type.
4750 * This function is a synchronous call if write type is "write without resonse"
4751 * and it is an asynchronous call if write type is "write with response"
4753 * @return BLUETOOTH_ERROR_NONE - Success \n
4754 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4755 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4756 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4759 * @param[in] char_handle - Handle for Characteristic property.
4760 * @param[in] value - New value to set for characteristic property.
4761 * @param[in] length - Length of the value to be set.
4762 * @param[in] write_type - Type of write.
4767 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4768 const guint8 *value, int length, guint8 write_type);
4772 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4773 * const guint8 *value, int length)
4775 * @brief Set characteristic value request.
4777 * This function is an asynchronous call.
4779 * @return BLUETOOTH_ERROR_NONE - Success \n
4780 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4781 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4782 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4785 * @param[in] char_handle - Handle for Characteristic property.
4786 * @param[in] value - New value to set for characteristic property.
4787 * @param[in] length - Length of the value to be set.
4792 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4793 const guint8 *value, int length);
4796 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4798 * @brief Read characteristic value.
4800 * This function is a asynchronous call.
4802 * @return BLUETOOTH_ERROR_NONE - Success \n
4803 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4804 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4805 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4808 * @param[in] char_handle - Handle for Characteristic property.
4813 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
4816 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4817 * const char *service_uuid,
4818 * bt_gatt_service_property_t *service)
4820 * @brief Gets the service property from a device based on a particular uuid
4822 * This function is a synchronous call.
4824 * @return BLUETOOTH_ERROR_NONE - Success \n
4825 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4826 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4827 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4830 * @param[in] address - BD address of the remote device
4831 * @param[in] service_uuid - uuid of the service.
4832 * @param[out] service - Structure containing the service property.
4837 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4838 const char *service_uuid,
4839 bt_gatt_service_property_t *service);
4842 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4843 * const char *char_uuid)
4845 * @brief Gets the characteristic property from a service based on a particular char uuid
4847 * This function is an asynchronous call.
4848 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
4850 * @return BLUETOOTH_ERROR_NONE - Success \n
4851 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4852 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4853 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4856 * @param[in] service_handle - Service handle.
4857 * @param[in] uuid - Characteristic uuid.
4862 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4863 const char *char_uuid);
4866 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4868 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
4870 * This function is a synchronous call.
4871 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
4873 * @return BLUETOOTH_ERROR_NONE - Success \n
4874 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4877 * @param[in] prim_svc - GATT handle info structure
4880 * @see bluetooth_gatt_get_primary_services()
4882 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4885 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4887 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
4889 * This function is a synchronous call.
4890 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
4892 * @return BLUETOOTH_ERROR_NONE - Success \n
4893 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4896 * @param[in] svc_pty - GATT service property structure.
4899 * @see bluetooth_gatt_get_service_property()
4901 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4904 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4906 * @brief Provides characteristic value along with properties.
4908 * This function is a synchronous call.
4909 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4911 * @return BLUETOOTH_ERROR_NONE - Success \n
4912 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4915 * @param[in] char_pty - GATT characteristics property structure.
4918 * @see bluetooth_gatt_get_characteristics_property()
4920 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4923 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4925 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
4927 * This function is a synchronous call.
4928 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
4930 * @return BLUETOOTH_ERROR_NONE - Success \n
4931 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4934 * @param[in] desc_pty - GATT characteristics descriptor property structure.
4937 * @see bluetooth_gatt_get_char_descriptor_property()
4939 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4942 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
4944 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
4947 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4949 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
4951 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4953 * @return BLUETOOTH_ERROR_NONE - Success \n
4954 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4957 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
4961 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4964 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
4966 * @brief Read characteristic descriptor value.
4968 * This function is a asynchronous call.
4970 * @return BLUETOOTH_ERROR_NONE - Success \n
4971 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4972 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4973 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4976 * @param[in] desc_handle - Handle for Characteristic descriptor
4981 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
4984 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4985 * const guint8 *value, int length);
4987 * @brief Set characteristic descriptor value.
4989 * This function is a asynchronous call.
4991 * @return BLUETOOTH_ERROR_NONE - Success \n
4992 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4993 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4994 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4997 * @param[in] desc_handle - Handle for Characteristic descriptor
4998 * @param[in] value - New value to set for characteristic descriptor
4999 * @param[in] length - Length of the value to be set.
5004 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5005 const guint8 *value, int length);
5007 /* @fn int bluetooth_gatt_init(void)
5009 * @brief Initializes the gatt service.
5011 * This function is a synchronous call.
5012 * @return BLUETOOTH_ERROR_NONE - Success \n
5013 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5014 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5015 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5018 * @remark Adapter should be enabled
5019 * @see bluetooth_gatt_deinit()
5021 int bluetooth_gatt_init(void);
5023 /* @fn int bluetooth_gatt_init(void)
5025 * @brief DeInitializes the gatt service.
5027 * This function is a synchronous call.
5028 * @return BLUETOOTH_ERROR_NONE - Success \n
5029 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5030 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5031 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5034 * @remark Adapter should be enabled
5035 * @see bluetooth_gatt_init()
5037 int bluetooth_gatt_deinit(void);
5039 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5040 unsigned char **svc_path)
5042 * @brief Exports a new gatt service to the service interface.
5044 * This function is a synchronous call.
5046 * @return BLUETOOTH_ERROR_NONE - Success \n
5047 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5048 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5049 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5052 * @param[in] svc_uuid Gatt service uuid.
5053 * @param[out] svc_path service object path of the exported service.
5054 * @remark Adapter should be enabled
5055 * @see bluetooth_gatt_init()
5057 int bluetooth_gatt_add_service(const char *svc_uuid,
5060 /* @fn int bluetooth_gatt_add_new_characteristic(
5061 const char *svc_path, const char *char_uuid,
5062 bt_gatt_permission_t permissions,
5063 bt_gatt_characteristic_property_t properties,
5064 int flags_length, char **char_path);;
5066 * @brief Exports a new gatt characteristic to the characteristic interface.
5068 * This function is a synchronous call.
5069 * @return BLUETOOTH_ERROR_NONE - Success \n
5070 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5071 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5072 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5074 * @param[in] svc_path service object path of the exported service.
5075 * @param[in] char_uuid Gatt service uuid.
5076 * @param[in] properties GATT characteristic properties.
5077 * @param[out] char_path characteristic object path of the exported characteristic.
5079 * @remark Adapter should be enabled
5080 * @see bluetooth_gatt_add_service()
5082 int bluetooth_gatt_add_new_characteristic(
5083 const char *svc_path, const char *char_uuid,
5084 bt_gatt_permission_t permissions,
5085 bt_gatt_characteristic_property_t properties,
5088 /* @fn bluetooth_gatt_set_characteristic_value(
5089 const char *characteristic, const char *char_value,
5092 * @brief adds gatt charactertisic value to the given charactertistic path.
5094 * This function is a synchronous call.
5095 * @return BLUETOOTH_ERROR_NONE - Success \n
5096 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5097 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5098 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5100 * @param[in] char_value Value of the GATT characteristic to be added.
5101 * @param[in] value_length length of the chantacteristic value..
5102 * @param[out] characteristic characteristic object path..
5104 * @remark Adapter should be enabled
5105 * @see bluetooth_gatt_add_service()
5107 int bluetooth_gatt_set_characteristic_value(
5108 const char *characteristic, const char *char_value,
5111 /* @fn int bluetooth_gatt_add_descriptor(
5112 const char *char_path, const char *desc_uuid,
5113 bt_gatt_permission_t permissions,
5116 * @brief Exports a new gatt descriptor to the descriptor interface.
5118 * This function is a synchronous call.
5120 * @return BLUETOOTH_ERROR_NONE - Success \n
5121 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5122 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5123 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5126 * @param[in] desc_uuid Gatt descriptor uuid.
5127 * @param[in] desc_value GATT descriptor value.
5128 * @param[in] value_length Length of GATT descriptor value.
5129 * @param[in] permissions descriptor permissions.
5130 * @param[in] properties GATT descriptor properties.
5131 * @param[in] char_path characteristics object path of the exported character.
5133 * @remark Adapter should be enabled
5134 * @see bluetooth_gatt_add_service()
5135 * @see bluetooth_gatt_add_characteristics()
5137 int bluetooth_gatt_add_descriptor(
5138 const char *char_path, const char *desc_uuid,
5139 bt_gatt_permission_t permissions,
5142 /* @fn int bluetooth_gatt_set_descriptor_value(
5143 const char *desc_path, const char *desc_value,
5146 * @brief Adds value to the given descriptor handle.
5148 * This function is a synchronous call.
5150 * @return BLUETOOTH_ERROR_NONE - Success \n
5151 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5152 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5153 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5156 * @param[in] desc_value GATT descriptor value.
5157 * @param[in] value_length Length of GATT descriptor value.
5158 * @param[in] desc_path descriptor path to which the value needs to be added.
5160 * @remark Adapter should be enabled
5161 * @see bluetooth_gatt_add_service()
5162 * @see bluetooth_gatt_add_characteristics()
5164 int bluetooth_gatt_set_descriptor_value(
5165 const char *desc_path, const char *desc_value,
5168 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5170 * @brief Reads the Service registered on manager interface.
5172 * This function is a synchronous call.
5174 * @return BLUETOOTH_ERROR_NONE - Success \n
5175 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5176 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5177 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5180 * @param[in] svc_uuid Gatt Service uuid.
5182 * @remark Adapter should be enabled and service should be registered.
5183 * @see bluetooth_gatt_register_service()
5185 int bluetooth_gatt_get_service(const char *svc_uuid);
5187 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5189 * @brief Registers the given service path with the bluez gatt server.
5191 * This function is a synchronous call.
5193 * @return BLUETOOTH_ERROR_NONE - Success \n
5194 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5195 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5196 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5199 * @param[in] svc_path service object path of the exported service.
5201 * @remark Adapter should be enabled
5202 * @see bluetooth_gatt_add_service()
5203 * @see bluetooth_gatt_add_characteristics()
5204 * @see bluetooth_gatt_add_descriptor()
5205 * @see bluetooth_gatt_register_application()
5207 int bluetooth_gatt_register_service(const char *svc_path);
5209 /* @fn int bluetooth_gatt_register_application(void)
5211 * @brief Registers the application with the bluez gatt server.
5213 * This function is a synchronous call.
5215 * @return BLUETOOTH_ERROR_NONE - Success \n
5216 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5217 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5218 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5222 * @remark Adapter should be enabled
5223 * @see bluetooth_gatt_init()
5224 * @see bluetooth_gatt_add_service()
5225 * @see bluetooth_gatt_add_characteristics()
5226 * @see bluetooth_gatt_add_descriptor()
5227 * @see bluetooth_gatt_register_service()
5229 int bluetooth_gatt_register_application(void);
5231 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5233 * @brief Removes(unregister) service from the bluez gatt server db.
5235 * This function is a synchronous call.
5237 * @return BLUETOOTH_ERROR_NONE - Success \n
5238 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5239 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5240 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5243 * @param[in] svc_path service object path of the exported service.
5245 * @remark Adapter should be enabled
5246 * @see bluetooth_gatt_add_service()
5247 * @see bluetooth_gatt_add_characteristics()
5248 * @see bluetooth_gatt_add_descriptor()
5249 * @see bluetooth_gatt_register_service()
5251 int bluetooth_gatt_unregister_service(const char *svc_path);
5253 /* @fn int bluetooth_gatt_unregister_application(void)
5255 * @brief Removes(unregister) the application with the bluez gatt server,
5256 * and deletes all the service registered.
5258 * This function is a synchronous call.
5260 * @return BLUETOOTH_ERROR_NONE - Success \n
5261 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5262 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5263 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5267 * @remark Adapter should be enabled
5268 * @see bluetooth_gatt_init()
5269 * @see bluetooth_gatt_add_service()
5270 * @see bluetooth_gatt_add_characteristics()
5271 * @see bluetooth_gatt_add_descriptor()
5272 * @see bluetooth_gatt_register_service()
5273 * @see bluetooth_gatt_unregister_service()
5275 int bluetooth_gatt_unregister_application(void);
5277 /* @fn int bluetooth_gatt_send_response(int request_id,
5278 * int offset, char *value, int value_length)
5280 * @brief Updates the attribute value in local attribute list.
5282 * This function is a synchronous call.
5284 * @return BLUETOOTH_ERROR_NONE - Success \n
5285 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5286 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5287 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5290 * @param[in] request_id The identification of a read request
5291 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5292 * @param[in] resp_state The identification of response state
5293 * @param[in] offset The offset from where a value is read
5294 * @param[in] value The value to be sent. It will be sent from @a offset.
5295 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5296 * @param[in] value_length Value Length.
5298 * @remark Adapter should be enabled
5299 * @see bluetooth_gatt_add_service()
5300 * @see bluetooth_gatt_add_characteristics()
5301 * @see bluetooth_gatt_add_descriptor()
5302 * @see bluetooth_gatt_register_service()
5304 int bluetooth_gatt_send_response(int request_id, guint req_type,
5305 int resp_state, int offset, char *value, int value_length);
5307 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5309 * @brief Sets the notification property for a characteristic.
5311 * This function is a synchronous call.
5313 * @return BLUETOOTH_ERROR_NONE - Success \n
5314 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5315 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5316 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5319 * @param[in] char_path characteristic object path.
5320 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5322 * @remark Adapter should be enabled
5323 * @see bluetooth_gatt_update_characteristic()
5325 int bluetooth_gatt_server_set_notification(const char *char_path,
5326 bluetooth_device_address_t *unicast_address);
5328 /* @fn int bluetooth_gatt_delete_services(void)
5330 * @brief deletes (unregisters) all services from the gatt server database..
5332 * This function is a synchronous call.
5334 * @return BLUETOOTH_ERROR_NONE - Success \n
5335 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5336 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5337 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5341 * @remark Adapter should be enabled
5342 * @see bluetooth_gatt_add_service()
5343 * @see bluetooth_gatt_add_characteristics()
5344 * @see bluetooth_gatt_add_descriptor()
5345 * @see bluetooth_gatt_register_service()
5346 * @see bluetooth_gatt_unregister_service()
5348 int bluetooth_gatt_delete_services(void);
5350 /* @fn int bluetooth_gatt_update_characteristic(void)
5352 * @brief updates the given characteristic with a new value
5354 * This function is a synchronous call.
5356 * @return BLUETOOTH_ERROR_NONE - Success \n
5357 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5358 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5359 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5363 * @remark Adapter should be enabled
5364 * @see bluetooth_gatt_add_service()
5365 * @see bluetooth_gatt_add_characteristics()
5366 * @see bluetooth_gatt_add_descriptor()
5367 * @see bluetooth_gatt_register_service()
5368 * @see bluetooth_gatt_unregister_service()
5370 int bluetooth_gatt_update_characteristic(const char *char_path,
5371 const char* char_value, int value_length);
5374 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5376 * @brief Set advertising status.
5378 * This function is used to enable or disable LE advertising.
5379 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5381 * This function is a synchronous call.
5383 * @return BLUETOOTH_ERROR_NONE - Success \n
5384 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5385 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5388 * @param[in] enable - The status of advertising
5391 * @see bluetooth_set_advertising_data
5393 int bluetooth_set_advertising(int handle, gboolean enable);
5396 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5398 * @brief Set advertising status along with interval value.
5400 * This function is used to enable or disable LE advertising.
5401 * Interval_min and Interval_max is used to set the best advertising interval.
5402 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5404 * This function is a synchronous call.
5406 * @return BLUETOOTH_ERROR_NONE - Success \n
5407 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5408 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5411 * @param[in] enable - The status of advertising
5412 * @param[in] interval_min - Minimum interval of advertising (msec)
5413 * @param[in] interval_max - Maximum interval of advertising (msec)
5414 * @param[in] filter_policy - Advertising filter policy
5417 * @see bluetooth_set_advertising_data
5419 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5420 bluetooth_advertising_params_t *params);
5423 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5424 * @brief Get the advertising data
5426 * This function is used to get advertising data.
5427 * Before calling this API, the adapter should be enabled.
5429 * This function is a synchronous call.
5431 * @return BLUETOOTH_ERROR_NONE - Success \n
5432 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5433 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5434 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5436 * @param[out] value - Advertising data structure.
5437 * @param[out] length - The length of Advertising data.
5441 bluetooth_advertising_data_t *value = { {0} };
5444 ret = bluetooth_get_advertising_data(&value, &length);
5447 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5450 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5452 * @brief Set advertising data with value
5454 * This function is used to set advertising data and Maximum size of advertising data
5455 * is 28 byte (Except Flag)
5457 * This function is a synchronous call.
5459 * @return BLUETOOTH_ERROR_NONE - Success \n
5460 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5461 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5464 * @param[in] value - Advertising data structure.
5468 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5471 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5473 * @brief Check the privilege for advertising parameter setting
5475 * This function is a synchronous call.
5477 * @return BLUETOOTH_ERROR_NONE - Success \n
5478 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5484 int bluetooth_check_privilege_advertising_parameter(void);
5487 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5488 * @brief Get the LE scan response data
5490 * This function is used to get scan response data.
5491 * Before calling this API, the adapter should be enabled.
5493 * This function is a synchronous call.
5495 * @return BLUETOOTH_ERROR_NONE - Success \n
5496 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5497 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5498 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5500 * @param[out] value - Scan response data structure.
5501 * @param[out] length - The length of Scan response data.
5505 bluetooth_scan_resp_data_t *value = { {0} };
5508 ret = bluetooth_get_scan_response_data(&value, &length);
5511 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5514 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5516 * @brief Set scan response data with value
5518 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5520 * This function is a synchronous call.
5522 * @return BLUETOOTH_ERROR_NONE - Success \n
5523 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5524 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5527 * @param[in] value - LE Scan response data structure.
5531 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5534 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5536 * @brief Set scan interval and window
5538 * This function is used to set LE scan interval and window size
5540 * This function is a synchronous call.
5542 * @return BLUETOOTH_ERROR_NONE - Success \n
5543 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5544 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5547 * @param[in] interval - Interval of LE scan (msec)
5548 * @param[in] window - Window size of LE scan (msec)
5552 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5555 * @fn int bluetooth_is_advertising(void)
5556 * @brief Check for the advertising is in-progress or not.
5558 * This API is used to check the current status of the advertising procedure.
5559 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5562 * This function checks whether the advertising is started or not.
5564 * This function is a synchronous call.
5566 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5568 * @return BLUETOOTH_ERROR_NONE - Success \n
5569 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5572 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5576 gboolean is_advertising = 0;
5578 ret = bluetooth_is_advertising(&is_advertising);
5581 int bluetooth_is_advertising(gboolean *is_advertising);
5584 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5585 * @brief Add LE device to white list
5587 * This API is used to add LE device to white list
5588 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5592 * This function is a synchronous call.
5594 * @param[in] address The address of remote device
5596 * @return BLUETOOTH_ERROR_NONE - Success \n
5597 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5600 * @see bluetooth_set_custom_advertising
5602 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5605 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5606 * @brief Remove LE device from white list
5608 * This API is used to remove LE device from white list
5609 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5613 * This function is a synchronous call.
5615 * @param[in] address The address of remote device
5617 * @return BLUETOOTH_ERROR_NONE - Success \n
5618 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5621 * @see bluetooth_set_custom_advertising
5623 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5626 * @fn int bluetooth_clear_white_list(void)
5627 * @brief Clear white list
5629 * This API is used to clear white list
5630 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5634 * This function is a synchronous call.
5636 * @param[in] address The address of remote device
5638 * @return BLUETOOTH_ERROR_NONE - Success \n
5639 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5642 * @see bluetooth_set_custom_advertising
5644 int bluetooth_clear_white_list(void);
5647 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5648 * const bluetooth_le_connection_param_t *parameters)
5649 * @brief update connection paramter of LE connection.
5651 * This function is a synchronous call.
5653 * @return BLUETOOTH_ERROR_NONE - Success \n
5654 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5657 * @param[in] address - remote device address value.
5658 * @param[in] parameters - new connection parameters.
5661 * @see bluetooth_bond_device
5663 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5664 const bluetooth_le_connection_param_t *parameters);
5668 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5670 * @brief Enable/Disable LE Privacy feature.
5672 * This function is used to enable or disable LE Privacy feature.
5673 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
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_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5686 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5689 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
5690 * bluetooth_le_connection_mode_t mode)
5691 * @brief update connection paramter of LE connection.
5693 * This function is a synchronous call.
5695 * @return BLUETOOTH_ERROR_NONE - Success \n
5696 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5697 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5700 * @param[in] address - remote device address value.
5701 * @param[in] mode - new connection mode.
5705 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
5706 bluetooth_le_connection_mode_t mode);
5709 * @fn int bluetooth_le_read_maximum_data_length()
5710 * @brief reads the maximum LE data length supported in the controller.
5712 * This function is a synchronous call.
5714 * @return BLUETOOTH_ERROR_NONE - Success \n
5715 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5721 int bluetooth_le_read_maximum_data_length(
5722 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
5724 * @fn int bluetooth_le_write_host_suggested_default_data_length()
5725 * @brief writes the host suggested values for the controllers max transmitted no of payload
5726 * octects to be used for new connections.
5728 * This function is a synchronous call.
5730 * @return BLUETOOTH_ERROR_NONE - Success \n
5731 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5737 int bluetooth_le_write_host_suggested_default_data_length(
5738 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
5740 int bluetooth_le_read_suggested_default_data_length(
5741 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
5743 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
5744 const unsigned int max_tx_octets, const unsigned int max_tx_time);
5746 int bluetooth_pbap_init(void);
5747 int bluetooth_pbap_deinit(void);
5748 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
5749 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
5750 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
5751 bt_pbap_folder_t *folder);
5752 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
5753 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
5754 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
5755 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
5756 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
5757 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
5758 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
5759 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
5762 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5764 * @brief Set manufacturer data with value
5766 * This function is used to set manufacturer data.
5768 * This function is a synchronous call.
5770 * @return BLUETOOTH_ERROR_NONE - Success \n
5771 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5772 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5775 * @param[in] value - Manufacturer data structure.
5779 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5781 #ifdef TIZEN_DPM_VCONF_ENABLE
5783 * @fn int bluetooth_dpm_is_mode_allowed(void);
5785 * @brief Checks Restriction for BT mode(BT allowed or not)
5787 * This function is a synchronous call.
5789 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5790 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5791 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5798 int bluetooth_dpm_is_mode_allowed(void);
5802 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
5804 * @brief Sets Restriction for BT mode(BT allowed or not)
5806 * This function is a synchronous call.
5808 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5809 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5810 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5813 * @param[in] value - BT Allow value.
5814 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
5815 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
5816 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
5817 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
5821 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
5824 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
5826 * @brief Reads the Restriction for BT mode(BT allowed or not)
5828 * This function is a synchronous call.
5830 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5831 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5832 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5836 * @param[out] value - BT Allow value.
5837 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
5838 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
5839 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
5840 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
5844 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
5847 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
5849 * @brief Sets the Restriction for device.
5851 * This function is a synchronous call.
5853 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5854 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5855 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5858 * @param[in] value - State value.
5859 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5860 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5864 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
5867 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
5869 * @brief Reads the Restriction for device.
5871 * This function is a synchronous call.
5873 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5874 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5875 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5879 * @param[out] value - State value.
5880 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5881 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5885 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
5888 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
5890 * @brief Sets the Restriction for uuid.
5892 * This function is a synchronous call.
5894 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5895 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5896 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5899 * @param[in] value - State value.
5900 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5901 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5905 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
5908 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
5910 * @brief Reads the Restriction for uuid.
5912 * This function is a synchronous call.
5914 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5915 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5916 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5920 * @param[out] value - State value.
5921 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5922 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5926 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
5929 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
5931 * @brief Adds the device to blacklist.
5933 * This function is a synchronous call.
5935 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5936 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5937 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5940 * @param[in] device_address - Device address
5944 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
5947 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
5949 * @brief Adds the device to whitelist.
5951 * This function is a synchronous call.
5953 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5954 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5955 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5958 * @param[in] device_address - Device address
5962 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
5965 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
5967 * @brief Adds the Service UUIDS to blacklist.
5969 * This function is a synchronous call.
5971 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5972 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5973 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5976 * @param[in] service_uuids - profile or custom service uuids
5980 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
5983 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
5985 * @brief Adds the Service UUIDS to whitelist.
5987 * This function is a synchronous call.
5989 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5990 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5991 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5994 * @param[in] service_uuids - profile or custom service uuids
5998 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6001 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6003 * @brief Clears the devices from blacklist.
6005 * This function is a synchronous call.
6007 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6008 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6009 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6016 int bluetooth_dpm_clear_devices_from_blacklist(void);
6019 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6021 * @brief Clears the devices from whitelist.
6023 * This function is a synchronous call.
6025 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6026 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6027 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6034 int bluetooth_dpm_clear_devices_from_whitelist(void);
6037 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6039 * @brief Clears the uuids from blacklist.
6041 * This function is a synchronous call.
6043 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6044 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6045 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6052 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6055 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6057 * @brief Clears the uuids from whitelist.
6059 * This function is a synchronous call.
6061 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6062 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6063 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6070 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6073 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6075 * @brief reads the devices from blacklist.
6077 * This function is a synchronous call.
6079 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6080 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6081 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6084 * @param[out] device_list - list of devices
6088 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6091 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6093 * @brief reads the devices from whitelist.
6095 * This function is a synchronous call.
6097 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6098 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6099 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6102 * @param[out] device_list - list of devices
6106 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6109 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6111 * @brief reads the uuids from blacklist.
6113 * This function is a synchronous call.
6115 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6116 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6117 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6120 * @param[in] uuid_list - list of uuids
6124 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6127 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6129 * @brief reads the uuids from whitelist.
6131 * This function is a synchronous call.
6133 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6134 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6135 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6138 * @param[in] uuid_list - list of uuids
6142 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6145 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6147 * @brief Removes the device from whitelist.
6149 * This function is a synchronous call.
6151 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6152 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6153 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6156 * @param[in] device_address - Device address
6160 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6163 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6165 * @brief Removes the device from blacklist.
6167 * This function is a synchronous call.
6169 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6170 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6171 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6174 * @param[in] device_address - Device address
6178 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6181 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6183 * @brief Removes the Service UUIDS from whitelist.
6185 * This function is a synchronous call.
6187 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6188 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6189 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6192 * @param[in] service_uuids - profile or custom service uuids
6196 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6199 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6201 * @brief Removes the Service UUIDS from blacklist.
6203 * This function is a synchronous call.
6205 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6206 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6207 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6210 * @param[in] service_uuids - profile or custom service uuids
6214 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6217 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6219 * @brief Sets the Restriction for outgoing call.
6221 * This function is a synchronous call.
6223 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6224 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6225 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6228 * @param[in] value - State value.
6229 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6230 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6234 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6237 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6239 * @brief Reads the Restriction for outgoing call.
6241 * This function is a synchronous call.
6243 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6244 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6245 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6249 * @param[out] value - State value.
6250 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6251 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6255 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6258 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6260 * @brief Sets the Restriction for Pairing.
6262 * This function is a synchronous call.
6264 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6265 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6266 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6269 * @param[in] value - State value.
6270 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6271 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6275 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6278 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6280 * @brief Reads the Restriction for Pairing
6282 * This function is a synchronous call.
6284 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6285 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6286 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6290 * @param[out] value - State value.
6291 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6292 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6296 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6299 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6301 * @brief Sets the Restriction for using Profiles.
6303 * This function is a synchronous call.
6305 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6306 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6307 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6310 * @param[in]profile - Profile.
6311 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6312 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6313 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6314 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6315 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6316 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6317 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6318 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6319 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6320 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6321 * BLUETOOTH_DPM_PROFILE_NONE
6322 * @param[in] value - State value.
6323 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6324 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6328 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6331 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6333 * @brief Reads the Restriction for using Profiles.
6335 * This function is a synchronous call.
6337 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6338 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6339 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6342 * @param[in]profile - Profile.
6343 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6344 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6345 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6346 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6347 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6348 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6349 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6350 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6351 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6352 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6353 * BLUETOOTH_DPM_PROFILE_NONE
6354 * @param[out] value - State value.
6355 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6356 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6360 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6363 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6365 * @brief Sets the Restriction for Desktop Connectivity.
6367 * This function is a synchronous call.
6369 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6370 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6371 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6374 * @param[in] value - State value.
6375 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6376 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6380 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6383 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6385 * @brief Reads the Restriction for Desktop Connectivity.
6387 * This function is a synchronous call.
6389 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6390 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6391 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6395 * @param[out] value - State value.
6396 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6397 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6401 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6404 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6406 * @brief Sets the Restriction for Discoverable state.
6408 * This function is a synchronous call.
6410 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6411 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6412 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6415 * @param[in] value - State value.
6416 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6417 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6421 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6424 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6426 * @brief Reads the Restriction for Discoverable state.
6428 * This function is a synchronous call.
6430 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6431 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6432 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6436 * @param[out] value - State value.
6437 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6438 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6442 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6445 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6447 * @brief Sets the Restriction for linited discoverable state..
6449 * This function is a synchronous call.
6451 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6452 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6453 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6456 * @param[in] value - State value.
6457 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6458 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6462 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6465 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6467 * @brief Reads the Restriction for limited discoverable state.
6469 * This function is a synchronous call.
6471 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6472 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6473 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6477 * @param[out] value - State value.
6478 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6479 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6483 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6485 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6487 * @brief Sets the Restriction for Data trasnfer.
6489 * This function is a synchronous call.
6491 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6492 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6493 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6496 * @param[in] value - State value.
6497 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6498 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6502 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6506 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6508 * @brief Reads the Restriction for Data trasnfer.
6510 * This function is a synchronous call.
6512 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6513 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6514 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6518 * @param[out] value - State value.
6519 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6520 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6524 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6532 #endif /* __cplusplus */
6533 #endif /* _BLUETOOTH_API_H_*/