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;
1810 } bt_map_client_list_folders_filter_t;
1815 int8_t subject_length;
1824 } bt_map_client_list_messages_filter_t;
1827 char *message_object_name;
1832 char *sender_address;
1835 char *recipient_address;
1840 int64_t attachment_size;
1845 } bt_map_client_message_item_t;
1851 } bt_map_client_push_message_args_t;
1858 char *sender_address;
1861 char *recipient_address;
1870 } bt_map_client_message_t;
1873 char **names; // holding %size null-terminated folder names
1875 } bt_map_client_folders_s;
1878 bt_map_client_message_item_t *message_items;
1880 } bt_map_client_message_items_s;
1884 * Callback pointer type
1886 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1889 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1890 * @brief Set the callback function pointer for bluetooth event
1893 * This API will register the callback function, when any response and event are received from
1894 * bluetooth framework. @n
1895 * this registered callback function will be get called with appropriate event and data structures.
1896 * This function is a synchronous call. An application developer can call
1897 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1898 * type. This registered function will receive events of bluetooth_event_type_t type along with
1902 * @param[in] callback_ptr A pointer to the callback function
1903 * @param[in] user_data A pointer to user data
1904 * @return BLUETOOTH_ERROR_NONE - Success
1908 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1910 GMainLoop *main_loop = (GMainLoop*) user_data;
1914 // Code for each event
1916 g_main_loop_quit(main_loop);
1923 GMainLoop *main_loop = NULL;
1926 main_loop = g_main_loop_new(NULL, FALSE);
1927 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1928 if (ret >= BLUETOOTH_ERROR_NONE)
1930 // bluetooth_register_callback returned Success
1934 // bluetooth_register_callback returned failiure
1936 g_main_loop_run(main_loop);
1940 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1943 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1944 * @brief Set the callback function pointer for bluetooth le event
1947 * This API will register the callback function, when any response and event are received from
1948 * bluetooth framework. @n
1949 * this registered callback function will be get called with appropriate event and data structures.
1950 * This function is a synchronous call. An application developer can call
1951 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1952 * type. This registered function will receive events of bluetooth_event_type_t type along with
1956 * @param[in] callback_ptr A pointer to the callback function
1957 * @param[in] user_data A pointer to user data
1958 * @return BLUETOOTH_ERROR_NONE - Success
1962 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1965 * @fn int bluetooth_le_unregister_callback(void)
1966 * @brief Set the callback function pointer for bluetooth le event
1969 * This API will register the callback function, when any response and event are received from
1970 * bluetooth framework. @n
1971 * this registered callback function will be get called with appropriate event and data structures.
1972 * This function is a synchronous call. An application developer can call
1973 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1974 * type. This registered function will receive events of bluetooth_event_type_t type along with
1979 * @return BLUETOOTH_ERROR_NONE - Success
1983 int bluetooth_le_unregister_callback(void);
1986 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1987 * @brief Set the callback function pointer for bluetooth event
1990 * This API will register the callback function, when any response and event are received from
1991 * bluetooth framework. @n
1992 * this registered callback function will be get called with appropriate event and data structures.
1993 * This function is a synchronous call. An application developer can call
1994 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1995 * type. This registered function will receive events of bluetooth_event_type_t type along with
2000 * @return BLUETOOTH_ERROR_NONE - Success
2004 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2006 GMainLoop *main_loop = (GMainLoop*) user_data;
2010 // Code for each event
2012 g_main_loop_quit(main_loop);
2019 GMainLoop *main_loop = NULL;
2022 main_loop = g_main_loop_new(NULL, FALSE);
2023 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2024 if (ret >= BLUETOOTH_ERROR_NONE)
2026 // bluetooth_register_callback returned Success
2030 // bluetooth_register_callback returned failiure
2032 ret = bluetooth_deregister_callback(void);
2033 g_main_loop_run(main_loop);
2037 int bluetooth_unregister_callback(void);
2040 * @fn int bluetooth_enable_adapter(void)
2041 * @brief Enable the Bluetooth H/W
2044 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2045 * send request to bluetooth chip for activation.
2046 * This function is typically called at startup or when Bluetooth services are required. This
2047 * function must be called before calling any other API of Bluetooth operations.
2049 * Before performing any operations like Device discover, service search etc.., the adapter must be
2052 * This function is a asynchronous call.
2053 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2054 * through registered callback function with appropriate result code
2055 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2056 * BLUETOOTH_ERROR_NONE - Success \n
2058 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2059 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2061 * @return BLUETOOTH_ERROR_NONE - Success\n
2062 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2063 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2064 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2065 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2067 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2069 void bt_event_callback(int event, bluetooth_event_param_t *param)
2073 case BLUETOOTH_EVENT_ENABLED:
2074 if (param->result == BLUETOOTH_ERROR_NONE)
2076 // Successfully Enabled
2089 ret = bluetooth_enable_adapter();
2093 int bluetooth_enable_adapter(void);
2096 * @fn int bluetooth_disable_adapter(void)
2097 * @brief Disable the Bluetooth H/W
2100 * This function disables Bluetooth protocol stack and hardware. This function is called when
2101 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2103 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2104 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2105 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2107 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2110 * This function is a asynchronous call.
2111 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2112 * through registered callback function.
2115 * @return BLUETOOTH_ERROR_NONE - Success\n
2116 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2117 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2118 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2120 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2122 void bt_event_callback(int event, bluetooth_event_param_t *param)
2126 case BLUETOOTH_EVENT_DISABLED:
2127 if (param->result == BLUETOOTH_ERROR_NONE)
2129 // Successfully disabled
2142 ret = bluetooth_disable_adapter();
2145 int bluetooth_disable_adapter(void);
2146 int bluetooth_recover_adapter(void);
2147 int bluetooth_check_adapter_le(void);
2148 int bluetooth_enable_adapter_le(void);
2150 int bluetooth_disable_adapter_le(void);
2153 * @fn int bluetooth_reset_adapter(void)
2154 * @brief Reset the Bluetooth H/W and values
2157 * This function resets Bluetooth protocol stack and hardware. This function is called when
2158 * an user want to initialize Bluetooth environment.
2160 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2163 * This function is a synchronous call.
2165 * @return BLUETOOTH_ERROR_NONE - Success\n
2166 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2168 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2173 ret = bluetooth_reset_adapter();
2176 int bluetooth_reset_adapter(void);
2179 * @fn int bluetooth_is_supported(void)
2180 * @brief Check if the bluetooth is supported or not by the current target
2182 * This API checks whether the bluetooth is supported or not.
2183 * This API only run by root permission.
2185 * This function is a synchronous call.
2187 * @return 0 - if bluetooth is not supported\n
2188 * 1 - if bluetooth is supported\n
2189 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2194 ret = bluetooth_is_supported();
2197 int bluetooth_is_supported(void);
2201 * @fn int bluetooth_check_adapter(void)
2202 * @brief Check the current status of the Bluetooth adapter
2205 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2206 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2207 * bluetooth adapter.
2208 * This API get the adapter internal data structure and check current adapter status.
2210 * This function is a synchronous call.
2213 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2214 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2216 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2220 ret = bluetooth_check_adapter();
2223 int bluetooth_check_adapter(void);
2226 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2227 * @brief Get the local adapter bluetooth address
2230 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2231 * the adapter should be enabled.
2232 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2233 * contain Bluetooth address.
2234 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2235 * friendly name for each device.
2236 * There is no event callback for this API.
2238 * This function is a synchronous call.
2241 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2242 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2243 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2244 * @param[out] local_address a device address of local bluetooth adapter
2249 bluetooth_device_address_t local_address={0,};
2252 ret = bluetooth_get_local_address(&local_address);
2255 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2258 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2259 * @brief Get the hci version
2262 * This function is used to get the bluetooth hci version
2263 * Before calling this API make sure that the adapter is enabled.
2265 * This function is a synchronous call.
2268 * @return BLUETOOTH_ERROR_NONE - Success \n
2269 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2270 * @param[out] timeout remain visibility timeout value
2273 bluetooth_version_t *version;
2275 ret = bluetooth_get_local_version (&version);
2278 int bluetooth_get_local_version(bluetooth_version_t *version);
2281 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2282 * @brief Get the local device name
2285 * This function is used, get the local device name. Since its difficult to remember the Adapter
2286 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2287 * friendly name is retrived by the remote device and displaying.
2288 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2290 * This function is a synchronous call.
2293 * @return BLUETOOTH_ERROR_NONE - Success \n
2294 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2295 * @param[out] local_name a local device name
2299 bluetooth_device_name_t local_name={0,}
2301 ret = bluetooth_get_local_name (&local_name);
2304 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2307 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2308 * @brief Set the local device name
2311 * This function is used to set the local device name. This is a human friendly name whose
2312 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2314 * This function is a synchronous call.
2316 * @param[in] local_name bluetooth device name to set local device
2318 * @return BLUETOOTH_ERROR_NONE - Success \n
2319 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2320 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2321 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2322 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2323 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2328 bluetooth_device_name_t local_name={0,}
2330 ret = bluetooth_set_local_name (&local_name);
2333 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2337 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2338 * @brief Check if the uuid is used or not
2340 * This function is used to check if the uuid is used or not.
2342 * This function is a synchronous call.
2344 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2345 * @param[out] used if the uuid is used or not
2347 * @return BLUETOOTH_ERROR_NONE - Success \n
2348 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2349 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2350 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2355 gboolean used = FALSE;
2356 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2357 ret = bluetooth_is_service_used(uuid, &used);
2360 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2363 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2364 * @brief Check if the device is connected to the specific service
2366 * This function is used to check if if the device is connected to the specific service.
2368 * This function is a synchronous call.
2370 * @param[in] local_address a device address of remote bluetooth device
2371 * @param[in] type the service type
2372 * @param[out] is_connected if the device is connected or not
2374 * @return BLUETOOTH_ERROR_NONE - Success \n
2375 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2376 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2377 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2382 gboolean is_connected = FALSE;
2383 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2384 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2387 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2388 bluetooth_service_type_t type,
2389 gboolean *is_connected);
2392 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2393 * @brief Gets device's connected link type
2395 * This function is used to get device's connected link type
2397 * This function is a synchronous call.
2399 * @param[in] device_address a device address of remote bluetooth device
2400 * @param[out] connected_link a device's connected link type
2402 * @return BLUETOOTH_ERROR_NONE - Success \n
2403 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2404 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2405 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2410 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2411 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2412 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2415 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2416 bluetooth_connected_link_t *connected_link);
2419 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2420 * @brief Sets a profile trusted for a device
2422 * This function is used to Set a profile as trusted for a device
2424 * This function is a synchronous call.
2426 * @param[in] device_address a device address of remote bluetooth device
2427 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2428 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2430 * @return BLUETOOTH_ERROR_NONE - Success \n
2431 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2432 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2433 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2437 int bluetooth_set_profile_trusted(
2438 const bluetooth_device_address_t *device_address,
2439 int profile, int trust);
2442 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2443 * @brief Gets a profile is trusted for a device
2445 * This function is used to Get a profile is trusted or not for a device
2447 * This function is a synchronous call.
2449 * @param[in] device_address a device address of remote bluetooth device
2450 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2451 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2453 * @return BLUETOOTH_ERROR_NONE - Success \n
2454 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2455 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2456 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2460 int bluetooth_get_profile_trusted(
2461 const bluetooth_device_address_t *device_address,
2462 int profile, int *trust);
2465 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2466 * @brief Sets a profile restricted connection for a device
2468 * This function is used to Set a profile as restricted for a device
2470 * This function is a synchronous call.
2472 * @param[in] device_address a device address of remote bluetooth device
2473 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2474 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2476 * @return BLUETOOTH_ERROR_NONE - Success \n
2477 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2478 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2479 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2483 int bluetooth_set_profile_restricted(
2484 const bluetooth_device_address_t *device_address,
2485 int profile, int restricted);
2488 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2489 * @brief Gets a restricted connection state
2491 * This function is used to Get a profile is restricted or not for a device
2493 * This function is a synchronous call.
2495 * @param[in] device_address a device address of remote bluetooth device
2496 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2497 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2499 * @return BLUETOOTH_ERROR_NONE - Success \n
2500 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2501 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2502 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2506 int bluetooth_get_profile_restricted(
2507 const bluetooth_device_address_t *device_address,
2508 int profile, int *restricted);
2511 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2512 * @brief Get the visibility mode
2515 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2516 * visibity mode, the property of the device is determined whether it can be discoverable, non
2517 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2519 * This function is a synchronous call.
2522 * @return BLUETOOTH_ERROR_NONE - Success \n
2523 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2524 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2525 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2526 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2527 * @param[out] discoverable_mode current bluetooth discoverable mode
2529 * @see bluetooth_set_discoverable_mode
2531 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2533 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2536 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2539 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2541 * @brief Set the visibility mode
2544 * This function is used to set the discoverable mode (Visibility option).
2546 * Many times user may want to keep his device discoverable so that when peer device is performing
2547 * device search, he/she can find user's device. Application programmer can keep the mode as
2548 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2549 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2550 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2551 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2553 * This function is a synchronous call.
2555 * @return BLUETOOTH_ERROR_NONE - Success \n
2556 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2558 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2559 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2561 * @see bluetooth_get_discoverable_mode
2565 bluetooth_discoverable_mode_t mode;
2567 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2568 ret = bluetooth_set_discoverable_mode (mode, 180);
2572 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2577 * @fn int bluetooth_get_timeout_value(int *timeout)
2578 * @brief Get the visibility timeout value
2581 * This function is used to get the visibility timeout
2582 * Before calling this API make sure that the adapter is enabled.
2584 * This function is a synchronous call.
2587 * @return BLUETOOTH_ERROR_NONE - Success \n
2588 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2589 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2590 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2591 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2592 * @param[out] timeout remain visibility timeout value
2594 * @see bluetooth_set_discoverable_mode
2598 ret = bluetooth_get_timeout_value (&timeout);
2601 int bluetooth_get_timeout_value(int *timeout);
2605 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2606 * unsigned int classOfDeviceMask)
2607 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2609 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2610 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2611 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2612 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2613 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2614 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2615 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2616 * please see bluetooth_device_info_t for more details.
2619 * This API provides searching options like max responses, discovery duration in seconds and class
2620 * of device mask to filter device search. some times there may be too many bluetooth devices in
2621 * vicinity of your device.in such scenario, application can request to reduce number of responces
2622 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2623 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2624 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2625 * application defined time. please note that discovery_duration should be mentioned in seconds.
2626 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2629 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2630 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2631 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2633 * This function is a asynchronous call.
2634 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2635 * through registered callback function.
2637 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2638 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2640 * The completion or cancellation of the discovery is indicated by an
2641 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2643 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2646 * @return BLUETOOTH_ERROR_NONE - Success \n
2647 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2648 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2649 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2650 agent is not running \n
2652 * @param[in] max_response define the maximum response of the number of founded devices
2654 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2655 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2656 (refer to class of device)
2658 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2661 void bt_event_callback(int event, bluetooth_event_param_t *param)
2665 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2667 bluetooth_device_info_t *device_info = NULL;
2668 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2670 device_info = (bluetooth_device_info_t *)param->param_data;
2671 memcpy(&searched_device, &device_info->device_address,
2672 sizeof(bluetooth_device_address_t));
2673 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2674 device_info->device_address.addr[0],
2675 device_info->device_address.addr[1],
2676 device_info->device_address.addr[2],
2677 device_info->device_address.addr[3],
2678 device_info->device_address.addr[4],
2679 device_info->device_address.addr[5]);
2682 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2684 bluetooth_device_info_t *device_info = NULL;
2685 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2687 device_info = (bluetooth_device_info_t *)param->param_data;
2688 memcpy(&searched_device, &device_info->device_address,
2689 sizeof(bluetooth_device_address_t));
2690 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2691 device_info->device_name.name,
2692 device_info->device_address.addr[0],
2693 device_info->device_address.addr[1],
2694 device_info->device_address.addr[2],
2695 device_info->device_address.addr[3],
2696 device_info->device_address.addr[4],
2697 device_info->device_address.addr[5]);
2701 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2702 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2707 unsigned short max_response;
2708 unsigned short discovery_duration;
2709 unsigned classOfDeviceMask;
2713 discovery_duration =0;
2714 classOfDeviceMask =0;
2716 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2721 int bluetooth_start_discovery(unsigned short max_response,
2722 unsigned short discovery_duration,
2723 unsigned int classOfDeviceMask);
2726 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2727 * unsigned short max_response,
2728 * unsigned short discovery_duration,
2729 * unsigned int classOfDeviceMask)
2730 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2732 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2733 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2734 * Please see bluetooth_start_discovery() for other parameters description.
2736 * This function is a asynchronous call.
2737 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2738 * through registered callback function.
2740 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2741 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2743 * The completion or cancellation of the discovery is indicated by an
2744 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2746 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2749 * @return BLUETOOTH_ERROR_NONE - Success \n
2750 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2751 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2752 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2753 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2754 agent is not running \n
2756 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2757 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2758 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2759 * @param[in] max_response define the maximum response of the number of founded devices
2761 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2762 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2763 (refer to class of device)
2765 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2768 unsigned short type;
2769 unsigned short max_response;
2770 unsigned short discovery_duration;
2771 unsigned classOfDeviceMask;
2776 discovery_duration =0;
2777 classOfDeviceMask =0;
2779 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2784 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2785 unsigned short max_response,
2786 unsigned short discovery_duration,
2787 unsigned int classOfDeviceMask);
2790 * @fn int bluetooth_cancel_discovery (void)
2791 * @brief Cancel the on-going device discovery operation
2794 * This function stops the on-going device discovery operation. This API has to be called after the
2795 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2796 * the bluetooth_start_discovery API
2798 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2799 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2800 * cancel the discover request once the user received the device to which he wish to connect.
2802 * This function is a asynchronous call.
2803 * If the call is success to cancel discovey then the application will receive
2804 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2805 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2806 * BLUETOOTH_ERROR_NONE
2809 * @return BLUETOOTH_ERROR_NONE - Success \n
2810 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2811 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2812 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2813 other application \n
2814 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2816 * @see bluetooth_start_discovery
2818 void bt_event_callback(int event, bluetooth_event_param_t *param)
2822 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2823 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2832 ret = bluetooth_cancel_discovery();
2835 int bluetooth_cancel_discovery(void);
2838 * @fn int bluetooth_start_le_discovery(void)
2839 * @brief Start the generic device discovery which finds the LE devices.
2841 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2842 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2843 * It try to find LE devices. Bluetooth device address and name are
2844 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2845 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2846 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2847 * please see bluetooth_device_info_t for more details.
2849 * This function is a asynchronous call.
2850 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2851 * through registered callback function.
2853 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2856 * The completion or cancellation of the discovery is indicated by an
2857 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2859 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2862 * @return BLUETOOTH_ERROR_NONE - Success \n
2863 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2864 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2865 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2866 agent is not running \n
2869 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2872 void bt_event_callback(int event, bluetooth_event_param_t *param)
2876 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2878 bluetooth_device_info_t *device_info = NULL;
2879 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2881 device_info = (bluetooth_device_info_t *)param->param_data;
2882 memcpy(&searched_device, &device_info->device_address,
2883 sizeof(bluetooth_device_address_t));
2884 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2885 device_info->device_address.addr[0],
2886 device_info->device_address.addr[1],
2887 device_info->device_address.addr[2],
2888 device_info->device_address.addr[3],
2889 device_info->device_address.addr[4],
2890 device_info->device_address.addr[5]);
2894 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2895 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2901 ret = bluetooth_start_discovery();
2906 int bluetooth_start_le_discovery(void);
2909 * @fn int bluetooth_stop_le_discovery (void)
2910 * @brief Cancel the on-going device LE discovery operation
2913 * This function stops the on-going device discovery operation. This API has to be called after the
2914 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2915 * the bluetooth_start_le_discovery API
2918 * This function is a asynchronous call.
2919 * If the call is success to cancel discovey then the application will receive
2920 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2921 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2922 * BLUETOOTH_ERROR_NONE
2925 * @return BLUETOOTH_ERROR_NONE - Success \n
2926 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2927 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2928 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2929 other application \n
2930 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2932 * @see bluetooth_start_discovery
2934 void bt_event_callback(int event, bluetooth_event_param_t *param)
2938 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2939 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2948 ret = bluetooth_stop_le_discovery();
2951 int bluetooth_stop_le_discovery(void);
2954 * @fn int bluetooth_is_discovering(void)
2955 * @brief Check for the device discovery is in-progress or not.
2957 * This API is used to check the current status of the Discovery operation.If discovery is in\
2958 * progress normally other operations are not allowed.
2959 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2960 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2961 * event before performing other operations. This API is used to get for the current discovery
2962 * operation status and using bluetooth_cancel_discovery()
2963 * we can cancell the ongoing discovery process.
2964 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2967 * This function checks whether the device discovery is started or not.
2969 * This function is a synchronous call.
2972 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2973 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2974 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2977 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2981 ret = bluetooth_is_discovering ();
2984 int bluetooth_is_discovering(void);
2987 * @fn int bluetooth_is_le_discovering(void)
2988 * @brief Check for the device LE discovery is in-progress or not.
2990 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2991 * progress normally other operations are not allowed.
2992 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2993 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2994 * event before performing other operations. This API is used to get for the current discovery
2995 * operation status and using bluetooth_stop_le_discovery()
2996 * we can cancell the ongoing LE discovery process.
2997 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3000 * This function checks whether the device LE discovery is started or not.
3002 * This function is a synchronous call.
3005 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3006 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3007 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3010 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3014 ret = bluetooth_is_le_discovering ();
3017 int bluetooth_is_le_discovering(void);
3020 * @fn int bluetooth_is_le_scanning(void)
3021 * @brief Check for the device LE scan is in-progress or not.
3023 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3024 * progress normally other operations are not allowed.
3026 * This function checks whether the device LE Scan is started or not.
3028 * This function is a synchronous call.
3030 * @return TRUE - LE Scan in progress \n
3031 * FALSE - LE Scan is not in progress \n
3036 gboolean is_le_scanning = 0;
3037 is_le_scanning = bluetooth_is_le_scanning ();
3040 gboolean bluetooth_is_le_scanning(void);
3042 gboolean bluetooth_is_scan_filter_supported(void);
3045 * @fn int bluetooth_force_hcidump(int timeout)
3046 * @brief Enable /disable force-hcidump
3048 * This function control force-hcidump.
3050 * This function is a synchronous call.
3052 * @return BLUETOOTH_ERROR_NONE - Success \n
3053 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3054 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3056 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3061 int bluetooth_force_hcidump(int timeout);
3064 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3065 * @brief Register scan filter.
3067 * This function registers the scan filter.
3069 * This function is a synchronous call.
3071 * @return BLUETOOTH_ERROR_NONE - Success \n
3073 * @param[in] filter scan filter to register
3074 * @param[out] slot_id the slot ID of scan filter
3078 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3081 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3082 * @brief Register scan filter.
3084 * This function unregisters the scan filter.
3086 * This function is a synchronous call.
3088 * @return BLUETOOTH_ERROR_NONE - Success \n
3090 * @param[in] slot_id the slot ID of scan filter
3094 int bluetooth_unregister_scan_filter(int slot_id);
3097 * @fn int bluetooth_unregister_all_scan_filters(void)
3098 * @brief Register scan filter.
3100 * This function usregisters all scan filters.
3102 * This function is a synchronous call.
3104 * @return BLUETOOTH_ERROR_NONE - Success \n
3108 int bluetooth_unregister_all_scan_filters(void);
3111 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3112 int link_type, bt_rssi_threshold_t rssi_threshold)
3113 * @brief Enable RSSI monitoring
3115 * This function enables RSSI monitoring and sets threshold for a connection
3117 * @return BLUETOOTH_ERROR_NONE - Success \n
3120 * @see bluetooth_get_rssi_strength
3122 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3123 int link_type, bt_rssi_threshold_t *rssi_threshold);
3126 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3127 * @brief Gets Raw RSSI signal Strength
3129 * This function gives the Raw RSSI signal strength for a connection.
3131 * @return BLUETOOTH_ERROR_NONE - Success \n
3134 * @see bluetooth_enable_rssi
3136 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3138 int bluetooth_set_connectable(gboolean is_connectable);
3140 int bluetooth_is_connectable(gboolean *is_connectable);
3143 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3144 * @brief Initiate a bonding process
3147 * This function initiates a bonding procedure with a peer device. The bonding procedure
3148 * enables authentication and optionally encryption on the Bluetooth link.
3150 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3151 * inititate the bonding request to the devices already in the paired list.
3153 * Usually we call this API after the device discovery.
3154 * This function is a asynchronous call.
3156 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3157 * mentioed result code
3158 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3159 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3160 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3161 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3162 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3164 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3165 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3168 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3171 * @return BLUETOOTH_ERROR_NONE - Success \n
3172 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3173 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3174 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3175 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3177 * @param[in] device_address This indicates an address of the device with which the pairing
3178 * should be initiated
3180 * @see bluetooth_cancel_bonding
3182 void bt_event_callback(int event, bluetooth_event_param_t *param)
3186 case BLUETOOTH_EVENT_BONDING_FINISHED:
3188 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3189 if (param->result >= BLUETOOTH_ERROR_NONE)
3191 bluetooth_device_info_t *device_info = NULL;
3192 device_info = (bluetooth_device_info_t *)param->param_data;
3193 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3194 mjr[%#x] min[%#x] srv[%#x]",
3195 device_info->device_name.name,
3196 device_info->device_address.addr[0],
3197 device_info->device_address.addr[1],
3198 device_info->device_address.addr[2],
3199 device_info->device_address.addr[3],
3200 device_info->device_address.addr[4],
3201 device_info->device_address.addr[5],
3202 device_info->device_class.major_class,
3203 device_info->device_class.minor_class,
3204 device_info->device_class.service_class);
3218 bluetooth_device_address_t device_address={{0}};
3220 ret = bluetooth_bond_device(&device_address);
3224 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3227 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3228 * bluetooth_conn_type_t conn_type)
3229 * @brief Initiate a bonding process
3232 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3233 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3235 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3236 * inititate the bonding request to the devices already in the paired list.
3238 * Usually we call this API after the device discovery.
3239 * This function is a asynchronous call.
3241 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3242 * mentioed result code
3243 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3244 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3245 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3246 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3247 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3249 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3250 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3253 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3256 * @return BLUETOOTH_ERROR_NONE - Success \n
3257 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3258 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3259 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3260 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3262 * @param[in] device_address This indicates an address of the device with which pairing
3263 * should be initiated
3264 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3267 * @see bluetooth_cancel_bonding
3269 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3270 bluetooth_conn_type_t conn_type);
3273 * @fn int bluetooth_cancel_bonding(void)
3274 * @brief Cancel the on-going bonding process
3276 * This API is called to cancel the on-going bonding procedure. It should be called before the
3277 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3278 * This API is useful when the remote device is not responding to the bond request or we wish to
3279 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3281 * This function is a synchronous call.
3283 * @return BLUETOOTH_ERROR_NONE - Success \n
3284 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3285 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3288 * @see bluetooth_bond_device
3294 ret = bluetooth_cancel_bonding();
3297 int bluetooth_cancel_bonding(void);
3300 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3301 * @brief Remove bonding
3304 * To communicate with remote device over bluetooth link, user should bond with peer device.
3305 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3306 * API is used to remove peer device from the list. Please note that after removing the device
3307 * from bonded device list, you cannot communication with peer device until bonding happens again.
3309 * User can call this function by passing bluetooth device address of any bonded device. Please note
3310 * that after successful return of this function, any bluetooth application running on your device
3311 * will not be able to communicate with unbonded device until bond operation happens again using
3312 * bluetooth_bond_device()
3315 * This function is a asynchronous call. The request to remove the specified device from the bonded
3316 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3317 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3318 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3322 * @return BLUETOOTH_ERROR_NONE - Success \n
3323 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3324 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3325 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3326 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3327 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3328 * agent is not running \n
3329 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3332 * @param[in] device_address This indicates an address of the device to remove bonding
3336 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3339 void bt_event_callback(int event, bluetooth_event_param_t *param)
3342 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3343 bluetooth_device_address_t *dev_addr = NULL;
3345 if (param->result == BLUETOOTH_ERROR_NONE) {
3346 dev_addr = (bluetooth_device_address_t *)param->param_data;
3348 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3349 dev_addr->addr[0], dev_addr->addr[1]
3350 dev_addr->addr[2], dev_addr->addr[3]
3351 dev_addr->addr[4], dev_addr->addr[5]
3362 bluetooth_device_address_t *device_address;
3364 // copy valid device address in device_address
3366 ret = bluetooth_unbond_device(device_address);
3369 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3372 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3373 * @brief Get bonded(paired) device list
3376 * This API gets all bonded device list.
3377 * The devices in the bonded device list further can be used to perform the authorization by calling
3378 * bluetooth_authorize_device API.
3380 * This function is a synchronous call.
3381 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3382 * there is no valid information in the dev_list.
3383 * The len field in the dev_list represents the number of bonded devices. The data structure for
3384 * bonded device information is bluetooth_device_info_t.
3387 * @return BLUETOOTH_ERROR_NONE - Success \n
3388 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3390 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3392 void bt_get_bonded_devices(void)
3396 GPtrArray *devinfo = NULL;
3397 bluetooth_device_info_t *ptr;
3399 // allocate the g_pointer_array
3400 devinfo = g_ptr_array_new();
3402 ret = bluetooth_get_bonded_device_list(&devinfo);
3403 if (ret != BLUETOOTH_ERROR_NONE)
3405 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3409 printf("g pointer arrary count : [%d]", devinfo->len);
3410 for (i=0; i<devinfo->len; i++)
3412 ptr = g_ptr_array_index(devinfo, i);
3415 printf("Name [%s]\n", ptr->device_name.name);
3416 printf("Major Class [%d]\n", ptr->device_class.major_class);
3417 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3418 printf("Service Class [%d]\n", ptr->device_class.service_class);
3419 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3420 ptr->device_address.addr[0],
3421 ptr->device_address.addr[1], ptr->device_address.addr[2],
3422 ptr->device_address.addr[3],
3423 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3430 // free g_pointer_array
3431 g_ptr_array_free(devinfo, TRUE);
3436 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3438 int bluetooth_get_profile_connected_device_list(
3439 const char *profile_uuid, GPtrArray **addr_list);
3442 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3443 * bluetooth_device_info_t *dev_info)
3444 * @brief Get a bonded(paired) device
3447 * This API gets a bonded device.
3449 * This function is a synchronous call.
3450 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3451 * there is no valid information in the dev_info.
3452 * The data structure for bonded device information is bluetooth_device_info_t.
3455 * @return BLUETOOTH_ERROR_NONE - Success \n
3456 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3458 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3460 void bt_get_bonded_device(void)
3464 bluetooth_device_info_t devinfo = {0};
3465 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3467 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3468 if (ret != BLUETOOTH_ERROR_NONE)
3470 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3474 printf("Name [%s]\n", devinfo.device_name.name);
3475 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3476 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3477 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3478 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3479 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3480 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3481 devinfo.device_address.addr[5]);
3490 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3491 bluetooth_device_info_t *dev_info);
3495 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3496 * gboolean *is_alias_set)
3497 * @brief Get is_alias_set property of device
3499 * This API gets is_alias_set property of a bonded device.
3501 * This function is a synchronous call.
3502 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3503 * If not,there is no valid information in the is_alias_set.
3505 * @return BLUETOOTH_ERROR_NONE - Success \n
3506 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3511 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3513 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3516 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3517 gboolean *is_alias_set);
3520 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3521 * @brief set alias for bonded device
3524 * This function set alias for bonded device.
3526 * This function is a synchronous call.
3529 * @return BLUETOOTH_ERROR_NONE - Success \n
3530 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3531 * @param[in] device_address This indicates an address of the remote device
3532 * @param[in] alias This indicates an alias to set
3537 ret = bluetooth_set_alias(&remote_address);
3540 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3544 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3545 * @brief Get remote deivice
3548 * This function gets specific remote device.
3550 * This function is a asynchronous call.
3551 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3554 * @return BLUETOOTH_ERROR_NONE - Success \n
3555 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3556 * @param[in] device_address This indicates an address of the remote device
3561 ret = bluetooth_get_remote_device(&remote_address);
3564 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3567 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3568 * gboolean authorized)
3569 * @brief Authorize/Unauthorize a bonded device
3572 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3573 * with/without user confirmation.
3575 * If we select a paired device and make it authorized by calling this API with the authorized
3576 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3577 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3578 * then it will ask for the user conformation before the connection.
3580 * This API supposed to be called on the paired devices. Which means we have to use this API only
3581 * after successful pairing.
3583 * This function is a asynchronous call.
3584 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3586 * @return BLUETOOTH_ERROR_NONE - Success \n
3587 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3588 * @param[in] device_address This indicates an address of the device to authorize \n
3589 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3591 * @see bluetooth_get_bonded_device_list
3593 void bt_event_callback(int event, bluetooth_event_param_t *param)
3597 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3599 if (param->result == BLUETOOTH_ERROR_NONE)
3603 //device authorization failed failure
3611 bluetooth_device_address_t device_address={{0}};
3612 gboolean authorized;
3616 ret = bluetooth_authorize_device(&device_address,authorized);
3619 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3620 gboolean authorized);
3622 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3623 const bluetooth_device_pin_code_t *pin_code);
3625 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3628 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3630 * @brief Receives Legacy Passkey\pin with following authentication response types
3632 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3633 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3636 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3639 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3641 * @brief This API sends user confirmation reply to the local adapter.
3643 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3646 int bluetooth_passkey_confirmation_reply(gboolean reply);
3649 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3650 * @brief Get all services supported by remote device
3653 * This API call initiates the search for the services supported by the specified device. Normally
3654 * the service search will take a couple of seconds to get it completed. Before calling this API
3655 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3656 * perform the service search. We can get the device address by doing a device discovery operation.
3659 * This function is a asynchronous call.
3660 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3662 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3663 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3664 * event is generated with appropriate result code.
3666 * @return BLUETOOTH_ERROR_NONE - Success \n
3667 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3668 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3669 * @param[in] device_address This indicates an address of the device
3670 * whose services need to be found
3672 * @see bluetooth_cancel_service_search
3674 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3677 * @fn int bluetooth_cancel_service_search(void)
3678 * @brief Cancel the ongoing service search operation
3681 * This function cancel the ongoing service search operation. This API is usually calling after the
3682 * bluetooth_search_service API.
3683 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3684 * if the user wish to cancel the Ongoing service search operation.
3686 * This API should be called just after the bluetooth_search_service API and before the
3687 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3689 * This function is a synchronous call.
3691 * @return BLUETOOTH_ERROR_NONE - Success \n
3692 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3693 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3694 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3697 * @see bluetooth_search_service
3702 ret = bluetooth_cancel_service_search();
3705 int bluetooth_cancel_service_search(void);
3708 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3709 * @brief Register rfcomm socket with a specific uuid
3712 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3713 * descriptor of the server.
3714 * This is the first API which is called to create the server. Once we created the server socket,
3715 * we will listen on that return socket.
3716 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3719 * @return socket FD on Success \n
3720 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3721 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3722 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3723 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3724 * @param[in] UUID (128 bits)
3727 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3731 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3732 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3736 int bluetooth_rfcomm_create_socket(const char *uuid);
3739 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3740 * @brief Register rfcomm socket with a specific uuid
3743 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3744 * descriptor of the server.
3745 * This is the first API which is called to create the server. Once we created the server socket,
3746 * we will listen on that return socket.
3747 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3750 * @return socket FD on Success \n
3751 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3752 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3753 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3754 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3755 * @param[in] UUID (128 bits)
3756 * @param[in] bus_name (const char)
3757 * @param[in] path (const char)
3760 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3764 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3765 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3769 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3772 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3773 * @brief De-register the rfcomm socket
3776 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3777 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3778 * descriptor else no event will come. We will call this API only after the
3779 * bluetooth_rfcomm_listen_and_accept.
3780 * This is a synchronous call.
3782 * @return BLUETOOTH_ERROR_NONE - Success \n
3783 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3784 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3785 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3786 * @param[in] int socket_fd
3789 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3792 void bt_event_callback(int event, bluetooth_event_param_t *param)
3796 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3798 bluetooth_rfcomm_connection_t *discon_ind =
3799 (bluetooth_rfcomm_connection_t *)param->param_data;
3801 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3809 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3810 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3812 ret = bluetooth_rfcomm_remove_socket(fd);
3815 int bluetooth_rfcomm_remove_socket(int socket_fd);
3818 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3819 * @brief De-register the rfcomm socket
3822 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3823 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3824 * descriptor else no event will come. We will call this API only after the
3825 * bluetooth_rfcomm_listen_and_accept_ex.
3826 * This is a synchronous call.
3828 * @return BLUETOOTH_ERROR_NONE - Success \n
3829 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3830 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3831 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3832 * @param[in] UUID (128 bits)
3835 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3838 void bt_event_callback(int event, bluetooth_event_param_t *param)
3842 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3844 bluetooth_rfcomm_connection_t *discon_ind =
3845 (bluetooth_rfcomm_connection_t *)param->param_data;
3847 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3855 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3856 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3858 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3861 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3864 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3865 * @brief Disconnect rfcomm connection
3868 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3869 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3872 * @return BLUETOOTH_ERROR_NONE - Success \n
3873 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3874 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3875 * @param[in] int socket_fd the sending socket fd
3881 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3883 printf("Disconnection failed");
3885 printf("Disconnection Success");
3889 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3892 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3893 * @brief Rfcomm socket listen
3896 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3897 * after the bluetooth_rfcomm_create_socket API.
3898 * This API listen for the incomming connection and once it receives a connection, it will give
3899 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3900 * event to the application. This is an Asynchronous API call.
3903 * @return BLUETOOTH_ERROR_NONE - Success \n
3904 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3905 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3907 * @param[in] int socket_fd
3908 * @param[in] max pending connection.
3911 * @see bluetooth_rfcomm_create_socket
3914 void bt_event_callback(int event, bluetooth_event_param_t* param)
3918 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3920 bluetooth_rfcomm_connection_t *conn_ind =
3921 (bluetooth_rfcomm_connection_t *)param->param_data;
3923 printf("\nConnected from FD %d", conn_ind->socket_fd);
3931 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3932 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3936 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3939 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3940 * @brief Rfcomm socket listen
3943 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3944 * after the bluetooth_rfcomm_create_socket API.
3945 * This API listen for the incomming connection and once it receives a connection, it will give
3946 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3947 * event to the application. This is an Asynchronous API call.
3950 * @return BLUETOOTH_ERROR_NONE - Success \n
3951 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3952 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3954 * @param[in] int socket_fd
3955 * @param[in] max pending connection.
3960 * @see bluetooth_rfcomm_create_socket_ex
3963 void bt_event_callback(int event, bluetooth_event_param_t* param)
3967 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3969 bluetooth_rfcomm_connection_t *conn_ind =
3970 (bluetooth_rfcomm_connection_t *)param->param_data;
3972 printf("\nConnected from FD %d", conn_ind->socket_fd);
3980 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3981 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3986 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3989 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3990 * @brief Rfcomm socket listen
3993 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3994 * after the bluetooth_rfcomm_create_socket API.
3995 * This API listen for the incomming connection and once it receives a connection, it will give
3996 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3997 * event to the application. This is an Asynchronous API call.
4000 * @return BLUETOOTH_ERROR_NONE - Success \n
4001 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4002 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4004 * @param[in] int socket_fd
4005 * @param[in] max pending connection.
4008 * @see bluetooth_rfcomm_create_socket
4011 void bt_event_callback(int event, bluetooth_event_param_t* param)
4015 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4017 char *name = (char *)param->param_data;
4019 printf("\nConnected from %s", name);
4021 bluetooth_rfcomm_accept_connection();
4029 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4030 ret = bluetooth_rfcomm_listen(fd, 1);
4034 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4037 * @fn int bluetooth_rfcomm_accept_connection()
4038 * @brief Accepts the authorization request indicated by the event
4039 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4041 * This function is a synchronous call.
4043 * @return BLUETOOTH_ERROR_NONE - Success \n
4044 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4046 * @param[in] the socket fd of the server
4047 * @param[out] the socket fd of the client
4051 * @see bluetooth_rfcomm_reject_connection
4053 int bluetooth_rfcomm_accept_connection(int server_fd);
4056 * @fn int bluetooth_rfcomm_reject_connection()
4057 * @brief Rejects the authorization request indicated by the event
4058 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4060 * This function is a synchronous call.
4062 * @return BLUETOOTH_ERROR_NONE - Success \n
4063 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4065 * @param[in] the socket fd of the server
4069 * @see bluetooth_rfcomm_accept_connection
4071 int bluetooth_rfcomm_reject_connection(int server_fd);
4074 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4075 * @brief Informs whether rfcomm server uuid is available or not.
4077 * This function is a synchronous call.
4079 * @return TRUE - RFCOMM uuid is available \n
4080 * FALSE - RFCOMM uuid is not available \n
4082 * @param[in] uuid UUID string
4088 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4091 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4092 * const char *remote_uuid)
4093 * @brief Connect to the remote device rfcomm *
4095 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4096 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4097 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4098 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4099 * initiating a connection.
4101 * @return BLUETOOTH_ERROR_NONE - Success \n
4102 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4103 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4104 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4105 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4106 * @param[in] bluetooth_device_address_t remote bt_address
4107 * @param[in] char remote uuid
4109 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4113 void bt_event_callback(int event, bluetooth_event_param_t *param)
4117 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4119 if (param->result >= BLUETOOTH_ERROR_NONE)
4121 bt_sdp_info_t *bt_sdp_info=param->param_data;
4123 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4124 bt_sdp_info->device_addr.addr[0],
4125 bt_sdp_info->device_addr.addr[1],
4126 bt_sdp_info->device_addr.addr[2],
4127 bt_sdp_info->device_addr.addr[3],
4128 bt_sdp_info->device_addr.addr[4],
4129 bt_sdp_info->device_addr.addr[5]);
4131 printf("Supported service list:\n");
4132 for(i=0; i<bt_sdp_info->service_index; i++)
4134 bt_sdp_info->service_list_array[i]);
4137 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4138 //rfcomm_test_uuid);
4142 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4144 bluetooth_rfcomm_connection_t *conn_ind =
4145 (bluetooth_rfcomm_connection_t *)param->param_data;
4147 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4148 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4149 "SERVER" : "CLIENT");
4154 bluetooth_device_address_t remote_address = {{0},};
4155 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4156 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4157 ret = bluetooth_search_service(&remote_address);
4159 printf("Seach failed, Reason = %d", ret);
4161 printf("Search Success, Ret = %d", ret);
4163 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4165 printf("Connection failed, Reason = %d", ret);
4167 printf("Connection Success, Ret = %d", ret);
4171 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4172 const char *remote_uuid);
4175 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4176 * @brief Disconnect rfcomm connection
4179 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4180 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4183 * @return BLUETOOTH_ERROR_NONE - Success \n
4184 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4185 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4186 * @param[in] char remote bt_address
4189 * @see bluetooth_rfcomm_connect
4193 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4195 printf("Disconnection failed");
4197 printf("Disconnection Success");
4202 int bluetooth_rfcomm_disconnect(int socket_fd);
4205 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4206 * @brief Write to rfcomm connection
4209 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4210 * API is used to send the data for server and the client.
4212 * @return BLUETOOTH_ERROR_NONE - Success \n
4213 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4214 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4216 * @param[in] const char *buff Data buffer to send
4217 * @param[in] int length Length of the data
4220 * @see bluetooth_rfcomm_connect
4223 char *buff = "Test data 123456789"
4224 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4226 printf("Send failed");
4228 printf("Send success");
4232 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4235 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4236 * @brief Informs whether rfcomm client is connected.
4238 * This function is a synchronous call.
4240 * @return TRUE - RFCOMM client is connected \n
4241 * FALSE - RFCOMM client is not connected \n
4247 gboolean bluetooth_rfcomm_is_client_connected(void);
4248 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4249 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4252 * @fn int bluetooth_network_activate_server(void)
4253 * @brief Activate the NAP (Network Access Point) service
4255 * This function is a asynchronous call.
4256 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4258 * @return BLUETOOTH_ERROR_NONE - Success \n
4259 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4260 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4261 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4264 * @see bluetooth_network_deactivate_server
4267 int bluetooth_network_activate_server(void);
4270 * @fn int bluetooth_network_deactivate_server(void)
4271 * @brief Deactivate the NAP (Network Access Point) service
4273 * This function is a asynchronous call.
4274 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4276 * @return BLUETOOTH_ERROR_NONE - Success \n
4277 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4278 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4279 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4282 * @see bluetooth_network_activate_server
4285 int bluetooth_network_deactivate_server(void);
4288 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4289 * bluetooth_network_role_t role,
4291 * @brief Connect the network server in the peer
4293 * This function is a asynchronous call.
4294 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4296 * @return BLUETOOTH_ERROR_NONE - Success \n
4297 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4298 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4299 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4302 * @param[in] device_address This indicates an address of the device with which the pairing
4303 * should be initiated
4304 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4305 * need to use the third parameter.
4306 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4307 * connect. UUID string
4309 * @see bluetooth_network_disconnect
4311 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4312 bluetooth_network_role_t role, char *custom_uuid);
4315 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4316 * bluetooth_network_role_t role,
4317 * char *custom_uuid)
4318 * @brief Connect the network server in the peer
4320 * This function is a asynchronous call.
4321 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4323 * @return BLUETOOTH_ERROR_NONE - Success \n
4324 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4325 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4326 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4329 * @param[in] device_address This indicates an address of the device with which the pairing
4330 * should be initiated
4332 * @see bluetooth_network_connect
4334 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4337 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4338 * @brief Disconnect the device from the network
4340 * This function is an asynchronous call.
4341 * The network server disconnect request is responded by
4342 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4344 * @return BLUETOOTH_ERROR_NONE - Success \n
4345 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4346 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4347 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4350 * @param[in] device_address This indicates an address of the connected client device
4352 * @see bluetooth_network_activate_server
4354 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4359 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4360 * bt_hdp_role_type_t role,
4361 * bt_hdp_qos_type_t channel_type,
4362 * char **app_handle)
4363 * @brief Activate the HDP service for a particular data type
4365 * This function is a synchronous call.
4367 * @return BLUETOOTH_ERROR_NONE - Success \n
4368 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4369 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4370 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4373 * @param[in] data_type The data type against corresponding service
4374 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4375 * @param[in] channel_type The QOS type for the channel.
4376 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4377 * For role = HDP_ROLE_SINK, the channel_type
4378 * should be HDP_QOS_ANY.
4379 * @param[out] app_handle The application handler against corresponding service
4381 * @see bluetooth_hdp_deactivate
4383 int bluetooth_hdp_activate(unsigned short data_type,
4384 bt_hdp_role_type_t role,
4385 bt_hdp_qos_type_t channel_type,
4388 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4389 * @brief Deactivate the HDP service for a particular service using the handler
4391 * This function is a synchronous call.
4393 * @return BLUETOOTH_ERROR_NONE - Success \n
4394 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4395 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4396 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4399 * @param[in] app_handle The application handler against corresponding service
4401 * @see bluetooth_hdp_deactivate
4403 int bluetooth_hdp_deactivate(const char *app_handle);
4406 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4407 * const char *buffer, unsigned int size)
4408 * @brief Send data to the remote HDP device
4410 * This function is a synchronous call.
4412 * @return BLUETOOTH_ERROR_NONE - Success \n
4413 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4414 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4415 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4416 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4419 * @param[in] channel_id The channel id for the connection.
4420 * @param[in] buffer The pdu buffer.
4421 * @param[in] size Size of the buffer.
4423 * @see bluetooth_hdp_connect
4425 int bluetooth_hdp_send_data(unsigned int channel_id,
4426 const char *buffer, unsigned int size);
4428 * @fn int bluetooth_hdp_connect(const char *app_handle,
4429 * bt_hdp_qos_type_t channel_type,
4430 * const bluetooth_device_address_t *device_address)
4431 * @brief Connect to the remote device(Mainly used by source)
4433 * This function is a asynchronous call.
4434 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4436 * @return BLUETOOTH_ERROR_NONE - Success \n
4437 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4438 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4439 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4440 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4443 * @param[in] app_handle The application handler against corresponding service
4444 * @param[in] channel_type The QOS type for the channel.
4445 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4446 * @param[in] device_address The remote device Bd address.
4449 * @see bluetooth_hdp_disconnect
4451 int bluetooth_hdp_connect(const char *app_handle,
4452 bt_hdp_qos_type_t channel_type,
4453 const bluetooth_device_address_t *device_address);
4455 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4456 * const bluetooth_device_address_t *device_address)
4457 * @brief Disconnect from the remote device(Mainly used by source)
4459 * This function is a asynchronous call.
4460 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4462 * @return BLUETOOTH_ERROR_NONE - Success \n
4463 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4464 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4465 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4466 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4469 * @param[in] channel_id The channel id for the connection.
4470 * @param[in] device_address The remote device Bd address.
4473 * @see bluetooth_hdp_connect
4475 int bluetooth_hdp_disconnect(unsigned int channel_id,
4476 const bluetooth_device_address_t *device_address);
4480 * @fn int bluetooth_opc_init(void)
4481 * @brief Initialize OPP client.
4483 * This function is a synchronous call.
4484 * No event corresponding to this api
4486 * @return BLUETOOTH_ERROR_NONE - Success \n
4487 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4488 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4489 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4490 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4495 * @see bluetooth_opc_deinit
4497 int bluetooth_opc_init(void);
4500 * @fn int bluetooth_opc_deinit(void)
4501 * @brief Deinitialize OPP client.
4503 * This function is a synchronous call.
4504 * No event corresponding to this api
4506 * @return BLUETOOTH_ERROR_NONE - Success \n
4507 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4508 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4513 * @see bluetooth_opc_init
4516 int bluetooth_opc_deinit(void);
4519 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4520 char **file_name_array)
4521 * @brief Send multiple files to a remote device.
4523 * This function is a asynchronous call.
4524 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4526 * @return BLUETOOTH_ERROR_NONE - Success \n
4527 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4528 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4529 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4530 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4531 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4532 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4535 * @param[in] device_address The remote device Bd address.
4536 * @param[in] file_name_array Array of filepaths to be sent.
4539 * @see bluetooth_opc_cancel_push
4542 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4543 char **file_name_array);
4546 * @fn int bluetooth_opc_cancel_push(void)
4547 * @brief Cancels the ongoing file push.
4549 * This function is a asynchronous call.
4550 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4551 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4553 * @return BLUETOOTH_ERROR_NONE - Success \n
4554 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4555 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4560 * @see bluetooth_opc_push_files
4563 int bluetooth_opc_cancel_push(void);
4566 * @fn gboolean bluetooth_opc_session_is_exist(void)
4567 * @brief Informs whether opc session exists or not.
4569 * This function is a synchronous call.
4571 * @return TRUE - OPC session exists \n
4572 * FALSE - OPC session does not exist \n
4580 gboolean bluetooth_opc_session_is_exist(void);
4583 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4584 * @brief Informs whether opc session exists or not.
4586 * This function is a synchronous call.
4588 * @return BLUETOOTH_ERROR_NONE - Success \n
4589 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4590 * BLUETOOTH_ERROR_INTERNAL \n
4593 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4598 int bluetooth_opc_is_sending(gboolean *is_sending);
4601 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4602 int transfer_id, unsigned char *progress)
4603 * @brief Gets the percentage progress for ongoing transfers.
4605 * This function is a synchronous call.
4607 * @return BLUETOOTH_ERROR_NONE - Success \n
4608 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4609 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4612 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4613 * @param[in] transfer_id Transfer ID
4614 * @param[out] progress Percentage Progress
4618 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4619 int transfer_id, unsigned char *progress);
4622 * @fn int bluetooth_obex_server_init(const char *dst_path)
4623 * @brief Initialize OPP and FTP server.
4625 * This function is a synchronous call.
4626 * No event corresponding to this api
4628 * @return BLUETOOTH_ERROR_NONE - Success \n
4629 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4630 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4631 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4632 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4635 * @param[in] dst_path OPS destination file path.
4637 * @see bluetooth_obex_server_deinit
4639 int bluetooth_obex_server_init(const char *dst_path);
4643 * @fn int bluetooth_obex_server_deinit(void)
4644 * @brief Deinitialize OPP and FTP server.
4646 * This function is a synchronous call.
4647 * No event corresponding to this api
4649 * @return BLUETOOTH_ERROR_NONE - Success \n
4650 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4651 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4656 * @see bluetooth_obex_server_init
4658 int bluetooth_obex_server_deinit(void);
4662 * @fn gboolean bluetooth_obex_server_is_activated(void)
4663 * @brief Informs whether obex server is activated or not.
4665 * This function is a synchronous call.
4667 * @return TRUE - OBEX server is activated \n
4668 * FALSE - OBEX server is not activated \n
4675 gboolean bluetooth_obex_server_is_activated(void);
4679 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4680 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4682 * This function is a synchronous call.
4683 * No event corresponding to this api
4685 * @return BLUETOOTH_ERROR_NONE - Success \n
4686 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4687 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4688 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4689 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4693 * @param[in] dst_path OPS destination file path.
4695 * @see bluetooth_obex_server_deinit_without_agent
4697 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4701 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4702 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4704 * This function is a synchronous call.
4705 * No event corresponding to this api
4707 * @return BLUETOOTH_ERROR_NONE - Success \n
4708 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4709 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4714 * @see bluetooth_obex_server_init_without_agent
4716 int bluetooth_obex_server_deinit_without_agent(void);
4720 * @fn int bluetooth_obex_server_accept_connection(void)
4721 * @brief Accepts the authorization request indicated by the event
4722 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4724 * This function is a synchronous call.
4726 * @return BLUETOOTH_ERROR_NONE - Success \n
4727 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4728 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4732 * @see bluetooth_obex_server_reject_authorize
4734 int bluetooth_obex_server_accept_connection(void);
4738 * @fn int bluetooth_obex_server_reject_connection(void)
4739 * @brief Rejects the authorization request indicated by the event
4740 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4742 * This function is a synchronous call.
4744 * @return BLUETOOTH_ERROR_NONE - Success \n
4745 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4746 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4750 * @see bluetooth_obex_server_reject_authorize
4752 int bluetooth_obex_server_reject_connection(void);
4756 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4757 * @brief Accepts the authorization request indicated by the event
4758 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4760 * This function is a asynchronous call.
4761 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4763 * @return BLUETOOTH_ERROR_NONE - Success \n
4764 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4765 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4766 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4769 * @param[in] filename Authorized filename.
4772 * @see bluetooth_obex_server_reject_authorize
4775 int bluetooth_obex_server_accept_authorize(const char *filename);
4778 * @fn int bluetooth_obex_server_reject_authorize(void)
4779 * @brief Reject the authorization request indicated by the event
4780 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4782 * This function is a asynchronous call.
4783 * No event for this api..
4785 * @return BLUETOOTH_ERROR_NONE - Success \n
4786 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4787 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4792 * @see bluetooth_obex_server_accept_authorize
4795 int bluetooth_obex_server_reject_authorize(void);
4798 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4799 * @brief Set the OPS destination file path..
4801 * This function is a asynchronous call.
4802 * No event for this api..
4804 * @return BLUETOOTH_ERROR_NONE - Success \n
4805 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4806 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4807 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4810 * @param[in] dst_path OPS destination file path.
4816 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4819 * @fn int bluetooth_obex_server_set_root(const char *root)
4820 * @brief Set the FTS root folder..
4822 * This function is a asynchronous call.
4823 * No event for this api..
4825 * @return BLUETOOTH_ERROR_NONE - Success \n
4826 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4827 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4828 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4829 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4830 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4833 * @param[in] root FTS root folder.
4839 int bluetooth_obex_server_set_root(const char *root);
4842 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4843 * @brief Cancel the transfer on server
4845 * This function is an asynchronous call.
4846 * If the function call that cancels transfer is successful, the application would receive
4847 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4848 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4849 * the error code will be BLUETOOTH_ERROR_NONE
4851 * @return BLUETOOTH_ERROR_NONE - Success \n
4852 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4853 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4854 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4855 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4858 * @param[in] transfer_id transfer ID
4863 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4867 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4868 * @brief Cancel the transfer on server
4870 * This function is an asynchronous call.
4871 * If the function call that cancels transfer is successful, the application would receive
4872 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4873 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4874 * the error code will be BLUETOOTH_ERROR_NONE
4876 * @return BLUETOOTH_ERROR_NONE - Success \n
4877 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4878 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4879 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4880 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4887 int bluetooth_obex_server_cancel_all_transfers(void);
4891 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4892 * @brief Informs whether obex server is receiving or not.
4894 * This function is a synchronous call.
4896 * @return BLUETOOTH_ERROR_NONE - Success \n
4897 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4898 * BLUETOOTH_ERROR_INTERNAL \n
4901 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4906 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4910 * @fn int bluetooth_map_client_init(void)
4911 * @brief Initialize MAP client.
4913 * This function is a synchronous call.
4914 * No event corresponding to this api
4916 * @return BLUETOOTH_ERROR_NONE - Success \n
4917 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4918 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4919 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4920 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4925 * @see bluetooth_map_client_deinit
4927 int bluetooth_map_client_init(void);
4929 int bluetooth_map_client_deinit(void);
4931 int bluetooth_map_client_create_session(
4932 bt_map_client_session_info_s *session
4935 int bluetooth_map_client_destroy_session(
4936 bt_map_client_session_info_s *session
4939 int bluetooth_map_client_set_folder(
4940 bt_map_client_session_info_s *session,
4944 int bluetooth_map_client_list_folders(
4945 bt_map_client_session_info_s *session,
4951 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
4952 * @brief Return all available fields that can be used in Fields filter.
4954 * This function is a asynchronous call.
4956 * @return BLUETOOTH_ERROR_NONE - Success \n
4957 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4958 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
4961 * @param[in] session Information about session.
4964 int bluetooth_map_client_list_filter_fields(
4965 bt_map_client_session_info_s *session
4968 int bluetooth_map_client_list_messages(
4969 bt_map_client_session_info_s *session,
4974 int bluetooth_map_client_update_inbox(
4975 bt_map_client_session_info_s *session
4978 int bluetooth_map_client_push_message(
4979 bt_map_client_session_info_s *session,
4980 const char *source_file,
4985 int bluetooth_map_client_get_message(
4986 bt_map_client_session_info_s *session,
4987 const char *message_object_name,
4988 const char *target_file,
4994 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4995 * @brief Read the local Hash and Randmizer.
4997 * This function is a synchronous call.
4999 * @return BLUETOOTH_ERROR_NONE - Success \n
5000 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5004 * @param[out] local_oob_data - Pointer to the local OOB data
5010 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5014 * @fn int bluetooth_oob_add_remote_data(
5015 * const bluetooth_device_address_t *remote_device_address,
5016 * bt_oob_data_t *oob_data)
5017 * @brief Add/updated the remote device Hash and Randmizer.
5019 * This function is a synchronous call.
5020 * No event for this api..
5022 * @return BLUETOOTH_ERROR_NONE - Success \n
5023 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5026 * @param[in] remote_device_address - Remote device address
5027 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5033 int bluetooth_oob_add_remote_data(
5034 const bluetooth_device_address_t *remote_device_address,
5035 bt_oob_data_t *remote_oob_data);
5039 * @fn int bluetooth_oob_remove_remote_data(
5040 * const bluetooth_device_address_t *remote_device_address)
5041 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5043 * This function is a synchronous call.
5044 * No event for this api..
5046 * @return BLUETOOTH_ERROR_NONE - Success \n
5047 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5050 * @param[in] remote_device_address - Remote device address
5056 int bluetooth_oob_remove_remote_data(
5057 const bluetooth_device_address_t *remote_device_address);
5060 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5061 * bt_gatt_handle_info_t *prim_svc);
5063 * @brief Gets the GATT based primary services handle supported by remote device
5065 * This function is a synchronous call.
5066 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5068 * @return BLUETOOTH_ERROR_NONE - Success \n
5069 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5070 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5071 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5074 * @param[in] address - Remote device address
5075 * @param[out] prim_svc - Structure containing remote service count and handle list.
5078 * @see bluetooth_gatt_free_primary_services()
5080 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5081 bt_gatt_handle_info_t *prim_svc);
5084 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5086 * @brief Discovers the characteristics of GATT based service of remote device
5088 * This function is an asynchronous call.
5089 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5091 * @return BLUETOOTH_ERROR_NONE - Success \n
5092 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5093 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5094 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5097 * @param[in] service_handle - Handle for remote service.
5102 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5104 int bluetooth_gatt_set_service_change_watcher(
5105 const bluetooth_device_address_t *address, gboolean enable);
5108 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5109 * bt_gatt_service_property_t *service);
5111 * @brief Gets the properties of GATT based service of remote device
5113 * This function is a synchronous call.
5114 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5116 * @return BLUETOOTH_ERROR_NONE - Success \n
5117 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5118 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5119 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5122 * @param[in] service_handle - Handle for remote service.
5123 * @param[out] service - Structure containing remote service property.
5126 * @see bluetooth_gatt_free_service_property()
5128 int bluetooth_gatt_get_service_property(const char *service_handle,
5129 bt_gatt_service_property_t *service);
5132 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5134 * @brief Register to GATT based service to receive value change notification/indication.
5136 * This function is a synchronous call.
5137 * No event for this api.
5139 * @return BLUETOOTH_ERROR_NONE - Success \n
5140 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5141 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5142 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5145 * @param[in] service_handle - Handle for remote service.
5150 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5153 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5155 * @brief Unregister GATT based service to receive value change notification/indication.
5157 * This function is a synchronous call.
5158 * No event for this api.
5160 * @return BLUETOOTH_ERROR_NONE - Success \n
5161 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5162 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5163 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5166 * @param[in] service_handle - Handle for remote service.
5171 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5174 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5175 * bt_gatt_char_property_t *characteristic);
5177 * @brief Provides characteristic value along with properties.
5179 * This function is a synchronous call.
5180 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5182 * @return BLUETOOTH_ERROR_NONE - Success \n
5183 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5184 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5185 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5188 * @param[in] char_handle - Handle for Characteristic property.
5189 * @param[out] characteristic - Structure containing remote characteristic property.
5192 * @see bluetooth_gatt_free_char_property()
5194 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5195 bt_gatt_char_property_t *characteristic);
5198 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5199 * bt_gatt_char_property_t *characteristic);
5201 * @brief Provides characteristic descriptor value along with its UUID.
5203 * This function is a synchronous call.
5204 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5206 * @return BLUETOOTH_ERROR_NONE - Success \n
5207 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5208 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5209 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5212 * @param[in] desc_handle - Handle for Characteristic descriptor.
5213 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5216 * @see bluetooth_gatt_free_desc_property()
5218 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5219 bt_gatt_char_descriptor_property_t *descriptor);
5223 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5224 * const guint8 *value, int length)
5226 * @brief Set characteristic value.
5228 * This function is a synchronous call.
5230 * @return BLUETOOTH_ERROR_NONE - Success \n
5231 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5232 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5233 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5236 * @param[in] char_handle - Handle for Characteristic property.
5237 * @param[in] value - New value to set for characteristic property.
5238 * @param[in] length - Length of the value to be set.
5243 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5244 const guint8 *value, int length);
5247 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5248 * const guint8 *value, int length, guint8 write_type)
5250 * @brief Set characteristic value by write type.
5252 * This function is a synchronous call if write type is "write without resonse"
5253 * and it is an asynchronous call if write type is "write with response"
5255 * @return BLUETOOTH_ERROR_NONE - Success \n
5256 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5257 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5258 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5261 * @param[in] char_handle - Handle for Characteristic property.
5262 * @param[in] value - New value to set for characteristic property.
5263 * @param[in] length - Length of the value to be set.
5264 * @param[in] write_type - Type of write.
5269 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5270 const guint8 *value, int length, guint8 write_type);
5274 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5275 * const guint8 *value, int length)
5277 * @brief Set characteristic value request.
5279 * This function is an asynchronous call.
5281 * @return BLUETOOTH_ERROR_NONE - Success \n
5282 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5283 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5284 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5287 * @param[in] char_handle - Handle for Characteristic property.
5288 * @param[in] value - New value to set for characteristic property.
5289 * @param[in] length - Length of the value to be set.
5294 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5295 const guint8 *value, int length);
5298 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5300 * @brief Read characteristic value.
5302 * This function is a asynchronous call.
5304 * @return BLUETOOTH_ERROR_NONE - Success \n
5305 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5306 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5307 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5310 * @param[in] char_handle - Handle for Characteristic property.
5315 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5318 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5319 * const char *service_uuid,
5320 * bt_gatt_service_property_t *service)
5322 * @brief Gets the service property from a device based on a particular uuid
5324 * This function is a synchronous call.
5326 * @return BLUETOOTH_ERROR_NONE - Success \n
5327 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5328 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5329 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5332 * @param[in] address - BD address of the remote device
5333 * @param[in] service_uuid - uuid of the service.
5334 * @param[out] service - Structure containing the service property.
5339 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5340 const char *service_uuid,
5341 bt_gatt_service_property_t *service);
5344 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5345 * const char *char_uuid)
5347 * @brief Gets the characteristic property from a service based on a particular char uuid
5349 * This function is an asynchronous call.
5350 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5352 * @return BLUETOOTH_ERROR_NONE - Success \n
5353 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5354 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5355 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5358 * @param[in] service_handle - Service handle.
5359 * @param[in] uuid - Characteristic uuid.
5364 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5365 const char *char_uuid);
5368 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5370 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5372 * This function is a synchronous call.
5373 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5375 * @return BLUETOOTH_ERROR_NONE - Success \n
5376 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5379 * @param[in] prim_svc - GATT handle info structure
5382 * @see bluetooth_gatt_get_primary_services()
5384 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5387 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5389 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5391 * This function is a synchronous call.
5392 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5394 * @return BLUETOOTH_ERROR_NONE - Success \n
5395 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5398 * @param[in] svc_pty - GATT service property structure.
5401 * @see bluetooth_gatt_get_service_property()
5403 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5406 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5408 * @brief Provides characteristic value along with properties.
5410 * This function is a synchronous call.
5411 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5413 * @return BLUETOOTH_ERROR_NONE - Success \n
5414 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5417 * @param[in] char_pty - GATT characteristics property structure.
5420 * @see bluetooth_gatt_get_characteristics_property()
5422 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5425 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5427 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5429 * This function is a synchronous call.
5430 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5432 * @return BLUETOOTH_ERROR_NONE - Success \n
5433 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5436 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5439 * @see bluetooth_gatt_get_char_descriptor_property()
5441 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5443 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5445 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5448 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5450 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5452 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5454 * @return BLUETOOTH_ERROR_NONE - Success \n
5455 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5458 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5462 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5465 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5467 * @brief Read characteristic descriptor value.
5469 * This function is a asynchronous call.
5471 * @return BLUETOOTH_ERROR_NONE - Success \n
5472 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5473 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5474 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5477 * @param[in] desc_handle - Handle for Characteristic descriptor
5482 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5485 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5486 * const guint8 *value, int length);
5488 * @brief Set characteristic descriptor value.
5490 * This function is a asynchronous call.
5492 * @return BLUETOOTH_ERROR_NONE - Success \n
5493 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5494 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5495 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5498 * @param[in] desc_handle - Handle for Characteristic descriptor
5499 * @param[in] value - New value to set for characteristic descriptor
5500 * @param[in] length - Length of the value to be set.
5505 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5506 const guint8 *value, int length);
5508 /* @fn int bluetooth_gatt_init(void)
5510 * @brief Initializes the gatt service.
5512 * This function is a synchronous call.
5513 * @return BLUETOOTH_ERROR_NONE - Success \n
5514 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5515 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5516 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5519 * @remark Adapter should be enabled
5520 * @see bluetooth_gatt_deinit()
5522 int bluetooth_gatt_init(void);
5524 /* @fn int bluetooth_gatt_init(void)
5526 * @brief DeInitializes the gatt service.
5528 * This function is a synchronous call.
5529 * @return BLUETOOTH_ERROR_NONE - Success \n
5530 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5531 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5532 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5535 * @remark Adapter should be enabled
5536 * @see bluetooth_gatt_init()
5538 int bluetooth_gatt_deinit(void);
5540 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5541 unsigned char **svc_path)
5543 * @brief Exports a new gatt service to the service interface.
5545 * This function is a synchronous call.
5547 * @return BLUETOOTH_ERROR_NONE - Success \n
5548 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5549 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5550 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5553 * @param[in] svc_uuid Gatt service uuid.
5554 * @param[out] svc_path service object path of the exported service.
5555 * @remark Adapter should be enabled
5556 * @see bluetooth_gatt_init()
5558 int bluetooth_gatt_add_service(const char *svc_uuid,
5561 /* @fn int bluetooth_gatt_add_new_characteristic(
5562 const char *svc_path, const char *char_uuid,
5563 bt_gatt_permission_t permissions,
5564 bt_gatt_characteristic_property_t properties,
5565 int flags_length, char **char_path);;
5567 * @brief Exports a new gatt characteristic to the characteristic interface.
5569 * This function is a synchronous call.
5570 * @return BLUETOOTH_ERROR_NONE - Success \n
5571 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5572 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5573 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5575 * @param[in] svc_path service object path of the exported service.
5576 * @param[in] char_uuid Gatt service uuid.
5577 * @param[in] properties GATT characteristic properties.
5578 * @param[out] char_path characteristic object path of the exported characteristic.
5580 * @remark Adapter should be enabled
5581 * @see bluetooth_gatt_add_service()
5583 int bluetooth_gatt_add_new_characteristic(
5584 const char *svc_path, const char *char_uuid,
5585 bt_gatt_permission_t permissions,
5586 bt_gatt_characteristic_property_t properties,
5589 /* @fn bluetooth_gatt_set_characteristic_value(
5590 const char *characteristic, const char *char_value,
5593 * @brief adds gatt charactertisic value to the given charactertistic path.
5595 * This function is a synchronous call.
5596 * @return BLUETOOTH_ERROR_NONE - Success \n
5597 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5598 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5599 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5601 * @param[in] char_value Value of the GATT characteristic to be added.
5602 * @param[in] value_length length of the chantacteristic value..
5603 * @param[out] characteristic characteristic object path..
5605 * @remark Adapter should be enabled
5606 * @see bluetooth_gatt_add_service()
5608 int bluetooth_gatt_set_characteristic_value(
5609 const char *characteristic, const char *char_value,
5612 /* @fn int bluetooth_gatt_add_descriptor(
5613 const char *char_path, const char *desc_uuid,
5614 bt_gatt_permission_t permissions,
5617 * @brief Exports a new gatt descriptor to the descriptor interface.
5619 * This function is a synchronous call.
5621 * @return BLUETOOTH_ERROR_NONE - Success \n
5622 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5623 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5624 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5627 * @param[in] desc_uuid Gatt descriptor uuid.
5628 * @param[in] desc_value GATT descriptor value.
5629 * @param[in] value_length Length of GATT descriptor value.
5630 * @param[in] permissions descriptor permissions.
5631 * @param[in] properties GATT descriptor properties.
5632 * @param[in] char_path characteristics object path of the exported character.
5634 * @remark Adapter should be enabled
5635 * @see bluetooth_gatt_add_service()
5636 * @see bluetooth_gatt_add_characteristics()
5638 int bluetooth_gatt_add_descriptor(
5639 const char *char_path, const char *desc_uuid,
5640 bt_gatt_permission_t permissions,
5643 /* @fn int bluetooth_gatt_set_descriptor_value(
5644 const char *desc_path, const char *desc_value,
5647 * @brief Adds value to the given descriptor handle.
5649 * This function is a synchronous call.
5651 * @return BLUETOOTH_ERROR_NONE - Success \n
5652 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5653 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5654 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5657 * @param[in] desc_value GATT descriptor value.
5658 * @param[in] value_length Length of GATT descriptor value.
5659 * @param[in] desc_path descriptor path to which the value needs to be added.
5661 * @remark Adapter should be enabled
5662 * @see bluetooth_gatt_add_service()
5663 * @see bluetooth_gatt_add_characteristics()
5665 int bluetooth_gatt_set_descriptor_value(
5666 const char *desc_path, const char *desc_value,
5669 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5671 * @brief Reads the Service registered on manager interface.
5673 * This function is a synchronous call.
5675 * @return BLUETOOTH_ERROR_NONE - Success \n
5676 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5677 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5678 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5681 * @param[in] svc_uuid Gatt Service uuid.
5683 * @remark Adapter should be enabled and service should be registered.
5684 * @see bluetooth_gatt_register_service()
5686 int bluetooth_gatt_get_service(const char *svc_uuid);
5688 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5690 * @brief Registers the given service path with the library.
5692 * This function is a synchronous call.
5694 * @return BLUETOOTH_ERROR_NONE - Success \n
5695 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5696 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5697 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5700 * @param[in] svc_path service object path of the exported service.
5702 * @remark Adapter should be enabled
5703 * @see bluetooth_gatt_add_service()
5704 * @see bluetooth_gatt_add_characteristics()
5705 * @see bluetooth_gatt_add_descriptor()
5706 * @see bluetooth_gatt_register_application()
5708 int bluetooth_gatt_register_service(const char *svc_path);
5710 /* @fn int bluetooth_gatt_register_application(void)
5712 * @brief Registers the application with the bluez gatt server.
5714 * This function is a synchronous call.
5716 * @return BLUETOOTH_ERROR_NONE - Success \n
5717 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5718 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5719 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5723 * @remark Adapter should be enabled
5724 * @see bluetooth_gatt_init()
5725 * @see bluetooth_gatt_add_service()
5726 * @see bluetooth_gatt_add_characteristics()
5727 * @see bluetooth_gatt_add_descriptor()
5728 * @see bluetooth_gatt_register_service()
5730 int bluetooth_gatt_register_application(void);
5732 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5734 * @brief Removes(unregister) service from the bluez gatt server db.
5736 * This function is a synchronous call.
5738 * @return BLUETOOTH_ERROR_NONE - Success \n
5739 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5740 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5741 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5744 * @param[in] svc_path service object path of the exported service.
5746 * @remark Adapter should be enabled
5747 * @see bluetooth_gatt_add_service()
5748 * @see bluetooth_gatt_add_characteristics()
5749 * @see bluetooth_gatt_add_descriptor()
5750 * @see bluetooth_gatt_register_service()
5752 int bluetooth_gatt_unregister_service(const char *svc_path);
5754 /* @fn int bluetooth_gatt_unregister_application(void)
5756 * @brief Removes(unregister) the application with the bluez gatt server,
5757 * and deletes all the service registered.
5759 * This function is a synchronous call.
5761 * @return BLUETOOTH_ERROR_NONE - Success \n
5762 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5763 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5764 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5768 * @remark Adapter should be enabled
5769 * @see bluetooth_gatt_init()
5770 * @see bluetooth_gatt_add_service()
5771 * @see bluetooth_gatt_add_characteristics()
5772 * @see bluetooth_gatt_add_descriptor()
5773 * @see bluetooth_gatt_register_service()
5774 * @see bluetooth_gatt_unregister_service()
5776 int bluetooth_gatt_unregister_application(void);
5778 /* @fn int bluetooth_gatt_send_response(int request_id,
5779 * int offset, char *value, int value_length)
5781 * @brief Updates the attribute value in local attribute list.
5783 * This function is a synchronous call.
5785 * @return BLUETOOTH_ERROR_NONE - Success \n
5786 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5787 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5788 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5791 * @param[in] request_id The identification of a read request
5792 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5793 * @param[in] resp_state The identification of response state
5794 * @param[in] offset The offset from where a value is read
5795 * @param[in] value The value to be sent. It will be sent from @a offset.
5796 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5797 * @param[in] value_length Value Length.
5799 * @remark Adapter should be enabled
5800 * @see bluetooth_gatt_add_service()
5801 * @see bluetooth_gatt_add_characteristics()
5802 * @see bluetooth_gatt_add_descriptor()
5803 * @see bluetooth_gatt_register_service()
5805 int bluetooth_gatt_send_response(int request_id, guint req_type,
5806 int resp_state, int offset, char *value, int value_length);
5808 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5810 * @brief Sets the notification property for a characteristic.
5812 * This function is a synchronous call.
5814 * @return BLUETOOTH_ERROR_NONE - Success \n
5815 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5816 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5817 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5820 * @param[in] char_path characteristic object path.
5821 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5823 * @remark Adapter should be enabled
5824 * @see bluetooth_gatt_update_characteristic()
5826 int bluetooth_gatt_server_set_notification(const char *char_path,
5827 bluetooth_device_address_t *unicast_address);
5829 /* @fn int bluetooth_gatt_delete_services(void)
5831 * @brief deletes (unregisters) all services from the gatt server database..
5833 * This function is a synchronous call.
5835 * @return BLUETOOTH_ERROR_NONE - Success \n
5836 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5837 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5838 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5842 * @remark Adapter should be enabled
5843 * @see bluetooth_gatt_add_service()
5844 * @see bluetooth_gatt_add_characteristics()
5845 * @see bluetooth_gatt_add_descriptor()
5846 * @see bluetooth_gatt_register_service()
5847 * @see bluetooth_gatt_unregister_service()
5849 int bluetooth_gatt_delete_services(void);
5851 /* @fn int bluetooth_gatt_update_characteristic(void)
5853 * @brief updates the given characteristic with a new value
5855 * This function is a synchronous call.
5857 * @return BLUETOOTH_ERROR_NONE - Success \n
5858 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5859 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5860 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5864 * @remark Adapter should be enabled
5865 * @see bluetooth_gatt_add_service()
5866 * @see bluetooth_gatt_add_characteristics()
5867 * @see bluetooth_gatt_add_descriptor()
5868 * @see bluetooth_gatt_register_service()
5869 * @see bluetooth_gatt_unregister_service()
5871 int bluetooth_gatt_update_characteristic(const char *char_path,
5872 const char* char_value, int value_length);
5875 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5877 * @brief Set advertising status.
5879 * This function is used to enable or disable LE advertising.
5880 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5882 * This function is a synchronous call.
5884 * @return BLUETOOTH_ERROR_NONE - Success \n
5885 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5886 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5889 * @param[in] enable - The status of advertising
5892 * @see bluetooth_set_advertising_data
5894 int bluetooth_set_advertising(int handle, gboolean enable);
5897 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5899 * @brief Set advertising status along with interval value.
5901 * This function is used to enable or disable LE advertising.
5902 * Interval_min and Interval_max is used to set the best advertising interval.
5903 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5905 * This function is a synchronous call.
5907 * @return BLUETOOTH_ERROR_NONE - Success \n
5908 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5909 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5912 * @param[in] enable - The status of advertising
5913 * @param[in] interval_min - Minimum interval of advertising (msec)
5914 * @param[in] interval_max - Maximum interval of advertising (msec)
5915 * @param[in] filter_policy - Advertising filter policy
5918 * @see bluetooth_set_advertising_data
5920 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5921 bluetooth_advertising_params_t *params);
5924 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5925 * @brief Get the advertising data
5927 * This function is used to get advertising data.
5928 * Before calling this API, the adapter should be enabled.
5930 * This function is a synchronous call.
5932 * @return BLUETOOTH_ERROR_NONE - Success \n
5933 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5934 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5935 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5937 * @param[out] value - Advertising data structure.
5938 * @param[out] length - The length of Advertising data.
5942 bluetooth_advertising_data_t *value = { {0} };
5945 ret = bluetooth_get_advertising_data(&value, &length);
5948 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5951 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5953 * @brief Set advertising data with value
5955 * This function is used to set advertising data and Maximum size of advertising data
5956 * is 28 byte (Except Flag)
5958 * This function is a synchronous call.
5960 * @return BLUETOOTH_ERROR_NONE - Success \n
5961 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5962 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5965 * @param[in] value - Advertising data structure.
5969 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5972 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5974 * @brief Check the privilege for advertising parameter setting
5976 * This function is a synchronous call.
5978 * @return BLUETOOTH_ERROR_NONE - Success \n
5979 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5985 int bluetooth_check_privilege_advertising_parameter(void);
5988 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5989 * @brief Get the LE scan response data
5991 * This function is used to get scan response data.
5992 * Before calling this API, the adapter should be enabled.
5994 * This function is a synchronous call.
5996 * @return BLUETOOTH_ERROR_NONE - Success \n
5997 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5998 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5999 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6001 * @param[out] value - Scan response data structure.
6002 * @param[out] length - The length of Scan response data.
6006 bluetooth_scan_resp_data_t *value = { {0} };
6009 ret = bluetooth_get_scan_response_data(&value, &length);
6012 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6015 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6017 * @brief Set scan response data with value
6019 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6021 * This function is a synchronous call.
6023 * @return BLUETOOTH_ERROR_NONE - Success \n
6024 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6025 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6028 * @param[in] value - LE Scan response data structure.
6032 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6035 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6037 * @brief Set scan interval and window
6039 * This function is used to set LE scan interval and window size
6041 * This function is a synchronous call.
6043 * @return BLUETOOTH_ERROR_NONE - Success \n
6044 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6045 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6048 * @param[in] interval - Interval of LE scan (msec)
6049 * @param[in] window - Window size of LE scan (msec)
6053 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6056 * @fn int bluetooth_is_advertising(void)
6057 * @brief Check for the advertising is in-progress or not.
6059 * This API is used to check the current status of the advertising procedure.
6060 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6063 * This function checks whether the advertising is started or not.
6065 * This function is a synchronous call.
6067 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6069 * @return BLUETOOTH_ERROR_NONE - Success \n
6070 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6073 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6077 gboolean is_advertising = 0;
6079 ret = bluetooth_is_advertising(&is_advertising);
6082 int bluetooth_is_advertising(gboolean *is_advertising);
6085 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6086 * @brief Add LE device to white list
6088 * This API is used to add LE device to white list
6089 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6093 * This function is a synchronous call.
6095 * @param[in] address The address of remote device
6097 * @return BLUETOOTH_ERROR_NONE - Success \n
6098 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6101 * @see bluetooth_set_custom_advertising
6103 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6106 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6107 * @brief Remove LE device from white list
6109 * This API is used to remove LE device from white list
6110 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6114 * This function is a synchronous call.
6116 * @param[in] address The address of remote device
6118 * @return BLUETOOTH_ERROR_NONE - Success \n
6119 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6122 * @see bluetooth_set_custom_advertising
6124 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6127 * @fn int bluetooth_clear_white_list(void)
6128 * @brief Clear white list
6130 * This API is used to clear white list
6131 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6135 * This function is a synchronous call.
6137 * @param[in] address The address of remote device
6139 * @return BLUETOOTH_ERROR_NONE - Success \n
6140 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6143 * @see bluetooth_set_custom_advertising
6145 int bluetooth_clear_white_list(void);
6148 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6149 * const bluetooth_le_connection_param_t *parameters)
6150 * @brief update connection paramter of LE connection.
6152 * This function is a synchronous call.
6154 * @return BLUETOOTH_ERROR_NONE - Success \n
6155 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6158 * @param[in] address - remote device address value.
6159 * @param[in] parameters - new connection parameters.
6162 * @see bluetooth_bond_device
6164 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6165 const bluetooth_le_connection_param_t *parameters);
6168 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6170 * @brief Enable/Disable LE Privacy feature.
6172 * This function is used to enable or disable LE Privacy feature.
6173 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6175 * This function is a synchronous call.
6177 * @return BLUETOOTH_ERROR_NONE - Success \n
6178 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6179 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6182 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6186 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6189 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6191 * @brief Enable/Disable LE static random address.
6193 * This function is used to enable or disable LE static random address.
6195 * This function is a synchronous call.
6197 * @return BLUETOOTH_ERROR_NONE - Success \n
6198 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6199 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6202 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6206 int bluetooth_set_le_static_random_address(gboolean enable);
6209 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6210 * bluetooth_le_connection_mode_t mode)
6211 * @brief update connection paramter of LE connection.
6213 * This function is a synchronous call.
6215 * @return BLUETOOTH_ERROR_NONE - Success \n
6216 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6217 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6220 * @param[in] address - remote device address value.
6221 * @param[in] mode - new connection mode.
6225 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6226 bluetooth_le_connection_mode_t mode);
6229 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6230 * @brief Request for new ATT MTU value.
6232 * This function is a asynchronous call.
6234 * @return BLUETOOTH_ERROR_NONE - Success \n
6235 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6236 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6239 * @param[in] address - remote device address value.
6240 * @param[in] mtu - MTU value to be set.
6244 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6247 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6248 * unsigned int *mtu)
6249 * @brief Gets the xisting MTU value set for a connection.
6251 * This function is a synchronous call.
6253 * @return BLUETOOTH_ERROR_NONE - Success \n
6254 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6255 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6258 * @param[in] address - remote device address value.
6259 * @param[out] mtu - MTU value set for the connection.
6263 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6267 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6268 * bluetooth_device_address_t *id_address)
6269 * @brief Gets the Identity address of remote device.
6271 * This function is a synchronous call.
6273 * @return BLUETOOTH_ERROR_NONE - Success \n
6274 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6275 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6278 * @param[in] device_rpa - remote Resolvable private address.
6279 * @param[out] id_address - remote Identity device address value.
6283 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6284 bluetooth_device_address_t *id_address);
6287 * @fn int bluetooth_le_read_maximum_data_length()
6288 * @brief reads the maximum LE data length supported in the controller.
6290 * This function is a synchronous call.
6292 * @return BLUETOOTH_ERROR_NONE - Success \n
6293 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6299 int bluetooth_le_read_maximum_data_length(
6300 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6302 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6303 * @brief writes the host suggested values for the controllers max transmitted no of payload
6304 * octects to be used for new connections.
6306 * This function is a synchronous call.
6308 * @return BLUETOOTH_ERROR_NONE - Success \n
6309 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6315 int bluetooth_le_write_host_suggested_default_data_length(
6316 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6318 int bluetooth_le_read_suggested_default_data_length(
6319 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6321 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6322 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6324 int bluetooth_pbap_init(void);
6325 int bluetooth_pbap_deinit(void);
6326 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6327 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6328 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6329 bt_pbap_folder_t *folder);
6330 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6331 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6332 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6333 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6334 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6335 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6336 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6337 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6340 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6342 * @brief Set manufacturer data with value
6344 * This function is used to set manufacturer data.
6346 * This function is a synchronous call.
6348 * @return BLUETOOTH_ERROR_NONE - Success \n
6349 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6350 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6353 * @param[in] value - Manufacturer data structure.
6357 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6359 int bluetooth_set_passkey_notification(gboolean enable);
6362 * @fn int bluetooth_dpm_is_mode_allowed(void);
6364 * @brief Checks Restriction for BT mode(BT allowed or not)
6366 * This function is a synchronous call.
6368 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6369 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6370 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6377 int bluetooth_dpm_is_mode_allowed(void);
6380 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6382 * @brief Sets Restriction for BT mode(BT allowed or not)
6384 * This function is a synchronous call.
6386 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6387 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6388 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6391 * @param[in] value - BT Allow value.
6392 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6393 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6394 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6395 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6399 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6402 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6404 * @brief Reads the Restriction for BT mode(BT allowed or not)
6406 * This function is a synchronous call.
6408 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6409 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6410 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6414 * @param[out] value - BT Allow value.
6415 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6416 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6417 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6418 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6422 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6425 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6427 * @brief Sets the Restriction for device.
6429 * This function is a synchronous call.
6431 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6432 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6433 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6436 * @param[in] value - State value.
6437 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6438 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6442 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6445 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6447 * @brief Reads the Restriction for device.
6449 * This function is a synchronous call.
6451 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6452 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6453 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6457 * @param[out] value - State value.
6458 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6459 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6463 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6466 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6468 * @brief Sets the Restriction for uuid.
6470 * This function is a synchronous call.
6472 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6473 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6474 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6477 * @param[in] value - State value.
6478 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6479 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6483 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6486 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6488 * @brief Reads the Restriction for uuid.
6490 * This function is a synchronous call.
6492 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6493 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6494 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6498 * @param[out] value - State value.
6499 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6500 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6504 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6507 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6509 * @brief Adds the device to blacklist.
6511 * This function is a synchronous call.
6513 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6514 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6515 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6518 * @param[in] device_address - Device address
6522 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6525 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6527 * @brief Adds the device to whitelist.
6529 * This function is a synchronous call.
6531 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6532 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6533 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6536 * @param[in] device_address - Device address
6540 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6543 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6545 * @brief Adds the Service UUIDS to blacklist.
6547 * This function is a synchronous call.
6549 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6550 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6551 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6554 * @param[in] service_uuids - profile or custom service uuids
6558 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6561 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6563 * @brief Adds the Service UUIDS to whitelist.
6565 * This function is a synchronous call.
6567 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6568 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6569 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6572 * @param[in] service_uuids - profile or custom service uuids
6576 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6579 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6581 * @brief Clears the devices from blacklist.
6583 * This function is a synchronous call.
6585 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6586 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6587 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6594 int bluetooth_dpm_clear_devices_from_blacklist(void);
6597 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6599 * @brief Clears the devices from whitelist.
6601 * This function is a synchronous call.
6603 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6604 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6605 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6612 int bluetooth_dpm_clear_devices_from_whitelist(void);
6615 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6617 * @brief Clears the uuids from blacklist.
6619 * This function is a synchronous call.
6621 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6622 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6623 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6630 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6633 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6635 * @brief Clears the uuids from whitelist.
6637 * This function is a synchronous call.
6639 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6640 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6641 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6648 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6651 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6653 * @brief reads the devices from blacklist.
6655 * This function is a synchronous call.
6657 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6658 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6659 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6662 * @param[out] device_list - list of devices
6666 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6669 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6671 * @brief reads the devices from whitelist.
6673 * This function is a synchronous call.
6675 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6676 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6677 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6680 * @param[out] device_list - list of devices
6684 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6687 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6689 * @brief reads the uuids from blacklist.
6691 * This function is a synchronous call.
6693 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6694 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6695 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6698 * @param[in] uuid_list - list of uuids
6702 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6705 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6707 * @brief reads the uuids from whitelist.
6709 * This function is a synchronous call.
6711 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6712 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6713 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6716 * @param[in] uuid_list - list of uuids
6720 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6723 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6725 * @brief Removes the device from whitelist.
6727 * This function is a synchronous call.
6729 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6730 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6731 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6734 * @param[in] device_address - Device address
6738 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6741 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6743 * @brief Removes the device from blacklist.
6745 * This function is a synchronous call.
6747 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6748 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6749 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6752 * @param[in] device_address - Device address
6756 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6759 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6761 * @brief Removes the Service UUIDS from whitelist.
6763 * This function is a synchronous call.
6765 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6766 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6767 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6770 * @param[in] service_uuids - profile or custom service uuids
6774 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6777 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6779 * @brief Removes the Service UUIDS from blacklist.
6781 * This function is a synchronous call.
6783 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6784 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6785 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6788 * @param[in] service_uuids - profile or custom service uuids
6792 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6795 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6797 * @brief Sets the Restriction for outgoing call.
6799 * This function is a synchronous call.
6801 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6802 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6803 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6806 * @param[in] value - State value.
6807 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6808 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6812 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6815 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6817 * @brief Reads the Restriction for outgoing call.
6819 * This function is a synchronous call.
6821 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6822 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6823 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6827 * @param[out] value - State value.
6828 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6829 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6833 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6836 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6838 * @brief Sets the Restriction for Pairing.
6840 * This function is a synchronous call.
6842 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6843 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6844 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6847 * @param[in] value - State value.
6848 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6849 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6853 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6856 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6858 * @brief Reads the Restriction for Pairing
6860 * This function is a synchronous call.
6862 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6863 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6864 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6868 * @param[out] value - State value.
6869 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6870 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6874 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6877 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6879 * @brief Sets the Restriction for using Profiles.
6881 * This function is a synchronous call.
6883 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6884 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6885 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6888 * @param[in]profile - Profile.
6889 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6890 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6891 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6892 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6893 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6894 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6895 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6896 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6897 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6898 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6899 * BLUETOOTH_DPM_PROFILE_NONE
6900 * @param[in] value - State value.
6901 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6902 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6906 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6909 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6911 * @brief Reads the Restriction for using Profiles.
6913 * This function is a synchronous call.
6915 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6916 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6917 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6920 * @param[in]profile - Profile.
6921 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6922 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6923 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6924 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6925 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6926 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6927 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6928 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6929 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6930 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6931 * BLUETOOTH_DPM_PROFILE_NONE
6932 * @param[out] value - State value.
6933 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6934 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6938 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6941 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6943 * @brief Sets the Restriction for Desktop Connectivity.
6945 * This function is a synchronous call.
6947 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6948 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6949 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6952 * @param[in] value - State value.
6953 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6954 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6958 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6961 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6963 * @brief Reads the Restriction for Desktop Connectivity.
6965 * This function is a synchronous call.
6967 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6968 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6969 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6973 * @param[out] value - State value.
6974 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6975 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6979 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6982 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6984 * @brief Sets the Restriction for Discoverable state.
6986 * This function is a synchronous call.
6988 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6989 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6990 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6993 * @param[in] value - State value.
6994 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6995 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6999 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7002 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7004 * @brief Reads the Restriction for Discoverable state.
7006 * This function is a synchronous call.
7008 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7009 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7010 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7014 * @param[out] value - State value.
7015 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7016 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7020 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7023 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7025 * @brief Sets the Restriction for linited discoverable state..
7027 * This function is a synchronous call.
7029 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7030 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7031 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7034 * @param[in] value - State value.
7035 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7036 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7040 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7043 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7045 * @brief Reads the Restriction for limited discoverable state.
7047 * This function is a synchronous call.
7049 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7050 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7051 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7055 * @param[out] value - State value.
7056 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7057 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7061 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7063 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7065 * @brief Sets the Restriction for Data trasnfer.
7067 * This function is a synchronous call.
7069 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7070 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7071 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7074 * @param[in] value - State value.
7075 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7076 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7080 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7084 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7086 * @brief Reads the Restriction for Data trasnfer.
7088 * This function is a synchronous call.
7090 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7091 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7092 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7096 * @param[out] value - State value.
7097 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7098 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7102 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7105 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7106 * bluetooth_pxp_poperty_t property, int value);
7108 * @brief Sets the Proximity alert level/properties for monitor role.
7110 * This function is a synchronous call.
7112 * @return BLUETOOTH_ERROR_NONE - Success \n
7113 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7114 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7115 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7118 * @param[in] device_address remote device address
7119 * @param[in] property proximity profile property
7120 * @param[in] value alert level/property value to be set
7125 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7126 bluetooth_pxp_poperty_t property, int value);
7129 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7130 * bluetooth_pxp_poperty_t property, int *value);
7132 * @brief Reads the Proximity alert level/properties for monitor role.
7134 * This function is a synchronous call.
7136 * @return BLUETOOTH_ERROR_NONE - Success \n
7137 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7138 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7139 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7142 * @param[in] device_address remote device address
7143 * @param[in] property proximity profile property
7144 * @param[out] value alert level/property value
7148 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7149 bluetooth_pxp_poperty_t property, int *value);
7152 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7153 * int *services_supported);
7155 * @brief Reads the Proximity Monitor profile supported properties/services.
7157 * This function is a synchronous call.
7159 * @return BLUETOOTH_ERROR_NONE - Success \n
7160 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7161 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7162 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7165 * @param[in] device_address remote device address
7166 * @param[out] services_supported proximity profile property/service
7170 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7171 int *services_supported);
7174 * @fn int bluetooth_proximity_reporter_register();
7176 * @brief Register all proximity related services in BlueZ.
7178 * This function is a synchronous call.
7180 * @return BLUETOOTH_ERROR_NONE - Success \n
7181 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7187 int bluetooth_proximity_reporter_register(void);
7190 * @fn int bluetooth_proximity_reporter_unregister();
7192 * @brief Unregister all proximity related services in BlueZ.
7194 * This function is a synchronous call.
7196 * @return BLUETOOTH_ERROR_NONE - Success \n
7197 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7203 int bluetooth_proximity_reporter_unregister(void);
7206 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7207 * bluetooth_pxp_poperty_t property, int *value);
7209 * @brief Reads the Proximity alert level/properties for reporter role.
7211 * This function is a synchronous call.
7213 * @return BLUETOOTH_ERROR_NONE - Success \n
7214 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7215 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7216 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7219 * @param[in] device_address remote device address
7220 * @param[in] property proximity profile property
7221 * @param[out] value alert level/property value
7225 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7226 bluetooth_pxp_poperty_t property, int *value);
7234 #endif /* __cplusplus */
7235 #endif /* _BLUETOOTH_API_H_*/