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_
28 #endif /* __cplusplus */
31 * @defgroup BLUETOOTHFW BluetoothFW
33 * A base library for bluetooth framework
35 * @addtogroup BLUETOOTHFW
39 #define BLUETOOTH_ADDRESS_STRING_LENGTH 17 /**< This specifies bluetooth device address length (AA:BB:CC:DD:EE:FF) */
40 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
41 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
42 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
43 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
44 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
45 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
46 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
47 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
49 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
50 a device can support */
52 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
54 #define BLUETOOTH_UUID_STRING_MAX 50
55 #define BLUETOOTH_PATH_STRING 50
57 #define BLUETOOTH_OOB_DATA_LENGTH 16
59 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
62 * This is Bluetooth Connected event role
64 #define RFCOMM_ROLE_SERVER 1
65 #define RFCOMM_ROLE_CLIENT 2
68 * This is RFCOMM default Channel Value
70 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
73 * This is maximum length for search value string for PBAP Phonebook Search
75 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
78 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
82 * This is Bluetooth error code
84 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
86 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
87 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
89 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
90 /**< Callback error */
91 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
92 /**< invalid paramerror */
93 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
94 /**< invalid data error */
95 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
96 /**< Memory allocation error */
97 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
98 /**< out of memory error */
99 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
100 /**< timeout error */
101 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
102 /**< No resource error */
103 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
104 /**< internal error */
105 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
106 /**< Not supported error */
107 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
108 /**< Operation is failed because
109 of not enabled BT Adapter */
110 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
111 /**< Enabling is failed because of
112 already enabled BT Adapter */
113 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
114 /**< Operation is failed because of
115 other on going operation */
116 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
117 /**< access denied error */
118 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
119 /**< max client error */
120 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
121 /**< not found error */
122 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
123 /**< service search fail */
124 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
125 /**< pairing failed error */
126 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
127 /**< Not paired error */
128 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
129 /**< no service error */
130 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
131 /**< no connection error */
132 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
133 /**< alread connected error */
134 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
135 /**< connection busy error */
136 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
137 /**< connection error */
138 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
139 /**< max connection error*/
140 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
141 /**< Not in operation */
142 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
143 /**< Cancelled by user */
144 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
145 /**< Service record registration failed */
146 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
147 /**< Operation in progress */
148 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
149 /**< authentication failed error when paring*/
150 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
151 /**< Remote host is down */
152 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
153 /**< End of device list */
155 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
156 /**< Obex agent already exists */
157 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
158 /**< Obex agent does not exist */
160 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
161 /**< Already initialized */
163 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
164 /**< Permission deined */
166 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
167 /**< Nap already done */
169 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
170 /**< Not initialized */
172 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
173 /**< Authentication rejected */
175 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
176 /**< Device Policy Restricted */
179 * Device disconnection reasons; received from stack
181 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
182 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
183 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
184 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
185 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
186 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
187 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
188 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
189 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
190 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
191 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
192 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
193 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
194 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
195 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
200 * Device disconnect reason
203 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
204 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
205 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
206 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
207 } bluetooth_device_disconnect_reason_t;
210 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
213 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
214 } bluetooth_device_address_t;
217 * This is Bluetooth device address type
220 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
221 BLUETOOTH_DEVICE_RANDOM_ADDRESS
222 } bluetooth_device_address_type_t;
225 * This is Bluetooth version
228 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
229 } bluetooth_version_t;
232 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
235 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
236 } bluetooth_device_name_t;
239 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
242 int data_len; /**< manafacturer specific data length */
243 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
244 } bluetooth_manufacturer_data_t;
247 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
248 } bluetooth_device_pin_code_t;
254 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
255 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
256 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
257 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
258 } bluetooth_adapter_state_t;
264 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
265 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
266 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
267 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
268 } bluetooth_adapter_le_state_t;
274 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
275 /*Changed the order to make it compatable with old method */
276 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
277 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
278 /**< Discoverable mode with time limit
279 After specific timeout, it is changed
280 to non discoverable mode */
281 } bluetooth_discoverable_mode_t;
284 * Network connect mode
287 BLUETOOTH_NETWORK_PANU_ROLE,
289 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
290 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
291 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
292 } bluetooth_network_role_t;
296 * Service type matched to bt_profile_type_t of bt-service-common.h
299 BLUETOOTH_RFCOMM_SERVICE = 0x01,
300 BLUETOOTH_A2DP_SERVICE = 0x02,
301 BLUETOOTH_HSP_SERVICE = 0x04,
302 BLUETOOTH_HID_SERVICE = 0x08,
303 BLUETOOTH_NAP_SERVICE = 0x10,
304 BLUETOOTH_HFG_SERVICE = 0x20,
305 BLUETOOTH_GATT_SERVICE = 0x40,
306 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
307 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
308 BLUETOOTH_PBAP_SERVICE = 0x200,
309 } bluetooth_service_type_t;
315 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
316 /* represents that connection
317 * type can both BR/EDR and LE */
318 BLUETOOTH_DEV_CONN_BREDR = 0x00,
319 BLUETOOTH_DEV_CONN_LE = 0x01,
320 } bluetooth_conn_type_t;
326 BLUETOOTH_CODEC_ID_CVSD = 0x01,
327 BLUETOOTH_CODEC_ID_MSBC = 0x02,
328 } bluetooth_codec_type_t;
334 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
335 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
336 } bluetooth_hf_audio_connected_type_t;
342 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
343 } bluetooth_advertising_data_t;
349 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
350 } bluetooth_scan_resp_data_t;
353 * Advertising filter policy
356 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
357 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
358 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
359 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
360 } bluetooth_advertising_filter_policy_t;
366 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
367 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
368 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
369 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
370 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
371 } bluetooth_advertising_type_t;
374 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
375 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
376 } bluetooth_gatt_service_change_type_t;
379 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
380 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
381 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
382 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
383 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
384 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
385 } bt_gatt_permission_t;
388 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
389 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
390 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
391 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
392 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
393 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
394 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
395 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
396 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
397 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
398 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
399 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
400 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
401 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
402 } bt_gatt_characteristic_property_t;
405 * Remote device request types for attributes
408 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
409 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
410 } bluetooth_gatt_att_request_tyep_t;
413 * Proximity Property Type
416 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
417 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
418 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
419 } bluetooth_pxp_poperty_t;
422 * Advertising parameters
427 guint8 filter_policy;
429 } bluetooth_advertising_params_t;
435 int type; /**< passive 0, active 1 */
436 float interval; /**< LE scan interval */
437 float window; /**< LE scan window */
438 } bluetooth_le_scan_params_t;
448 } bluetooth_le_connection_param_t;
451 LE Read Maximum Data Length
454 guint16 max_tx_octets;
456 guint16 max_rx_octets;
458 } bluetooth_le_read_maximum_data_length_t;
461 LE Read Host suggested default Data Length
464 guint16 def_tx_octets;
466 } bluetooth_le_read_host_suggested_data_length_t;
469 * Samsung XSAT Vendor dependent command
474 } bluetooth_vendor_dep_at_cmd_t;
480 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
481 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
482 } bluetooth_opp_transfer_type_t;
487 } bluetooth_hf_ciev_device_event_t;
489 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
490 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
491 /**< Base ID for GAP Event */
492 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
493 /**< Base ID for SDP events */
494 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
495 /**< Base ID for RFCOMM events */
496 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
497 /**< Base ID for NETWORK events */
498 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
499 /**< Base ID for HDP events */
500 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
501 /**< Base ID for OPC events */
502 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
503 /**< Base ID for Obex Server events */
504 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
505 /**< Base ID for GATT events */
507 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
508 /**< Base ID for Audio events */
509 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
510 /**< Base ID for HID events */
511 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
512 /**< Base ID for Advertising events */
513 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
514 /**< Base ID for PBAP Client events */
515 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
516 /**< Base ID for AVRCP events */
517 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
518 /**< Base ID for IPSP events */
519 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
520 /**< Base ID for MAP events */
523 * Bluetooth event type
526 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
528 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
529 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
530 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
531 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
532 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
533 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
534 /**< Bluetooth event Discoverable timeout requested*/
535 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
536 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
537 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
538 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
539 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
540 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
541 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
542 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
543 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
544 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
545 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
546 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
547 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
548 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
549 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
550 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
551 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
552 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
553 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
554 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
555 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
557 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
558 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
559 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
560 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
561 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
563 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
564 /**< Bluetooth event serice search base id */
565 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
566 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
567 /**< RFCOMM data receive event */
568 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
569 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
571 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
573 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
574 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
576 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
578 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
579 /**< Bluetooth Network event */
580 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
581 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
582 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
583 /**< Network disconnected evnet in server */
585 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
586 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
588 BLUETOOTH_EVENT_HDP_CONNECTED
589 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
590 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
591 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
593 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
594 /* OPC Connected event */
595 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
596 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
597 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
598 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
600 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
601 BLUETOOTH_EVENT_MAP_DISCONNECTED,
603 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
604 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
605 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
606 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
607 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
609 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
610 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
611 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
612 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
613 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
614 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
615 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
616 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
617 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
618 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
619 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
620 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
621 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
623 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
624 /* Obex server authorize event*/
625 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
626 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
627 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
628 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
629 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
630 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
632 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
633 /**<Discovered GATT service characteristics event*/
634 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
635 /**<Remote GATT charateristic value changed event*/
636 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
637 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
638 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
639 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
640 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
641 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
642 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
643 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
644 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
645 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
646 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
647 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
648 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
649 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
650 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
652 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
653 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
654 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
655 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
656 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
657 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
658 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
659 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
660 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
661 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
662 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
663 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
664 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
665 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
666 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
667 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
668 BLUETOOTH_EVENT_HF_CONNECTED,
669 BLUETOOTH_EVENT_HF_DISCONNECTED,
670 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
671 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
672 BLUETOOTH_EVENT_HF_RING_INDICATOR,
673 BLUETOOTH_EVENT_HF_CALL_WAITING,
674 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
675 BLUETOOTH_EVENT_HF_CALL_STARTED,
676 BLUETOOTH_EVENT_HF_CALL_ENDED,
677 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
678 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
679 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
680 BLUETOOTH_EVENT_HF_CALL_STATUS,
681 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
682 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
683 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
684 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
685 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
686 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
687 BLUETOOTH_EVENT_HF_CALL_IDLE,
688 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
689 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
690 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
692 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
693 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
694 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
695 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
696 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
698 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
699 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
700 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
701 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
702 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
703 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
704 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
705 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
707 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
708 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
709 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
710 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
711 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
712 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
713 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
715 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
716 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
717 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
718 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
719 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
720 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
721 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
722 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
723 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
725 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
726 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
727 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
728 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
729 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
730 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
731 } bluetooth_event_type_t;
734 * This bt_service_uuid_list_t enum indicates service uuid list .
735 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
739 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
740 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
741 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
742 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
743 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
744 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
745 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
746 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
747 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
748 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
749 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
750 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
751 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
753 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
754 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
755 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
756 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
757 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
758 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
759 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
760 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
761 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
762 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
763 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
764 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
765 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
766 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
768 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
769 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
770 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
771 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
772 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
773 /**<DIRECT PRINTING*/
774 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
775 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
776 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
777 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
778 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
779 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
780 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
781 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
782 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
783 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
784 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
785 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
786 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
787 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
788 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
789 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
790 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
791 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
792 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
793 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
794 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
795 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
796 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
797 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
798 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
799 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
800 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
801 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
802 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
803 } bluetooth_service_uuid_list_t;
806 * Service class part of class of device returned from device discovery
809 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
810 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
811 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
812 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
813 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
814 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
815 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
816 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
817 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
818 } bluetooth_device_service_class_t;
822 * Major device mask (For device discovery)
825 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
826 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
827 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
828 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
829 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
830 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
831 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
832 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
833 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
834 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
835 } bluetooth_device_major_mask_t;
839 * Major device class (part of Class of Device)
842 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
843 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
844 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
845 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
846 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
847 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
848 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
849 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
850 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
851 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
852 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
853 } bluetooth_device_major_class_t;
856 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
858 /* About Computer Major class */
859 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
861 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
862 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
863 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
864 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
865 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
867 /* About Phone Major class */
868 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
869 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
870 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
871 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
872 /**< voice gateway minor class */
873 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
875 /* About LAN/Network Access Point Major class */
876 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
877 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
878 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
879 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
880 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
881 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
882 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
883 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
885 /* About Audio/Video Major class */
886 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
887 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
889 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
890 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
891 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
892 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
893 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
894 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
895 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
896 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
897 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
898 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
899 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
900 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
901 /**< Video Display and Loud
902 Speaker minor class */
903 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
906 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
908 /* About Peripheral Major class */
909 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
910 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
911 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
912 /**< Combo Keyboard or pointing
915 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
916 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
917 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
918 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
919 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
920 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
921 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
922 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
923 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
925 /* About Imaging Major class */
926 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
927 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
928 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
929 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
931 /* About Wearable Major class */
932 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
933 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
934 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
935 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
936 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
938 /* About Toy Major class */
939 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
940 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
941 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
942 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
943 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
945 /* About Health Major class */
946 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
947 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
948 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
949 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
950 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
951 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
952 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
953 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
954 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
955 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
956 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
957 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
958 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
959 } bluetooth_device_minor_class_t;
962 * structure to hold the device information
965 bluetooth_device_major_class_t major_class; /**< major device class */
966 bluetooth_device_minor_class_t minor_class; /**< minor device class */
967 bluetooth_device_service_class_t service_class;
968 /**< service device class */
969 } bluetooth_device_class_t;
972 * Discovery Role types
975 DISCOVERY_ROLE_BREDR = 0x1,
977 DISCOVERY_ROLE_LE_BREDR
978 } bt_discovery_role_type_t;
981 * Connected state types
984 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
985 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
986 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
987 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
988 } bluetooth_connected_link_t;
994 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
995 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
996 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
997 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
998 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
999 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1000 } bluetooth_le_scan_filter_feature_t;
1003 * LE connection mode
1006 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1007 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1008 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1009 } bluetooth_le_connection_mode_t;
1012 * structure to hold the device information
1015 bluetooth_device_address_t device_address; /**< device address */
1016 bluetooth_device_name_t device_name; /**< device name */
1017 bluetooth_device_class_t device_class; /**< device class */
1018 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1019 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1021 int rssi; /**< received strength signal*/
1022 gboolean paired; /**< paired flag */
1023 bluetooth_connected_link_t connected; /**< connected link type */
1024 gboolean trust; /**< trust flag */
1025 gboolean is_alias_set; /** is device alias set flag**/
1026 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1027 } bluetooth_device_info_t;
1030 * structure to hold the LE device information
1033 int data_len; /**< manafacturer specific data length */
1034 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1035 } bluetooth_le_advertising_data_t;
1038 bluetooth_device_address_t device_address; /**< device address */
1039 int addr_type; /**< address type*/
1040 int rssi; /**< received strength signal*/
1041 bluetooth_le_advertising_data_t adv_ind_data;
1042 bluetooth_le_advertising_data_t scan_resp_data;
1043 } bluetooth_le_device_info_t;
1047 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1048 bluetooth_device_address_t device_address; /**< device address */
1049 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1050 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1051 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1052 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1053 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1054 bluetooth_le_advertising_data_t service_data; /**< service data */
1055 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1056 int manufacturer_id; /**< manufacturer ID */
1057 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1058 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1059 } bluetooth_le_scan_filter_t;
1062 bluetooth_device_address_t device_address; /**< device address */
1063 unsigned int mtu; /** < MTU set for the ATT connection */
1064 unsigned int status; /** < status of the MTU exchange */
1065 } bluetooth_le_att_mtu_info_t;
1068 * structure to hold the paired device information
1071 bluetooth_device_address_t device_address; /**< paired device address */
1072 bluetooth_device_name_t device_name; /**< device name */
1073 bluetooth_device_class_t device_class; /**< device class */
1074 } bluetooth_paired_device_info_t;
1077 * structure to hold the paired device information
1080 bluetooth_device_address_t device_address;
1081 /**< device address */
1082 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1083 /**< network interface name */
1084 } bluetooth_network_device_info_t;
1087 * Authentication event types
1091 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1092 BLUETOOTH_AUTH_PIN_REQUEST,
1093 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1094 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1095 } bluetooth_auth_type_t;
1098 * structure to hold the pincode/pass-key req informations
1101 bluetooth_device_address_t device_address; /**< remote device address */
1102 bluetooth_device_name_t device_name; /**< device name */
1103 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1104 } bluetooth_authentication_request_info_t;
1107 * Stucture to hold discovery option
1110 unsigned short max_response; /**< the number of maximum response */
1111 unsigned short discovery_duration;
1112 /**< duration of discovery (seconds) */
1113 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1114 classOfDevice variable */
1115 } bluetooth_discovery_option_t;
1118 * Stucture to hold event information
1121 int event; /**< event type */
1122 int result; /**< Success or error value */
1124 /**<parameter data pointer */
1126 } bluetooth_event_param_t;
1129 bluetooth_device_address_t device_addr;
1130 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1131 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1132 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1137 bluetooth_device_address_t device_addr;
1138 unsigned char addr_type;
1140 } bt_connection_info_t;
1143 * Stucture to rfcomm receive data
1148 /**< the socket fd */
1149 int buffer_size;/**< the length of the receive buffer */
1151 /**< the receive data buffer */
1152 } bluetooth_rfcomm_received_data_t;
1158 HTYPE_TRANS_HANDSHAKE,
1159 HTYPE_TRANS_HID_CONTROL,
1160 HTYPE_TRANS_GET_REPORT,
1161 HTYPE_TRANS_SET_REPORT,
1162 HTYPE_TRANS_GET_PROTOCOL,
1163 HTYPE_TRANS_SET_PROTOCOL,
1166 } bt_hid_header_type_t;
1172 PTYPE_DATA_RTYPE_INPUT,
1173 PTYPE_DATA_RTYPE_OUTPUT
1174 } bt_hid_param_type_t;
1177 * Stucture to hid receive data
1180 const char *address;
1181 bt_hid_header_type_t type;
1182 /**< Header type containing */
1183 bt_hid_param_type_t param;
1184 /**< Param type in header like INPUT Report or OutPut Report */
1185 int buffer_size;/**< the length of the receive buffer */
1187 /**< the receive data buffer */
1188 } bluetooth_hid_received_data_t;
1191 * Stucture to rfcomm connection
1195 int socket_fd; /**< the socket fd */
1196 int server_id; /* Server id */
1197 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1198 bluetooth_device_address_t device_addr;
1199 /**< device address */
1200 char uuid[BLUETOOTH_UUID_STRING_MAX];
1201 } bluetooth_rfcomm_connection_t;
1204 * Stucture to rfcomm disconnection
1208 /**< the socket fd */
1209 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1210 bluetooth_device_address_t device_addr;
1211 /**< device address */
1212 char uuid[BLUETOOTH_UUID_STRING_MAX];
1213 } bluetooth_rfcomm_disconnection_t;
1217 /**< the socket fd */
1218 bluetooth_device_address_t device_addr;
1219 /**< device address */
1220 } bluetooth_rfcomm_connection_request_t;
1224 /**< the socket fd */
1225 bluetooth_device_address_t device_addr;
1226 /**< device address */
1227 } bluetooth_hid_request_t;
1236 } bt_hdp_qos_type_t;
1242 HDP_ROLE_SOURCE = 0x0,
1244 } bt_hdp_role_type_t;
1248 * Stucture to HDP connected
1251 const char *app_handle; /**< the application handle */
1252 unsigned int channel_id; /**< the channel id */
1253 bt_hdp_qos_type_t type; /**< the QOS type */
1254 bluetooth_device_address_t device_address; /**< the remote address */
1255 } bt_hdp_connected_t;
1258 * Stucture to HDP disconnected
1261 unsigned int channel_id; /**< the channel id */
1262 bluetooth_device_address_t device_address; /**< the remote address */
1263 } bt_hdp_disconnected_t;
1266 * Stucture to HDP data indication
1269 unsigned int channel_id; /**< the channel id */
1270 const char *buffer; /**< the RX data buffer */
1271 unsigned int size; /**< the RX data size */
1272 } bt_hdp_data_ind_t;
1275 * Stucture to OPP client transfer information
1282 } bt_opc_transfer_info_t;
1284 /* TODO: MAP client structures, see above */
1286 * Stucture to Map filter fields
1291 } bt_map_list_filter_fields_info_t;
1293 /* Obex Server transfer type */
1294 #define TRANSFER_PUT "PUT"
1295 #define TRANSFER_GET "GET"
1297 * Stucture to OPP/FTP Server authorize information
1304 } bt_obex_server_authorize_into_t;
1312 } bt_obex_server_type_t;
1315 * Stucture to OPP/FTP server transfer information
1323 unsigned long file_size;
1325 bt_obex_server_type_t server_type;
1327 unsigned char *contact_auth_info;
1328 } bt_obex_server_transfer_info_t;
1331 * Stucture to OPP/FTP server connection/disconnection information
1337 } bt_obex_server_connection_info_t;
1341 * Stucture to OOB data
1345 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1346 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1347 unsigned int hash_len;
1348 unsigned int randomizer_len;
1350 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1351 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1352 unsigned int hash256_len;
1353 unsigned int randomizer256_len;
1357 * Structure to GATT attribute handle data
1363 } bt_gatt_handle_info_t;
1366 * Structure to GATT Remote service data
1373 bt_gatt_handle_info_t include_handles;
1374 bt_gatt_handle_info_t char_handle;
1375 } bt_gatt_service_property_t;
1378 * Structure to GATT Remote characteristic data
1382 char *service_handle;
1383 bt_gatt_handle_info_t handle_info;
1384 } bt_gatt_discovered_char_t;
1387 * Structure to format of GATT Characteristic Value
1391 unsigned char format;
1392 unsigned char exponent;
1393 unsigned short unit;
1394 unsigned char name_space;
1395 unsigned short description;
1396 } bt_gatt_char_format_t;
1399 * Structure to GATT Characteristic property
1407 bt_gatt_char_format_t format;
1409 unsigned int val_len;
1410 unsigned int permission;
1411 char *representation;
1412 bt_gatt_handle_info_t char_desc_handle;
1413 } bt_gatt_char_property_t;
1416 * Structure to GATT Characteristic descriptor property
1423 unsigned int val_len;
1424 } bt_gatt_char_descriptor_property_t;
1427 * Structure to GATT Characteristic value
1434 } bt_gatt_char_value_t;
1437 * Structure to GATT Read Request
1441 char *service_handle;
1445 } bt_gatt_read_req_t;
1448 * Structure to GATT Value change
1452 char *service_handle;
1455 gboolean response_needed;
1459 } bt_gatt_value_change_t;
1462 bluetooth_device_address_t device_addr;
1464 bluetooth_gatt_service_change_type_t change_type;
1465 } bt_gatt_service_change_t;
1468 * Structure to GATT characteristc Notification change
1472 char *service_handle;
1473 gboolean att_notify;
1474 } bt_gatt_char_notify_change_t;
1477 * Structure to Indication confirmation
1481 char *service_handle;
1484 } bt_gatt_indicate_confirm_t;
1487 * Structure to RSSI Signal Strength Alert
1498 * Structure to RSSI Signal Strength
1508 * Structure for RSSI Enabled or Disabled
1514 gboolean rssi_enabled;
1515 } bt_rssi_enabled_t;
1518 * Structure for RSSI Threshold
1523 int in_range_threshold;
1525 } bt_rssi_threshold_t;
1529 * Structure for Suppoted Profiles and Trusted Profiles
1536 } bt_supported_profile_trusted_t;
1539 * Structure for PBAP Folder Parameters
1542 unsigned char addressbook;
1543 unsigned char folder_type;
1547 * Structure for PBAP Pull application Parameters
1550 unsigned char format;
1551 unsigned char order;
1552 unsigned short offset;
1553 unsigned short maxlist;
1554 long long unsigned fields;
1555 } bt_pbap_pull_parameters_t;
1558 * Structure for PBAP List application Parameters
1561 unsigned char order;
1562 unsigned short offset;
1563 unsigned short maxlist;
1564 } bt_pbap_list_parameters_t;
1567 * Structure for PBAP Pull vCard application Parameters
1570 unsigned char format;
1571 long long unsigned fields;
1573 } bt_pbap_pull_vcard_parameters_t;
1576 * Structure for PBAP Search application Parameters
1579 unsigned char order;
1580 unsigned short offset;
1581 unsigned short maxlist;
1582 unsigned char search_attribute;
1583 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1584 } bt_pbap_search_parameters_t;
1587 * Structure for PBAP Connection Status
1590 bluetooth_device_address_t btaddr;
1592 } bt_pbap_connected_t;
1595 * Structure for PBAP Phonebook Size
1598 bluetooth_device_address_t btaddr;
1600 } bt_pbap_phonebook_size_t;
1603 * Structure for PBAP Phonebook Pull
1606 bluetooth_device_address_t btaddr;
1609 } bt_pbap_phonebook_pull_t;
1612 * Structure for PBAP vCard List
1615 bluetooth_device_address_t btaddr;
1619 } bt_pbap_vcard_list_t;
1622 * Structure for PBAP vCard Pull
1625 bluetooth_device_address_t btaddr;
1628 } bt_pbap_vcard_pull_t;
1631 * Structure for PBAP Phonebook search List
1634 bluetooth_device_address_t btaddr;
1638 } bt_pbap_phonebook_search_list_t;
1641 * Stucture to HF Call status information
1645 char *number; /*Phone Number */
1646 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1647 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1648 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1649 int idx; /*Call index/ID */
1650 } bt_hf_call_status_info_t;
1655 } bt_hf_call_list_s;
1661 TRUSTED_PROFILE_PBAP = 1,
1662 TRUSTED_PROFILE_MAP,
1663 TRUSTED_PROFILE_SAP,
1664 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1665 } bluetooth_trusted_profile_t;
1668 * Restricted Profile types
1671 RESTRICTED_PROFILE_HFP_HS = 1,
1672 RESTRICTED_PROFILE_A2DP,
1673 } bluetooth_restricted_profile_t;
1676 * Structure for LE data length change params
1679 bluetooth_device_address_t device_address;
1680 guint16 max_tx_octets;
1681 guint16 max_tx_time;
1682 guint16 max_rx_octets;
1683 guint16 max_rx_time;
1684 } bt_le_data_length_params_t;
1687 * Structure for proximity property change params
1690 bluetooth_device_address_t device_address;
1694 } bt_pxp_property_changed_params_t;
1697 * @brief DPM BT allowance state
1701 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1702 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1703 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1704 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1708 * @brief DPM API result
1712 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1713 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1714 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1715 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1716 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1717 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1721 * @brief DPM Policy status
1725 BLUETOOTH_DPM_STATUS_ERROR = -1,
1727 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1728 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1730 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1731 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1733 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1734 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1738 /* policy-group : BLUETOOTH */
1739 BLUETOOTH_DPM_POLICY_ALLOW,
1740 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1741 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1742 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1743 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1744 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1745 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1746 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1747 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1748 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1749 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1750 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1751 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1752 BLUETOOTH_DPM_POLICY_END,
1753 } bt_dpm_policy_cmd_t;
1756 struct bt_dpm_policy {
1762 typedef struct bt_dpm_policy bt_dpm_policy_t;
1765 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1766 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1767 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1768 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1769 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1770 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1771 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1772 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1773 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1774 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1775 BLUETOOTH_DPM_PROFILE_NONE,
1778 struct bt_dpm_profile_val {
1779 int value; /* tells whether the profile is enabled or disabled */
1781 typedef struct dpm_profile_val dpm_profile_state_t;
1784 * Structure to DPM device list
1788 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1789 } bt_dpm_device_list_t;
1792 * Structure to DPM uuid list
1796 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1797 } bt_dpm_uuids_list_t;
1800 * Structure for IPSP Interface Info
1803 bluetooth_device_address_t btaddr;
1805 } bt_ipsp_connection_info_t;
1809 char* remote_address;
1810 } bt_map_client_session_info_s;
1812 typedef char* bt_map_client_message_object_t;
1817 } bt_map_client_list_folders_filter_t;
1822 int8_t subject_length;
1831 } bt_map_client_list_messages_filter_t;
1834 bt_map_client_message_object_t message_object;
1839 char *sender_address;
1842 char *recipient_address;
1847 int64_t attachment_size;
1852 } bt_map_client_message_item_t;
1858 } bt_map_client_push_message_args_t;
1865 char *sender_address;
1868 char *recipient_address;
1877 } bt_map_client_message_t;
1880 char **names; // holding %size null-terminated folder names
1882 } bt_map_client_folders_s;
1885 bt_map_client_message_item_t *message_items;
1887 } bt_map_client_message_items_s;
1890 const char* target_file;
1892 } bt_get_message_callback_data;
1895 * Callback pointer type
1897 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1900 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1901 * @brief Set the callback function pointer for bluetooth event
1904 * This API will register the callback function, when any response and event are received from
1905 * bluetooth framework. @n
1906 * this registered callback function will be get called with appropriate event and data structures.
1907 * This function is a synchronous call. An application developer can call
1908 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1909 * type. This registered function will receive events of bluetooth_event_type_t type along with
1913 * @param[in] callback_ptr A pointer to the callback function
1914 * @param[in] user_data A pointer to user data
1915 * @return BLUETOOTH_ERROR_NONE - Success
1919 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1921 GMainLoop *main_loop = (GMainLoop*) user_data;
1925 // Code for each event
1927 g_main_loop_quit(main_loop);
1934 GMainLoop *main_loop = NULL;
1937 main_loop = g_main_loop_new(NULL, FALSE);
1938 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1939 if (ret >= BLUETOOTH_ERROR_NONE)
1941 // bluetooth_register_callback returned Success
1945 // bluetooth_register_callback returned failiure
1947 g_main_loop_run(main_loop);
1951 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1954 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1955 * @brief Set the callback function pointer for bluetooth le event
1958 * This API will register the callback function, when any response and event are received from
1959 * bluetooth framework. @n
1960 * this registered callback function will be get called with appropriate event and data structures.
1961 * This function is a synchronous call. An application developer can call
1962 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1963 * type. This registered function will receive events of bluetooth_event_type_t type along with
1967 * @param[in] callback_ptr A pointer to the callback function
1968 * @param[in] user_data A pointer to user data
1969 * @return BLUETOOTH_ERROR_NONE - Success
1973 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1976 * @fn int bluetooth_le_unregister_callback(void)
1977 * @brief Set the callback function pointer for bluetooth le event
1980 * This API will register the callback function, when any response and event are received from
1981 * bluetooth framework. @n
1982 * this registered callback function will be get called with appropriate event and data structures.
1983 * This function is a synchronous call. An application developer can call
1984 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1985 * type. This registered function will receive events of bluetooth_event_type_t type along with
1990 * @return BLUETOOTH_ERROR_NONE - Success
1994 int bluetooth_le_unregister_callback(void);
1997 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1998 * @brief Set the callback function pointer for bluetooth event
2001 * This API will register the callback function, when any response and event are received from
2002 * bluetooth framework. @n
2003 * this registered callback function will be get called with appropriate event and data structures.
2004 * This function is a synchronous call. An application developer can call
2005 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2006 * type. This registered function will receive events of bluetooth_event_type_t type along with
2011 * @return BLUETOOTH_ERROR_NONE - Success
2015 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2017 GMainLoop *main_loop = (GMainLoop*) user_data;
2021 // Code for each event
2023 g_main_loop_quit(main_loop);
2030 GMainLoop *main_loop = NULL;
2033 main_loop = g_main_loop_new(NULL, FALSE);
2034 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2035 if (ret >= BLUETOOTH_ERROR_NONE)
2037 // bluetooth_register_callback returned Success
2041 // bluetooth_register_callback returned failiure
2043 ret = bluetooth_deregister_callback(void);
2044 g_main_loop_run(main_loop);
2048 int bluetooth_unregister_callback(void);
2051 * @fn int bluetooth_enable_adapter(void)
2052 * @brief Enable the Bluetooth H/W
2055 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2056 * send request to bluetooth chip for activation.
2057 * This function is typically called at startup or when Bluetooth services are required. This
2058 * function must be called before calling any other API of Bluetooth operations.
2060 * Before performing any operations like Device discover, service search etc.., the adapter must be
2063 * This function is a asynchronous call.
2064 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2065 * through registered callback function with appropriate result code
2066 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2067 * BLUETOOTH_ERROR_NONE - Success \n
2069 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2070 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2072 * @return BLUETOOTH_ERROR_NONE - Success\n
2073 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2074 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2075 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2076 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2078 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2080 void bt_event_callback(int event, bluetooth_event_param_t *param)
2084 case BLUETOOTH_EVENT_ENABLED:
2085 if (param->result == BLUETOOTH_ERROR_NONE)
2087 // Successfully Enabled
2100 ret = bluetooth_enable_adapter();
2104 int bluetooth_enable_adapter(void);
2107 * @fn int bluetooth_disable_adapter(void)
2108 * @brief Disable the Bluetooth H/W
2111 * This function disables Bluetooth protocol stack and hardware. This function is called when
2112 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2114 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2115 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2116 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2118 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2121 * This function is a asynchronous call.
2122 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2123 * through registered callback function.
2126 * @return BLUETOOTH_ERROR_NONE - Success\n
2127 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2128 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2129 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2131 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2133 void bt_event_callback(int event, bluetooth_event_param_t *param)
2137 case BLUETOOTH_EVENT_DISABLED:
2138 if (param->result == BLUETOOTH_ERROR_NONE)
2140 // Successfully disabled
2153 ret = bluetooth_disable_adapter();
2156 int bluetooth_disable_adapter(void);
2157 int bluetooth_recover_adapter(void);
2158 int bluetooth_check_adapter_le(void);
2159 int bluetooth_enable_adapter_le(void);
2161 int bluetooth_disable_adapter_le(void);
2164 * @fn int bluetooth_reset_adapter(void)
2165 * @brief Reset the Bluetooth H/W and values
2168 * This function resets Bluetooth protocol stack and hardware. This function is called when
2169 * an user want to initialize Bluetooth environment.
2171 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2174 * This function is a synchronous call.
2176 * @return BLUETOOTH_ERROR_NONE - Success\n
2177 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2179 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2184 ret = bluetooth_reset_adapter();
2187 int bluetooth_reset_adapter(void);
2190 * @fn int bluetooth_is_supported(void)
2191 * @brief Check if the bluetooth is supported or not by the current target
2193 * This API checks whether the bluetooth is supported or not.
2194 * This API only run by root permission.
2196 * This function is a synchronous call.
2198 * @return 0 - if bluetooth is not supported\n
2199 * 1 - if bluetooth is supported\n
2200 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2205 ret = bluetooth_is_supported();
2208 int bluetooth_is_supported(void);
2212 * @fn int bluetooth_check_adapter(void)
2213 * @brief Check the current status of the Bluetooth adapter
2216 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2217 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2218 * bluetooth adapter.
2219 * This API get the adapter internal data structure and check current adapter status.
2221 * This function is a synchronous call.
2224 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2225 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2227 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2231 ret = bluetooth_check_adapter();
2234 int bluetooth_check_adapter(void);
2237 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2238 * @brief Get the local adapter bluetooth address
2241 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2242 * the adapter should be enabled.
2243 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2244 * contain Bluetooth address.
2245 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2246 * friendly name for each device.
2247 * There is no event callback for this API.
2249 * This function is a synchronous call.
2252 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2253 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2254 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2255 * @param[out] local_address a device address of local bluetooth adapter
2260 bluetooth_device_address_t local_address={0,};
2263 ret = bluetooth_get_local_address(&local_address);
2266 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2269 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2270 * @brief Get the hci version
2273 * This function is used to get the bluetooth hci version
2274 * Before calling this API make sure that the adapter is enabled.
2276 * This function is a synchronous call.
2279 * @return BLUETOOTH_ERROR_NONE - Success \n
2280 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2281 * @param[out] timeout remain visibility timeout value
2284 bluetooth_version_t *version;
2286 ret = bluetooth_get_local_version (&version);
2289 int bluetooth_get_local_version(bluetooth_version_t *version);
2292 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2293 * @brief Get the local device name
2296 * This function is used, get the local device name. Since its difficult to remember the Adapter
2297 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2298 * friendly name is retrived by the remote device and displaying.
2299 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2301 * This function is a synchronous call.
2304 * @return BLUETOOTH_ERROR_NONE - Success \n
2305 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2306 * @param[out] local_name a local device name
2310 bluetooth_device_name_t local_name={0,}
2312 ret = bluetooth_get_local_name (&local_name);
2315 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2318 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2319 * @brief Set the local device name
2322 * This function is used to set the local device name. This is a human friendly name whose
2323 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2325 * This function is a synchronous call.
2327 * @param[in] local_name bluetooth device name to set local device
2329 * @return BLUETOOTH_ERROR_NONE - Success \n
2330 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2331 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2332 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2333 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2334 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2339 bluetooth_device_name_t local_name={0,}
2341 ret = bluetooth_set_local_name (&local_name);
2344 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2348 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2349 * @brief Check if the uuid is used or not
2351 * This function is used to check if the uuid is used or not.
2353 * This function is a synchronous call.
2355 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2356 * @param[out] used if the uuid is used or not
2358 * @return BLUETOOTH_ERROR_NONE - Success \n
2359 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2360 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2361 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2366 gboolean used = FALSE;
2367 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2368 ret = bluetooth_is_service_used(uuid, &used);
2371 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2374 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2375 * @brief Check if the device is connected to the specific service
2377 * This function is used to check if if the device is connected to the specific service.
2379 * This function is a synchronous call.
2381 * @param[in] local_address a device address of remote bluetooth device
2382 * @param[in] type the service type
2383 * @param[out] is_connected if the device is connected or not
2385 * @return BLUETOOTH_ERROR_NONE - Success \n
2386 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2387 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2388 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2393 gboolean is_connected = FALSE;
2394 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2395 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2398 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2399 bluetooth_service_type_t type,
2400 gboolean *is_connected);
2403 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2404 * @brief Gets device's connected link type
2406 * This function is used to get device's connected link type
2408 * This function is a synchronous call.
2410 * @param[in] device_address a device address of remote bluetooth device
2411 * @param[out] connected_link a device's connected link type
2413 * @return BLUETOOTH_ERROR_NONE - Success \n
2414 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2415 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2416 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2421 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2422 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2423 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2426 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2427 bluetooth_connected_link_t *connected_link);
2430 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2431 * @brief Sets a profile trusted for a device
2433 * This function is used to Set a profile as trusted for a device
2435 * This function is a synchronous call.
2437 * @param[in] device_address a device address of remote bluetooth device
2438 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2439 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2441 * @return BLUETOOTH_ERROR_NONE - Success \n
2442 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2443 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2444 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2448 int bluetooth_set_profile_trusted(
2449 const bluetooth_device_address_t *device_address,
2450 int profile, int trust);
2453 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2454 * @brief Gets a profile is trusted for a device
2456 * This function is used to Get a profile is trusted or not for a device
2458 * This function is a synchronous call.
2460 * @param[in] device_address a device address of remote bluetooth device
2461 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2462 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2464 * @return BLUETOOTH_ERROR_NONE - Success \n
2465 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2466 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2467 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2471 int bluetooth_get_profile_trusted(
2472 const bluetooth_device_address_t *device_address,
2473 int profile, int *trust);
2476 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2477 * @brief Sets a profile restricted connection for a device
2479 * This function is used to Set a profile as restricted for a device
2481 * This function is a synchronous call.
2483 * @param[in] device_address a device address of remote bluetooth device
2484 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2485 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2487 * @return BLUETOOTH_ERROR_NONE - Success \n
2488 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2489 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2490 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2494 int bluetooth_set_profile_restricted(
2495 const bluetooth_device_address_t *device_address,
2496 int profile, int restricted);
2499 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2500 * @brief Gets a restricted connection state
2502 * This function is used to Get a profile is restricted or not for a device
2504 * This function is a synchronous call.
2506 * @param[in] device_address a device address of remote bluetooth device
2507 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2508 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2510 * @return BLUETOOTH_ERROR_NONE - Success \n
2511 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2512 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2513 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2517 int bluetooth_get_profile_restricted(
2518 const bluetooth_device_address_t *device_address,
2519 int profile, int *restricted);
2522 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2523 * @brief Get the visibility mode
2526 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2527 * visibity mode, the property of the device is determined whether it can be discoverable, non
2528 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2530 * This function is a synchronous call.
2533 * @return BLUETOOTH_ERROR_NONE - Success \n
2534 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2535 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2536 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2537 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2538 * @param[out] discoverable_mode current bluetooth discoverable mode
2540 * @see bluetooth_set_discoverable_mode
2542 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2544 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2547 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2550 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2552 * @brief Set the visibility mode
2555 * This function is used to set the discoverable mode (Visibility option).
2557 * Many times user may want to keep his device discoverable so that when peer device is performing
2558 * device search, he/she can find user's device. Application programmer can keep the mode as
2559 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2560 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2561 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2562 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2564 * This function is a synchronous call.
2566 * @return BLUETOOTH_ERROR_NONE - Success \n
2567 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2569 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2570 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2572 * @see bluetooth_get_discoverable_mode
2576 bluetooth_discoverable_mode_t mode;
2578 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2579 ret = bluetooth_set_discoverable_mode (mode, 180);
2583 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2588 * @fn int bluetooth_get_timeout_value(int *timeout)
2589 * @brief Get the visibility timeout value
2592 * This function is used to get the visibility timeout
2593 * Before calling this API make sure that the adapter is enabled.
2595 * This function is a synchronous call.
2598 * @return BLUETOOTH_ERROR_NONE - Success \n
2599 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2600 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2601 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2602 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2603 * @param[out] timeout remain visibility timeout value
2605 * @see bluetooth_set_discoverable_mode
2609 ret = bluetooth_get_timeout_value (&timeout);
2612 int bluetooth_get_timeout_value(int *timeout);
2616 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2617 * unsigned int classOfDeviceMask)
2618 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2620 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2621 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2622 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2623 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2624 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2625 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2626 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2627 * please see bluetooth_device_info_t for more details.
2630 * This API provides searching options like max responses, discovery duration in seconds and class
2631 * of device mask to filter device search. some times there may be too many bluetooth devices in
2632 * vicinity of your device.in such scenario, application can request to reduce number of responces
2633 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2634 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2635 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2636 * application defined time. please note that discovery_duration should be mentioned in seconds.
2637 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2640 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2641 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2642 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2644 * This function is a asynchronous call.
2645 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2646 * through registered callback function.
2648 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2649 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2651 * The completion or cancellation of the discovery is indicated by an
2652 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2654 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2657 * @return BLUETOOTH_ERROR_NONE - Success \n
2658 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2659 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2660 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2661 agent is not running \n
2663 * @param[in] max_response define the maximum response of the number of founded devices
2665 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2666 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2667 (refer to class of device)
2669 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2672 void bt_event_callback(int event, bluetooth_event_param_t *param)
2676 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2678 bluetooth_device_info_t *device_info = NULL;
2679 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2681 device_info = (bluetooth_device_info_t *)param->param_data;
2682 memcpy(&searched_device, &device_info->device_address,
2683 sizeof(bluetooth_device_address_t));
2684 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2685 device_info->device_address.addr[0],
2686 device_info->device_address.addr[1],
2687 device_info->device_address.addr[2],
2688 device_info->device_address.addr[3],
2689 device_info->device_address.addr[4],
2690 device_info->device_address.addr[5]);
2693 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2695 bluetooth_device_info_t *device_info = NULL;
2696 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2698 device_info = (bluetooth_device_info_t *)param->param_data;
2699 memcpy(&searched_device, &device_info->device_address,
2700 sizeof(bluetooth_device_address_t));
2701 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2702 device_info->device_name.name,
2703 device_info->device_address.addr[0],
2704 device_info->device_address.addr[1],
2705 device_info->device_address.addr[2],
2706 device_info->device_address.addr[3],
2707 device_info->device_address.addr[4],
2708 device_info->device_address.addr[5]);
2712 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2713 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2718 unsigned short max_response;
2719 unsigned short discovery_duration;
2720 unsigned classOfDeviceMask;
2724 discovery_duration =0;
2725 classOfDeviceMask =0;
2727 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2732 int bluetooth_start_discovery(unsigned short max_response,
2733 unsigned short discovery_duration,
2734 unsigned int classOfDeviceMask);
2737 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2738 * unsigned short max_response,
2739 * unsigned short discovery_duration,
2740 * unsigned int classOfDeviceMask)
2741 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2743 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2744 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2745 * Please see bluetooth_start_discovery() for other parameters description.
2747 * This function is a asynchronous call.
2748 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2749 * through registered callback function.
2751 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2752 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2754 * The completion or cancellation of the discovery is indicated by an
2755 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2757 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2760 * @return BLUETOOTH_ERROR_NONE - Success \n
2761 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2762 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2763 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2764 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2765 agent is not running \n
2767 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2768 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2769 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2770 * @param[in] max_response define the maximum response of the number of founded devices
2772 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2773 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2774 (refer to class of device)
2776 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2779 unsigned short type;
2780 unsigned short max_response;
2781 unsigned short discovery_duration;
2782 unsigned classOfDeviceMask;
2787 discovery_duration =0;
2788 classOfDeviceMask =0;
2790 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2795 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2796 unsigned short max_response,
2797 unsigned short discovery_duration,
2798 unsigned int classOfDeviceMask);
2801 * @fn int bluetooth_cancel_discovery (void)
2802 * @brief Cancel the on-going device discovery operation
2805 * This function stops the on-going device discovery operation. This API has to be called after the
2806 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2807 * the bluetooth_start_discovery API
2809 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2810 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2811 * cancel the discover request once the user received the device to which he wish to connect.
2813 * This function is a asynchronous call.
2814 * If the call is success to cancel discovey then the application will receive
2815 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2816 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2817 * BLUETOOTH_ERROR_NONE
2820 * @return BLUETOOTH_ERROR_NONE - Success \n
2821 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2822 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2823 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2824 other application \n
2825 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2827 * @see bluetooth_start_discovery
2829 void bt_event_callback(int event, bluetooth_event_param_t *param)
2833 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2834 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2843 ret = bluetooth_cancel_discovery();
2846 int bluetooth_cancel_discovery(void);
2849 * @fn int bluetooth_start_le_discovery(void)
2850 * @brief Start the generic device discovery which finds the LE devices.
2852 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2853 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2854 * It try to find LE devices. Bluetooth device address and name are
2855 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2856 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2857 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2858 * please see bluetooth_device_info_t for more details.
2860 * This function is a asynchronous call.
2861 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2862 * through registered callback function.
2864 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2867 * The completion or cancellation of the discovery is indicated by an
2868 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2870 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2873 * @return BLUETOOTH_ERROR_NONE - Success \n
2874 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2875 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2876 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2877 agent is not running \n
2880 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2883 void bt_event_callback(int event, bluetooth_event_param_t *param)
2887 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2889 bluetooth_device_info_t *device_info = NULL;
2890 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2892 device_info = (bluetooth_device_info_t *)param->param_data;
2893 memcpy(&searched_device, &device_info->device_address,
2894 sizeof(bluetooth_device_address_t));
2895 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2896 device_info->device_address.addr[0],
2897 device_info->device_address.addr[1],
2898 device_info->device_address.addr[2],
2899 device_info->device_address.addr[3],
2900 device_info->device_address.addr[4],
2901 device_info->device_address.addr[5]);
2905 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2906 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2912 ret = bluetooth_start_discovery();
2917 int bluetooth_start_le_discovery(void);
2920 * @fn int bluetooth_stop_le_discovery (void)
2921 * @brief Cancel the on-going device LE discovery operation
2924 * This function stops the on-going device discovery operation. This API has to be called after the
2925 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2926 * the bluetooth_start_le_discovery API
2929 * This function is a asynchronous call.
2930 * If the call is success to cancel discovey then the application will receive
2931 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2932 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2933 * BLUETOOTH_ERROR_NONE
2936 * @return BLUETOOTH_ERROR_NONE - Success \n
2937 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2938 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2939 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2940 other application \n
2941 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2943 * @see bluetooth_start_discovery
2945 void bt_event_callback(int event, bluetooth_event_param_t *param)
2949 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2950 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2959 ret = bluetooth_stop_le_discovery();
2962 int bluetooth_stop_le_discovery(void);
2965 * @fn int bluetooth_is_discovering(void)
2966 * @brief Check for the device discovery is in-progress or not.
2968 * This API is used to check the current status of the Discovery operation.If discovery is in\
2969 * progress normally other operations are not allowed.
2970 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2971 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2972 * event before performing other operations. This API is used to get for the current discovery
2973 * operation status and using bluetooth_cancel_discovery()
2974 * we can cancell the ongoing discovery process.
2975 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2978 * This function checks whether the device discovery is started or not.
2980 * This function is a synchronous call.
2983 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2984 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2985 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2988 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2992 ret = bluetooth_is_discovering ();
2995 int bluetooth_is_discovering(void);
2998 * @fn int bluetooth_is_le_discovering(void)
2999 * @brief Check for the device LE discovery is in-progress or not.
3001 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3002 * progress normally other operations are not allowed.
3003 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3004 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3005 * event before performing other operations. This API is used to get for the current discovery
3006 * operation status and using bluetooth_stop_le_discovery()
3007 * we can cancell the ongoing LE discovery process.
3008 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3011 * This function checks whether the device LE discovery is started or not.
3013 * This function is a synchronous call.
3016 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3017 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3018 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3021 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3025 ret = bluetooth_is_le_discovering ();
3028 int bluetooth_is_le_discovering(void);
3031 * @fn int bluetooth_is_le_scanning(void)
3032 * @brief Check for the device LE scan is in-progress or not.
3034 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3035 * progress normally other operations are not allowed.
3037 * This function checks whether the device LE Scan is started or not.
3039 * This function is a synchronous call.
3041 * @return TRUE - LE Scan in progress \n
3042 * FALSE - LE Scan is not in progress \n
3047 gboolean is_le_scanning = 0;
3048 is_le_scanning = bluetooth_is_le_scanning ();
3051 gboolean bluetooth_is_le_scanning(void);
3053 gboolean bluetooth_is_scan_filter_supported(void);
3056 * @fn int bluetooth_force_hcidump(int timeout)
3057 * @brief Enable /disable force-hcidump
3059 * This function control force-hcidump.
3061 * This function is a synchronous call.
3063 * @return BLUETOOTH_ERROR_NONE - Success \n
3064 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3065 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3067 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3072 int bluetooth_force_hcidump(int timeout);
3075 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3076 * @brief Register scan filter.
3078 * This function registers the scan filter.
3080 * This function is a synchronous call.
3082 * @return BLUETOOTH_ERROR_NONE - Success \n
3084 * @param[in] filter scan filter to register
3085 * @param[out] slot_id the slot ID of scan filter
3089 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3092 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3093 * @brief Register scan filter.
3095 * This function unregisters the scan filter.
3097 * This function is a synchronous call.
3099 * @return BLUETOOTH_ERROR_NONE - Success \n
3101 * @param[in] slot_id the slot ID of scan filter
3105 int bluetooth_unregister_scan_filter(int slot_id);
3108 * @fn int bluetooth_unregister_all_scan_filters(void)
3109 * @brief Register scan filter.
3111 * This function usregisters all scan filters.
3113 * This function is a synchronous call.
3115 * @return BLUETOOTH_ERROR_NONE - Success \n
3119 int bluetooth_unregister_all_scan_filters(void);
3122 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3123 int link_type, bt_rssi_threshold_t rssi_threshold)
3124 * @brief Enable RSSI monitoring
3126 * This function enables RSSI monitoring and sets threshold for a connection
3128 * @return BLUETOOTH_ERROR_NONE - Success \n
3131 * @see bluetooth_get_rssi_strength
3133 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3134 int link_type, bt_rssi_threshold_t *rssi_threshold);
3137 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3138 * @brief Gets Raw RSSI signal Strength
3140 * This function gives the Raw RSSI signal strength for a connection.
3142 * @return BLUETOOTH_ERROR_NONE - Success \n
3145 * @see bluetooth_enable_rssi
3147 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3149 int bluetooth_set_connectable(gboolean is_connectable);
3151 int bluetooth_is_connectable(gboolean *is_connectable);
3154 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3155 * @brief Initiate a bonding process
3158 * This function initiates a bonding procedure with a peer device. The bonding procedure
3159 * enables authentication and optionally encryption on the Bluetooth link.
3161 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3162 * inititate the bonding request to the devices already in the paired list.
3164 * Usually we call this API after the device discovery.
3165 * This function is a asynchronous call.
3167 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3168 * mentioed result code
3169 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3170 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3171 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3172 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3173 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3175 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3176 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3179 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3182 * @return BLUETOOTH_ERROR_NONE - Success \n
3183 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3184 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3185 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3186 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3188 * @param[in] device_address This indicates an address of the device with which the pairing
3189 * should be initiated
3191 * @see bluetooth_cancel_bonding
3193 void bt_event_callback(int event, bluetooth_event_param_t *param)
3197 case BLUETOOTH_EVENT_BONDING_FINISHED:
3199 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3200 if (param->result >= BLUETOOTH_ERROR_NONE)
3202 bluetooth_device_info_t *device_info = NULL;
3203 device_info = (bluetooth_device_info_t *)param->param_data;
3204 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3205 mjr[%#x] min[%#x] srv[%#x]",
3206 device_info->device_name.name,
3207 device_info->device_address.addr[0],
3208 device_info->device_address.addr[1],
3209 device_info->device_address.addr[2],
3210 device_info->device_address.addr[3],
3211 device_info->device_address.addr[4],
3212 device_info->device_address.addr[5],
3213 device_info->device_class.major_class,
3214 device_info->device_class.minor_class,
3215 device_info->device_class.service_class);
3229 bluetooth_device_address_t device_address={{0}};
3231 ret = bluetooth_bond_device(&device_address);
3235 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3238 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3239 * bluetooth_conn_type_t conn_type)
3240 * @brief Initiate a bonding process
3243 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3244 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3246 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3247 * inititate the bonding request to the devices already in the paired list.
3249 * Usually we call this API after the device discovery.
3250 * This function is a asynchronous call.
3252 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3253 * mentioed result code
3254 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3255 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3256 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3257 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3258 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3260 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3261 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3264 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3267 * @return BLUETOOTH_ERROR_NONE - Success \n
3268 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3269 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3270 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3271 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3273 * @param[in] device_address This indicates an address of the device with which pairing
3274 * should be initiated
3275 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3278 * @see bluetooth_cancel_bonding
3280 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3281 bluetooth_conn_type_t conn_type);
3284 * @fn int bluetooth_cancel_bonding(void)
3285 * @brief Cancel the on-going bonding process
3287 * This API is called to cancel the on-going bonding procedure. It should be called before the
3288 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3289 * This API is useful when the remote device is not responding to the bond request or we wish to
3290 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3292 * This function is a synchronous call.
3294 * @return BLUETOOTH_ERROR_NONE - Success \n
3295 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3296 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3299 * @see bluetooth_bond_device
3305 ret = bluetooth_cancel_bonding();
3308 int bluetooth_cancel_bonding(void);
3311 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3312 * @brief Remove bonding
3315 * To communicate with remote device over bluetooth link, user should bond with peer device.
3316 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3317 * API is used to remove peer device from the list. Please note that after removing the device
3318 * from bonded device list, you cannot communication with peer device until bonding happens again.
3320 * User can call this function by passing bluetooth device address of any bonded device. Please note
3321 * that after successful return of this function, any bluetooth application running on your device
3322 * will not be able to communicate with unbonded device until bond operation happens again using
3323 * bluetooth_bond_device()
3326 * This function is a asynchronous call. The request to remove the specified device from the bonded
3327 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3328 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3329 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3333 * @return BLUETOOTH_ERROR_NONE - Success \n
3334 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3335 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3336 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3337 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3338 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3339 * agent is not running \n
3340 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3343 * @param[in] device_address This indicates an address of the device to remove bonding
3347 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3350 void bt_event_callback(int event, bluetooth_event_param_t *param)
3353 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3354 bluetooth_device_address_t *dev_addr = NULL;
3356 if (param->result == BLUETOOTH_ERROR_NONE) {
3357 dev_addr = (bluetooth_device_address_t *)param->param_data;
3359 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3360 dev_addr->addr[0], dev_addr->addr[1]
3361 dev_addr->addr[2], dev_addr->addr[3]
3362 dev_addr->addr[4], dev_addr->addr[5]
3373 bluetooth_device_address_t *device_address;
3375 // copy valid device address in device_address
3377 ret = bluetooth_unbond_device(device_address);
3380 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3383 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3384 * @brief Get bonded(paired) device list
3387 * This API gets all bonded device list.
3388 * The devices in the bonded device list further can be used to perform the authorization by calling
3389 * bluetooth_authorize_device API.
3391 * This function is a synchronous call.
3392 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3393 * there is no valid information in the dev_list.
3394 * The len field in the dev_list represents the number of bonded devices. The data structure for
3395 * bonded device information is bluetooth_device_info_t.
3398 * @return BLUETOOTH_ERROR_NONE - Success \n
3399 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3401 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3403 void bt_get_bonded_devices(void)
3407 GPtrArray *devinfo = NULL;
3408 bluetooth_device_info_t *ptr;
3410 // allocate the g_pointer_array
3411 devinfo = g_ptr_array_new();
3413 ret = bluetooth_get_bonded_device_list(&devinfo);
3414 if (ret != BLUETOOTH_ERROR_NONE)
3416 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3420 printf("g pointer arrary count : [%d]", devinfo->len);
3421 for (i=0; i<devinfo->len; i++)
3423 ptr = g_ptr_array_index(devinfo, i);
3426 printf("Name [%s]\n", ptr->device_name.name);
3427 printf("Major Class [%d]\n", ptr->device_class.major_class);
3428 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3429 printf("Service Class [%d]\n", ptr->device_class.service_class);
3430 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3431 ptr->device_address.addr[0],
3432 ptr->device_address.addr[1], ptr->device_address.addr[2],
3433 ptr->device_address.addr[3],
3434 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3441 // free g_pointer_array
3442 g_ptr_array_free(devinfo, TRUE);
3447 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3449 int bluetooth_get_profile_connected_device_list(
3450 const char *profile_uuid, GPtrArray **addr_list);
3453 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3454 * bluetooth_device_info_t *dev_info)
3455 * @brief Get a bonded(paired) device
3458 * This API gets a bonded device.
3460 * This function is a synchronous call.
3461 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3462 * there is no valid information in the dev_info.
3463 * The data structure for bonded device information is bluetooth_device_info_t.
3466 * @return BLUETOOTH_ERROR_NONE - Success \n
3467 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3469 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3471 void bt_get_bonded_device(void)
3475 bluetooth_device_info_t devinfo = {0};
3476 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3478 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3479 if (ret != BLUETOOTH_ERROR_NONE)
3481 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3485 printf("Name [%s]\n", devinfo.device_name.name);
3486 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3487 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3488 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3489 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3490 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3491 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3492 devinfo.device_address.addr[5]);
3501 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3502 bluetooth_device_info_t *dev_info);
3506 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3507 * gboolean *is_alias_set)
3508 * @brief Get is_alias_set property of device
3510 * This API gets is_alias_set property of a bonded device.
3512 * This function is a synchronous call.
3513 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3514 * If not,there is no valid information in the is_alias_set.
3516 * @return BLUETOOTH_ERROR_NONE - Success \n
3517 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3522 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3524 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3527 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3528 gboolean *is_alias_set);
3531 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3532 * @brief set alias for bonded device
3535 * This function set alias for bonded device.
3537 * This function is a synchronous call.
3540 * @return BLUETOOTH_ERROR_NONE - Success \n
3541 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3542 * @param[in] device_address This indicates an address of the remote device
3543 * @param[in] alias This indicates an alias to set
3548 ret = bluetooth_set_alias(&remote_address);
3551 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3555 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3556 * @brief Get remote deivice
3559 * This function gets specific remote device.
3561 * This function is a asynchronous call.
3562 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3565 * @return BLUETOOTH_ERROR_NONE - Success \n
3566 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3567 * @param[in] device_address This indicates an address of the remote device
3572 ret = bluetooth_get_remote_device(&remote_address);
3575 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3578 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3579 * gboolean authorized)
3580 * @brief Authorize/Unauthorize a bonded device
3583 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3584 * with/without user confirmation.
3586 * If we select a paired device and make it authorized by calling this API with the authorized
3587 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3588 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3589 * then it will ask for the user conformation before the connection.
3591 * This API supposed to be called on the paired devices. Which means we have to use this API only
3592 * after successful pairing.
3594 * This function is a asynchronous call.
3595 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3597 * @return BLUETOOTH_ERROR_NONE - Success \n
3598 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3599 * @param[in] device_address This indicates an address of the device to authorize \n
3600 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3602 * @see bluetooth_get_bonded_device_list
3604 void bt_event_callback(int event, bluetooth_event_param_t *param)
3608 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3610 if (param->result == BLUETOOTH_ERROR_NONE)
3614 //device authorization failed failure
3622 bluetooth_device_address_t device_address={{0}};
3623 gboolean authorized;
3627 ret = bluetooth_authorize_device(&device_address,authorized);
3630 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3631 gboolean authorized);
3633 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3634 const bluetooth_device_pin_code_t *pin_code);
3636 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3639 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3641 * @brief Receives Legacy Passkey\pin with following authentication response types
3643 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3644 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3647 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3650 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3652 * @brief This API sends user confirmation reply to the local adapter.
3654 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3657 int bluetooth_passkey_confirmation_reply(gboolean reply);
3660 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3661 * @brief Get all services supported by remote device
3664 * This API call initiates the search for the services supported by the specified device. Normally
3665 * the service search will take a couple of seconds to get it completed. Before calling this API
3666 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3667 * perform the service search. We can get the device address by doing a device discovery operation.
3670 * This function is a asynchronous call.
3671 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3673 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3674 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3675 * event is generated with appropriate result code.
3677 * @return BLUETOOTH_ERROR_NONE - Success \n
3678 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3679 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3680 * @param[in] device_address This indicates an address of the device
3681 * whose services need to be found
3683 * @see bluetooth_cancel_service_search
3685 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3688 * @fn int bluetooth_cancel_service_search(void)
3689 * @brief Cancel the ongoing service search operation
3692 * This function cancel the ongoing service search operation. This API is usually calling after the
3693 * bluetooth_search_service API.
3694 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3695 * if the user wish to cancel the Ongoing service search operation.
3697 * This API should be called just after the bluetooth_search_service API and before the
3698 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3700 * This function is a synchronous call.
3702 * @return BLUETOOTH_ERROR_NONE - Success \n
3703 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3704 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3705 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3708 * @see bluetooth_search_service
3713 ret = bluetooth_cancel_service_search();
3716 int bluetooth_cancel_service_search(void);
3719 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3720 * @brief Register rfcomm socket with a specific uuid
3723 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3724 * descriptor of the server.
3725 * This is the first API which is called to create the server. Once we created the server socket,
3726 * we will listen on that return socket.
3727 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3730 * @return socket FD on Success \n
3731 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3732 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3733 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3734 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3735 * @param[in] UUID (128 bits)
3738 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3742 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3743 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3747 int bluetooth_rfcomm_create_socket(const char *uuid);
3750 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3751 * @brief Register rfcomm socket with a specific uuid
3754 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3755 * descriptor of the server.
3756 * This is the first API which is called to create the server. Once we created the server socket,
3757 * we will listen on that return socket.
3758 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3761 * @return socket FD on Success \n
3762 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3763 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3764 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3765 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3766 * @param[in] UUID (128 bits)
3767 * @param[in] bus_name (const char)
3768 * @param[in] path (const char)
3771 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3775 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3776 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3780 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3783 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3784 * @brief De-register the rfcomm socket
3787 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3788 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3789 * descriptor else no event will come. We will call this API only after the
3790 * bluetooth_rfcomm_listen_and_accept.
3791 * This is a synchronous call.
3793 * @return BLUETOOTH_ERROR_NONE - Success \n
3794 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3795 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3796 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3797 * @param[in] int socket_fd
3800 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3803 void bt_event_callback(int event, bluetooth_event_param_t *param)
3807 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3809 bluetooth_rfcomm_connection_t *discon_ind =
3810 (bluetooth_rfcomm_connection_t *)param->param_data;
3812 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3820 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3821 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3823 ret = bluetooth_rfcomm_remove_socket(fd);
3826 int bluetooth_rfcomm_remove_socket(int socket_fd);
3829 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3830 * @brief De-register the rfcomm socket
3833 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3834 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3835 * descriptor else no event will come. We will call this API only after the
3836 * bluetooth_rfcomm_listen_and_accept_ex.
3837 * This is a synchronous call.
3839 * @return BLUETOOTH_ERROR_NONE - Success \n
3840 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3841 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3842 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3843 * @param[in] UUID (128 bits)
3846 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3849 void bt_event_callback(int event, bluetooth_event_param_t *param)
3853 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3855 bluetooth_rfcomm_connection_t *discon_ind =
3856 (bluetooth_rfcomm_connection_t *)param->param_data;
3858 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3866 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3867 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3869 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3872 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3875 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3876 * @brief Disconnect rfcomm connection
3879 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3880 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3883 * @return BLUETOOTH_ERROR_NONE - Success \n
3884 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3885 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3886 * @param[in] int socket_fd the sending socket fd
3892 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3894 printf("Disconnection failed");
3896 printf("Disconnection Success");
3900 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3903 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3904 * @brief Rfcomm socket listen
3907 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3908 * after the bluetooth_rfcomm_create_socket API.
3909 * This API listen for the incomming connection and once it receives a connection, it will give
3910 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3911 * event to the application. This is an Asynchronous API call.
3914 * @return BLUETOOTH_ERROR_NONE - Success \n
3915 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3916 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3918 * @param[in] int socket_fd
3919 * @param[in] max pending connection.
3922 * @see bluetooth_rfcomm_create_socket
3925 void bt_event_callback(int event, bluetooth_event_param_t* param)
3929 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3931 bluetooth_rfcomm_connection_t *conn_ind =
3932 (bluetooth_rfcomm_connection_t *)param->param_data;
3934 printf("\nConnected from FD %d", conn_ind->socket_fd);
3942 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3943 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3947 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3950 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3951 * @brief Rfcomm socket listen
3954 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3955 * after the bluetooth_rfcomm_create_socket API.
3956 * This API listen for the incomming connection and once it receives a connection, it will give
3957 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3958 * event to the application. This is an Asynchronous API call.
3961 * @return BLUETOOTH_ERROR_NONE - Success \n
3962 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3963 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3965 * @param[in] int socket_fd
3966 * @param[in] max pending connection.
3971 * @see bluetooth_rfcomm_create_socket_ex
3974 void bt_event_callback(int event, bluetooth_event_param_t* param)
3978 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3980 bluetooth_rfcomm_connection_t *conn_ind =
3981 (bluetooth_rfcomm_connection_t *)param->param_data;
3983 printf("\nConnected from FD %d", conn_ind->socket_fd);
3991 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3992 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3997 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4000 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4001 * @brief Rfcomm socket listen
4004 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4005 * after the bluetooth_rfcomm_create_socket API.
4006 * This API listen for the incomming connection and once it receives a connection, it will give
4007 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4008 * event to the application. This is an Asynchronous API call.
4011 * @return BLUETOOTH_ERROR_NONE - Success \n
4012 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4013 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4015 * @param[in] int socket_fd
4016 * @param[in] max pending connection.
4019 * @see bluetooth_rfcomm_create_socket
4022 void bt_event_callback(int event, bluetooth_event_param_t* param)
4026 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4028 char *name = (char *)param->param_data;
4030 printf("\nConnected from %s", name);
4032 bluetooth_rfcomm_accept_connection();
4040 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4041 ret = bluetooth_rfcomm_listen(fd, 1);
4045 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4048 * @fn int bluetooth_rfcomm_accept_connection()
4049 * @brief Accepts the authorization request indicated by the event
4050 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4052 * This function is a synchronous call.
4054 * @return BLUETOOTH_ERROR_NONE - Success \n
4055 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4057 * @param[in] the socket fd of the server
4058 * @param[out] the socket fd of the client
4062 * @see bluetooth_rfcomm_reject_connection
4064 int bluetooth_rfcomm_accept_connection(int server_fd);
4067 * @fn int bluetooth_rfcomm_reject_connection()
4068 * @brief Rejects the authorization request indicated by the event
4069 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4071 * This function is a synchronous call.
4073 * @return BLUETOOTH_ERROR_NONE - Success \n
4074 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4076 * @param[in] the socket fd of the server
4080 * @see bluetooth_rfcomm_accept_connection
4082 int bluetooth_rfcomm_reject_connection(int server_fd);
4085 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4086 * @brief Informs whether rfcomm server uuid is available or not.
4088 * This function is a synchronous call.
4090 * @return TRUE - RFCOMM uuid is available \n
4091 * FALSE - RFCOMM uuid is not available \n
4093 * @param[in] uuid UUID string
4099 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4102 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4103 * const char *remote_uuid)
4104 * @brief Connect to the remote device rfcomm *
4106 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4107 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4108 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4109 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4110 * initiating a connection.
4112 * @return BLUETOOTH_ERROR_NONE - Success \n
4113 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4114 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4115 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4116 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4117 * @param[in] bluetooth_device_address_t remote bt_address
4118 * @param[in] char remote uuid
4120 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4124 void bt_event_callback(int event, bluetooth_event_param_t *param)
4128 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4130 if (param->result >= BLUETOOTH_ERROR_NONE)
4132 bt_sdp_info_t *bt_sdp_info=param->param_data;
4134 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4135 bt_sdp_info->device_addr.addr[0],
4136 bt_sdp_info->device_addr.addr[1],
4137 bt_sdp_info->device_addr.addr[2],
4138 bt_sdp_info->device_addr.addr[3],
4139 bt_sdp_info->device_addr.addr[4],
4140 bt_sdp_info->device_addr.addr[5]);
4142 printf("Supported service list:\n");
4143 for(i=0; i<bt_sdp_info->service_index; i++)
4145 bt_sdp_info->service_list_array[i]);
4148 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4149 //rfcomm_test_uuid);
4153 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4155 bluetooth_rfcomm_connection_t *conn_ind =
4156 (bluetooth_rfcomm_connection_t *)param->param_data;
4158 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4159 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4160 "SERVER" : "CLIENT");
4165 bluetooth_device_address_t remote_address = {{0},};
4166 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4167 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4168 ret = bluetooth_search_service(&remote_address);
4170 printf("Seach failed, Reason = %d", ret);
4172 printf("Search Success, Ret = %d", ret);
4174 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4176 printf("Connection failed, Reason = %d", ret);
4178 printf("Connection Success, Ret = %d", ret);
4182 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4183 const char *remote_uuid);
4186 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4187 * @brief Disconnect rfcomm connection
4190 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4191 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4194 * @return BLUETOOTH_ERROR_NONE - Success \n
4195 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4196 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4197 * @param[in] char remote bt_address
4200 * @see bluetooth_rfcomm_connect
4204 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4206 printf("Disconnection failed");
4208 printf("Disconnection Success");
4213 int bluetooth_rfcomm_disconnect(int socket_fd);
4216 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4217 * @brief Write to rfcomm connection
4220 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4221 * API is used to send the data for server and the client.
4223 * @return BLUETOOTH_ERROR_NONE - Success \n
4224 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4225 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4227 * @param[in] const char *buff Data buffer to send
4228 * @param[in] int length Length of the data
4231 * @see bluetooth_rfcomm_connect
4234 char *buff = "Test data 123456789"
4235 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4237 printf("Send failed");
4239 printf("Send success");
4243 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4246 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4247 * @brief Informs whether rfcomm client is connected.
4249 * This function is a synchronous call.
4251 * @return TRUE - RFCOMM client is connected \n
4252 * FALSE - RFCOMM client is not connected \n
4258 gboolean bluetooth_rfcomm_is_client_connected(void);
4259 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4260 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4263 * @fn int bluetooth_network_activate_server(void)
4264 * @brief Activate the NAP (Network Access Point) service
4266 * This function is a asynchronous call.
4267 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4269 * @return BLUETOOTH_ERROR_NONE - Success \n
4270 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4271 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4272 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4275 * @see bluetooth_network_deactivate_server
4278 int bluetooth_network_activate_server(void);
4281 * @fn int bluetooth_network_deactivate_server(void)
4282 * @brief Deactivate the NAP (Network Access Point) service
4284 * This function is a asynchronous call.
4285 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4287 * @return BLUETOOTH_ERROR_NONE - Success \n
4288 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4289 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4290 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4293 * @see bluetooth_network_activate_server
4296 int bluetooth_network_deactivate_server(void);
4299 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4300 * bluetooth_network_role_t role,
4302 * @brief Connect the network server in the peer
4304 * This function is a asynchronous call.
4305 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4307 * @return BLUETOOTH_ERROR_NONE - Success \n
4308 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4309 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4310 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4313 * @param[in] device_address This indicates an address of the device with which the pairing
4314 * should be initiated
4315 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4316 * need to use the third parameter.
4317 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4318 * connect. UUID string
4320 * @see bluetooth_network_disconnect
4322 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4323 bluetooth_network_role_t role, char *custom_uuid);
4326 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4327 * bluetooth_network_role_t role,
4328 * char *custom_uuid)
4329 * @brief Connect the network server in the peer
4331 * This function is a asynchronous call.
4332 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4334 * @return BLUETOOTH_ERROR_NONE - Success \n
4335 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4336 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4337 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4340 * @param[in] device_address This indicates an address of the device with which the pairing
4341 * should be initiated
4343 * @see bluetooth_network_connect
4345 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4348 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4349 * @brief Disconnect the device from the network
4351 * This function is an asynchronous call.
4352 * The network server disconnect request is responded by
4353 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4355 * @return BLUETOOTH_ERROR_NONE - Success \n
4356 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4357 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4358 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4361 * @param[in] device_address This indicates an address of the connected client device
4363 * @see bluetooth_network_activate_server
4365 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4370 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4371 * bt_hdp_role_type_t role,
4372 * bt_hdp_qos_type_t channel_type,
4373 * char **app_handle)
4374 * @brief Activate the HDP service for a particular data type
4376 * This function is a synchronous call.
4378 * @return BLUETOOTH_ERROR_NONE - Success \n
4379 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4380 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4381 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4384 * @param[in] data_type The data type against corresponding service
4385 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4386 * @param[in] channel_type The QOS type for the channel.
4387 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4388 * For role = HDP_ROLE_SINK, the channel_type
4389 * should be HDP_QOS_ANY.
4390 * @param[out] app_handle The application handler against corresponding service
4392 * @see bluetooth_hdp_deactivate
4394 int bluetooth_hdp_activate(unsigned short data_type,
4395 bt_hdp_role_type_t role,
4396 bt_hdp_qos_type_t channel_type,
4399 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4400 * @brief Deactivate the HDP service for a particular service using the handler
4402 * This function is a synchronous call.
4404 * @return BLUETOOTH_ERROR_NONE - Success \n
4405 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4406 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4407 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4410 * @param[in] app_handle The application handler against corresponding service
4412 * @see bluetooth_hdp_deactivate
4414 int bluetooth_hdp_deactivate(const char *app_handle);
4417 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4418 * const char *buffer, unsigned int size)
4419 * @brief Send data to the remote HDP device
4421 * This function is a synchronous call.
4423 * @return BLUETOOTH_ERROR_NONE - Success \n
4424 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4425 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4426 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4427 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4430 * @param[in] channel_id The channel id for the connection.
4431 * @param[in] buffer The pdu buffer.
4432 * @param[in] size Size of the buffer.
4434 * @see bluetooth_hdp_connect
4436 int bluetooth_hdp_send_data(unsigned int channel_id,
4437 const char *buffer, unsigned int size);
4439 * @fn int bluetooth_hdp_connect(const char *app_handle,
4440 * bt_hdp_qos_type_t channel_type,
4441 * const bluetooth_device_address_t *device_address)
4442 * @brief Connect to the remote device(Mainly used by source)
4444 * This function is a asynchronous call.
4445 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4447 * @return BLUETOOTH_ERROR_NONE - Success \n
4448 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4449 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4450 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4451 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4454 * @param[in] app_handle The application handler against corresponding service
4455 * @param[in] channel_type The QOS type for the channel.
4456 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4457 * @param[in] device_address The remote device Bd address.
4460 * @see bluetooth_hdp_disconnect
4462 int bluetooth_hdp_connect(const char *app_handle,
4463 bt_hdp_qos_type_t channel_type,
4464 const bluetooth_device_address_t *device_address);
4466 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4467 * const bluetooth_device_address_t *device_address)
4468 * @brief Disconnect from the remote device(Mainly used by source)
4470 * This function is a asynchronous call.
4471 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4473 * @return BLUETOOTH_ERROR_NONE - Success \n
4474 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4475 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4476 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4477 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4480 * @param[in] channel_id The channel id for the connection.
4481 * @param[in] device_address The remote device Bd address.
4484 * @see bluetooth_hdp_connect
4486 int bluetooth_hdp_disconnect(unsigned int channel_id,
4487 const bluetooth_device_address_t *device_address);
4491 * @fn int bluetooth_opc_init(void)
4492 * @brief Initialize OPP client.
4494 * This function is a synchronous call.
4495 * No event corresponding to this api
4497 * @return BLUETOOTH_ERROR_NONE - Success \n
4498 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4499 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4500 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4501 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4506 * @see bluetooth_opc_deinit
4508 int bluetooth_opc_init(void);
4511 * @fn int bluetooth_opc_deinit(void)
4512 * @brief Deinitialize OPP client.
4514 * This function is a synchronous call.
4515 * No event corresponding to this api
4517 * @return BLUETOOTH_ERROR_NONE - Success \n
4518 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4519 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4524 * @see bluetooth_opc_init
4527 int bluetooth_opc_deinit(void);
4530 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4531 char **file_name_array)
4532 * @brief Send multiple files to a remote device.
4534 * This function is a asynchronous call.
4535 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4537 * @return BLUETOOTH_ERROR_NONE - Success \n
4538 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4539 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4540 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4541 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4542 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4543 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4546 * @param[in] device_address The remote device Bd address.
4547 * @param[in] file_name_array Array of filepaths to be sent.
4550 * @see bluetooth_opc_cancel_push
4553 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4554 char **file_name_array);
4557 * @fn int bluetooth_opc_cancel_push(void)
4558 * @brief Cancels the ongoing file push.
4560 * This function is a asynchronous call.
4561 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4562 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4564 * @return BLUETOOTH_ERROR_NONE - Success \n
4565 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4566 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4571 * @see bluetooth_opc_push_files
4574 int bluetooth_opc_cancel_push(void);
4577 * @fn gboolean bluetooth_opc_session_is_exist(void)
4578 * @brief Informs whether opc session exists or not.
4580 * This function is a synchronous call.
4582 * @return TRUE - OPC session exists \n
4583 * FALSE - OPC session does not exist \n
4591 gboolean bluetooth_opc_session_is_exist(void);
4594 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4595 * @brief Informs whether opc session exists or not.
4597 * This function is a synchronous call.
4599 * @return BLUETOOTH_ERROR_NONE - Success \n
4600 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4601 * BLUETOOTH_ERROR_INTERNAL \n
4604 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4609 int bluetooth_opc_is_sending(gboolean *is_sending);
4612 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4613 int transfer_id, unsigned char *progress)
4614 * @brief Gets the percentage progress for ongoing transfers.
4616 * This function is a synchronous call.
4618 * @return BLUETOOTH_ERROR_NONE - Success \n
4619 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4620 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4623 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4624 * @param[in] transfer_id Transfer ID
4625 * @param[out] progress Percentage Progress
4629 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4630 int transfer_id, unsigned char *progress);
4633 * @fn int bluetooth_obex_server_init(const char *dst_path)
4634 * @brief Initialize OPP and FTP server.
4636 * This function is a synchronous call.
4637 * No event corresponding to this api
4639 * @return BLUETOOTH_ERROR_NONE - Success \n
4640 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4641 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4642 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4643 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4646 * @param[in] dst_path OPS destination file path.
4648 * @see bluetooth_obex_server_deinit
4650 int bluetooth_obex_server_init(const char *dst_path);
4654 * @fn int bluetooth_obex_server_deinit(void)
4655 * @brief Deinitialize OPP and FTP server.
4657 * This function is a synchronous call.
4658 * No event corresponding to this api
4660 * @return BLUETOOTH_ERROR_NONE - Success \n
4661 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4662 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4667 * @see bluetooth_obex_server_init
4669 int bluetooth_obex_server_deinit(void);
4673 * @fn gboolean bluetooth_obex_server_is_activated(void)
4674 * @brief Informs whether obex server is activated or not.
4676 * This function is a synchronous call.
4678 * @return TRUE - OBEX server is activated \n
4679 * FALSE - OBEX server is not activated \n
4686 gboolean bluetooth_obex_server_is_activated(void);
4690 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4691 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4693 * This function is a synchronous call.
4694 * No event corresponding to this api
4696 * @return BLUETOOTH_ERROR_NONE - Success \n
4697 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4698 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4699 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4700 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4704 * @param[in] dst_path OPS destination file path.
4706 * @see bluetooth_obex_server_deinit_without_agent
4708 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4712 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4713 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4715 * This function is a synchronous call.
4716 * No event corresponding to this api
4718 * @return BLUETOOTH_ERROR_NONE - Success \n
4719 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4720 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4725 * @see bluetooth_obex_server_init_without_agent
4727 int bluetooth_obex_server_deinit_without_agent(void);
4731 * @fn int bluetooth_obex_server_accept_connection(void)
4732 * @brief Accepts the authorization request indicated by the event
4733 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4735 * This function is a synchronous call.
4737 * @return BLUETOOTH_ERROR_NONE - Success \n
4738 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4739 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4743 * @see bluetooth_obex_server_reject_authorize
4745 int bluetooth_obex_server_accept_connection(void);
4749 * @fn int bluetooth_obex_server_reject_connection(void)
4750 * @brief Rejects the authorization request indicated by the event
4751 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4753 * This function is a synchronous call.
4755 * @return BLUETOOTH_ERROR_NONE - Success \n
4756 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4757 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4761 * @see bluetooth_obex_server_reject_authorize
4763 int bluetooth_obex_server_reject_connection(void);
4767 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4768 * @brief Accepts the authorization request indicated by the event
4769 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4771 * This function is a asynchronous call.
4772 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4774 * @return BLUETOOTH_ERROR_NONE - Success \n
4775 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4776 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4777 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4780 * @param[in] filename Authorized filename.
4783 * @see bluetooth_obex_server_reject_authorize
4786 int bluetooth_obex_server_accept_authorize(const char *filename);
4789 * @fn int bluetooth_obex_server_reject_authorize(void)
4790 * @brief Reject the authorization request indicated by the event
4791 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4793 * This function is a asynchronous call.
4794 * No event for this api..
4796 * @return BLUETOOTH_ERROR_NONE - Success \n
4797 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4798 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4803 * @see bluetooth_obex_server_accept_authorize
4806 int bluetooth_obex_server_reject_authorize(void);
4809 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4810 * @brief Set the OPS destination file path..
4812 * This function is a asynchronous call.
4813 * No event for this api..
4815 * @return BLUETOOTH_ERROR_NONE - Success \n
4816 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4817 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4818 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4821 * @param[in] dst_path OPS destination file path.
4827 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4830 * @fn int bluetooth_obex_server_set_root(const char *root)
4831 * @brief Set the FTS root folder..
4833 * This function is a asynchronous call.
4834 * No event for this api..
4836 * @return BLUETOOTH_ERROR_NONE - Success \n
4837 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4838 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4839 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4840 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4841 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4844 * @param[in] root FTS root folder.
4850 int bluetooth_obex_server_set_root(const char *root);
4853 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4854 * @brief Cancel the transfer on server
4856 * This function is an asynchronous call.
4857 * If the function call that cancels transfer is successful, the application would receive
4858 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4859 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4860 * the error code will be BLUETOOTH_ERROR_NONE
4862 * @return BLUETOOTH_ERROR_NONE - Success \n
4863 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4864 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4865 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4866 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4869 * @param[in] transfer_id transfer ID
4874 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4878 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4879 * @brief Cancel the transfer on server
4881 * This function is an asynchronous call.
4882 * If the function call that cancels transfer is successful, the application would receive
4883 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4884 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4885 * the error code will be BLUETOOTH_ERROR_NONE
4887 * @return BLUETOOTH_ERROR_NONE - Success \n
4888 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4889 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4890 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4891 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4898 int bluetooth_obex_server_cancel_all_transfers(void);
4902 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4903 * @brief Informs whether obex server is receiving or not.
4905 * This function is a synchronous call.
4907 * @return BLUETOOTH_ERROR_NONE - Success \n
4908 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4909 * BLUETOOTH_ERROR_INTERNAL \n
4912 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4917 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4921 * @fn int bluetooth_map_client_init(void)
4922 * @brief Initialize MAP client.
4924 * This function is a synchronous call.
4925 * No event corresponding to this api
4927 * @return BLUETOOTH_ERROR_NONE - Success \n
4928 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4929 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4930 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4931 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4936 * @see bluetooth_map_client_deinit
4938 int bluetooth_map_client_init(void);
4940 int bluetooth_map_client_deinit(void);
4942 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
4944 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
4946 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
4948 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
4949 bt_map_client_list_folders_filter_t *filter);
4952 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
4953 * @brief Return all available fields that can be used in Fields filter.
4955 * This function is a asynchronous call.
4957 * @return BLUETOOTH_ERROR_NONE - Success \n
4958 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4959 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
4962 * @param[in] session Information about session.
4965 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
4967 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
4969 bt_map_client_list_messages_filter_t *filter);
4971 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
4973 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
4974 const char *source_file,
4976 bt_map_client_push_message_args_t *args);
4978 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
4979 const bt_map_client_message_object_t message_object,
4980 const char *target_file,
4985 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4986 * @brief Read the local Hash and Randmizer.
4988 * This function is a synchronous call.
4990 * @return BLUETOOTH_ERROR_NONE - Success \n
4991 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4995 * @param[out] local_oob_data - Pointer to the local OOB data
5001 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5005 * @fn int bluetooth_oob_add_remote_data(
5006 * const bluetooth_device_address_t *remote_device_address,
5007 * bt_oob_data_t *oob_data)
5008 * @brief Add/updated the remote device Hash and Randmizer.
5010 * This function is a synchronous call.
5011 * No event for this api..
5013 * @return BLUETOOTH_ERROR_NONE - Success \n
5014 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5017 * @param[in] remote_device_address - Remote device address
5018 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5024 int bluetooth_oob_add_remote_data(
5025 const bluetooth_device_address_t *remote_device_address,
5026 bt_oob_data_t *remote_oob_data);
5030 * @fn int bluetooth_oob_remove_remote_data(
5031 * const bluetooth_device_address_t *remote_device_address)
5032 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5034 * This function is a synchronous call.
5035 * No event for this api..
5037 * @return BLUETOOTH_ERROR_NONE - Success \n
5038 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5041 * @param[in] remote_device_address - Remote device address
5047 int bluetooth_oob_remove_remote_data(
5048 const bluetooth_device_address_t *remote_device_address);
5051 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5052 * bt_gatt_handle_info_t *prim_svc);
5054 * @brief Gets the GATT based primary services handle supported by remote device
5056 * This function is a synchronous call.
5057 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5059 * @return BLUETOOTH_ERROR_NONE - Success \n
5060 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5061 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5062 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5065 * @param[in] address - Remote device address
5066 * @param[out] prim_svc - Structure containing remote service count and handle list.
5069 * @see bluetooth_gatt_free_primary_services()
5071 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5072 bt_gatt_handle_info_t *prim_svc);
5075 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5077 * @brief Discovers the characteristics of GATT based service of remote device
5079 * This function is an asynchronous call.
5080 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5082 * @return BLUETOOTH_ERROR_NONE - Success \n
5083 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5084 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5085 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5088 * @param[in] service_handle - Handle for remote service.
5093 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5095 int bluetooth_gatt_set_service_change_watcher(
5096 const bluetooth_device_address_t *address, gboolean enable);
5099 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5100 * bt_gatt_service_property_t *service);
5102 * @brief Gets the properties of GATT based service of remote device
5104 * This function is a synchronous call.
5105 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5107 * @return BLUETOOTH_ERROR_NONE - Success \n
5108 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5109 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5110 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5113 * @param[in] service_handle - Handle for remote service.
5114 * @param[out] service - Structure containing remote service property.
5117 * @see bluetooth_gatt_free_service_property()
5119 int bluetooth_gatt_get_service_property(const char *service_handle,
5120 bt_gatt_service_property_t *service);
5123 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5125 * @brief Register to GATT based service to receive value change notification/indication.
5127 * This function is a synchronous call.
5128 * No event for this api.
5130 * @return BLUETOOTH_ERROR_NONE - Success \n
5131 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5132 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5133 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5136 * @param[in] service_handle - Handle for remote service.
5141 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5144 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5146 * @brief Unregister GATT based service to receive value change notification/indication.
5148 * This function is a synchronous call.
5149 * No event for this api.
5151 * @return BLUETOOTH_ERROR_NONE - Success \n
5152 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5153 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5154 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5157 * @param[in] service_handle - Handle for remote service.
5162 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5165 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5166 * bt_gatt_char_property_t *characteristic);
5168 * @brief Provides characteristic value along with properties.
5170 * This function is a synchronous call.
5171 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5173 * @return BLUETOOTH_ERROR_NONE - Success \n
5174 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5175 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5176 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5179 * @param[in] char_handle - Handle for Characteristic property.
5180 * @param[out] characteristic - Structure containing remote characteristic property.
5183 * @see bluetooth_gatt_free_char_property()
5185 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5186 bt_gatt_char_property_t *characteristic);
5189 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5190 * bt_gatt_char_property_t *characteristic);
5192 * @brief Provides characteristic descriptor value along with its UUID.
5194 * This function is a synchronous call.
5195 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5197 * @return BLUETOOTH_ERROR_NONE - Success \n
5198 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5199 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5200 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5203 * @param[in] desc_handle - Handle for Characteristic descriptor.
5204 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5207 * @see bluetooth_gatt_free_desc_property()
5209 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5210 bt_gatt_char_descriptor_property_t *descriptor);
5214 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5215 * const guint8 *value, int length)
5217 * @brief Set characteristic value.
5219 * This function is a synchronous call.
5221 * @return BLUETOOTH_ERROR_NONE - Success \n
5222 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5223 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5224 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5227 * @param[in] char_handle - Handle for Characteristic property.
5228 * @param[in] value - New value to set for characteristic property.
5229 * @param[in] length - Length of the value to be set.
5234 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5235 const guint8 *value, int length);
5238 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5239 * const guint8 *value, int length, guint8 write_type)
5241 * @brief Set characteristic value by write type.
5243 * This function is a synchronous call if write type is "write without resonse"
5244 * and it is an asynchronous call if write type is "write with response"
5246 * @return BLUETOOTH_ERROR_NONE - Success \n
5247 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5248 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5249 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5252 * @param[in] char_handle - Handle for Characteristic property.
5253 * @param[in] value - New value to set for characteristic property.
5254 * @param[in] length - Length of the value to be set.
5255 * @param[in] write_type - Type of write.
5260 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5261 const guint8 *value, int length, guint8 write_type);
5265 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5266 * const guint8 *value, int length)
5268 * @brief Set characteristic value request.
5270 * This function is an asynchronous call.
5272 * @return BLUETOOTH_ERROR_NONE - Success \n
5273 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5274 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5275 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5278 * @param[in] char_handle - Handle for Characteristic property.
5279 * @param[in] value - New value to set for characteristic property.
5280 * @param[in] length - Length of the value to be set.
5285 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5286 const guint8 *value, int length);
5289 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5291 * @brief Read characteristic value.
5293 * This function is a asynchronous call.
5295 * @return BLUETOOTH_ERROR_NONE - Success \n
5296 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5297 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5298 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5301 * @param[in] char_handle - Handle for Characteristic property.
5306 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5309 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5310 * const char *service_uuid,
5311 * bt_gatt_service_property_t *service)
5313 * @brief Gets the service property from a device based on a particular uuid
5315 * This function is a synchronous call.
5317 * @return BLUETOOTH_ERROR_NONE - Success \n
5318 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5319 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5320 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5323 * @param[in] address - BD address of the remote device
5324 * @param[in] service_uuid - uuid of the service.
5325 * @param[out] service - Structure containing the service property.
5330 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5331 const char *service_uuid,
5332 bt_gatt_service_property_t *service);
5335 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5336 * const char *char_uuid)
5338 * @brief Gets the characteristic property from a service based on a particular char uuid
5340 * This function is an asynchronous call.
5341 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5343 * @return BLUETOOTH_ERROR_NONE - Success \n
5344 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5345 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5346 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5349 * @param[in] service_handle - Service handle.
5350 * @param[in] uuid - Characteristic uuid.
5355 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5356 const char *char_uuid);
5359 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5361 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5363 * This function is a synchronous call.
5364 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5366 * @return BLUETOOTH_ERROR_NONE - Success \n
5367 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5370 * @param[in] prim_svc - GATT handle info structure
5373 * @see bluetooth_gatt_get_primary_services()
5375 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5378 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5380 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5382 * This function is a synchronous call.
5383 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5385 * @return BLUETOOTH_ERROR_NONE - Success \n
5386 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5389 * @param[in] svc_pty - GATT service property structure.
5392 * @see bluetooth_gatt_get_service_property()
5394 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5397 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5399 * @brief Provides characteristic value along with properties.
5401 * This function is a synchronous call.
5402 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5404 * @return BLUETOOTH_ERROR_NONE - Success \n
5405 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5408 * @param[in] char_pty - GATT characteristics property structure.
5411 * @see bluetooth_gatt_get_characteristics_property()
5413 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5416 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5418 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5420 * This function is a synchronous call.
5421 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5423 * @return BLUETOOTH_ERROR_NONE - Success \n
5424 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5427 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5430 * @see bluetooth_gatt_get_char_descriptor_property()
5432 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5434 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5436 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5439 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5441 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5443 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5445 * @return BLUETOOTH_ERROR_NONE - Success \n
5446 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5449 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5453 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5456 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5458 * @brief Read characteristic descriptor value.
5460 * This function is a asynchronous call.
5462 * @return BLUETOOTH_ERROR_NONE - Success \n
5463 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5464 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5465 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5468 * @param[in] desc_handle - Handle for Characteristic descriptor
5473 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5476 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5477 * const guint8 *value, int length);
5479 * @brief Set characteristic descriptor value.
5481 * This function is a asynchronous call.
5483 * @return BLUETOOTH_ERROR_NONE - Success \n
5484 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5485 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5486 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5489 * @param[in] desc_handle - Handle for Characteristic descriptor
5490 * @param[in] value - New value to set for characteristic descriptor
5491 * @param[in] length - Length of the value to be set.
5496 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5497 const guint8 *value, int length);
5499 /* @fn int bluetooth_gatt_init(void)
5501 * @brief Initializes the gatt service.
5503 * This function is a synchronous call.
5504 * @return BLUETOOTH_ERROR_NONE - Success \n
5505 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5506 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5507 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5510 * @remark Adapter should be enabled
5511 * @see bluetooth_gatt_deinit()
5513 int bluetooth_gatt_init(void);
5515 /* @fn int bluetooth_gatt_init(void)
5517 * @brief DeInitializes the gatt service.
5519 * This function is a synchronous call.
5520 * @return BLUETOOTH_ERROR_NONE - Success \n
5521 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5522 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5523 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5526 * @remark Adapter should be enabled
5527 * @see bluetooth_gatt_init()
5529 int bluetooth_gatt_deinit(void);
5531 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5532 unsigned char **svc_path)
5534 * @brief Exports a new gatt service to the service interface.
5536 * This function is a synchronous call.
5538 * @return BLUETOOTH_ERROR_NONE - Success \n
5539 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5540 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5541 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5544 * @param[in] svc_uuid Gatt service uuid.
5545 * @param[out] svc_path service object path of the exported service.
5546 * @remark Adapter should be enabled
5547 * @see bluetooth_gatt_init()
5549 int bluetooth_gatt_add_service(const char *svc_uuid,
5552 /* @fn int bluetooth_gatt_add_new_characteristic(
5553 const char *svc_path, const char *char_uuid,
5554 bt_gatt_permission_t permissions,
5555 bt_gatt_characteristic_property_t properties,
5556 int flags_length, char **char_path);;
5558 * @brief Exports a new gatt characteristic to the characteristic interface.
5560 * This function is a synchronous call.
5561 * @return BLUETOOTH_ERROR_NONE - Success \n
5562 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5563 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5564 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5566 * @param[in] svc_path service object path of the exported service.
5567 * @param[in] char_uuid Gatt service uuid.
5568 * @param[in] properties GATT characteristic properties.
5569 * @param[out] char_path characteristic object path of the exported characteristic.
5571 * @remark Adapter should be enabled
5572 * @see bluetooth_gatt_add_service()
5574 int bluetooth_gatt_add_new_characteristic(
5575 const char *svc_path, const char *char_uuid,
5576 bt_gatt_permission_t permissions,
5577 bt_gatt_characteristic_property_t properties,
5580 /* @fn bluetooth_gatt_set_characteristic_value(
5581 const char *characteristic, const char *char_value,
5584 * @brief adds gatt charactertisic value to the given charactertistic path.
5586 * This function is a synchronous call.
5587 * @return BLUETOOTH_ERROR_NONE - Success \n
5588 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5589 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5590 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5592 * @param[in] char_value Value of the GATT characteristic to be added.
5593 * @param[in] value_length length of the chantacteristic value..
5594 * @param[out] characteristic characteristic object path..
5596 * @remark Adapter should be enabled
5597 * @see bluetooth_gatt_add_service()
5599 int bluetooth_gatt_set_characteristic_value(
5600 const char *characteristic, const char *char_value,
5603 /* @fn int bluetooth_gatt_add_descriptor(
5604 const char *char_path, const char *desc_uuid,
5605 bt_gatt_permission_t permissions,
5608 * @brief Exports a new gatt descriptor to the descriptor interface.
5610 * This function is a synchronous call.
5612 * @return BLUETOOTH_ERROR_NONE - Success \n
5613 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5614 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5615 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5618 * @param[in] desc_uuid Gatt descriptor uuid.
5619 * @param[in] desc_value GATT descriptor value.
5620 * @param[in] value_length Length of GATT descriptor value.
5621 * @param[in] permissions descriptor permissions.
5622 * @param[in] properties GATT descriptor properties.
5623 * @param[in] char_path characteristics object path of the exported character.
5625 * @remark Adapter should be enabled
5626 * @see bluetooth_gatt_add_service()
5627 * @see bluetooth_gatt_add_characteristics()
5629 int bluetooth_gatt_add_descriptor(
5630 const char *char_path, const char *desc_uuid,
5631 bt_gatt_permission_t permissions,
5634 /* @fn int bluetooth_gatt_set_descriptor_value(
5635 const char *desc_path, const char *desc_value,
5638 * @brief Adds value to the given descriptor handle.
5640 * This function is a synchronous call.
5642 * @return BLUETOOTH_ERROR_NONE - Success \n
5643 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5644 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5645 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5648 * @param[in] desc_value GATT descriptor value.
5649 * @param[in] value_length Length of GATT descriptor value.
5650 * @param[in] desc_path descriptor path to which the value needs to be added.
5652 * @remark Adapter should be enabled
5653 * @see bluetooth_gatt_add_service()
5654 * @see bluetooth_gatt_add_characteristics()
5656 int bluetooth_gatt_set_descriptor_value(
5657 const char *desc_path, const char *desc_value,
5660 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5662 * @brief Reads the Service registered on manager interface.
5664 * This function is a synchronous call.
5666 * @return BLUETOOTH_ERROR_NONE - Success \n
5667 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5668 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5669 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5672 * @param[in] svc_uuid Gatt Service uuid.
5674 * @remark Adapter should be enabled and service should be registered.
5675 * @see bluetooth_gatt_register_service()
5677 int bluetooth_gatt_get_service(const char *svc_uuid);
5679 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5681 * @brief Registers the given service path with the library.
5683 * This function is a synchronous call.
5685 * @return BLUETOOTH_ERROR_NONE - Success \n
5686 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5687 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5688 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5691 * @param[in] svc_path service object path of the exported service.
5693 * @remark Adapter should be enabled
5694 * @see bluetooth_gatt_add_service()
5695 * @see bluetooth_gatt_add_characteristics()
5696 * @see bluetooth_gatt_add_descriptor()
5697 * @see bluetooth_gatt_register_application()
5699 int bluetooth_gatt_register_service(const char *svc_path);
5701 /* @fn int bluetooth_gatt_register_application(void)
5703 * @brief Registers the application with the bluez gatt server.
5705 * This function is a synchronous call.
5707 * @return BLUETOOTH_ERROR_NONE - Success \n
5708 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5709 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5710 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5714 * @remark Adapter should be enabled
5715 * @see bluetooth_gatt_init()
5716 * @see bluetooth_gatt_add_service()
5717 * @see bluetooth_gatt_add_characteristics()
5718 * @see bluetooth_gatt_add_descriptor()
5719 * @see bluetooth_gatt_register_service()
5721 int bluetooth_gatt_register_application(void);
5723 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5725 * @brief Removes(unregister) service from the bluez gatt server db.
5727 * This function is a synchronous call.
5729 * @return BLUETOOTH_ERROR_NONE - Success \n
5730 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5731 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5732 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5735 * @param[in] svc_path service object path of the exported service.
5737 * @remark Adapter should be enabled
5738 * @see bluetooth_gatt_add_service()
5739 * @see bluetooth_gatt_add_characteristics()
5740 * @see bluetooth_gatt_add_descriptor()
5741 * @see bluetooth_gatt_register_service()
5743 int bluetooth_gatt_unregister_service(const char *svc_path);
5745 /* @fn int bluetooth_gatt_unregister_application(void)
5747 * @brief Removes(unregister) the application with the bluez gatt server,
5748 * and deletes all the service registered.
5750 * This function is a synchronous call.
5752 * @return BLUETOOTH_ERROR_NONE - Success \n
5753 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5754 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5755 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5759 * @remark Adapter should be enabled
5760 * @see bluetooth_gatt_init()
5761 * @see bluetooth_gatt_add_service()
5762 * @see bluetooth_gatt_add_characteristics()
5763 * @see bluetooth_gatt_add_descriptor()
5764 * @see bluetooth_gatt_register_service()
5765 * @see bluetooth_gatt_unregister_service()
5767 int bluetooth_gatt_unregister_application(void);
5769 /* @fn int bluetooth_gatt_send_response(int request_id,
5770 * int offset, char *value, int value_length)
5772 * @brief Updates the attribute value in local attribute list.
5774 * This function is a synchronous call.
5776 * @return BLUETOOTH_ERROR_NONE - Success \n
5777 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5778 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5779 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5782 * @param[in] request_id The identification of a read request
5783 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5784 * @param[in] resp_state The identification of response state
5785 * @param[in] offset The offset from where a value is read
5786 * @param[in] value The value to be sent. It will be sent from @a offset.
5787 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5788 * @param[in] value_length Value Length.
5790 * @remark Adapter should be enabled
5791 * @see bluetooth_gatt_add_service()
5792 * @see bluetooth_gatt_add_characteristics()
5793 * @see bluetooth_gatt_add_descriptor()
5794 * @see bluetooth_gatt_register_service()
5796 int bluetooth_gatt_send_response(int request_id, guint req_type,
5797 int resp_state, int offset, char *value, int value_length);
5799 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5801 * @brief Sets the notification property for a characteristic.
5803 * This function is a synchronous call.
5805 * @return BLUETOOTH_ERROR_NONE - Success \n
5806 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5807 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5808 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5811 * @param[in] char_path characteristic object path.
5812 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5814 * @remark Adapter should be enabled
5815 * @see bluetooth_gatt_update_characteristic()
5817 int bluetooth_gatt_server_set_notification(const char *char_path,
5818 bluetooth_device_address_t *unicast_address);
5820 /* @fn int bluetooth_gatt_delete_services(void)
5822 * @brief deletes (unregisters) all services from the gatt server database..
5824 * This function is a synchronous call.
5826 * @return BLUETOOTH_ERROR_NONE - Success \n
5827 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5828 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5829 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5833 * @remark Adapter should be enabled
5834 * @see bluetooth_gatt_add_service()
5835 * @see bluetooth_gatt_add_characteristics()
5836 * @see bluetooth_gatt_add_descriptor()
5837 * @see bluetooth_gatt_register_service()
5838 * @see bluetooth_gatt_unregister_service()
5840 int bluetooth_gatt_delete_services(void);
5842 /* @fn int bluetooth_gatt_update_characteristic(void)
5844 * @brief updates the given characteristic with a new value
5846 * This function is a synchronous call.
5848 * @return BLUETOOTH_ERROR_NONE - Success \n
5849 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5850 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5851 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5855 * @remark Adapter should be enabled
5856 * @see bluetooth_gatt_add_service()
5857 * @see bluetooth_gatt_add_characteristics()
5858 * @see bluetooth_gatt_add_descriptor()
5859 * @see bluetooth_gatt_register_service()
5860 * @see bluetooth_gatt_unregister_service()
5862 int bluetooth_gatt_update_characteristic(const char *char_path,
5863 const char* char_value, int value_length);
5866 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5868 * @brief Set advertising status.
5870 * This function is used to enable or disable LE advertising.
5871 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5873 * This function is a synchronous call.
5875 * @return BLUETOOTH_ERROR_NONE - Success \n
5876 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5877 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5880 * @param[in] enable - The status of advertising
5883 * @see bluetooth_set_advertising_data
5885 int bluetooth_set_advertising(int handle, gboolean enable);
5888 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5890 * @brief Set advertising status along with interval value.
5892 * This function is used to enable or disable LE advertising.
5893 * Interval_min and Interval_max is used to set the best advertising interval.
5894 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5896 * This function is a synchronous call.
5898 * @return BLUETOOTH_ERROR_NONE - Success \n
5899 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5900 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5903 * @param[in] enable - The status of advertising
5904 * @param[in] interval_min - Minimum interval of advertising (msec)
5905 * @param[in] interval_max - Maximum interval of advertising (msec)
5906 * @param[in] filter_policy - Advertising filter policy
5909 * @see bluetooth_set_advertising_data
5911 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5912 bluetooth_advertising_params_t *params);
5915 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5916 * @brief Get the advertising data
5918 * This function is used to get advertising data.
5919 * Before calling this API, the adapter should be enabled.
5921 * This function is a synchronous call.
5923 * @return BLUETOOTH_ERROR_NONE - Success \n
5924 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5925 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5926 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5928 * @param[out] value - Advertising data structure.
5929 * @param[out] length - The length of Advertising data.
5933 bluetooth_advertising_data_t *value = { {0} };
5936 ret = bluetooth_get_advertising_data(&value, &length);
5939 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5942 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5944 * @brief Set advertising data with value
5946 * This function is used to set advertising data and Maximum size of advertising data
5947 * is 28 byte (Except Flag)
5949 * This function is a synchronous call.
5951 * @return BLUETOOTH_ERROR_NONE - Success \n
5952 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5953 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5956 * @param[in] value - Advertising data structure.
5960 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5963 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5965 * @brief Check the privilege for advertising parameter setting
5967 * This function is a synchronous call.
5969 * @return BLUETOOTH_ERROR_NONE - Success \n
5970 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5976 int bluetooth_check_privilege_advertising_parameter(void);
5979 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5980 * @brief Get the LE scan response data
5982 * This function is used to get scan response data.
5983 * Before calling this API, the adapter should be enabled.
5985 * This function is a synchronous call.
5987 * @return BLUETOOTH_ERROR_NONE - Success \n
5988 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5989 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5990 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5992 * @param[out] value - Scan response data structure.
5993 * @param[out] length - The length of Scan response data.
5997 bluetooth_scan_resp_data_t *value = { {0} };
6000 ret = bluetooth_get_scan_response_data(&value, &length);
6003 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6006 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6008 * @brief Set scan response data with value
6010 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6012 * This function is a synchronous call.
6014 * @return BLUETOOTH_ERROR_NONE - Success \n
6015 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6016 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6019 * @param[in] value - LE Scan response data structure.
6023 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6026 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6028 * @brief Set scan interval and window
6030 * This function is used to set LE scan interval and window size
6032 * This function is a synchronous call.
6034 * @return BLUETOOTH_ERROR_NONE - Success \n
6035 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6036 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6039 * @param[in] interval - Interval of LE scan (msec)
6040 * @param[in] window - Window size of LE scan (msec)
6044 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6047 * @fn int bluetooth_is_advertising(void)
6048 * @brief Check for the advertising is in-progress or not.
6050 * This API is used to check the current status of the advertising procedure.
6051 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6054 * This function checks whether the advertising is started or not.
6056 * This function is a synchronous call.
6058 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6060 * @return BLUETOOTH_ERROR_NONE - Success \n
6061 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6064 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6068 gboolean is_advertising = 0;
6070 ret = bluetooth_is_advertising(&is_advertising);
6073 int bluetooth_is_advertising(gboolean *is_advertising);
6076 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6077 * @brief Add LE device to white list
6079 * This API is used to add LE device to white list
6080 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6084 * This function is a synchronous call.
6086 * @param[in] address The address of remote device
6088 * @return BLUETOOTH_ERROR_NONE - Success \n
6089 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6092 * @see bluetooth_set_custom_advertising
6094 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6097 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6098 * @brief Remove LE device from white list
6100 * This API is used to remove LE device from white list
6101 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6105 * This function is a synchronous call.
6107 * @param[in] address The address of remote device
6109 * @return BLUETOOTH_ERROR_NONE - Success \n
6110 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6113 * @see bluetooth_set_custom_advertising
6115 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6118 * @fn int bluetooth_clear_white_list(void)
6119 * @brief Clear white list
6121 * This API is used to clear white list
6122 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6126 * This function is a synchronous call.
6128 * @param[in] address The address of remote device
6130 * @return BLUETOOTH_ERROR_NONE - Success \n
6131 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6134 * @see bluetooth_set_custom_advertising
6136 int bluetooth_clear_white_list(void);
6139 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6140 * const bluetooth_le_connection_param_t *parameters)
6141 * @brief update connection paramter of LE connection.
6143 * This function is a synchronous call.
6145 * @return BLUETOOTH_ERROR_NONE - Success \n
6146 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6149 * @param[in] address - remote device address value.
6150 * @param[in] parameters - new connection parameters.
6153 * @see bluetooth_bond_device
6155 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6156 const bluetooth_le_connection_param_t *parameters);
6159 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6161 * @brief Enable/Disable LE Privacy feature.
6163 * This function is used to enable or disable LE Privacy feature.
6164 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6166 * This function is a synchronous call.
6168 * @return BLUETOOTH_ERROR_NONE - Success \n
6169 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6170 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6173 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6177 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6180 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6182 * @brief Enable/Disable LE static random address.
6184 * This function is used to enable or disable LE static random address.
6186 * This function is a synchronous call.
6188 * @return BLUETOOTH_ERROR_NONE - Success \n
6189 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6190 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6193 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6197 int bluetooth_set_le_static_random_address(gboolean enable);
6200 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6201 * bluetooth_le_connection_mode_t mode)
6202 * @brief update connection paramter of LE connection.
6204 * This function is a synchronous call.
6206 * @return BLUETOOTH_ERROR_NONE - Success \n
6207 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6208 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6211 * @param[in] address - remote device address value.
6212 * @param[in] mode - new connection mode.
6216 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6217 bluetooth_le_connection_mode_t mode);
6220 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6221 * @brief Request for new ATT MTU value.
6223 * This function is a asynchronous call.
6225 * @return BLUETOOTH_ERROR_NONE - Success \n
6226 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6227 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6230 * @param[in] address - remote device address value.
6231 * @param[in] mtu - MTU value to be set.
6235 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6238 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6239 * unsigned int *mtu)
6240 * @brief Gets the xisting MTU value set for a connection.
6242 * This function is a synchronous call.
6244 * @return BLUETOOTH_ERROR_NONE - Success \n
6245 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6246 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6249 * @param[in] address - remote device address value.
6250 * @param[out] mtu - MTU value set for the connection.
6254 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6258 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6259 * bluetooth_device_address_t *id_address)
6260 * @brief Gets the Identity address of remote device.
6262 * This function is a synchronous call.
6264 * @return BLUETOOTH_ERROR_NONE - Success \n
6265 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6266 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6269 * @param[in] device_rpa - remote Resolvable private address.
6270 * @param[out] id_address - remote Identity device address value.
6274 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6275 bluetooth_device_address_t *id_address);
6278 * @fn int bluetooth_le_read_maximum_data_length()
6279 * @brief reads the maximum LE data length supported in the controller.
6281 * This function is a synchronous call.
6283 * @return BLUETOOTH_ERROR_NONE - Success \n
6284 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6290 int bluetooth_le_read_maximum_data_length(
6291 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6293 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6294 * @brief writes the host suggested values for the controllers max transmitted no of payload
6295 * octects to be used for new connections.
6297 * This function is a synchronous call.
6299 * @return BLUETOOTH_ERROR_NONE - Success \n
6300 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6306 int bluetooth_le_write_host_suggested_default_data_length(
6307 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6309 int bluetooth_le_read_suggested_default_data_length(
6310 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6312 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6313 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6315 int bluetooth_pbap_init(void);
6316 int bluetooth_pbap_deinit(void);
6317 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6318 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6319 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6320 bt_pbap_folder_t *folder);
6321 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6322 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6323 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6324 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6325 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6326 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6327 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6328 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6331 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6333 * @brief Set manufacturer data with value
6335 * This function is used to set manufacturer data.
6337 * This function is a synchronous call.
6339 * @return BLUETOOTH_ERROR_NONE - Success \n
6340 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6341 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6344 * @param[in] value - Manufacturer data structure.
6348 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6350 int bluetooth_set_passkey_notification(gboolean enable);
6353 * @fn int bluetooth_dpm_is_mode_allowed(void);
6355 * @brief Checks Restriction for BT mode(BT allowed or not)
6357 * This function is a synchronous call.
6359 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6360 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6361 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6368 int bluetooth_dpm_is_mode_allowed(void);
6371 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6373 * @brief Sets Restriction for BT mode(BT allowed or not)
6375 * This function is a synchronous call.
6377 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6378 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6379 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6382 * @param[in] value - BT Allow value.
6383 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6384 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6385 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6386 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6390 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6393 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6395 * @brief Reads the Restriction for BT mode(BT allowed or not)
6397 * This function is a synchronous call.
6399 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6400 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6401 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6405 * @param[out] value - BT Allow value.
6406 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6407 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6408 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6409 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6413 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6416 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6418 * @brief Sets the Restriction for device.
6420 * This function is a synchronous call.
6422 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6423 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6424 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6427 * @param[in] 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_activate_device_restriction(bt_dpm_status_t value);
6436 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6438 * @brief Reads the Restriction for device.
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
6448 * @param[out] value - State value.
6449 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6450 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6454 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6457 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6459 * @brief Sets the Restriction for uuid.
6461 * This function is a synchronous call.
6463 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6464 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6465 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6468 * @param[in] 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_activate_uuid_restriction(bt_dpm_status_t value);
6477 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6479 * @brief Reads the Restriction for uuid.
6481 * This function is a synchronous call.
6483 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6484 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6485 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6489 * @param[out] value - State value.
6490 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6491 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6495 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6498 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6500 * @brief Adds the device to blacklist.
6502 * This function is a synchronous call.
6504 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6505 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6506 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6509 * @param[in] device_address - Device address
6513 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6516 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6518 * @brief Adds the device to whitelist.
6520 * This function is a synchronous call.
6522 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6523 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6524 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6527 * @param[in] device_address - Device address
6531 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6534 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6536 * @brief Adds the Service UUIDS to blacklist.
6538 * This function is a synchronous call.
6540 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6541 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6542 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6545 * @param[in] service_uuids - profile or custom service uuids
6549 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6552 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6554 * @brief Adds the Service UUIDS to whitelist.
6556 * This function is a synchronous call.
6558 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6559 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6560 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6563 * @param[in] service_uuids - profile or custom service uuids
6567 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6570 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6572 * @brief Clears the devices from blacklist.
6574 * This function is a synchronous call.
6576 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6577 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6578 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6585 int bluetooth_dpm_clear_devices_from_blacklist(void);
6588 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6590 * @brief Clears the devices from whitelist.
6592 * This function is a synchronous call.
6594 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6595 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6596 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6603 int bluetooth_dpm_clear_devices_from_whitelist(void);
6606 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6608 * @brief Clears the uuids from blacklist.
6610 * This function is a synchronous call.
6612 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6613 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6614 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6621 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6624 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6626 * @brief Clears the uuids from whitelist.
6628 * This function is a synchronous call.
6630 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6631 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6632 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6639 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6642 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6644 * @brief reads the devices from blacklist.
6646 * This function is a synchronous call.
6648 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6649 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6650 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6653 * @param[out] device_list - list of devices
6657 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6660 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6662 * @brief reads the devices from whitelist.
6664 * This function is a synchronous call.
6666 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6667 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6668 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6671 * @param[out] device_list - list of devices
6675 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6678 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6680 * @brief reads the uuids from blacklist.
6682 * This function is a synchronous call.
6684 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6685 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6686 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6689 * @param[in] uuid_list - list of uuids
6693 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6696 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6698 * @brief reads the uuids from whitelist.
6700 * This function is a synchronous call.
6702 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6703 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6704 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6707 * @param[in] uuid_list - list of uuids
6711 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6714 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6716 * @brief Removes the device from whitelist.
6718 * This function is a synchronous call.
6720 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6721 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6722 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6725 * @param[in] device_address - Device address
6729 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6732 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6734 * @brief Removes the device from blacklist.
6736 * This function is a synchronous call.
6738 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6739 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6740 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6743 * @param[in] device_address - Device address
6747 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6750 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6752 * @brief Removes the Service UUIDS from whitelist.
6754 * This function is a synchronous call.
6756 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6757 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6758 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6761 * @param[in] service_uuids - profile or custom service uuids
6765 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6768 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6770 * @brief Removes the Service UUIDS from blacklist.
6772 * This function is a synchronous call.
6774 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6775 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6776 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6779 * @param[in] service_uuids - profile or custom service uuids
6783 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6786 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6788 * @brief Sets the Restriction for outgoing call.
6790 * This function is a synchronous call.
6792 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6793 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6794 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6797 * @param[in] value - State value.
6798 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6799 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6803 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6806 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6808 * @brief Reads the Restriction for outgoing call.
6810 * This function is a synchronous call.
6812 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6813 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6814 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6818 * @param[out] value - State value.
6819 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6820 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6824 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6827 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6829 * @brief Sets the Restriction for Pairing.
6831 * This function is a synchronous call.
6833 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6834 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6835 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6838 * @param[in] value - State value.
6839 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6840 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6844 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6847 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6849 * @brief Reads the Restriction for Pairing
6851 * This function is a synchronous call.
6853 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6854 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6855 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6859 * @param[out] value - State value.
6860 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6861 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6865 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6868 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6870 * @brief Sets the Restriction for using Profiles.
6872 * This function is a synchronous call.
6874 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6875 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6876 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6879 * @param[in]profile - Profile.
6880 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6881 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6882 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6883 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6884 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6885 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6886 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6887 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6888 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6889 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6890 * BLUETOOTH_DPM_PROFILE_NONE
6891 * @param[in] value - State value.
6892 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6893 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6897 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6900 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6902 * @brief Reads the Restriction for using Profiles.
6904 * This function is a synchronous call.
6906 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6907 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6908 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6911 * @param[in]profile - Profile.
6912 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6913 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6914 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6915 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6916 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6917 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6918 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6919 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6920 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6921 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6922 * BLUETOOTH_DPM_PROFILE_NONE
6923 * @param[out] value - State value.
6924 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6925 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6929 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6932 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6934 * @brief Sets the Restriction for Desktop Connectivity.
6936 * This function is a synchronous call.
6938 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6939 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6940 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6943 * @param[in] value - State value.
6944 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6945 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6949 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6952 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6954 * @brief Reads the Restriction for Desktop Connectivity.
6956 * This function is a synchronous call.
6958 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6959 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6960 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6964 * @param[out] value - State value.
6965 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6966 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6970 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6973 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6975 * @brief Sets the Restriction for Discoverable state.
6977 * This function is a synchronous call.
6979 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6980 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6981 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6984 * @param[in] value - State value.
6985 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6986 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6990 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6993 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6995 * @brief Reads the Restriction for Discoverable state.
6997 * This function is a synchronous call.
6999 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7000 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7001 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7005 * @param[out] value - State value.
7006 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7007 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7011 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7014 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7016 * @brief Sets the Restriction for linited discoverable state..
7018 * This function is a synchronous call.
7020 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7021 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7022 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7025 * @param[in] value - State value.
7026 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7027 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7031 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7034 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7036 * @brief Reads the Restriction for limited discoverable state.
7038 * This function is a synchronous call.
7040 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7041 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7042 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7046 * @param[out] value - State value.
7047 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7048 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7052 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7054 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7056 * @brief Sets the Restriction for Data trasnfer.
7058 * This function is a synchronous call.
7060 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7061 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7062 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7065 * @param[in] value - State value.
7066 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7067 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7071 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7075 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7077 * @brief Reads the Restriction for Data trasnfer.
7079 * This function is a synchronous call.
7081 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7082 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7083 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7087 * @param[out] value - State value.
7088 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7089 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7093 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7096 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7097 * bluetooth_pxp_poperty_t property, int value);
7099 * @brief Sets the Proximity alert level/properties for monitor role.
7101 * This function is a synchronous call.
7103 * @return BLUETOOTH_ERROR_NONE - Success \n
7104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7105 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7106 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7109 * @param[in] device_address remote device address
7110 * @param[in] property proximity profile property
7111 * @param[in] value alert level/property value to be set
7116 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7117 bluetooth_pxp_poperty_t property, int value);
7120 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7121 * bluetooth_pxp_poperty_t property, int *value);
7123 * @brief Reads the Proximity alert level/properties for monitor role.
7125 * This function is a synchronous call.
7127 * @return BLUETOOTH_ERROR_NONE - Success \n
7128 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7129 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7130 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7133 * @param[in] device_address remote device address
7134 * @param[in] property proximity profile property
7135 * @param[out] value alert level/property value
7139 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7140 bluetooth_pxp_poperty_t property, int *value);
7143 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7144 * int *services_supported);
7146 * @brief Reads the Proximity Monitor profile supported properties/services.
7148 * This function is a synchronous call.
7150 * @return BLUETOOTH_ERROR_NONE - Success \n
7151 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7152 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7153 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7156 * @param[in] device_address remote device address
7157 * @param[out] services_supported proximity profile property/service
7161 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7162 int *services_supported);
7165 * @fn int bluetooth_proximity_reporter_register();
7167 * @brief Register all proximity related services in BlueZ.
7169 * This function is a synchronous call.
7171 * @return BLUETOOTH_ERROR_NONE - Success \n
7172 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7178 int bluetooth_proximity_reporter_register(void);
7181 * @fn int bluetooth_proximity_reporter_unregister();
7183 * @brief Unregister all proximity related services in BlueZ.
7185 * This function is a synchronous call.
7187 * @return BLUETOOTH_ERROR_NONE - Success \n
7188 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7194 int bluetooth_proximity_reporter_unregister(void);
7197 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7198 * bluetooth_pxp_poperty_t property, int *value);
7200 * @brief Reads the Proximity alert level/properties for reporter role.
7202 * This function is a synchronous call.
7204 * @return BLUETOOTH_ERROR_NONE - Success \n
7205 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7206 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7207 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7210 * @param[in] device_address remote device address
7211 * @param[in] property proximity profile property
7212 * @param[out] value alert level/property value
7216 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7217 bluetooth_pxp_poperty_t property, int *value);
7225 #endif /* __cplusplus */
7226 #endif /* _BLUETOOTH_API_H_*/