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_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
196 * Device disconnect reason
199 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
200 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
201 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
202 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
203 } bluetooth_device_disconnect_reason_t;
206 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
209 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
210 } bluetooth_device_address_t;
213 * This is Bluetooth device address type
216 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
217 BLUETOOTH_DEVICE_RANDOM_ADDRESS
218 } bluetooth_device_address_type_t;
221 * This is Bluetooth version
224 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
225 } bluetooth_version_t;
228 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
231 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
232 } bluetooth_device_name_t;
235 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
238 int data_len; /**< manafacturer specific data length */
239 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
240 } bluetooth_manufacturer_data_t;
243 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
244 } bluetooth_device_pin_code_t;
250 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
251 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
252 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
253 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
254 } bluetooth_adapter_state_t;
260 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
261 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
262 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
263 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
264 } bluetooth_adapter_le_state_t;
270 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
271 /*Changed the order to make it compatable with old method */
272 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
273 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
274 /**< Discoverable mode with time limit
275 After specific timeout, it is changed
276 to non discoverable mode */
277 } bluetooth_discoverable_mode_t;
280 * Network connect mode
283 BLUETOOTH_NETWORK_PANU_ROLE,
285 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
286 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
287 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
288 } bluetooth_network_role_t;
294 BLUETOOTH_RFCOMM_SERVICE = 0x01,
295 BLUETOOTH_A2DP_SERVICE = 0x02,
296 BLUETOOTH_HSP_SERVICE = 0x04,
297 BLUETOOTH_HID_SERVICE = 0x08,
298 BLUETOOTH_NAP_SERVICE = 0x10,
299 BLUETOOTH_HFG_SERVICE = 0x20,
300 BLUETOOTH_GATT_SERVICE = 0x40,
301 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
302 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
303 BLUETOOTH_PBAP_SERVICE = 0x200,
304 } bluetooth_service_type_t;
310 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
311 /* represents that connection
312 * type can both BR/EDR and LE */
313 BLUETOOTH_DEV_CONN_BREDR = 0x00,
314 BLUETOOTH_DEV_CONN_LE = 0x01,
315 } bluetooth_conn_type_t;
321 BLUETOOTH_CODEC_ID_CVSD = 0x01,
322 BLUETOOTH_CODEC_ID_MSBC = 0x02,
323 } bluetooth_codec_type_t;
329 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
330 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
331 } bluetooth_hf_audio_connected_type_t;
337 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
338 } bluetooth_advertising_data_t;
344 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
345 } bluetooth_scan_resp_data_t;
348 * Advertising filter policy
351 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
352 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
353 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
354 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
355 } bluetooth_advertising_filter_policy_t;
361 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
362 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
363 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
364 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
365 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
366 } bluetooth_advertising_type_t;
369 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
370 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
371 } bluetooth_gatt_service_change_type_t;
374 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
375 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
376 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
377 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
378 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
379 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
380 } bt_gatt_permission_t;
383 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
384 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
385 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
386 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
387 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
388 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
389 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
390 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
391 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
392 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
393 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
394 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
395 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
396 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
397 } bt_gatt_characteristic_property_t;
400 * Remote device request types for attributes
403 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
404 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
405 } bluetooth_gatt_att_request_tyep_t;
408 * Proximity Property Type
411 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
412 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
413 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
414 } bluetooth_pxp_poperty_t;
417 * Advertising parameters
422 guint8 filter_policy;
424 } bluetooth_advertising_params_t;
430 int type; /**< passive 0, active 1 */
431 float interval; /**< LE scan interval */
432 float window; /**< LE scan window */
433 } bluetooth_le_scan_params_t;
443 } bluetooth_le_connection_param_t;
446 LE Read Maximum Data Length
449 guint16 max_tx_octets;
451 guint16 max_rx_octets;
453 } bluetooth_le_read_maximum_data_length_t;
456 LE Read Host suggested default Data Length
459 guint16 def_tx_octets;
461 } bluetooth_le_read_host_suggested_data_length_t;
464 * Samsung XSAT Vendor dependent command
469 } bluetooth_vendor_dep_at_cmd_t;
475 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
476 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
477 } bluetooth_opp_transfer_type_t;
482 } bluetooth_hf_ciev_device_event_t;
484 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
485 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
486 /**< Base ID for GAP Event */
487 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
488 /**< Base ID for SDP events */
489 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
490 /**< Base ID for RFCOMM events */
491 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
492 /**< Base ID for NETWORK events */
493 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
494 /**< Base ID for HDP events */
495 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
496 /**< Base ID for OPC events */
497 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
498 /**< Base ID for Obex Server events */
499 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
500 /**< Base ID for GATT events */
502 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
503 /**< Base ID for Audio events */
504 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
505 /**< Base ID for HID events */
506 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
507 /**< Base ID for Advertising events */
508 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
509 /**< Base ID for PBAP Client events */
510 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
511 /**< Base ID for AVRCP events */
512 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
513 /**< Base ID for IPSP events */
514 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
515 /**< Base ID for MAP events */
518 * Bluetooth event type
521 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
523 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
524 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
525 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
526 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
527 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
528 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
529 /**< Bluetooth event Discoverable timeout requested*/
530 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
531 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
532 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
533 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
534 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
535 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
536 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
537 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
538 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
539 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
540 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
541 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
542 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
543 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
544 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
545 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
546 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
547 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
548 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
549 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
550 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
552 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
553 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
554 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
555 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
556 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
558 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
559 /**< Bluetooth event serice search base id */
560 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
561 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
562 /**< RFCOMM data receive event */
563 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
564 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
566 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
568 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
569 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
571 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
573 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
574 /**< Bluetooth Network event */
575 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
576 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
577 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
578 /**< Network disconnected evnet in server */
580 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
581 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
583 BLUETOOTH_EVENT_HDP_CONNECTED
584 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
585 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
586 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
588 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
589 /* OPC Connected event */
590 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
591 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
592 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
593 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
595 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
596 BLUETOOTH_EVENT_MAP_DISCONNECTED,
598 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
599 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
600 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
601 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
602 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
604 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
605 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
606 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
607 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
608 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
609 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
610 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
611 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
612 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
613 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
614 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
615 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
616 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
618 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
619 /* Obex server authorize event*/
620 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
621 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
622 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
623 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
624 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
625 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
627 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
628 /**<Discovered GATT service characteristics event*/
629 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
630 /**<Remote GATT charateristic value changed event*/
631 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
632 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
633 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
634 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
635 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
636 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
637 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
638 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
639 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
640 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
641 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
642 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
643 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
644 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
645 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
647 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
648 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
649 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
650 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
651 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
652 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
653 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
654 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
655 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
656 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
657 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
658 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
659 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
660 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
661 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
662 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
663 BLUETOOTH_EVENT_HF_CONNECTED,
664 BLUETOOTH_EVENT_HF_DISCONNECTED,
665 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
666 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
667 BLUETOOTH_EVENT_HF_RING_INDICATOR,
668 BLUETOOTH_EVENT_HF_CALL_WAITING,
669 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
670 BLUETOOTH_EVENT_HF_CALL_STARTED,
671 BLUETOOTH_EVENT_HF_CALL_ENDED,
672 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
673 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
674 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
675 BLUETOOTH_EVENT_HF_CALL_STATUS,
676 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
677 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
678 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
679 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
680 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
681 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
682 BLUETOOTH_EVENT_HF_CALL_IDLE,
683 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
684 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
685 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
687 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
688 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
689 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
690 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
691 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
693 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
694 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
695 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
696 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
697 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
698 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
699 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
700 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
702 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
703 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
704 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
705 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
706 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
707 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
708 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
710 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
711 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
712 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
713 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
714 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
715 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
716 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
717 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
718 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
720 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
721 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
722 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
723 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
724 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
725 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
726 } bluetooth_event_type_t;
729 * This bt_service_uuid_list_t enum indicates service uuid list .
730 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
734 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
735 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
736 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
737 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
738 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
739 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
740 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
741 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
742 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
743 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
744 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
745 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
746 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
748 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
749 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
750 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
751 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
752 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
753 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
754 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
755 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
756 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
757 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
758 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
759 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
760 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
761 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
763 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
764 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
765 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
766 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
767 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
768 /**<DIRECT PRINTING*/
769 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
770 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
771 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
772 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
773 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
774 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
775 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
776 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
777 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
778 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
779 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
780 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
781 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
782 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
783 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
784 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
785 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
786 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
787 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
788 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
789 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
790 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
791 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
792 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
793 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
794 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
795 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
796 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
797 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
798 } bluetooth_service_uuid_list_t;
801 * Service class part of class of device returned from device discovery
804 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
805 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
806 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
807 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
808 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
809 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
810 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
811 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
812 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
813 } bluetooth_device_service_class_t;
817 * Major device mask (For device discovery)
820 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
821 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
822 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
823 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
824 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
825 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
826 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
827 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
828 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
829 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
830 } bluetooth_device_major_mask_t;
834 * Major device class (part of Class of Device)
837 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
838 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
839 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
840 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
841 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
842 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
843 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
844 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
845 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
846 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
847 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
848 } bluetooth_device_major_class_t;
851 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
853 /* About Computer Major class */
854 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
856 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
857 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
858 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
859 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
860 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
862 /* About Phone Major class */
863 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
864 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
865 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
866 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
867 /**< voice gateway minor class */
868 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
870 /* About LAN/Network Access Point Major class */
871 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
872 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
873 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
874 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
875 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
876 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
877 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
878 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
880 /* About Audio/Video Major class */
881 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
882 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
884 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
885 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
886 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
887 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
888 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
889 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
890 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
891 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
892 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
893 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
894 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
895 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
896 /**< Video Display and Loud
897 Speaker minor class */
898 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
901 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
903 /* About Peripheral Major class */
904 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
905 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
906 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
907 /**< Combo Keyboard or pointing
910 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
911 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
912 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
913 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
914 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
915 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
916 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
917 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
918 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
920 /* About Imaging Major class */
921 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
922 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
923 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
924 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
926 /* About Wearable Major class */
927 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
928 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
929 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
930 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
931 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
933 /* About Toy Major class */
934 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
935 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
936 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
937 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
938 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
940 /* About Health Major class */
941 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
942 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
943 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
944 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
945 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
946 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
947 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
948 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
949 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
950 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
951 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
952 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
953 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
954 } bluetooth_device_minor_class_t;
957 * structure to hold the device information
960 bluetooth_device_major_class_t major_class; /**< major device class */
961 bluetooth_device_minor_class_t minor_class; /**< minor device class */
962 bluetooth_device_service_class_t service_class;
963 /**< service device class */
964 } bluetooth_device_class_t;
967 * Discovery Role types
970 DISCOVERY_ROLE_BREDR = 0x1,
972 DISCOVERY_ROLE_LE_BREDR
973 } bt_discovery_role_type_t;
976 * Connected state types
979 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
980 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
981 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
982 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
983 } bluetooth_connected_link_t;
989 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
990 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
991 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
992 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
993 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
994 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
995 } bluetooth_le_scan_filter_feature_t;
1001 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1002 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1003 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1004 } bluetooth_le_connection_mode_t;
1007 * structure to hold the device information
1010 bluetooth_device_address_t device_address; /**< device address */
1011 bluetooth_device_name_t device_name; /**< device name */
1012 bluetooth_device_class_t device_class; /**< device class */
1013 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1014 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1016 int rssi; /**< received strength signal*/
1017 gboolean paired; /**< paired flag */
1018 bluetooth_connected_link_t connected; /**< connected link type */
1019 gboolean trust; /**< trust flag */
1020 gboolean is_alias_set; /** is device alias set flag**/
1021 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1022 } bluetooth_device_info_t;
1025 * structure to hold the LE device information
1028 int data_len; /**< manafacturer specific data length */
1029 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1030 } bluetooth_le_advertising_data_t;
1033 bluetooth_device_address_t device_address; /**< device address */
1034 int addr_type; /**< address type*/
1035 int rssi; /**< received strength signal*/
1036 bluetooth_le_advertising_data_t adv_ind_data;
1037 bluetooth_le_advertising_data_t scan_resp_data;
1038 } bluetooth_le_device_info_t;
1042 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1043 bluetooth_device_address_t device_address; /**< device address */
1044 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1045 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1046 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1047 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1048 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1049 bluetooth_le_advertising_data_t service_data; /**< service data */
1050 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1051 int manufacturer_id; /**< manufacturer ID */
1052 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1053 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1054 } bluetooth_le_scan_filter_t;
1057 bluetooth_device_address_t device_address; /**< device address */
1058 unsigned int mtu; /** < MTU set for the ATT connection */
1059 unsigned int status; /** < status of the MTU exchange */
1060 } bluetooth_le_att_mtu_info_t;
1063 * structure to hold the paired device information
1066 bluetooth_device_address_t device_address; /**< paired device address */
1067 bluetooth_device_name_t device_name; /**< device name */
1068 bluetooth_device_class_t device_class; /**< device class */
1069 } bluetooth_paired_device_info_t;
1072 * structure to hold the paired device information
1075 bluetooth_device_address_t device_address;
1076 /**< device address */
1077 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1078 /**< network interface name */
1079 } bluetooth_network_device_info_t;
1082 * Authentication event types
1086 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1087 BLUETOOTH_AUTH_PIN_REQUEST,
1088 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1089 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1090 } bluetooth_auth_type_t;
1093 * structure to hold the pincode/pass-key req informations
1096 bluetooth_device_address_t device_address; /**< remote device address */
1097 bluetooth_device_name_t device_name; /**< device name */
1098 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1099 } bluetooth_authentication_request_info_t;
1102 * Stucture to hold discovery option
1105 unsigned short max_response; /**< the number of maximum response */
1106 unsigned short discovery_duration;
1107 /**< duration of discovery (seconds) */
1108 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1109 classOfDevice variable */
1110 } bluetooth_discovery_option_t;
1113 * Stucture to hold event information
1116 int event; /**< event type */
1117 int result; /**< Success or error value */
1119 /**<parameter data pointer */
1121 } bluetooth_event_param_t;
1124 bluetooth_device_address_t device_addr;
1125 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1126 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1127 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1132 bluetooth_device_address_t device_addr;
1133 unsigned char addr_type;
1135 } bt_connection_info_t;
1138 * Stucture to rfcomm receive data
1143 /**< the socket fd */
1144 int buffer_size;/**< the length of the receive buffer */
1146 /**< the receive data buffer */
1147 } bluetooth_rfcomm_received_data_t;
1153 HTYPE_TRANS_HANDSHAKE,
1154 HTYPE_TRANS_HID_CONTROL,
1155 HTYPE_TRANS_GET_REPORT,
1156 HTYPE_TRANS_SET_REPORT,
1157 HTYPE_TRANS_GET_PROTOCOL,
1158 HTYPE_TRANS_SET_PROTOCOL,
1161 } bt_hid_header_type_t;
1167 PTYPE_DATA_RTYPE_INPUT,
1168 PTYPE_DATA_RTYPE_OUTPUT
1169 } bt_hid_param_type_t;
1172 * Stucture to hid receive data
1175 const char *address;
1176 bt_hid_header_type_t type;
1177 /**< Header type containing */
1178 bt_hid_param_type_t param;
1179 /**< Param type in header like INPUT Report or OutPut Report */
1180 int buffer_size;/**< the length of the receive buffer */
1182 /**< the receive data buffer */
1183 } bluetooth_hid_received_data_t;
1186 * Stucture to rfcomm connection
1190 int socket_fd; /**< the socket fd */
1191 int server_id; /* Server id */
1192 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1193 bluetooth_device_address_t device_addr;
1194 /**< device address */
1195 char uuid[BLUETOOTH_UUID_STRING_MAX];
1196 } bluetooth_rfcomm_connection_t;
1199 * Stucture to rfcomm disconnection
1203 /**< the socket fd */
1204 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1205 bluetooth_device_address_t device_addr;
1206 /**< device address */
1207 char uuid[BLUETOOTH_UUID_STRING_MAX];
1208 } bluetooth_rfcomm_disconnection_t;
1212 /**< the socket fd */
1213 bluetooth_device_address_t device_addr;
1214 /**< device address */
1215 } bluetooth_rfcomm_connection_request_t;
1219 /**< the socket fd */
1220 bluetooth_device_address_t device_addr;
1221 /**< device address */
1222 } bluetooth_hid_request_t;
1231 } bt_hdp_qos_type_t;
1237 HDP_ROLE_SOURCE = 0x0,
1239 } bt_hdp_role_type_t;
1243 * Stucture to HDP connected
1246 const char *app_handle; /**< the application handle */
1247 unsigned int channel_id; /**< the channel id */
1248 bt_hdp_qos_type_t type; /**< the QOS type */
1249 bluetooth_device_address_t device_address; /**< the remote address */
1250 } bt_hdp_connected_t;
1253 * Stucture to HDP disconnected
1256 unsigned int channel_id; /**< the channel id */
1257 bluetooth_device_address_t device_address; /**< the remote address */
1258 } bt_hdp_disconnected_t;
1261 * Stucture to HDP data indication
1264 unsigned int channel_id; /**< the channel id */
1265 const char *buffer; /**< the RX data buffer */
1266 unsigned int size; /**< the RX data size */
1267 } bt_hdp_data_ind_t;
1270 * Stucture to OPP client transfer information
1277 } bt_opc_transfer_info_t;
1279 /* TODO: MAP client structures, see above */
1281 * Stucture to Map filter fields
1286 } bt_map_list_filter_fields_info_t;
1288 /* Obex Server transfer type */
1289 #define TRANSFER_PUT "PUT"
1290 #define TRANSFER_GET "GET"
1292 * Stucture to OPP/FTP Server authorize information
1299 } bt_obex_server_authorize_into_t;
1307 } bt_obex_server_type_t;
1310 * Stucture to OPP/FTP server transfer information
1318 unsigned long file_size;
1320 bt_obex_server_type_t server_type;
1322 unsigned char *contact_auth_info;
1323 } bt_obex_server_transfer_info_t;
1326 * Stucture to OPP/FTP server connection/disconnection information
1332 } bt_obex_server_connection_info_t;
1336 * Stucture to OOB data
1340 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1341 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1342 unsigned int hash_len;
1343 unsigned int randomizer_len;
1345 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1346 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1347 unsigned int hash256_len;
1348 unsigned int randomizer256_len;
1352 * Structure to GATT attribute handle data
1358 } bt_gatt_handle_info_t;
1361 * Structure to GATT Remote service data
1368 bt_gatt_handle_info_t include_handles;
1369 bt_gatt_handle_info_t char_handle;
1370 } bt_gatt_service_property_t;
1373 * Structure to GATT Remote characteristic data
1377 char *service_handle;
1378 bt_gatt_handle_info_t handle_info;
1379 } bt_gatt_discovered_char_t;
1382 * Structure to format of GATT Characteristic Value
1386 unsigned char format;
1387 unsigned char exponent;
1388 unsigned short unit;
1389 unsigned char name_space;
1390 unsigned short description;
1391 } bt_gatt_char_format_t;
1394 * Structure to GATT Characteristic property
1402 bt_gatt_char_format_t format;
1404 unsigned int val_len;
1405 unsigned int permission;
1406 char *representation;
1407 bt_gatt_handle_info_t char_desc_handle;
1408 } bt_gatt_char_property_t;
1411 * Structure to GATT Characteristic descriptor property
1418 unsigned int val_len;
1419 } bt_gatt_char_descriptor_property_t;
1422 * Structure to GATT Characteristic value
1429 } bt_gatt_char_value_t;
1432 * Structure to GATT Read Request
1436 char *service_handle;
1440 } bt_gatt_read_req_t;
1443 * Structure to GATT Value change
1447 char *service_handle;
1450 gboolean response_needed;
1454 } bt_gatt_value_change_t;
1457 bluetooth_device_address_t device_addr;
1459 bluetooth_gatt_service_change_type_t change_type;
1460 } bt_gatt_service_change_t;
1463 * Structure to GATT characteristc Notification change
1467 char *service_handle;
1468 gboolean att_notify;
1469 } bt_gatt_char_notify_change_t;
1472 * Structure to Indication confirmation
1476 char *service_handle;
1479 } bt_gatt_indicate_confirm_t;
1482 * Structure to RSSI Signal Strength Alert
1493 * Structure to RSSI Signal Strength
1503 * Structure for RSSI Enabled or Disabled
1509 gboolean rssi_enabled;
1510 } bt_rssi_enabled_t;
1513 * Structure for RSSI Threshold
1518 int in_range_threshold;
1520 } bt_rssi_threshold_t;
1524 * Structure for Suppoted Profiles and Trusted Profiles
1531 } bt_supported_profile_trusted_t;
1534 * Structure for PBAP Folder Parameters
1537 unsigned char addressbook;
1538 unsigned char folder_type;
1542 * Structure for PBAP Pull application Parameters
1545 unsigned char format;
1546 unsigned char order;
1547 unsigned short offset;
1548 unsigned short maxlist;
1549 long long unsigned fields;
1550 } bt_pbap_pull_parameters_t;
1553 * Structure for PBAP List application Parameters
1556 unsigned char order;
1557 unsigned short offset;
1558 unsigned short maxlist;
1559 } bt_pbap_list_parameters_t;
1562 * Structure for PBAP Pull vCard application Parameters
1565 unsigned char format;
1566 long long unsigned fields;
1568 } bt_pbap_pull_vcard_parameters_t;
1571 * Structure for PBAP Search application Parameters
1574 unsigned char order;
1575 unsigned short offset;
1576 unsigned short maxlist;
1577 unsigned char search_attribute;
1578 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1579 } bt_pbap_search_parameters_t;
1582 * Structure for PBAP Connection Status
1585 bluetooth_device_address_t btaddr;
1587 } bt_pbap_connected_t;
1590 * Structure for PBAP Phonebook Size
1593 bluetooth_device_address_t btaddr;
1595 } bt_pbap_phonebook_size_t;
1598 * Structure for PBAP Phonebook Pull
1601 bluetooth_device_address_t btaddr;
1604 } bt_pbap_phonebook_pull_t;
1607 * Structure for PBAP vCard List
1610 bluetooth_device_address_t btaddr;
1614 } bt_pbap_vcard_list_t;
1617 * Structure for PBAP vCard Pull
1620 bluetooth_device_address_t btaddr;
1623 } bt_pbap_vcard_pull_t;
1626 * Structure for PBAP Phonebook search List
1629 bluetooth_device_address_t btaddr;
1633 } bt_pbap_phonebook_search_list_t;
1636 * Stucture to HF Call status information
1640 char *number; /*Phone Number */
1641 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1642 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1643 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1644 int idx; /*Call index/ID */
1645 } bt_hf_call_status_info_t;
1650 } bt_hf_call_list_s;
1656 TRUSTED_PROFILE_PBAP = 1,
1657 TRUSTED_PROFILE_MAP,
1658 TRUSTED_PROFILE_SAP,
1659 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1660 } bluetooth_trusted_profile_t;
1663 * Restricted Profile types
1666 RESTRICTED_PROFILE_HFP_HS = 1,
1667 RESTRICTED_PROFILE_A2DP,
1668 } bluetooth_restricted_profile_t;
1671 * Structure for LE data length change params
1674 bluetooth_device_address_t device_address;
1675 guint16 max_tx_octets;
1676 guint16 max_tx_time;
1677 guint16 max_rx_octets;
1678 guint16 max_rx_time;
1679 } bt_le_data_length_params_t;
1682 * Structure for proximity property change params
1685 bluetooth_device_address_t device_address;
1689 } bt_pxp_property_changed_params_t;
1692 * @brief DPM BT allowance state
1696 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1697 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1698 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1699 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1703 * @brief DPM API result
1707 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1708 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1709 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1710 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1711 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1712 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1716 * @brief DPM Policy status
1720 BLUETOOTH_DPM_STATUS_ERROR = -1,
1722 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1723 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1725 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1726 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1728 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1729 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1733 /* policy-group : BLUETOOTH */
1734 BLUETOOTH_DPM_POLICY_ALLOW,
1735 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1736 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1737 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1738 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1739 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1740 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1741 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1742 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1743 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1744 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1745 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1746 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1747 BLUETOOTH_DPM_POLICY_END,
1748 } bt_dpm_policy_cmd_t;
1751 struct bt_dpm_policy {
1757 typedef struct bt_dpm_policy bt_dpm_policy_t;
1760 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1761 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1762 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1763 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1764 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1765 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1766 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1767 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1768 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1769 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1770 BLUETOOTH_DPM_PROFILE_NONE,
1773 struct bt_dpm_profile_val {
1774 int value; /* tells whether the profile is enabled or disabled */
1776 typedef struct dpm_profile_val dpm_profile_state_t;
1779 * Structure to DPM device list
1783 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1784 } bt_dpm_device_list_t;
1787 * Structure to DPM uuid list
1791 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1792 } bt_dpm_uuids_list_t;
1795 * Structure for IPSP Interface Info
1798 bluetooth_device_address_t btaddr;
1800 } bt_ipsp_connection_info_t;
1804 char* remote_address;
1805 } bt_map_client_session_info_s;
1807 typedef char* bt_map_client_message_object_t;
1812 } bt_map_client_list_folders_filter_t;
1817 int8_t subject_length;
1826 } bt_map_client_list_messages_filter_t;
1829 bt_map_client_message_object_t message_object;
1834 char *sender_address;
1837 char *recipient_address;
1842 int64_t attachment_size;
1847 } bt_map_client_message_item_t;
1853 } bt_map_client_push_message_args_t;
1860 char *sender_address;
1863 char *recipient_address;
1872 } bt_map_client_message_t;
1875 char **names; // holding %size null-terminated folder names
1877 } bt_map_client_folders_s;
1880 bt_map_client_message_item_t *message_items;
1882 } bt_map_client_message_items_s;
1885 const char* target_file;
1887 } bt_get_message_callback_data;
1891 * Callback pointer type
1893 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1896 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1897 * @brief Set the callback function pointer for bluetooth event
1900 * This API will register the callback function, when any response and event are received from
1901 * bluetooth framework. @n
1902 * this registered callback function will be get called with appropriate event and data structures.
1903 * This function is a synchronous call. An application developer can call
1904 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1905 * type. This registered function will receive events of bluetooth_event_type_t type along with
1909 * @param[in] callback_ptr A pointer to the callback function
1910 * @param[in] user_data A pointer to user data
1911 * @return BLUETOOTH_ERROR_NONE - Success
1915 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1917 GMainLoop *main_loop = (GMainLoop*) user_data;
1921 // Code for each event
1923 g_main_loop_quit(main_loop);
1930 GMainLoop *main_loop = NULL;
1933 main_loop = g_main_loop_new(NULL, FALSE);
1934 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1935 if (ret >= BLUETOOTH_ERROR_NONE)
1937 // bluetooth_register_callback returned Success
1941 // bluetooth_register_callback returned failiure
1943 g_main_loop_run(main_loop);
1947 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1950 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1951 * @brief Set the callback function pointer for bluetooth le event
1954 * This API will register the callback function, when any response and event are received from
1955 * bluetooth framework. @n
1956 * this registered callback function will be get called with appropriate event and data structures.
1957 * This function is a synchronous call. An application developer can call
1958 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1959 * type. This registered function will receive events of bluetooth_event_type_t type along with
1963 * @param[in] callback_ptr A pointer to the callback function
1964 * @param[in] user_data A pointer to user data
1965 * @return BLUETOOTH_ERROR_NONE - Success
1969 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1972 * @fn int bluetooth_le_unregister_callback(void)
1973 * @brief Set the callback function pointer for bluetooth le event
1976 * This API will register the callback function, when any response and event are received from
1977 * bluetooth framework. @n
1978 * this registered callback function will be get called with appropriate event and data structures.
1979 * This function is a synchronous call. An application developer can call
1980 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1981 * type. This registered function will receive events of bluetooth_event_type_t type along with
1986 * @return BLUETOOTH_ERROR_NONE - Success
1990 int bluetooth_le_unregister_callback(void);
1993 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1994 * @brief Set the callback function pointer for bluetooth event
1997 * This API will register the callback function, when any response and event are received from
1998 * bluetooth framework. @n
1999 * this registered callback function will be get called with appropriate event and data structures.
2000 * This function is a synchronous call. An application developer can call
2001 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2002 * type. This registered function will receive events of bluetooth_event_type_t type along with
2007 * @return BLUETOOTH_ERROR_NONE - Success
2011 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2013 GMainLoop *main_loop = (GMainLoop*) user_data;
2017 // Code for each event
2019 g_main_loop_quit(main_loop);
2026 GMainLoop *main_loop = NULL;
2029 main_loop = g_main_loop_new(NULL, FALSE);
2030 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2031 if (ret >= BLUETOOTH_ERROR_NONE)
2033 // bluetooth_register_callback returned Success
2037 // bluetooth_register_callback returned failiure
2039 ret = bluetooth_deregister_callback(void);
2040 g_main_loop_run(main_loop);
2044 int bluetooth_unregister_callback(void);
2047 * @fn int bluetooth_enable_adapter(void)
2048 * @brief Enable the Bluetooth H/W
2051 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2052 * send request to bluetooth chip for activation.
2053 * This function is typically called at startup or when Bluetooth services are required. This
2054 * function must be called before calling any other API of Bluetooth operations.
2056 * Before performing any operations like Device discover, service search etc.., the adapter must be
2059 * This function is a asynchronous call.
2060 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2061 * through registered callback function with appropriate result code
2062 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2063 * BLUETOOTH_ERROR_NONE - Success \n
2065 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2066 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2068 * @return BLUETOOTH_ERROR_NONE - Success\n
2069 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2070 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2071 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2072 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2074 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2076 void bt_event_callback(int event, bluetooth_event_param_t *param)
2080 case BLUETOOTH_EVENT_ENABLED:
2081 if (param->result == BLUETOOTH_ERROR_NONE)
2083 // Successfully Enabled
2096 ret = bluetooth_enable_adapter();
2100 int bluetooth_enable_adapter(void);
2103 * @fn int bluetooth_disable_adapter(void)
2104 * @brief Disable the Bluetooth H/W
2107 * This function disables Bluetooth protocol stack and hardware. This function is called when
2108 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2110 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2111 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2112 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2114 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2117 * This function is a asynchronous call.
2118 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2119 * through registered callback function.
2122 * @return BLUETOOTH_ERROR_NONE - Success\n
2123 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2124 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2125 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2127 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2129 void bt_event_callback(int event, bluetooth_event_param_t *param)
2133 case BLUETOOTH_EVENT_DISABLED:
2134 if (param->result == BLUETOOTH_ERROR_NONE)
2136 // Successfully disabled
2149 ret = bluetooth_disable_adapter();
2152 int bluetooth_disable_adapter(void);
2153 int bluetooth_recover_adapter(void);
2154 int bluetooth_check_adapter_le(void);
2155 int bluetooth_enable_adapter_le(void);
2157 int bluetooth_disable_adapter_le(void);
2160 * @fn int bluetooth_reset_adapter(void)
2161 * @brief Reset the Bluetooth H/W and values
2164 * This function resets Bluetooth protocol stack and hardware. This function is called when
2165 * an user want to initialize Bluetooth environment.
2167 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2170 * This function is a synchronous call.
2172 * @return BLUETOOTH_ERROR_NONE - Success\n
2173 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2175 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2180 ret = bluetooth_reset_adapter();
2183 int bluetooth_reset_adapter(void);
2186 * @fn int bluetooth_is_supported(void)
2187 * @brief Check if the bluetooth is supported or not by the current target
2189 * This API checks whether the bluetooth is supported or not.
2190 * This API only run by root permission.
2192 * This function is a synchronous call.
2194 * @return 0 - if bluetooth is not supported\n
2195 * 1 - if bluetooth is supported\n
2196 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2201 ret = bluetooth_is_supported();
2204 int bluetooth_is_supported(void);
2208 * @fn int bluetooth_check_adapter(void)
2209 * @brief Check the current status of the Bluetooth adapter
2212 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2213 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2214 * bluetooth adapter.
2215 * This API get the adapter internal data structure and check current adapter status.
2217 * This function is a synchronous call.
2220 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2221 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2223 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2227 ret = bluetooth_check_adapter();
2230 int bluetooth_check_adapter(void);
2233 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2234 * @brief Get the local adapter bluetooth address
2237 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2238 * the adapter should be enabled.
2239 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2240 * contain Bluetooth address.
2241 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2242 * friendly name for each device.
2243 * There is no event callback for this API.
2245 * This function is a synchronous call.
2248 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2249 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2250 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2251 * @param[out] local_address a device address of local bluetooth adapter
2256 bluetooth_device_address_t local_address={0,};
2259 ret = bluetooth_get_local_address(&local_address);
2262 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2265 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2266 * @brief Get the hci version
2269 * This function is used to get the bluetooth hci version
2270 * Before calling this API make sure that the adapter is enabled.
2272 * This function is a synchronous call.
2275 * @return BLUETOOTH_ERROR_NONE - Success \n
2276 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2277 * @param[out] timeout remain visibility timeout value
2280 bluetooth_version_t *version;
2282 ret = bluetooth_get_local_version (&version);
2285 int bluetooth_get_local_version(bluetooth_version_t *version);
2288 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2289 * @brief Get the local device name
2292 * This function is used, get the local device name. Since its difficult to remember the Adapter
2293 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2294 * friendly name is retrived by the remote device and displaying.
2295 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2297 * This function is a synchronous call.
2300 * @return BLUETOOTH_ERROR_NONE - Success \n
2301 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2302 * @param[out] local_name a local device name
2306 bluetooth_device_name_t local_name={0,}
2308 ret = bluetooth_get_local_name (&local_name);
2311 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2314 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2315 * @brief Set the local device name
2318 * This function is used to set the local device name. This is a human friendly name whose
2319 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2321 * This function is a synchronous call.
2323 * @param[in] local_name bluetooth device name to set local device
2325 * @return BLUETOOTH_ERROR_NONE - Success \n
2326 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2327 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2328 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2329 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2330 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2335 bluetooth_device_name_t local_name={0,}
2337 ret = bluetooth_set_local_name (&local_name);
2340 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2344 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2345 * @brief Check if the uuid is used or not
2347 * This function is used to check if the uuid is used or not.
2349 * This function is a synchronous call.
2351 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2352 * @param[out] used if the uuid is used or not
2354 * @return BLUETOOTH_ERROR_NONE - Success \n
2355 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2356 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2357 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2362 gboolean used = FALSE;
2363 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2364 ret = bluetooth_is_service_used(uuid, &used);
2367 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2370 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2371 * @brief Check if the device is connected to the specific service
2373 * This function is used to check if if the device is connected to the specific service.
2375 * This function is a synchronous call.
2377 * @param[in] local_address a device address of remote bluetooth device
2378 * @param[in] type the service type
2379 * @param[out] is_connected if the device is connected or not
2381 * @return BLUETOOTH_ERROR_NONE - Success \n
2382 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2383 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2384 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2389 gboolean is_connected = FALSE;
2390 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2391 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2394 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2395 bluetooth_service_type_t type,
2396 gboolean *is_connected);
2399 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2400 * @brief Gets device's connected link type
2402 * This function is used to get device's connected link type
2404 * This function is a synchronous call.
2406 * @param[in] device_address a device address of remote bluetooth device
2407 * @param[out] connected_link a device's connected link type
2409 * @return BLUETOOTH_ERROR_NONE - Success \n
2410 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2411 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2412 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2417 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2418 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2419 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2422 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2423 bluetooth_connected_link_t *connected_link);
2426 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2427 * @brief Sets a profile trusted for a device
2429 * This function is used to Set a profile as trusted for a device
2431 * This function is a synchronous call.
2433 * @param[in] device_address a device address of remote bluetooth device
2434 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2435 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2437 * @return BLUETOOTH_ERROR_NONE - Success \n
2438 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2439 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2440 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2444 int bluetooth_set_profile_trusted(
2445 const bluetooth_device_address_t *device_address,
2446 int profile, int trust);
2449 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2450 * @brief Gets a profile is trusted for a device
2452 * This function is used to Get a profile is trusted or not for a device
2454 * This function is a synchronous call.
2456 * @param[in] device_address a device address of remote bluetooth device
2457 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2458 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2460 * @return BLUETOOTH_ERROR_NONE - Success \n
2461 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2462 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2463 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2467 int bluetooth_get_profile_trusted(
2468 const bluetooth_device_address_t *device_address,
2469 int profile, int *trust);
2472 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2473 * @brief Sets a profile restricted connection for a device
2475 * This function is used to Set a profile as restricted for a device
2477 * This function is a synchronous call.
2479 * @param[in] device_address a device address of remote bluetooth device
2480 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2481 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2483 * @return BLUETOOTH_ERROR_NONE - Success \n
2484 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2485 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2486 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2490 int bluetooth_set_profile_restricted(
2491 const bluetooth_device_address_t *device_address,
2492 int profile, int restricted);
2495 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2496 * @brief Gets a restricted connection state
2498 * This function is used to Get a profile is restricted or not for a device
2500 * This function is a synchronous call.
2502 * @param[in] device_address a device address of remote bluetooth device
2503 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2504 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2506 * @return BLUETOOTH_ERROR_NONE - Success \n
2507 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2508 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2509 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2513 int bluetooth_get_profile_restricted(
2514 const bluetooth_device_address_t *device_address,
2515 int profile, int *restricted);
2518 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2519 * @brief Get the visibility mode
2522 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2523 * visibity mode, the property of the device is determined whether it can be discoverable, non
2524 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2526 * This function is a synchronous call.
2529 * @return BLUETOOTH_ERROR_NONE - Success \n
2530 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2531 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2532 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2533 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2534 * @param[out] discoverable_mode current bluetooth discoverable mode
2536 * @see bluetooth_set_discoverable_mode
2538 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2540 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2543 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2546 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2548 * @brief Set the visibility mode
2551 * This function is used to set the discoverable mode (Visibility option).
2553 * Many times user may want to keep his device discoverable so that when peer device is performing
2554 * device search, he/she can find user's device. Application programmer can keep the mode as
2555 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2556 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2557 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2558 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2560 * This function is a synchronous call.
2562 * @return BLUETOOTH_ERROR_NONE - Success \n
2563 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2565 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2566 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2568 * @see bluetooth_get_discoverable_mode
2572 bluetooth_discoverable_mode_t mode;
2574 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2575 ret = bluetooth_set_discoverable_mode (mode, 180);
2579 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2584 * @fn int bluetooth_get_timeout_value(int *timeout)
2585 * @brief Get the visibility timeout value
2588 * This function is used to get the visibility timeout
2589 * Before calling this API make sure that the adapter is enabled.
2591 * This function is a synchronous call.
2594 * @return BLUETOOTH_ERROR_NONE - Success \n
2595 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2596 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2597 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2598 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2599 * @param[out] timeout remain visibility timeout value
2601 * @see bluetooth_set_discoverable_mode
2605 ret = bluetooth_get_timeout_value (&timeout);
2608 int bluetooth_get_timeout_value(int *timeout);
2612 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2613 * unsigned int classOfDeviceMask)
2614 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2616 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2617 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2618 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2619 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2620 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2621 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2622 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2623 * please see bluetooth_device_info_t for more details.
2626 * This API provides searching options like max responses, discovery duration in seconds and class
2627 * of device mask to filter device search. some times there may be too many bluetooth devices in
2628 * vicinity of your device.in such scenario, application can request to reduce number of responces
2629 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2630 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2631 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2632 * application defined time. please note that discovery_duration should be mentioned in seconds.
2633 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2636 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2637 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2638 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2640 * This function is a asynchronous call.
2641 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2642 * through registered callback function.
2644 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2645 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2647 * The completion or cancellation of the discovery is indicated by an
2648 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2650 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2653 * @return BLUETOOTH_ERROR_NONE - Success \n
2654 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2655 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2656 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2657 agent is not running \n
2659 * @param[in] max_response define the maximum response of the number of founded devices
2661 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2662 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2663 (refer to class of device)
2665 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2668 void bt_event_callback(int event, bluetooth_event_param_t *param)
2672 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2674 bluetooth_device_info_t *device_info = NULL;
2675 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2677 device_info = (bluetooth_device_info_t *)param->param_data;
2678 memcpy(&searched_device, &device_info->device_address,
2679 sizeof(bluetooth_device_address_t));
2680 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2681 device_info->device_address.addr[0],
2682 device_info->device_address.addr[1],
2683 device_info->device_address.addr[2],
2684 device_info->device_address.addr[3],
2685 device_info->device_address.addr[4],
2686 device_info->device_address.addr[5]);
2689 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2691 bluetooth_device_info_t *device_info = NULL;
2692 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2694 device_info = (bluetooth_device_info_t *)param->param_data;
2695 memcpy(&searched_device, &device_info->device_address,
2696 sizeof(bluetooth_device_address_t));
2697 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2698 device_info->device_name.name,
2699 device_info->device_address.addr[0],
2700 device_info->device_address.addr[1],
2701 device_info->device_address.addr[2],
2702 device_info->device_address.addr[3],
2703 device_info->device_address.addr[4],
2704 device_info->device_address.addr[5]);
2708 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2709 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2714 unsigned short max_response;
2715 unsigned short discovery_duration;
2716 unsigned classOfDeviceMask;
2720 discovery_duration =0;
2721 classOfDeviceMask =0;
2723 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2728 int bluetooth_start_discovery(unsigned short max_response,
2729 unsigned short discovery_duration,
2730 unsigned int classOfDeviceMask);
2733 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2734 * unsigned short max_response,
2735 * unsigned short discovery_duration,
2736 * unsigned int classOfDeviceMask)
2737 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2739 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2740 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2741 * Please see bluetooth_start_discovery() for other parameters description.
2743 * This function is a asynchronous call.
2744 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2745 * through registered callback function.
2747 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2748 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2750 * The completion or cancellation of the discovery is indicated by an
2751 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2753 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2756 * @return BLUETOOTH_ERROR_NONE - Success \n
2757 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2758 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2759 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2760 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2761 agent is not running \n
2763 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2764 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2765 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2766 * @param[in] max_response define the maximum response of the number of founded devices
2768 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2769 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2770 (refer to class of device)
2772 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2775 unsigned short type;
2776 unsigned short max_response;
2777 unsigned short discovery_duration;
2778 unsigned classOfDeviceMask;
2783 discovery_duration =0;
2784 classOfDeviceMask =0;
2786 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2791 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2792 unsigned short max_response,
2793 unsigned short discovery_duration,
2794 unsigned int classOfDeviceMask);
2797 * @fn int bluetooth_cancel_discovery (void)
2798 * @brief Cancel the on-going device discovery operation
2801 * This function stops the on-going device discovery operation. This API has to be called after the
2802 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2803 * the bluetooth_start_discovery API
2805 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2806 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2807 * cancel the discover request once the user received the device to which he wish to connect.
2809 * This function is a asynchronous call.
2810 * If the call is success to cancel discovey then the application will receive
2811 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2812 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2813 * BLUETOOTH_ERROR_NONE
2816 * @return BLUETOOTH_ERROR_NONE - Success \n
2817 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2818 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2819 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2820 other application \n
2821 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2823 * @see bluetooth_start_discovery
2825 void bt_event_callback(int event, bluetooth_event_param_t *param)
2829 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2830 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2839 ret = bluetooth_cancel_discovery();
2842 int bluetooth_cancel_discovery(void);
2845 * @fn int bluetooth_start_le_discovery(void)
2846 * @brief Start the generic device discovery which finds the LE devices.
2848 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2849 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2850 * It try to find LE devices. Bluetooth device address and name are
2851 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2852 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2853 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2854 * please see bluetooth_device_info_t for more details.
2856 * This function is a asynchronous call.
2857 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2858 * through registered callback function.
2860 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2863 * The completion or cancellation of the discovery is indicated by an
2864 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2866 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2869 * @return BLUETOOTH_ERROR_NONE - Success \n
2870 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2871 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2872 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2873 agent is not running \n
2876 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2879 void bt_event_callback(int event, bluetooth_event_param_t *param)
2883 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2885 bluetooth_device_info_t *device_info = NULL;
2886 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2888 device_info = (bluetooth_device_info_t *)param->param_data;
2889 memcpy(&searched_device, &device_info->device_address,
2890 sizeof(bluetooth_device_address_t));
2891 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2892 device_info->device_address.addr[0],
2893 device_info->device_address.addr[1],
2894 device_info->device_address.addr[2],
2895 device_info->device_address.addr[3],
2896 device_info->device_address.addr[4],
2897 device_info->device_address.addr[5]);
2901 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2902 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2908 ret = bluetooth_start_discovery();
2913 int bluetooth_start_le_discovery(void);
2916 * @fn int bluetooth_stop_le_discovery (void)
2917 * @brief Cancel the on-going device LE discovery operation
2920 * This function stops the on-going device discovery operation. This API has to be called after the
2921 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2922 * the bluetooth_start_le_discovery API
2925 * This function is a asynchronous call.
2926 * If the call is success to cancel discovey then the application will receive
2927 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2928 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2929 * BLUETOOTH_ERROR_NONE
2932 * @return BLUETOOTH_ERROR_NONE - Success \n
2933 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2934 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2935 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2936 other application \n
2937 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2939 * @see bluetooth_start_discovery
2941 void bt_event_callback(int event, bluetooth_event_param_t *param)
2945 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2946 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2955 ret = bluetooth_stop_le_discovery();
2958 int bluetooth_stop_le_discovery(void);
2961 * @fn int bluetooth_is_discovering(void)
2962 * @brief Check for the device discovery is in-progress or not.
2964 * This API is used to check the current status of the Discovery operation.If discovery is in\
2965 * progress normally other operations are not allowed.
2966 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2967 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2968 * event before performing other operations. This API is used to get for the current discovery
2969 * operation status and using bluetooth_cancel_discovery()
2970 * we can cancell the ongoing discovery process.
2971 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2974 * This function checks whether the device discovery is started or not.
2976 * This function is a synchronous call.
2979 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2980 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2981 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2984 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2988 ret = bluetooth_is_discovering ();
2991 int bluetooth_is_discovering(void);
2994 * @fn int bluetooth_is_le_discovering(void)
2995 * @brief Check for the device LE discovery is in-progress or not.
2997 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2998 * progress normally other operations are not allowed.
2999 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3000 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3001 * event before performing other operations. This API is used to get for the current discovery
3002 * operation status and using bluetooth_stop_le_discovery()
3003 * we can cancell the ongoing LE discovery process.
3004 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3007 * This function checks whether the device LE discovery is started or not.
3009 * This function is a synchronous call.
3012 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3013 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3014 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3017 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3021 ret = bluetooth_is_le_discovering ();
3024 int bluetooth_is_le_discovering(void);
3027 * @fn int bluetooth_is_le_scanning(void)
3028 * @brief Check for the device LE scan is in-progress or not.
3030 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3031 * progress normally other operations are not allowed.
3033 * This function checks whether the device LE Scan is started or not.
3035 * This function is a synchronous call.
3037 * @return TRUE - LE Scan in progress \n
3038 * FALSE - LE Scan is not in progress \n
3043 gboolean is_le_scanning = 0;
3044 is_le_scanning = bluetooth_is_le_scanning ();
3047 gboolean bluetooth_is_le_scanning(void);
3049 gboolean bluetooth_is_scan_filter_supported(void);
3052 * @fn int bluetooth_force_hcidump(int timeout)
3053 * @brief Enable /disable force-hcidump
3055 * This function control force-hcidump.
3057 * This function is a synchronous call.
3059 * @return BLUETOOTH_ERROR_NONE - Success \n
3060 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3061 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3063 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3068 int bluetooth_force_hcidump(int timeout);
3071 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3072 * @brief Register scan filter.
3074 * This function registers the scan filter.
3076 * This function is a synchronous call.
3078 * @return BLUETOOTH_ERROR_NONE - Success \n
3080 * @param[in] filter scan filter to register
3081 * @param[out] slot_id the slot ID of scan filter
3085 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3088 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3089 * @brief Register scan filter.
3091 * This function unregisters the scan filter.
3093 * This function is a synchronous call.
3095 * @return BLUETOOTH_ERROR_NONE - Success \n
3097 * @param[in] slot_id the slot ID of scan filter
3101 int bluetooth_unregister_scan_filter(int slot_id);
3104 * @fn int bluetooth_unregister_all_scan_filters(void)
3105 * @brief Register scan filter.
3107 * This function usregisters all scan filters.
3109 * This function is a synchronous call.
3111 * @return BLUETOOTH_ERROR_NONE - Success \n
3115 int bluetooth_unregister_all_scan_filters(void);
3118 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3119 int link_type, bt_rssi_threshold_t rssi_threshold)
3120 * @brief Enable RSSI monitoring
3122 * This function enables RSSI monitoring and sets threshold for a connection
3124 * @return BLUETOOTH_ERROR_NONE - Success \n
3127 * @see bluetooth_get_rssi_strength
3129 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3130 int link_type, bt_rssi_threshold_t *rssi_threshold);
3133 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3134 * @brief Gets Raw RSSI signal Strength
3136 * This function gives the Raw RSSI signal strength for a connection.
3138 * @return BLUETOOTH_ERROR_NONE - Success \n
3141 * @see bluetooth_enable_rssi
3143 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3145 int bluetooth_set_connectable(gboolean is_connectable);
3147 int bluetooth_is_connectable(gboolean *is_connectable);
3150 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3151 * @brief Initiate a bonding process
3154 * This function initiates a bonding procedure with a peer device. The bonding procedure
3155 * enables authentication and optionally encryption on the Bluetooth link.
3157 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3158 * inititate the bonding request to the devices already in the paired list.
3160 * Usually we call this API after the device discovery.
3161 * This function is a asynchronous call.
3163 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3164 * mentioed result code
3165 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3166 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3167 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3168 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3169 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3171 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3172 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3175 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3178 * @return BLUETOOTH_ERROR_NONE - Success \n
3179 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3180 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3181 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3182 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3184 * @param[in] device_address This indicates an address of the device with which the pairing
3185 * should be initiated
3187 * @see bluetooth_cancel_bonding
3189 void bt_event_callback(int event, bluetooth_event_param_t *param)
3193 case BLUETOOTH_EVENT_BONDING_FINISHED:
3195 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3196 if (param->result >= BLUETOOTH_ERROR_NONE)
3198 bluetooth_device_info_t *device_info = NULL;
3199 device_info = (bluetooth_device_info_t *)param->param_data;
3200 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3201 mjr[%#x] min[%#x] srv[%#x]",
3202 device_info->device_name.name,
3203 device_info->device_address.addr[0],
3204 device_info->device_address.addr[1],
3205 device_info->device_address.addr[2],
3206 device_info->device_address.addr[3],
3207 device_info->device_address.addr[4],
3208 device_info->device_address.addr[5],
3209 device_info->device_class.major_class,
3210 device_info->device_class.minor_class,
3211 device_info->device_class.service_class);
3225 bluetooth_device_address_t device_address={{0}};
3227 ret = bluetooth_bond_device(&device_address);
3231 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3234 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3235 * bluetooth_conn_type_t conn_type)
3236 * @brief Initiate a bonding process
3239 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3240 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3242 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3243 * inititate the bonding request to the devices already in the paired list.
3245 * Usually we call this API after the device discovery.
3246 * This function is a asynchronous call.
3248 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3249 * mentioed result code
3250 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3251 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3252 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3253 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3254 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3256 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3257 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3260 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3263 * @return BLUETOOTH_ERROR_NONE - Success \n
3264 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3265 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3266 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3267 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3269 * @param[in] device_address This indicates an address of the device with which pairing
3270 * should be initiated
3271 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3274 * @see bluetooth_cancel_bonding
3276 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3277 bluetooth_conn_type_t conn_type);
3280 * @fn int bluetooth_cancel_bonding(void)
3281 * @brief Cancel the on-going bonding process
3283 * This API is called to cancel the on-going bonding procedure. It should be called before the
3284 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3285 * This API is useful when the remote device is not responding to the bond request or we wish to
3286 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3288 * This function is a synchronous call.
3290 * @return BLUETOOTH_ERROR_NONE - Success \n
3291 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3292 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3295 * @see bluetooth_bond_device
3301 ret = bluetooth_cancel_bonding();
3304 int bluetooth_cancel_bonding(void);
3307 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3308 * @brief Remove bonding
3311 * To communicate with remote device over bluetooth link, user should bond with peer device.
3312 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3313 * API is used to remove peer device from the list. Please note that after removing the device
3314 * from bonded device list, you cannot communication with peer device until bonding happens again.
3316 * User can call this function by passing bluetooth device address of any bonded device. Please note
3317 * that after successful return of this function, any bluetooth application running on your device
3318 * will not be able to communicate with unbonded device until bond operation happens again using
3319 * bluetooth_bond_device()
3322 * This function is a asynchronous call. The request to remove the specified device from the bonded
3323 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3324 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3325 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3329 * @return BLUETOOTH_ERROR_NONE - Success \n
3330 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3331 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3332 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3333 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3334 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3335 * agent is not running \n
3336 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3339 * @param[in] device_address This indicates an address of the device to remove bonding
3343 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3346 void bt_event_callback(int event, bluetooth_event_param_t *param)
3349 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3350 bluetooth_device_address_t *dev_addr = NULL;
3352 if (param->result == BLUETOOTH_ERROR_NONE) {
3353 dev_addr = (bluetooth_device_address_t *)param->param_data;
3355 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3356 dev_addr->addr[0], dev_addr->addr[1]
3357 dev_addr->addr[2], dev_addr->addr[3]
3358 dev_addr->addr[4], dev_addr->addr[5]
3369 bluetooth_device_address_t *device_address;
3371 // copy valid device address in device_address
3373 ret = bluetooth_unbond_device(device_address);
3376 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3379 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3380 * @brief Get bonded(paired) device list
3383 * This API gets all bonded device list.
3384 * The devices in the bonded device list further can be used to perform the authorization by calling
3385 * bluetooth_authorize_device API.
3387 * This function is a synchronous call.
3388 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3389 * there is no valid information in the dev_list.
3390 * The len field in the dev_list represents the number of bonded devices. The data structure for
3391 * bonded device information is bluetooth_device_info_t.
3394 * @return BLUETOOTH_ERROR_NONE - Success \n
3395 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3397 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3399 void bt_get_bonded_devices(void)
3403 GPtrArray *devinfo = NULL;
3404 bluetooth_device_info_t *ptr;
3406 // allocate the g_pointer_array
3407 devinfo = g_ptr_array_new();
3409 ret = bluetooth_get_bonded_device_list(&devinfo);
3410 if (ret != BLUETOOTH_ERROR_NONE)
3412 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3416 printf("g pointer arrary count : [%d]", devinfo->len);
3417 for (i=0; i<devinfo->len; i++)
3419 ptr = g_ptr_array_index(devinfo, i);
3422 printf("Name [%s]\n", ptr->device_name.name);
3423 printf("Major Class [%d]\n", ptr->device_class.major_class);
3424 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3425 printf("Service Class [%d]\n", ptr->device_class.service_class);
3426 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3427 ptr->device_address.addr[0],
3428 ptr->device_address.addr[1], ptr->device_address.addr[2],
3429 ptr->device_address.addr[3],
3430 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3437 // free g_pointer_array
3438 g_ptr_array_free(devinfo, TRUE);
3443 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3445 int bluetooth_get_profile_connected_device_list(
3446 const char *profile_uuid, GPtrArray **addr_list);
3449 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3450 * bluetooth_device_info_t *dev_info)
3451 * @brief Get a bonded(paired) device
3454 * This API gets a bonded device.
3456 * This function is a synchronous call.
3457 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3458 * there is no valid information in the dev_info.
3459 * The data structure for bonded device information is bluetooth_device_info_t.
3462 * @return BLUETOOTH_ERROR_NONE - Success \n
3463 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3465 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3467 void bt_get_bonded_device(void)
3471 bluetooth_device_info_t devinfo = {0};
3472 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3474 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3475 if (ret != BLUETOOTH_ERROR_NONE)
3477 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3481 printf("Name [%s]\n", devinfo.device_name.name);
3482 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3483 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3484 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3485 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3486 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3487 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3488 devinfo.device_address.addr[5]);
3497 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3498 bluetooth_device_info_t *dev_info);
3502 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3503 * gboolean *is_alias_set)
3504 * @brief Get is_alias_set property of device
3506 * This API gets is_alias_set property of a bonded device.
3508 * This function is a synchronous call.
3509 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3510 * If not,there is no valid information in the is_alias_set.
3512 * @return BLUETOOTH_ERROR_NONE - Success \n
3513 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3518 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3520 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3523 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3524 gboolean *is_alias_set);
3527 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3528 * @brief set alias for bonded device
3531 * This function set alias for bonded device.
3533 * This function is a synchronous call.
3536 * @return BLUETOOTH_ERROR_NONE - Success \n
3537 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3538 * @param[in] device_address This indicates an address of the remote device
3539 * @param[in] alias This indicates an alias to set
3544 ret = bluetooth_set_alias(&remote_address);
3547 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3551 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3552 * @brief Get remote deivice
3555 * This function gets specific remote device.
3557 * This function is a asynchronous call.
3558 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3561 * @return BLUETOOTH_ERROR_NONE - Success \n
3562 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3563 * @param[in] device_address This indicates an address of the remote device
3568 ret = bluetooth_get_remote_device(&remote_address);
3571 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3574 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3575 * gboolean authorized)
3576 * @brief Authorize/Unauthorize a bonded device
3579 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3580 * with/without user confirmation.
3582 * If we select a paired device and make it authorized by calling this API with the authorized
3583 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3584 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3585 * then it will ask for the user conformation before the connection.
3587 * This API supposed to be called on the paired devices. Which means we have to use this API only
3588 * after successful pairing.
3590 * This function is a asynchronous call.
3591 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3593 * @return BLUETOOTH_ERROR_NONE - Success \n
3594 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3595 * @param[in] device_address This indicates an address of the device to authorize \n
3596 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3598 * @see bluetooth_get_bonded_device_list
3600 void bt_event_callback(int event, bluetooth_event_param_t *param)
3604 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3606 if (param->result == BLUETOOTH_ERROR_NONE)
3610 //device authorization failed failure
3618 bluetooth_device_address_t device_address={{0}};
3619 gboolean authorized;
3623 ret = bluetooth_authorize_device(&device_address,authorized);
3626 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3627 gboolean authorized);
3629 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3630 const bluetooth_device_pin_code_t *pin_code);
3632 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3635 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3637 * @brief Receives Legacy Passkey\pin with following authentication response types
3639 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3640 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3643 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3646 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3648 * @brief This API sends user confirmation reply to the local adapter.
3650 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3653 int bluetooth_passkey_confirmation_reply(gboolean reply);
3656 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3657 * @brief Get all services supported by remote device
3660 * This API call initiates the search for the services supported by the specified device. Normally
3661 * the service search will take a couple of seconds to get it completed. Before calling this API
3662 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3663 * perform the service search. We can get the device address by doing a device discovery operation.
3666 * This function is a asynchronous call.
3667 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3669 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3670 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3671 * event is generated with appropriate result code.
3673 * @return BLUETOOTH_ERROR_NONE - Success \n
3674 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3675 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3676 * @param[in] device_address This indicates an address of the device
3677 * whose services need to be found
3679 * @see bluetooth_cancel_service_search
3681 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3684 * @fn int bluetooth_cancel_service_search(void)
3685 * @brief Cancel the ongoing service search operation
3688 * This function cancel the ongoing service search operation. This API is usually calling after the
3689 * bluetooth_search_service API.
3690 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3691 * if the user wish to cancel the Ongoing service search operation.
3693 * This API should be called just after the bluetooth_search_service API and before the
3694 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3696 * This function is a synchronous call.
3698 * @return BLUETOOTH_ERROR_NONE - Success \n
3699 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3700 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3701 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3704 * @see bluetooth_search_service
3709 ret = bluetooth_cancel_service_search();
3712 int bluetooth_cancel_service_search(void);
3715 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3716 * @brief Register rfcomm socket with a specific uuid
3719 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3720 * descriptor of the server.
3721 * This is the first API which is called to create the server. Once we created the server socket,
3722 * we will listen on that return socket.
3723 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3726 * @return socket FD on Success \n
3727 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3728 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3729 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3730 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3731 * @param[in] UUID (128 bits)
3734 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3738 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3739 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3743 int bluetooth_rfcomm_create_socket(const char *uuid);
3746 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3747 * @brief Register rfcomm socket with a specific uuid
3750 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3751 * descriptor of the server.
3752 * This is the first API which is called to create the server. Once we created the server socket,
3753 * we will listen on that return socket.
3754 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3757 * @return socket FD on Success \n
3758 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3759 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3760 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3761 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3762 * @param[in] UUID (128 bits)
3763 * @param[in] bus_name (const char)
3764 * @param[in] path (const char)
3767 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3771 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3772 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3776 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3779 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3780 * @brief De-register the rfcomm socket
3783 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3784 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3785 * descriptor else no event will come. We will call this API only after the
3786 * bluetooth_rfcomm_listen_and_accept.
3787 * This is a synchronous call.
3789 * @return BLUETOOTH_ERROR_NONE - Success \n
3790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3791 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3792 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3793 * @param[in] int socket_fd
3796 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3799 void bt_event_callback(int event, bluetooth_event_param_t *param)
3803 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3805 bluetooth_rfcomm_connection_t *discon_ind =
3806 (bluetooth_rfcomm_connection_t *)param->param_data;
3808 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3816 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3817 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3819 ret = bluetooth_rfcomm_remove_socket(fd);
3822 int bluetooth_rfcomm_remove_socket(int socket_fd);
3825 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3826 * @brief De-register the rfcomm socket
3829 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3830 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3831 * descriptor else no event will come. We will call this API only after the
3832 * bluetooth_rfcomm_listen_and_accept_ex.
3833 * This is a synchronous call.
3835 * @return BLUETOOTH_ERROR_NONE - Success \n
3836 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3837 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3838 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3839 * @param[in] UUID (128 bits)
3842 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3845 void bt_event_callback(int event, bluetooth_event_param_t *param)
3849 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3851 bluetooth_rfcomm_connection_t *discon_ind =
3852 (bluetooth_rfcomm_connection_t *)param->param_data;
3854 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3862 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3863 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3865 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3868 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3871 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3872 * @brief Disconnect rfcomm connection
3875 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3876 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3879 * @return BLUETOOTH_ERROR_NONE - Success \n
3880 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3881 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3882 * @param[in] int socket_fd the sending socket fd
3888 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3890 printf("Disconnection failed");
3892 printf("Disconnection Success");
3896 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3899 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3900 * @brief Rfcomm socket listen
3903 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3904 * after the bluetooth_rfcomm_create_socket API.
3905 * This API listen for the incomming connection and once it receives a connection, it will give
3906 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3907 * event to the application. This is an Asynchronous API call.
3910 * @return BLUETOOTH_ERROR_NONE - Success \n
3911 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3912 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3914 * @param[in] int socket_fd
3915 * @param[in] max pending connection.
3918 * @see bluetooth_rfcomm_create_socket
3921 void bt_event_callback(int event, bluetooth_event_param_t* param)
3925 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3927 bluetooth_rfcomm_connection_t *conn_ind =
3928 (bluetooth_rfcomm_connection_t *)param->param_data;
3930 printf("\nConnected from FD %d", conn_ind->socket_fd);
3938 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3939 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3943 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3946 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3947 * @brief Rfcomm socket listen
3950 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3951 * after the bluetooth_rfcomm_create_socket API.
3952 * This API listen for the incomming connection and once it receives a connection, it will give
3953 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3954 * event to the application. This is an Asynchronous API call.
3957 * @return BLUETOOTH_ERROR_NONE - Success \n
3958 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3959 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3961 * @param[in] int socket_fd
3962 * @param[in] max pending connection.
3967 * @see bluetooth_rfcomm_create_socket_ex
3970 void bt_event_callback(int event, bluetooth_event_param_t* param)
3974 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3976 bluetooth_rfcomm_connection_t *conn_ind =
3977 (bluetooth_rfcomm_connection_t *)param->param_data;
3979 printf("\nConnected from FD %d", conn_ind->socket_fd);
3987 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3988 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3993 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3996 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3997 * @brief Rfcomm socket listen
4000 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4001 * after the bluetooth_rfcomm_create_socket API.
4002 * This API listen for the incomming connection and once it receives a connection, it will give
4003 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4004 * event to the application. This is an Asynchronous API call.
4007 * @return BLUETOOTH_ERROR_NONE - Success \n
4008 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4009 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4011 * @param[in] int socket_fd
4012 * @param[in] max pending connection.
4015 * @see bluetooth_rfcomm_create_socket
4018 void bt_event_callback(int event, bluetooth_event_param_t* param)
4022 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4024 char *name = (char *)param->param_data;
4026 printf("\nConnected from %s", name);
4028 bluetooth_rfcomm_accept_connection();
4036 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4037 ret = bluetooth_rfcomm_listen(fd, 1);
4041 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4044 * @fn int bluetooth_rfcomm_accept_connection()
4045 * @brief Accepts the authorization request indicated by the event
4046 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4048 * This function is a synchronous call.
4050 * @return BLUETOOTH_ERROR_NONE - Success \n
4051 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4053 * @param[in] the socket fd of the server
4054 * @param[out] the socket fd of the client
4058 * @see bluetooth_rfcomm_reject_connection
4060 int bluetooth_rfcomm_accept_connection(int server_fd);
4063 * @fn int bluetooth_rfcomm_reject_connection()
4064 * @brief Rejects the authorization request indicated by the event
4065 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4067 * This function is a synchronous call.
4069 * @return BLUETOOTH_ERROR_NONE - Success \n
4070 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4072 * @param[in] the socket fd of the server
4076 * @see bluetooth_rfcomm_accept_connection
4078 int bluetooth_rfcomm_reject_connection(int server_fd);
4081 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4082 * @brief Informs whether rfcomm server uuid is available or not.
4084 * This function is a synchronous call.
4086 * @return TRUE - RFCOMM uuid is available \n
4087 * FALSE - RFCOMM uuid is not available \n
4089 * @param[in] uuid UUID string
4095 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4098 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4099 * const char *remote_uuid)
4100 * @brief Connect to the remote device rfcomm *
4102 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4103 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4104 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4105 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4106 * initiating a connection.
4108 * @return BLUETOOTH_ERROR_NONE - Success \n
4109 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4110 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4111 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4112 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4113 * @param[in] bluetooth_device_address_t remote bt_address
4114 * @param[in] char remote uuid
4116 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4120 void bt_event_callback(int event, bluetooth_event_param_t *param)
4124 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4126 if (param->result >= BLUETOOTH_ERROR_NONE)
4128 bt_sdp_info_t *bt_sdp_info=param->param_data;
4130 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4131 bt_sdp_info->device_addr.addr[0],
4132 bt_sdp_info->device_addr.addr[1],
4133 bt_sdp_info->device_addr.addr[2],
4134 bt_sdp_info->device_addr.addr[3],
4135 bt_sdp_info->device_addr.addr[4],
4136 bt_sdp_info->device_addr.addr[5]);
4138 printf("Supported service list:\n");
4139 for(i=0; i<bt_sdp_info->service_index; i++)
4141 bt_sdp_info->service_list_array[i]);
4144 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4145 //rfcomm_test_uuid);
4149 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4151 bluetooth_rfcomm_connection_t *conn_ind =
4152 (bluetooth_rfcomm_connection_t *)param->param_data;
4154 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4155 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4156 "SERVER" : "CLIENT");
4161 bluetooth_device_address_t remote_address = {{0},};
4162 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4163 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4164 ret = bluetooth_search_service(&remote_address);
4166 printf("Seach failed, Reason = %d", ret);
4168 printf("Search Success, Ret = %d", ret);
4170 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4172 printf("Connection failed, Reason = %d", ret);
4174 printf("Connection Success, Ret = %d", ret);
4178 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4179 const char *remote_uuid);
4182 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4183 * @brief Disconnect rfcomm connection
4186 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4187 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4190 * @return BLUETOOTH_ERROR_NONE - Success \n
4191 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4192 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4193 * @param[in] char remote bt_address
4196 * @see bluetooth_rfcomm_connect
4200 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4202 printf("Disconnection failed");
4204 printf("Disconnection Success");
4209 int bluetooth_rfcomm_disconnect(int socket_fd);
4212 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4213 * @brief Write to rfcomm connection
4216 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4217 * API is used to send the data for server and the client.
4219 * @return BLUETOOTH_ERROR_NONE - Success \n
4220 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4221 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4223 * @param[in] const char *buff Data buffer to send
4224 * @param[in] int length Length of the data
4227 * @see bluetooth_rfcomm_connect
4230 char *buff = "Test data 123456789"
4231 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4233 printf("Send failed");
4235 printf("Send success");
4239 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4242 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4243 * @brief Informs whether rfcomm client is connected.
4245 * This function is a synchronous call.
4247 * @return TRUE - RFCOMM client is connected \n
4248 * FALSE - RFCOMM client is not connected \n
4254 gboolean bluetooth_rfcomm_is_client_connected(void);
4255 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4256 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4259 * @fn int bluetooth_network_activate_server(void)
4260 * @brief Activate the NAP (Network Access Point) service
4262 * This function is a asynchronous call.
4263 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4265 * @return BLUETOOTH_ERROR_NONE - Success \n
4266 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4267 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4268 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4271 * @see bluetooth_network_deactivate_server
4274 int bluetooth_network_activate_server(void);
4277 * @fn int bluetooth_network_deactivate_server(void)
4278 * @brief Deactivate the NAP (Network Access Point) service
4280 * This function is a asynchronous call.
4281 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4283 * @return BLUETOOTH_ERROR_NONE - Success \n
4284 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4285 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4286 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4289 * @see bluetooth_network_activate_server
4292 int bluetooth_network_deactivate_server(void);
4295 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4296 * bluetooth_network_role_t role,
4298 * @brief Connect the network server in the peer
4300 * This function is a asynchronous call.
4301 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4303 * @return BLUETOOTH_ERROR_NONE - Success \n
4304 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4305 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4306 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4309 * @param[in] device_address This indicates an address of the device with which the pairing
4310 * should be initiated
4311 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4312 * need to use the third parameter.
4313 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4314 * connect. UUID string
4316 * @see bluetooth_network_disconnect
4318 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4319 bluetooth_network_role_t role, char *custom_uuid);
4322 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4323 * bluetooth_network_role_t role,
4324 * char *custom_uuid)
4325 * @brief Connect the network server in the peer
4327 * This function is a asynchronous call.
4328 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4330 * @return BLUETOOTH_ERROR_NONE - Success \n
4331 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4332 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4333 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4336 * @param[in] device_address This indicates an address of the device with which the pairing
4337 * should be initiated
4339 * @see bluetooth_network_connect
4341 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4344 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4345 * @brief Disconnect the device from the network
4347 * This function is an asynchronous call.
4348 * The network server disconnect request is responded by
4349 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4351 * @return BLUETOOTH_ERROR_NONE - Success \n
4352 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4353 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4354 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4357 * @param[in] device_address This indicates an address of the connected client device
4359 * @see bluetooth_network_activate_server
4361 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4366 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4367 * bt_hdp_role_type_t role,
4368 * bt_hdp_qos_type_t channel_type,
4369 * char **app_handle)
4370 * @brief Activate the HDP service for a particular data type
4372 * This function is a synchronous call.
4374 * @return BLUETOOTH_ERROR_NONE - Success \n
4375 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4376 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4377 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4380 * @param[in] data_type The data type against corresponding service
4381 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4382 * @param[in] channel_type The QOS type for the channel.
4383 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4384 * For role = HDP_ROLE_SINK, the channel_type
4385 * should be HDP_QOS_ANY.
4386 * @param[out] app_handle The application handler against corresponding service
4388 * @see bluetooth_hdp_deactivate
4390 int bluetooth_hdp_activate(unsigned short data_type,
4391 bt_hdp_role_type_t role,
4392 bt_hdp_qos_type_t channel_type,
4395 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4396 * @brief Deactivate the HDP service for a particular service using the handler
4398 * This function is a synchronous call.
4400 * @return BLUETOOTH_ERROR_NONE - Success \n
4401 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4402 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4403 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4406 * @param[in] app_handle The application handler against corresponding service
4408 * @see bluetooth_hdp_deactivate
4410 int bluetooth_hdp_deactivate(const char *app_handle);
4413 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4414 * const char *buffer, unsigned int size)
4415 * @brief Send data to the remote HDP device
4417 * This function is a synchronous call.
4419 * @return BLUETOOTH_ERROR_NONE - Success \n
4420 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4421 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4422 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4423 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4426 * @param[in] channel_id The channel id for the connection.
4427 * @param[in] buffer The pdu buffer.
4428 * @param[in] size Size of the buffer.
4430 * @see bluetooth_hdp_connect
4432 int bluetooth_hdp_send_data(unsigned int channel_id,
4433 const char *buffer, unsigned int size);
4435 * @fn int bluetooth_hdp_connect(const char *app_handle,
4436 * bt_hdp_qos_type_t channel_type,
4437 * const bluetooth_device_address_t *device_address)
4438 * @brief Connect to the remote device(Mainly used by source)
4440 * This function is a asynchronous call.
4441 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4443 * @return BLUETOOTH_ERROR_NONE - Success \n
4444 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4445 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4446 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4447 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4450 * @param[in] app_handle The application handler against corresponding service
4451 * @param[in] channel_type The QOS type for the channel.
4452 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4453 * @param[in] device_address The remote device Bd address.
4456 * @see bluetooth_hdp_disconnect
4458 int bluetooth_hdp_connect(const char *app_handle,
4459 bt_hdp_qos_type_t channel_type,
4460 const bluetooth_device_address_t *device_address);
4462 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4463 * const bluetooth_device_address_t *device_address)
4464 * @brief Disconnect from the remote device(Mainly used by source)
4466 * This function is a asynchronous call.
4467 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4469 * @return BLUETOOTH_ERROR_NONE - Success \n
4470 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4471 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4472 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4473 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4476 * @param[in] channel_id The channel id for the connection.
4477 * @param[in] device_address The remote device Bd address.
4480 * @see bluetooth_hdp_connect
4482 int bluetooth_hdp_disconnect(unsigned int channel_id,
4483 const bluetooth_device_address_t *device_address);
4487 * @fn int bluetooth_opc_init(void)
4488 * @brief Initialize OPP client.
4490 * This function is a synchronous call.
4491 * No event corresponding to this api
4493 * @return BLUETOOTH_ERROR_NONE - Success \n
4494 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4495 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4496 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4497 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4502 * @see bluetooth_opc_deinit
4504 int bluetooth_opc_init(void);
4507 * @fn int bluetooth_opc_deinit(void)
4508 * @brief Deinitialize OPP client.
4510 * This function is a synchronous call.
4511 * No event corresponding to this api
4513 * @return BLUETOOTH_ERROR_NONE - Success \n
4514 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4515 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4520 * @see bluetooth_opc_init
4523 int bluetooth_opc_deinit(void);
4526 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4527 char **file_name_array)
4528 * @brief Send multiple files to a remote device.
4530 * This function is a asynchronous call.
4531 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4533 * @return BLUETOOTH_ERROR_NONE - Success \n
4534 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4535 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4536 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4537 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4538 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4539 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4542 * @param[in] device_address The remote device Bd address.
4543 * @param[in] file_name_array Array of filepaths to be sent.
4546 * @see bluetooth_opc_cancel_push
4549 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4550 char **file_name_array);
4553 * @fn int bluetooth_opc_cancel_push(void)
4554 * @brief Cancels the ongoing file push.
4556 * This function is a asynchronous call.
4557 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4558 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4560 * @return BLUETOOTH_ERROR_NONE - Success \n
4561 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4562 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4567 * @see bluetooth_opc_push_files
4570 int bluetooth_opc_cancel_push(void);
4573 * @fn gboolean bluetooth_opc_session_is_exist(void)
4574 * @brief Informs whether opc session exists or not.
4576 * This function is a synchronous call.
4578 * @return TRUE - OPC session exists \n
4579 * FALSE - OPC session does not exist \n
4587 gboolean bluetooth_opc_session_is_exist(void);
4590 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4591 * @brief Informs whether opc session exists or not.
4593 * This function is a synchronous call.
4595 * @return BLUETOOTH_ERROR_NONE - Success \n
4596 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4597 * BLUETOOTH_ERROR_INTERNAL \n
4600 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4605 int bluetooth_opc_is_sending(gboolean *is_sending);
4608 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4609 int transfer_id, unsigned char *progress)
4610 * @brief Gets the percentage progress for ongoing transfers.
4612 * This function is a synchronous call.
4614 * @return BLUETOOTH_ERROR_NONE - Success \n
4615 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4616 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4619 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4620 * @param[in] transfer_id Transfer ID
4621 * @param[out] progress Percentage Progress
4625 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4626 int transfer_id, unsigned char *progress);
4629 * @fn int bluetooth_obex_server_init(const char *dst_path)
4630 * @brief Initialize OPP and FTP server.
4632 * This function is a synchronous call.
4633 * No event corresponding to this api
4635 * @return BLUETOOTH_ERROR_NONE - Success \n
4636 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4637 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4638 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4639 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4642 * @param[in] dst_path OPS destination file path.
4644 * @see bluetooth_obex_server_deinit
4646 int bluetooth_obex_server_init(const char *dst_path);
4650 * @fn int bluetooth_obex_server_deinit(void)
4651 * @brief Deinitialize OPP and FTP server.
4653 * This function is a synchronous call.
4654 * No event corresponding to this api
4656 * @return BLUETOOTH_ERROR_NONE - Success \n
4657 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4658 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4663 * @see bluetooth_obex_server_init
4665 int bluetooth_obex_server_deinit(void);
4669 * @fn gboolean bluetooth_obex_server_is_activated(void)
4670 * @brief Informs whether obex server is activated or not.
4672 * This function is a synchronous call.
4674 * @return TRUE - OBEX server is activated \n
4675 * FALSE - OBEX server is not activated \n
4682 gboolean bluetooth_obex_server_is_activated(void);
4686 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4687 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4689 * This function is a synchronous call.
4690 * No event corresponding to this api
4692 * @return BLUETOOTH_ERROR_NONE - Success \n
4693 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4694 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4695 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4696 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4700 * @param[in] dst_path OPS destination file path.
4702 * @see bluetooth_obex_server_deinit_without_agent
4704 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4708 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4709 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4711 * This function is a synchronous call.
4712 * No event corresponding to this api
4714 * @return BLUETOOTH_ERROR_NONE - Success \n
4715 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4716 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4721 * @see bluetooth_obex_server_init_without_agent
4723 int bluetooth_obex_server_deinit_without_agent(void);
4727 * @fn int bluetooth_obex_server_accept_connection(void)
4728 * @brief Accepts the authorization request indicated by the event
4729 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4731 * This function is a synchronous call.
4733 * @return BLUETOOTH_ERROR_NONE - Success \n
4734 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4735 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4739 * @see bluetooth_obex_server_reject_authorize
4741 int bluetooth_obex_server_accept_connection(void);
4745 * @fn int bluetooth_obex_server_reject_connection(void)
4746 * @brief Rejects the authorization request indicated by the event
4747 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4749 * This function is a synchronous call.
4751 * @return BLUETOOTH_ERROR_NONE - Success \n
4752 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4753 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4757 * @see bluetooth_obex_server_reject_authorize
4759 int bluetooth_obex_server_reject_connection(void);
4763 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4764 * @brief Accepts the authorization request indicated by the event
4765 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4767 * This function is a asynchronous call.
4768 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4770 * @return BLUETOOTH_ERROR_NONE - Success \n
4771 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4772 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4773 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4776 * @param[in] filename Authorized filename.
4779 * @see bluetooth_obex_server_reject_authorize
4782 int bluetooth_obex_server_accept_authorize(const char *filename);
4785 * @fn int bluetooth_obex_server_reject_authorize(void)
4786 * @brief Reject the authorization request indicated by the event
4787 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4789 * This function is a asynchronous call.
4790 * No event for this api..
4792 * @return BLUETOOTH_ERROR_NONE - Success \n
4793 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4794 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4799 * @see bluetooth_obex_server_accept_authorize
4802 int bluetooth_obex_server_reject_authorize(void);
4805 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4806 * @brief Set the OPS destination file path..
4808 * This function is a asynchronous call.
4809 * No event for this api..
4811 * @return BLUETOOTH_ERROR_NONE - Success \n
4812 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4813 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4814 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4817 * @param[in] dst_path OPS destination file path.
4823 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4826 * @fn int bluetooth_obex_server_set_root(const char *root)
4827 * @brief Set the FTS root folder..
4829 * This function is a asynchronous call.
4830 * No event for this api..
4832 * @return BLUETOOTH_ERROR_NONE - Success \n
4833 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4834 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4835 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4836 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4837 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4840 * @param[in] root FTS root folder.
4846 int bluetooth_obex_server_set_root(const char *root);
4849 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4850 * @brief Cancel the transfer on server
4852 * This function is an asynchronous call.
4853 * If the function call that cancels transfer is successful, the application would receive
4854 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4855 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4856 * the error code will be BLUETOOTH_ERROR_NONE
4858 * @return BLUETOOTH_ERROR_NONE - Success \n
4859 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4860 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4861 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4862 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4865 * @param[in] transfer_id transfer ID
4870 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4874 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4875 * @brief Cancel the transfer on server
4877 * This function is an asynchronous call.
4878 * If the function call that cancels transfer is successful, the application would receive
4879 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4880 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4881 * the error code will be BLUETOOTH_ERROR_NONE
4883 * @return BLUETOOTH_ERROR_NONE - Success \n
4884 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4885 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4886 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4887 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4894 int bluetooth_obex_server_cancel_all_transfers(void);
4898 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4899 * @brief Informs whether obex server is receiving or not.
4901 * This function is a synchronous call.
4903 * @return BLUETOOTH_ERROR_NONE - Success \n
4904 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4905 * BLUETOOTH_ERROR_INTERNAL \n
4908 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4913 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4917 * @fn int bluetooth_map_client_init(void)
4918 * @brief Initialize MAP client.
4920 * This function is a synchronous call.
4921 * No event corresponding to this api
4923 * @return BLUETOOTH_ERROR_NONE - Success \n
4924 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4925 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4926 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4927 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4932 * @see bluetooth_map_client_deinit
4934 int bluetooth_map_client_init(void);
4936 int bluetooth_map_client_deinit(void);
4938 int bluetooth_map_client_create_session(
4939 bt_map_client_session_info_s *session
4942 int bluetooth_map_client_destroy_session(
4943 bt_map_client_session_info_s *session
4946 int bluetooth_map_client_set_folder(
4947 bt_map_client_session_info_s *session,
4951 int bluetooth_map_client_list_folders(
4952 bt_map_client_session_info_s *session,
4953 bt_map_client_list_folders_filter_t *filter
4957 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
4958 * @brief Return all available fields that can be used in Fields filter.
4960 * This function is a asynchronous call.
4962 * @return BLUETOOTH_ERROR_NONE - Success \n
4963 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4964 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
4967 * @param[in] session Information about session.
4970 int bluetooth_map_client_list_filter_fields(
4971 bt_map_client_session_info_s *session
4974 int bluetooth_map_client_list_messages(
4975 bt_map_client_session_info_s *session,
4977 bt_map_client_list_messages_filter_t *filter
4980 int bluetooth_map_client_update_inbox(
4981 bt_map_client_session_info_s *session
4984 int bluetooth_map_client_push_message(
4985 bt_map_client_session_info_s *session,
4986 const char *source_file,
4988 bt_map_client_push_message_args_t *args
4991 int bluetooth_map_client_get_message(
4992 bt_map_client_session_info_s *session,
4993 const bt_map_client_message_object_t message_object,
4994 const char *target_file,
5000 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5001 * @brief Read the local Hash and Randmizer.
5003 * This function is a synchronous call.
5005 * @return BLUETOOTH_ERROR_NONE - Success \n
5006 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5010 * @param[out] local_oob_data - Pointer to the local OOB data
5016 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5020 * @fn int bluetooth_oob_add_remote_data(
5021 * const bluetooth_device_address_t *remote_device_address,
5022 * bt_oob_data_t *oob_data)
5023 * @brief Add/updated the remote device Hash and Randmizer.
5025 * This function is a synchronous call.
5026 * No event for this api..
5028 * @return BLUETOOTH_ERROR_NONE - Success \n
5029 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5032 * @param[in] remote_device_address - Remote device address
5033 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5039 int bluetooth_oob_add_remote_data(
5040 const bluetooth_device_address_t *remote_device_address,
5041 bt_oob_data_t *remote_oob_data);
5045 * @fn int bluetooth_oob_remove_remote_data(
5046 * const bluetooth_device_address_t *remote_device_address)
5047 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5049 * This function is a synchronous call.
5050 * No event for this api..
5052 * @return BLUETOOTH_ERROR_NONE - Success \n
5053 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5056 * @param[in] remote_device_address - Remote device address
5062 int bluetooth_oob_remove_remote_data(
5063 const bluetooth_device_address_t *remote_device_address);
5066 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5067 * bt_gatt_handle_info_t *prim_svc);
5069 * @brief Gets the GATT based primary services handle supported by remote device
5071 * This function is a synchronous call.
5072 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5074 * @return BLUETOOTH_ERROR_NONE - Success \n
5075 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5076 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5077 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5080 * @param[in] address - Remote device address
5081 * @param[out] prim_svc - Structure containing remote service count and handle list.
5084 * @see bluetooth_gatt_free_primary_services()
5086 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5087 bt_gatt_handle_info_t *prim_svc);
5090 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5092 * @brief Discovers the characteristics of GATT based service of remote device
5094 * This function is an asynchronous call.
5095 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5097 * @return BLUETOOTH_ERROR_NONE - Success \n
5098 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5099 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5100 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5103 * @param[in] service_handle - Handle for remote service.
5108 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5110 int bluetooth_gatt_set_service_change_watcher(
5111 const bluetooth_device_address_t *address, gboolean enable);
5114 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5115 * bt_gatt_service_property_t *service);
5117 * @brief Gets the properties of GATT based service of remote device
5119 * This function is a synchronous call.
5120 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5122 * @return BLUETOOTH_ERROR_NONE - Success \n
5123 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5124 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5125 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5128 * @param[in] service_handle - Handle for remote service.
5129 * @param[out] service - Structure containing remote service property.
5132 * @see bluetooth_gatt_free_service_property()
5134 int bluetooth_gatt_get_service_property(const char *service_handle,
5135 bt_gatt_service_property_t *service);
5138 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5140 * @brief Register to GATT based service to receive value change notification/indication.
5142 * This function is a synchronous call.
5143 * No event for this api.
5145 * @return BLUETOOTH_ERROR_NONE - Success \n
5146 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5147 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5148 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5151 * @param[in] service_handle - Handle for remote service.
5156 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5159 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5161 * @brief Unregister GATT based service to receive value change notification/indication.
5163 * This function is a synchronous call.
5164 * No event for this api.
5166 * @return BLUETOOTH_ERROR_NONE - Success \n
5167 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5168 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5169 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5172 * @param[in] service_handle - Handle for remote service.
5177 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5180 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5181 * bt_gatt_char_property_t *characteristic);
5183 * @brief Provides characteristic value along with properties.
5185 * This function is a synchronous call.
5186 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5188 * @return BLUETOOTH_ERROR_NONE - Success \n
5189 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5190 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5191 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5194 * @param[in] char_handle - Handle for Characteristic property.
5195 * @param[out] characteristic - Structure containing remote characteristic property.
5198 * @see bluetooth_gatt_free_char_property()
5200 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5201 bt_gatt_char_property_t *characteristic);
5204 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5205 * bt_gatt_char_property_t *characteristic);
5207 * @brief Provides characteristic descriptor value along with its UUID.
5209 * This function is a synchronous call.
5210 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5212 * @return BLUETOOTH_ERROR_NONE - Success \n
5213 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5214 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5215 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5218 * @param[in] desc_handle - Handle for Characteristic descriptor.
5219 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5222 * @see bluetooth_gatt_free_desc_property()
5224 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5225 bt_gatt_char_descriptor_property_t *descriptor);
5229 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5230 * const guint8 *value, int length)
5232 * @brief Set characteristic value.
5234 * This function is a synchronous call.
5236 * @return BLUETOOTH_ERROR_NONE - Success \n
5237 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5238 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5239 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5242 * @param[in] char_handle - Handle for Characteristic property.
5243 * @param[in] value - New value to set for characteristic property.
5244 * @param[in] length - Length of the value to be set.
5249 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5250 const guint8 *value, int length);
5253 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5254 * const guint8 *value, int length, guint8 write_type)
5256 * @brief Set characteristic value by write type.
5258 * This function is a synchronous call if write type is "write without resonse"
5259 * and it is an asynchronous call if write type is "write with response"
5261 * @return BLUETOOTH_ERROR_NONE - Success \n
5262 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5263 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5264 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5267 * @param[in] char_handle - Handle for Characteristic property.
5268 * @param[in] value - New value to set for characteristic property.
5269 * @param[in] length - Length of the value to be set.
5270 * @param[in] write_type - Type of write.
5275 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5276 const guint8 *value, int length, guint8 write_type);
5280 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5281 * const guint8 *value, int length)
5283 * @brief Set characteristic value request.
5285 * This function is an asynchronous call.
5287 * @return BLUETOOTH_ERROR_NONE - Success \n
5288 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5289 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5290 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5293 * @param[in] char_handle - Handle for Characteristic property.
5294 * @param[in] value - New value to set for characteristic property.
5295 * @param[in] length - Length of the value to be set.
5300 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5301 const guint8 *value, int length);
5304 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5306 * @brief Read characteristic value.
5308 * This function is a asynchronous call.
5310 * @return BLUETOOTH_ERROR_NONE - Success \n
5311 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5312 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5313 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5316 * @param[in] char_handle - Handle for Characteristic property.
5321 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5324 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5325 * const char *service_uuid,
5326 * bt_gatt_service_property_t *service)
5328 * @brief Gets the service property from a device based on a particular uuid
5330 * This function is a synchronous call.
5332 * @return BLUETOOTH_ERROR_NONE - Success \n
5333 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5334 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5335 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5338 * @param[in] address - BD address of the remote device
5339 * @param[in] service_uuid - uuid of the service.
5340 * @param[out] service - Structure containing the service property.
5345 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5346 const char *service_uuid,
5347 bt_gatt_service_property_t *service);
5350 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5351 * const char *char_uuid)
5353 * @brief Gets the characteristic property from a service based on a particular char uuid
5355 * This function is an asynchronous call.
5356 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5358 * @return BLUETOOTH_ERROR_NONE - Success \n
5359 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5360 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5361 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5364 * @param[in] service_handle - Service handle.
5365 * @param[in] uuid - Characteristic uuid.
5370 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5371 const char *char_uuid);
5374 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5376 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5378 * This function is a synchronous call.
5379 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5381 * @return BLUETOOTH_ERROR_NONE - Success \n
5382 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5385 * @param[in] prim_svc - GATT handle info structure
5388 * @see bluetooth_gatt_get_primary_services()
5390 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5393 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5395 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5397 * This function is a synchronous call.
5398 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5400 * @return BLUETOOTH_ERROR_NONE - Success \n
5401 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5404 * @param[in] svc_pty - GATT service property structure.
5407 * @see bluetooth_gatt_get_service_property()
5409 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5412 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5414 * @brief Provides characteristic value along with properties.
5416 * This function is a synchronous call.
5417 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5419 * @return BLUETOOTH_ERROR_NONE - Success \n
5420 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5423 * @param[in] char_pty - GATT characteristics property structure.
5426 * @see bluetooth_gatt_get_characteristics_property()
5428 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5431 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5433 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5435 * This function is a synchronous call.
5436 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5438 * @return BLUETOOTH_ERROR_NONE - Success \n
5439 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5442 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5445 * @see bluetooth_gatt_get_char_descriptor_property()
5447 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5449 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5451 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5454 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5456 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5458 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5460 * @return BLUETOOTH_ERROR_NONE - Success \n
5461 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5464 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5468 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5471 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5473 * @brief Read characteristic descriptor value.
5475 * This function is a asynchronous call.
5477 * @return BLUETOOTH_ERROR_NONE - Success \n
5478 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5479 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5480 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5483 * @param[in] desc_handle - Handle for Characteristic descriptor
5488 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5491 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5492 * const guint8 *value, int length);
5494 * @brief Set characteristic descriptor value.
5496 * This function is a asynchronous call.
5498 * @return BLUETOOTH_ERROR_NONE - Success \n
5499 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5500 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5501 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5504 * @param[in] desc_handle - Handle for Characteristic descriptor
5505 * @param[in] value - New value to set for characteristic descriptor
5506 * @param[in] length - Length of the value to be set.
5511 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5512 const guint8 *value, int length);
5514 /* @fn int bluetooth_gatt_init(void)
5516 * @brief Initializes the gatt service.
5518 * This function is a synchronous call.
5519 * @return BLUETOOTH_ERROR_NONE - Success \n
5520 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5521 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5522 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5525 * @remark Adapter should be enabled
5526 * @see bluetooth_gatt_deinit()
5528 int bluetooth_gatt_init(void);
5530 /* @fn int bluetooth_gatt_init(void)
5532 * @brief DeInitializes the gatt service.
5534 * This function is a synchronous call.
5535 * @return BLUETOOTH_ERROR_NONE - Success \n
5536 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5537 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5538 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5541 * @remark Adapter should be enabled
5542 * @see bluetooth_gatt_init()
5544 int bluetooth_gatt_deinit(void);
5546 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5547 unsigned char **svc_path)
5549 * @brief Exports a new gatt service to the service interface.
5551 * This function is a synchronous call.
5553 * @return BLUETOOTH_ERROR_NONE - Success \n
5554 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5555 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5556 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5559 * @param[in] svc_uuid Gatt service uuid.
5560 * @param[out] svc_path service object path of the exported service.
5561 * @remark Adapter should be enabled
5562 * @see bluetooth_gatt_init()
5564 int bluetooth_gatt_add_service(const char *svc_uuid,
5567 /* @fn int bluetooth_gatt_add_new_characteristic(
5568 const char *svc_path, const char *char_uuid,
5569 bt_gatt_permission_t permissions,
5570 bt_gatt_characteristic_property_t properties,
5571 int flags_length, char **char_path);;
5573 * @brief Exports a new gatt characteristic to the characteristic interface.
5575 * This function is a synchronous call.
5576 * @return BLUETOOTH_ERROR_NONE - Success \n
5577 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5578 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5579 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5581 * @param[in] svc_path service object path of the exported service.
5582 * @param[in] char_uuid Gatt service uuid.
5583 * @param[in] properties GATT characteristic properties.
5584 * @param[out] char_path characteristic object path of the exported characteristic.
5586 * @remark Adapter should be enabled
5587 * @see bluetooth_gatt_add_service()
5589 int bluetooth_gatt_add_new_characteristic(
5590 const char *svc_path, const char *char_uuid,
5591 bt_gatt_permission_t permissions,
5592 bt_gatt_characteristic_property_t properties,
5595 /* @fn bluetooth_gatt_set_characteristic_value(
5596 const char *characteristic, const char *char_value,
5599 * @brief adds gatt charactertisic value to the given charactertistic path.
5601 * This function is a synchronous call.
5602 * @return BLUETOOTH_ERROR_NONE - Success \n
5603 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5604 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5605 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5607 * @param[in] char_value Value of the GATT characteristic to be added.
5608 * @param[in] value_length length of the chantacteristic value..
5609 * @param[out] characteristic characteristic object path..
5611 * @remark Adapter should be enabled
5612 * @see bluetooth_gatt_add_service()
5614 int bluetooth_gatt_set_characteristic_value(
5615 const char *characteristic, const char *char_value,
5618 /* @fn int bluetooth_gatt_add_descriptor(
5619 const char *char_path, const char *desc_uuid,
5620 bt_gatt_permission_t permissions,
5623 * @brief Exports a new gatt descriptor to the descriptor interface.
5625 * This function is a synchronous call.
5627 * @return BLUETOOTH_ERROR_NONE - Success \n
5628 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5629 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5630 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5633 * @param[in] desc_uuid Gatt descriptor uuid.
5634 * @param[in] desc_value GATT descriptor value.
5635 * @param[in] value_length Length of GATT descriptor value.
5636 * @param[in] permissions descriptor permissions.
5637 * @param[in] properties GATT descriptor properties.
5638 * @param[in] char_path characteristics object path of the exported character.
5640 * @remark Adapter should be enabled
5641 * @see bluetooth_gatt_add_service()
5642 * @see bluetooth_gatt_add_characteristics()
5644 int bluetooth_gatt_add_descriptor(
5645 const char *char_path, const char *desc_uuid,
5646 bt_gatt_permission_t permissions,
5649 /* @fn int bluetooth_gatt_set_descriptor_value(
5650 const char *desc_path, const char *desc_value,
5653 * @brief Adds value to the given descriptor handle.
5655 * This function is a synchronous call.
5657 * @return BLUETOOTH_ERROR_NONE - Success \n
5658 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5659 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5660 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5663 * @param[in] desc_value GATT descriptor value.
5664 * @param[in] value_length Length of GATT descriptor value.
5665 * @param[in] desc_path descriptor path to which the value needs to be added.
5667 * @remark Adapter should be enabled
5668 * @see bluetooth_gatt_add_service()
5669 * @see bluetooth_gatt_add_characteristics()
5671 int bluetooth_gatt_set_descriptor_value(
5672 const char *desc_path, const char *desc_value,
5675 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5677 * @brief Reads the Service registered on manager interface.
5679 * This function is a synchronous call.
5681 * @return BLUETOOTH_ERROR_NONE - Success \n
5682 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5683 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5684 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5687 * @param[in] svc_uuid Gatt Service uuid.
5689 * @remark Adapter should be enabled and service should be registered.
5690 * @see bluetooth_gatt_register_service()
5692 int bluetooth_gatt_get_service(const char *svc_uuid);
5694 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5696 * @brief Registers the given service path with the library.
5698 * This function is a synchronous call.
5700 * @return BLUETOOTH_ERROR_NONE - Success \n
5701 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5702 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5703 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5706 * @param[in] svc_path service object path of the exported service.
5708 * @remark Adapter should be enabled
5709 * @see bluetooth_gatt_add_service()
5710 * @see bluetooth_gatt_add_characteristics()
5711 * @see bluetooth_gatt_add_descriptor()
5712 * @see bluetooth_gatt_register_application()
5714 int bluetooth_gatt_register_service(const char *svc_path);
5716 /* @fn int bluetooth_gatt_register_application(void)
5718 * @brief Registers the application with the bluez gatt server.
5720 * This function is a synchronous call.
5722 * @return BLUETOOTH_ERROR_NONE - Success \n
5723 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5724 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5725 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5729 * @remark Adapter should be enabled
5730 * @see bluetooth_gatt_init()
5731 * @see bluetooth_gatt_add_service()
5732 * @see bluetooth_gatt_add_characteristics()
5733 * @see bluetooth_gatt_add_descriptor()
5734 * @see bluetooth_gatt_register_service()
5736 int bluetooth_gatt_register_application(void);
5738 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5740 * @brief Removes(unregister) service from the bluez gatt server db.
5742 * This function is a synchronous call.
5744 * @return BLUETOOTH_ERROR_NONE - Success \n
5745 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5746 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5747 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5750 * @param[in] svc_path service object path of the exported service.
5752 * @remark Adapter should be enabled
5753 * @see bluetooth_gatt_add_service()
5754 * @see bluetooth_gatt_add_characteristics()
5755 * @see bluetooth_gatt_add_descriptor()
5756 * @see bluetooth_gatt_register_service()
5758 int bluetooth_gatt_unregister_service(const char *svc_path);
5760 /* @fn int bluetooth_gatt_unregister_application(void)
5762 * @brief Removes(unregister) the application with the bluez gatt server,
5763 * and deletes all the service registered.
5765 * This function is a synchronous call.
5767 * @return BLUETOOTH_ERROR_NONE - Success \n
5768 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5769 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5770 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5774 * @remark Adapter should be enabled
5775 * @see bluetooth_gatt_init()
5776 * @see bluetooth_gatt_add_service()
5777 * @see bluetooth_gatt_add_characteristics()
5778 * @see bluetooth_gatt_add_descriptor()
5779 * @see bluetooth_gatt_register_service()
5780 * @see bluetooth_gatt_unregister_service()
5782 int bluetooth_gatt_unregister_application(void);
5784 /* @fn int bluetooth_gatt_send_response(int request_id,
5785 * int offset, char *value, int value_length)
5787 * @brief Updates the attribute value in local attribute list.
5789 * This function is a synchronous call.
5791 * @return BLUETOOTH_ERROR_NONE - Success \n
5792 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5793 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5794 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5797 * @param[in] request_id The identification of a read request
5798 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5799 * @param[in] resp_state The identification of response state
5800 * @param[in] offset The offset from where a value is read
5801 * @param[in] value The value to be sent. It will be sent from @a offset.
5802 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5803 * @param[in] value_length Value Length.
5805 * @remark Adapter should be enabled
5806 * @see bluetooth_gatt_add_service()
5807 * @see bluetooth_gatt_add_characteristics()
5808 * @see bluetooth_gatt_add_descriptor()
5809 * @see bluetooth_gatt_register_service()
5811 int bluetooth_gatt_send_response(int request_id, guint req_type,
5812 int resp_state, int offset, char *value, int value_length);
5814 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5816 * @brief Sets the notification property for a characteristic.
5818 * This function is a synchronous call.
5820 * @return BLUETOOTH_ERROR_NONE - Success \n
5821 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5822 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5823 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5826 * @param[in] char_path characteristic object path.
5827 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5829 * @remark Adapter should be enabled
5830 * @see bluetooth_gatt_update_characteristic()
5832 int bluetooth_gatt_server_set_notification(const char *char_path,
5833 bluetooth_device_address_t *unicast_address);
5835 /* @fn int bluetooth_gatt_delete_services(void)
5837 * @brief deletes (unregisters) all services from the gatt server database..
5839 * This function is a synchronous call.
5841 * @return BLUETOOTH_ERROR_NONE - Success \n
5842 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5843 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5844 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5848 * @remark Adapter should be enabled
5849 * @see bluetooth_gatt_add_service()
5850 * @see bluetooth_gatt_add_characteristics()
5851 * @see bluetooth_gatt_add_descriptor()
5852 * @see bluetooth_gatt_register_service()
5853 * @see bluetooth_gatt_unregister_service()
5855 int bluetooth_gatt_delete_services(void);
5857 /* @fn int bluetooth_gatt_update_characteristic(void)
5859 * @brief updates the given characteristic with a new value
5861 * This function is a synchronous call.
5863 * @return BLUETOOTH_ERROR_NONE - Success \n
5864 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5865 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5866 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5870 * @remark Adapter should be enabled
5871 * @see bluetooth_gatt_add_service()
5872 * @see bluetooth_gatt_add_characteristics()
5873 * @see bluetooth_gatt_add_descriptor()
5874 * @see bluetooth_gatt_register_service()
5875 * @see bluetooth_gatt_unregister_service()
5877 int bluetooth_gatt_update_characteristic(const char *char_path,
5878 const char* char_value, int value_length);
5881 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5883 * @brief Set advertising status.
5885 * This function is used to enable or disable LE advertising.
5886 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5888 * This function is a synchronous call.
5890 * @return BLUETOOTH_ERROR_NONE - Success \n
5891 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5892 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5895 * @param[in] enable - The status of advertising
5898 * @see bluetooth_set_advertising_data
5900 int bluetooth_set_advertising(int handle, gboolean enable);
5903 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5905 * @brief Set advertising status along with interval value.
5907 * This function is used to enable or disable LE advertising.
5908 * Interval_min and Interval_max is used to set the best advertising interval.
5909 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5911 * This function is a synchronous call.
5913 * @return BLUETOOTH_ERROR_NONE - Success \n
5914 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5915 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5918 * @param[in] enable - The status of advertising
5919 * @param[in] interval_min - Minimum interval of advertising (msec)
5920 * @param[in] interval_max - Maximum interval of advertising (msec)
5921 * @param[in] filter_policy - Advertising filter policy
5924 * @see bluetooth_set_advertising_data
5926 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5927 bluetooth_advertising_params_t *params);
5930 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5931 * @brief Get the advertising data
5933 * This function is used to get advertising data.
5934 * Before calling this API, the adapter should be enabled.
5936 * This function is a synchronous call.
5938 * @return BLUETOOTH_ERROR_NONE - Success \n
5939 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5940 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5941 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5943 * @param[out] value - Advertising data structure.
5944 * @param[out] length - The length of Advertising data.
5948 bluetooth_advertising_data_t *value = { {0} };
5951 ret = bluetooth_get_advertising_data(&value, &length);
5954 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5957 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5959 * @brief Set advertising data with value
5961 * This function is used to set advertising data and Maximum size of advertising data
5962 * is 28 byte (Except Flag)
5964 * This function is a synchronous call.
5966 * @return BLUETOOTH_ERROR_NONE - Success \n
5967 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5968 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5971 * @param[in] value - Advertising data structure.
5975 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5978 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5980 * @brief Check the privilege for advertising parameter setting
5982 * This function is a synchronous call.
5984 * @return BLUETOOTH_ERROR_NONE - Success \n
5985 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5991 int bluetooth_check_privilege_advertising_parameter(void);
5994 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5995 * @brief Get the LE scan response data
5997 * This function is used to get scan response data.
5998 * Before calling this API, the adapter should be enabled.
6000 * This function is a synchronous call.
6002 * @return BLUETOOTH_ERROR_NONE - Success \n
6003 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6004 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6005 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6007 * @param[out] value - Scan response data structure.
6008 * @param[out] length - The length of Scan response data.
6012 bluetooth_scan_resp_data_t *value = { {0} };
6015 ret = bluetooth_get_scan_response_data(&value, &length);
6018 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6021 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6023 * @brief Set scan response data with value
6025 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6027 * This function is a synchronous call.
6029 * @return BLUETOOTH_ERROR_NONE - Success \n
6030 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6031 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6034 * @param[in] value - LE Scan response data structure.
6038 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6041 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6043 * @brief Set scan interval and window
6045 * This function is used to set LE scan interval and window size
6047 * This function is a synchronous call.
6049 * @return BLUETOOTH_ERROR_NONE - Success \n
6050 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6051 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6054 * @param[in] interval - Interval of LE scan (msec)
6055 * @param[in] window - Window size of LE scan (msec)
6059 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6062 * @fn int bluetooth_is_advertising(void)
6063 * @brief Check for the advertising is in-progress or not.
6065 * This API is used to check the current status of the advertising procedure.
6066 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6069 * This function checks whether the advertising is started or not.
6071 * This function is a synchronous call.
6073 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6075 * @return BLUETOOTH_ERROR_NONE - Success \n
6076 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6079 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6083 gboolean is_advertising = 0;
6085 ret = bluetooth_is_advertising(&is_advertising);
6088 int bluetooth_is_advertising(gboolean *is_advertising);
6091 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6092 * @brief Add LE device to white list
6094 * This API is used to add LE device to white list
6095 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6099 * This function is a synchronous call.
6101 * @param[in] address The address of remote device
6103 * @return BLUETOOTH_ERROR_NONE - Success \n
6104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6107 * @see bluetooth_set_custom_advertising
6109 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6112 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6113 * @brief Remove LE device from white list
6115 * This API is used to remove LE device from white list
6116 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6120 * This function is a synchronous call.
6122 * @param[in] address The address of remote device
6124 * @return BLUETOOTH_ERROR_NONE - Success \n
6125 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6128 * @see bluetooth_set_custom_advertising
6130 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6133 * @fn int bluetooth_clear_white_list(void)
6134 * @brief Clear white list
6136 * This API is used to clear white list
6137 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6141 * This function is a synchronous call.
6143 * @param[in] address The address of remote device
6145 * @return BLUETOOTH_ERROR_NONE - Success \n
6146 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6149 * @see bluetooth_set_custom_advertising
6151 int bluetooth_clear_white_list(void);
6154 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6155 * const bluetooth_le_connection_param_t *parameters)
6156 * @brief update connection paramter of LE connection.
6158 * This function is a synchronous call.
6160 * @return BLUETOOTH_ERROR_NONE - Success \n
6161 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6164 * @param[in] address - remote device address value.
6165 * @param[in] parameters - new connection parameters.
6168 * @see bluetooth_bond_device
6170 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6171 const bluetooth_le_connection_param_t *parameters);
6174 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6176 * @brief Enable/Disable LE Privacy feature.
6178 * This function is used to enable or disable LE Privacy feature.
6179 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6181 * This function is a synchronous call.
6183 * @return BLUETOOTH_ERROR_NONE - Success \n
6184 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6185 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6188 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6192 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6195 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6197 * @brief Enable/Disable LE static random address.
6199 * This function is used to enable or disable LE static random address.
6201 * This function is a synchronous call.
6203 * @return BLUETOOTH_ERROR_NONE - Success \n
6204 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6205 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6208 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6212 int bluetooth_set_le_static_random_address(gboolean enable);
6215 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6216 * bluetooth_le_connection_mode_t mode)
6217 * @brief update connection paramter of LE connection.
6219 * This function is a synchronous call.
6221 * @return BLUETOOTH_ERROR_NONE - Success \n
6222 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6223 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6226 * @param[in] address - remote device address value.
6227 * @param[in] mode - new connection mode.
6231 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6232 bluetooth_le_connection_mode_t mode);
6235 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6236 * @brief Request for new ATT MTU value.
6238 * This function is a asynchronous call.
6240 * @return BLUETOOTH_ERROR_NONE - Success \n
6241 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6242 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6245 * @param[in] address - remote device address value.
6246 * @param[in] mtu - MTU value to be set.
6250 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6253 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6254 * unsigned int *mtu)
6255 * @brief Gets the xisting MTU value set for a connection.
6257 * This function is a synchronous call.
6259 * @return BLUETOOTH_ERROR_NONE - Success \n
6260 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6261 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6264 * @param[in] address - remote device address value.
6265 * @param[out] mtu - MTU value set for the connection.
6269 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6273 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6274 * bluetooth_device_address_t *id_address)
6275 * @brief Gets the Identity address of remote device.
6277 * This function is a synchronous call.
6279 * @return BLUETOOTH_ERROR_NONE - Success \n
6280 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6281 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6284 * @param[in] device_rpa - remote Resolvable private address.
6285 * @param[out] id_address - remote Identity device address value.
6289 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6290 bluetooth_device_address_t *id_address);
6293 * @fn int bluetooth_le_read_maximum_data_length()
6294 * @brief reads the maximum LE data length supported in the controller.
6296 * This function is a synchronous call.
6298 * @return BLUETOOTH_ERROR_NONE - Success \n
6299 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6305 int bluetooth_le_read_maximum_data_length(
6306 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6308 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6309 * @brief writes the host suggested values for the controllers max transmitted no of payload
6310 * octects to be used for new connections.
6312 * This function is a synchronous call.
6314 * @return BLUETOOTH_ERROR_NONE - Success \n
6315 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6321 int bluetooth_le_write_host_suggested_default_data_length(
6322 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6324 int bluetooth_le_read_suggested_default_data_length(
6325 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6327 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6328 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6330 int bluetooth_pbap_init(void);
6331 int bluetooth_pbap_deinit(void);
6332 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6333 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6334 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6335 bt_pbap_folder_t *folder);
6336 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6337 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6338 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6339 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6340 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6341 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6342 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6343 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6346 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6348 * @brief Set manufacturer data with value
6350 * This function is used to set manufacturer data.
6352 * This function is a synchronous call.
6354 * @return BLUETOOTH_ERROR_NONE - Success \n
6355 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6356 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6359 * @param[in] value - Manufacturer data structure.
6363 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6365 int bluetooth_set_passkey_notification(gboolean enable);
6368 * @fn int bluetooth_dpm_is_mode_allowed(void);
6370 * @brief Checks Restriction for BT mode(BT allowed or not)
6372 * This function is a synchronous call.
6374 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6375 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6376 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6383 int bluetooth_dpm_is_mode_allowed(void);
6386 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6388 * @brief Sets Restriction for BT mode(BT allowed or not)
6390 * This function is a synchronous call.
6392 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6393 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6394 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6397 * @param[in] value - BT Allow value.
6398 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6399 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6400 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6401 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6405 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6408 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6410 * @brief Reads the Restriction for BT mode(BT allowed or not)
6412 * This function is a synchronous call.
6414 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6415 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6416 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6420 * @param[out] value - BT Allow value.
6421 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6422 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6423 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6424 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6428 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6431 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6433 * @brief Sets the Restriction for device.
6435 * This function is a synchronous call.
6437 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6438 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6439 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6442 * @param[in] value - State value.
6443 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6444 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6448 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6451 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6453 * @brief Reads the Restriction for device.
6455 * This function is a synchronous call.
6457 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6458 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6459 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6463 * @param[out] value - State value.
6464 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6465 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6469 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6472 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6474 * @brief Sets the Restriction for uuid.
6476 * This function is a synchronous call.
6478 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6479 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6480 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6483 * @param[in] value - State value.
6484 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6485 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6489 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6492 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6494 * @brief Reads the Restriction for uuid.
6496 * This function is a synchronous call.
6498 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6499 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6500 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6504 * @param[out] value - State value.
6505 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6506 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6510 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6513 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6515 * @brief Adds the device to blacklist.
6517 * This function is a synchronous call.
6519 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6520 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6521 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6524 * @param[in] device_address - Device address
6528 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6531 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6533 * @brief Adds the device to whitelist.
6535 * This function is a synchronous call.
6537 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6538 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6539 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6542 * @param[in] device_address - Device address
6546 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6549 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6551 * @brief Adds the Service UUIDS to blacklist.
6553 * This function is a synchronous call.
6555 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6556 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6557 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6560 * @param[in] service_uuids - profile or custom service uuids
6564 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6567 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6569 * @brief Adds the Service UUIDS to whitelist.
6571 * This function is a synchronous call.
6573 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6574 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6575 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6578 * @param[in] service_uuids - profile or custom service uuids
6582 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6585 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6587 * @brief Clears the devices from blacklist.
6589 * This function is a synchronous call.
6591 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6592 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6593 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6600 int bluetooth_dpm_clear_devices_from_blacklist(void);
6603 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6605 * @brief Clears the devices from whitelist.
6607 * This function is a synchronous call.
6609 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6610 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6611 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6618 int bluetooth_dpm_clear_devices_from_whitelist(void);
6621 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6623 * @brief Clears the uuids from blacklist.
6625 * This function is a synchronous call.
6627 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6628 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6629 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6636 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6639 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6641 * @brief Clears the uuids from whitelist.
6643 * This function is a synchronous call.
6645 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6646 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6647 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6654 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6657 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6659 * @brief reads the devices from blacklist.
6661 * This function is a synchronous call.
6663 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6664 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6665 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6668 * @param[out] device_list - list of devices
6672 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6675 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6677 * @brief reads the devices from whitelist.
6679 * This function is a synchronous call.
6681 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6682 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6683 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6686 * @param[out] device_list - list of devices
6690 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6693 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6695 * @brief reads the uuids from blacklist.
6697 * This function is a synchronous call.
6699 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6700 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6701 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6704 * @param[in] uuid_list - list of uuids
6708 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6711 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6713 * @brief reads the uuids from whitelist.
6715 * This function is a synchronous call.
6717 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6718 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6719 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6722 * @param[in] uuid_list - list of uuids
6726 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6729 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6731 * @brief Removes the device from whitelist.
6733 * This function is a synchronous call.
6735 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6736 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6737 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6740 * @param[in] device_address - Device address
6744 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6747 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6749 * @brief Removes the device from blacklist.
6751 * This function is a synchronous call.
6753 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6754 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6755 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6758 * @param[in] device_address - Device address
6762 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6765 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6767 * @brief Removes the Service UUIDS from whitelist.
6769 * This function is a synchronous call.
6771 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6772 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6773 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6776 * @param[in] service_uuids - profile or custom service uuids
6780 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6783 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6785 * @brief Removes the Service UUIDS from blacklist.
6787 * This function is a synchronous call.
6789 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6790 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6791 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6794 * @param[in] service_uuids - profile or custom service uuids
6798 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6801 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6803 * @brief Sets the Restriction for outgoing call.
6805 * This function is a synchronous call.
6807 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6808 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6809 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6812 * @param[in] value - State value.
6813 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6814 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6818 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6821 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6823 * @brief Reads the Restriction for outgoing call.
6825 * This function is a synchronous call.
6827 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6828 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6829 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6833 * @param[out] value - State value.
6834 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6835 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6839 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6842 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6844 * @brief Sets the Restriction for Pairing.
6846 * This function is a synchronous call.
6848 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6849 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6850 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6853 * @param[in] value - State value.
6854 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6855 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6859 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6862 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6864 * @brief Reads the Restriction for Pairing
6866 * This function is a synchronous call.
6868 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6869 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6870 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6874 * @param[out] value - State value.
6875 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6876 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6880 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6883 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6885 * @brief Sets the Restriction for using Profiles.
6887 * This function is a synchronous call.
6889 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6890 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6891 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6894 * @param[in]profile - Profile.
6895 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6896 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6897 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6898 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6899 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6900 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6901 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6902 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6903 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6904 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6905 * BLUETOOTH_DPM_PROFILE_NONE
6906 * @param[in] value - State value.
6907 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6908 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6912 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6915 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6917 * @brief Reads the Restriction for using Profiles.
6919 * This function is a synchronous call.
6921 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6922 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6923 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6926 * @param[in]profile - Profile.
6927 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6928 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6929 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6930 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6931 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6932 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6933 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6934 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6935 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6936 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6937 * BLUETOOTH_DPM_PROFILE_NONE
6938 * @param[out] value - State value.
6939 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6940 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6944 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6947 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6949 * @brief Sets the Restriction for Desktop Connectivity.
6951 * This function is a synchronous call.
6953 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6954 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6955 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6958 * @param[in] value - State value.
6959 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6960 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6964 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6967 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6969 * @brief Reads the Restriction for Desktop Connectivity.
6971 * This function is a synchronous call.
6973 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6974 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6975 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6979 * @param[out] value - State value.
6980 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6981 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6985 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6988 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6990 * @brief Sets the Restriction for Discoverable state.
6992 * This function is a synchronous call.
6994 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6995 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6996 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6999 * @param[in] value - State value.
7000 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7001 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7005 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7008 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7010 * @brief Reads the Restriction for Discoverable state.
7012 * This function is a synchronous call.
7014 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7015 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7016 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7020 * @param[out] value - State value.
7021 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7022 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7026 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7029 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7031 * @brief Sets the Restriction for linited discoverable state..
7033 * This function is a synchronous call.
7035 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7036 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7037 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7040 * @param[in] value - State value.
7041 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7042 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7046 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7049 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7051 * @brief Reads the Restriction for limited discoverable state.
7053 * This function is a synchronous call.
7055 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7056 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7057 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7061 * @param[out] value - State value.
7062 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7063 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7067 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7069 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7071 * @brief Sets the Restriction for Data trasnfer.
7073 * This function is a synchronous call.
7075 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7076 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7077 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7080 * @param[in] value - State value.
7081 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7082 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7086 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7090 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7092 * @brief Reads the Restriction for Data trasnfer.
7094 * This function is a synchronous call.
7096 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7097 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7098 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7102 * @param[out] value - State value.
7103 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7104 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7108 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7111 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7112 * bluetooth_pxp_poperty_t property, int value);
7114 * @brief Sets the Proximity alert level/properties for monitor role.
7116 * This function is a synchronous call.
7118 * @return BLUETOOTH_ERROR_NONE - Success \n
7119 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7120 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7121 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7124 * @param[in] device_address remote device address
7125 * @param[in] property proximity profile property
7126 * @param[in] value alert level/property value to be set
7131 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7132 bluetooth_pxp_poperty_t property, int value);
7135 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7136 * bluetooth_pxp_poperty_t property, int *value);
7138 * @brief Reads the Proximity alert level/properties for monitor role.
7140 * This function is a synchronous call.
7142 * @return BLUETOOTH_ERROR_NONE - Success \n
7143 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7144 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7145 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7148 * @param[in] device_address remote device address
7149 * @param[in] property proximity profile property
7150 * @param[out] value alert level/property value
7154 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7155 bluetooth_pxp_poperty_t property, int *value);
7158 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7159 * int *services_supported);
7161 * @brief Reads the Proximity Monitor profile supported properties/services.
7163 * This function is a synchronous call.
7165 * @return BLUETOOTH_ERROR_NONE - Success \n
7166 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7167 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7168 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7171 * @param[in] device_address remote device address
7172 * @param[out] services_supported proximity profile property/service
7176 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7177 int *services_supported);
7180 * @fn int bluetooth_proximity_reporter_register();
7182 * @brief Register all proximity related services in BlueZ.
7184 * This function is a synchronous call.
7186 * @return BLUETOOTH_ERROR_NONE - Success \n
7187 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7193 int bluetooth_proximity_reporter_register(void);
7196 * @fn int bluetooth_proximity_reporter_unregister();
7198 * @brief Unregister all proximity related services in BlueZ.
7200 * This function is a synchronous call.
7202 * @return BLUETOOTH_ERROR_NONE - Success \n
7203 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7209 int bluetooth_proximity_reporter_unregister(void);
7212 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7213 * bluetooth_pxp_poperty_t property, int *value);
7215 * @brief Reads the Proximity alert level/properties for reporter role.
7217 * This function is a synchronous call.
7219 * @return BLUETOOTH_ERROR_NONE - Success \n
7220 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7221 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7222 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7225 * @param[in] device_address remote device address
7226 * @param[in] property proximity profile property
7227 * @param[out] value alert level/property value
7231 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7232 bluetooth_pxp_poperty_t property, int *value);
7240 #endif /* __cplusplus */
7241 #endif /* _BLUETOOTH_API_H_*/