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
81 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
82 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
85 * < This defines the maximum size of OTP server directory name
87 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
89 #define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH 500 /**< OTP Characteristics Value Max length */
92 * This is Bluetooth error code
94 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
96 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
97 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
99 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
100 /**< Callback error */
101 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
102 /**< invalid paramerror */
103 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
104 /**< invalid data error */
105 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
106 /**< Memory allocation error */
107 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
108 /**< out of memory error */
109 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
110 /**< timeout error */
111 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
112 /**< No resource error */
113 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
114 /**< internal error */
115 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
116 /**< Not supported error */
117 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
118 /**< Operation is failed because
119 of not enabled BT Adapter */
120 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
121 /**< Enabling is failed because of
122 already enabled BT Adapter */
123 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
124 /**< Operation is failed because of
125 other on going operation */
126 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
127 /**< access denied error */
128 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
129 /**< max client error */
130 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
131 /**< not found error */
132 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
133 /**< service search fail */
134 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
135 /**< pairing failed error */
136 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
137 /**< Not paired error */
138 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
139 /**< no service error */
140 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
141 /**< no connection error */
142 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
143 /**< alread connected error */
144 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
145 /**< connection busy error */
146 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
147 /**< connection error */
148 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
149 /**< max connection error*/
150 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
151 /**< Not in operation */
152 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
153 /**< Cancelled by user */
154 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
155 /**< Service record registration failed */
156 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
157 /**< Operation in progress */
158 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
159 /**< authentication failed error when paring*/
160 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
161 /**< Remote host is down */
162 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
163 /**< End of device list */
165 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
166 /**< Obex agent already exists */
167 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
168 /**< Obex agent does not exist */
170 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
171 /**< Already initialized */
173 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
174 /**< Permission deined */
176 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
177 /**< Nap already done */
179 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
180 /**< Not initialized */
182 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
183 /**< Authentication rejected */
185 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
186 /**< Device Policy Restricted */
189 * Device disconnection reasons; received from stack
191 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
192 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
193 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
194 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
195 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
196 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
197 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
198 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
199 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
200 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
201 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
202 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
203 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
204 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
205 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
208 * Bluetooth OTP error codes
210 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
211 #define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
212 #define BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED 0x80
213 #define BLUETOOTH_ERROR_OBJECT_NOT_SELECTED 0x81
214 #define BLUETOOTH_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
215 #define BLUETOOTH_ERROR_OBJECT_NAME_EXISITS 0x83
216 #define BLUETOOTH_ERROR_CCC_IMPROPERLY_CONFIGURED 0xfd
219 * Device disconnect reason
222 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
223 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
224 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
225 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
226 } bluetooth_device_disconnect_reason_t;
229 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
232 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
233 } bluetooth_device_address_t;
236 * This is Bluetooth device address type
239 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
240 BLUETOOTH_DEVICE_RANDOM_ADDRESS
241 } bluetooth_device_address_type_t;
244 * This is BD Address type defined in kernel BT header
247 BLUETOOTH_BDADDR_BREDR = 0x00,
248 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
249 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
250 } bluetooth_bdaddr_type_e;
253 * This is Bluetooth version
256 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
257 } bluetooth_version_t;
260 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
263 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
264 } bluetooth_device_name_t;
267 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
270 int data_len; /**< manafacturer specific data length */
271 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
272 } bluetooth_manufacturer_data_t;
275 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
276 } bluetooth_device_pin_code_t;
282 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
283 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
284 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
285 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
286 } bluetooth_adapter_state_t;
292 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
293 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
294 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
295 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
296 } bluetooth_adapter_le_state_t;
302 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
303 /*Changed the order to make it compatable with old method */
304 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
305 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
306 /**< Discoverable mode with time limit
307 After specific timeout, it is changed
308 to non discoverable mode */
309 } bluetooth_discoverable_mode_t;
312 * Network connect mode
315 BLUETOOTH_NETWORK_PANU_ROLE,
317 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
318 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
319 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
320 } bluetooth_network_role_t;
324 * Service type matched to bt_profile_type_t of bt-service-common.h
327 BLUETOOTH_RFCOMM_SERVICE = 0x01,
328 BLUETOOTH_A2DP_SERVICE = 0x02,
329 BLUETOOTH_HSP_SERVICE = 0x04,
330 BLUETOOTH_HID_SERVICE = 0x08,
331 BLUETOOTH_NAP_SERVICE = 0x10,
332 BLUETOOTH_HFG_SERVICE = 0x20,
333 BLUETOOTH_GATT_SERVICE = 0x40,
334 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
335 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
336 BLUETOOTH_PBAP_SERVICE = 0x200,
337 } bluetooth_service_type_t;
343 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
344 /* represents that connection
345 * type can both BR/EDR and LE */
346 BLUETOOTH_DEV_CONN_BREDR = 0x00,
347 BLUETOOTH_DEV_CONN_LE = 0x01,
348 } bluetooth_conn_type_t;
354 BLUETOOTH_CODEC_ID_CVSD = 0x01,
355 BLUETOOTH_CODEC_ID_MSBC = 0x02,
356 } bluetooth_codec_type_t;
362 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
363 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
364 } bluetooth_hf_audio_connected_type_t;
370 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
371 } bluetooth_advertising_data_t;
377 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
378 } bluetooth_scan_resp_data_t;
381 * Advertising filter policy
384 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
385 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
386 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
387 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
388 } bluetooth_advertising_filter_policy_t;
394 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
395 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
396 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
397 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
398 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
399 } bluetooth_advertising_type_t;
402 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
403 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
404 } bluetooth_gatt_service_change_type_t;
407 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
408 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
409 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
410 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
411 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
412 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
413 } bt_gatt_permission_t;
416 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
417 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
418 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
419 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
420 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
421 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
422 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
423 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
424 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
425 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
426 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
427 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
428 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
429 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
430 } bt_gatt_characteristic_property_t;
433 * Remote device request types for attributes
436 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
437 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
438 } bluetooth_gatt_att_request_tyep_t;
441 * Proximity Property Type
444 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
445 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
446 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
447 } bluetooth_pxp_poperty_t;
453 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
454 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
456 BLUETOOTH_TDS_TRANSPORT_INVALID
457 } bluetooth_tds_transport_t;
460 * TDS transport state
463 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
464 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
465 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
466 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
467 } bluetooth_tds_transport_state_t;
474 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
475 } bluetooth_tds_data_t;
478 * TDS activation request
481 bluetooth_device_address_t rem_addr;
482 bluetooth_tds_transport_t transport;
483 bluetooth_tds_data_t tds_data;
484 } bluetooth_tds_activation_req_t;
487 * TDS Control Point data
490 int length; /**< Control point data length */
491 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
492 } bluetooth_control_point_data_t;
495 * TDS Indication Response data
498 bluetooth_device_address_t rem_addr; /**< Device address */
499 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
500 } bluetooth_tds_indication_res_t;
503 * Structure to hold the TDS Complete data information which is read from remote TDS provider
506 bluetooth_device_address_t device_address; /**< Device address */
507 int data_length; /**< Data length */
508 char *data; /**< Complete Transport Specific data */
509 } bluetooth_tds_transport_data_info_t;
512 * OTP Characteristics Value
515 int length; /**< Characteristics value length */
516 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
517 } bluetooth_otp_charc_data_t;
520 * Structure to hold the OTP response data from remote OTP server
523 char *handle; /**< Handle */
524 int data_length; /**< Data length */
525 char *data; /**< Read data */
526 } bluetooth_otp_resp_info_t;
529 * Structure to hold the OTC Channel Info
532 gboolean connected; /**< Connection Status */
534 char *address; /**< Remote address */
535 } bluetooth_otc_info_t;
538 * Advertising parameters
543 guint8 filter_policy;
545 } bluetooth_advertising_params_t;
551 int type; /**< passive 0, active 1 */
552 float interval; /**< LE scan interval */
553 float window; /**< LE scan window */
554 } bluetooth_le_scan_params_t;
564 } bluetooth_le_connection_param_t;
567 LE Read Maximum Data Length
570 guint16 max_tx_octets;
572 guint16 max_rx_octets;
574 } bluetooth_le_read_maximum_data_length_t;
577 LE Read Host suggested default Data Length
580 guint16 def_tx_octets;
582 } bluetooth_le_read_host_suggested_data_length_t;
585 * Samsung XSAT Vendor dependent command
590 } bluetooth_vendor_dep_at_cmd_t;
596 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
597 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
598 } bluetooth_opp_transfer_type_t;
603 } bluetooth_hf_ciev_device_event_t;
605 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
606 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
607 /**< Base ID for GAP Event */
608 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
609 /**< Base ID for SDP events */
610 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
611 /**< Base ID for RFCOMM events */
612 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
613 /**< Base ID for NETWORK events */
614 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
615 /**< Base ID for HDP events */
616 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
617 /**< Base ID for OPC events */
618 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
619 /**< Base ID for Obex Server events */
620 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
621 /**< Base ID for GATT events */
623 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
624 /**< Base ID for Audio events */
625 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
626 /**< Base ID for HID events */
627 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
628 /**< Base ID for Advertising events */
629 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
630 /**< Base ID for PBAP Client events */
631 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
632 /**< Base ID for AVRCP events */
633 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
634 /**< Base ID for IPSP events */
635 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
636 /**< Base ID for MAP events */
639 * Bluetooth event type
642 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
644 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
645 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
646 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
647 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
648 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
649 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
650 /**< Bluetooth event Discoverable timeout requested*/
651 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
652 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
653 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
654 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
655 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
656 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
657 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
658 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
659 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
660 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
661 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
662 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
663 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
664 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
665 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
666 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
667 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
668 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
669 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
670 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
671 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
673 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
674 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
675 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
676 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
677 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
679 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
680 /**< Bluetooth event serice search base id */
681 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
682 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
683 /**< RFCOMM data receive event */
684 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
685 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
687 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
689 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
690 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
692 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
694 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
695 /**< Bluetooth Network event */
696 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
697 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
698 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
699 /**< Network disconnected evnet in server */
701 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
702 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
704 BLUETOOTH_EVENT_HDP_CONNECTED
705 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
706 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
707 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
709 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
710 /* OPC Connected event */
711 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
712 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
713 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
714 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
716 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
717 BLUETOOTH_EVENT_MAP_DISCONNECTED,
719 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
720 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
721 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
722 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
723 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
725 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
726 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
727 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
728 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
729 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
730 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
731 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
732 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
733 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
734 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
735 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
736 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
737 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
739 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
740 /* Obex server authorize event*/
741 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
742 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
743 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
744 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
745 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
746 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
748 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
749 /**<Discovered GATT service characteristics event*/
750 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
751 /**<Remote GATT charateristic value changed event*/
752 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
753 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
754 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
755 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
756 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
757 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
758 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
759 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
760 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
761 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
762 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
763 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
764 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
765 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
766 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
768 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
769 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
770 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
771 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
772 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
773 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
774 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
775 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
776 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
777 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
778 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
779 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
780 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
781 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
782 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
783 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
784 BLUETOOTH_EVENT_HF_CONNECTED,
785 BLUETOOTH_EVENT_HF_DISCONNECTED,
786 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
787 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
788 BLUETOOTH_EVENT_HF_RING_INDICATOR,
789 BLUETOOTH_EVENT_HF_CALL_WAITING,
790 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
791 BLUETOOTH_EVENT_HF_CALL_STARTED,
792 BLUETOOTH_EVENT_HF_CALL_ENDED,
793 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
794 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
795 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
796 BLUETOOTH_EVENT_HF_CALL_STATUS,
797 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
798 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
799 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
800 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
801 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
802 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
803 BLUETOOTH_EVENT_HF_CALL_IDLE,
804 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
805 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
806 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
808 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
809 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
810 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
811 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
812 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
814 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
815 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
816 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
817 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
818 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
819 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
820 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
821 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
823 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
824 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
825 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
826 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
827 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
828 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
829 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
831 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
832 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
833 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
834 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
835 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
836 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
837 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
838 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
839 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
841 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
842 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
843 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
844 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
845 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
846 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
847 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
848 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
849 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
850 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
851 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
853 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
854 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
855 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
856 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
857 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
858 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
859 } bluetooth_event_type_t;
862 * This bt_service_uuid_list_t enum indicates service uuid list .
863 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
867 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
868 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
869 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
870 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
871 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
872 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
873 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
874 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
875 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
876 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
877 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
878 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
879 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
881 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
882 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
883 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
884 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
885 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
886 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
887 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
888 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
889 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
890 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
891 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
892 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
893 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
894 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
896 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
897 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
898 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
899 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
900 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
901 /**<DIRECT PRINTING*/
902 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
903 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
904 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
905 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
906 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
907 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
908 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
909 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
910 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
911 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
912 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
913 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
914 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
915 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
916 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
917 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
918 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
919 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
920 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
921 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
922 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
923 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
924 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
925 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
926 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
927 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
928 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
929 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
930 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
931 } bluetooth_service_uuid_list_t;
934 * Service class part of class of device returned from device discovery
937 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
938 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
939 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
940 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
941 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
942 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
943 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
944 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
945 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
946 } bluetooth_device_service_class_t;
950 * Major device mask (For device discovery)
953 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
954 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
955 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
956 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
957 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
958 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
959 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
960 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
961 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
962 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
963 } bluetooth_device_major_mask_t;
967 * Major device class (part of Class of Device)
970 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
971 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
972 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
973 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
974 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
975 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
976 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
977 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
978 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
979 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
980 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
981 } bluetooth_device_major_class_t;
984 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
986 /* About Computer Major class */
987 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
989 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
990 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
991 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
992 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
993 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
995 /* About Phone Major class */
996 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
997 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
998 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
999 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1000 /**< voice gateway minor class */
1001 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1003 /* About LAN/Network Access Point Major class */
1004 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1005 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1006 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1007 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1008 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1009 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1010 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1011 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1013 /* About Audio/Video Major class */
1014 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1015 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1017 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1018 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1019 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1020 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1021 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1022 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1023 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1024 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1025 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1026 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1027 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1028 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1029 /**< Video Display and Loud
1030 Speaker minor class */
1031 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1034 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1036 /* About Peripheral Major class */
1037 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1038 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1039 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1040 /**< Combo Keyboard or pointing
1041 device minorclass */
1043 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1044 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1045 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1046 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1047 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1048 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1049 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1050 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1051 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1053 /* About Imaging Major class */
1054 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1055 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1056 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1057 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1059 /* About Wearable Major class */
1060 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1061 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1062 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1063 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1064 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1066 /* About Toy Major class */
1067 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1068 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1069 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1070 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1071 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1073 /* About Health Major class */
1074 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1075 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1076 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1077 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1078 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1079 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1080 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1081 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1082 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1083 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1084 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1085 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1086 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1087 } bluetooth_device_minor_class_t;
1090 * structure to hold the device information
1093 bluetooth_device_major_class_t major_class; /**< major device class */
1094 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1095 bluetooth_device_service_class_t service_class;
1096 /**< service device class */
1097 } bluetooth_device_class_t;
1100 * Discovery Role types
1103 DISCOVERY_ROLE_BREDR = 0x1,
1105 DISCOVERY_ROLE_LE_BREDR
1106 } bt_discovery_role_type_t;
1109 * Connected state types
1112 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1113 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1114 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1115 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1116 } bluetooth_connected_link_t;
1122 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1123 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1124 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1125 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1126 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1127 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1128 } bluetooth_le_scan_filter_feature_t;
1131 * LE connection mode
1134 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1135 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1136 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1137 } bluetooth_le_connection_mode_t;
1140 * structure to hold the device information
1143 bluetooth_device_address_t device_address; /**< device address */
1144 bluetooth_device_name_t device_name; /**< device name */
1145 bluetooth_device_class_t device_class; /**< device class */
1146 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1147 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1149 int rssi; /**< received strength signal*/
1150 gboolean paired; /**< paired flag */
1151 bluetooth_connected_link_t connected; /**< connected link type */
1152 gboolean trust; /**< trust flag */
1153 gboolean is_alias_set; /** is device alias set flag**/
1154 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1155 } bluetooth_device_info_t;
1158 * structure to hold the LE device information
1161 int data_len; /**< manafacturer specific data length */
1162 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1163 } bluetooth_le_advertising_data_t;
1166 bluetooth_device_address_t device_address; /**< device address */
1167 int addr_type; /**< address type*/
1168 int rssi; /**< received strength signal*/
1169 bluetooth_le_advertising_data_t adv_ind_data;
1170 bluetooth_le_advertising_data_t scan_resp_data;
1171 } bluetooth_le_device_info_t;
1175 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1176 bluetooth_device_address_t device_address; /**< device address */
1177 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1178 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1179 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1180 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1181 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1182 bluetooth_le_advertising_data_t service_data; /**< service data */
1183 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1184 int manufacturer_id; /**< manufacturer ID */
1185 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1186 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1187 } bluetooth_le_scan_filter_t;
1190 bluetooth_device_address_t device_address; /**< device address */
1191 unsigned int mtu; /** < MTU set for the ATT connection */
1192 unsigned int status; /** < status of the MTU exchange */
1193 } bluetooth_le_att_mtu_info_t;
1196 * structure to hold the paired device information
1199 bluetooth_device_address_t device_address; /**< paired device address */
1200 bluetooth_device_name_t device_name; /**< device name */
1201 bluetooth_device_class_t device_class; /**< device class */
1202 } bluetooth_paired_device_info_t;
1205 * structure to hold the paired device information
1208 bluetooth_device_address_t device_address;
1209 /**< device address */
1210 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1211 /**< network interface name */
1212 } bluetooth_network_device_info_t;
1215 * Authentication event types
1219 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1220 BLUETOOTH_AUTH_PIN_REQUEST,
1221 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1222 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1223 } bluetooth_auth_type_t;
1226 * structure to hold the pincode/pass-key req informations
1229 bluetooth_device_address_t device_address; /**< remote device address */
1230 bluetooth_device_name_t device_name; /**< device name */
1231 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1232 } bluetooth_authentication_request_info_t;
1235 * Stucture to hold discovery option
1238 unsigned short max_response; /**< the number of maximum response */
1239 unsigned short discovery_duration;
1240 /**< duration of discovery (seconds) */
1241 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1242 classOfDevice variable */
1243 } bluetooth_discovery_option_t;
1246 * Stucture to hold event information
1249 int event; /**< event type */
1250 int result; /**< Success or error value */
1252 /**<parameter data pointer */
1254 } bluetooth_event_param_t;
1257 bluetooth_device_address_t device_addr;
1258 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1259 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1260 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1265 bluetooth_device_address_t device_addr;
1266 unsigned char addr_type;
1268 } bt_connection_info_t;
1271 * Stucture to rfcomm receive data
1276 /**< the socket fd */
1277 int buffer_size;/**< the length of the receive buffer */
1279 /**< the receive data buffer */
1280 } bluetooth_rfcomm_received_data_t;
1286 HTYPE_TRANS_HANDSHAKE,
1287 HTYPE_TRANS_HID_CONTROL,
1288 HTYPE_TRANS_GET_REPORT,
1289 HTYPE_TRANS_SET_REPORT,
1290 HTYPE_TRANS_GET_PROTOCOL,
1291 HTYPE_TRANS_SET_PROTOCOL,
1294 } bt_hid_header_type_t;
1300 PTYPE_DATA_RTYPE_INPUT,
1301 PTYPE_DATA_RTYPE_OUTPUT
1302 } bt_hid_param_type_t;
1305 * Stucture to hid receive data
1308 const char *address;
1309 bt_hid_header_type_t type;
1310 /**< Header type containing */
1311 bt_hid_param_type_t param;
1312 /**< Param type in header like INPUT Report or OutPut Report */
1313 int buffer_size;/**< the length of the receive buffer */
1315 /**< the receive data buffer */
1316 } bluetooth_hid_received_data_t;
1319 * Stucture to rfcomm connection
1323 int socket_fd; /**< the socket fd */
1324 int server_id; /* Server id */
1325 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1326 bluetooth_device_address_t device_addr;
1327 /**< device address */
1328 char uuid[BLUETOOTH_UUID_STRING_MAX];
1329 } bluetooth_rfcomm_connection_t;
1332 * Stucture to rfcomm disconnection
1336 /**< the socket fd */
1337 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1338 bluetooth_device_address_t device_addr;
1339 /**< device address */
1340 char uuid[BLUETOOTH_UUID_STRING_MAX];
1341 } bluetooth_rfcomm_disconnection_t;
1345 /**< the socket fd */
1346 bluetooth_device_address_t device_addr;
1347 /**< device address */
1348 } bluetooth_rfcomm_connection_request_t;
1352 /**< the socket fd */
1353 bluetooth_device_address_t device_addr;
1354 /**< device address */
1355 } bluetooth_hid_request_t;
1364 } bt_hdp_qos_type_t;
1370 HDP_ROLE_SOURCE = 0x0,
1372 } bt_hdp_role_type_t;
1376 * Stucture to HDP connected
1379 const char *app_handle; /**< the application handle */
1380 unsigned int channel_id; /**< the channel id */
1381 bt_hdp_qos_type_t type; /**< the QOS type */
1382 bluetooth_device_address_t device_address; /**< the remote address */
1383 } bt_hdp_connected_t;
1386 * Stucture to HDP disconnected
1389 unsigned int channel_id; /**< the channel id */
1390 bluetooth_device_address_t device_address; /**< the remote address */
1391 } bt_hdp_disconnected_t;
1394 * Stucture to HDP data indication
1397 unsigned int channel_id; /**< the channel id */
1398 const char *buffer; /**< the RX data buffer */
1399 unsigned int size; /**< the RX data size */
1400 } bt_hdp_data_ind_t;
1403 * Stucture to OPP client transfer information
1410 } bt_opc_transfer_info_t;
1412 /* TODO: MAP client structures, see above */
1414 * Stucture to Map filter fields
1419 } bt_map_list_filter_fields_info_t;
1421 /* Obex Server transfer type */
1422 #define TRANSFER_PUT "PUT"
1423 #define TRANSFER_GET "GET"
1425 * Stucture to OPP/FTP Server authorize information
1432 } bt_obex_server_authorize_into_t;
1440 } bt_obex_server_type_t;
1443 * Stucture to OPP/FTP server transfer information
1451 unsigned long file_size;
1453 bt_obex_server_type_t server_type;
1455 unsigned char *contact_auth_info;
1456 } bt_obex_server_transfer_info_t;
1459 * Stucture to OPP/FTP server connection/disconnection information
1465 } bt_obex_server_connection_info_t;
1469 * Stucture to OOB data
1473 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1474 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1475 unsigned int hash_len;
1476 unsigned int randomizer_len;
1478 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1479 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1480 unsigned int hash256_len;
1481 unsigned int randomizer256_len;
1485 * Structure to GATT attribute handle data
1491 } bt_gatt_handle_info_t;
1494 * Structure to GATT Remote service data
1501 bt_gatt_handle_info_t include_handles;
1502 bt_gatt_handle_info_t char_handle;
1503 } bt_gatt_service_property_t;
1506 * Structure to GATT Remote characteristic data
1510 char *service_handle;
1511 bt_gatt_handle_info_t handle_info;
1512 } bt_gatt_discovered_char_t;
1515 * Structure to format of GATT Characteristic Value
1519 unsigned char format;
1520 unsigned char exponent;
1521 unsigned short unit;
1522 unsigned char name_space;
1523 unsigned short description;
1524 } bt_gatt_char_format_t;
1527 * Structure to GATT Characteristic property
1535 bt_gatt_char_format_t format;
1537 unsigned int val_len;
1538 unsigned int permission;
1539 char *representation;
1540 bt_gatt_handle_info_t char_desc_handle;
1541 } bt_gatt_char_property_t;
1544 * Structure to GATT Characteristic descriptor property
1551 unsigned int val_len;
1552 } bt_gatt_char_descriptor_property_t;
1555 * Structure to GATT Characteristic value
1562 } bt_gatt_char_value_t;
1565 * Structure to GATT Read Request
1569 char *service_handle;
1573 } bt_gatt_read_req_t;
1576 * Structure to GATT Value change
1580 char *service_handle;
1583 gboolean response_needed;
1587 } bt_gatt_value_change_t;
1590 bluetooth_device_address_t device_addr;
1592 bluetooth_gatt_service_change_type_t change_type;
1593 } bt_gatt_service_change_t;
1596 * Structure to GATT characteristc Notification change
1600 char *service_handle;
1601 gboolean att_notify;
1602 } bt_gatt_char_notify_change_t;
1605 * Structure to Indication confirmation
1609 char *service_handle;
1612 } bt_gatt_indicate_confirm_t;
1615 * Structure to RSSI Signal Strength Alert
1626 * Structure to RSSI Signal Strength
1636 * Structure for RSSI Enabled or Disabled
1642 gboolean rssi_enabled;
1643 } bt_rssi_enabled_t;
1646 * Structure for RSSI Threshold
1651 int in_range_threshold;
1653 } bt_rssi_threshold_t;
1657 * Structure for Suppoted Profiles and Trusted Profiles
1664 } bt_supported_profile_trusted_t;
1667 * Structure for PBAP Folder Parameters
1670 unsigned char addressbook;
1671 unsigned char folder_type;
1675 * Structure for PBAP Pull application Parameters
1678 unsigned char format;
1679 unsigned char order;
1680 unsigned short offset;
1681 unsigned short maxlist;
1682 long long unsigned fields;
1683 } bt_pbap_pull_parameters_t;
1686 * Structure for PBAP List application Parameters
1689 unsigned char order;
1690 unsigned short offset;
1691 unsigned short maxlist;
1692 } bt_pbap_list_parameters_t;
1695 * Structure for PBAP Pull vCard application Parameters
1698 unsigned char format;
1699 long long unsigned fields;
1701 } bt_pbap_pull_vcard_parameters_t;
1704 * Structure for PBAP Search application Parameters
1707 unsigned char order;
1708 unsigned short offset;
1709 unsigned short maxlist;
1710 unsigned char search_attribute;
1711 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1712 } bt_pbap_search_parameters_t;
1715 * Structure for PBAP Connection Status
1718 bluetooth_device_address_t btaddr;
1720 } bt_pbap_connected_t;
1723 * Structure for PBAP Phonebook Size
1726 bluetooth_device_address_t btaddr;
1728 } bt_pbap_phonebook_size_t;
1731 * Structure for PBAP Phonebook Pull
1734 bluetooth_device_address_t btaddr;
1737 } bt_pbap_phonebook_pull_t;
1740 * Structure for PBAP vCard List
1743 bluetooth_device_address_t btaddr;
1747 } bt_pbap_vcard_list_t;
1750 * Structure for PBAP vCard Pull
1753 bluetooth_device_address_t btaddr;
1756 } bt_pbap_vcard_pull_t;
1759 * Structure for PBAP Phonebook search List
1762 bluetooth_device_address_t btaddr;
1766 } bt_pbap_phonebook_search_list_t;
1769 * Stucture to HF Call status information
1773 char *number; /*Phone Number */
1774 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1775 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1776 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1777 int idx; /*Call index/ID */
1778 } bt_hf_call_status_info_t;
1783 } bt_hf_call_list_s;
1789 TRUSTED_PROFILE_PBAP = 1,
1790 TRUSTED_PROFILE_MAP,
1791 TRUSTED_PROFILE_SAP,
1792 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1793 } bluetooth_trusted_profile_t;
1796 * Restricted Profile types
1799 RESTRICTED_PROFILE_HFP_HS = 1,
1800 RESTRICTED_PROFILE_A2DP,
1801 } bluetooth_restricted_profile_t;
1804 * Structure for LE data length change params
1807 bluetooth_device_address_t device_address;
1808 guint16 max_tx_octets;
1809 guint16 max_tx_time;
1810 guint16 max_rx_octets;
1811 guint16 max_rx_time;
1812 } bt_le_data_length_params_t;
1815 * Structure for proximity property change params
1818 bluetooth_device_address_t device_address;
1822 } bt_pxp_property_changed_params_t;
1825 * @brief DPM BT allowance state
1829 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1830 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1831 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1832 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1836 * @brief DPM API result
1840 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1841 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1842 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1843 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1844 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1845 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1849 * @brief DPM Policy status
1853 BLUETOOTH_DPM_STATUS_ERROR = -1,
1855 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1856 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1858 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1859 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1861 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1862 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1866 /* policy-group : BLUETOOTH */
1867 BLUETOOTH_DPM_POLICY_ALLOW,
1868 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1869 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1870 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1871 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1872 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1873 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1874 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1875 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1876 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1877 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1878 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1879 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1880 BLUETOOTH_DPM_POLICY_END,
1881 } bt_dpm_policy_cmd_t;
1884 struct bt_dpm_policy {
1890 typedef struct bt_dpm_policy bt_dpm_policy_t;
1893 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1894 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1895 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1896 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1897 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1898 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1899 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1900 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1901 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1902 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1903 BLUETOOTH_DPM_PROFILE_NONE,
1906 struct bt_dpm_profile_val {
1907 int value; /* tells whether the profile is enabled or disabled */
1909 typedef struct dpm_profile_val dpm_profile_state_t;
1912 * Structure to DPM device list
1916 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1917 } bt_dpm_device_list_t;
1920 * Structure to DPM uuid list
1924 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1925 } bt_dpm_uuids_list_t;
1928 * Structure for IPSP Interface Info
1931 bluetooth_device_address_t btaddr;
1933 } bt_ipsp_connection_info_t;
1937 char* remote_address;
1938 } bt_map_client_session_info_s;
1940 typedef char* bt_map_client_message_object_t;
1945 } bt_map_client_list_folders_filter_t;
1950 int8_t subject_length;
1959 } bt_map_client_list_messages_filter_t;
1962 bt_map_client_message_object_t message_object;
1967 char *sender_address;
1970 char *recipient_address;
1975 int64_t attachment_size;
1980 } bt_map_client_message_item_t;
1986 } bt_map_client_push_message_args_t;
1993 char *sender_address;
1996 char *recipient_address;
2005 } bt_map_client_message_t;
2008 char **names; // holding %size null-terminated folder names
2010 } bt_map_client_folders_s;
2013 bt_map_client_message_item_t *message_items;
2015 } bt_map_client_message_items_s;
2018 const char* target_file;
2020 } bt_get_message_callback_data;
2023 * Callback pointer type
2025 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2028 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2029 * @brief Set the callback function pointer for bluetooth event
2032 * This API will register the callback function, when any response and event are received from
2033 * bluetooth framework. @n
2034 * this registered callback function will be get called with appropriate event and data structures.
2035 * This function is a synchronous call. An application developer can call
2036 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2037 * type. This registered function will receive events of bluetooth_event_type_t type along with
2041 * @param[in] callback_ptr A pointer to the callback function
2042 * @param[in] user_data A pointer to user data
2043 * @return BLUETOOTH_ERROR_NONE - Success
2047 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2049 GMainLoop *main_loop = (GMainLoop*) user_data;
2053 // Code for each event
2055 g_main_loop_quit(main_loop);
2062 GMainLoop *main_loop = NULL;
2065 main_loop = g_main_loop_new(NULL, FALSE);
2066 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2067 if (ret >= BLUETOOTH_ERROR_NONE)
2069 // bluetooth_register_callback returned Success
2073 // bluetooth_register_callback returned failiure
2075 g_main_loop_run(main_loop);
2079 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2082 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2083 * @brief Set the callback function pointer for bluetooth le event
2086 * This API will register the callback function, when any response and event are received from
2087 * bluetooth framework. @n
2088 * this registered callback function will be get called with appropriate event and data structures.
2089 * This function is a synchronous call. An application developer can call
2090 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2091 * type. This registered function will receive events of bluetooth_event_type_t type along with
2095 * @param[in] callback_ptr A pointer to the callback function
2096 * @param[in] user_data A pointer to user data
2097 * @return BLUETOOTH_ERROR_NONE - Success
2101 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2104 * @fn int bluetooth_le_unregister_callback(void)
2105 * @brief Set the callback function pointer for bluetooth le event
2108 * This API will register the callback function, when any response and event are received from
2109 * bluetooth framework. @n
2110 * this registered callback function will be get called with appropriate event and data structures.
2111 * This function is a synchronous call. An application developer can call
2112 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2113 * type. This registered function will receive events of bluetooth_event_type_t type along with
2118 * @return BLUETOOTH_ERROR_NONE - Success
2122 int bluetooth_le_unregister_callback(void);
2125 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2126 * @brief Set the callback function pointer for bluetooth event
2129 * This API will register the callback function, when any response and event are received from
2130 * bluetooth framework. @n
2131 * this registered callback function will be get called with appropriate event and data structures.
2132 * This function is a synchronous call. An application developer can call
2133 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2134 * type. This registered function will receive events of bluetooth_event_type_t type along with
2139 * @return BLUETOOTH_ERROR_NONE - Success
2143 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2145 GMainLoop *main_loop = (GMainLoop*) user_data;
2149 // Code for each event
2151 g_main_loop_quit(main_loop);
2158 GMainLoop *main_loop = NULL;
2161 main_loop = g_main_loop_new(NULL, FALSE);
2162 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2163 if (ret >= BLUETOOTH_ERROR_NONE)
2165 // bluetooth_register_callback returned Success
2169 // bluetooth_register_callback returned failiure
2171 ret = bluetooth_deregister_callback(void);
2172 g_main_loop_run(main_loop);
2176 int bluetooth_unregister_callback(void);
2179 * @fn int bluetooth_enable_adapter(void)
2180 * @brief Enable the Bluetooth H/W
2183 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2184 * send request to bluetooth chip for activation.
2185 * This function is typically called at startup or when Bluetooth services are required. This
2186 * function must be called before calling any other API of Bluetooth operations.
2188 * Before performing any operations like Device discover, service search etc.., the adapter must be
2191 * This function is a asynchronous call.
2192 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2193 * through registered callback function with appropriate result code
2194 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2195 * BLUETOOTH_ERROR_NONE - Success \n
2197 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2198 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2200 * @return BLUETOOTH_ERROR_NONE - Success\n
2201 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2202 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2203 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2204 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2206 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2208 void bt_event_callback(int event, bluetooth_event_param_t *param)
2212 case BLUETOOTH_EVENT_ENABLED:
2213 if (param->result == BLUETOOTH_ERROR_NONE)
2215 // Successfully Enabled
2228 ret = bluetooth_enable_adapter();
2232 int bluetooth_enable_adapter(void);
2235 * @fn int bluetooth_disable_adapter(void)
2236 * @brief Disable the Bluetooth H/W
2239 * This function disables Bluetooth protocol stack and hardware. This function is called when
2240 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2242 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2243 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2244 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2246 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2249 * This function is a asynchronous call.
2250 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2251 * through registered callback function.
2254 * @return BLUETOOTH_ERROR_NONE - Success\n
2255 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2256 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2257 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2259 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2261 void bt_event_callback(int event, bluetooth_event_param_t *param)
2265 case BLUETOOTH_EVENT_DISABLED:
2266 if (param->result == BLUETOOTH_ERROR_NONE)
2268 // Successfully disabled
2281 ret = bluetooth_disable_adapter();
2284 int bluetooth_disable_adapter(void);
2285 int bluetooth_recover_adapter(void);
2286 int bluetooth_check_adapter_le(void);
2287 int bluetooth_enable_adapter_le(void);
2289 int bluetooth_disable_adapter_le(void);
2292 * @fn int bluetooth_reset_adapter(void)
2293 * @brief Reset the Bluetooth H/W and values
2296 * This function resets Bluetooth protocol stack and hardware. This function is called when
2297 * an user want to initialize Bluetooth environment.
2299 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2302 * This function is a synchronous call.
2304 * @return BLUETOOTH_ERROR_NONE - Success\n
2305 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2307 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2312 ret = bluetooth_reset_adapter();
2315 int bluetooth_reset_adapter(void);
2318 * @fn int bluetooth_is_supported(void)
2319 * @brief Check if the bluetooth is supported or not by the current target
2321 * This API checks whether the bluetooth is supported or not.
2322 * This API only run by root permission.
2324 * This function is a synchronous call.
2326 * @return 0 - if bluetooth is not supported\n
2327 * 1 - if bluetooth is supported\n
2328 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2333 ret = bluetooth_is_supported();
2336 int bluetooth_is_supported(void);
2340 * @fn int bluetooth_check_adapter(void)
2341 * @brief Check the current status of the Bluetooth adapter
2344 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2345 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2346 * bluetooth adapter.
2347 * This API get the adapter internal data structure and check current adapter status.
2349 * This function is a synchronous call.
2352 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2353 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2355 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2359 ret = bluetooth_check_adapter();
2362 int bluetooth_check_adapter(void);
2365 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2366 * @brief Get the local adapter bluetooth address
2369 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2370 * the adapter should be enabled.
2371 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2372 * contain Bluetooth address.
2373 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2374 * friendly name for each device.
2375 * There is no event callback for this API.
2377 * This function is a synchronous call.
2380 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2381 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2382 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2383 * @param[out] local_address a device address of local bluetooth adapter
2388 bluetooth_device_address_t local_address={0,};
2391 ret = bluetooth_get_local_address(&local_address);
2394 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2397 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2398 * @brief Get the hci version
2401 * This function is used to get the bluetooth hci version
2402 * Before calling this API make sure that the adapter is enabled.
2404 * This function is a synchronous call.
2407 * @return BLUETOOTH_ERROR_NONE - Success \n
2408 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2409 * @param[out] timeout remain visibility timeout value
2412 bluetooth_version_t *version;
2414 ret = bluetooth_get_local_version (&version);
2417 int bluetooth_get_local_version(bluetooth_version_t *version);
2420 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2421 * @brief Get the local device name
2424 * This function is used, get the local device name. Since its difficult to remember the Adapter
2425 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2426 * friendly name is retrived by the remote device and displaying.
2427 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2429 * This function is a synchronous call.
2432 * @return BLUETOOTH_ERROR_NONE - Success \n
2433 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2434 * @param[out] local_name a local device name
2438 bluetooth_device_name_t local_name={0,}
2440 ret = bluetooth_get_local_name (&local_name);
2443 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2446 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2447 * @brief Set the local device name
2450 * This function is used to set the local device name. This is a human friendly name whose
2451 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2453 * This function is a synchronous call.
2455 * @param[in] local_name bluetooth device name to set local device
2457 * @return BLUETOOTH_ERROR_NONE - Success \n
2458 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2459 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2460 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2461 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2462 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2467 bluetooth_device_name_t local_name={0,}
2469 ret = bluetooth_set_local_name (&local_name);
2472 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2476 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2477 * @brief Check if the uuid is used or not
2479 * This function is used to check if the uuid is used or not.
2481 * This function is a synchronous call.
2483 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2484 * @param[out] used if the uuid is used or not
2486 * @return BLUETOOTH_ERROR_NONE - Success \n
2487 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2488 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2489 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2494 gboolean used = FALSE;
2495 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2496 ret = bluetooth_is_service_used(uuid, &used);
2499 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2502 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2503 * @brief Check if the device is connected to the specific service
2505 * This function is used to check if if the device is connected to the specific service.
2507 * This function is a synchronous call.
2509 * @param[in] local_address a device address of remote bluetooth device
2510 * @param[in] type the service type
2511 * @param[out] is_connected if the device is connected or not
2513 * @return BLUETOOTH_ERROR_NONE - Success \n
2514 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2515 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2516 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2521 gboolean is_connected = FALSE;
2522 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2523 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2526 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2527 bluetooth_service_type_t type,
2528 gboolean *is_connected);
2531 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2532 * @brief Gets device's connected link type
2534 * This function is used to get device's connected link type
2536 * This function is a synchronous call.
2538 * @param[in] device_address a device address of remote bluetooth device
2539 * @param[out] connected_link a device's connected link type
2541 * @return BLUETOOTH_ERROR_NONE - Success \n
2542 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2543 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2544 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2549 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2550 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2551 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2554 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2555 bluetooth_connected_link_t *connected_link);
2558 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2559 * @brief Sets a profile trusted for a device
2561 * This function is used to Set a profile as trusted for a device
2563 * This function is a synchronous call.
2565 * @param[in] device_address a device address of remote bluetooth device
2566 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2567 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2569 * @return BLUETOOTH_ERROR_NONE - Success \n
2570 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2571 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2572 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2576 int bluetooth_set_profile_trusted(
2577 const bluetooth_device_address_t *device_address,
2578 int profile, int trust);
2581 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2582 * @brief Gets a profile is trusted for a device
2584 * This function is used to Get a profile is trusted or not for a device
2586 * This function is a synchronous call.
2588 * @param[in] device_address a device address of remote bluetooth device
2589 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2590 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2592 * @return BLUETOOTH_ERROR_NONE - Success \n
2593 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2594 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2595 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2599 int bluetooth_get_profile_trusted(
2600 const bluetooth_device_address_t *device_address,
2601 int profile, int *trust);
2604 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2605 * @brief Sets a profile restricted connection for a device
2607 * This function is used to Set a profile as restricted for a device
2609 * This function is a synchronous call.
2611 * @param[in] device_address a device address of remote bluetooth device
2612 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2613 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2615 * @return BLUETOOTH_ERROR_NONE - Success \n
2616 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2617 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2618 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2622 int bluetooth_set_profile_restricted(
2623 const bluetooth_device_address_t *device_address,
2624 int profile, int restricted);
2627 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2628 * @brief Gets a restricted connection state
2630 * This function is used to Get a profile is restricted or not for a device
2632 * This function is a synchronous call.
2634 * @param[in] device_address a device address of remote bluetooth device
2635 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2636 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2638 * @return BLUETOOTH_ERROR_NONE - Success \n
2639 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2640 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2641 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2645 int bluetooth_get_profile_restricted(
2646 const bluetooth_device_address_t *device_address,
2647 int profile, int *restricted);
2650 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2651 * @brief Get the visibility mode
2654 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2655 * visibity mode, the property of the device is determined whether it can be discoverable, non
2656 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2658 * This function is a synchronous call.
2661 * @return BLUETOOTH_ERROR_NONE - Success \n
2662 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2663 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2664 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2665 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2666 * @param[out] discoverable_mode current bluetooth discoverable mode
2668 * @see bluetooth_set_discoverable_mode
2670 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2672 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2675 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2678 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2680 * @brief Set the visibility mode
2683 * This function is used to set the discoverable mode (Visibility option).
2685 * Many times user may want to keep his device discoverable so that when peer device is performing
2686 * device search, he/she can find user's device. Application programmer can keep the mode as
2687 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2688 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2689 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2690 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2692 * This function is a synchronous call.
2694 * @return BLUETOOTH_ERROR_NONE - Success \n
2695 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2697 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2698 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2700 * @see bluetooth_get_discoverable_mode
2704 bluetooth_discoverable_mode_t mode;
2706 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2707 ret = bluetooth_set_discoverable_mode (mode, 180);
2711 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2716 * @fn int bluetooth_get_timeout_value(int *timeout)
2717 * @brief Get the visibility timeout value
2720 * This function is used to get the visibility timeout
2721 * Before calling this API make sure that the adapter is enabled.
2723 * This function is a synchronous call.
2726 * @return BLUETOOTH_ERROR_NONE - Success \n
2727 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2728 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2729 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2730 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2731 * @param[out] timeout remain visibility timeout value
2733 * @see bluetooth_set_discoverable_mode
2737 ret = bluetooth_get_timeout_value (&timeout);
2740 int bluetooth_get_timeout_value(int *timeout);
2744 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2745 * unsigned int classOfDeviceMask)
2746 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2748 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2749 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2750 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2751 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2752 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2753 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2754 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2755 * please see bluetooth_device_info_t for more details.
2758 * This API provides searching options like max responses, discovery duration in seconds and class
2759 * of device mask to filter device search. some times there may be too many bluetooth devices in
2760 * vicinity of your device.in such scenario, application can request to reduce number of responces
2761 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2762 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2763 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2764 * application defined time. please note that discovery_duration should be mentioned in seconds.
2765 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2768 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2769 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2770 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2772 * This function is a asynchronous call.
2773 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2774 * through registered callback function.
2776 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2777 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2779 * The completion or cancellation of the discovery is indicated by an
2780 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2782 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2785 * @return BLUETOOTH_ERROR_NONE - Success \n
2786 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2787 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2788 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2789 agent is not running \n
2791 * @param[in] max_response define the maximum response of the number of founded devices
2793 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2794 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2795 (refer to class of device)
2797 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2800 void bt_event_callback(int event, bluetooth_event_param_t *param)
2804 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2806 bluetooth_device_info_t *device_info = NULL;
2807 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2809 device_info = (bluetooth_device_info_t *)param->param_data;
2810 memcpy(&searched_device, &device_info->device_address,
2811 sizeof(bluetooth_device_address_t));
2812 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2813 device_info->device_address.addr[0],
2814 device_info->device_address.addr[1],
2815 device_info->device_address.addr[2],
2816 device_info->device_address.addr[3],
2817 device_info->device_address.addr[4],
2818 device_info->device_address.addr[5]);
2821 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2823 bluetooth_device_info_t *device_info = NULL;
2824 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2826 device_info = (bluetooth_device_info_t *)param->param_data;
2827 memcpy(&searched_device, &device_info->device_address,
2828 sizeof(bluetooth_device_address_t));
2829 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2830 device_info->device_name.name,
2831 device_info->device_address.addr[0],
2832 device_info->device_address.addr[1],
2833 device_info->device_address.addr[2],
2834 device_info->device_address.addr[3],
2835 device_info->device_address.addr[4],
2836 device_info->device_address.addr[5]);
2840 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2841 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2846 unsigned short max_response;
2847 unsigned short discovery_duration;
2848 unsigned classOfDeviceMask;
2852 discovery_duration =0;
2853 classOfDeviceMask =0;
2855 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2860 int bluetooth_start_discovery(unsigned short max_response,
2861 unsigned short discovery_duration,
2862 unsigned int classOfDeviceMask);
2865 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2866 * unsigned short max_response,
2867 * unsigned short discovery_duration,
2868 * unsigned int classOfDeviceMask)
2869 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2871 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2872 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2873 * Please see bluetooth_start_discovery() for other parameters description.
2875 * This function is a asynchronous call.
2876 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2877 * through registered callback function.
2879 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2880 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2882 * The completion or cancellation of the discovery is indicated by an
2883 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2885 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2888 * @return BLUETOOTH_ERROR_NONE - Success \n
2889 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2890 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2891 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2892 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2893 agent is not running \n
2895 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2896 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2897 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2898 * @param[in] max_response define the maximum response of the number of founded devices
2900 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2901 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2902 (refer to class of device)
2904 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2907 unsigned short type;
2908 unsigned short max_response;
2909 unsigned short discovery_duration;
2910 unsigned classOfDeviceMask;
2915 discovery_duration =0;
2916 classOfDeviceMask =0;
2918 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2923 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2924 unsigned short max_response,
2925 unsigned short discovery_duration,
2926 unsigned int classOfDeviceMask);
2929 * @fn int bluetooth_cancel_discovery (void)
2930 * @brief Cancel the on-going device discovery operation
2933 * This function stops the on-going device discovery operation. This API has to be called after the
2934 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2935 * the bluetooth_start_discovery API
2937 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2938 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2939 * cancel the discover request once the user received the device to which he wish to connect.
2941 * This function is a asynchronous call.
2942 * If the call is success to cancel discovey then the application will receive
2943 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2944 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2945 * BLUETOOTH_ERROR_NONE
2948 * @return BLUETOOTH_ERROR_NONE - Success \n
2949 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2950 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2951 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2952 other application \n
2953 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2955 * @see bluetooth_start_discovery
2957 void bt_event_callback(int event, bluetooth_event_param_t *param)
2961 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2962 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2971 ret = bluetooth_cancel_discovery();
2974 int bluetooth_cancel_discovery(void);
2977 * @fn int bluetooth_start_le_discovery(void)
2978 * @brief Start the generic device discovery which finds the LE devices.
2980 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2981 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2982 * It try to find LE devices. Bluetooth device address and name are
2983 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2984 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2985 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2986 * please see bluetooth_device_info_t for more details.
2988 * This function is a asynchronous call.
2989 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2990 * through registered callback function.
2992 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2995 * The completion or cancellation of the discovery is indicated by an
2996 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2998 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3001 * @return BLUETOOTH_ERROR_NONE - Success \n
3002 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3003 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3004 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3005 agent is not running \n
3008 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3011 void bt_event_callback(int event, bluetooth_event_param_t *param)
3015 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3017 bluetooth_device_info_t *device_info = NULL;
3018 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3020 device_info = (bluetooth_device_info_t *)param->param_data;
3021 memcpy(&searched_device, &device_info->device_address,
3022 sizeof(bluetooth_device_address_t));
3023 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3024 device_info->device_address.addr[0],
3025 device_info->device_address.addr[1],
3026 device_info->device_address.addr[2],
3027 device_info->device_address.addr[3],
3028 device_info->device_address.addr[4],
3029 device_info->device_address.addr[5]);
3033 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3034 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3040 ret = bluetooth_start_discovery();
3045 int bluetooth_start_le_discovery(void);
3048 * @fn int bluetooth_stop_le_discovery (void)
3049 * @brief Cancel the on-going device LE discovery operation
3052 * This function stops the on-going device discovery operation. This API has to be called after the
3053 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3054 * the bluetooth_start_le_discovery API
3057 * This function is a asynchronous call.
3058 * If the call is success to cancel discovey then the application will receive
3059 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3060 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3061 * BLUETOOTH_ERROR_NONE
3064 * @return BLUETOOTH_ERROR_NONE - Success \n
3065 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3066 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3067 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3068 other application \n
3069 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3071 * @see bluetooth_start_discovery
3073 void bt_event_callback(int event, bluetooth_event_param_t *param)
3077 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3078 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3087 ret = bluetooth_stop_le_discovery();
3090 int bluetooth_stop_le_discovery(void);
3093 * @fn int bluetooth_is_discovering(void)
3094 * @brief Check for the device discovery is in-progress or not.
3096 * This API is used to check the current status of the Discovery operation.If discovery is in\
3097 * progress normally other operations are not allowed.
3098 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3099 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3100 * event before performing other operations. This API is used to get for the current discovery
3101 * operation status and using bluetooth_cancel_discovery()
3102 * we can cancell the ongoing discovery process.
3103 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3106 * This function checks whether the device discovery is started or not.
3108 * This function is a synchronous call.
3111 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3112 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3113 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3116 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3120 ret = bluetooth_is_discovering ();
3123 int bluetooth_is_discovering(void);
3126 * @fn int bluetooth_is_le_discovering(void)
3127 * @brief Check for the device LE discovery is in-progress or not.
3129 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3130 * progress normally other operations are not allowed.
3131 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3132 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3133 * event before performing other operations. This API is used to get for the current discovery
3134 * operation status and using bluetooth_stop_le_discovery()
3135 * we can cancell the ongoing LE discovery process.
3136 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3139 * This function checks whether the device LE discovery is started or not.
3141 * This function is a synchronous call.
3144 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3145 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3146 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3149 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3153 ret = bluetooth_is_le_discovering ();
3156 int bluetooth_is_le_discovering(void);
3159 * @fn int bluetooth_is_le_scanning(void)
3160 * @brief Check for the device LE scan is in-progress or not.
3162 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3163 * progress normally other operations are not allowed.
3165 * This function checks whether the device LE Scan is started or not.
3167 * This function is a synchronous call.
3169 * @return TRUE - LE Scan in progress \n
3170 * FALSE - LE Scan is not in progress \n
3175 gboolean is_le_scanning = 0;
3176 is_le_scanning = bluetooth_is_le_scanning ();
3179 gboolean bluetooth_is_le_scanning(void);
3181 gboolean bluetooth_is_scan_filter_supported(void);
3184 * @fn int bluetooth_force_hcidump(int timeout)
3185 * @brief Enable /disable force-hcidump
3187 * This function control force-hcidump.
3189 * This function is a synchronous call.
3191 * @return BLUETOOTH_ERROR_NONE - Success \n
3192 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3193 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3195 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3200 int bluetooth_force_hcidump(int timeout);
3203 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3204 * @brief Register scan filter.
3206 * This function registers the scan filter.
3208 * This function is a synchronous call.
3210 * @return BLUETOOTH_ERROR_NONE - Success \n
3212 * @param[in] filter scan filter to register
3213 * @param[out] slot_id the slot ID of scan filter
3217 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3220 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3221 * @brief Register scan filter.
3223 * This function unregisters the scan filter.
3225 * This function is a synchronous call.
3227 * @return BLUETOOTH_ERROR_NONE - Success \n
3229 * @param[in] slot_id the slot ID of scan filter
3233 int bluetooth_unregister_scan_filter(int slot_id);
3236 * @fn int bluetooth_unregister_all_scan_filters(void)
3237 * @brief Register scan filter.
3239 * This function usregisters all scan filters.
3241 * This function is a synchronous call.
3243 * @return BLUETOOTH_ERROR_NONE - Success \n
3247 int bluetooth_unregister_all_scan_filters(void);
3250 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3251 int link_type, bt_rssi_threshold_t rssi_threshold)
3252 * @brief Enable RSSI monitoring
3254 * This function enables RSSI monitoring and sets threshold for a connection
3256 * @return BLUETOOTH_ERROR_NONE - Success \n
3259 * @see bluetooth_get_rssi_strength
3261 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3262 int link_type, bt_rssi_threshold_t *rssi_threshold);
3265 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3266 * @brief Gets Raw RSSI signal Strength
3268 * This function gives the Raw RSSI signal strength for a connection.
3270 * @return BLUETOOTH_ERROR_NONE - Success \n
3273 * @see bluetooth_enable_rssi
3275 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3277 int bluetooth_set_connectable(gboolean is_connectable);
3279 int bluetooth_is_connectable(gboolean *is_connectable);
3282 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3283 * @brief Initiate a bonding process
3286 * This function initiates a bonding procedure with a peer device. The bonding procedure
3287 * enables authentication and optionally encryption on the Bluetooth link.
3289 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3290 * inititate the bonding request to the devices already in the paired list.
3292 * Usually we call this API after the device discovery.
3293 * This function is a asynchronous call.
3295 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3296 * mentioed result code
3297 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3298 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3299 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3300 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3301 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3303 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3304 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3307 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3310 * @return BLUETOOTH_ERROR_NONE - Success \n
3311 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3312 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3313 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3314 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3316 * @param[in] device_address This indicates an address of the device with which the pairing
3317 * should be initiated
3319 * @see bluetooth_cancel_bonding
3321 void bt_event_callback(int event, bluetooth_event_param_t *param)
3325 case BLUETOOTH_EVENT_BONDING_FINISHED:
3327 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3328 if (param->result >= BLUETOOTH_ERROR_NONE)
3330 bluetooth_device_info_t *device_info = NULL;
3331 device_info = (bluetooth_device_info_t *)param->param_data;
3332 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3333 mjr[%#x] min[%#x] srv[%#x]",
3334 device_info->device_name.name,
3335 device_info->device_address.addr[0],
3336 device_info->device_address.addr[1],
3337 device_info->device_address.addr[2],
3338 device_info->device_address.addr[3],
3339 device_info->device_address.addr[4],
3340 device_info->device_address.addr[5],
3341 device_info->device_class.major_class,
3342 device_info->device_class.minor_class,
3343 device_info->device_class.service_class);
3357 bluetooth_device_address_t device_address={{0}};
3359 ret = bluetooth_bond_device(&device_address);
3363 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3366 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3367 * bluetooth_conn_type_t conn_type)
3368 * @brief Initiate a bonding process
3371 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3372 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3374 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3375 * inititate the bonding request to the devices already in the paired list.
3377 * Usually we call this API after the device discovery.
3378 * This function is a asynchronous call.
3380 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3381 * mentioed result code
3382 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3383 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3384 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3385 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3386 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3388 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3389 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3392 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3395 * @return BLUETOOTH_ERROR_NONE - Success \n
3396 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3397 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3398 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3399 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3401 * @param[in] device_address This indicates an address of the device with which pairing
3402 * should be initiated
3403 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3406 * @see bluetooth_cancel_bonding
3408 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3409 bluetooth_conn_type_t conn_type);
3412 * @fn int bluetooth_cancel_bonding(void)
3413 * @brief Cancel the on-going bonding process
3415 * This API is called to cancel the on-going bonding procedure. It should be called before the
3416 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3417 * This API is useful when the remote device is not responding to the bond request or we wish to
3418 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3420 * This function is a synchronous call.
3422 * @return BLUETOOTH_ERROR_NONE - Success \n
3423 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3424 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3427 * @see bluetooth_bond_device
3433 ret = bluetooth_cancel_bonding();
3436 int bluetooth_cancel_bonding(void);
3439 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3440 * @brief Remove bonding
3443 * To communicate with remote device over bluetooth link, user should bond with peer device.
3444 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3445 * API is used to remove peer device from the list. Please note that after removing the device
3446 * from bonded device list, you cannot communication with peer device until bonding happens again.
3448 * User can call this function by passing bluetooth device address of any bonded device. Please note
3449 * that after successful return of this function, any bluetooth application running on your device
3450 * will not be able to communicate with unbonded device until bond operation happens again using
3451 * bluetooth_bond_device()
3454 * This function is a asynchronous call. The request to remove the specified device from the bonded
3455 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3456 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3457 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3461 * @return BLUETOOTH_ERROR_NONE - Success \n
3462 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3463 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3464 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3465 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3466 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3467 * agent is not running \n
3468 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3471 * @param[in] device_address This indicates an address of the device to remove bonding
3475 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3478 void bt_event_callback(int event, bluetooth_event_param_t *param)
3481 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3482 bluetooth_device_address_t *dev_addr = NULL;
3484 if (param->result == BLUETOOTH_ERROR_NONE) {
3485 dev_addr = (bluetooth_device_address_t *)param->param_data;
3487 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3488 dev_addr->addr[0], dev_addr->addr[1]
3489 dev_addr->addr[2], dev_addr->addr[3]
3490 dev_addr->addr[4], dev_addr->addr[5]
3501 bluetooth_device_address_t *device_address;
3503 // copy valid device address in device_address
3505 ret = bluetooth_unbond_device(device_address);
3508 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3511 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3512 * @brief Get bonded(paired) device list
3515 * This API gets all bonded device list.
3516 * The devices in the bonded device list further can be used to perform the authorization by calling
3517 * bluetooth_authorize_device API.
3519 * This function is a synchronous call.
3520 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3521 * there is no valid information in the dev_list.
3522 * The len field in the dev_list represents the number of bonded devices. The data structure for
3523 * bonded device information is bluetooth_device_info_t.
3526 * @return BLUETOOTH_ERROR_NONE - Success \n
3527 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3529 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3531 void bt_get_bonded_devices(void)
3535 GPtrArray *devinfo = NULL;
3536 bluetooth_device_info_t *ptr;
3538 // allocate the g_pointer_array
3539 devinfo = g_ptr_array_new();
3541 ret = bluetooth_get_bonded_device_list(&devinfo);
3542 if (ret != BLUETOOTH_ERROR_NONE)
3544 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3548 printf("g pointer arrary count : [%d]", devinfo->len);
3549 for (i=0; i<devinfo->len; i++)
3551 ptr = g_ptr_array_index(devinfo, i);
3554 printf("Name [%s]\n", ptr->device_name.name);
3555 printf("Major Class [%d]\n", ptr->device_class.major_class);
3556 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3557 printf("Service Class [%d]\n", ptr->device_class.service_class);
3558 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3559 ptr->device_address.addr[0],
3560 ptr->device_address.addr[1], ptr->device_address.addr[2],
3561 ptr->device_address.addr[3],
3562 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3569 // free g_pointer_array
3570 g_ptr_array_free(devinfo, TRUE);
3575 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3577 int bluetooth_get_profile_connected_device_list(
3578 const char *profile_uuid, GPtrArray **addr_list);
3581 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3582 * bluetooth_device_info_t *dev_info)
3583 * @brief Get a bonded(paired) device
3586 * This API gets a bonded device.
3588 * This function is a synchronous call.
3589 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3590 * there is no valid information in the dev_info.
3591 * The data structure for bonded device information is bluetooth_device_info_t.
3594 * @return BLUETOOTH_ERROR_NONE - Success \n
3595 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3597 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3599 void bt_get_bonded_device(void)
3603 bluetooth_device_info_t devinfo = {0};
3604 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3606 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3607 if (ret != BLUETOOTH_ERROR_NONE)
3609 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3613 printf("Name [%s]\n", devinfo.device_name.name);
3614 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3615 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3616 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3617 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3618 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3619 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3620 devinfo.device_address.addr[5]);
3629 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3630 bluetooth_device_info_t *dev_info);
3634 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3635 * gboolean *is_alias_set)
3636 * @brief Get is_alias_set property of device
3638 * This API gets is_alias_set property of a bonded device.
3640 * This function is a synchronous call.
3641 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3642 * If not,there is no valid information in the is_alias_set.
3644 * @return BLUETOOTH_ERROR_NONE - Success \n
3645 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3650 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3652 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3655 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3656 gboolean *is_alias_set);
3659 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3660 * @brief set alias for bonded device
3663 * This function set alias for bonded device.
3665 * This function is a synchronous call.
3668 * @return BLUETOOTH_ERROR_NONE - Success \n
3669 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3670 * @param[in] device_address This indicates an address of the remote device
3671 * @param[in] alias This indicates an alias to set
3676 ret = bluetooth_set_alias(&remote_address);
3679 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3683 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3684 * @brief Get remote deivice
3687 * This function gets specific remote device.
3689 * This function is a asynchronous call.
3690 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3693 * @return BLUETOOTH_ERROR_NONE - Success \n
3694 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3695 * @param[in] device_address This indicates an address of the remote device
3700 ret = bluetooth_get_remote_device(&remote_address);
3703 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3706 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3707 * gboolean authorized)
3708 * @brief Authorize/Unauthorize a bonded device
3711 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3712 * with/without user confirmation.
3714 * If we select a paired device and make it authorized by calling this API with the authorized
3715 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3716 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3717 * then it will ask for the user conformation before the connection.
3719 * This API supposed to be called on the paired devices. Which means we have to use this API only
3720 * after successful pairing.
3722 * This function is a asynchronous call.
3723 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3725 * @return BLUETOOTH_ERROR_NONE - Success \n
3726 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3727 * @param[in] device_address This indicates an address of the device to authorize \n
3728 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3730 * @see bluetooth_get_bonded_device_list
3732 void bt_event_callback(int event, bluetooth_event_param_t *param)
3736 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3738 if (param->result == BLUETOOTH_ERROR_NONE)
3742 //device authorization failed failure
3750 bluetooth_device_address_t device_address={{0}};
3751 gboolean authorized;
3755 ret = bluetooth_authorize_device(&device_address,authorized);
3758 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3759 gboolean authorized);
3761 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3762 const bluetooth_device_pin_code_t *pin_code);
3764 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3767 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3769 * @brief Receives Legacy Passkey\pin with following authentication response types
3771 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3772 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3775 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3778 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3780 * @brief This API sends user confirmation reply to the local adapter.
3782 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3785 int bluetooth_passkey_confirmation_reply(gboolean reply);
3788 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3789 * @brief Get all services supported by remote device
3792 * This API call initiates the search for the services supported by the specified device. Normally
3793 * the service search will take a couple of seconds to get it completed. Before calling this API
3794 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3795 * perform the service search. We can get the device address by doing a device discovery operation.
3798 * This function is a asynchronous call.
3799 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3801 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3802 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3803 * event is generated with appropriate result code.
3805 * @return BLUETOOTH_ERROR_NONE - Success \n
3806 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3807 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3808 * @param[in] device_address This indicates an address of the device
3809 * whose services need to be found
3811 * @see bluetooth_cancel_service_search
3813 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3816 * @fn int bluetooth_cancel_service_search(void)
3817 * @brief Cancel the ongoing service search operation
3820 * This function cancel the ongoing service search operation. This API is usually calling after the
3821 * bluetooth_search_service API.
3822 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3823 * if the user wish to cancel the Ongoing service search operation.
3825 * This API should be called just after the bluetooth_search_service API and before the
3826 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3828 * This function is a synchronous call.
3830 * @return BLUETOOTH_ERROR_NONE - Success \n
3831 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3832 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3833 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3836 * @see bluetooth_search_service
3841 ret = bluetooth_cancel_service_search();
3844 int bluetooth_cancel_service_search(void);
3847 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3848 * @brief Register rfcomm socket with a specific uuid
3851 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3852 * descriptor of the server.
3853 * This is the first API which is called to create the server. Once we created the server socket,
3854 * we will listen on that return socket.
3855 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3858 * @return socket FD on Success \n
3859 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3860 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3861 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3862 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3863 * @param[in] UUID (128 bits)
3866 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3870 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3871 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3875 int bluetooth_rfcomm_create_socket(const char *uuid);
3878 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3879 * @brief Register rfcomm socket with a specific uuid
3882 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3883 * descriptor of the server.
3884 * This is the first API which is called to create the server. Once we created the server socket,
3885 * we will listen on that return socket.
3886 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3889 * @return socket FD on Success \n
3890 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3891 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3892 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3893 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3894 * @param[in] UUID (128 bits)
3895 * @param[in] bus_name (const char)
3896 * @param[in] path (const char)
3899 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3903 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3904 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3908 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3911 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3912 * @brief De-register the rfcomm socket
3915 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3916 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3917 * descriptor else no event will come. We will call this API only after the
3918 * bluetooth_rfcomm_listen_and_accept.
3919 * This is a synchronous call.
3921 * @return BLUETOOTH_ERROR_NONE - Success \n
3922 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3923 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3924 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3925 * @param[in] int socket_fd
3928 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3931 void bt_event_callback(int event, bluetooth_event_param_t *param)
3935 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3937 bluetooth_rfcomm_connection_t *discon_ind =
3938 (bluetooth_rfcomm_connection_t *)param->param_data;
3940 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3948 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3949 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3951 ret = bluetooth_rfcomm_remove_socket(fd);
3954 int bluetooth_rfcomm_remove_socket(int socket_fd);
3957 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3958 * @brief De-register the rfcomm socket
3961 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3962 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3963 * descriptor else no event will come. We will call this API only after the
3964 * bluetooth_rfcomm_listen_and_accept_ex.
3965 * This is a synchronous call.
3967 * @return BLUETOOTH_ERROR_NONE - Success \n
3968 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3969 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3970 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3971 * @param[in] UUID (128 bits)
3974 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3977 void bt_event_callback(int event, bluetooth_event_param_t *param)
3981 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3983 bluetooth_rfcomm_connection_t *discon_ind =
3984 (bluetooth_rfcomm_connection_t *)param->param_data;
3986 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3994 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3995 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3997 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4000 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4003 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4004 * @brief Disconnect rfcomm connection
4007 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4008 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4011 * @return BLUETOOTH_ERROR_NONE - Success \n
4012 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4013 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4014 * @param[in] int socket_fd the sending socket fd
4020 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4022 printf("Disconnection failed");
4024 printf("Disconnection Success");
4028 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4031 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4032 * @brief Rfcomm socket listen
4035 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4036 * after the bluetooth_rfcomm_create_socket API.
4037 * This API listen for the incomming connection and once it receives a connection, it will give
4038 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4039 * event to the application. This is an Asynchronous API call.
4042 * @return BLUETOOTH_ERROR_NONE - Success \n
4043 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4044 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4046 * @param[in] int socket_fd
4047 * @param[in] max pending connection.
4050 * @see bluetooth_rfcomm_create_socket
4053 void bt_event_callback(int event, bluetooth_event_param_t* param)
4057 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4059 bluetooth_rfcomm_connection_t *conn_ind =
4060 (bluetooth_rfcomm_connection_t *)param->param_data;
4062 printf("\nConnected from FD %d", conn_ind->socket_fd);
4070 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4071 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4075 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4078 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4079 * @brief Rfcomm socket listen
4082 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4083 * after the bluetooth_rfcomm_create_socket API.
4084 * This API listen for the incomming connection and once it receives a connection, it will give
4085 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4086 * event to the application. This is an Asynchronous API call.
4089 * @return BLUETOOTH_ERROR_NONE - Success \n
4090 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4091 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4093 * @param[in] int socket_fd
4094 * @param[in] max pending connection.
4099 * @see bluetooth_rfcomm_create_socket_ex
4102 void bt_event_callback(int event, bluetooth_event_param_t* param)
4106 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4108 bluetooth_rfcomm_connection_t *conn_ind =
4109 (bluetooth_rfcomm_connection_t *)param->param_data;
4111 printf("\nConnected from FD %d", conn_ind->socket_fd);
4119 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4120 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4125 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4128 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4129 * @brief Rfcomm socket listen
4132 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4133 * after the bluetooth_rfcomm_create_socket API.
4134 * This API listen for the incomming connection and once it receives a connection, it will give
4135 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4136 * event to the application. This is an Asynchronous API call.
4139 * @return BLUETOOTH_ERROR_NONE - Success \n
4140 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4141 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4143 * @param[in] int socket_fd
4144 * @param[in] max pending connection.
4147 * @see bluetooth_rfcomm_create_socket
4150 void bt_event_callback(int event, bluetooth_event_param_t* param)
4154 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4156 char *name = (char *)param->param_data;
4158 printf("\nConnected from %s", name);
4160 bluetooth_rfcomm_accept_connection();
4168 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4169 ret = bluetooth_rfcomm_listen(fd, 1);
4173 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4176 * @fn int bluetooth_rfcomm_accept_connection()
4177 * @brief Accepts the authorization request indicated by the event
4178 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4180 * This function is a synchronous call.
4182 * @return BLUETOOTH_ERROR_NONE - Success \n
4183 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4185 * @param[in] the socket fd of the server
4186 * @param[out] the socket fd of the client
4190 * @see bluetooth_rfcomm_reject_connection
4192 int bluetooth_rfcomm_accept_connection(int server_fd);
4195 * @fn int bluetooth_rfcomm_reject_connection()
4196 * @brief Rejects the authorization request indicated by the event
4197 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4199 * This function is a synchronous call.
4201 * @return BLUETOOTH_ERROR_NONE - Success \n
4202 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4204 * @param[in] the socket fd of the server
4208 * @see bluetooth_rfcomm_accept_connection
4210 int bluetooth_rfcomm_reject_connection(int server_fd);
4213 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4214 * @brief Informs whether rfcomm server uuid is available or not.
4216 * This function is a synchronous call.
4218 * @return TRUE - RFCOMM uuid is available \n
4219 * FALSE - RFCOMM uuid is not available \n
4221 * @param[in] uuid UUID string
4227 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4230 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4231 * const char *remote_uuid)
4232 * @brief Connect to the remote device rfcomm *
4234 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4235 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4236 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4237 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4238 * initiating a connection.
4240 * @return BLUETOOTH_ERROR_NONE - Success \n
4241 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4242 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4243 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4244 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4245 * @param[in] bluetooth_device_address_t remote bt_address
4246 * @param[in] char remote uuid
4248 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4252 void bt_event_callback(int event, bluetooth_event_param_t *param)
4256 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4258 if (param->result >= BLUETOOTH_ERROR_NONE)
4260 bt_sdp_info_t *bt_sdp_info=param->param_data;
4262 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4263 bt_sdp_info->device_addr.addr[0],
4264 bt_sdp_info->device_addr.addr[1],
4265 bt_sdp_info->device_addr.addr[2],
4266 bt_sdp_info->device_addr.addr[3],
4267 bt_sdp_info->device_addr.addr[4],
4268 bt_sdp_info->device_addr.addr[5]);
4270 printf("Supported service list:\n");
4271 for(i=0; i<bt_sdp_info->service_index; i++)
4273 bt_sdp_info->service_list_array[i]);
4276 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4277 //rfcomm_test_uuid);
4281 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4283 bluetooth_rfcomm_connection_t *conn_ind =
4284 (bluetooth_rfcomm_connection_t *)param->param_data;
4286 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4287 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4288 "SERVER" : "CLIENT");
4293 bluetooth_device_address_t remote_address = {{0},};
4294 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4295 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4296 ret = bluetooth_search_service(&remote_address);
4298 printf("Seach failed, Reason = %d", ret);
4300 printf("Search Success, Ret = %d", ret);
4302 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4304 printf("Connection failed, Reason = %d", ret);
4306 printf("Connection Success, Ret = %d", ret);
4310 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4311 const char *remote_uuid);
4314 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4315 * @brief Disconnect rfcomm connection
4318 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4319 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4322 * @return BLUETOOTH_ERROR_NONE - Success \n
4323 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4324 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4325 * @param[in] char remote bt_address
4328 * @see bluetooth_rfcomm_connect
4332 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4334 printf("Disconnection failed");
4336 printf("Disconnection Success");
4341 int bluetooth_rfcomm_disconnect(int socket_fd);
4344 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4345 * @brief Write to rfcomm connection
4348 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4349 * API is used to send the data for server and the client.
4351 * @return BLUETOOTH_ERROR_NONE - Success \n
4352 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4353 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4355 * @param[in] const char *buff Data buffer to send
4356 * @param[in] int length Length of the data
4359 * @see bluetooth_rfcomm_connect
4362 char *buff = "Test data 123456789"
4363 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4365 printf("Send failed");
4367 printf("Send success");
4371 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4374 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4375 * @brief Informs whether rfcomm client is connected.
4377 * This function is a synchronous call.
4379 * @return TRUE - RFCOMM client is connected \n
4380 * FALSE - RFCOMM client is not connected \n
4386 gboolean bluetooth_rfcomm_is_client_connected(void);
4387 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4388 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4391 * @fn int bluetooth_network_activate_server(void)
4392 * @brief Activate the NAP (Network Access Point) service
4394 * This function is a asynchronous call.
4395 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4397 * @return BLUETOOTH_ERROR_NONE - Success \n
4398 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4399 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4400 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4403 * @see bluetooth_network_deactivate_server
4406 int bluetooth_network_activate_server(void);
4409 * @fn int bluetooth_network_deactivate_server(void)
4410 * @brief Deactivate the NAP (Network Access Point) service
4412 * This function is a asynchronous call.
4413 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4415 * @return BLUETOOTH_ERROR_NONE - Success \n
4416 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4417 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4418 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4421 * @see bluetooth_network_activate_server
4424 int bluetooth_network_deactivate_server(void);
4427 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4428 * bluetooth_network_role_t role,
4430 * @brief Connect the network server in the peer
4432 * This function is a asynchronous call.
4433 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4435 * @return BLUETOOTH_ERROR_NONE - Success \n
4436 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4437 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4438 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4441 * @param[in] device_address This indicates an address of the device with which the pairing
4442 * should be initiated
4443 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4444 * need to use the third parameter.
4445 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4446 * connect. UUID string
4448 * @see bluetooth_network_disconnect
4450 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4451 bluetooth_network_role_t role, char *custom_uuid);
4454 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4455 * bluetooth_network_role_t role,
4456 * char *custom_uuid)
4457 * @brief Connect the network server in the peer
4459 * This function is a asynchronous call.
4460 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED 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_DEVICE_NOT_ENABLED - Not enabled \n
4468 * @param[in] device_address This indicates an address of the device with which the pairing
4469 * should be initiated
4471 * @see bluetooth_network_connect
4473 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4476 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4477 * @brief Disconnect the device from the network
4479 * This function is an asynchronous call.
4480 * The network server disconnect request is responded by
4481 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4483 * @return BLUETOOTH_ERROR_NONE - Success \n
4484 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4485 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4486 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4489 * @param[in] device_address This indicates an address of the connected client device
4491 * @see bluetooth_network_activate_server
4493 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4498 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4499 * bt_hdp_role_type_t role,
4500 * bt_hdp_qos_type_t channel_type,
4501 * char **app_handle)
4502 * @brief Activate the HDP service for a particular data type
4504 * This function is a synchronous call.
4506 * @return BLUETOOTH_ERROR_NONE - Success \n
4507 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4508 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4509 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4512 * @param[in] data_type The data type against corresponding service
4513 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4514 * @param[in] channel_type The QOS type for the channel.
4515 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4516 * For role = HDP_ROLE_SINK, the channel_type
4517 * should be HDP_QOS_ANY.
4518 * @param[out] app_handle The application handler against corresponding service
4520 * @see bluetooth_hdp_deactivate
4522 int bluetooth_hdp_activate(unsigned short data_type,
4523 bt_hdp_role_type_t role,
4524 bt_hdp_qos_type_t channel_type,
4527 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4528 * @brief Deactivate the HDP service for a particular service using the handler
4530 * This function is a synchronous call.
4532 * @return BLUETOOTH_ERROR_NONE - Success \n
4533 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4534 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4535 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4538 * @param[in] app_handle The application handler against corresponding service
4540 * @see bluetooth_hdp_deactivate
4542 int bluetooth_hdp_deactivate(const char *app_handle);
4545 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4546 * const char *buffer, unsigned int size)
4547 * @brief Send data to the remote HDP device
4549 * This function is a synchronous call.
4551 * @return BLUETOOTH_ERROR_NONE - Success \n
4552 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4553 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4554 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4555 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4558 * @param[in] channel_id The channel id for the connection.
4559 * @param[in] buffer The pdu buffer.
4560 * @param[in] size Size of the buffer.
4562 * @see bluetooth_hdp_connect
4564 int bluetooth_hdp_send_data(unsigned int channel_id,
4565 const char *buffer, unsigned int size);
4567 * @fn int bluetooth_hdp_connect(const char *app_handle,
4568 * bt_hdp_qos_type_t channel_type,
4569 * const bluetooth_device_address_t *device_address)
4570 * @brief Connect to the remote device(Mainly used by source)
4572 * This function is a asynchronous call.
4573 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4575 * @return BLUETOOTH_ERROR_NONE - Success \n
4576 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4577 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4578 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4579 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4582 * @param[in] app_handle The application handler against corresponding service
4583 * @param[in] channel_type The QOS type for the channel.
4584 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4585 * @param[in] device_address The remote device Bd address.
4588 * @see bluetooth_hdp_disconnect
4590 int bluetooth_hdp_connect(const char *app_handle,
4591 bt_hdp_qos_type_t channel_type,
4592 const bluetooth_device_address_t *device_address);
4594 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4595 * const bluetooth_device_address_t *device_address)
4596 * @brief Disconnect from the remote device(Mainly used by source)
4598 * This function is a asynchronous call.
4599 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4601 * @return BLUETOOTH_ERROR_NONE - Success \n
4602 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4603 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4604 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4605 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4608 * @param[in] channel_id The channel id for the connection.
4609 * @param[in] device_address The remote device Bd address.
4612 * @see bluetooth_hdp_connect
4614 int bluetooth_hdp_disconnect(unsigned int channel_id,
4615 const bluetooth_device_address_t *device_address);
4619 * @fn int bluetooth_opc_init(void)
4620 * @brief Initialize OPP client.
4622 * This function is a synchronous call.
4623 * No event corresponding to this api
4625 * @return BLUETOOTH_ERROR_NONE - Success \n
4626 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4627 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4628 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4629 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4634 * @see bluetooth_opc_deinit
4636 int bluetooth_opc_init(void);
4639 * @fn int bluetooth_opc_deinit(void)
4640 * @brief Deinitialize OPP client.
4642 * This function is a synchronous call.
4643 * No event corresponding to this api
4645 * @return BLUETOOTH_ERROR_NONE - Success \n
4646 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4647 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4652 * @see bluetooth_opc_init
4655 int bluetooth_opc_deinit(void);
4658 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4659 char **file_name_array)
4660 * @brief Send multiple files to a remote device.
4662 * This function is a asynchronous call.
4663 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4665 * @return BLUETOOTH_ERROR_NONE - Success \n
4666 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4667 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4668 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4669 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4670 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4671 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4674 * @param[in] device_address The remote device Bd address.
4675 * @param[in] file_name_array Array of filepaths to be sent.
4678 * @see bluetooth_opc_cancel_push
4681 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4682 char **file_name_array);
4685 * @fn int bluetooth_opc_cancel_push(void)
4686 * @brief Cancels the ongoing file push.
4688 * This function is a asynchronous call.
4689 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4690 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4692 * @return BLUETOOTH_ERROR_NONE - Success \n
4693 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4694 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4699 * @see bluetooth_opc_push_files
4702 int bluetooth_opc_cancel_push(void);
4705 * @fn gboolean bluetooth_opc_session_is_exist(void)
4706 * @brief Informs whether opc session exists or not.
4708 * This function is a synchronous call.
4710 * @return TRUE - OPC session exists \n
4711 * FALSE - OPC session does not exist \n
4719 gboolean bluetooth_opc_session_is_exist(void);
4722 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4723 * @brief Informs whether opc session exists or not.
4725 * This function is a synchronous call.
4727 * @return BLUETOOTH_ERROR_NONE - Success \n
4728 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4729 * BLUETOOTH_ERROR_INTERNAL \n
4732 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4737 int bluetooth_opc_is_sending(gboolean *is_sending);
4740 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4741 int transfer_id, unsigned char *progress)
4742 * @brief Gets the percentage progress for ongoing transfers.
4744 * This function is a synchronous call.
4746 * @return BLUETOOTH_ERROR_NONE - Success \n
4747 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4748 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4751 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4752 * @param[in] transfer_id Transfer ID
4753 * @param[out] progress Percentage Progress
4757 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4758 int transfer_id, unsigned char *progress);
4761 * @fn int bluetooth_obex_server_init(const char *dst_path)
4762 * @brief Initialize OPP and FTP server.
4764 * This function is a synchronous call.
4765 * No event corresponding to this api
4767 * @return BLUETOOTH_ERROR_NONE - Success \n
4768 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4769 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4770 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4771 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4774 * @param[in] dst_path OPS destination file path.
4776 * @see bluetooth_obex_server_deinit
4778 int bluetooth_obex_server_init(const char *dst_path);
4782 * @fn int bluetooth_obex_server_deinit(void)
4783 * @brief Deinitialize OPP and FTP server.
4785 * This function is a synchronous call.
4786 * No event corresponding to this api
4788 * @return BLUETOOTH_ERROR_NONE - Success \n
4789 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4790 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4795 * @see bluetooth_obex_server_init
4797 int bluetooth_obex_server_deinit(void);
4801 * @fn gboolean bluetooth_obex_server_is_activated(void)
4802 * @brief Informs whether obex server is activated or not.
4804 * This function is a synchronous call.
4806 * @return TRUE - OBEX server is activated \n
4807 * FALSE - OBEX server is not activated \n
4814 gboolean bluetooth_obex_server_is_activated(void);
4818 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4819 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4821 * This function is a synchronous call.
4822 * No event corresponding to this api
4824 * @return BLUETOOTH_ERROR_NONE - Success \n
4825 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4826 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4827 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4828 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4832 * @param[in] dst_path OPS destination file path.
4834 * @see bluetooth_obex_server_deinit_without_agent
4836 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4840 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4841 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4843 * This function is a synchronous call.
4844 * No event corresponding to this api
4846 * @return BLUETOOTH_ERROR_NONE - Success \n
4847 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4848 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4853 * @see bluetooth_obex_server_init_without_agent
4855 int bluetooth_obex_server_deinit_without_agent(void);
4859 * @fn int bluetooth_obex_server_accept_connection(void)
4860 * @brief Accepts the authorization request indicated by the event
4861 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4863 * This function is a synchronous call.
4865 * @return BLUETOOTH_ERROR_NONE - Success \n
4866 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4867 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4871 * @see bluetooth_obex_server_reject_authorize
4873 int bluetooth_obex_server_accept_connection(void);
4877 * @fn int bluetooth_obex_server_reject_connection(void)
4878 * @brief Rejects the authorization request indicated by the event
4879 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4881 * This function is a synchronous call.
4883 * @return BLUETOOTH_ERROR_NONE - Success \n
4884 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4885 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4889 * @see bluetooth_obex_server_reject_authorize
4891 int bluetooth_obex_server_reject_connection(void);
4895 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4896 * @brief Accepts the authorization request indicated by the event
4897 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4899 * This function is a asynchronous call.
4900 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4902 * @return BLUETOOTH_ERROR_NONE - Success \n
4903 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4904 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4905 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4908 * @param[in] filename Authorized filename.
4911 * @see bluetooth_obex_server_reject_authorize
4914 int bluetooth_obex_server_accept_authorize(const char *filename);
4917 * @fn int bluetooth_obex_server_reject_authorize(void)
4918 * @brief Reject the authorization request indicated by the event
4919 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4921 * This function is a asynchronous call.
4922 * No event for this api..
4924 * @return BLUETOOTH_ERROR_NONE - Success \n
4925 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4926 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4931 * @see bluetooth_obex_server_accept_authorize
4934 int bluetooth_obex_server_reject_authorize(void);
4937 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4938 * @brief Set the OPS destination file path..
4940 * This function is a asynchronous call.
4941 * No event for this api..
4943 * @return BLUETOOTH_ERROR_NONE - Success \n
4944 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4945 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4946 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4949 * @param[in] dst_path OPS destination file path.
4955 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4958 * @fn int bluetooth_obex_server_set_root(const char *root)
4959 * @brief Set the FTS root folder..
4961 * This function is a asynchronous call.
4962 * No event for this api..
4964 * @return BLUETOOTH_ERROR_NONE - Success \n
4965 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4966 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4967 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4968 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4969 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4972 * @param[in] root FTS root folder.
4978 int bluetooth_obex_server_set_root(const char *root);
4981 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4982 * @brief Cancel the transfer on server
4984 * This function is an asynchronous call.
4985 * If the function call that cancels transfer is successful, the application would receive
4986 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4987 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4988 * the error code will be BLUETOOTH_ERROR_NONE
4990 * @return BLUETOOTH_ERROR_NONE - Success \n
4991 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4992 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4993 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4994 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4997 * @param[in] transfer_id transfer ID
5002 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5006 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5007 * @brief Cancel the transfer on server
5009 * This function is an asynchronous call.
5010 * If the function call that cancels transfer is successful, the application would receive
5011 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5012 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5013 * the error code will be BLUETOOTH_ERROR_NONE
5015 * @return BLUETOOTH_ERROR_NONE - Success \n
5016 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5017 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5018 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5019 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5026 int bluetooth_obex_server_cancel_all_transfers(void);
5030 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5031 * @brief Informs whether obex server is receiving or not.
5033 * This function is a synchronous call.
5035 * @return BLUETOOTH_ERROR_NONE - Success \n
5036 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5037 * BLUETOOTH_ERROR_INTERNAL \n
5040 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5045 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5049 * @fn int bluetooth_map_client_init(void)
5050 * @brief Initialize MAP client.
5052 * This function is a synchronous call.
5053 * No event corresponding to this api
5055 * @return BLUETOOTH_ERROR_NONE - Success \n
5056 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5057 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5058 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5059 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5064 * @see bluetooth_map_client_deinit
5066 int bluetooth_map_client_init(void);
5068 int bluetooth_map_client_deinit(void);
5070 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5072 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5074 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5076 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5077 bt_map_client_list_folders_filter_t *filter);
5080 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5081 * @brief Return all available fields that can be used in Fields filter.
5083 * This function is a asynchronous call.
5085 * @return BLUETOOTH_ERROR_NONE - Success \n
5086 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5087 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5090 * @param[in] session Information about session.
5093 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5095 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5097 bt_map_client_list_messages_filter_t *filter);
5099 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5101 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5102 const char *source_file,
5104 bt_map_client_push_message_args_t *args);
5106 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5107 const bt_map_client_message_object_t message_object,
5108 const char *target_file,
5113 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5114 * @brief Read the local Hash and Randmizer.
5116 * This function is a synchronous call.
5118 * @return BLUETOOTH_ERROR_NONE - Success \n
5119 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5123 * @param[out] local_oob_data - Pointer to the local OOB data
5129 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5133 * @fn int bluetooth_oob_add_remote_data(
5134 * const bluetooth_device_address_t *remote_device_address,
5135 * bluetooth_bdaddr_type_e address_type,
5136 * bt_oob_data_t *oob_data)
5137 * @brief Add/updated the remote device Hash and Randmizer.
5139 * This function is a synchronous call.
5140 * No event for this api..
5142 * @return BLUETOOTH_ERROR_NONE - Success \n
5143 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5146 * @param[in] remote_device_address - Remote device address
5147 * address_type - bdaddr type
5148 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5154 int bluetooth_oob_add_remote_data(
5155 const bluetooth_device_address_t *remote_device_address,
5156 bluetooth_bdaddr_type_e address_type,
5157 bt_oob_data_t *remote_oob_data);
5161 * @fn int bluetooth_oob_remove_remote_data(
5162 * const bluetooth_device_address_t *remote_device_address)
5163 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5165 * This function is a synchronous call.
5166 * No event for this api..
5168 * @return BLUETOOTH_ERROR_NONE - Success \n
5169 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5172 * @param[in] remote_device_address - Remote device address
5178 int bluetooth_oob_remove_remote_data(
5179 const bluetooth_device_address_t *remote_device_address);
5182 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5183 * bt_gatt_handle_info_t *prim_svc);
5185 * @brief Gets the GATT based primary services handle supported by remote device
5187 * This function is a synchronous call.
5188 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5190 * @return BLUETOOTH_ERROR_NONE - Success \n
5191 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5192 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5193 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5196 * @param[in] address - Remote device address
5197 * @param[out] prim_svc - Structure containing remote service count and handle list.
5200 * @see bluetooth_gatt_free_primary_services()
5202 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5203 bt_gatt_handle_info_t *prim_svc);
5206 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5208 * @brief Discovers the characteristics of GATT based service of remote device
5210 * This function is an asynchronous call.
5211 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5213 * @return BLUETOOTH_ERROR_NONE - Success \n
5214 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5215 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5216 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5219 * @param[in] service_handle - Handle for remote service.
5224 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5226 int bluetooth_gatt_set_service_change_watcher(
5227 const bluetooth_device_address_t *address, gboolean enable);
5230 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5231 * bt_gatt_service_property_t *service);
5233 * @brief Gets the properties of GATT based service of remote device
5235 * This function is a synchronous call.
5236 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5238 * @return BLUETOOTH_ERROR_NONE - Success \n
5239 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5240 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5241 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5244 * @param[in] service_handle - Handle for remote service.
5245 * @param[out] service - Structure containing remote service property.
5248 * @see bluetooth_gatt_free_service_property()
5250 int bluetooth_gatt_get_service_property(const char *service_handle,
5251 bt_gatt_service_property_t *service);
5254 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5256 * @brief Register to GATT based service to receive value change notification/indication.
5258 * This function is a synchronous call.
5259 * No event for this api.
5261 * @return BLUETOOTH_ERROR_NONE - Success \n
5262 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5263 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5264 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5267 * @param[in] service_handle - Handle for remote service.
5272 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5275 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5277 * @brief Unregister GATT based service to receive value change notification/indication.
5279 * This function is a synchronous call.
5280 * No event for this api.
5282 * @return BLUETOOTH_ERROR_NONE - Success \n
5283 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5284 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5285 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5288 * @param[in] service_handle - Handle for remote service.
5293 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5296 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5297 * bt_gatt_char_property_t *characteristic);
5299 * @brief Provides characteristic value along with properties.
5301 * This function is a synchronous call.
5302 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
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.
5311 * @param[out] characteristic - Structure containing remote characteristic property.
5314 * @see bluetooth_gatt_free_char_property()
5316 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5317 bt_gatt_char_property_t *characteristic);
5320 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5321 * bt_gatt_char_property_t *characteristic);
5323 * @brief Provides characteristic descriptor value along with its UUID.
5325 * This function is a synchronous call.
5326 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5328 * @return BLUETOOTH_ERROR_NONE - Success \n
5329 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5330 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5331 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5334 * @param[in] desc_handle - Handle for Characteristic descriptor.
5335 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5338 * @see bluetooth_gatt_free_desc_property()
5340 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5341 bt_gatt_char_descriptor_property_t *descriptor);
5345 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5346 * const guint8 *value, int length)
5348 * @brief Set characteristic value.
5350 * This function is a synchronous call.
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] char_handle - Handle for Characteristic property.
5359 * @param[in] value - New value to set for characteristic property.
5360 * @param[in] length - Length of the value to be set.
5365 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5366 const guint8 *value, int length);
5369 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5370 * const guint8 *value, int length, guint8 write_type)
5372 * @brief Set characteristic value by write type.
5374 * This function is a synchronous call if write type is "write without resonse"
5375 * and it is an asynchronous call if write type is "write with response"
5377 * @return BLUETOOTH_ERROR_NONE - Success \n
5378 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5379 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5380 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5383 * @param[in] char_handle - Handle for Characteristic property.
5384 * @param[in] value - New value to set for characteristic property.
5385 * @param[in] length - Length of the value to be set.
5386 * @param[in] write_type - Type of write.
5391 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5392 const guint8 *value, int length, guint8 write_type);
5396 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5397 * const guint8 *value, int length)
5399 * @brief Set characteristic value request.
5401 * This function is an asynchronous call.
5403 * @return BLUETOOTH_ERROR_NONE - Success \n
5404 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5405 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5406 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5409 * @param[in] char_handle - Handle for Characteristic property.
5410 * @param[in] value - New value to set for characteristic property.
5411 * @param[in] length - Length of the value to be set.
5416 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5417 const guint8 *value, int length);
5420 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5422 * @brief Read characteristic value.
5424 * This function is a asynchronous call.
5426 * @return BLUETOOTH_ERROR_NONE - Success \n
5427 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5428 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5429 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5432 * @param[in] char_handle - Handle for Characteristic property.
5437 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5440 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5441 * const char *service_uuid,
5442 * bt_gatt_service_property_t *service)
5444 * @brief Gets the service property from a device based on a particular uuid
5446 * This function is a synchronous call.
5448 * @return BLUETOOTH_ERROR_NONE - Success \n
5449 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5450 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5451 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5454 * @param[in] address - BD address of the remote device
5455 * @param[in] service_uuid - uuid of the service.
5456 * @param[out] service - Structure containing the service property.
5461 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5462 const char *service_uuid,
5463 bt_gatt_service_property_t *service);
5466 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5467 * const char *char_uuid)
5469 * @brief Gets the characteristic property from a service based on a particular char uuid
5471 * This function is an asynchronous call.
5472 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5474 * @return BLUETOOTH_ERROR_NONE - Success \n
5475 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5476 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5477 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5480 * @param[in] service_handle - Service handle.
5481 * @param[in] uuid - Characteristic uuid.
5486 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5487 const char *char_uuid);
5490 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5492 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5494 * This function is a synchronous call.
5495 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5497 * @return BLUETOOTH_ERROR_NONE - Success \n
5498 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5501 * @param[in] prim_svc - GATT handle info structure
5504 * @see bluetooth_gatt_get_primary_services()
5506 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5509 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5511 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5513 * This function is a synchronous call.
5514 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5516 * @return BLUETOOTH_ERROR_NONE - Success \n
5517 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5520 * @param[in] svc_pty - GATT service property structure.
5523 * @see bluetooth_gatt_get_service_property()
5525 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5528 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5530 * @brief Provides characteristic value along with properties.
5532 * This function is a synchronous call.
5533 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5535 * @return BLUETOOTH_ERROR_NONE - Success \n
5536 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5539 * @param[in] char_pty - GATT characteristics property structure.
5542 * @see bluetooth_gatt_get_characteristics_property()
5544 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5547 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5549 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5551 * This function is a synchronous call.
5552 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5554 * @return BLUETOOTH_ERROR_NONE - Success \n
5555 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5558 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5561 * @see bluetooth_gatt_get_char_descriptor_property()
5563 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5565 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5567 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5570 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5572 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5574 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5576 * @return BLUETOOTH_ERROR_NONE - Success \n
5577 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5580 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5584 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5587 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5589 * @brief Read characteristic descriptor value.
5591 * This function is a asynchronous call.
5593 * @return BLUETOOTH_ERROR_NONE - Success \n
5594 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5595 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5596 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5599 * @param[in] desc_handle - Handle for Characteristic descriptor
5604 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5607 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5608 * const guint8 *value, int length);
5610 * @brief Set characteristic descriptor value.
5612 * This function is a asynchronous call.
5614 * @return BLUETOOTH_ERROR_NONE - Success \n
5615 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5616 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5617 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5620 * @param[in] desc_handle - Handle for Characteristic descriptor
5621 * @param[in] value - New value to set for characteristic descriptor
5622 * @param[in] length - Length of the value to be set.
5627 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5628 const guint8 *value, int length);
5630 /* @fn int bluetooth_gatt_init(void)
5632 * @brief Initializes the gatt service.
5634 * This function is a synchronous call.
5635 * @return BLUETOOTH_ERROR_NONE - Success \n
5636 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5637 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5638 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5641 * @remark Adapter should be enabled
5642 * @see bluetooth_gatt_deinit()
5644 int bluetooth_gatt_init(void);
5646 /* @fn int bluetooth_gatt_init(void)
5648 * @brief DeInitializes the gatt service.
5650 * 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 * @remark Adapter should be enabled
5658 * @see bluetooth_gatt_init()
5660 int bluetooth_gatt_deinit(void);
5662 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5663 unsigned char **svc_path)
5665 * @brief Exports a new gatt service to the service interface.
5667 * This function is a synchronous call.
5669 * @return BLUETOOTH_ERROR_NONE - Success \n
5670 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5671 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5672 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5675 * @param[in] svc_uuid Gatt service uuid.
5676 * @param[out] svc_path service object path of the exported service.
5677 * @remark Adapter should be enabled
5678 * @see bluetooth_gatt_init()
5680 int bluetooth_gatt_add_service(const char *svc_uuid,
5683 /* @fn int bluetooth_gatt_add_new_characteristic(
5684 const char *svc_path, const char *char_uuid,
5685 bt_gatt_permission_t permissions,
5686 bt_gatt_characteristic_property_t properties,
5687 int flags_length, char **char_path);;
5689 * @brief Exports a new gatt characteristic to the characteristic interface.
5691 * This function is a synchronous call.
5692 * @return BLUETOOTH_ERROR_NONE - Success \n
5693 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5694 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5695 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5697 * @param[in] svc_path service object path of the exported service.
5698 * @param[in] char_uuid Gatt service uuid.
5699 * @param[in] properties GATT characteristic properties.
5700 * @param[out] char_path characteristic object path of the exported characteristic.
5702 * @remark Adapter should be enabled
5703 * @see bluetooth_gatt_add_service()
5705 int bluetooth_gatt_add_new_characteristic(
5706 const char *svc_path, const char *char_uuid,
5707 bt_gatt_permission_t permissions,
5708 bt_gatt_characteristic_property_t properties,
5711 /* @fn bluetooth_gatt_set_characteristic_value(
5712 const char *characteristic, const char *char_value,
5715 * @brief adds gatt charactertisic value to the given charactertistic path.
5717 * This function is a synchronous call.
5718 * @return BLUETOOTH_ERROR_NONE - Success \n
5719 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5720 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5721 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5723 * @param[in] char_value Value of the GATT characteristic to be added.
5724 * @param[in] value_length length of the chantacteristic value..
5725 * @param[out] characteristic characteristic object path..
5727 * @remark Adapter should be enabled
5728 * @see bluetooth_gatt_add_service()
5730 int bluetooth_gatt_set_characteristic_value(
5731 const char *characteristic, const char *char_value,
5734 /* @fn int bluetooth_gatt_add_descriptor(
5735 const char *char_path, const char *desc_uuid,
5736 bt_gatt_permission_t permissions,
5739 * @brief Exports a new gatt descriptor to the descriptor interface.
5741 * This function is a synchronous call.
5743 * @return BLUETOOTH_ERROR_NONE - Success \n
5744 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5745 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5746 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5749 * @param[in] desc_uuid Gatt descriptor uuid.
5750 * @param[in] desc_value GATT descriptor value.
5751 * @param[in] value_length Length of GATT descriptor value.
5752 * @param[in] permissions descriptor permissions.
5753 * @param[in] properties GATT descriptor properties.
5754 * @param[in] char_path characteristics object path of the exported character.
5756 * @remark Adapter should be enabled
5757 * @see bluetooth_gatt_add_service()
5758 * @see bluetooth_gatt_add_characteristics()
5760 int bluetooth_gatt_add_descriptor(
5761 const char *char_path, const char *desc_uuid,
5762 bt_gatt_permission_t permissions,
5765 /* @fn int bluetooth_gatt_set_descriptor_value(
5766 const char *desc_path, const char *desc_value,
5769 * @brief Adds value to the given descriptor handle.
5771 * This function is a synchronous call.
5773 * @return BLUETOOTH_ERROR_NONE - Success \n
5774 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5775 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5776 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5779 * @param[in] desc_value GATT descriptor value.
5780 * @param[in] value_length Length of GATT descriptor value.
5781 * @param[in] desc_path descriptor path to which the value needs to be added.
5783 * @remark Adapter should be enabled
5784 * @see bluetooth_gatt_add_service()
5785 * @see bluetooth_gatt_add_characteristics()
5787 int bluetooth_gatt_set_descriptor_value(
5788 const char *desc_path, const char *desc_value,
5791 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5793 * @brief Reads the Service registered on manager interface.
5795 * This function is a synchronous call.
5797 * @return BLUETOOTH_ERROR_NONE - Success \n
5798 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5799 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5800 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5803 * @param[in] svc_uuid Gatt Service uuid.
5805 * @remark Adapter should be enabled and service should be registered.
5806 * @see bluetooth_gatt_register_service()
5808 int bluetooth_gatt_get_service(const char *svc_uuid);
5810 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5812 * @brief Registers the given service path with the library.
5814 * This function is a synchronous call.
5816 * @return BLUETOOTH_ERROR_NONE - Success \n
5817 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5818 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5819 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5822 * @param[in] svc_path service object path of the exported service.
5824 * @remark Adapter should be enabled
5825 * @see bluetooth_gatt_add_service()
5826 * @see bluetooth_gatt_add_characteristics()
5827 * @see bluetooth_gatt_add_descriptor()
5828 * @see bluetooth_gatt_register_application()
5830 int bluetooth_gatt_register_service(const char *svc_path);
5832 /* @fn int bluetooth_gatt_register_application(void)
5834 * @brief Registers the application with the bluez gatt server.
5836 * This function is a synchronous call.
5838 * @return BLUETOOTH_ERROR_NONE - Success \n
5839 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5840 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5841 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5845 * @remark Adapter should be enabled
5846 * @see bluetooth_gatt_init()
5847 * @see bluetooth_gatt_add_service()
5848 * @see bluetooth_gatt_add_characteristics()
5849 * @see bluetooth_gatt_add_descriptor()
5850 * @see bluetooth_gatt_register_service()
5852 int bluetooth_gatt_register_application(void);
5854 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5856 * @brief Removes(unregister) service from the bluez gatt server db.
5858 * This function is a synchronous call.
5860 * @return BLUETOOTH_ERROR_NONE - Success \n
5861 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5862 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5863 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5866 * @param[in] svc_path service object path of the exported service.
5868 * @remark Adapter should be enabled
5869 * @see bluetooth_gatt_add_service()
5870 * @see bluetooth_gatt_add_characteristics()
5871 * @see bluetooth_gatt_add_descriptor()
5872 * @see bluetooth_gatt_register_service()
5874 int bluetooth_gatt_unregister_service(const char *svc_path);
5876 /* @fn int bluetooth_gatt_unregister_application(void)
5878 * @brief Removes(unregister) the application with the bluez gatt server,
5879 * and deletes all the service registered.
5881 * This function is a synchronous call.
5883 * @return BLUETOOTH_ERROR_NONE - Success \n
5884 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5885 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5886 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5890 * @remark Adapter should be enabled
5891 * @see bluetooth_gatt_init()
5892 * @see bluetooth_gatt_add_service()
5893 * @see bluetooth_gatt_add_characteristics()
5894 * @see bluetooth_gatt_add_descriptor()
5895 * @see bluetooth_gatt_register_service()
5896 * @see bluetooth_gatt_unregister_service()
5898 int bluetooth_gatt_unregister_application(void);
5900 /* @fn int bluetooth_gatt_send_response(int request_id,
5901 * int offset, char *value, int value_length)
5903 * @brief Updates the attribute value in local attribute list.
5905 * This function is a synchronous call.
5907 * @return BLUETOOTH_ERROR_NONE - Success \n
5908 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5909 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5910 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5913 * @param[in] request_id The identification of a read request
5914 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5915 * @param[in] resp_state The identification of response state
5916 * @param[in] offset The offset from where a value is read
5917 * @param[in] value The value to be sent. It will be sent from @a offset.
5918 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5919 * @param[in] value_length Value Length.
5921 * @remark Adapter should be enabled
5922 * @see bluetooth_gatt_add_service()
5923 * @see bluetooth_gatt_add_characteristics()
5924 * @see bluetooth_gatt_add_descriptor()
5925 * @see bluetooth_gatt_register_service()
5927 int bluetooth_gatt_send_response(int request_id, guint req_type,
5928 int resp_state, int offset, char *value, int value_length);
5930 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5932 * @brief Sets the notification property for a characteristic.
5934 * This function is a synchronous call.
5936 * @return BLUETOOTH_ERROR_NONE - Success \n
5937 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5938 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5939 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5942 * @param[in] char_path characteristic object path.
5943 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5945 * @remark Adapter should be enabled
5946 * @see bluetooth_gatt_update_characteristic()
5948 int bluetooth_gatt_server_set_notification(const char *char_path,
5949 bluetooth_device_address_t *unicast_address);
5951 /* @fn int bluetooth_gatt_delete_services(void)
5953 * @brief deletes (unregisters) all services from the gatt server database..
5955 * This function is a synchronous call.
5957 * @return BLUETOOTH_ERROR_NONE - Success \n
5958 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5959 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5960 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5964 * @remark Adapter should be enabled
5965 * @see bluetooth_gatt_add_service()
5966 * @see bluetooth_gatt_add_characteristics()
5967 * @see bluetooth_gatt_add_descriptor()
5968 * @see bluetooth_gatt_register_service()
5969 * @see bluetooth_gatt_unregister_service()
5971 int bluetooth_gatt_delete_services(void);
5973 /* @fn int bluetooth_gatt_update_characteristic(void)
5975 * @brief updates the given characteristic with a new value
5977 * This function is a synchronous call.
5979 * @return BLUETOOTH_ERROR_NONE - Success \n
5980 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5981 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5982 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5986 * @remark Adapter should be enabled
5987 * @see bluetooth_gatt_add_service()
5988 * @see bluetooth_gatt_add_characteristics()
5989 * @see bluetooth_gatt_add_descriptor()
5990 * @see bluetooth_gatt_register_service()
5991 * @see bluetooth_gatt_unregister_service()
5993 int bluetooth_gatt_update_characteristic(const char *char_path,
5994 const char* char_value, int value_length);
5997 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5999 * @brief Set advertising status.
6001 * This function is used to enable or disable LE advertising.
6002 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6004 * This function is a synchronous call.
6006 * @return BLUETOOTH_ERROR_NONE - Success \n
6007 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6008 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6011 * @param[in] enable - The status of advertising
6014 * @see bluetooth_set_advertising_data
6016 int bluetooth_set_advertising(int handle, gboolean enable);
6019 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6021 * @brief Set advertising status along with interval value.
6023 * This function is used to enable or disable LE advertising.
6024 * Interval_min and Interval_max is used to set the best advertising interval.
6025 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6027 * This function is a synchronous call.
6029 * @return BLUETOOTH_ERROR_NONE - Success \n
6030 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6031 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6034 * @param[in] enable - The status of advertising
6035 * @param[in] interval_min - Minimum interval of advertising (msec)
6036 * @param[in] interval_max - Maximum interval of advertising (msec)
6037 * @param[in] filter_policy - Advertising filter policy
6040 * @see bluetooth_set_advertising_data
6042 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6043 bluetooth_advertising_params_t *params);
6046 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6047 * @brief Get the advertising data
6049 * This function is used to get advertising data.
6050 * Before calling this API, the adapter should be enabled.
6052 * This function is a synchronous call.
6054 * @return BLUETOOTH_ERROR_NONE - Success \n
6055 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6056 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6057 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6059 * @param[out] value - Advertising data structure.
6060 * @param[out] length - The length of Advertising data.
6064 bluetooth_advertising_data_t *value = { {0} };
6067 ret = bluetooth_get_advertising_data(&value, &length);
6070 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6073 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6075 * @brief Set advertising data with value
6077 * This function is used to set advertising data and Maximum size of advertising data
6078 * is 28 byte (Except Flag)
6080 * This function is a synchronous call.
6082 * @return BLUETOOTH_ERROR_NONE - Success \n
6083 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6084 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6087 * @param[in] value - Advertising data structure.
6091 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6094 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6096 * @brief Check the privilege for advertising parameter setting
6098 * This function is a synchronous call.
6100 * @return BLUETOOTH_ERROR_NONE - Success \n
6101 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6107 int bluetooth_check_privilege_advertising_parameter(void);
6110 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6111 * @brief Get the LE scan response data
6113 * This function is used to get scan response data.
6114 * Before calling this API, the adapter should be enabled.
6116 * This function is a synchronous call.
6118 * @return BLUETOOTH_ERROR_NONE - Success \n
6119 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6120 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6121 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6123 * @param[out] value - Scan response data structure.
6124 * @param[out] length - The length of Scan response data.
6128 bluetooth_scan_resp_data_t *value = { {0} };
6131 ret = bluetooth_get_scan_response_data(&value, &length);
6134 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6137 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6139 * @brief Set scan response data with value
6141 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6143 * This function is a synchronous call.
6145 * @return BLUETOOTH_ERROR_NONE - Success \n
6146 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6147 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6150 * @param[in] value - LE Scan response data structure.
6154 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6157 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6159 * @brief Set scan interval and window
6161 * This function is used to set LE scan interval and window size
6163 * This function is a synchronous call.
6165 * @return BLUETOOTH_ERROR_NONE - Success \n
6166 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6167 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6170 * @param[in] interval - Interval of LE scan (msec)
6171 * @param[in] window - Window size of LE scan (msec)
6175 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6178 * @fn int bluetooth_is_advertising(void)
6179 * @brief Check for the advertising is in-progress or not.
6181 * This API is used to check the current status of the advertising procedure.
6182 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6185 * This function checks whether the advertising is started or not.
6187 * This function is a synchronous call.
6189 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6191 * @return BLUETOOTH_ERROR_NONE - Success \n
6192 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6195 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6199 gboolean is_advertising = 0;
6201 ret = bluetooth_is_advertising(&is_advertising);
6204 int bluetooth_is_advertising(gboolean *is_advertising);
6207 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6208 * @brief Add LE device to white list
6210 * This API is used to add LE device to white list
6211 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6215 * This function is a synchronous call.
6217 * @param[in] address The address of remote device
6219 * @return BLUETOOTH_ERROR_NONE - Success \n
6220 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6223 * @see bluetooth_set_custom_advertising
6225 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6228 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6229 * @brief Remove LE device from white list
6231 * This API is used to remove LE device from white list
6232 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6236 * This function is a synchronous call.
6238 * @param[in] address The address of remote device
6240 * @return BLUETOOTH_ERROR_NONE - Success \n
6241 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6244 * @see bluetooth_set_custom_advertising
6246 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6249 * @fn int bluetooth_clear_white_list(void)
6250 * @brief Clear white list
6252 * This API is used to clear white list
6253 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6257 * This function is a synchronous call.
6259 * @param[in] address The address of remote device
6261 * @return BLUETOOTH_ERROR_NONE - Success \n
6262 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6265 * @see bluetooth_set_custom_advertising
6267 int bluetooth_clear_white_list(void);
6270 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6271 * const bluetooth_le_connection_param_t *parameters)
6272 * @brief update connection paramter of LE connection.
6274 * This function is a synchronous call.
6276 * @return BLUETOOTH_ERROR_NONE - Success \n
6277 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6280 * @param[in] address - remote device address value.
6281 * @param[in] parameters - new connection parameters.
6284 * @see bluetooth_bond_device
6286 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6287 const bluetooth_le_connection_param_t *parameters);
6290 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6292 * @brief Enable/Disable LE Privacy feature.
6294 * This function is used to enable or disable LE Privacy feature.
6295 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6297 * This function is a synchronous call.
6299 * @return BLUETOOTH_ERROR_NONE - Success \n
6300 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6301 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6304 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6308 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6311 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6313 * @brief Enable/Disable LE static random address.
6315 * This function is used to enable or disable LE static random address.
6317 * This function is a synchronous call.
6319 * @return BLUETOOTH_ERROR_NONE - Success \n
6320 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6321 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6324 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6328 int bluetooth_set_le_static_random_address(gboolean enable);
6331 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6332 * bluetooth_le_connection_mode_t mode)
6333 * @brief update connection paramter of LE connection.
6335 * This function is a synchronous call.
6337 * @return BLUETOOTH_ERROR_NONE - Success \n
6338 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6339 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6342 * @param[in] address - remote device address value.
6343 * @param[in] mode - new connection mode.
6347 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6348 bluetooth_le_connection_mode_t mode);
6351 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6352 * @brief Request for new ATT MTU value.
6354 * This function is a asynchronous call.
6356 * @return BLUETOOTH_ERROR_NONE - Success \n
6357 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6358 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6361 * @param[in] address - remote device address value.
6362 * @param[in] mtu - MTU value to be set.
6366 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6369 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6370 * unsigned int *mtu)
6371 * @brief Gets the xisting MTU value set for a connection.
6373 * This function is a synchronous call.
6375 * @return BLUETOOTH_ERROR_NONE - Success \n
6376 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6377 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6380 * @param[in] address - remote device address value.
6381 * @param[out] mtu - MTU value set for the connection.
6385 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6389 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6390 * bluetooth_device_address_t *id_address)
6391 * @brief Gets the Identity address of remote device.
6393 * This function is a synchronous call.
6395 * @return BLUETOOTH_ERROR_NONE - Success \n
6396 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6397 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6400 * @param[in] device_rpa - remote Resolvable private address.
6401 * @param[out] id_address - remote Identity device address value.
6405 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6406 bluetooth_device_address_t *id_address);
6409 * @fn int bluetooth_le_read_maximum_data_length()
6410 * @brief reads the maximum LE data length supported in the controller.
6412 * This function is a synchronous call.
6414 * @return BLUETOOTH_ERROR_NONE - Success \n
6415 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6421 int bluetooth_le_read_maximum_data_length(
6422 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6424 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6425 * @brief writes the host suggested values for the controllers max transmitted no of payload
6426 * octects to be used for new connections.
6428 * This function is a synchronous call.
6430 * @return BLUETOOTH_ERROR_NONE - Success \n
6431 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6437 int bluetooth_le_write_host_suggested_default_data_length(
6438 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6440 int bluetooth_le_read_suggested_default_data_length(
6441 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6443 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6444 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6446 int bluetooth_pbap_init(void);
6447 int bluetooth_pbap_deinit(void);
6448 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6449 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6450 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6451 bt_pbap_folder_t *folder);
6452 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6453 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6454 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6455 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6456 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6457 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6458 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6459 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6462 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6464 * @brief Set manufacturer data with value
6466 * This function is used to set manufacturer data.
6468 * This function is a synchronous call.
6470 * @return BLUETOOTH_ERROR_NONE - Success \n
6471 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6472 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6475 * @param[in] value - Manufacturer data structure.
6479 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6481 int bluetooth_set_passkey_notification(gboolean enable);
6484 * @fn int bluetooth_dpm_is_mode_allowed(void);
6486 * @brief Checks Restriction for BT mode(BT allowed or not)
6488 * This function is a synchronous call.
6490 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6491 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6492 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6499 int bluetooth_dpm_is_mode_allowed(void);
6502 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6504 * @brief Sets Restriction for BT mode(BT allowed or not)
6506 * This function is a synchronous call.
6508 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6509 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6510 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6513 * @param[in] value - BT Allow value.
6514 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6515 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6516 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6517 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6521 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6524 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6526 * @brief Reads the Restriction for BT mode(BT allowed or not)
6528 * This function is a synchronous call.
6530 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6531 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6532 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6536 * @param[out] value - BT Allow value.
6537 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6538 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6539 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6540 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6544 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6547 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6549 * @brief Sets the Restriction for device.
6551 * This function is a synchronous call.
6553 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6554 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6555 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6558 * @param[in] value - State value.
6559 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6560 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6564 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6567 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6569 * @brief Reads the Restriction for device.
6571 * This function is a synchronous call.
6573 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6574 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6575 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6579 * @param[out] value - State value.
6580 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6581 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6585 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6588 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6590 * @brief Sets the Restriction for uuid.
6592 * This function is a synchronous call.
6594 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6595 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6596 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6599 * @param[in] value - State value.
6600 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6601 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6605 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6608 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6610 * @brief Reads the Restriction for uuid.
6612 * This function is a synchronous call.
6614 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6615 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6616 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6620 * @param[out] value - State value.
6621 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6622 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6626 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6629 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6631 * @brief Adds the device to blacklist.
6633 * This function is a synchronous call.
6635 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6636 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6637 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6640 * @param[in] device_address - Device address
6644 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6647 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6649 * @brief Adds the device to whitelist.
6651 * This function is a synchronous call.
6653 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6654 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6655 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6658 * @param[in] device_address - Device address
6662 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6665 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6667 * @brief Adds the Service UUIDS to blacklist.
6669 * This function is a synchronous call.
6671 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6672 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6673 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6676 * @param[in] service_uuids - profile or custom service uuids
6680 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6683 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6685 * @brief Adds the Service UUIDS to whitelist.
6687 * This function is a synchronous call.
6689 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6690 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6691 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6694 * @param[in] service_uuids - profile or custom service uuids
6698 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6701 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6703 * @brief Clears the devices from blacklist.
6705 * This function is a synchronous call.
6707 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6708 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6709 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6716 int bluetooth_dpm_clear_devices_from_blacklist(void);
6719 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6721 * @brief Clears the devices from whitelist.
6723 * This function is a synchronous call.
6725 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6726 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6727 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6734 int bluetooth_dpm_clear_devices_from_whitelist(void);
6737 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6739 * @brief Clears the uuids from blacklist.
6741 * This function is a synchronous call.
6743 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6744 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6745 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6752 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6755 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6757 * @brief Clears the uuids from whitelist.
6759 * This function is a synchronous call.
6761 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6762 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6763 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6770 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6773 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6775 * @brief reads the devices from blacklist.
6777 * This function is a synchronous call.
6779 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6780 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6781 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6784 * @param[out] device_list - list of devices
6788 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6791 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6793 * @brief reads the devices from whitelist.
6795 * This function is a synchronous call.
6797 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6798 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6799 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6802 * @param[out] device_list - list of devices
6806 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6809 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6811 * @brief reads the uuids from blacklist.
6813 * This function is a synchronous call.
6815 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6816 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6817 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6820 * @param[in] uuid_list - list of uuids
6824 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6827 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6829 * @brief reads the uuids from whitelist.
6831 * This function is a synchronous call.
6833 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6834 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6835 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6838 * @param[in] uuid_list - list of uuids
6842 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6845 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6847 * @brief Removes the device from whitelist.
6849 * This function is a synchronous call.
6851 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6852 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6853 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6856 * @param[in] device_address - Device address
6860 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6863 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6865 * @brief Removes the device from blacklist.
6867 * This function is a synchronous call.
6869 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6870 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6871 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6874 * @param[in] device_address - Device address
6878 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6881 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6883 * @brief Removes the Service UUIDS from whitelist.
6885 * This function is a synchronous call.
6887 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6888 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6889 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6892 * @param[in] service_uuids - profile or custom service uuids
6896 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6899 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6901 * @brief Removes the Service UUIDS from blacklist.
6903 * This function is a synchronous call.
6905 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6906 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6907 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6910 * @param[in] service_uuids - profile or custom service uuids
6914 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6917 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6919 * @brief Sets the Restriction for outgoing call.
6921 * This function is a synchronous call.
6923 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6924 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6925 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6928 * @param[in] value - State value.
6929 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6930 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6934 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6937 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6939 * @brief Reads the Restriction for outgoing call.
6941 * This function is a synchronous call.
6943 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6944 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6945 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6949 * @param[out] value - State value.
6950 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6951 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6955 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6958 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6960 * @brief Sets the Restriction for Pairing.
6962 * This function is a synchronous call.
6964 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6965 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6966 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6969 * @param[in] value - State value.
6970 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6971 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6975 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6978 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6980 * @brief Reads the Restriction for Pairing
6982 * This function is a synchronous call.
6984 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6985 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6986 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6990 * @param[out] value - State value.
6991 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6992 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6996 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6999 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7001 * @brief Sets the Restriction for using Profiles.
7003 * This function is a synchronous call.
7005 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7006 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7007 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7010 * @param[in]profile - Profile.
7011 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7012 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7013 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7014 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7015 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7016 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7017 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7018 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7019 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7020 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7021 * BLUETOOTH_DPM_PROFILE_NONE
7022 * @param[in] value - State value.
7023 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7024 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7028 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7031 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7033 * @brief Reads the Restriction for using Profiles.
7035 * This function is a synchronous call.
7037 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7038 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7039 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7042 * @param[in]profile - Profile.
7043 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7044 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7045 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7046 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7047 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7048 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7049 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7050 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7051 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7052 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7053 * BLUETOOTH_DPM_PROFILE_NONE
7054 * @param[out] value - State value.
7055 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7056 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7060 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7063 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7065 * @brief Sets the Restriction for Desktop Connectivity.
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_desktop_connectivity_state(bt_dpm_status_t value);
7083 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7085 * @brief Reads the Restriction for Desktop Connectivity.
7087 * This function is a synchronous call.
7089 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7090 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7091 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7095 * @param[out] value - State value.
7096 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7097 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7101 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7104 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7106 * @brief Sets the Restriction for Discoverable state.
7108 * This function is a synchronous call.
7110 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7111 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7112 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7115 * @param[in] value - State value.
7116 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7117 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7121 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7124 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7126 * @brief Reads the Restriction for Discoverable state.
7128 * This function is a synchronous call.
7130 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7131 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7132 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7136 * @param[out] value - State value.
7137 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7138 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7142 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7145 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7147 * @brief Sets the Restriction for linited discoverable state..
7149 * This function is a synchronous call.
7151 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7152 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7153 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7156 * @param[in] value - State value.
7157 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7158 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7162 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7165 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7167 * @brief Reads the Restriction for limited discoverable state.
7169 * This function is a synchronous call.
7171 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7172 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7173 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7177 * @param[out] value - State value.
7178 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7179 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7183 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7185 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7187 * @brief Sets the Restriction for Data trasnfer.
7189 * This function is a synchronous call.
7191 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7192 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7193 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7196 * @param[in] value - State value.
7197 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7198 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7202 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7206 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7208 * @brief Reads the Restriction for Data trasnfer.
7210 * This function is a synchronous call.
7212 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7213 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7214 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7218 * @param[out] value - State value.
7219 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7220 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7224 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7227 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7228 * bluetooth_pxp_poperty_t property, int value);
7230 * @brief Sets the Proximity alert level/properties for monitor role.
7232 * This function is a synchronous call.
7234 * @return BLUETOOTH_ERROR_NONE - Success \n
7235 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7236 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7237 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7240 * @param[in] device_address remote device address
7241 * @param[in] property proximity profile property
7242 * @param[in] value alert level/property value to be set
7247 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7248 bluetooth_pxp_poperty_t property, int value);
7251 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7252 * bluetooth_pxp_poperty_t property, int *value);
7254 * @brief Reads the Proximity alert level/properties for monitor role.
7256 * This function is a synchronous call.
7258 * @return BLUETOOTH_ERROR_NONE - Success \n
7259 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7260 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7261 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7264 * @param[in] device_address remote device address
7265 * @param[in] property proximity profile property
7266 * @param[out] value alert level/property value
7270 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7271 bluetooth_pxp_poperty_t property, int *value);
7274 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7275 * int *services_supported);
7277 * @brief Reads the Proximity Monitor profile supported properties/services.
7279 * This function is a synchronous call.
7281 * @return BLUETOOTH_ERROR_NONE - Success \n
7282 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7283 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7284 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7287 * @param[in] device_address remote device address
7288 * @param[out] services_supported proximity profile property/service
7292 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7293 int *services_supported);
7296 * @fn int bluetooth_proximity_reporter_register();
7298 * @brief Register all proximity related services in BlueZ.
7300 * This function is a synchronous call.
7302 * @return BLUETOOTH_ERROR_NONE - Success \n
7303 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7309 int bluetooth_proximity_reporter_register(void);
7312 * @fn int bluetooth_proximity_reporter_unregister();
7314 * @brief Unregister all proximity related services in BlueZ.
7316 * This function is a synchronous call.
7318 * @return BLUETOOTH_ERROR_NONE - Success \n
7319 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7325 int bluetooth_proximity_reporter_unregister(void);
7328 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7329 * bluetooth_pxp_poperty_t property, int *value);
7331 * @brief Reads the Proximity alert level/properties for reporter role.
7333 * This function is a synchronous call.
7335 * @return BLUETOOTH_ERROR_NONE - Success \n
7336 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7337 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7338 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7341 * @param[in] device_address remote device address
7342 * @param[in] property proximity profile property
7343 * @param[out] value alert level/property value
7347 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7348 bluetooth_pxp_poperty_t property, int *value);
7351 * @fn int bluetooth_tds_provider_register(void);
7353 * @brief Register Transport Discovery Provider role.
7355 * This function is a synchronous call.
7357 * @return BLUETOOTH_ERROR_NONE - Success \n
7358 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7359 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7360 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7368 int bluetooth_tds_provider_register(void);
7371 * @fn int bluetooth_tds_provider_unregister(void);
7373 * @brief Unregister Transport Discovery Provider role.
7375 * This function is a synchronous call.
7377 * @return BLUETOOTH_ERROR_NONE - Success \n
7378 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7379 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7380 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7388 int bluetooth_tds_provider_unregister(void);
7391 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7393 * @brief Create Transport Discovery Provider for a transport.
7395 * This function is a synchronous call.
7397 * @return BLUETOOTH_ERROR_NONE - Success \n
7398 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7399 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7400 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7403 * @param[in] Transport (BT, CUSTOM etc.)
7404 * @param[in] Unique handle for TDS provider.
7409 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7412 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7414 * @brief Remove previously created Transport Discovery Provider.
7416 * This function is a synchronous call.
7418 * @return BLUETOOTH_ERROR_NONE - Success \n
7419 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7422 * @param[in] Unique handle for previously created provider.
7427 int bluetooth_tds_provider_destroy(unsigned int handle);
7430 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7432 * @brief Set transport block for in advertisement and gatt db.
7434 * This function is a synchronous call.
7436 * @return BLUETOOTH_ERROR_NONE - Success \n
7437 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7438 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7439 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7442 * @param[in] Provider specific manufacturer data.
7443 * @param[in] Provider specific manufacturer data length.
7448 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7451 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7452 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7454 * @brief Set transport block for in advertisement and gatt db.
7456 * This function is a synchronous call.
7458 * @return BLUETOOTH_ERROR_NONE - Success \n
7459 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7460 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7461 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7464 * @param[in] Unique handle for TDS provider.
7465 * @param[in] Transport state (On/Off/Not Available).
7466 * @param[in] Transport specific data block.
7467 * @param[in] Transport specific data block length.
7472 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7473 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7476 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7477 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7479 * @brief Send response to TDS activation request from remoted device.
7481 * This function is a synchronous call.
7483 * @return BLUETOOTH_ERROR_NONE - Success \n
7484 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7485 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7486 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7489 * @param[in] Remote device BT address.
7490 * @param[in] Unique handle for TDS provider.
7491 * @param[in] Response for TDS activation request.
7492 * @param[in] Transport specific data block to be sent in activation response.
7493 * @param[in] Data block length.
7498 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7499 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7502 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7504 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7506 * This function is an asynchronous call.
7508 * @return BLUETOOTH_ERROR_NONE - Success \n
7509 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7510 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7511 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7512 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7515 * @param[in] device_address remote device address
7516 * @param[in] handle attribute handle
7518 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7519 * when TDS data is received from Remote provider
7521 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7522 const char *handle);
7525 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7527 * @brief Enables CCCD on Remote Provider.
7529 * This function is an asynchronous call.
7531 * @return BLUETOOTH_ERROR_NONE - Success \n
7532 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7533 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7534 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7535 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7538 * @param[in] device_address remote device address
7539 * @param[in] handle attribute handle
7541 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7542 * when Indication is enabled on Remote provider
7544 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7545 const char *handle);
7548 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7549 * unsigned char *buf, int length);
7550 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7552 * This function is an asynchronous call.
7554 * @return BLUETOOTH_ERROR_NONE - Success \n
7555 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7556 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7557 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7558 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7561 * @param[in] device_address remote device address
7562 * @param[in] handle attribute handle
7563 * @param[in] buf Control point activation param
7564 * @param[in] param length
7566 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7567 * is received from remote Provider
7569 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7570 unsigned char *buf, int length);
7573 * @fn int bluetooth_otp_server_init(const char *directory);
7575 * @brief Starts OTP server.
7577 * This function is a synchronous call.
7587 int bluetooth_otp_server_init(const char *directory);
7590 * @fn int bluetooth_otp_server_deinit();
7592 * @brief Stops OTP server.
7594 * This function is a synchronous call.
7604 int bluetooth_otp_server_deinit();
7607 * @fn int bluetooth_otp_enable_notification(const char *handle);
7609 * @brief Enable notification for remote OACP & OLCP characteristics.
7611 * This function is a synchronous call.
7621 int bluetooth_otp_enable_notification(const char *handle);
7624 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7625 * unsigned char *buf, int length);
7627 * @brief Write value on remote characteristics.
7629 * This function is a synchronous call.
7639 int bluetooth_otp_write_characteristics_value( const char *handle,
7640 unsigned char *buf, int length);
7643 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7645 * @brief Read value for remote characteristics.
7647 * This function is a synchronous call.
7657 int bluetooth_otp_read_characteristic_value(const char *handle);
7660 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7662 * @brief Read value for remote characteristics.
7664 * This function is a synchronous call.
7674 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7677 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7679 * @brief Read value for remote characteristics.
7681 * This function is a synchronous call.
7691 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7699 #endif /* __cplusplus */
7700 #endif /* _BLUETOOTH_API_H_*/