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 */
169 * Device disconnect reason
172 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
173 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
174 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
175 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
176 } bluetooth_device_disconnect_reason_t;
179 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
182 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
183 } bluetooth_device_address_t;
186 * This is Bluetooth device address type
190 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
191 BLUETOOTH_DEVICE_RANDOM_ADDRESS
192 } bluetooth_device_address_type_t;
195 * This is Bluetooth version
198 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
199 } bluetooth_version_t;
202 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
205 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
206 } bluetooth_device_name_t;
209 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
212 int data_len; /**< manafacturer specific data length */
213 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
214 } bluetooth_manufacturer_data_t;
217 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
218 } bluetooth_device_pin_code_t;
224 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
225 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
226 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
227 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
228 } bluetooth_adapter_state_t;
234 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
235 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
236 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
237 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
238 } bluetooth_adapter_le_state_t;
244 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
245 /*Changed the order to make it compatable with old method */
246 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
247 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
248 /**< Discoverable mode with time limit
249 After specific timeout, it is changed
250 to non discoverable mode */
251 } bluetooth_discoverable_mode_t;
254 * Network connect mode
257 BLUETOOTH_NETWORK_PANU_ROLE,
259 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
260 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
261 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
262 } bluetooth_network_role_t;
268 BLUETOOTH_RFCOMM_SERVICE = 0x01,
269 BLUETOOTH_A2DP_SERVICE = 0x02,
270 BLUETOOTH_HSP_SERVICE = 0x04,
271 BLUETOOTH_HID_SERVICE = 0x08,
272 BLUETOOTH_NAP_SERVICE = 0x10,
273 BLUETOOTH_HFG_SERVICE = 0x20,
274 BLUETOOTH_GATT_SERVICE = 0x40,
275 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
276 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
277 } bluetooth_service_type_t;
283 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, /* represents that connection
284 * type can both BR/EDR and LE */
285 BLUETOOTH_DEV_CONN_BREDR = 0x00,
286 BLUETOOTH_DEV_CONN_LE = 0x01,
287 } bluetooth_conn_type_t;
293 BLUETOOTH_CODEC_ID_CVSD = 0x01,
294 BLUETOOTH_CODEC_ID_MSBC = 0x02,
295 } bluetooth_codec_type_t;
301 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
302 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
303 } bluetooth_hf_audio_connected_type_t;
309 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
310 } bluetooth_advertising_data_t;
316 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
317 } bluetooth_scan_resp_data_t;
320 * Advertising filter policy
323 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
324 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
325 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
326 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
327 } bluetooth_advertising_filter_policy_t;
333 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
334 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
335 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
336 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
337 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
338 } bluetooth_advertising_type_t;
342 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
343 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
344 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
345 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
346 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
347 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
348 } 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_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
637 } bluetooth_event_type_t;
640 * This bt_service_uuid_list_t enum indicates service uuid list .
641 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
645 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
646 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
647 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
648 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
649 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
650 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
651 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
652 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
653 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
654 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
655 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
656 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
658 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
659 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
660 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
661 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
662 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
663 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
664 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
665 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
666 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
667 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
668 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
669 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
670 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
671 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
673 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
674 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
675 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
676 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
677 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
678 /**<DIRECT PRINTING*/
679 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
680 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
681 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
682 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
683 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
684 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
685 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
686 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
687 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
688 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
689 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
690 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
691 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
692 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
693 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
694 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
695 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
696 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
697 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
698 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
699 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
700 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
701 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
702 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
703 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
704 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
705 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
706 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
707 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
708 } bluetooth_service_uuid_list_t;
711 * Service class part of class of device returned from device discovery
714 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
715 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
716 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
717 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
718 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
719 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
720 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
721 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
722 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
723 } bluetooth_device_service_class_t;
727 * Major device mask (For device discovery)
730 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
731 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
732 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
733 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
734 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
735 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
736 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
737 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
738 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
739 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
740 } bluetooth_device_major_mask_t;
744 * Major device class (part of Class of Device)
747 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
748 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
749 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
750 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
751 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
752 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
753 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
754 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
755 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
756 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
757 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
758 } bluetooth_device_major_class_t;
761 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
763 /* About Computer Major class */
764 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
766 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
767 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
768 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
769 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
770 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
772 /* About Phone Major class */
773 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
774 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
775 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
776 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
777 /**< voice gateway minor class */
778 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
780 /* About LAN/Network Access Point Major class */
781 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
782 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
783 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
784 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
785 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
786 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
787 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
788 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
790 /* About Audio/Video Major class */
791 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
792 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
794 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
795 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
796 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
797 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
798 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
799 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
800 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
801 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
802 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
803 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
804 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
805 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
806 /**< Video Display and Loud
807 Speaker minor class */
808 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
811 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
813 /* About Peripheral Major class */
814 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
815 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
816 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
817 /**< Combo Keyboard or pointing
820 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
821 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
822 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
823 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
824 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
825 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
826 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
827 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
828 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
830 /* About Imaging Major class */
831 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
832 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
833 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
834 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
836 /* About Wearable Major class */
837 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
838 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
839 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
840 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
841 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
843 /* About Toy Major class */
844 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
845 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
846 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
847 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
848 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
850 /* About Health Major class */
851 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
852 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
853 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
854 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
855 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
856 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
857 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
858 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
859 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
860 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
861 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
862 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
863 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
864 } bluetooth_device_minor_class_t;
867 * structure to hold the device information
870 bluetooth_device_major_class_t major_class; /**< major device class */
871 bluetooth_device_minor_class_t minor_class; /**< minor device class */
872 bluetooth_device_service_class_t service_class;
873 /**< service device class */
874 } bluetooth_device_class_t;
877 * Discovery Role types
880 DISCOVERY_ROLE_BREDR = 0x1,
882 DISCOVERY_ROLE_LE_BREDR
883 } bt_discovery_role_type_t;
886 * Connected state types
889 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
890 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
891 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
892 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
893 } bluetooth_connected_link_t;
899 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
900 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
901 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
902 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
903 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
904 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
905 } bluetooth_le_scan_filter_feature_t;
911 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
912 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
913 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
914 } bluetooth_le_connection_mode_t;
917 * structure to hold the device information
920 bluetooth_device_address_t device_address; /**< device address */
921 bluetooth_device_name_t device_name; /**< device name */
922 bluetooth_device_class_t device_class; /**< device class */
923 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
924 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
926 int rssi; /**< received strength signal*/
927 gboolean paired; /**< paired flag */
928 bluetooth_connected_link_t connected; /**< connected link type */
929 gboolean trust; /**< trust flag */
930 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
931 } bluetooth_device_info_t;
934 * structure to hold the LE device information
937 int data_len; /**< manafacturer specific data length */
938 bluetooth_advertising_data_t data; /**< manafacturer specific data */
939 } bluetooth_le_advertising_data_t;
942 bluetooth_device_address_t device_address; /**< device address */
943 int addr_type; /**< address type*/
944 int rssi; /**< received strength signal*/
945 bluetooth_le_advertising_data_t adv_ind_data;
946 bluetooth_le_advertising_data_t scan_resp_data;
947 } bluetooth_le_device_info_t;
951 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
952 bluetooth_device_address_t device_address; /**< device address */
953 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
954 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
955 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
956 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
957 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
958 bluetooth_le_advertising_data_t service_data; /**< service data */
959 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
960 int manufacturer_id; /**< manufacturer ID */
961 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
962 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
963 } bluetooth_le_scan_filter_t;
966 * structure to hold the paired device information
969 bluetooth_device_address_t device_address; /**< paired device address */
970 bluetooth_device_name_t device_name; /**< device name */
971 bluetooth_device_class_t device_class; /**< device class */
972 } bluetooth_paired_device_info_t;
975 * structure to hold the paired device information
978 bluetooth_device_address_t device_address;
979 /**< device address */
980 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
981 /**< network interface name */
982 } bluetooth_network_device_info_t;
985 * Authentication event types
989 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
990 BLUETOOTH_AUTH_PIN_REQUEST,
991 BLUETOOTH_AUTH_PASSKEY_REQUEST,
992 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
993 } bluetooth_auth_type_t;
996 * structure to hold the pincode/pass-key req informations
999 bluetooth_device_address_t device_address; /**< remote device address */
1000 bluetooth_device_name_t device_name; /**< device name */
1001 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1002 } bluetooth_authentication_request_info_t;
1005 * Stucture to hold discovery option
1008 unsigned short max_response; /**< the number of maximum response */
1009 unsigned short discovery_duration;
1010 /**< duration of discovery (seconds) */
1011 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1012 classOfDevice variable */
1013 } bluetooth_discovery_option_t;
1016 * Stucture to hold event information
1019 int event; /**< event type */
1020 int result; /**< Success or error value */
1022 /**<parameter data pointer */
1024 } bluetooth_event_param_t;
1027 bluetooth_device_address_t device_addr;
1028 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1029 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1030 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1035 bluetooth_device_address_t device_addr;
1036 unsigned char addr_type;
1038 } bt_connection_info_t;
1041 * Stucture to rfcomm receive data
1046 /**< the socket fd */
1047 int buffer_size;/**< the length of the receive buffer */
1049 /**< the receive data buffer */
1050 } bluetooth_rfcomm_received_data_t;
1056 HTYPE_TRANS_HANDSHAKE,
1057 HTYPE_TRANS_HID_CONTROL,
1058 HTYPE_TRANS_GET_REPORT,
1059 HTYPE_TRANS_SET_REPORT,
1060 HTYPE_TRANS_GET_PROTOCOL,
1061 HTYPE_TRANS_SET_PROTOCOL,
1064 }bt_hid_header_type_t;
1070 PTYPE_DATA_RTYPE_INPUT,
1071 PTYPE_DATA_RTYPE_OUTPUT
1072 }bt_hid_param_type_t;
1075 * Stucture to hid receive data
1078 const char *address;
1079 bt_hid_header_type_t type;
1080 /**< Header type containing */
1081 bt_hid_param_type_t param;
1082 /**< Param type in header like INPUT Report or OutPut Report */
1083 int buffer_size;/**< the length of the receive buffer */
1085 /**< the receive data buffer */
1086 } bluetooth_hid_received_data_t;
1089 * Stucture to rfcomm connection
1093 int socket_fd; /**< the socket fd */
1094 int server_id; /* Server id */
1095 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1096 bluetooth_device_address_t device_addr;
1097 /**< device address */
1098 char uuid[BLUETOOTH_UUID_STRING_MAX];
1099 } bluetooth_rfcomm_connection_t;
1102 * Stucture to rfcomm disconnection
1106 /**< the socket fd */
1107 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1108 bluetooth_device_address_t device_addr;
1109 /**< device address */
1110 char uuid[BLUETOOTH_UUID_STRING_MAX];
1111 } bluetooth_rfcomm_disconnection_t;
1115 /**< the socket fd */
1116 bluetooth_device_address_t device_addr;
1117 /**< device address */
1118 } bluetooth_rfcomm_connection_request_t;
1122 /**< the socket fd */
1123 bluetooth_device_address_t device_addr;
1124 /**< device address */
1125 } bluetooth_hid_request_t;
1140 HDP_ROLE_SOURCE = 0x0,
1142 }bt_hdp_role_type_t;
1146 * Stucture to HDP connected
1149 const char *app_handle; /**< the application handle */
1150 unsigned int channel_id; /**< the channel id */
1151 bt_hdp_qos_type_t type; /**< the QOS type */
1152 bluetooth_device_address_t device_address; /**< the remote address */
1153 } bt_hdp_connected_t;
1156 * Stucture to HDP disconnected
1159 unsigned int channel_id; /**< the channel id */
1160 bluetooth_device_address_t device_address; /**< the remote address */
1161 } bt_hdp_disconnected_t;
1164 * Stucture to HDP data indication
1167 unsigned int channel_id; /**< the channel id */
1168 const char *buffer; /**< the RX data buffer */
1169 unsigned int size; /**< the RX data size */
1170 } bt_hdp_data_ind_t;
1173 * Stucture to OPP client transfer information
1179 }bt_opc_transfer_info_t;
1181 /* Obex Server transfer type */
1182 #define TRANSFER_PUT "PUT"
1183 #define TRANSFER_GET "GET"
1185 * Stucture to OPP/FTP Server authorize information
1190 } bt_obex_server_authorize_into_t;
1198 } bt_obex_server_type_t;
1201 * Stucture to OPP/FTP server transfer information
1209 unsigned long file_size;
1211 bt_obex_server_type_t server_type;
1212 } bt_obex_server_transfer_info_t;
1215 * Stucture to OOB data
1219 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1220 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1221 unsigned int hash_len;
1222 unsigned int randomizer_len;
1226 * Structure to GATT attribute handle data
1232 } bt_gatt_handle_info_t;
1235 * Structure to GATT Remote service data
1242 bt_gatt_handle_info_t include_handles;
1243 bt_gatt_handle_info_t char_handle;
1244 } bt_gatt_service_property_t;
1247 * Structure to GATT Remote characteristic data
1251 char *service_handle;
1252 bt_gatt_handle_info_t handle_info;
1253 } bt_gatt_discovered_char_t;
1256 * Structure to format of GATT Characteristic Value
1260 unsigned char format;
1261 unsigned char exponent;
1262 unsigned short unit;
1263 unsigned char name_space;
1264 unsigned short description;
1265 } bt_gatt_char_format_t;
1268 * Structure to GATT Characteristic property
1276 bt_gatt_char_format_t format;
1278 unsigned int val_len;
1279 unsigned int permission;
1280 char *representation;
1281 bt_gatt_handle_info_t char_desc_handle;
1282 } bt_gatt_char_property_t;
1285 * Structure to GATT Characteristic descriptor property
1292 unsigned int val_len;
1293 } bt_gatt_char_descriptor_property_t;
1296 * Structure to GATT Characteristic value
1303 } bt_gatt_char_value_t;
1306 * Structure to GATT Read Request
1310 char *service_handle;
1314 } bt_gatt_read_req_t;
1317 * Structure to GATT Value change
1321 char *service_handle;
1327 } bt_gatt_value_change_t;
1330 * Structure to GATT characteristc Notification change
1334 char *service_handle;
1335 gboolean att_notify;
1336 } bt_gatt_char_notify_change_t;
1339 * Structure to Indication confirmation
1343 char *service_handle;
1346 } bt_gatt_indicate_confirm_t;
1349 * Structure to RSSI Signal Strength Alert
1360 * Structure to RSSI Signal Strength
1370 * Structure for RSSI Enabled or Disabled
1376 gboolean rssi_enabled;
1377 } bt_rssi_enabled_t;
1380 * Structure for RSSI Threshold
1385 int in_range_threshold;
1387 } bt_rssi_threshold_t;
1390 * Structure for PBAP Folder Parameters
1393 unsigned char addressbook;
1394 unsigned char folder_type;
1398 * Structure for PBAP Pull application Parameters
1401 unsigned char format;
1402 unsigned char order;
1403 unsigned short offset;
1404 unsigned short maxlist;
1405 long long unsigned fields;
1406 } bt_pbap_pull_parameters_t;
1409 * Structure for PBAP List application Parameters
1412 unsigned char order;
1413 unsigned short offset;
1414 unsigned short maxlist;
1415 } bt_pbap_list_parameters_t;
1418 * Structure for PBAP Pull vCard application Parameters
1421 unsigned char format;
1422 long long unsigned fields;
1424 } bt_pbap_pull_vcard_parameters_t;
1427 * Structure for PBAP Search application Parameters
1430 unsigned char order;
1431 unsigned short offset;
1432 unsigned short maxlist;
1433 unsigned char search_attribute;
1434 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1435 } bt_pbap_search_parameters_t;
1438 * Structure for PBAP Connection Status
1441 bluetooth_device_address_t btaddr;
1443 } bt_pbap_connected_t;
1446 * Structure for PBAP Phonebook Size
1449 bluetooth_device_address_t btaddr;
1451 } bt_pbap_phonebook_size_t;
1454 * Structure for PBAP Phonebook Pull
1457 bluetooth_device_address_t btaddr;
1460 } bt_pbap_phonebook_pull_t;
1463 * Structure for PBAP vCard List
1466 bluetooth_device_address_t btaddr;
1470 } bt_pbap_vcard_list_t;
1473 * Structure for PBAP vCard Pull
1476 bluetooth_device_address_t btaddr;
1479 } bt_pbap_vcard_pull_t;
1482 * Structure for PBAP Phonebook search List
1485 bluetooth_device_address_t btaddr;
1489 } bt_pbap_phonebook_search_list_t;
1492 * Stucture to HF Call status information
1496 char *number; /*Phone Number */
1497 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1498 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1499 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1500 int idx; /*Call index/ID */
1501 } bt_hf_call_status_info_t;
1506 } bt_hf_call_list_s;
1509 * Structure for LE data length change params
1513 bluetooth_device_address_t device_address;
1514 guint16 max_tx_octets;
1515 guint16 max_tx_time;
1516 guint16 max_rx_octets;
1517 guint16 max_rx_time;
1518 } bt_le_data_length_params_t;
1522 * @brief DPM BT allowance state
1526 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1527 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1528 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1529 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1533 * @brief DPM API result
1537 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1538 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1539 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1540 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1541 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1542 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1546 * @brief DPM Policy status
1550 BLUETOOTH_DPM_STATUS_ERROR = -1,
1552 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1553 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1555 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1556 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1558 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1559 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1563 /* policy-group : BLUETOOTH */
1564 BLUETOOTH_DPM_POLICY_ALLOW,
1565 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1566 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1567 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1568 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1569 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1570 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1571 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1572 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1573 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1574 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1575 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1576 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1577 BLUETOOTH_DPM_POLICY_END,
1578 } bt_dpm_policy_cmd_t;
1581 struct bt_dpm_policy {
1587 typedef struct bt_dpm_policy bt_dpm_policy_t;
1590 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1591 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1592 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1593 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1594 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1595 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1596 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1597 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1598 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1599 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1600 BLUETOOTH_DPM_PROFILE_NONE,
1603 struct bt_dpm_profile_val {
1604 int value; /* tells whether the profile is enabled or disabled */
1606 typedef struct dpm_profile_val dpm_profile_state_t;
1609 * Structure to DPM device list
1613 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1614 } bt_dpm_device_list_t;
1617 * Structure to DPM uuid list
1621 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1622 } bt_dpm_uuids_list_t;
1625 * Callback pointer type
1627 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1630 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1631 * @brief Set the callback function pointer for bluetooth event
1634 * This API will register the callback function, when any response and event are received from
1635 * bluetooth framework. @n
1636 * this registered callback function will be get called with appropriate event and data structures.
1637 * This function is a synchronous call. An application developer can call
1638 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1639 * type. This registered function will receive events of bluetooth_event_type_t type along with
1643 * @param[in] callback_ptr A pointer to the callback function
1644 * @param[in] user_data A pointer to user data
1645 * @return BLUETOOTH_ERROR_NONE - Success
1649 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1651 GMainLoop *main_loop = (GMainLoop*) user_data;
1655 // Code for each event
1657 g_main_loop_quit(main_loop);
1664 GMainLoop *main_loop = NULL;
1666 main_loop = g_main_loop_new(NULL, FALSE);
1667 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1668 if (ret >= BLUETOOTH_ERROR_NONE)
1670 // bluetooth_register_callback returned Success
1674 // bluetooth_register_callback returned failiure
1676 g_main_loop_run(main_loop);
1680 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1683 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1684 * @brief Set the callback function pointer for bluetooth le event
1687 * This API will register the callback function, when any response and event are received from
1688 * bluetooth framework. @n
1689 * this registered callback function will be get called with appropriate event and data structures.
1690 * This function is a synchronous call. An application developer can call
1691 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1692 * type. This registered function will receive events of bluetooth_event_type_t type along with
1696 * @param[in] callback_ptr A pointer to the callback function
1697 * @param[in] user_data A pointer to user data
1698 * @return BLUETOOTH_ERROR_NONE - Success
1702 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1705 * @fn int bluetooth_le_unregister_callback(void)
1706 * @brief Set the callback function pointer for bluetooth le event
1709 * This API will register the callback function, when any response and event are received from
1710 * bluetooth framework. @n
1711 * this registered callback function will be get called with appropriate event and data structures.
1712 * This function is a synchronous call. An application developer can call
1713 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1714 * type. This registered function will receive events of bluetooth_event_type_t type along with
1719 * @return BLUETOOTH_ERROR_NONE - Success
1723 int bluetooth_le_unregister_callback(void);
1726 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1727 * @brief Set the callback function pointer for bluetooth event
1730 * This API will register the callback function, when any response and event are received from
1731 * bluetooth framework. @n
1732 * this registered callback function will be get called with appropriate event and data structures.
1733 * This function is a synchronous call. An application developer can call
1734 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1735 * type. This registered function will receive events of bluetooth_event_type_t type along with
1740 * @return BLUETOOTH_ERROR_NONE - Success
1744 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1746 GMainLoop *main_loop = (GMainLoop*) user_data;
1750 // Code for each event
1752 g_main_loop_quit(main_loop);
1759 GMainLoop *main_loop = NULL;
1761 main_loop = g_main_loop_new(NULL, FALSE);
1762 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1763 if (ret >= BLUETOOTH_ERROR_NONE)
1765 // bluetooth_register_callback returned Success
1769 // bluetooth_register_callback returned failiure
1771 ret = bluetooth_deregister_callback(void);
1772 g_main_loop_run(main_loop);
1776 int bluetooth_unregister_callback(void);
1779 * @fn int bluetooth_enable_adapter(void)
1780 * @brief Enable the Bluetooth H/W
1783 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1784 * send request to bluetooth chip for activation.
1785 * This function is typically called at startup or when Bluetooth services are required. This
1786 * function must be called before calling any other API of Bluetooth operations.
1788 * Before performing any operations like Device discover, service search etc.., the adapter must be
1791 * This function is a asynchronous call.
1792 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1793 * through registered callback function with appropriate result code
1794 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1795 * BLUETOOTH_ERROR_NONE - Success \n
1797 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1798 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1800 * @return BLUETOOTH_ERROR_NONE - Success\n
1801 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1802 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1803 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1804 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1806 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1808 void bt_event_callback(int event, bluetooth_event_param_t *param)
1812 case BLUETOOTH_EVENT_ENABLED:
1813 if (param->result == BLUETOOTH_ERROR_NONE)
1815 // Successfully Enabled
1828 ret = bluetooth_enable_adapter();
1832 int bluetooth_enable_adapter(void);
1835 * @fn int bluetooth_disable_adapter(void)
1836 * @brief Disable the Bluetooth H/W
1839 * This function disables Bluetooth protocol stack and hardware. This function is called when
1840 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1842 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1843 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1844 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1846 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1849 * This function is a asynchronous call.
1850 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1851 * through registered callback function.
1854 * @return BLUETOOTH_ERROR_NONE - Success\n
1855 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1856 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1857 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1859 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1861 void bt_event_callback(int event, bluetooth_event_param_t *param)
1865 case BLUETOOTH_EVENT_DISABLED:
1866 if (param->result == BLUETOOTH_ERROR_NONE)
1868 // Successfully disabled
1881 ret = bluetooth_disable_adapter();
1884 int bluetooth_disable_adapter(void);
1885 int bluetooth_recover_adapter(void);
1886 int bluetooth_check_adapter_le(void);
1887 int bluetooth_enable_adapter_le(void);
1889 int bluetooth_disable_adapter_le(void);
1892 * @fn int bluetooth_reset_adapter(void)
1893 * @brief Reset the Bluetooth H/W and values
1896 * This function resets Bluetooth protocol stack and hardware. This function is called when
1897 * an user want to initialize Bluetooth environment.
1899 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1902 * This function is a synchronous call.
1904 * @return BLUETOOTH_ERROR_NONE - Success\n
1905 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1907 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1912 ret = bluetooth_reset_adapter();
1915 int bluetooth_reset_adapter(void);
1918 * @fn int bluetooth_is_supported(void)
1919 * @brief Check if the bluetooth is supported or not by the current target
1921 * This API checks whether the bluetooth is supported or not.
1922 * This API only run by root permission.
1924 * This function is a synchronous call.
1926 * @return 0 - if bluetooth is not supported\n
1927 * 1 - if bluetooth is supported\n
1928 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
1933 ret = bluetooth_is_supported();
1936 int bluetooth_is_supported(void);
1940 * @fn int bluetooth_check_adapter(void)
1941 * @brief Check the current status of the Bluetooth adapter
1944 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
1945 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
1946 * bluetooth adapter.
1947 * This API get the adapter internal data structure and check current adapter status.
1949 * This function is a synchronous call.
1952 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
1953 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
1955 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
1959 ret = bluetooth_check_adapter();
1962 int bluetooth_check_adapter(void);
1965 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
1966 * @brief Get the local adapter bluetooth address
1969 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
1970 * the adapter should be enabled.
1971 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
1972 * contain Bluetooth address.
1973 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
1974 * friendly name for each device.
1975 * There is no event callback for this API.
1977 * This function is a synchronous call.
1980 * @return BLUETOOTH_ERROR_NONE - Succeess \n
1981 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
1982 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
1983 * @param[out] local_address a device address of local bluetooth adapter
1988 bluetooth_device_address_t local_address={0,};
1991 ret = bluetooth_get_local_address(&local_address);
1994 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
1997 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
1998 * @brief Get the hci version
2001 * This function is used to get the bluetooth hci version
2002 * Before calling this API make sure that the adapter is enabled.
2004 * This function is a synchronous call.
2007 * @return BLUETOOTH_ERROR_NONE - Success \n
2008 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2009 * @param[out] timeout remain visibility timeout value
2012 bluetooth_version_t *version;
2014 ret = bluetooth_get_local_version (&version);
2017 int bluetooth_get_local_version(bluetooth_version_t *version);
2020 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2021 * @brief Get the local device name
2024 * This function is used, get the local device name. Since its difficult to remember the Adapter
2025 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2026 * friendly name is retrived by the remote device and displaying.
2027 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2029 * This function is a synchronous call.
2032 * @return BLUETOOTH_ERROR_NONE - Success \n
2033 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2034 * @param[out] local_name a local device name
2038 bluetooth_device_name_t local_name={0,}
2040 ret = bluetooth_get_local_name (&local_name);
2043 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2046 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2047 * @brief Set the local device name
2050 * This function is used to set the local device name. This is a human friendly name whose
2051 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2053 * This function is a synchronous call.
2055 * @param[in] local_name bluetooth device name to set local device
2057 * @return BLUETOOTH_ERROR_NONE - Success \n
2058 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2059 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2060 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2061 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2062 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2067 bluetooth_device_name_t local_name={0,}
2069 ret = bluetooth_set_local_name (&local_name);
2072 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2076 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2077 * @brief Check if the uuid is used or not
2079 * This function is used to check if the uuid is used or not.
2081 * This function is a synchronous call.
2083 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2084 * @param[out] used if the uuid is used or not
2086 * @return BLUETOOTH_ERROR_NONE - Success \n
2087 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2088 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2089 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2094 gboolean used = FALSE;
2095 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2096 ret = bluetooth_is_service_used(uuid, &used);
2099 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2102 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2103 * @brief Check if the device is connected to the specific service
2105 * This function is used to check if if the device is connected to the specific service.
2107 * This function is a synchronous call.
2109 * @param[in] local_address a device address of remote bluetooth device
2110 * @param[in] type the service type
2111 * @param[out] is_connected if the device is connected or not
2113 * @return BLUETOOTH_ERROR_NONE - Success \n
2114 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2115 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2116 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2121 gboolean is_connected = FALSE;
2122 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2123 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2126 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2127 bluetooth_service_type_t type,
2128 gboolean *is_connected);
2131 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2132 * @brief Gets device's connected link type
2134 * This function is used to get device's connected link type
2136 * This function is a synchronous call.
2138 * @param[in] device_address a device address of remote bluetooth device
2139 * @param[out] connected_link a device's connected link type
2141 * @return BLUETOOTH_ERROR_NONE - Success \n
2142 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2143 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2144 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2149 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2150 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2151 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2154 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2155 bluetooth_connected_link_t *connected_link);
2158 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2159 * @brief Get the visibility mode
2162 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2163 * visibity mode, the property of the device is determined whether it can be discoverable, non
2164 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2166 * This function is a synchronous call.
2169 * @return BLUETOOTH_ERROR_NONE - Success \n
2170 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2171 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2172 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2173 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2174 * @param[out] discoverable_mode current bluetooth discoverable mode
2176 * @see bluetooth_set_discoverable_mode
2178 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2180 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2183 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2186 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2188 * @brief Set the visibility mode
2191 * This function is used to set the discoverable mode (Visibility option).
2193 * Many times user may want to keep his device discoverable so that when peer device is performing
2194 * device search, he/she can find user's device. Application programmer can keep the mode as
2195 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2196 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2197 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2198 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2200 * This function is a synchronous call.
2202 * @return BLUETOOTH_ERROR_NONE - Success \n
2203 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2205 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2206 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2208 * @see bluetooth_get_discoverable_mode
2212 bluetooth_discoverable_mode_t mode;
2214 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2215 ret = bluetooth_set_discoverable_mode (mode, 180);
2219 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2224 * @fn int bluetooth_get_timeout_value(int *timeout)
2225 * @brief Get the visibility timeout value
2228 * This function is used to get the visibility timeout
2229 * Before calling this API make sure that the adapter is enabled.
2231 * This function is a synchronous call.
2234 * @return BLUETOOTH_ERROR_NONE - Success \n
2235 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2236 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2237 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2238 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2239 * @param[out] timeout remain visibility timeout value
2241 * @see bluetooth_set_discoverable_mode
2245 ret = bluetooth_get_timeout_value (&timeout);
2248 int bluetooth_get_timeout_value(int *timeout);
2252 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2253 * unsigned int classOfDeviceMask)
2254 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2256 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2257 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2258 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2259 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2260 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2261 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2262 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2263 * please see bluetooth_device_info_t for more details.
2266 * This API provides searching options like max responses, discovery duration in seconds and class
2267 * of device mask to filter device search. some times there may be too many bluetooth devices in
2268 * vicinity of your device.in such scenario, application can request to reduce number of responces
2269 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2270 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2271 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2272 * application defined time. please note that discovery_duration should be mentioned in seconds.
2273 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2276 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2277 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2278 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2280 * This function is a asynchronous call.
2281 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2282 * through registered callback function.
2284 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2285 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2287 * The completion or cancellation of the discovery is indicated by an
2288 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2290 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2293 * @return BLUETOOTH_ERROR_NONE - Success \n
2294 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2295 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2296 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2297 agent is not running \n
2299 * @param[in] max_response define the maximum response of the number of founded devices
2301 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2302 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2303 (refer to class of device)
2305 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2308 void bt_event_callback(int event, bluetooth_event_param_t *param)
2312 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2314 bluetooth_device_info_t *device_info = NULL;
2315 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2317 device_info = (bluetooth_device_info_t *)param->param_data;
2318 memcpy(&searched_device, &device_info->device_address,
2319 sizeof(bluetooth_device_address_t));
2320 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2321 device_info->device_address.addr[0],
2322 device_info->device_address.addr[1],
2323 device_info->device_address.addr[2],
2324 device_info->device_address.addr[3],
2325 device_info->device_address.addr[4],
2326 device_info->device_address.addr[5]);
2329 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2331 bluetooth_device_info_t *device_info = NULL;
2332 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2334 device_info = (bluetooth_device_info_t *)param->param_data;
2335 memcpy(&searched_device, &device_info->device_address,
2336 sizeof(bluetooth_device_address_t));
2337 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2338 device_info->device_name.name,
2339 device_info->device_address.addr[0],
2340 device_info->device_address.addr[1],
2341 device_info->device_address.addr[2],
2342 device_info->device_address.addr[3],
2343 device_info->device_address.addr[4],
2344 device_info->device_address.addr[5]);
2348 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2349 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2354 unsigned short max_response;
2355 unsigned short discovery_duration;
2356 unsigned classOfDeviceMask;
2360 discovery_duration =0;
2361 classOfDeviceMask =0;
2363 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2368 int bluetooth_start_discovery(unsigned short max_response,
2369 unsigned short discovery_duration,
2370 unsigned int classOfDeviceMask);
2373 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2374 * unsigned short max_response,
2375 * unsigned short discovery_duration,
2376 * unsigned int classOfDeviceMask)
2377 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2379 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2380 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2381 * Please see bluetooth_start_discovery() for other parameters description.
2383 * This function is a asynchronous call.
2384 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2385 * through registered callback function.
2387 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2388 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2390 * The completion or cancellation of the discovery is indicated by an
2391 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2393 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2396 * @return BLUETOOTH_ERROR_NONE - Success \n
2397 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2398 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2399 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2400 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2401 agent is not running \n
2403 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2404 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2405 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2406 * @param[in] max_response define the maximum response of the number of founded devices
2408 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2409 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2410 (refer to class of device)
2412 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2415 unsigned short type;
2416 unsigned short max_response;
2417 unsigned short discovery_duration;
2418 unsigned classOfDeviceMask;
2423 discovery_duration =0;
2424 classOfDeviceMask =0;
2426 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2431 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2432 unsigned short max_response,
2433 unsigned short discovery_duration,
2434 unsigned int classOfDeviceMask);
2437 * @fn int bluetooth_cancel_discovery (void)
2438 * @brief Cancel the on-going device discovery operation
2441 * This function stops the on-going device discovery operation. This API has to be called after the
2442 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2443 * the bluetooth_start_discovery API
2445 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2446 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2447 * cancel the discover request once the user received the device to which he wish to connect.
2449 * This function is a asynchronous call.
2450 * If the call is success to cancel discovey then the application will receive
2451 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2452 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2453 * BLUETOOTH_ERROR_NONE
2456 * @return BLUETOOTH_ERROR_NONE - Success \n
2457 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2458 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2459 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2460 other application \n
2461 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2463 * @see bluetooth_start_discovery
2465 void bt_event_callback(int event, bluetooth_event_param_t *param)
2469 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2470 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2479 ret = bluetooth_cancel_discovery();
2482 int bluetooth_cancel_discovery(void);
2485 * @fn int bluetooth_start_le_discovery(void)
2486 * @brief Start the generic device discovery which finds the LE devices.
2488 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2489 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2490 * It try to find LE devices. Bluetooth device address and name are
2491 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2492 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2493 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2494 * please see bluetooth_device_info_t for more details.
2496 * This function is a asynchronous call.
2497 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2498 * through registered callback function.
2500 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2503 * The completion or cancellation of the discovery is indicated by an
2504 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2506 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2509 * @return BLUETOOTH_ERROR_NONE - Success \n
2510 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2511 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2512 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2513 agent is not running \n
2516 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2519 void bt_event_callback(int event, bluetooth_event_param_t *param)
2523 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2525 bluetooth_device_info_t *device_info = NULL;
2526 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2528 device_info = (bluetooth_device_info_t *)param->param_data;
2529 memcpy(&searched_device, &device_info->device_address,
2530 sizeof(bluetooth_device_address_t));
2531 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2532 device_info->device_address.addr[0],
2533 device_info->device_address.addr[1],
2534 device_info->device_address.addr[2],
2535 device_info->device_address.addr[3],
2536 device_info->device_address.addr[4],
2537 device_info->device_address.addr[5]);
2541 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2542 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2548 ret = bluetooth_start_discovery();
2553 int bluetooth_start_le_discovery(void);
2556 * @fn int bluetooth_stop_le_discovery (void)
2557 * @brief Cancel the on-going device LE discovery operation
2560 * This function stops the on-going device discovery operation. This API has to be called after the
2561 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2562 * the bluetooth_start_le_discovery API
2565 * This function is a asynchronous call.
2566 * If the call is success to cancel discovey then the application will receive
2567 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2568 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2569 * BLUETOOTH_ERROR_NONE
2572 * @return BLUETOOTH_ERROR_NONE - Success \n
2573 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2574 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2575 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2576 other application \n
2577 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2579 * @see bluetooth_start_discovery
2581 void bt_event_callback(int event, bluetooth_event_param_t *param)
2585 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2586 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2595 ret = bluetooth_stop_le_discovery();
2598 int bluetooth_stop_le_discovery(void);
2601 * @fn int bluetooth_is_discovering(void)
2602 * @brief Check for the device discovery is in-progress or not.
2604 * This API is used to check the current status of the Discovery operation.If discovery is in\
2605 * progress normally other operations are not allowed.
2606 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2607 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2608 * event before performing other operations. This API is used to get for the current discovery
2609 * operation status and using bluetooth_cancel_discovery()
2610 * we can cancell the ongoing discovery process.
2611 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2614 * This function checks whether the device discovery is started or not.
2616 * This function is a synchronous call.
2619 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2620 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2621 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2624 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2628 ret = bluetooth_is_discovering ();
2631 int bluetooth_is_discovering(void);
2634 * @fn int bluetooth_is_le_discovering(void)
2635 * @brief Check for the device LE discovery is in-progress or not.
2637 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2638 * progress normally other operations are not allowed.
2639 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2640 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2641 * event before performing other operations. This API is used to get for the current discovery
2642 * operation status and using bluetooth_stop_le_discovery()
2643 * we can cancell the ongoing LE discovery process.
2644 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2647 * This function checks whether the device LE discovery is started or not.
2649 * This function is a synchronous call.
2652 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2653 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2654 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2657 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2661 ret = bluetooth_is_le_discovering ();
2664 int bluetooth_is_le_discovering(void);
2667 * @fn int bluetooth_is_le_scanning(void)
2668 * @brief Check for the device LE scan is in-progress or not.
2670 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2671 * progress normally other operations are not allowed.
2673 * This function checks whether the device LE Scan is started or not.
2675 * This function is a synchronous call.
2677 * @return TRUE - LE Scan in progress \n
2678 * FALSE - LE Scan is not in progress \n
2683 gboolean is_le_scanning = 0;
2684 is_le_scanning = bluetooth_is_le_scanning ();
2687 gboolean bluetooth_is_le_scanning(void);
2690 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2691 * @brief Register scan filter.
2693 * This function registers the scan filter.
2695 * This function is a synchronous call.
2697 * @return BLUETOOTH_ERROR_NONE - Success \n
2699 * @param[in] filter scan filter to register
2700 * @param[out] slot_id the slot ID of scan filter
2704 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2707 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2708 * @brief Register scan filter.
2710 * This function unregisters the scan filter.
2712 * This function is a synchronous call.
2714 * @return BLUETOOTH_ERROR_NONE - Success \n
2716 * @param[in] slot_id the slot ID of scan filter
2720 int bluetooth_unregister_scan_filter(int slot_id);
2723 * @fn int bluetooth_unregister_all_scan_filters(void)
2724 * @brief Register scan filter.
2726 * This function usregisters all scan filters.
2728 * This function is a synchronous call.
2730 * @return BLUETOOTH_ERROR_NONE - Success \n
2734 int bluetooth_unregister_all_scan_filters(void);
2737 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2738 int link_type, bt_rssi_threshold_t rssi_threshold)
2739 * @brief Enable RSSI monitoring
2741 * This function enables RSSI monitoring and sets threshold for a connection
2743 * @return BLUETOOTH_ERROR_NONE - Success \n
2746 * @see bluetooth_get_rssi_strength
2748 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2749 int link_type, bt_rssi_threshold_t *rssi_threshold);
2752 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2753 * @brief Gets Raw RSSI signal Strength
2755 * This function gives the Raw RSSI signal strength for a connection.
2757 * @return BLUETOOTH_ERROR_NONE - Success \n
2760 * @see bluetooth_enable_rssi
2762 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2764 int bluetooth_set_connectable(gboolean is_connectable);
2766 int bluetooth_is_connectable(gboolean *is_connectable);
2769 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2770 * @brief Initiate a bonding process
2773 * This function initiates a bonding procedure with a peer device. The bonding procedure
2774 * enables authentication and optionally encryption on the Bluetooth link.
2776 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2777 * inititate the bonding request to the devices already in the paired list.
2779 * Usually we call this API after the device discovery.
2780 * This function is a asynchronous call.
2782 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2783 * mentioed result code
2784 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2785 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2786 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2787 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2788 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2790 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2791 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2794 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2797 * @return BLUETOOTH_ERROR_NONE - Success \n
2798 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2799 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2800 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2801 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2803 * @param[in] device_address This indicates an address of the device with which the pairing
2804 * should be initiated
2806 * @see bluetooth_cancel_bonding
2808 void bt_event_callback(int event, bluetooth_event_param_t *param)
2812 case BLUETOOTH_EVENT_BONDING_FINISHED:
2814 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2815 if (param->result >= BLUETOOTH_ERROR_NONE)
2817 bluetooth_device_info_t *device_info = NULL;
2818 device_info = (bluetooth_device_info_t *)param->param_data;
2819 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
2820 mjr[%#x] min[%#x] srv[%#x]",
2821 device_info->device_name.name,
2822 device_info->device_address.addr[0],
2823 device_info->device_address.addr[1],
2824 device_info->device_address.addr[2],
2825 device_info->device_address.addr[3],
2826 device_info->device_address.addr[4],
2827 device_info->device_address.addr[5],
2828 device_info->device_class.major_class,
2829 device_info->device_class.minor_class,
2830 device_info->device_class.service_class);
2844 bluetooth_device_address_t device_address={{0}};
2846 ret = bluetooth_bond_device(&device_address);
2850 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
2853 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2854 * bluetooth_conn_type_t conn_type)
2855 * @brief Initiate a bonding process
2858 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
2859 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
2861 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2862 * inititate the bonding request to the devices already in the paired list.
2864 * Usually we call this API after the device discovery.
2865 * This function is a asynchronous call.
2867 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2868 * mentioed result code
2869 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2870 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2871 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2872 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2873 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2875 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2876 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2879 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2882 * @return BLUETOOTH_ERROR_NONE - Success \n
2883 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2884 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2885 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2886 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2888 * @param[in] device_address This indicates an address of the device with which pairing
2889 * should be initiated
2890 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
2893 * @see bluetooth_cancel_bonding
2895 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2896 bluetooth_conn_type_t conn_type);
2899 * @fn int bluetooth_cancel_bonding(void)
2900 * @brief Cancel the on-going bonding process
2902 * This API is called to cancel the on-going bonding procedure. It should be called before the
2903 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
2904 * This API is useful when the remote device is not responding to the bond request or we wish to
2905 * cancel the bonding request. In this case we need not wait for the timeout to happen.
2907 * This function is a synchronous call.
2909 * @return BLUETOOTH_ERROR_NONE - Success \n
2910 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
2911 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2914 * @see bluetooth_bond_device
2920 ret = bluetooth_cancel_bonding();
2923 int bluetooth_cancel_bonding(void);
2926 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
2927 * @brief Remove bonding
2930 * To communicate with remote device over bluetooth link, user should bond with peer device.
2931 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
2932 * API is used to remove peer device from the list. Please note that after removing the device
2933 * from bonded device list, you cannot communication with peer device until bonding happens again.
2935 * User can call this function by passing bluetooth device address of any bonded device. Please note
2936 * that after successful return of this function, any bluetooth application running on your device
2937 * will not be able to communicate with unbonded device until bond operation happens again using
2938 * bluetooth_bond_device()
2941 * This function is a asynchronous call. The request to remove the specified device from the bonded
2942 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
2943 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
2944 * in case if there is a problem in locating given bluetooth device address in bonded devices list
2948 * @return BLUETOOTH_ERROR_NONE - Success \n
2949 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
2950 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2951 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2952 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2953 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2954 * agent is not running \n
2955 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
2958 * @param[in] device_address This indicates an address of the device to remove bonding
2962 * @see bluetooth_bond_device, bluetooth_cancel_bonding
2965 void bt_event_callback(int event, bluetooth_event_param_t *param)
2968 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
2969 bluetooth_device_address_t *dev_addr = NULL;
2971 if (param->result == BLUETOOTH_ERROR_NONE) {
2972 dev_addr = (bluetooth_device_address_t *)param->param_data;
2974 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2975 dev_addr->addr[0], dev_addr->addr[1]
2976 dev_addr->addr[2], dev_addr->addr[3]
2977 dev_addr->addr[4], dev_addr->addr[5]
2988 bluetooth_device_address_t *device_address;
2990 // copy valid device address in device_address
2992 ret = bluetooth_unbond_device(device_address);
2995 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
2998 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
2999 * @brief Get bonded(paired) device list
3002 * This API gets all bonded device list.
3003 * The devices in the bonded device list further can be used to perform the authorization by calling
3004 * bluetooth_authorize_device API.
3006 * This function is a synchronous call.
3007 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3008 * there is no valid information in the dev_list.
3009 * The len field in the dev_list represents the number of bonded devices. The data structure for
3010 * bonded device information is bluetooth_device_info_t.
3013 * @return BLUETOOTH_ERROR_NONE - Success \n
3014 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3016 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3018 void bt_get_bonded_devices(void)
3022 GPtrArray *devinfo = NULL;
3023 bluetooth_device_info_t *ptr;
3025 // allocate the g_pointer_array
3026 devinfo = g_ptr_array_new();
3028 ret = bluetooth_get_bonded_device_list(&devinfo);
3029 if (ret != BLUETOOTH_ERROR_NONE)
3031 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3035 printf("g pointer arrary count : [%d]", devinfo->len);
3036 for (i=0; i<devinfo->len; i++)
3038 ptr = g_ptr_array_index(devinfo, i);
3041 printf("Name [%s]\n", ptr->device_name.name);
3042 printf("Major Class [%d]\n", ptr->device_class.major_class);
3043 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3044 printf("Service Class [%d]\n", ptr->device_class.service_class);
3045 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3046 ptr->device_address.addr[0],
3047 ptr->device_address.addr[1], ptr->device_address.addr[2],
3048 ptr->device_address.addr[3],
3049 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3056 // free g_pointer_array
3057 g_ptr_array_free(devinfo, TRUE);
3062 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3065 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3066 * bluetooth_device_info_t *dev_info)
3067 * @brief Get a bonded(paired) device
3070 * This API gets a bonded device.
3072 * This function is a synchronous call.
3073 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3074 * there is no valid information in the dev_info.
3075 * The data structure for bonded device information is bluetooth_device_info_t.
3078 * @return BLUETOOTH_ERROR_NONE - Success \n
3079 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3081 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3083 void bt_get_bonded_device(void)
3087 bluetooth_device_info_t devinfo = {0};
3088 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3090 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3091 if (ret != BLUETOOTH_ERROR_NONE)
3093 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3097 printf("Name [%s]\n", devinfo.device_name.name);
3098 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3099 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3100 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3101 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3102 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3103 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3104 devinfo.device_address.addr[5]);
3113 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3114 bluetooth_device_info_t *dev_info);
3117 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3118 * @brief set alias for bonded device
3121 * This function set alias for bonded device.
3123 * This function is a synchronous call.
3126 * @return BLUETOOTH_ERROR_NONE - Success \n
3127 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3128 * @param[in] device_address This indicates an address of the remote device
3129 * @param[in] alias This indicates an alias to set
3134 ret = bluetooth_set_alias(&remote_address);
3137 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3141 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3142 * @brief Get remote deivice
3145 * This function gets specific remote device.
3147 * This function is a asynchronous call.
3148 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3151 * @return BLUETOOTH_ERROR_NONE - Success \n
3152 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3153 * @param[in] device_address This indicates an address of the remote device
3158 ret = bluetooth_get_remote_device(&remote_address);
3161 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3164 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3165 * gboolean authorized)
3166 * @brief Authorize/Unauthorize a bonded device
3169 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3170 * with/without user confirmation.
3172 * If we select a paired device and make it authorized by calling this API with the authorized
3173 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3174 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3175 * then it will ask for the user conformation before the connection.
3177 * This API supposed to be called on the paired devices. Which means we have to use this API only
3178 * after successful pairing.
3180 * This function is a asynchronous call.
3181 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3183 * @return BLUETOOTH_ERROR_NONE - Success \n
3184 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3185 * @param[in] device_address This indicates an address of the device to authorize \n
3186 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3188 * @see bluetooth_get_bonded_device_list
3190 void bt_event_callback(int event, bluetooth_event_param_t *param)
3194 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3196 if (param->result == BLUETOOTH_ERROR_NONE)
3200 //device authorization failed failure
3208 bluetooth_device_address_t device_address={{0}};
3209 gboolean authorized;
3213 ret = bluetooth_authorize_device(&device_address,authorized);
3216 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3217 gboolean authorized);
3219 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3220 const bluetooth_device_pin_code_t *pin_code);
3222 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3225 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3227 * @brief Receives Legacy Passkey\pin with following authentication response types
3229 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3230 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3233 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3236 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3238 * @brief This API sends user confirmation reply to the local adapter.
3240 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3243 int bluetooth_passkey_confirmation_reply(gboolean reply);
3246 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3247 * @brief Get all services supported by remote device
3250 * This API call initiates the search for the services supported by the specified device. Normally
3251 * the service search will take a couple of seconds to get it completed. Before calling this API
3252 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3253 * perform the service search. We can get the device address by doing a device discovery operation.
3256 * This function is a asynchronous call.
3257 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3259 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3260 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3261 * event is generated with appropriate result code.
3263 * @return BLUETOOTH_ERROR_NONE - Success \n
3264 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3265 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3266 * @param[in] device_address This indicates an address of the device
3267 * whose services need to be found
3269 * @see bluetooth_cancel_service_search
3271 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3274 * @fn int bluetooth_cancel_service_search(void)
3275 * @brief Cancel the ongoing service search operation
3278 * This function cancel the ongoing service search operation. This API is usually calling after the
3279 * bluetooth_search_service API.
3280 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3281 * if the user wish to cancel the Ongoing service search operation.
3283 * This API should be called just after the bluetooth_search_service API and before the
3284 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3286 * This function is a synchronous call.
3288 * @return BLUETOOTH_ERROR_NONE - Success \n
3289 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3290 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3291 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3294 * @see bluetooth_search_service
3299 ret = bluetooth_cancel_service_search();
3302 int bluetooth_cancel_service_search(void);
3305 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3306 * @brief Register rfcomm socket with a specific uuid
3309 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3310 * descriptor of the server.
3311 * This is the first API which is called to create the server. Once we created the server socket,
3312 * we will listen on that return socket.
3313 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3316 * @return socket FD on Success \n
3317 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3318 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3319 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3320 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3321 * @param[in] UUID (128 bits)
3324 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3328 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3329 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3333 int bluetooth_rfcomm_create_socket(const char *uuid);
3336 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3337 * @brief Register rfcomm socket with a specific uuid
3340 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3341 * descriptor of the server.
3342 * This is the first API which is called to create the server. Once we created the server socket,
3343 * we will listen on that return socket.
3344 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3347 * @return socket FD on Success \n
3348 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3349 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3350 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3351 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3352 * @param[in] UUID (128 bits)
3353 * @param[in] bus_name (const char)
3354 * @param[in] path (const char)
3357 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3361 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3362 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3366 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3369 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3370 * @brief De-register the rfcomm socket
3373 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3374 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3375 * descriptor else no event will come. We will call this API only after the
3376 * bluetooth_rfcomm_listen_and_accept.
3377 * This is a synchronous call.
3379 * @return BLUETOOTH_ERROR_NONE - Success \n
3380 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3381 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3382 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3383 * @param[in] int socket_fd
3386 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3389 void bt_event_callback(int event, bluetooth_event_param_t *param)
3393 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3395 bluetooth_rfcomm_connection_t *discon_ind =
3396 (bluetooth_rfcomm_connection_t *)param->param_data;
3398 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3406 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3407 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3409 ret = bluetooth_rfcomm_remove_socket(fd);
3412 int bluetooth_rfcomm_remove_socket(int socket_fd);
3415 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3416 * @brief De-register the rfcomm socket
3419 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3420 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3421 * descriptor else no event will come. We will call this API only after the
3422 * bluetooth_rfcomm_listen_and_accept_ex.
3423 * This is a synchronous call.
3425 * @return BLUETOOTH_ERROR_NONE - Success \n
3426 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3427 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3428 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3429 * @param[in] UUID (128 bits)
3432 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3435 void bt_event_callback(int event, bluetooth_event_param_t *param)
3439 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3441 bluetooth_rfcomm_connection_t *discon_ind =
3442 (bluetooth_rfcomm_connection_t *)param->param_data;
3444 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3452 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3453 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3455 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3458 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3461 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3462 * @brief Disconnect rfcomm connection
3465 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3466 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3469 * @return BLUETOOTH_ERROR_NONE - Success \n
3470 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3471 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3472 * @param[in] int socket_fd the sending socket fd
3478 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3480 printf("Disconnection failed");
3482 printf("Disconnection Success");
3486 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3489 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3490 * @brief Rfcomm socket listen
3493 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3494 * after the bluetooth_rfcomm_create_socket API.
3495 * This API listen for the incomming connection and once it receives a connection, it will give
3496 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3497 * event to the application. This is an Asynchronous API call.
3500 * @return BLUETOOTH_ERROR_NONE - Success \n
3501 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3502 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3504 * @param[in] int socket_fd
3505 * @param[in] max pending connection.
3508 * @see bluetooth_rfcomm_create_socket
3511 void bt_event_callback(int event, bluetooth_event_param_t* param)
3515 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3517 bluetooth_rfcomm_connection_t *conn_ind =
3518 (bluetooth_rfcomm_connection_t *)param->param_data;
3520 printf("\nConnected from FD %d", conn_ind->socket_fd);
3528 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3529 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3533 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3536 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3537 * @brief Rfcomm socket listen
3540 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3541 * after the bluetooth_rfcomm_create_socket API.
3542 * This API listen for the incomming connection and once it receives a connection, it will give
3543 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3544 * event to the application. This is an Asynchronous API call.
3547 * @return BLUETOOTH_ERROR_NONE - Success \n
3548 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3549 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3551 * @param[in] int socket_fd
3552 * @param[in] max pending connection.
3557 * @see bluetooth_rfcomm_create_socket_ex
3560 void bt_event_callback(int event, bluetooth_event_param_t* param)
3564 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3566 bluetooth_rfcomm_connection_t *conn_ind =
3567 (bluetooth_rfcomm_connection_t *)param->param_data;
3569 printf("\nConnected from FD %d", conn_ind->socket_fd);
3577 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3578 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3583 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3586 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3587 * @brief Rfcomm socket listen
3590 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3591 * after the bluetooth_rfcomm_create_socket API.
3592 * This API listen for the incomming connection and once it receives a connection, it will give
3593 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3594 * event to the application. This is an Asynchronous API call.
3597 * @return BLUETOOTH_ERROR_NONE - Success \n
3598 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3599 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3601 * @param[in] int socket_fd
3602 * @param[in] max pending connection.
3605 * @see bluetooth_rfcomm_create_socket
3608 void bt_event_callback(int event, bluetooth_event_param_t* param)
3612 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3614 char *name = (char *)param->param_data;
3616 printf("\nConnected from %s", name);
3618 bluetooth_rfcomm_accept_connection();
3626 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3627 ret = bluetooth_rfcomm_listen(fd, 1);
3631 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3634 * @fn int bluetooth_rfcomm_accept_connection()
3635 * @brief Accepts the authorization request indicated by the event
3636 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3638 * This function is a synchronous call.
3640 * @return BLUETOOTH_ERROR_NONE - Success \n
3641 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3643 * @param[in] the socket fd of the server
3644 * @param[out] the socket fd of the client
3648 * @see bluetooth_rfcomm_reject_connection
3650 int bluetooth_rfcomm_accept_connection(int server_fd);
3653 * @fn int bluetooth_rfcomm_reject_connection()
3654 * @brief Rejects the authorization request indicated by the event
3655 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3657 * This function is a synchronous call.
3659 * @return BLUETOOTH_ERROR_NONE - Success \n
3660 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3662 * @param[in] the socket fd of the server
3666 * @see bluetooth_rfcomm_accept_connection
3668 int bluetooth_rfcomm_reject_connection(int server_fd);
3671 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3672 * @brief Informs whether rfcomm server uuid is available or not.
3674 * This function is a synchronous call.
3676 * @return TRUE - RFCOMM uuid is available \n
3677 * FALSE - RFCOMM uuid is not available \n
3679 * @param[in] uuid UUID string
3685 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3688 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3689 * const char *remote_uuid)
3690 * @brief Connect to the remote device rfcomm *
3692 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3693 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3694 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3695 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3696 * initiating a connection.
3698 * @return BLUETOOTH_ERROR_NONE - Success \n
3699 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3700 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3701 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3702 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3703 * @param[in] bluetooth_device_address_t remote bt_address
3704 * @param[in] char remote uuid
3706 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3710 void bt_event_callback(int event, bluetooth_event_param_t *param)
3714 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3716 if (param->result >= BLUETOOTH_ERROR_NONE)
3718 bt_sdp_info_t *bt_sdp_info=param->param_data;
3720 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3721 bt_sdp_info->device_addr.addr[0],
3722 bt_sdp_info->device_addr.addr[1],
3723 bt_sdp_info->device_addr.addr[2],
3724 bt_sdp_info->device_addr.addr[3],
3725 bt_sdp_info->device_addr.addr[4],
3726 bt_sdp_info->device_addr.addr[5]);
3728 printf("Supported service list:\n");
3729 for(i=0; i<bt_sdp_info->service_index; i++)
3731 bt_sdp_info->service_list_array[i]);
3734 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3735 //rfcomm_test_uuid);
3739 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3741 bluetooth_rfcomm_connection_t *conn_ind =
3742 (bluetooth_rfcomm_connection_t *)param->param_data;
3744 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
3745 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3746 "SERVER" : "CLIENT");
3751 bluetooth_device_address_t remote_address = {{0},};
3752 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3753 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
3754 ret = bluetooth_search_service(&remote_address);
3756 printf("Seach failed, Reason = %d", ret);
3758 printf("Search Success, Ret = %d", ret);
3760 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3762 printf("Connection failed, Reason = %d", ret);
3764 printf("Connection Success, Ret = %d", ret);
3768 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3769 const char *remote_uuid);
3772 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3773 * @brief Disconnect rfcomm connection
3776 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3777 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3780 * @return BLUETOOTH_ERROR_NONE - Success \n
3781 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3782 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3783 * @param[in] char remote bt_address
3786 * @see bluetooth_rfcomm_connect
3790 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3792 printf("Disconnection failed");
3794 printf("Disconnection Success");
3799 int bluetooth_rfcomm_disconnect(int socket_fd);
3802 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3803 * @brief Write to rfcomm connection
3806 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3807 * API is used to send the data for server and the client.
3809 * @return BLUETOOTH_ERROR_NONE - Success \n
3810 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3811 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3813 * @param[in] const char *buff Data buffer to send
3814 * @param[in] int length Length of the data
3817 * @see bluetooth_rfcomm_connect
3820 char *buff = "Test data 123456789"
3821 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
3823 printf("Send failed");
3825 printf("Send success");
3829 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
3832 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
3833 * @brief Informs whether rfcomm client is connected.
3835 * This function is a synchronous call.
3837 * @return TRUE - RFCOMM client is connected \n
3838 * FALSE - RFCOMM client is not connected \n
3844 gboolean bluetooth_rfcomm_is_client_connected(void);
3845 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3846 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3849 * @fn int bluetooth_network_activate_server(void)
3850 * @brief Activate the NAP (Network Access Point) service
3852 * This function is a asynchronous call.
3853 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
3855 * @return BLUETOOTH_ERROR_NONE - Success \n
3856 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3857 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3858 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3861 * @see bluetooth_network_deactivate_server
3864 int bluetooth_network_activate_server(void);
3867 * @fn int bluetooth_network_deactivate_server(void)
3868 * @brief Deactivate the NAP (Network Access Point) service
3870 * This function is a asynchronous call.
3871 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
3873 * @return BLUETOOTH_ERROR_NONE - Success \n
3874 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3875 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3876 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3879 * @see bluetooth_network_activate_server
3882 int bluetooth_network_deactivate_server(void);
3885 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3886 * bluetooth_network_role_t role,
3888 * @brief Connect the network server in the peer
3890 * This function is a asynchronous call.
3891 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3893 * @return BLUETOOTH_ERROR_NONE - Success \n
3894 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3895 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3896 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3899 * @param[in] device_address This indicates an address of the device with which the pairing
3900 * should be initiated
3901 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
3902 * need to use the third parameter.
3903 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
3904 * connect. UUID string
3906 * @see bluetooth_network_disconnect
3908 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3909 bluetooth_network_role_t role, char *custom_uuid);
3912 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
3913 * bluetooth_network_role_t role,
3914 * char *custom_uuid)
3915 * @brief Connect the network server in the peer
3917 * This function is a asynchronous call.
3918 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3920 * @return BLUETOOTH_ERROR_NONE - Success \n
3921 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3922 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3923 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3926 * @param[in] device_address This indicates an address of the device with which the pairing
3927 * should be initiated
3929 * @see bluetooth_network_connect
3931 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
3934 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
3935 * @brief Disconnect the device from the network
3937 * This function is an asynchronous call.
3938 * The network server disconnect request is responded by
3939 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
3941 * @return BLUETOOTH_ERROR_NONE - Success \n
3942 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3943 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3944 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3947 * @param[in] device_address This indicates an address of the connected client device
3949 * @see bluetooth_network_activate_server
3951 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
3956 * @fn int bluetooth_hdp_activate(unsigned short data_type,
3957 * bt_hdp_role_type_t role,
3958 * bt_hdp_qos_type_t channel_type,
3959 * char **app_handle)
3960 * @brief Activate the HDP service for a particular data type
3962 * This function is a synchronous call.
3964 * @return BLUETOOTH_ERROR_NONE - Success \n
3965 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3966 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3967 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3970 * @param[in] data_type The data type against corresponding service
3971 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
3972 * @param[in] channel_type The QOS type for the channel.
3973 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
3974 * For role = HDP_ROLE_SINK, the channel_type
3975 * should be HDP_QOS_ANY.
3976 * @param[out] app_handle The application handler against corresponding service
3978 * @see bluetooth_hdp_deactivate
3980 int bluetooth_hdp_activate(unsigned short data_type,
3981 bt_hdp_role_type_t role,
3982 bt_hdp_qos_type_t channel_type,
3985 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
3986 * @brief Deactivate the HDP service for a particular service using the handler
3988 * This function is a synchronous call.
3990 * @return BLUETOOTH_ERROR_NONE - Success \n
3991 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3992 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3993 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3996 * @param[in] app_handle The application handler against corresponding service
3998 * @see bluetooth_hdp_deactivate
4000 int bluetooth_hdp_deactivate(const char *app_handle);
4003 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4004 * const char *buffer, unsigned int size)
4005 * @brief Send data to the remote HDP device
4007 * This function is a synchronous call.
4009 * @return BLUETOOTH_ERROR_NONE - Success \n
4010 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4011 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4012 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4013 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4016 * @param[in] channel_id The channel id for the connection.
4017 * @param[in] buffer The pdu buffer.
4018 * @param[in] size Size of the buffer.
4020 * @see bluetooth_hdp_connect
4022 int bluetooth_hdp_send_data(unsigned int channel_id,
4023 const char *buffer, unsigned int size);
4025 * @fn int bluetooth_hdp_connect(const char *app_handle,
4026 * bt_hdp_qos_type_t channel_type,
4027 * const bluetooth_device_address_t *device_address)
4028 * @brief Connect to the remote device(Mainly used by source)
4030 * This function is a asynchronous call.
4031 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4033 * @return BLUETOOTH_ERROR_NONE - Success \n
4034 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4035 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4036 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4037 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4040 * @param[in] app_handle The application handler against corresponding service
4041 * @param[in] channel_type The QOS type for the channel.
4042 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4043 * @param[in] device_address The remote device Bd address.
4046 * @see bluetooth_hdp_disconnect
4048 int bluetooth_hdp_connect(const char *app_handle,
4049 bt_hdp_qos_type_t channel_type,
4050 const bluetooth_device_address_t *device_address);
4052 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4053 * const bluetooth_device_address_t *device_address)
4054 * @brief Disconnect from the remote device(Mainly used by source)
4056 * This function is a asynchronous call.
4057 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4059 * @return BLUETOOTH_ERROR_NONE - Success \n
4060 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4061 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4062 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4063 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4066 * @param[in] channel_id The channel id for the connection.
4067 * @param[in] device_address The remote device Bd address.
4070 * @see bluetooth_hdp_connect
4072 int bluetooth_hdp_disconnect(unsigned int channel_id,
4073 const bluetooth_device_address_t *device_address);
4077 * @fn int bluetooth_opc_init(void)
4078 * @brief Initialize OPP client.
4080 * This function is a synchronous call.
4081 * No event corresponding to this api
4083 * @return BLUETOOTH_ERROR_NONE - Success \n
4084 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4085 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4086 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4087 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4092 * @see bluetooth_opc_deinit
4094 int bluetooth_opc_init(void);
4097 * @fn int bluetooth_opc_deinit(void)
4098 * @brief Deinitialize OPP client.
4100 * This function is a synchronous call.
4101 * No event corresponding to this api
4103 * @return BLUETOOTH_ERROR_NONE - Success \n
4104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4105 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4110 * @see bluetooth_opc_init
4113 int bluetooth_opc_deinit(void);
4116 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4117 char **file_name_array)
4118 * @brief Send multiple files to a remote device.
4120 * This function is a asynchronous call.
4121 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4123 * @return BLUETOOTH_ERROR_NONE - Success \n
4124 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4125 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4126 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4127 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4128 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4129 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4132 * @param[in] device_address The remote device Bd address.
4133 * @param[in] file_name_array Array of filepaths to be sent.
4136 * @see bluetooth_opc_cancel_push
4139 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4140 char **file_name_array);
4143 * @fn int bluetooth_opc_cancel_push(void)
4144 * @brief Cancels the ongoing file push.
4146 * This function is a asynchronous call.
4147 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4148 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4150 * @return BLUETOOTH_ERROR_NONE - Success \n
4151 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4152 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4157 * @see bluetooth_opc_push_files
4160 int bluetooth_opc_cancel_push(void);
4163 * @fn gboolean bluetooth_opc_session_is_exist(void)
4164 * @brief Informs whether opc session exists or not.
4166 * This function is a synchronous call.
4168 * @return TRUE - OPC session exists \n
4169 * FALSE - OPC session does not exist \n
4177 gboolean bluetooth_opc_session_is_exist(void);
4180 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4181 * @brief Informs whether opc session exists or not.
4183 * This function is a synchronous call.
4185 * @return BLUETOOTH_ERROR_NONE - Success \n
4186 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4187 * BLUETOOTH_ERROR_INTERNAL \n
4190 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4195 int bluetooth_opc_is_sending(gboolean *is_sending);
4198 * @fn int bluetooth_obex_server_init(const char *dst_path)
4199 * @brief Initialize OPP and FTP server.
4201 * This function is a synchronous call.
4202 * No event corresponding to this api
4204 * @return BLUETOOTH_ERROR_NONE - Success \n
4205 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4206 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4207 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4208 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4211 * @param[in] dst_path OPS destination file path.
4213 * @see bluetooth_obex_server_deinit
4215 int bluetooth_obex_server_init(const char *dst_path);
4219 * @fn int bluetooth_obex_server_deinit(void)
4220 * @brief Deinitialize OPP and FTP server.
4222 * This function is a synchronous call.
4223 * No event corresponding to this api
4225 * @return BLUETOOTH_ERROR_NONE - Success \n
4226 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4227 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4232 * @see bluetooth_obex_server_init
4234 int bluetooth_obex_server_deinit(void);
4238 * @fn gboolean bluetooth_obex_server_is_activated(void)
4239 * @brief Informs whether obex server is activated or not.
4241 * This function is a synchronous call.
4243 * @return TRUE - OBEX server is activated \n
4244 * FALSE - OBEX server is not activated \n
4251 gboolean bluetooth_obex_server_is_activated(void);
4255 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4256 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4258 * This function is a synchronous call.
4259 * No event corresponding to this api
4261 * @return BLUETOOTH_ERROR_NONE - Success \n
4262 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4263 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4264 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4265 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4269 * @param[in] dst_path OPS destination file path.
4271 * @see bluetooth_obex_server_deinit_without_agent
4273 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4277 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4278 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4280 * This function is a synchronous call.
4281 * No event corresponding to this api
4283 * @return BLUETOOTH_ERROR_NONE - Success \n
4284 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4285 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4290 * @see bluetooth_obex_server_init_without_agent
4292 int bluetooth_obex_server_deinit_without_agent(void);
4296 * @fn int bluetooth_obex_server_accept_connection(void)
4297 * @brief Accepts the authorization request indicated by the event
4298 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4300 * This function is a synchronous call.
4302 * @return BLUETOOTH_ERROR_NONE - Success \n
4303 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4304 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4308 * @see bluetooth_obex_server_reject_authorize
4310 int bluetooth_obex_server_accept_connection(void);
4314 * @fn int bluetooth_obex_server_reject_connection(void)
4315 * @brief Rejects the authorization request indicated by the event
4316 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4318 * This function is a synchronous call.
4320 * @return BLUETOOTH_ERROR_NONE - Success \n
4321 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4322 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4326 * @see bluetooth_obex_server_reject_authorize
4328 int bluetooth_obex_server_reject_connection(void);
4332 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4333 * @brief Accepts the authorization request indicated by the event
4334 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4336 * This function is a asynchronous call.
4337 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4339 * @return BLUETOOTH_ERROR_NONE - Success \n
4340 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4341 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4342 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4345 * @param[in] filename Authorized filename.
4348 * @see bluetooth_obex_server_reject_authorize
4351 int bluetooth_obex_server_accept_authorize(const char *filename);
4354 * @fn int bluetooth_obex_server_reject_authorize(void)
4355 * @brief Reject the authorization request indicated by the event
4356 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4358 * This function is a asynchronous call.
4359 * No event for this api..
4361 * @return BLUETOOTH_ERROR_NONE - Success \n
4362 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4363 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4368 * @see bluetooth_obex_server_accept_authorize
4371 int bluetooth_obex_server_reject_authorize(void);
4374 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4375 * @brief Set the OPS destination file path..
4377 * This function is a asynchronous call.
4378 * No event for this api..
4380 * @return BLUETOOTH_ERROR_NONE - Success \n
4381 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4382 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4383 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4386 * @param[in] dst_path OPS destination file path.
4392 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4395 * @fn int bluetooth_obex_server_set_root(const char *root)
4396 * @brief Set the FTS root folder..
4398 * This function is a asynchronous call.
4399 * No event for this api..
4401 * @return BLUETOOTH_ERROR_NONE - Success \n
4402 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4403 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4404 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4405 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4406 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4409 * @param[in] root FTS root folder.
4415 int bluetooth_obex_server_set_root(const char *root);
4418 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4419 * @brief Cancel the transfer on server
4421 * This function is an asynchronous call.
4422 * If the function call that cancels transfer is successful, the application would receive
4423 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4424 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4425 * the error code will be BLUETOOTH_ERROR_NONE
4427 * @return BLUETOOTH_ERROR_NONE - Success \n
4428 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4429 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4430 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4431 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4434 * @param[in] transfer_id transfer ID
4439 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4443 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4444 * @brief Cancel the transfer on server
4446 * This function is an asynchronous call.
4447 * If the function call that cancels transfer is successful, the application would receive
4448 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4449 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4450 * the error code will be BLUETOOTH_ERROR_NONE
4452 * @return BLUETOOTH_ERROR_NONE - Success \n
4453 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4454 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4455 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4456 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4463 int bluetooth_obex_server_cancel_all_transfers(void);
4467 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4468 * @brief Informs whether obex server is receiving or not.
4470 * This function is a synchronous call.
4472 * @return BLUETOOTH_ERROR_NONE - Success \n
4473 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4474 * BLUETOOTH_ERROR_INTERNAL \n
4477 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4482 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4486 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4487 * @brief Read the local Hash and Randmizer.
4489 * This function is a synchronous call.
4491 * @return BLUETOOTH_ERROR_NONE - Success \n
4492 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4496 * @param[out] local_oob_data - Pointer to the local OOB data
4502 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4506 * @fn int bluetooth_oob_add_remote_data(
4507 * const bluetooth_device_address_t *remote_device_address,
4508 * bt_oob_data_t *oob_data)
4509 * @brief Add/updated the remote device Hash and Randmizer.
4511 * This function is a synchronous call.
4512 * No event for this api..
4514 * @return BLUETOOTH_ERROR_NONE - Success \n
4515 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4518 * @param[in] remote_device_address - Remote device address
4519 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4525 int bluetooth_oob_add_remote_data(
4526 const bluetooth_device_address_t *remote_device_address,
4527 bt_oob_data_t *remote_oob_data);
4531 * @fn int bluetooth_oob_remove_remote_data(
4532 * const bluetooth_device_address_t *remote_device_address)
4533 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4535 * This function is a synchronous call.
4536 * No event for this api..
4538 * @return BLUETOOTH_ERROR_NONE - Success \n
4539 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4542 * @param[in] remote_device_address - Remote device address
4548 int bluetooth_oob_remove_remote_data(
4549 const bluetooth_device_address_t *remote_device_address);
4552 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4553 * bt_gatt_handle_info_t *prim_svc);
4555 * @brief Gets the GATT based primary services handle supported by remote device
4557 * This function is a synchronous call.
4558 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4560 * @return BLUETOOTH_ERROR_NONE - Success \n
4561 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4562 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4563 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4566 * @param[in] address - Remote device address
4567 * @param[out] prim_svc - Structure containing remote service count and handle list.
4570 * @see bluetooth_gatt_free_primary_services()
4572 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4573 bt_gatt_handle_info_t *prim_svc);
4576 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4578 * @brief Discovers the characteristics of GATT based service of remote device
4580 * This function is an asynchronous call.
4581 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4583 * @return BLUETOOTH_ERROR_NONE - Success \n
4584 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4585 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4586 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4589 * @param[in] service_handle - Handle for remote service.
4594 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4597 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4598 * bt_gatt_service_property_t *service);
4600 * @brief Gets the properties of GATT based service of remote device
4602 * This function is a synchronous call.
4603 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4605 * @return BLUETOOTH_ERROR_NONE - Success \n
4606 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4607 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4608 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4611 * @param[in] service_handle - Handle for remote service.
4612 * @param[out] service - Structure containing remote service property.
4615 * @see bluetooth_gatt_free_service_property()
4617 int bluetooth_gatt_get_service_property(const char *service_handle,
4618 bt_gatt_service_property_t *service);
4621 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4623 * @brief Register to GATT based service to receive value change notification/indication.
4625 * This function is a synchronous call.
4626 * No event for this api.
4628 * @return BLUETOOTH_ERROR_NONE - Success \n
4629 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4630 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4631 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4634 * @param[in] service_handle - Handle for remote service.
4639 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4642 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4644 * @brief Unregister GATT based service to receive value change notification/indication.
4646 * This function is a synchronous call.
4647 * No event for this api.
4649 * @return BLUETOOTH_ERROR_NONE - Success \n
4650 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4651 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4652 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4655 * @param[in] service_handle - Handle for remote service.
4660 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4663 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4664 * bt_gatt_char_property_t *characteristic);
4666 * @brief Provides characteristic value along with properties.
4668 * This function is a synchronous call.
4669 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4671 * @return BLUETOOTH_ERROR_NONE - Success \n
4672 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4673 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4674 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4677 * @param[in] char_handle - Handle for Characteristic property.
4678 * @param[out] characteristic - Structure containing remote characteristic property.
4681 * @see bluetooth_gatt_free_char_property()
4683 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4684 bt_gatt_char_property_t *characteristic);
4687 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4688 * bt_gatt_char_property_t *characteristic);
4690 * @brief Provides characteristic descriptor value along with its UUID.
4692 * This function is a synchronous call.
4693 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4695 * @return BLUETOOTH_ERROR_NONE - Success \n
4696 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4697 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4698 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4701 * @param[in] desc_handle - Handle for Characteristic descriptor.
4702 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4705 * @see bluetooth_gatt_free_desc_property()
4707 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4708 bt_gatt_char_descriptor_property_t *descriptor);
4712 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4713 * const guint8 *value, int length)
4715 * @brief Set characteristic value.
4717 * This function is a synchronous call.
4719 * @return BLUETOOTH_ERROR_NONE - Success \n
4720 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4721 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4722 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4725 * @param[in] char_handle - Handle for Characteristic property.
4726 * @param[in] value - New value to set for characteristic property.
4727 * @param[in] length - Length of the value to be set.
4732 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4733 const guint8 *value, int length);
4736 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4737 * const guint8 *value, int length, guint8 write_type)
4739 * @brief Set characteristic value by write type.
4741 * This function is a synchronous call if write type is "write without resonse"
4742 * and it is an asynchronous call if write type is "write with response"
4744 * @return BLUETOOTH_ERROR_NONE - Success \n
4745 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4746 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4747 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4750 * @param[in] char_handle - Handle for Characteristic property.
4751 * @param[in] value - New value to set for characteristic property.
4752 * @param[in] length - Length of the value to be set.
4753 * @param[in] write_type - Type of write.
4758 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4759 const guint8 *value, int length, guint8 write_type);
4763 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4764 * const guint8 *value, int length)
4766 * @brief Set characteristic value request.
4768 * This function is an asynchronous call.
4770 * @return BLUETOOTH_ERROR_NONE - Success \n
4771 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4772 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4773 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4776 * @param[in] char_handle - Handle for Characteristic property.
4777 * @param[in] value - New value to set for characteristic property.
4778 * @param[in] length - Length of the value to be set.
4783 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4784 const guint8 *value, int length);
4787 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4789 * @brief Read characteristic value.
4791 * This function is a asynchronous call.
4793 * @return BLUETOOTH_ERROR_NONE - Success \n
4794 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4795 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4796 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4799 * @param[in] char_handle - Handle for Characteristic property.
4804 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
4807 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4808 * const char *service_uuid,
4809 * bt_gatt_service_property_t *service)
4811 * @brief Gets the service property from a device based on a particular uuid
4813 * This function is a synchronous call.
4815 * @return BLUETOOTH_ERROR_NONE - Success \n
4816 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4817 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4818 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4821 * @param[in] address - BD address of the remote device
4822 * @param[in] service_uuid - uuid of the service.
4823 * @param[out] service - Structure containing the service property.
4828 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4829 const char *service_uuid,
4830 bt_gatt_service_property_t *service);
4833 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4834 * const char *char_uuid)
4836 * @brief Gets the characteristic property from a service based on a particular char uuid
4838 * This function is an asynchronous call.
4839 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
4841 * @return BLUETOOTH_ERROR_NONE - Success \n
4842 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4843 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4844 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4847 * @param[in] service_handle - Service handle.
4848 * @param[in] uuid - Characteristic uuid.
4853 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4854 const char *char_uuid);
4857 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4859 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
4861 * This function is a synchronous call.
4862 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
4864 * @return BLUETOOTH_ERROR_NONE - Success \n
4865 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4868 * @param[in] prim_svc - GATT handle info structure
4871 * @see bluetooth_gatt_get_primary_services()
4873 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4876 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4878 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
4880 * This function is a synchronous call.
4881 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
4883 * @return BLUETOOTH_ERROR_NONE - Success \n
4884 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4887 * @param[in] svc_pty - GATT service property structure.
4890 * @see bluetooth_gatt_get_service_property()
4892 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4895 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4897 * @brief Provides characteristic value along with properties.
4899 * This function is a synchronous call.
4900 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4902 * @return BLUETOOTH_ERROR_NONE - Success \n
4903 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4906 * @param[in] char_pty - GATT characteristics property structure.
4909 * @see bluetooth_gatt_get_characteristics_property()
4911 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4914 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4916 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
4918 * This function is a synchronous call.
4919 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
4921 * @return BLUETOOTH_ERROR_NONE - Success \n
4922 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4925 * @param[in] desc_pty - GATT characteristics descriptor property structure.
4928 * @see bluetooth_gatt_get_char_descriptor_property()
4930 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4933 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
4935 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
4938 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4940 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
4942 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4944 * @return BLUETOOTH_ERROR_NONE - Success \n
4945 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4948 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
4952 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4955 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
4957 * @brief Read characteristic descriptor value.
4959 * This function is a asynchronous call.
4961 * @return BLUETOOTH_ERROR_NONE - Success \n
4962 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4963 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4964 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4967 * @param[in] desc_handle - Handle for Characteristic descriptor
4972 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
4975 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4976 * const guint8 *value, int length);
4978 * @brief Set characteristic descriptor value.
4980 * This function is a asynchronous call.
4982 * @return BLUETOOTH_ERROR_NONE - Success \n
4983 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4984 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4985 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4988 * @param[in] desc_handle - Handle for Characteristic descriptor
4989 * @param[in] value - New value to set for characteristic descriptor
4990 * @param[in] length - Length of the value to be set.
4995 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4996 const guint8 *value, int length);
4998 /* @fn int bluetooth_gatt_init(void)
5000 * @brief Initializes the gatt service.
5002 * This function is a synchronous call.
5003 * @return BLUETOOTH_ERROR_NONE - Success \n
5004 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5005 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5006 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5009 * @remark Adapter should be enabled
5010 * @see bluetooth_gatt_deinit()
5012 int bluetooth_gatt_init(void);
5014 /* @fn int bluetooth_gatt_init(void)
5016 * @brief DeInitializes the gatt service.
5018 * This function is a synchronous call.
5019 * @return BLUETOOTH_ERROR_NONE - Success \n
5020 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5021 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5022 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5025 * @remark Adapter should be enabled
5026 * @see bluetooth_gatt_init()
5028 int bluetooth_gatt_deinit(void);
5030 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5031 unsigned char **svc_path)
5033 * @brief Exports a new gatt service to the service interface.
5035 * This function is a synchronous call.
5037 * @return BLUETOOTH_ERROR_NONE - Success \n
5038 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5039 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5040 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5043 * @param[in] svc_uuid Gatt service uuid.
5044 * @param[out] svc_path service object path of the exported service.
5045 * @remark Adapter should be enabled
5046 * @see bluetooth_gatt_init()
5048 int bluetooth_gatt_add_service(const char *svc_uuid,
5051 /* @fn int bluetooth_gatt_add_new_characteristic(
5052 const char *svc_path, const char *char_uuid,
5053 bt_gatt_permission_t permissions,
5054 bt_gatt_characteristic_property_t properties,
5055 int flags_length, char **char_path);;
5057 * @brief Exports a new gatt characteristic to the characteristic interface.
5059 * This function is a synchronous call.
5060 * @return BLUETOOTH_ERROR_NONE - Success \n
5061 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5062 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5063 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5065 * @param[in] svc_path service object path of the exported service.
5066 * @param[in] char_uuid Gatt service uuid.
5067 * @param[in] properties GATT characteristic properties.
5068 * @param[out] char_path characteristic object path of the exported characteristic.
5070 * @remark Adapter should be enabled
5071 * @see bluetooth_gatt_add_service()
5073 int bluetooth_gatt_add_new_characteristic(
5074 const char *svc_path, const char *char_uuid,
5075 bt_gatt_permission_t permissions,
5076 bt_gatt_characteristic_property_t properties,
5079 /* @fn bluetooth_gatt_set_characteristic_value(
5080 const char *characteristic, const char *char_value,
5083 * @brief adds gatt charactertisic value to the given charactertistic path.
5085 * This function is a synchronous call.
5086 * @return BLUETOOTH_ERROR_NONE - Success \n
5087 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5088 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5089 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5091 * @param[in] char_value Value of the GATT characteristic to be added.
5092 * @param[in] value_length length of the chantacteristic value..
5093 * @param[out] characteristic characteristic object path..
5095 * @remark Adapter should be enabled
5096 * @see bluetooth_gatt_add_service()
5098 int bluetooth_gatt_set_characteristic_value(
5099 const char *characteristic, const char *char_value,
5102 /* @fn int bluetooth_gatt_add_descriptor(
5103 const char *char_path, const char *desc_uuid,
5104 bt_gatt_permission_t permissions,
5107 * @brief Exports a new gatt descriptor to the descriptor interface.
5109 * This function is a synchronous call.
5111 * @return BLUETOOTH_ERROR_NONE - Success \n
5112 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5113 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5114 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5117 * @param[in] desc_uuid Gatt descriptor uuid.
5118 * @param[in] desc_value GATT descriptor value.
5119 * @param[in] value_length Length of GATT descriptor value.
5120 * @param[in] permissions descriptor permissions.
5121 * @param[in] properties GATT descriptor properties.
5122 * @param[in] char_path characteristics object path of the exported character.
5124 * @remark Adapter should be enabled
5125 * @see bluetooth_gatt_add_service()
5126 * @see bluetooth_gatt_add_characteristics()
5128 int bluetooth_gatt_add_descriptor(
5129 const char *char_path, const char *desc_uuid,
5130 bt_gatt_permission_t permissions,
5133 /* @fn int bluetooth_gatt_set_descriptor_value(
5134 const char *desc_path, const char *desc_value,
5137 * @brief Adds value to the given descriptor handle.
5139 * This function is a synchronous call.
5141 * @return BLUETOOTH_ERROR_NONE - Success \n
5142 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5143 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5144 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5147 * @param[in] desc_value GATT descriptor value.
5148 * @param[in] value_length Length of GATT descriptor value.
5149 * @param[in] desc_path descriptor path to which the value needs to be added.
5151 * @remark Adapter should be enabled
5152 * @see bluetooth_gatt_add_service()
5153 * @see bluetooth_gatt_add_characteristics()
5155 int bluetooth_gatt_set_descriptor_value(
5156 const char *desc_path, const char *desc_value,
5159 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5161 * @brief Reads the Service registered on manager interface.
5163 * This function is a synchronous call.
5165 * @return BLUETOOTH_ERROR_NONE - Success \n
5166 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5167 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5168 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5171 * @param[in] svc_uuid Gatt Service uuid.
5173 * @remark Adapter should be enabled and service should be registered.
5174 * @see bluetooth_gatt_register_service()
5176 int bluetooth_gatt_get_service(const char *svc_uuid);
5178 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5180 * @brief Registers the given service path with the bluez gatt server.
5182 * This function is a synchronous call.
5184 * @return BLUETOOTH_ERROR_NONE - Success \n
5185 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5186 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5187 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5190 * @param[in] svc_path service object path of the exported service.
5192 * @remark Adapter should be enabled
5193 * @see bluetooth_gatt_add_service()
5194 * @see bluetooth_gatt_add_characteristics()
5195 * @see bluetooth_gatt_add_descriptor()
5196 * @see bluetooth_gatt_register_application()
5198 int bluetooth_gatt_register_service(const char *svc_path);
5200 /* @fn int bluetooth_gatt_register_application(void)
5202 * @brief Registers the application with the bluez gatt server.
5204 * This function is a synchronous call.
5206 * @return BLUETOOTH_ERROR_NONE - Success \n
5207 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5208 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5209 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5213 * @remark Adapter should be enabled
5214 * @see bluetooth_gatt_init()
5215 * @see bluetooth_gatt_add_service()
5216 * @see bluetooth_gatt_add_characteristics()
5217 * @see bluetooth_gatt_add_descriptor()
5218 * @see bluetooth_gatt_register_service()
5220 int bluetooth_gatt_register_application(void);
5222 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5224 * @brief Removes(unregister) service from the bluez gatt server db.
5226 * This function is a synchronous call.
5228 * @return BLUETOOTH_ERROR_NONE - Success \n
5229 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5230 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5231 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5234 * @param[in] svc_path service object path of the exported service.
5236 * @remark Adapter should be enabled
5237 * @see bluetooth_gatt_add_service()
5238 * @see bluetooth_gatt_add_characteristics()
5239 * @see bluetooth_gatt_add_descriptor()
5240 * @see bluetooth_gatt_register_service()
5242 int bluetooth_gatt_unregister_service(const char *svc_path);
5244 /* @fn int bluetooth_gatt_unregister_application(void)
5246 * @brief Removes(unregister) the application with the bluez gatt server,
5247 * and deletes all the service registered.
5249 * This function is a synchronous call.
5251 * @return BLUETOOTH_ERROR_NONE - Success \n
5252 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5253 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5254 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5258 * @remark Adapter should be enabled
5259 * @see bluetooth_gatt_init()
5260 * @see bluetooth_gatt_add_service()
5261 * @see bluetooth_gatt_add_characteristics()
5262 * @see bluetooth_gatt_add_descriptor()
5263 * @see bluetooth_gatt_register_service()
5264 * @see bluetooth_gatt_unregister_service()
5266 int bluetooth_gatt_unregister_application(void);
5268 /* @fn int bluetooth_gatt_send_response(int request_id,
5269 * int offset, char *value, int value_length)
5271 * @brief Updates the attribute value in local attribute list.
5273 * This function is a synchronous call.
5275 * @return BLUETOOTH_ERROR_NONE - Success \n
5276 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5277 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5278 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5281 * @param[in] request_id The identification of a read request
5282 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5283 * @param[in] resp_state The identification of response state
5284 * @param[in] offset The offset from where a value is read
5285 * @param[in] value The value to be sent. It will be sent from @a offset.
5286 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5287 * @param[in] value_length Value Length.
5289 * @remark Adapter should be enabled
5290 * @see bluetooth_gatt_add_service()
5291 * @see bluetooth_gatt_add_characteristics()
5292 * @see bluetooth_gatt_add_descriptor()
5293 * @see bluetooth_gatt_register_service()
5295 int bluetooth_gatt_send_response(int request_id, guint req_type,
5296 int resp_state, int offset, char *value, int value_length);
5298 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5300 * @brief Sets the notification property for a characteristic.
5302 * This function is a synchronous call.
5304 * @return BLUETOOTH_ERROR_NONE - Success \n
5305 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5306 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5307 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5310 * @param[in] char_path characteristic object path.
5311 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5313 * @remark Adapter should be enabled
5314 * @see bluetooth_gatt_update_characteristic()
5316 int bluetooth_gatt_server_set_notification(const char *char_path,
5317 bluetooth_device_address_t *unicast_address);
5319 /* @fn int bluetooth_gatt_delete_services(void)
5321 * @brief deletes (unregisters) all services from the gatt server database..
5323 * This function is a synchronous call.
5325 * @return BLUETOOTH_ERROR_NONE - Success \n
5326 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5327 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5328 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5332 * @remark Adapter should be enabled
5333 * @see bluetooth_gatt_add_service()
5334 * @see bluetooth_gatt_add_characteristics()
5335 * @see bluetooth_gatt_add_descriptor()
5336 * @see bluetooth_gatt_register_service()
5337 * @see bluetooth_gatt_unregister_service()
5339 int bluetooth_gatt_delete_services(void);
5341 /* @fn int bluetooth_gatt_update_characteristic(void)
5343 * @brief updates the given characteristic with a new value
5345 * This function is a synchronous call.
5347 * @return BLUETOOTH_ERROR_NONE - Success \n
5348 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5349 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5350 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5354 * @remark Adapter should be enabled
5355 * @see bluetooth_gatt_add_service()
5356 * @see bluetooth_gatt_add_characteristics()
5357 * @see bluetooth_gatt_add_descriptor()
5358 * @see bluetooth_gatt_register_service()
5359 * @see bluetooth_gatt_unregister_service()
5361 int bluetooth_gatt_update_characteristic(const char *char_path,
5362 const char* char_value, int value_length);
5365 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5367 * @brief Set advertising status.
5369 * This function is used to enable or disable LE advertising.
5370 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5372 * This function is a synchronous call.
5374 * @return BLUETOOTH_ERROR_NONE - Success \n
5375 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5376 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5379 * @param[in] enable - The status of advertising
5382 * @see bluetooth_set_advertising_data
5384 int bluetooth_set_advertising(int handle, gboolean enable);
5387 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5389 * @brief Set advertising status along with interval value.
5391 * This function is used to enable or disable LE advertising.
5392 * Interval_min and Interval_max is used to set the best advertising interval.
5393 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5395 * This function is a synchronous call.
5397 * @return BLUETOOTH_ERROR_NONE - Success \n
5398 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5399 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5402 * @param[in] enable - The status of advertising
5403 * @param[in] interval_min - Minimum interval of advertising (msec)
5404 * @param[in] interval_max - Maximum interval of advertising (msec)
5405 * @param[in] filter_policy - Advertising filter policy
5408 * @see bluetooth_set_advertising_data
5410 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5411 bluetooth_advertising_params_t *params);
5414 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5415 * @brief Get the advertising data
5417 * This function is used to get advertising data.
5418 * Before calling this API, the adapter should be enabled.
5420 * This function is a synchronous call.
5422 * @return BLUETOOTH_ERROR_NONE - Success \n
5423 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5424 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5425 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5427 * @param[out] value - Advertising data structure.
5428 * @param[out] length - The length of Advertising data.
5432 bluetooth_advertising_data_t *value = { {0} };
5435 ret = bluetooth_get_advertising_data(&value, &length);
5438 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5441 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5443 * @brief Set advertising data with value
5445 * This function is used to set advertising data and Maximum size of advertising data
5446 * is 28 byte (Except Flag)
5448 * This function is a synchronous call.
5450 * @return BLUETOOTH_ERROR_NONE - Success \n
5451 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5452 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5455 * @param[in] value - Advertising data structure.
5459 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5462 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5464 * @brief Check the privilege for advertising parameter setting
5466 * This function is a synchronous call.
5468 * @return BLUETOOTH_ERROR_NONE - Success \n
5469 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5475 int bluetooth_check_privilege_advertising_parameter(void);
5478 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5479 * @brief Get the LE scan response data
5481 * This function is used to get scan response data.
5482 * Before calling this API, the adapter should be enabled.
5484 * This function is a synchronous call.
5486 * @return BLUETOOTH_ERROR_NONE - Success \n
5487 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5488 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5489 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5491 * @param[out] value - Scan response data structure.
5492 * @param[out] length - The length of Scan response data.
5496 bluetooth_scan_resp_data_t *value = { {0} };
5499 ret = bluetooth_get_scan_response_data(&value, &length);
5502 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5505 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5507 * @brief Set scan response data with value
5509 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5511 * This function is a synchronous call.
5513 * @return BLUETOOTH_ERROR_NONE - Success \n
5514 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5515 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5518 * @param[in] value - LE Scan response data structure.
5522 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5525 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5527 * @brief Set scan interval and window
5529 * This function is used to set LE scan interval and window size
5531 * This function is a synchronous call.
5533 * @return BLUETOOTH_ERROR_NONE - Success \n
5534 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5535 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5538 * @param[in] interval - Interval of LE scan (msec)
5539 * @param[in] window - Window size of LE scan (msec)
5543 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5546 * @fn int bluetooth_is_advertising(void)
5547 * @brief Check for the advertising is in-progress or not.
5549 * This API is used to check the current status of the advertising procedure.
5550 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5553 * This function checks whether the advertising is started or not.
5555 * This function is a synchronous call.
5557 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5559 * @return BLUETOOTH_ERROR_NONE - Success \n
5560 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5563 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5567 gboolean is_advertising = 0;
5569 ret = bluetooth_is_advertising(&is_advertising);
5572 int bluetooth_is_advertising(gboolean *is_advertising);
5575 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5576 * @brief Add LE device to white list
5578 * This API is used to add LE device to white list
5579 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5583 * This function is a synchronous call.
5585 * @param[in] address The address of remote device
5587 * @return BLUETOOTH_ERROR_NONE - Success \n
5588 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5591 * @see bluetooth_set_custom_advertising
5593 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5596 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5597 * @brief Remove LE device from white list
5599 * This API is used to remove LE device from white list
5600 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5604 * This function is a synchronous call.
5606 * @param[in] address The address of remote device
5608 * @return BLUETOOTH_ERROR_NONE - Success \n
5609 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5612 * @see bluetooth_set_custom_advertising
5614 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5617 * @fn int bluetooth_clear_white_list(void)
5618 * @brief Clear white list
5620 * This API is used to clear white list
5621 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5625 * This function is a synchronous call.
5627 * @param[in] address The address of remote device
5629 * @return BLUETOOTH_ERROR_NONE - Success \n
5630 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5633 * @see bluetooth_set_custom_advertising
5635 int bluetooth_clear_white_list(void);
5638 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5639 * const bluetooth_le_connection_param_t *parameters)
5640 * @brief update connection paramter of LE connection.
5642 * This function is a synchronous call.
5644 * @return BLUETOOTH_ERROR_NONE - Success \n
5645 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5648 * @param[in] address - remote device address value.
5649 * @param[in] parameters - new connection parameters.
5652 * @see bluetooth_bond_device
5654 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5655 const bluetooth_le_connection_param_t *parameters);
5659 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5661 * @brief Enable/Disable LE Privacy feature.
5663 * This function is used to enable or disable LE Privacy feature.
5664 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5666 * This function is a synchronous call.
5668 * @return BLUETOOTH_ERROR_NONE - Success \n
5669 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5670 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5673 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5677 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5680 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
5681 * bluetooth_le_connection_mode_t mode)
5682 * @brief update connection paramter of LE connection.
5684 * This function is a synchronous call.
5686 * @return BLUETOOTH_ERROR_NONE - Success \n
5687 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5688 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5691 * @param[in] address - remote device address value.
5692 * @param[in] mode - new connection mode.
5696 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
5697 bluetooth_le_connection_mode_t mode);
5700 * @fn int bluetooth_le_read_maximum_data_length()
5701 * @brief reads the maximum LE data length supported in the controller.
5703 * This function is a synchronous call.
5705 * @return BLUETOOTH_ERROR_NONE - Success \n
5706 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5712 int bluetooth_le_read_maximum_data_length(
5713 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
5715 * @fn int bluetooth_le_write_host_suggested_default_data_length()
5716 * @brief writes the host suggested values for the controllers max transmitted no of payload
5717 * octects to be used for new connections.
5719 * This function is a synchronous call.
5721 * @return BLUETOOTH_ERROR_NONE - Success \n
5722 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5728 int bluetooth_le_write_host_suggested_default_data_length(
5729 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
5731 int bluetooth_le_read_suggested_default_data_length(
5732 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
5734 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
5735 const unsigned int max_tx_octets, const unsigned int max_tx_time);
5737 int bluetooth_pbap_init(void);
5738 int bluetooth_pbap_deinit(void);
5739 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
5740 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
5741 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
5742 bt_pbap_folder_t *folder);
5743 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
5744 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
5745 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
5746 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
5747 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
5748 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
5749 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
5750 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
5753 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5755 * @brief Set manufacturer data with value
5757 * This function is used to set manufacturer data.
5759 * This function is a synchronous call.
5761 * @return BLUETOOTH_ERROR_NONE - Success \n
5762 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5763 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5766 * @param[in] value - Manufacturer data structure.
5770 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5772 #ifdef TIZEN_DPM_VCONF_ENABLE
5774 * @fn int bluetooth_dpm_is_mode_allowed(void);
5776 * @brief Checks Restriction for BT mode(BT allowed or not)
5778 * This function is a synchronous call.
5780 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5781 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5782 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5789 int bluetooth_dpm_is_mode_allowed(void);
5793 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
5795 * @brief Sets Restriction for BT mode(BT allowed or not)
5797 * This function is a synchronous call.
5799 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5800 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5801 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5804 * @param[in] value - BT Allow value.
5805 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
5806 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
5807 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
5808 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
5812 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
5815 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
5817 * @brief Reads the Restriction for BT mode(BT allowed or not)
5819 * This function is a synchronous call.
5821 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5822 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5823 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5827 * @param[out] value - BT Allow value.
5828 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
5829 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
5830 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
5831 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
5835 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
5838 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
5840 * @brief Sets the Restriction for device.
5842 * This function is a synchronous call.
5844 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5845 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5846 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5849 * @param[in] value - State value.
5850 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5851 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5855 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
5858 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
5860 * @brief Reads the Restriction for device.
5862 * This function is a synchronous call.
5864 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5865 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5866 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5870 * @param[out] value - State value.
5871 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5872 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5876 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
5879 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
5881 * @brief Sets the Restriction for uuid.
5883 * This function is a synchronous call.
5885 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5886 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5887 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5890 * @param[in] value - State value.
5891 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5892 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5896 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
5899 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
5901 * @brief Reads the Restriction for uuid.
5903 * This function is a synchronous call.
5905 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5906 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5907 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5911 * @param[out] value - State value.
5912 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
5913 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
5917 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
5920 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
5922 * @brief Adds the device to blacklist.
5924 * This function is a synchronous call.
5926 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5927 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5928 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5931 * @param[in] device_address - Device address
5935 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
5938 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
5940 * @brief Adds the device to whitelist.
5942 * This function is a synchronous call.
5944 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5945 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5946 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5949 * @param[in] device_address - Device address
5953 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
5956 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
5958 * @brief Adds the Service UUIDS to blacklist.
5960 * This function is a synchronous call.
5962 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5963 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5964 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5967 * @param[in] service_uuids - profile or custom service uuids
5971 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
5974 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
5976 * @brief Adds the Service UUIDS to whitelist.
5978 * This function is a synchronous call.
5980 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5981 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
5982 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
5985 * @param[in] service_uuids - profile or custom service uuids
5989 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
5992 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
5994 * @brief Clears the devices from blacklist.
5996 * This function is a synchronous call.
5998 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
5999 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6000 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6007 int bluetooth_dpm_clear_devices_from_blacklist(void);
6010 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6012 * @brief Clears the devices from whitelist.
6014 * This function is a synchronous call.
6016 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6017 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6018 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6025 int bluetooth_dpm_clear_devices_from_whitelist(void);
6028 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6030 * @brief Clears the uuids from blacklist.
6032 * This function is a synchronous call.
6034 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6035 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6036 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6043 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6046 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6048 * @brief Clears the uuids from whitelist.
6050 * This function is a synchronous call.
6052 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6053 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6054 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6061 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6064 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6066 * @brief reads the devices from blacklist.
6068 * This function is a synchronous call.
6070 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6071 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6072 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6075 * @param[out] device_list - list of devices
6079 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6082 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6084 * @brief reads the devices from whitelist.
6086 * This function is a synchronous call.
6088 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6089 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6090 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6093 * @param[out] device_list - list of devices
6097 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6100 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6102 * @brief reads the uuids from blacklist.
6104 * This function is a synchronous call.
6106 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6107 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6108 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6111 * @param[in] uuid_list - list of uuids
6115 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6118 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6120 * @brief reads the uuids from whitelist.
6122 * This function is a synchronous call.
6124 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6125 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6126 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6129 * @param[in] uuid_list - list of uuids
6133 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6136 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6138 * @brief Removes the device from whitelist.
6140 * This function is a synchronous call.
6142 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6143 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6144 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6147 * @param[in] device_address - Device address
6151 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6154 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6156 * @brief Removes the device from blacklist.
6158 * This function is a synchronous call.
6160 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6161 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6162 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6165 * @param[in] device_address - Device address
6169 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6172 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6174 * @brief Removes the Service UUIDS from whitelist.
6176 * This function is a synchronous call.
6178 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6179 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6180 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6183 * @param[in] service_uuids - profile or custom service uuids
6187 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6190 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6192 * @brief Removes the Service UUIDS from blacklist.
6194 * This function is a synchronous call.
6196 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6197 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6198 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6201 * @param[in] service_uuids - profile or custom service uuids
6205 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6208 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6210 * @brief Sets the Restriction for outgoing call.
6212 * This function is a synchronous call.
6214 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6215 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6216 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6219 * @param[in] value - State value.
6220 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6221 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6225 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6228 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6230 * @brief Reads the Restriction for outgoing call.
6232 * This function is a synchronous call.
6234 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6235 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6236 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6240 * @param[out] value - State value.
6241 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6242 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6246 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6249 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6251 * @brief Sets the Restriction for Pairing.
6253 * This function is a synchronous call.
6255 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6256 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6257 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6260 * @param[in] value - State value.
6261 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6262 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6266 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6269 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6271 * @brief Reads the Restriction for Pairing
6273 * This function is a synchronous call.
6275 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6276 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6277 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6281 * @param[out] value - State value.
6282 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6283 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6287 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6290 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6292 * @brief Sets the Restriction for using Profiles.
6294 * This function is a synchronous call.
6296 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6297 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6298 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6301 * @param[in]profile - Profile.
6302 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6303 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6304 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6305 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6306 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6307 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6308 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6309 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6310 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6311 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6312 * BLUETOOTH_DPM_PROFILE_NONE
6313 * @param[in] value - State value.
6314 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6315 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6319 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6322 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6324 * @brief Reads the Restriction for using Profiles.
6326 * This function is a synchronous call.
6328 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6329 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6330 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6333 * @param[in]profile - Profile.
6334 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6335 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6336 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6337 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6338 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6339 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6340 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6341 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6342 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6343 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6344 * BLUETOOTH_DPM_PROFILE_NONE
6345 * @param[out] value - State value.
6346 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6347 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6351 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6354 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6356 * @brief Sets the Restriction for Desktop Connectivity.
6358 * This function is a synchronous call.
6360 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6361 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6362 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6365 * @param[in] value - State value.
6366 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6367 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6371 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6374 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6376 * @brief Reads the Restriction for Desktop Connectivity.
6378 * This function is a synchronous call.
6380 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6381 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6382 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6386 * @param[out] value - State value.
6387 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6388 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6392 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6395 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6397 * @brief Sets the Restriction for Discoverable state.
6399 * This function is a synchronous call.
6401 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6402 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6403 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6406 * @param[in] value - State value.
6407 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6408 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6412 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6415 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6417 * @brief Reads the Restriction for Discoverable state.
6419 * This function is a synchronous call.
6421 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6422 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6423 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6427 * @param[out] value - State value.
6428 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6429 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6433 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6436 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6438 * @brief Sets the Restriction for linited discoverable state..
6440 * This function is a synchronous call.
6442 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6443 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6444 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6447 * @param[in] value - State value.
6448 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6449 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6453 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6456 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6458 * @brief Reads the Restriction for limited discoverable state.
6460 * This function is a synchronous call.
6462 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6463 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6464 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6468 * @param[out] value - State value.
6469 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6470 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6474 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6476 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6478 * @brief Sets the Restriction for Data trasnfer.
6480 * This function is a synchronous call.
6482 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6483 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6484 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6487 * @param[in] value - State value.
6488 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6489 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6493 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6497 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6499 * @brief Reads the Restriction for Data trasnfer.
6501 * This function is a synchronous call.
6503 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6504 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6505 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6509 * @param[out] value - State value.
6510 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6511 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6515 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6523 #endif /* __cplusplus */
6524 #endif /* _BLUETOOTH_API_H_*/