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 is Bluetooth error code
87 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
89 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
90 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
92 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
93 /**< Callback error */
94 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
95 /**< invalid paramerror */
96 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
97 /**< invalid data error */
98 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
99 /**< Memory allocation error */
100 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
101 /**< out of memory error */
102 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
103 /**< timeout error */
104 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
105 /**< No resource error */
106 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
107 /**< internal error */
108 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
109 /**< Not supported error */
110 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
111 /**< Operation is failed because
112 of not enabled BT Adapter */
113 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
114 /**< Enabling is failed because of
115 already enabled BT Adapter */
116 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
117 /**< Operation is failed because of
118 other on going operation */
119 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
120 /**< access denied error */
121 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
122 /**< max client error */
123 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
124 /**< not found error */
125 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
126 /**< service search fail */
127 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
128 /**< pairing failed error */
129 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
130 /**< Not paired error */
131 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
132 /**< no service error */
133 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
134 /**< no connection error */
135 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
136 /**< alread connected error */
137 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
138 /**< connection busy error */
139 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
140 /**< connection error */
141 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
142 /**< max connection error*/
143 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
144 /**< Not in operation */
145 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
146 /**< Cancelled by user */
147 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
148 /**< Service record registration failed */
149 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
150 /**< Operation in progress */
151 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
152 /**< authentication failed error when paring*/
153 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
154 /**< Remote host is down */
155 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
156 /**< End of device list */
158 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
159 /**< Obex agent already exists */
160 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
161 /**< Obex agent does not exist */
163 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
164 /**< Already initialized */
166 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
167 /**< Permission deined */
169 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
170 /**< Nap already done */
172 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
173 /**< Not initialized */
175 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
176 /**< Authentication rejected */
178 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
179 /**< Device Policy Restricted */
182 * Device disconnection reasons; received from stack
184 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
185 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
186 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
187 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
188 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
189 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
190 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
191 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
192 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
193 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
194 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
195 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
196 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
197 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
198 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
203 * Device disconnect reason
206 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
207 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
208 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
209 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
210 } bluetooth_device_disconnect_reason_t;
213 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
216 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
217 } bluetooth_device_address_t;
220 * This is Bluetooth device address type
223 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
224 BLUETOOTH_DEVICE_RANDOM_ADDRESS
225 } bluetooth_device_address_type_t;
228 * This is Bluetooth version
231 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
232 } bluetooth_version_t;
235 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
238 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
239 } bluetooth_device_name_t;
242 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
245 int data_len; /**< manafacturer specific data length */
246 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
247 } bluetooth_manufacturer_data_t;
250 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
251 } bluetooth_device_pin_code_t;
257 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
258 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
259 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
260 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
261 } bluetooth_adapter_state_t;
267 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
268 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
269 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
270 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
271 } bluetooth_adapter_le_state_t;
277 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
278 /*Changed the order to make it compatable with old method */
279 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
280 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
281 /**< Discoverable mode with time limit
282 After specific timeout, it is changed
283 to non discoverable mode */
284 } bluetooth_discoverable_mode_t;
287 * Network connect mode
290 BLUETOOTH_NETWORK_PANU_ROLE,
292 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
293 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
294 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
295 } bluetooth_network_role_t;
299 * Service type matched to bt_profile_type_t of bt-service-common.h
302 BLUETOOTH_RFCOMM_SERVICE = 0x01,
303 BLUETOOTH_A2DP_SERVICE = 0x02,
304 BLUETOOTH_HSP_SERVICE = 0x04,
305 BLUETOOTH_HID_SERVICE = 0x08,
306 BLUETOOTH_NAP_SERVICE = 0x10,
307 BLUETOOTH_HFG_SERVICE = 0x20,
308 BLUETOOTH_GATT_SERVICE = 0x40,
309 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
310 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
311 BLUETOOTH_PBAP_SERVICE = 0x200,
312 } bluetooth_service_type_t;
318 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
319 /* represents that connection
320 * type can both BR/EDR and LE */
321 BLUETOOTH_DEV_CONN_BREDR = 0x00,
322 BLUETOOTH_DEV_CONN_LE = 0x01,
323 } bluetooth_conn_type_t;
329 BLUETOOTH_CODEC_ID_CVSD = 0x01,
330 BLUETOOTH_CODEC_ID_MSBC = 0x02,
331 } bluetooth_codec_type_t;
337 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
338 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
339 } bluetooth_hf_audio_connected_type_t;
345 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
346 } bluetooth_advertising_data_t;
352 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
353 } bluetooth_scan_resp_data_t;
356 * Advertising filter policy
359 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
360 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
361 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
362 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
363 } bluetooth_advertising_filter_policy_t;
369 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
370 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
371 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
372 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
373 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
374 } bluetooth_advertising_type_t;
377 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
378 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
379 } bluetooth_gatt_service_change_type_t;
382 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
383 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
384 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
385 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
386 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
387 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
388 } bt_gatt_permission_t;
391 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
392 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
393 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
394 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
395 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
396 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
397 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
398 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
399 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
400 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
401 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
402 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
403 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
404 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
405 } bt_gatt_characteristic_property_t;
408 * Remote device request types for attributes
411 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
412 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
413 } bluetooth_gatt_att_request_tyep_t;
416 * Proximity Property Type
419 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
420 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
421 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
422 } bluetooth_pxp_poperty_t;
428 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
429 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
431 BLUETOOTH_TDS_TRANSPORT_INVALID
432 } bluetooth_tds_transport_t;
435 * TDS transport state
438 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
439 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
440 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
441 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
442 } bluetooth_tds_transport_state_t;
449 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
450 } bluetooth_tds_data_t;
453 * TDS activation request
456 bluetooth_device_address_t rem_addr;
457 bluetooth_tds_transport_t transport;
458 bluetooth_tds_data_t tds_data;
459 } bluetooth_tds_activation_req_t;
462 * TDS Control Point data
465 int length; /**< Control point data length */
466 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
467 } bluetooth_control_point_data_t;
470 * TDS Indication Response data
473 bluetooth_device_address_t rem_addr; /**< Device address */
474 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
475 } bluetooth_tds_indication_res_t;
478 * Structure to hold the TDS Complete data information which is read from remote TDS provider
481 bluetooth_device_address_t device_address; /**< Device address */
482 int data_length; /**< Data length */
483 char *data; /**< Complete Transport Specific data */
484 } bluetooth_tds_transport_data_info_t;
487 * Advertising parameters
492 guint8 filter_policy;
494 } bluetooth_advertising_params_t;
500 int type; /**< passive 0, active 1 */
501 float interval; /**< LE scan interval */
502 float window; /**< LE scan window */
503 } bluetooth_le_scan_params_t;
513 } bluetooth_le_connection_param_t;
516 LE Read Maximum Data Length
519 guint16 max_tx_octets;
521 guint16 max_rx_octets;
523 } bluetooth_le_read_maximum_data_length_t;
526 LE Read Host suggested default Data Length
529 guint16 def_tx_octets;
531 } bluetooth_le_read_host_suggested_data_length_t;
534 * Samsung XSAT Vendor dependent command
539 } bluetooth_vendor_dep_at_cmd_t;
545 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
546 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
547 } bluetooth_opp_transfer_type_t;
552 } bluetooth_hf_ciev_device_event_t;
554 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
555 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
556 /**< Base ID for GAP Event */
557 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
558 /**< Base ID for SDP events */
559 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
560 /**< Base ID for RFCOMM events */
561 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
562 /**< Base ID for NETWORK events */
563 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
564 /**< Base ID for HDP events */
565 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
566 /**< Base ID for OPC events */
567 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
568 /**< Base ID for Obex Server events */
569 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
570 /**< Base ID for GATT events */
572 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
573 /**< Base ID for Audio events */
574 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
575 /**< Base ID for HID events */
576 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
577 /**< Base ID for Advertising events */
578 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
579 /**< Base ID for PBAP Client events */
580 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
581 /**< Base ID for AVRCP events */
582 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
583 /**< Base ID for IPSP events */
584 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
585 /**< Base ID for MAP events */
588 * Bluetooth event type
591 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
593 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
594 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
595 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
596 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
597 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
598 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
599 /**< Bluetooth event Discoverable timeout requested*/
600 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
601 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
602 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
603 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
604 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
605 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
606 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
607 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
608 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
609 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
610 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
611 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
612 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
613 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
614 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
615 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
616 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
617 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
618 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
619 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
620 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
622 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
623 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
624 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
625 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
626 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
628 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
629 /**< Bluetooth event serice search base id */
630 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
631 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
632 /**< RFCOMM data receive event */
633 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
634 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
636 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
638 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
639 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
641 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
643 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
644 /**< Bluetooth Network event */
645 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
646 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
647 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
648 /**< Network disconnected evnet in server */
650 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
651 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
653 BLUETOOTH_EVENT_HDP_CONNECTED
654 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
655 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
656 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
658 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
659 /* OPC Connected event */
660 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
661 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
662 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
663 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
665 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
666 BLUETOOTH_EVENT_MAP_DISCONNECTED,
668 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
669 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
670 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
671 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
672 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
674 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
675 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
676 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
677 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
678 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
679 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
680 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
681 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
682 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
683 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
684 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
685 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
686 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
688 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
689 /* Obex server authorize event*/
690 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
691 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
692 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
693 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
694 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
695 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
697 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
698 /**<Discovered GATT service characteristics event*/
699 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
700 /**<Remote GATT charateristic value changed event*/
701 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
702 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
703 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
704 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
705 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
706 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
707 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
708 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
709 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
710 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
711 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
712 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
713 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
714 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
715 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
717 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
718 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
719 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
720 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
721 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
722 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
723 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
724 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
725 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
726 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
727 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
728 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
729 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
730 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
731 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
732 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
733 BLUETOOTH_EVENT_HF_CONNECTED,
734 BLUETOOTH_EVENT_HF_DISCONNECTED,
735 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
736 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
737 BLUETOOTH_EVENT_HF_RING_INDICATOR,
738 BLUETOOTH_EVENT_HF_CALL_WAITING,
739 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
740 BLUETOOTH_EVENT_HF_CALL_STARTED,
741 BLUETOOTH_EVENT_HF_CALL_ENDED,
742 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
743 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
744 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
745 BLUETOOTH_EVENT_HF_CALL_STATUS,
746 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
747 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
748 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
749 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
750 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
751 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
752 BLUETOOTH_EVENT_HF_CALL_IDLE,
753 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
754 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
755 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
757 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
758 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
759 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
760 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
761 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
763 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
764 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
765 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
766 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
767 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
768 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
769 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
770 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
772 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
773 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
774 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
775 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
776 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
777 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
778 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
780 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
781 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
782 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
783 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
784 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
785 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
786 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
787 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
788 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
790 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
791 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
792 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
793 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
794 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
795 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
796 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
797 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
798 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
799 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
800 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
801 } bluetooth_event_type_t;
804 * This bt_service_uuid_list_t enum indicates service uuid list .
805 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
809 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
810 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
811 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
812 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
813 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
814 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
815 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
816 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
817 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
818 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
819 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
820 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
821 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
823 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
824 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
825 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
826 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
827 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
828 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
829 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
830 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
831 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
832 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
833 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
834 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
835 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
836 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
838 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
839 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
840 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
841 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
842 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
843 /**<DIRECT PRINTING*/
844 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
845 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
846 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
847 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
848 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
849 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
850 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
851 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
852 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
853 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
854 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
855 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
856 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
857 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
858 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
859 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
860 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
861 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
862 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
863 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
864 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
865 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
866 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
867 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
868 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
869 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
870 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
871 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
872 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
873 } bluetooth_service_uuid_list_t;
876 * Service class part of class of device returned from device discovery
879 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
880 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
881 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
882 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
883 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
884 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
885 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
886 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
887 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
888 } bluetooth_device_service_class_t;
892 * Major device mask (For device discovery)
895 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
896 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
897 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
898 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
899 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
900 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
901 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
902 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
903 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
904 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
905 } bluetooth_device_major_mask_t;
909 * Major device class (part of Class of Device)
912 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
913 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
914 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
915 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
916 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
917 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
918 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
919 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
920 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
921 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
922 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
923 } bluetooth_device_major_class_t;
926 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
928 /* About Computer Major class */
929 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
931 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
932 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
933 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
934 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
935 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
937 /* About Phone Major class */
938 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
939 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
940 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
941 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
942 /**< voice gateway minor class */
943 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
945 /* About LAN/Network Access Point Major class */
946 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
947 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
948 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
949 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
950 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
951 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
952 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
953 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
955 /* About Audio/Video Major class */
956 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
957 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
959 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
960 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
961 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
962 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
963 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
964 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
965 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
966 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
967 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
968 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
969 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
970 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
971 /**< Video Display and Loud
972 Speaker minor class */
973 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
976 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
978 /* About Peripheral Major class */
979 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
980 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
981 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
982 /**< Combo Keyboard or pointing
985 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
986 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
987 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
988 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
989 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
990 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
991 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
992 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
993 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
995 /* About Imaging Major class */
996 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
997 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
998 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
999 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1001 /* About Wearable Major class */
1002 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1003 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1004 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1005 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1006 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1008 /* About Toy Major class */
1009 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1010 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1011 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1012 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1013 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1015 /* About Health Major class */
1016 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1017 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1018 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1019 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1020 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1021 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1022 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1023 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1024 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1025 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1026 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1027 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1028 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1029 } bluetooth_device_minor_class_t;
1032 * structure to hold the device information
1035 bluetooth_device_major_class_t major_class; /**< major device class */
1036 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1037 bluetooth_device_service_class_t service_class;
1038 /**< service device class */
1039 } bluetooth_device_class_t;
1042 * Discovery Role types
1045 DISCOVERY_ROLE_BREDR = 0x1,
1047 DISCOVERY_ROLE_LE_BREDR
1048 } bt_discovery_role_type_t;
1051 * Connected state types
1054 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1055 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1056 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1057 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1058 } bluetooth_connected_link_t;
1064 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1065 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1066 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1067 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1068 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1069 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1070 } bluetooth_le_scan_filter_feature_t;
1073 * LE connection mode
1076 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1077 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1078 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1079 } bluetooth_le_connection_mode_t;
1082 * structure to hold the device information
1085 bluetooth_device_address_t device_address; /**< device address */
1086 bluetooth_device_name_t device_name; /**< device name */
1087 bluetooth_device_class_t device_class; /**< device class */
1088 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1089 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1091 int rssi; /**< received strength signal*/
1092 gboolean paired; /**< paired flag */
1093 bluetooth_connected_link_t connected; /**< connected link type */
1094 gboolean trust; /**< trust flag */
1095 gboolean is_alias_set; /** is device alias set flag**/
1096 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1097 } bluetooth_device_info_t;
1100 * structure to hold the LE device information
1103 int data_len; /**< manafacturer specific data length */
1104 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1105 } bluetooth_le_advertising_data_t;
1108 bluetooth_device_address_t device_address; /**< device address */
1109 int addr_type; /**< address type*/
1110 int rssi; /**< received strength signal*/
1111 bluetooth_le_advertising_data_t adv_ind_data;
1112 bluetooth_le_advertising_data_t scan_resp_data;
1113 } bluetooth_le_device_info_t;
1117 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1118 bluetooth_device_address_t device_address; /**< device address */
1119 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1120 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1121 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1122 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1123 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1124 bluetooth_le_advertising_data_t service_data; /**< service data */
1125 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1126 int manufacturer_id; /**< manufacturer ID */
1127 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1128 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1129 } bluetooth_le_scan_filter_t;
1132 bluetooth_device_address_t device_address; /**< device address */
1133 unsigned int mtu; /** < MTU set for the ATT connection */
1134 unsigned int status; /** < status of the MTU exchange */
1135 } bluetooth_le_att_mtu_info_t;
1138 * structure to hold the paired device information
1141 bluetooth_device_address_t device_address; /**< paired device address */
1142 bluetooth_device_name_t device_name; /**< device name */
1143 bluetooth_device_class_t device_class; /**< device class */
1144 } bluetooth_paired_device_info_t;
1147 * structure to hold the paired device information
1150 bluetooth_device_address_t device_address;
1151 /**< device address */
1152 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1153 /**< network interface name */
1154 } bluetooth_network_device_info_t;
1157 * Authentication event types
1161 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1162 BLUETOOTH_AUTH_PIN_REQUEST,
1163 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1164 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1165 } bluetooth_auth_type_t;
1168 * structure to hold the pincode/pass-key req informations
1171 bluetooth_device_address_t device_address; /**< remote device address */
1172 bluetooth_device_name_t device_name; /**< device name */
1173 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1174 } bluetooth_authentication_request_info_t;
1177 * Stucture to hold discovery option
1180 unsigned short max_response; /**< the number of maximum response */
1181 unsigned short discovery_duration;
1182 /**< duration of discovery (seconds) */
1183 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1184 classOfDevice variable */
1185 } bluetooth_discovery_option_t;
1188 * Stucture to hold event information
1191 int event; /**< event type */
1192 int result; /**< Success or error value */
1194 /**<parameter data pointer */
1196 } bluetooth_event_param_t;
1199 bluetooth_device_address_t device_addr;
1200 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1201 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1202 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1207 bluetooth_device_address_t device_addr;
1208 unsigned char addr_type;
1210 } bt_connection_info_t;
1213 * Stucture to rfcomm receive data
1218 /**< the socket fd */
1219 int buffer_size;/**< the length of the receive buffer */
1221 /**< the receive data buffer */
1222 } bluetooth_rfcomm_received_data_t;
1228 HTYPE_TRANS_HANDSHAKE,
1229 HTYPE_TRANS_HID_CONTROL,
1230 HTYPE_TRANS_GET_REPORT,
1231 HTYPE_TRANS_SET_REPORT,
1232 HTYPE_TRANS_GET_PROTOCOL,
1233 HTYPE_TRANS_SET_PROTOCOL,
1236 } bt_hid_header_type_t;
1242 PTYPE_DATA_RTYPE_INPUT,
1243 PTYPE_DATA_RTYPE_OUTPUT
1244 } bt_hid_param_type_t;
1247 * Stucture to hid receive data
1250 const char *address;
1251 bt_hid_header_type_t type;
1252 /**< Header type containing */
1253 bt_hid_param_type_t param;
1254 /**< Param type in header like INPUT Report or OutPut Report */
1255 int buffer_size;/**< the length of the receive buffer */
1257 /**< the receive data buffer */
1258 } bluetooth_hid_received_data_t;
1261 * Stucture to rfcomm connection
1265 int socket_fd; /**< the socket fd */
1266 int server_id; /* Server id */
1267 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1268 bluetooth_device_address_t device_addr;
1269 /**< device address */
1270 char uuid[BLUETOOTH_UUID_STRING_MAX];
1271 } bluetooth_rfcomm_connection_t;
1274 * Stucture to rfcomm disconnection
1278 /**< the socket fd */
1279 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1280 bluetooth_device_address_t device_addr;
1281 /**< device address */
1282 char uuid[BLUETOOTH_UUID_STRING_MAX];
1283 } bluetooth_rfcomm_disconnection_t;
1287 /**< the socket fd */
1288 bluetooth_device_address_t device_addr;
1289 /**< device address */
1290 } bluetooth_rfcomm_connection_request_t;
1294 /**< the socket fd */
1295 bluetooth_device_address_t device_addr;
1296 /**< device address */
1297 } bluetooth_hid_request_t;
1306 } bt_hdp_qos_type_t;
1312 HDP_ROLE_SOURCE = 0x0,
1314 } bt_hdp_role_type_t;
1318 * Stucture to HDP connected
1321 const char *app_handle; /**< the application handle */
1322 unsigned int channel_id; /**< the channel id */
1323 bt_hdp_qos_type_t type; /**< the QOS type */
1324 bluetooth_device_address_t device_address; /**< the remote address */
1325 } bt_hdp_connected_t;
1328 * Stucture to HDP disconnected
1331 unsigned int channel_id; /**< the channel id */
1332 bluetooth_device_address_t device_address; /**< the remote address */
1333 } bt_hdp_disconnected_t;
1336 * Stucture to HDP data indication
1339 unsigned int channel_id; /**< the channel id */
1340 const char *buffer; /**< the RX data buffer */
1341 unsigned int size; /**< the RX data size */
1342 } bt_hdp_data_ind_t;
1345 * Stucture to OPP client transfer information
1352 } bt_opc_transfer_info_t;
1354 /* TODO: MAP client structures, see above */
1356 * Stucture to Map filter fields
1361 } bt_map_list_filter_fields_info_t;
1363 /* Obex Server transfer type */
1364 #define TRANSFER_PUT "PUT"
1365 #define TRANSFER_GET "GET"
1367 * Stucture to OPP/FTP Server authorize information
1374 } bt_obex_server_authorize_into_t;
1382 } bt_obex_server_type_t;
1385 * Stucture to OPP/FTP server transfer information
1393 unsigned long file_size;
1395 bt_obex_server_type_t server_type;
1397 unsigned char *contact_auth_info;
1398 } bt_obex_server_transfer_info_t;
1401 * Stucture to OPP/FTP server connection/disconnection information
1407 } bt_obex_server_connection_info_t;
1411 * Stucture to OOB data
1415 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1416 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1417 unsigned int hash_len;
1418 unsigned int randomizer_len;
1420 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1421 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1422 unsigned int hash256_len;
1423 unsigned int randomizer256_len;
1427 * Structure to GATT attribute handle data
1433 } bt_gatt_handle_info_t;
1436 * Structure to GATT Remote service data
1443 bt_gatt_handle_info_t include_handles;
1444 bt_gatt_handle_info_t char_handle;
1445 } bt_gatt_service_property_t;
1448 * Structure to GATT Remote characteristic data
1452 char *service_handle;
1453 bt_gatt_handle_info_t handle_info;
1454 } bt_gatt_discovered_char_t;
1457 * Structure to format of GATT Characteristic Value
1461 unsigned char format;
1462 unsigned char exponent;
1463 unsigned short unit;
1464 unsigned char name_space;
1465 unsigned short description;
1466 } bt_gatt_char_format_t;
1469 * Structure to GATT Characteristic property
1477 bt_gatt_char_format_t format;
1479 unsigned int val_len;
1480 unsigned int permission;
1481 char *representation;
1482 bt_gatt_handle_info_t char_desc_handle;
1483 } bt_gatt_char_property_t;
1486 * Structure to GATT Characteristic descriptor property
1493 unsigned int val_len;
1494 } bt_gatt_char_descriptor_property_t;
1497 * Structure to GATT Characteristic value
1504 } bt_gatt_char_value_t;
1507 * Structure to GATT Read Request
1511 char *service_handle;
1515 } bt_gatt_read_req_t;
1518 * Structure to GATT Value change
1522 char *service_handle;
1525 gboolean response_needed;
1529 } bt_gatt_value_change_t;
1532 bluetooth_device_address_t device_addr;
1534 bluetooth_gatt_service_change_type_t change_type;
1535 } bt_gatt_service_change_t;
1538 * Structure to GATT characteristc Notification change
1542 char *service_handle;
1543 gboolean att_notify;
1544 } bt_gatt_char_notify_change_t;
1547 * Structure to Indication confirmation
1551 char *service_handle;
1554 } bt_gatt_indicate_confirm_t;
1557 * Structure for GATT response data
1563 } bt_gatt_resp_data_t;
1566 * Structure to RSSI Signal Strength Alert
1577 * Structure to RSSI Signal Strength
1587 * Structure for RSSI Enabled or Disabled
1593 gboolean rssi_enabled;
1594 } bt_rssi_enabled_t;
1597 * Structure for RSSI Threshold
1602 int in_range_threshold;
1604 } bt_rssi_threshold_t;
1608 * Structure for Suppoted Profiles and Trusted Profiles
1615 } bt_supported_profile_trusted_t;
1618 * Structure for PBAP Folder Parameters
1621 unsigned char addressbook;
1622 unsigned char folder_type;
1626 * Structure for PBAP Pull application Parameters
1629 unsigned char format;
1630 unsigned char order;
1631 unsigned short offset;
1632 unsigned short maxlist;
1633 long long unsigned fields;
1634 } bt_pbap_pull_parameters_t;
1637 * Structure for PBAP List application Parameters
1640 unsigned char order;
1641 unsigned short offset;
1642 unsigned short maxlist;
1643 } bt_pbap_list_parameters_t;
1646 * Structure for PBAP Pull vCard application Parameters
1649 unsigned char format;
1650 long long unsigned fields;
1652 } bt_pbap_pull_vcard_parameters_t;
1655 * Structure for PBAP Search application Parameters
1658 unsigned char order;
1659 unsigned short offset;
1660 unsigned short maxlist;
1661 unsigned char search_attribute;
1662 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1663 } bt_pbap_search_parameters_t;
1666 * Structure for PBAP Connection Status
1669 bluetooth_device_address_t btaddr;
1671 } bt_pbap_connected_t;
1674 * Structure for PBAP Phonebook Size
1677 bluetooth_device_address_t btaddr;
1679 } bt_pbap_phonebook_size_t;
1682 * Structure for PBAP Phonebook Pull
1685 bluetooth_device_address_t btaddr;
1688 } bt_pbap_phonebook_pull_t;
1691 * Structure for PBAP vCard List
1694 bluetooth_device_address_t btaddr;
1698 } bt_pbap_vcard_list_t;
1701 * Structure for PBAP vCard Pull
1704 bluetooth_device_address_t btaddr;
1707 } bt_pbap_vcard_pull_t;
1710 * Structure for PBAP Phonebook search List
1713 bluetooth_device_address_t btaddr;
1717 } bt_pbap_phonebook_search_list_t;
1720 * Stucture to HF Call status information
1724 char *number; /*Phone Number */
1725 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1726 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1727 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1728 int idx; /*Call index/ID */
1729 } bt_hf_call_status_info_t;
1734 } bt_hf_call_list_s;
1740 TRUSTED_PROFILE_PBAP = 1,
1741 TRUSTED_PROFILE_MAP,
1742 TRUSTED_PROFILE_SAP,
1743 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1744 } bluetooth_trusted_profile_t;
1747 * Restricted Profile types
1750 RESTRICTED_PROFILE_HFP_HS = 1,
1751 RESTRICTED_PROFILE_A2DP,
1752 } bluetooth_restricted_profile_t;
1755 * Structure for LE data length change params
1758 bluetooth_device_address_t device_address;
1759 guint16 max_tx_octets;
1760 guint16 max_tx_time;
1761 guint16 max_rx_octets;
1762 guint16 max_rx_time;
1763 } bt_le_data_length_params_t;
1766 * Structure for proximity property change params
1769 bluetooth_device_address_t device_address;
1773 } bt_pxp_property_changed_params_t;
1776 * @brief DPM BT allowance state
1780 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1781 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1782 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1783 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1787 * @brief DPM API result
1791 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1792 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1793 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1794 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1795 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1796 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1800 * @brief DPM Policy status
1804 BLUETOOTH_DPM_STATUS_ERROR = -1,
1806 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1807 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1809 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1810 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1812 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1813 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1817 /* policy-group : BLUETOOTH */
1818 BLUETOOTH_DPM_POLICY_ALLOW,
1819 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1820 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1821 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1822 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1823 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1824 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1825 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1826 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1827 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1828 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1829 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1830 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1831 BLUETOOTH_DPM_POLICY_END,
1832 } bt_dpm_policy_cmd_t;
1835 struct bt_dpm_policy {
1841 typedef struct bt_dpm_policy bt_dpm_policy_t;
1844 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1845 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1846 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1847 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1848 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1849 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1850 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1851 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1852 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1853 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1854 BLUETOOTH_DPM_PROFILE_NONE,
1857 struct bt_dpm_profile_val {
1858 int value; /* tells whether the profile is enabled or disabled */
1860 typedef struct dpm_profile_val dpm_profile_state_t;
1863 * Structure to DPM device list
1867 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1868 } bt_dpm_device_list_t;
1871 * Structure to DPM uuid list
1875 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1876 } bt_dpm_uuids_list_t;
1879 * Structure for IPSP Interface Info
1882 bluetooth_device_address_t btaddr;
1884 } bt_ipsp_connection_info_t;
1888 char* remote_address;
1889 } bt_map_client_session_info_s;
1891 typedef char* bt_map_client_message_object_t;
1896 } bt_map_client_list_folders_filter_t;
1901 int8_t subject_length;
1910 } bt_map_client_list_messages_filter_t;
1913 bt_map_client_message_object_t message_object;
1918 char *sender_address;
1921 char *recipient_address;
1926 int64_t attachment_size;
1931 } bt_map_client_message_item_t;
1937 } bt_map_client_push_message_args_t;
1944 char *sender_address;
1947 char *recipient_address;
1956 } bt_map_client_message_t;
1959 char **names; // holding %size null-terminated folder names
1961 } bt_map_client_folders_s;
1964 bt_map_client_message_item_t *message_items;
1966 } bt_map_client_message_items_s;
1969 const char* target_file;
1971 } bt_get_message_callback_data;
1974 * Callback pointer type
1976 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1979 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1980 * @brief Set the callback function pointer for bluetooth event
1983 * This API will register the callback function, when any response and event are received from
1984 * bluetooth framework. @n
1985 * this registered callback function will be get called with appropriate event and data structures.
1986 * This function is a synchronous call. An application developer can call
1987 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1988 * type. This registered function will receive events of bluetooth_event_type_t type along with
1992 * @param[in] callback_ptr A pointer to the callback function
1993 * @param[in] user_data A pointer to user data
1994 * @return BLUETOOTH_ERROR_NONE - Success
1998 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2000 GMainLoop *main_loop = (GMainLoop*) user_data;
2004 // Code for each event
2006 g_main_loop_quit(main_loop);
2013 GMainLoop *main_loop = NULL;
2016 main_loop = g_main_loop_new(NULL, FALSE);
2017 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2018 if (ret >= BLUETOOTH_ERROR_NONE)
2020 // bluetooth_register_callback returned Success
2024 // bluetooth_register_callback returned failiure
2026 g_main_loop_run(main_loop);
2030 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2033 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2034 * @brief Set the callback function pointer for bluetooth le event
2037 * This API will register the callback function, when any response and event are received from
2038 * bluetooth framework. @n
2039 * this registered callback function will be get called with appropriate event and data structures.
2040 * This function is a synchronous call. An application developer can call
2041 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2042 * type. This registered function will receive events of bluetooth_event_type_t type along with
2046 * @param[in] callback_ptr A pointer to the callback function
2047 * @param[in] user_data A pointer to user data
2048 * @return BLUETOOTH_ERROR_NONE - Success
2052 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2055 * @fn int bluetooth_le_unregister_callback(void)
2056 * @brief Set the callback function pointer for bluetooth le event
2059 * This API will register the callback function, when any response and event are received from
2060 * bluetooth framework. @n
2061 * this registered callback function will be get called with appropriate event and data structures.
2062 * This function is a synchronous call. An application developer can call
2063 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2064 * type. This registered function will receive events of bluetooth_event_type_t type along with
2069 * @return BLUETOOTH_ERROR_NONE - Success
2073 int bluetooth_le_unregister_callback(void);
2076 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2077 * @brief Set the callback function pointer for bluetooth event
2080 * This API will register the callback function, when any response and event are received from
2081 * bluetooth framework. @n
2082 * this registered callback function will be get called with appropriate event and data structures.
2083 * This function is a synchronous call. An application developer can call
2084 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2085 * type. This registered function will receive events of bluetooth_event_type_t type along with
2090 * @return BLUETOOTH_ERROR_NONE - Success
2094 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2096 GMainLoop *main_loop = (GMainLoop*) user_data;
2100 // Code for each event
2102 g_main_loop_quit(main_loop);
2109 GMainLoop *main_loop = NULL;
2112 main_loop = g_main_loop_new(NULL, FALSE);
2113 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2114 if (ret >= BLUETOOTH_ERROR_NONE)
2116 // bluetooth_register_callback returned Success
2120 // bluetooth_register_callback returned failiure
2122 ret = bluetooth_deregister_callback(void);
2123 g_main_loop_run(main_loop);
2127 int bluetooth_unregister_callback(void);
2130 * @fn int bluetooth_enable_adapter(void)
2131 * @brief Enable the Bluetooth H/W
2134 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2135 * send request to bluetooth chip for activation.
2136 * This function is typically called at startup or when Bluetooth services are required. This
2137 * function must be called before calling any other API of Bluetooth operations.
2139 * Before performing any operations like Device discover, service search etc.., the adapter must be
2142 * This function is a asynchronous call.
2143 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2144 * through registered callback function with appropriate result code
2145 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2146 * BLUETOOTH_ERROR_NONE - Success \n
2148 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2149 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2151 * @return BLUETOOTH_ERROR_NONE - Success\n
2152 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2153 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2154 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2155 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2157 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2159 void bt_event_callback(int event, bluetooth_event_param_t *param)
2163 case BLUETOOTH_EVENT_ENABLED:
2164 if (param->result == BLUETOOTH_ERROR_NONE)
2166 // Successfully Enabled
2179 ret = bluetooth_enable_adapter();
2183 int bluetooth_enable_adapter(void);
2186 * @fn int bluetooth_disable_adapter(void)
2187 * @brief Disable the Bluetooth H/W
2190 * This function disables Bluetooth protocol stack and hardware. This function is called when
2191 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2193 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2194 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2195 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2197 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2200 * This function is a asynchronous call.
2201 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2202 * through registered callback function.
2205 * @return BLUETOOTH_ERROR_NONE - Success\n
2206 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2207 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2208 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2210 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2212 void bt_event_callback(int event, bluetooth_event_param_t *param)
2216 case BLUETOOTH_EVENT_DISABLED:
2217 if (param->result == BLUETOOTH_ERROR_NONE)
2219 // Successfully disabled
2232 ret = bluetooth_disable_adapter();
2235 int bluetooth_disable_adapter(void);
2236 int bluetooth_recover_adapter(void);
2237 int bluetooth_check_adapter_le(void);
2238 int bluetooth_enable_adapter_le(void);
2240 int bluetooth_disable_adapter_le(void);
2243 * @fn int bluetooth_reset_adapter(void)
2244 * @brief Reset the Bluetooth H/W and values
2247 * This function resets Bluetooth protocol stack and hardware. This function is called when
2248 * an user want to initialize Bluetooth environment.
2250 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2253 * This function is a synchronous call.
2255 * @return BLUETOOTH_ERROR_NONE - Success\n
2256 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2258 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2263 ret = bluetooth_reset_adapter();
2266 int bluetooth_reset_adapter(void);
2269 * @fn int bluetooth_is_supported(void)
2270 * @brief Check if the bluetooth is supported or not by the current target
2272 * This API checks whether the bluetooth is supported or not.
2273 * This API only run by root permission.
2275 * This function is a synchronous call.
2277 * @return 0 - if bluetooth is not supported\n
2278 * 1 - if bluetooth is supported\n
2279 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2284 ret = bluetooth_is_supported();
2287 int bluetooth_is_supported(void);
2291 * @fn int bluetooth_check_adapter(void)
2292 * @brief Check the current status of the Bluetooth adapter
2295 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2296 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2297 * bluetooth adapter.
2298 * This API get the adapter internal data structure and check current adapter status.
2300 * This function is a synchronous call.
2303 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2304 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2306 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2310 ret = bluetooth_check_adapter();
2313 int bluetooth_check_adapter(void);
2316 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2317 * @brief Get the local adapter bluetooth address
2320 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2321 * the adapter should be enabled.
2322 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2323 * contain Bluetooth address.
2324 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2325 * friendly name for each device.
2326 * There is no event callback for this API.
2328 * This function is a synchronous call.
2331 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2332 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2333 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2334 * @param[out] local_address a device address of local bluetooth adapter
2339 bluetooth_device_address_t local_address={0,};
2342 ret = bluetooth_get_local_address(&local_address);
2345 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2348 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2349 * @brief Get the hci version
2352 * This function is used to get the bluetooth hci version
2353 * Before calling this API make sure that the adapter is enabled.
2355 * This function is a synchronous call.
2358 * @return BLUETOOTH_ERROR_NONE - Success \n
2359 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2360 * @param[out] timeout remain visibility timeout value
2363 bluetooth_version_t *version;
2365 ret = bluetooth_get_local_version (&version);
2368 int bluetooth_get_local_version(bluetooth_version_t *version);
2371 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2372 * @brief Get the local device name
2375 * This function is used, get the local device name. Since its difficult to remember the Adapter
2376 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2377 * friendly name is retrived by the remote device and displaying.
2378 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2380 * This function is a synchronous call.
2383 * @return BLUETOOTH_ERROR_NONE - Success \n
2384 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2385 * @param[out] local_name a local device name
2389 bluetooth_device_name_t local_name={0,}
2391 ret = bluetooth_get_local_name (&local_name);
2394 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2397 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2398 * @brief Set the local device name
2401 * This function is used to set the local device name. This is a human friendly name whose
2402 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2404 * This function is a synchronous call.
2406 * @param[in] local_name bluetooth device name to set local device
2408 * @return BLUETOOTH_ERROR_NONE - Success \n
2409 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2410 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2411 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2412 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2413 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2418 bluetooth_device_name_t local_name={0,}
2420 ret = bluetooth_set_local_name (&local_name);
2423 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2427 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2428 * @brief Check if the uuid is used or not
2430 * This function is used to check if the uuid is used or not.
2432 * This function is a synchronous call.
2434 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2435 * @param[out] used if the uuid is used or not
2437 * @return BLUETOOTH_ERROR_NONE - Success \n
2438 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2439 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2440 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2445 gboolean used = FALSE;
2446 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2447 ret = bluetooth_is_service_used(uuid, &used);
2450 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2453 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2454 * @brief Check if the device is connected to the specific service
2456 * This function is used to check if if the device is connected to the specific service.
2458 * This function is a synchronous call.
2460 * @param[in] local_address a device address of remote bluetooth device
2461 * @param[in] type the service type
2462 * @param[out] is_connected if the device is connected or not
2464 * @return BLUETOOTH_ERROR_NONE - Success \n
2465 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2466 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2467 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2472 gboolean is_connected = FALSE;
2473 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2474 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2477 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2478 bluetooth_service_type_t type,
2479 gboolean *is_connected);
2482 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2483 * @brief Gets device's connected link type
2485 * This function is used to get device's connected link type
2487 * This function is a synchronous call.
2489 * @param[in] device_address a device address of remote bluetooth device
2490 * @param[out] connected_link a device's connected link type
2492 * @return BLUETOOTH_ERROR_NONE - Success \n
2493 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2494 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2495 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2500 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2501 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2502 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2505 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2506 bluetooth_connected_link_t *connected_link);
2509 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2510 * @brief Sets a profile trusted for a device
2512 * This function is used to Set a profile as trusted for a device
2514 * This function is a synchronous call.
2516 * @param[in] device_address a device address of remote bluetooth device
2517 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2518 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2520 * @return BLUETOOTH_ERROR_NONE - Success \n
2521 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2522 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2523 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2527 int bluetooth_set_profile_trusted(
2528 const bluetooth_device_address_t *device_address,
2529 int profile, int trust);
2532 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2533 * @brief Gets a profile is trusted for a device
2535 * This function is used to Get a profile is trusted or not for a device
2537 * This function is a synchronous call.
2539 * @param[in] device_address a device address of remote bluetooth device
2540 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2541 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2543 * @return BLUETOOTH_ERROR_NONE - Success \n
2544 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2545 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2546 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2550 int bluetooth_get_profile_trusted(
2551 const bluetooth_device_address_t *device_address,
2552 int profile, int *trust);
2555 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2556 * @brief Sets a profile restricted connection for a device
2558 * This function is used to Set a profile as restricted for a device
2560 * This function is a synchronous call.
2562 * @param[in] device_address a device address of remote bluetooth device
2563 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2564 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2566 * @return BLUETOOTH_ERROR_NONE - Success \n
2567 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2568 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2569 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2573 int bluetooth_set_profile_restricted(
2574 const bluetooth_device_address_t *device_address,
2575 int profile, int restricted);
2578 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2579 * @brief Gets a restricted connection state
2581 * This function is used to Get a profile is restricted or not for a device
2583 * This function is a synchronous call.
2585 * @param[in] device_address a device address of remote bluetooth device
2586 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2587 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2589 * @return BLUETOOTH_ERROR_NONE - Success \n
2590 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2591 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2592 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2596 int bluetooth_get_profile_restricted(
2597 const bluetooth_device_address_t *device_address,
2598 int profile, int *restricted);
2601 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2602 * @brief Get the visibility mode
2605 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2606 * visibity mode, the property of the device is determined whether it can be discoverable, non
2607 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2609 * This function is a synchronous call.
2612 * @return BLUETOOTH_ERROR_NONE - Success \n
2613 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2614 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2615 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2616 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2617 * @param[out] discoverable_mode current bluetooth discoverable mode
2619 * @see bluetooth_set_discoverable_mode
2621 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2623 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2626 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2629 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2631 * @brief Set the visibility mode
2634 * This function is used to set the discoverable mode (Visibility option).
2636 * Many times user may want to keep his device discoverable so that when peer device is performing
2637 * device search, he/she can find user's device. Application programmer can keep the mode as
2638 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2639 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2640 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2641 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2643 * This function is a synchronous call.
2645 * @return BLUETOOTH_ERROR_NONE - Success \n
2646 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2648 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2649 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2651 * @see bluetooth_get_discoverable_mode
2655 bluetooth_discoverable_mode_t mode;
2657 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2658 ret = bluetooth_set_discoverable_mode (mode, 180);
2662 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2667 * @fn int bluetooth_get_timeout_value(int *timeout)
2668 * @brief Get the visibility timeout value
2671 * This function is used to get the visibility timeout
2672 * Before calling this API make sure that the adapter is enabled.
2674 * This function is a synchronous call.
2677 * @return BLUETOOTH_ERROR_NONE - Success \n
2678 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2679 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2680 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2681 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2682 * @param[out] timeout remain visibility timeout value
2684 * @see bluetooth_set_discoverable_mode
2688 ret = bluetooth_get_timeout_value (&timeout);
2691 int bluetooth_get_timeout_value(int *timeout);
2695 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2696 * unsigned int classOfDeviceMask)
2697 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2699 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2700 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2701 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2702 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2703 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2704 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2705 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2706 * please see bluetooth_device_info_t for more details.
2709 * This API provides searching options like max responses, discovery duration in seconds and class
2710 * of device mask to filter device search. some times there may be too many bluetooth devices in
2711 * vicinity of your device.in such scenario, application can request to reduce number of responces
2712 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2713 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2714 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2715 * application defined time. please note that discovery_duration should be mentioned in seconds.
2716 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2719 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2720 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2721 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2723 * This function is a asynchronous call.
2724 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2725 * through registered callback function.
2727 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2728 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2730 * The completion or cancellation of the discovery is indicated by an
2731 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2733 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2736 * @return BLUETOOTH_ERROR_NONE - Success \n
2737 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2738 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2739 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2740 agent is not running \n
2742 * @param[in] max_response define the maximum response of the number of founded devices
2744 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2745 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2746 (refer to class of device)
2748 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2751 void bt_event_callback(int event, bluetooth_event_param_t *param)
2755 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2757 bluetooth_device_info_t *device_info = NULL;
2758 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2760 device_info = (bluetooth_device_info_t *)param->param_data;
2761 memcpy(&searched_device, &device_info->device_address,
2762 sizeof(bluetooth_device_address_t));
2763 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2764 device_info->device_address.addr[0],
2765 device_info->device_address.addr[1],
2766 device_info->device_address.addr[2],
2767 device_info->device_address.addr[3],
2768 device_info->device_address.addr[4],
2769 device_info->device_address.addr[5]);
2772 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2774 bluetooth_device_info_t *device_info = NULL;
2775 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2777 device_info = (bluetooth_device_info_t *)param->param_data;
2778 memcpy(&searched_device, &device_info->device_address,
2779 sizeof(bluetooth_device_address_t));
2780 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2781 device_info->device_name.name,
2782 device_info->device_address.addr[0],
2783 device_info->device_address.addr[1],
2784 device_info->device_address.addr[2],
2785 device_info->device_address.addr[3],
2786 device_info->device_address.addr[4],
2787 device_info->device_address.addr[5]);
2791 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2792 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2797 unsigned short max_response;
2798 unsigned short discovery_duration;
2799 unsigned classOfDeviceMask;
2803 discovery_duration =0;
2804 classOfDeviceMask =0;
2806 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2811 int bluetooth_start_discovery(unsigned short max_response,
2812 unsigned short discovery_duration,
2813 unsigned int classOfDeviceMask);
2816 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2817 * unsigned short max_response,
2818 * unsigned short discovery_duration,
2819 * unsigned int classOfDeviceMask)
2820 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2822 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2823 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2824 * Please see bluetooth_start_discovery() for other parameters description.
2826 * This function is a asynchronous call.
2827 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2828 * through registered callback function.
2830 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2831 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2833 * The completion or cancellation of the discovery is indicated by an
2834 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2836 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2839 * @return BLUETOOTH_ERROR_NONE - Success \n
2840 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2841 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2842 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2843 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2844 agent is not running \n
2846 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2847 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2848 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2849 * @param[in] max_response define the maximum response of the number of founded devices
2851 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2852 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2853 (refer to class of device)
2855 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2858 unsigned short type;
2859 unsigned short max_response;
2860 unsigned short discovery_duration;
2861 unsigned classOfDeviceMask;
2866 discovery_duration =0;
2867 classOfDeviceMask =0;
2869 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2874 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2875 unsigned short max_response,
2876 unsigned short discovery_duration,
2877 unsigned int classOfDeviceMask);
2880 * @fn int bluetooth_cancel_discovery (void)
2881 * @brief Cancel the on-going device discovery operation
2884 * This function stops the on-going device discovery operation. This API has to be called after the
2885 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2886 * the bluetooth_start_discovery API
2888 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2889 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2890 * cancel the discover request once the user received the device to which he wish to connect.
2892 * This function is a asynchronous call.
2893 * If the call is success to cancel discovey then the application will receive
2894 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2895 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2896 * BLUETOOTH_ERROR_NONE
2899 * @return BLUETOOTH_ERROR_NONE - Success \n
2900 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2901 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2902 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2903 other application \n
2904 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2906 * @see bluetooth_start_discovery
2908 void bt_event_callback(int event, bluetooth_event_param_t *param)
2912 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2913 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2922 ret = bluetooth_cancel_discovery();
2925 int bluetooth_cancel_discovery(void);
2928 * @fn int bluetooth_start_le_discovery(void)
2929 * @brief Start the generic device discovery which finds the LE devices.
2931 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2932 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2933 * It try to find LE devices. Bluetooth device address and name are
2934 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2935 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2936 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2937 * please see bluetooth_device_info_t for more details.
2939 * This function is a asynchronous call.
2940 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2941 * through registered callback function.
2943 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2946 * The completion or cancellation of the discovery is indicated by an
2947 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2949 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2952 * @return BLUETOOTH_ERROR_NONE - Success \n
2953 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2954 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2955 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2956 agent is not running \n
2959 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2962 void bt_event_callback(int event, bluetooth_event_param_t *param)
2966 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2968 bluetooth_device_info_t *device_info = NULL;
2969 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2971 device_info = (bluetooth_device_info_t *)param->param_data;
2972 memcpy(&searched_device, &device_info->device_address,
2973 sizeof(bluetooth_device_address_t));
2974 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2975 device_info->device_address.addr[0],
2976 device_info->device_address.addr[1],
2977 device_info->device_address.addr[2],
2978 device_info->device_address.addr[3],
2979 device_info->device_address.addr[4],
2980 device_info->device_address.addr[5]);
2984 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2985 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2991 ret = bluetooth_start_discovery();
2996 int bluetooth_start_le_discovery(void);
2999 * @fn int bluetooth_stop_le_discovery (void)
3000 * @brief Cancel the on-going device LE discovery operation
3003 * This function stops the on-going device discovery operation. This API has to be called after the
3004 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3005 * the bluetooth_start_le_discovery API
3008 * This function is a asynchronous call.
3009 * If the call is success to cancel discovey then the application will receive
3010 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3011 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3012 * BLUETOOTH_ERROR_NONE
3015 * @return BLUETOOTH_ERROR_NONE - Success \n
3016 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3017 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3018 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3019 other application \n
3020 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3022 * @see bluetooth_start_discovery
3024 void bt_event_callback(int event, bluetooth_event_param_t *param)
3028 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3029 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3038 ret = bluetooth_stop_le_discovery();
3041 int bluetooth_stop_le_discovery(void);
3044 * @fn int bluetooth_is_discovering(void)
3045 * @brief Check for the device discovery is in-progress or not.
3047 * This API is used to check the current status of the Discovery operation.If discovery is in\
3048 * progress normally other operations are not allowed.
3049 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3050 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3051 * event before performing other operations. This API is used to get for the current discovery
3052 * operation status and using bluetooth_cancel_discovery()
3053 * we can cancell the ongoing discovery process.
3054 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3057 * This function checks whether the device discovery is started or not.
3059 * This function is a synchronous call.
3062 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3063 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3064 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3067 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3071 ret = bluetooth_is_discovering ();
3074 int bluetooth_is_discovering(void);
3077 * @fn int bluetooth_is_le_discovering(void)
3078 * @brief Check for the device LE discovery is in-progress or not.
3080 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3081 * progress normally other operations are not allowed.
3082 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3083 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3084 * event before performing other operations. This API is used to get for the current discovery
3085 * operation status and using bluetooth_stop_le_discovery()
3086 * we can cancell the ongoing LE discovery process.
3087 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3090 * This function checks whether the device LE discovery is started or not.
3092 * This function is a synchronous call.
3095 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3096 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3097 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3100 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3104 ret = bluetooth_is_le_discovering ();
3107 int bluetooth_is_le_discovering(void);
3110 * @fn int bluetooth_is_le_scanning(void)
3111 * @brief Check for the device LE scan is in-progress or not.
3113 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3114 * progress normally other operations are not allowed.
3116 * This function checks whether the device LE Scan is started or not.
3118 * This function is a synchronous call.
3120 * @return TRUE - LE Scan in progress \n
3121 * FALSE - LE Scan is not in progress \n
3126 gboolean is_le_scanning = 0;
3127 is_le_scanning = bluetooth_is_le_scanning ();
3130 gboolean bluetooth_is_le_scanning(void);
3132 gboolean bluetooth_is_scan_filter_supported(void);
3135 * @fn int bluetooth_force_hcidump(int timeout)
3136 * @brief Enable /disable force-hcidump
3138 * This function control force-hcidump.
3140 * This function is a synchronous call.
3142 * @return BLUETOOTH_ERROR_NONE - Success \n
3143 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3144 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3146 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3151 int bluetooth_force_hcidump(int timeout);
3154 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3155 * @brief Register scan filter.
3157 * This function registers the scan filter.
3159 * This function is a synchronous call.
3161 * @return BLUETOOTH_ERROR_NONE - Success \n
3163 * @param[in] filter scan filter to register
3164 * @param[out] slot_id the slot ID of scan filter
3168 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3171 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3172 * @brief Register scan filter.
3174 * This function unregisters the scan filter.
3176 * This function is a synchronous call.
3178 * @return BLUETOOTH_ERROR_NONE - Success \n
3180 * @param[in] slot_id the slot ID of scan filter
3184 int bluetooth_unregister_scan_filter(int slot_id);
3187 * @fn int bluetooth_unregister_all_scan_filters(void)
3188 * @brief Register scan filter.
3190 * This function usregisters all scan filters.
3192 * This function is a synchronous call.
3194 * @return BLUETOOTH_ERROR_NONE - Success \n
3198 int bluetooth_unregister_all_scan_filters(void);
3201 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3202 int link_type, bt_rssi_threshold_t rssi_threshold)
3203 * @brief Enable RSSI monitoring
3205 * This function enables RSSI monitoring and sets threshold for a connection
3207 * @return BLUETOOTH_ERROR_NONE - Success \n
3210 * @see bluetooth_get_rssi_strength
3212 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3213 int link_type, bt_rssi_threshold_t *rssi_threshold);
3216 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3217 * @brief Gets Raw RSSI signal Strength
3219 * This function gives the Raw RSSI signal strength for a connection.
3221 * @return BLUETOOTH_ERROR_NONE - Success \n
3224 * @see bluetooth_enable_rssi
3226 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3228 int bluetooth_set_connectable(gboolean is_connectable);
3230 int bluetooth_is_connectable(gboolean *is_connectable);
3233 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3234 * @brief Initiate a bonding process
3237 * This function initiates a bonding procedure with a peer device. The bonding procedure
3238 * enables authentication and optionally encryption on the Bluetooth link.
3240 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3241 * inititate the bonding request to the devices already in the paired list.
3243 * Usually we call this API after the device discovery.
3244 * This function is a asynchronous call.
3246 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3247 * mentioed result code
3248 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3249 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3250 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3251 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3252 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3254 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3255 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3258 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3261 * @return BLUETOOTH_ERROR_NONE - Success \n
3262 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3263 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3264 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3265 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3267 * @param[in] device_address This indicates an address of the device with which the pairing
3268 * should be initiated
3270 * @see bluetooth_cancel_bonding
3272 void bt_event_callback(int event, bluetooth_event_param_t *param)
3276 case BLUETOOTH_EVENT_BONDING_FINISHED:
3278 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3279 if (param->result >= BLUETOOTH_ERROR_NONE)
3281 bluetooth_device_info_t *device_info = NULL;
3282 device_info = (bluetooth_device_info_t *)param->param_data;
3283 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3284 mjr[%#x] min[%#x] srv[%#x]",
3285 device_info->device_name.name,
3286 device_info->device_address.addr[0],
3287 device_info->device_address.addr[1],
3288 device_info->device_address.addr[2],
3289 device_info->device_address.addr[3],
3290 device_info->device_address.addr[4],
3291 device_info->device_address.addr[5],
3292 device_info->device_class.major_class,
3293 device_info->device_class.minor_class,
3294 device_info->device_class.service_class);
3308 bluetooth_device_address_t device_address={{0}};
3310 ret = bluetooth_bond_device(&device_address);
3314 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3317 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3318 * bluetooth_conn_type_t conn_type)
3319 * @brief Initiate a bonding process
3322 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3323 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3325 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3326 * inititate the bonding request to the devices already in the paired list.
3328 * Usually we call this API after the device discovery.
3329 * This function is a asynchronous call.
3331 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3332 * mentioed result code
3333 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3334 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3335 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3336 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3337 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3339 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3340 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3343 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3346 * @return BLUETOOTH_ERROR_NONE - Success \n
3347 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3348 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3349 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3350 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3352 * @param[in] device_address This indicates an address of the device with which pairing
3353 * should be initiated
3354 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3357 * @see bluetooth_cancel_bonding
3359 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3360 bluetooth_conn_type_t conn_type);
3363 * @fn int bluetooth_cancel_bonding(void)
3364 * @brief Cancel the on-going bonding process
3366 * This API is called to cancel the on-going bonding procedure. It should be called before the
3367 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3368 * This API is useful when the remote device is not responding to the bond request or we wish to
3369 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3371 * This function is a synchronous call.
3373 * @return BLUETOOTH_ERROR_NONE - Success \n
3374 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3375 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3378 * @see bluetooth_bond_device
3384 ret = bluetooth_cancel_bonding();
3387 int bluetooth_cancel_bonding(void);
3390 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3391 * @brief Remove bonding
3394 * To communicate with remote device over bluetooth link, user should bond with peer device.
3395 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3396 * API is used to remove peer device from the list. Please note that after removing the device
3397 * from bonded device list, you cannot communication with peer device until bonding happens again.
3399 * User can call this function by passing bluetooth device address of any bonded device. Please note
3400 * that after successful return of this function, any bluetooth application running on your device
3401 * will not be able to communicate with unbonded device until bond operation happens again using
3402 * bluetooth_bond_device()
3405 * This function is a asynchronous call. The request to remove the specified device from the bonded
3406 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3407 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3408 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3412 * @return BLUETOOTH_ERROR_NONE - Success \n
3413 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3414 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3415 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3416 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3417 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3418 * agent is not running \n
3419 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3422 * @param[in] device_address This indicates an address of the device to remove bonding
3426 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3429 void bt_event_callback(int event, bluetooth_event_param_t *param)
3432 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3433 bluetooth_device_address_t *dev_addr = NULL;
3435 if (param->result == BLUETOOTH_ERROR_NONE) {
3436 dev_addr = (bluetooth_device_address_t *)param->param_data;
3438 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3439 dev_addr->addr[0], dev_addr->addr[1]
3440 dev_addr->addr[2], dev_addr->addr[3]
3441 dev_addr->addr[4], dev_addr->addr[5]
3452 bluetooth_device_address_t *device_address;
3454 // copy valid device address in device_address
3456 ret = bluetooth_unbond_device(device_address);
3459 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3462 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3463 * @brief Get bonded(paired) device list
3466 * This API gets all bonded device list.
3467 * The devices in the bonded device list further can be used to perform the authorization by calling
3468 * bluetooth_authorize_device API.
3470 * This function is a synchronous call.
3471 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3472 * there is no valid information in the dev_list.
3473 * The len field in the dev_list represents the number of bonded devices. The data structure for
3474 * bonded device information is bluetooth_device_info_t.
3477 * @return BLUETOOTH_ERROR_NONE - Success \n
3478 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3480 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3482 void bt_get_bonded_devices(void)
3486 GPtrArray *devinfo = NULL;
3487 bluetooth_device_info_t *ptr;
3489 // allocate the g_pointer_array
3490 devinfo = g_ptr_array_new();
3492 ret = bluetooth_get_bonded_device_list(&devinfo);
3493 if (ret != BLUETOOTH_ERROR_NONE)
3495 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3499 printf("g pointer arrary count : [%d]", devinfo->len);
3500 for (i=0; i<devinfo->len; i++)
3502 ptr = g_ptr_array_index(devinfo, i);
3505 printf("Name [%s]\n", ptr->device_name.name);
3506 printf("Major Class [%d]\n", ptr->device_class.major_class);
3507 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3508 printf("Service Class [%d]\n", ptr->device_class.service_class);
3509 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3510 ptr->device_address.addr[0],
3511 ptr->device_address.addr[1], ptr->device_address.addr[2],
3512 ptr->device_address.addr[3],
3513 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3520 // free g_pointer_array
3521 g_ptr_array_free(devinfo, TRUE);
3526 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3528 int bluetooth_get_profile_connected_device_list(
3529 const char *profile_uuid, GPtrArray **addr_list);
3532 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3533 * bluetooth_device_info_t *dev_info)
3534 * @brief Get a bonded(paired) device
3537 * This API gets a bonded device.
3539 * This function is a synchronous call.
3540 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3541 * there is no valid information in the dev_info.
3542 * The data structure for bonded device information is bluetooth_device_info_t.
3545 * @return BLUETOOTH_ERROR_NONE - Success \n
3546 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3548 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3550 void bt_get_bonded_device(void)
3554 bluetooth_device_info_t devinfo = {0};
3555 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3557 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3558 if (ret != BLUETOOTH_ERROR_NONE)
3560 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3564 printf("Name [%s]\n", devinfo.device_name.name);
3565 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3566 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3567 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3568 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3569 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3570 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3571 devinfo.device_address.addr[5]);
3580 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3581 bluetooth_device_info_t *dev_info);
3585 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3586 * gboolean *is_alias_set)
3587 * @brief Get is_alias_set property of device
3589 * This API gets is_alias_set property of a bonded device.
3591 * This function is a synchronous call.
3592 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3593 * If not,there is no valid information in the is_alias_set.
3595 * @return BLUETOOTH_ERROR_NONE - Success \n
3596 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3601 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3603 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3606 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3607 gboolean *is_alias_set);
3610 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3611 * @brief set alias for bonded device
3614 * This function set alias for bonded device.
3616 * This function is a synchronous call.
3619 * @return BLUETOOTH_ERROR_NONE - Success \n
3620 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3621 * @param[in] device_address This indicates an address of the remote device
3622 * @param[in] alias This indicates an alias to set
3627 ret = bluetooth_set_alias(&remote_address);
3630 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3634 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3635 * @brief Get remote deivice
3638 * This function gets specific remote device.
3640 * This function is a asynchronous call.
3641 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3644 * @return BLUETOOTH_ERROR_NONE - Success \n
3645 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3646 * @param[in] device_address This indicates an address of the remote device
3651 ret = bluetooth_get_remote_device(&remote_address);
3654 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3657 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3658 * gboolean authorized)
3659 * @brief Authorize/Unauthorize a bonded device
3662 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3663 * with/without user confirmation.
3665 * If we select a paired device and make it authorized by calling this API with the authorized
3666 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3667 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3668 * then it will ask for the user conformation before the connection.
3670 * This API supposed to be called on the paired devices. Which means we have to use this API only
3671 * after successful pairing.
3673 * This function is a asynchronous call.
3674 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3676 * @return BLUETOOTH_ERROR_NONE - Success \n
3677 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3678 * @param[in] device_address This indicates an address of the device to authorize \n
3679 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3681 * @see bluetooth_get_bonded_device_list
3683 void bt_event_callback(int event, bluetooth_event_param_t *param)
3687 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3689 if (param->result == BLUETOOTH_ERROR_NONE)
3693 //device authorization failed failure
3701 bluetooth_device_address_t device_address={{0}};
3702 gboolean authorized;
3706 ret = bluetooth_authorize_device(&device_address,authorized);
3709 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3710 gboolean authorized);
3712 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3713 const bluetooth_device_pin_code_t *pin_code);
3715 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3718 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3720 * @brief Receives Legacy Passkey\pin with following authentication response types
3722 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3723 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3726 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3729 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3731 * @brief This API sends user confirmation reply to the local adapter.
3733 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3736 int bluetooth_passkey_confirmation_reply(gboolean reply);
3739 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3740 * @brief Get all services supported by remote device
3743 * This API call initiates the search for the services supported by the specified device. Normally
3744 * the service search will take a couple of seconds to get it completed. Before calling this API
3745 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3746 * perform the service search. We can get the device address by doing a device discovery operation.
3749 * This function is a asynchronous call.
3750 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3752 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3753 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3754 * event is generated with appropriate result code.
3756 * @return BLUETOOTH_ERROR_NONE - Success \n
3757 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3758 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3759 * @param[in] device_address This indicates an address of the device
3760 * whose services need to be found
3762 * @see bluetooth_cancel_service_search
3764 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3767 * @fn int bluetooth_cancel_service_search(void)
3768 * @brief Cancel the ongoing service search operation
3771 * This function cancel the ongoing service search operation. This API is usually calling after the
3772 * bluetooth_search_service API.
3773 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3774 * if the user wish to cancel the Ongoing service search operation.
3776 * This API should be called just after the bluetooth_search_service API and before the
3777 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3779 * This function is a synchronous call.
3781 * @return BLUETOOTH_ERROR_NONE - Success \n
3782 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3783 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3784 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3787 * @see bluetooth_search_service
3792 ret = bluetooth_cancel_service_search();
3795 int bluetooth_cancel_service_search(void);
3798 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3799 * @brief Register rfcomm socket with a specific uuid
3802 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3803 * descriptor of the server.
3804 * This is the first API which is called to create the server. Once we created the server socket,
3805 * we will listen on that return socket.
3806 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3809 * @return socket FD on Success \n
3810 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3811 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3812 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3813 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3814 * @param[in] UUID (128 bits)
3817 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3821 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3822 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3826 int bluetooth_rfcomm_create_socket(const char *uuid);
3829 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3830 * @brief Register rfcomm socket with a specific uuid
3833 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3834 * descriptor of the server.
3835 * This is the first API which is called to create the server. Once we created the server socket,
3836 * we will listen on that return socket.
3837 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3840 * @return socket FD on Success \n
3841 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3842 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3843 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3844 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3845 * @param[in] UUID (128 bits)
3846 * @param[in] bus_name (const char)
3847 * @param[in] path (const char)
3850 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3854 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3855 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3859 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3862 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3863 * @brief De-register the rfcomm socket
3866 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3867 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3868 * descriptor else no event will come. We will call this API only after the
3869 * bluetooth_rfcomm_listen_and_accept.
3870 * This is a synchronous call.
3872 * @return BLUETOOTH_ERROR_NONE - Success \n
3873 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3874 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3875 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3876 * @param[in] int socket_fd
3879 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3882 void bt_event_callback(int event, bluetooth_event_param_t *param)
3886 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3888 bluetooth_rfcomm_connection_t *discon_ind =
3889 (bluetooth_rfcomm_connection_t *)param->param_data;
3891 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3899 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3900 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3902 ret = bluetooth_rfcomm_remove_socket(fd);
3905 int bluetooth_rfcomm_remove_socket(int socket_fd);
3908 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3909 * @brief De-register the rfcomm socket
3912 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3913 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3914 * descriptor else no event will come. We will call this API only after the
3915 * bluetooth_rfcomm_listen_and_accept_ex.
3916 * This is a synchronous call.
3918 * @return BLUETOOTH_ERROR_NONE - Success \n
3919 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3920 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3921 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3922 * @param[in] UUID (128 bits)
3925 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3928 void bt_event_callback(int event, bluetooth_event_param_t *param)
3932 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3934 bluetooth_rfcomm_connection_t *discon_ind =
3935 (bluetooth_rfcomm_connection_t *)param->param_data;
3937 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3945 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3946 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3948 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3951 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3954 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3955 * @brief Disconnect rfcomm connection
3958 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3959 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3962 * @return BLUETOOTH_ERROR_NONE - Success \n
3963 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3964 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3965 * @param[in] int socket_fd the sending socket fd
3971 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3973 printf("Disconnection failed");
3975 printf("Disconnection Success");
3979 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3982 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3983 * @brief Rfcomm socket listen
3986 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3987 * after the bluetooth_rfcomm_create_socket API.
3988 * This API listen for the incomming connection and once it receives a connection, it will give
3989 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3990 * event to the application. This is an Asynchronous API call.
3993 * @return BLUETOOTH_ERROR_NONE - Success \n
3994 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3995 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3997 * @param[in] int socket_fd
3998 * @param[in] max pending connection.
4001 * @see bluetooth_rfcomm_create_socket
4004 void bt_event_callback(int event, bluetooth_event_param_t* param)
4008 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4010 bluetooth_rfcomm_connection_t *conn_ind =
4011 (bluetooth_rfcomm_connection_t *)param->param_data;
4013 printf("\nConnected from FD %d", conn_ind->socket_fd);
4021 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4022 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4026 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4029 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4030 * @brief Rfcomm socket listen
4033 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4034 * after the bluetooth_rfcomm_create_socket API.
4035 * This API listen for the incomming connection and once it receives a connection, it will give
4036 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4037 * event to the application. This is an Asynchronous API call.
4040 * @return BLUETOOTH_ERROR_NONE - Success \n
4041 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4042 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4044 * @param[in] int socket_fd
4045 * @param[in] max pending connection.
4050 * @see bluetooth_rfcomm_create_socket_ex
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_ex(rfcomm_test_uuid);
4071 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4076 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4079 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4080 * @brief Rfcomm socket listen
4083 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4084 * after the bluetooth_rfcomm_create_socket API.
4085 * This API listen for the incomming connection and once it receives a connection, it will give
4086 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4087 * event to the application. This is an Asynchronous API call.
4090 * @return BLUETOOTH_ERROR_NONE - Success \n
4091 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4092 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4094 * @param[in] int socket_fd
4095 * @param[in] max pending connection.
4098 * @see bluetooth_rfcomm_create_socket
4101 void bt_event_callback(int event, bluetooth_event_param_t* param)
4105 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4107 char *name = (char *)param->param_data;
4109 printf("\nConnected from %s", name);
4111 bluetooth_rfcomm_accept_connection();
4119 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4120 ret = bluetooth_rfcomm_listen(fd, 1);
4124 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4127 * @fn int bluetooth_rfcomm_accept_connection()
4128 * @brief Accepts the authorization request indicated by the event
4129 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4131 * This function is a synchronous call.
4133 * @return BLUETOOTH_ERROR_NONE - Success \n
4134 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4136 * @param[in] the socket fd of the server
4137 * @param[out] the socket fd of the client
4141 * @see bluetooth_rfcomm_reject_connection
4143 int bluetooth_rfcomm_accept_connection(int server_fd);
4146 * @fn int bluetooth_rfcomm_reject_connection()
4147 * @brief Rejects the authorization request indicated by the event
4148 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4150 * This function is a synchronous call.
4152 * @return BLUETOOTH_ERROR_NONE - Success \n
4153 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4155 * @param[in] the socket fd of the server
4159 * @see bluetooth_rfcomm_accept_connection
4161 int bluetooth_rfcomm_reject_connection(int server_fd);
4164 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4165 * @brief Informs whether rfcomm server uuid is available or not.
4167 * This function is a synchronous call.
4169 * @return TRUE - RFCOMM uuid is available \n
4170 * FALSE - RFCOMM uuid is not available \n
4172 * @param[in] uuid UUID string
4178 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4181 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4182 * const char *remote_uuid)
4183 * @brief Connect to the remote device rfcomm *
4185 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4186 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4187 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4188 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4189 * initiating a connection.
4191 * @return BLUETOOTH_ERROR_NONE - Success \n
4192 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4193 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4194 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4195 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4196 * @param[in] bluetooth_device_address_t remote bt_address
4197 * @param[in] char remote uuid
4199 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4203 void bt_event_callback(int event, bluetooth_event_param_t *param)
4207 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4209 if (param->result >= BLUETOOTH_ERROR_NONE)
4211 bt_sdp_info_t *bt_sdp_info=param->param_data;
4213 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4214 bt_sdp_info->device_addr.addr[0],
4215 bt_sdp_info->device_addr.addr[1],
4216 bt_sdp_info->device_addr.addr[2],
4217 bt_sdp_info->device_addr.addr[3],
4218 bt_sdp_info->device_addr.addr[4],
4219 bt_sdp_info->device_addr.addr[5]);
4221 printf("Supported service list:\n");
4222 for(i=0; i<bt_sdp_info->service_index; i++)
4224 bt_sdp_info->service_list_array[i]);
4227 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4228 //rfcomm_test_uuid);
4232 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4234 bluetooth_rfcomm_connection_t *conn_ind =
4235 (bluetooth_rfcomm_connection_t *)param->param_data;
4237 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4238 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4239 "SERVER" : "CLIENT");
4244 bluetooth_device_address_t remote_address = {{0},};
4245 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4246 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4247 ret = bluetooth_search_service(&remote_address);
4249 printf("Seach failed, Reason = %d", ret);
4251 printf("Search Success, Ret = %d", ret);
4253 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4255 printf("Connection failed, Reason = %d", ret);
4257 printf("Connection Success, Ret = %d", ret);
4261 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4262 const char *remote_uuid);
4265 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4266 * @brief Disconnect rfcomm connection
4269 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4270 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4273 * @return BLUETOOTH_ERROR_NONE - Success \n
4274 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4275 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4276 * @param[in] char remote bt_address
4279 * @see bluetooth_rfcomm_connect
4283 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4285 printf("Disconnection failed");
4287 printf("Disconnection Success");
4292 int bluetooth_rfcomm_disconnect(int socket_fd);
4295 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4296 * @brief Write to rfcomm connection
4299 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4300 * API is used to send the data for server and the client.
4302 * @return BLUETOOTH_ERROR_NONE - Success \n
4303 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4304 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4306 * @param[in] const char *buff Data buffer to send
4307 * @param[in] int length Length of the data
4310 * @see bluetooth_rfcomm_connect
4313 char *buff = "Test data 123456789"
4314 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4316 printf("Send failed");
4318 printf("Send success");
4322 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4325 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4326 * @brief Informs whether rfcomm client is connected.
4328 * This function is a synchronous call.
4330 * @return TRUE - RFCOMM client is connected \n
4331 * FALSE - RFCOMM client is not connected \n
4337 gboolean bluetooth_rfcomm_is_client_connected(void);
4338 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4339 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4342 * @fn int bluetooth_network_activate_server(void)
4343 * @brief Activate the NAP (Network Access Point) service
4345 * This function is a asynchronous call.
4346 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4348 * @return BLUETOOTH_ERROR_NONE - Success \n
4349 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4350 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4351 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4354 * @see bluetooth_network_deactivate_server
4357 int bluetooth_network_activate_server(void);
4360 * @fn int bluetooth_network_deactivate_server(void)
4361 * @brief Deactivate the NAP (Network Access Point) service
4363 * This function is a asynchronous call.
4364 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4366 * @return BLUETOOTH_ERROR_NONE - Success \n
4367 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4368 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4369 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4372 * @see bluetooth_network_activate_server
4375 int bluetooth_network_deactivate_server(void);
4378 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4379 * bluetooth_network_role_t role,
4381 * @brief Connect the network server in the peer
4383 * This function is a asynchronous call.
4384 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4386 * @return BLUETOOTH_ERROR_NONE - Success \n
4387 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4388 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4389 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4392 * @param[in] device_address This indicates an address of the device with which the pairing
4393 * should be initiated
4394 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4395 * need to use the third parameter.
4396 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4397 * connect. UUID string
4399 * @see bluetooth_network_disconnect
4401 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4402 bluetooth_network_role_t role, char *custom_uuid);
4405 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4406 * bluetooth_network_role_t role,
4407 * char *custom_uuid)
4408 * @brief Connect the network server in the peer
4410 * This function is a asynchronous call.
4411 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4413 * @return BLUETOOTH_ERROR_NONE - Success \n
4414 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4415 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4416 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4419 * @param[in] device_address This indicates an address of the device with which the pairing
4420 * should be initiated
4422 * @see bluetooth_network_connect
4424 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4427 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4428 * @brief Disconnect the device from the network
4430 * This function is an asynchronous call.
4431 * The network server disconnect request is responded by
4432 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4434 * @return BLUETOOTH_ERROR_NONE - Success \n
4435 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4436 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4437 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4440 * @param[in] device_address This indicates an address of the connected client device
4442 * @see bluetooth_network_activate_server
4444 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4449 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4450 * bt_hdp_role_type_t role,
4451 * bt_hdp_qos_type_t channel_type,
4452 * char **app_handle)
4453 * @brief Activate the HDP service for a particular data type
4455 * This function is a synchronous call.
4457 * @return BLUETOOTH_ERROR_NONE - Success \n
4458 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4459 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4460 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4463 * @param[in] data_type The data type against corresponding service
4464 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4465 * @param[in] channel_type The QOS type for the channel.
4466 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4467 * For role = HDP_ROLE_SINK, the channel_type
4468 * should be HDP_QOS_ANY.
4469 * @param[out] app_handle The application handler against corresponding service
4471 * @see bluetooth_hdp_deactivate
4473 int bluetooth_hdp_activate(unsigned short data_type,
4474 bt_hdp_role_type_t role,
4475 bt_hdp_qos_type_t channel_type,
4478 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4479 * @brief Deactivate the HDP service for a particular service using the handler
4481 * This function is a synchronous call.
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_NO_RESOURCES - Not resource available \n
4489 * @param[in] app_handle The application handler against corresponding service
4491 * @see bluetooth_hdp_deactivate
4493 int bluetooth_hdp_deactivate(const char *app_handle);
4496 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4497 * const char *buffer, unsigned int size)
4498 * @brief Send data to the remote HDP device
4500 * This function is a synchronous call.
4502 * @return BLUETOOTH_ERROR_NONE - Success \n
4503 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4504 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4505 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4506 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4509 * @param[in] channel_id The channel id for the connection.
4510 * @param[in] buffer The pdu buffer.
4511 * @param[in] size Size of the buffer.
4513 * @see bluetooth_hdp_connect
4515 int bluetooth_hdp_send_data(unsigned int channel_id,
4516 const char *buffer, unsigned int size);
4518 * @fn int bluetooth_hdp_connect(const char *app_handle,
4519 * bt_hdp_qos_type_t channel_type,
4520 * const bluetooth_device_address_t *device_address)
4521 * @brief Connect to the remote device(Mainly used by source)
4523 * This function is a asynchronous call.
4524 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4526 * @return BLUETOOTH_ERROR_NONE - Success \n
4527 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4528 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4529 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4530 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4533 * @param[in] app_handle The application handler against corresponding service
4534 * @param[in] channel_type The QOS type for the channel.
4535 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4536 * @param[in] device_address The remote device Bd address.
4539 * @see bluetooth_hdp_disconnect
4541 int bluetooth_hdp_connect(const char *app_handle,
4542 bt_hdp_qos_type_t channel_type,
4543 const bluetooth_device_address_t *device_address);
4545 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4546 * const bluetooth_device_address_t *device_address)
4547 * @brief Disconnect from the remote device(Mainly used by source)
4549 * This function is a asynchronous call.
4550 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4552 * @return BLUETOOTH_ERROR_NONE - Success \n
4553 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4554 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4555 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4556 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4559 * @param[in] channel_id The channel id for the connection.
4560 * @param[in] device_address The remote device Bd address.
4563 * @see bluetooth_hdp_connect
4565 int bluetooth_hdp_disconnect(unsigned int channel_id,
4566 const bluetooth_device_address_t *device_address);
4570 * @fn int bluetooth_opc_init(void)
4571 * @brief Initialize OPP client.
4573 * This function is a synchronous call.
4574 * No event corresponding to this api
4576 * @return BLUETOOTH_ERROR_NONE - Success \n
4577 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4578 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4579 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4580 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4585 * @see bluetooth_opc_deinit
4587 int bluetooth_opc_init(void);
4590 * @fn int bluetooth_opc_deinit(void)
4591 * @brief Deinitialize OPP client.
4593 * This function is a synchronous call.
4594 * No event corresponding to this api
4596 * @return BLUETOOTH_ERROR_NONE - Success \n
4597 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4598 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4603 * @see bluetooth_opc_init
4606 int bluetooth_opc_deinit(void);
4609 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4610 char **file_name_array)
4611 * @brief Send multiple files to a remote device.
4613 * This function is a asynchronous call.
4614 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4616 * @return BLUETOOTH_ERROR_NONE - Success \n
4617 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4618 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4619 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4620 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4621 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4622 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4625 * @param[in] device_address The remote device Bd address.
4626 * @param[in] file_name_array Array of filepaths to be sent.
4629 * @see bluetooth_opc_cancel_push
4632 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4633 char **file_name_array);
4636 * @fn int bluetooth_opc_cancel_push(void)
4637 * @brief Cancels the ongoing file push.
4639 * This function is a asynchronous call.
4640 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4641 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4643 * @return BLUETOOTH_ERROR_NONE - Success \n
4644 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4645 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4650 * @see bluetooth_opc_push_files
4653 int bluetooth_opc_cancel_push(void);
4656 * @fn gboolean bluetooth_opc_session_is_exist(void)
4657 * @brief Informs whether opc session exists or not.
4659 * This function is a synchronous call.
4661 * @return TRUE - OPC session exists \n
4662 * FALSE - OPC session does not exist \n
4670 gboolean bluetooth_opc_session_is_exist(void);
4673 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4674 * @brief Informs whether opc session exists or not.
4676 * This function is a synchronous call.
4678 * @return BLUETOOTH_ERROR_NONE - Success \n
4679 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4680 * BLUETOOTH_ERROR_INTERNAL \n
4683 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4688 int bluetooth_opc_is_sending(gboolean *is_sending);
4691 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4692 int transfer_id, unsigned char *progress)
4693 * @brief Gets the percentage progress for ongoing transfers.
4695 * This function is a synchronous call.
4697 * @return BLUETOOTH_ERROR_NONE - Success \n
4698 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4699 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4702 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4703 * @param[in] transfer_id Transfer ID
4704 * @param[out] progress Percentage Progress
4708 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4709 int transfer_id, unsigned char *progress);
4712 * @fn int bluetooth_obex_server_init(const char *dst_path)
4713 * @brief Initialize OPP and FTP server.
4715 * This function is a synchronous call.
4716 * No event corresponding to this api
4718 * @return BLUETOOTH_ERROR_NONE - Success \n
4719 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4720 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4721 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4722 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4725 * @param[in] dst_path OPS destination file path.
4727 * @see bluetooth_obex_server_deinit
4729 int bluetooth_obex_server_init(const char *dst_path);
4733 * @fn int bluetooth_obex_server_deinit(void)
4734 * @brief Deinitialize OPP and FTP server.
4736 * This function is a synchronous call.
4737 * No event corresponding to this api
4739 * @return BLUETOOTH_ERROR_NONE - Success \n
4740 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4741 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4746 * @see bluetooth_obex_server_init
4748 int bluetooth_obex_server_deinit(void);
4752 * @fn gboolean bluetooth_obex_server_is_activated(void)
4753 * @brief Informs whether obex server is activated or not.
4755 * This function is a synchronous call.
4757 * @return TRUE - OBEX server is activated \n
4758 * FALSE - OBEX server is not activated \n
4765 gboolean bluetooth_obex_server_is_activated(void);
4769 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4770 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4772 * This function is a synchronous call.
4773 * No event corresponding to this api
4775 * @return BLUETOOTH_ERROR_NONE - Success \n
4776 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4777 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4778 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4779 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4783 * @param[in] dst_path OPS destination file path.
4785 * @see bluetooth_obex_server_deinit_without_agent
4787 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4791 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4792 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4794 * This function is a synchronous call.
4795 * No event corresponding to this api
4797 * @return BLUETOOTH_ERROR_NONE - Success \n
4798 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4799 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4804 * @see bluetooth_obex_server_init_without_agent
4806 int bluetooth_obex_server_deinit_without_agent(void);
4810 * @fn int bluetooth_obex_server_accept_connection(void)
4811 * @brief Accepts the authorization request indicated by the event
4812 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4814 * This function is a synchronous call.
4816 * @return BLUETOOTH_ERROR_NONE - Success \n
4817 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4818 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4822 * @see bluetooth_obex_server_reject_authorize
4824 int bluetooth_obex_server_accept_connection(void);
4828 * @fn int bluetooth_obex_server_reject_connection(void)
4829 * @brief Rejects the authorization request indicated by the event
4830 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4832 * This function is a synchronous call.
4834 * @return BLUETOOTH_ERROR_NONE - Success \n
4835 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4836 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4840 * @see bluetooth_obex_server_reject_authorize
4842 int bluetooth_obex_server_reject_connection(void);
4846 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4847 * @brief Accepts the authorization request indicated by the event
4848 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4850 * This function is a asynchronous call.
4851 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4853 * @return BLUETOOTH_ERROR_NONE - Success \n
4854 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4855 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4856 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4859 * @param[in] filename Authorized filename.
4862 * @see bluetooth_obex_server_reject_authorize
4865 int bluetooth_obex_server_accept_authorize(const char *filename);
4868 * @fn int bluetooth_obex_server_reject_authorize(void)
4869 * @brief Reject the authorization request indicated by the event
4870 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4872 * This function is a asynchronous call.
4873 * No event for this api..
4875 * @return BLUETOOTH_ERROR_NONE - Success \n
4876 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4877 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4882 * @see bluetooth_obex_server_accept_authorize
4885 int bluetooth_obex_server_reject_authorize(void);
4888 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4889 * @brief Set the OPS destination file path..
4891 * This function is a asynchronous call.
4892 * No event for this api..
4894 * @return BLUETOOTH_ERROR_NONE - Success \n
4895 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4896 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4897 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4900 * @param[in] dst_path OPS destination file path.
4906 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4909 * @fn int bluetooth_obex_server_set_root(const char *root)
4910 * @brief Set the FTS root folder..
4912 * This function is a asynchronous call.
4913 * No event for this api..
4915 * @return BLUETOOTH_ERROR_NONE - Success \n
4916 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4917 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4918 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4919 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4920 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4923 * @param[in] root FTS root folder.
4929 int bluetooth_obex_server_set_root(const char *root);
4932 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4933 * @brief Cancel the transfer on server
4935 * This function is an asynchronous call.
4936 * If the function call that cancels transfer is successful, the application would receive
4937 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4938 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4939 * the error code will be BLUETOOTH_ERROR_NONE
4941 * @return BLUETOOTH_ERROR_NONE - Success \n
4942 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4943 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4944 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4945 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4948 * @param[in] transfer_id transfer ID
4953 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4957 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4958 * @brief Cancel the transfer on server
4960 * This function is an asynchronous call.
4961 * If the function call that cancels transfer is successful, the application would receive
4962 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4963 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4964 * the error code will be BLUETOOTH_ERROR_NONE
4966 * @return BLUETOOTH_ERROR_NONE - Success \n
4967 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4968 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4969 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4970 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4977 int bluetooth_obex_server_cancel_all_transfers(void);
4981 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4982 * @brief Informs whether obex server is receiving or not.
4984 * This function is a synchronous call.
4986 * @return BLUETOOTH_ERROR_NONE - Success \n
4987 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4988 * BLUETOOTH_ERROR_INTERNAL \n
4991 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4996 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5000 * @fn int bluetooth_map_client_init(void)
5001 * @brief Initialize MAP client.
5003 * This function is a synchronous call.
5004 * No event corresponding to this api
5006 * @return BLUETOOTH_ERROR_NONE - Success \n
5007 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5008 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5009 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5010 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5015 * @see bluetooth_map_client_deinit
5017 int bluetooth_map_client_init(void);
5019 int bluetooth_map_client_deinit(void);
5021 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5023 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5025 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5027 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5028 bt_map_client_list_folders_filter_t *filter);
5031 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5032 * @brief Return all available fields that can be used in Fields filter.
5034 * This function is a asynchronous call.
5036 * @return BLUETOOTH_ERROR_NONE - Success \n
5037 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5038 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5041 * @param[in] session Information about session.
5044 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5046 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5048 bt_map_client_list_messages_filter_t *filter);
5050 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5052 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5053 const char *source_file,
5055 bt_map_client_push_message_args_t *args);
5057 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5058 const bt_map_client_message_object_t message_object,
5059 const char *target_file,
5064 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5065 * @brief Read the local Hash and Randmizer.
5067 * This function is a synchronous call.
5069 * @return BLUETOOTH_ERROR_NONE - Success \n
5070 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5074 * @param[out] local_oob_data - Pointer to the local OOB data
5080 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5084 * @fn int bluetooth_oob_add_remote_data(
5085 * const bluetooth_device_address_t *remote_device_address,
5086 * bt_oob_data_t *oob_data)
5087 * @brief Add/updated the remote device Hash and Randmizer.
5089 * This function is a synchronous call.
5090 * No event for this api..
5092 * @return BLUETOOTH_ERROR_NONE - Success \n
5093 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5096 * @param[in] remote_device_address - Remote device address
5097 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5103 int bluetooth_oob_add_remote_data(
5104 const bluetooth_device_address_t *remote_device_address,
5105 bt_oob_data_t *remote_oob_data);
5109 * @fn int bluetooth_oob_remove_remote_data(
5110 * const bluetooth_device_address_t *remote_device_address)
5111 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5113 * This function is a synchronous call.
5114 * No event for this api..
5116 * @return BLUETOOTH_ERROR_NONE - Success \n
5117 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5120 * @param[in] remote_device_address - Remote device address
5126 int bluetooth_oob_remove_remote_data(
5127 const bluetooth_device_address_t *remote_device_address);
5130 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5131 * bt_gatt_handle_info_t *prim_svc);
5133 * @brief Gets the GATT based primary services handle supported by remote device
5135 * This function is a synchronous call.
5136 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5138 * @return BLUETOOTH_ERROR_NONE - Success \n
5139 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5140 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5141 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5144 * @param[in] address - Remote device address
5145 * @param[out] prim_svc - Structure containing remote service count and handle list.
5148 * @see bluetooth_gatt_free_primary_services()
5150 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5151 bt_gatt_handle_info_t *prim_svc);
5154 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5156 * @brief Discovers the characteristics of GATT based service of remote device
5158 * This function is an asynchronous call.
5159 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5161 * @return BLUETOOTH_ERROR_NONE - Success \n
5162 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5163 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5164 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5167 * @param[in] service_handle - Handle for remote service.
5172 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5174 int bluetooth_gatt_set_service_change_watcher(
5175 const bluetooth_device_address_t *address, gboolean enable);
5178 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5179 * bt_gatt_service_property_t *service);
5181 * @brief Gets the properties of GATT based service of remote device
5183 * This function is a synchronous call.
5184 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5186 * @return BLUETOOTH_ERROR_NONE - Success \n
5187 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5188 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5189 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5192 * @param[in] service_handle - Handle for remote service.
5193 * @param[out] service - Structure containing remote service property.
5196 * @see bluetooth_gatt_free_service_property()
5198 int bluetooth_gatt_get_service_property(const char *service_handle,
5199 bt_gatt_service_property_t *service);
5202 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5204 * @brief Register to GATT based service to receive value change notification/indication.
5206 * This function is a synchronous call.
5207 * No event for this api.
5209 * @return BLUETOOTH_ERROR_NONE - Success \n
5210 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5211 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5212 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5215 * @param[in] service_handle - Handle for remote service.
5220 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5223 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5225 * @brief Unregister GATT based service to receive value change notification/indication.
5227 * This function is a synchronous call.
5228 * No event for this api.
5230 * @return BLUETOOTH_ERROR_NONE - Success \n
5231 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5232 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5233 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5236 * @param[in] service_handle - Handle for remote service.
5241 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5244 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5245 * bt_gatt_char_property_t *characteristic);
5247 * @brief Provides characteristic value along with properties.
5249 * This function is a synchronous call.
5250 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5252 * @return BLUETOOTH_ERROR_NONE - Success \n
5253 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5254 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5255 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5258 * @param[in] char_handle - Handle for Characteristic property.
5259 * @param[out] characteristic - Structure containing remote characteristic property.
5262 * @see bluetooth_gatt_free_char_property()
5264 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5265 bt_gatt_char_property_t *characteristic);
5268 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5269 * bt_gatt_char_property_t *characteristic);
5271 * @brief Provides characteristic descriptor value along with its UUID.
5273 * This function is a synchronous call.
5274 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5276 * @return BLUETOOTH_ERROR_NONE - Success \n
5277 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5278 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5279 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5282 * @param[in] desc_handle - Handle for Characteristic descriptor.
5283 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5286 * @see bluetooth_gatt_free_desc_property()
5288 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5289 bt_gatt_char_descriptor_property_t *descriptor);
5293 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5294 * const guint8 *value, int length)
5296 * @brief Set characteristic value.
5298 * This function is a synchronous call.
5300 * @return BLUETOOTH_ERROR_NONE - Success \n
5301 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5302 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5303 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5306 * @param[in] char_handle - Handle for Characteristic property.
5307 * @param[in] value - New value to set for characteristic property.
5308 * @param[in] length - Length of the value to be set.
5313 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5314 const guint8 *value, int length);
5317 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5318 * const guint8 *value, int length, guint8 write_type)
5320 * @brief Set characteristic value by write type.
5322 * This function is a synchronous call if write type is "write without resonse"
5323 * and it is an asynchronous call if write type is "write with response"
5325 * @return BLUETOOTH_ERROR_NONE - Success \n
5326 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5327 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5328 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5331 * @param[in] char_handle - Handle for Characteristic property.
5332 * @param[in] value - New value to set for characteristic property.
5333 * @param[in] length - Length of the value to be set.
5334 * @param[in] write_type - Type of write.
5339 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5340 const guint8 *value, int length,
5341 guint8 write_type, gpointer app_data);
5345 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5346 * const guint8 *value, int length)
5348 * @brief Set characteristic value request.
5350 * This function is an asynchronous 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_request(const char *char_handle,
5366 const guint8 *value, int length);
5369 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5371 * @brief Read characteristic value.
5373 * This function is a asynchronous call.
5375 * @return BLUETOOTH_ERROR_NONE - Success \n
5376 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5377 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5378 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5381 * @param[in] char_handle - Handle for Characteristic property.
5386 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5389 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5390 * const char *service_uuid,
5391 * bt_gatt_service_property_t *service)
5393 * @brief Gets the service property from a device based on a particular uuid
5395 * This function is a synchronous call.
5397 * @return BLUETOOTH_ERROR_NONE - Success \n
5398 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5399 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5400 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5403 * @param[in] address - BD address of the remote device
5404 * @param[in] service_uuid - uuid of the service.
5405 * @param[out] service - Structure containing the service property.
5410 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5411 const char *service_uuid,
5412 bt_gatt_service_property_t *service);
5415 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5416 * const char *char_uuid)
5418 * @brief Gets the characteristic property from a service based on a particular char uuid
5420 * This function is an asynchronous call.
5421 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5423 * @return BLUETOOTH_ERROR_NONE - Success \n
5424 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5425 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5426 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5429 * @param[in] service_handle - Service handle.
5430 * @param[in] uuid - Characteristic uuid.
5435 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5436 const char *char_uuid);
5439 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5441 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5443 * This function is a synchronous call.
5444 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5446 * @return BLUETOOTH_ERROR_NONE - Success \n
5447 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5450 * @param[in] prim_svc - GATT handle info structure
5453 * @see bluetooth_gatt_get_primary_services()
5455 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5458 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5460 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5462 * This function is a synchronous call.
5463 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5465 * @return BLUETOOTH_ERROR_NONE - Success \n
5466 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5469 * @param[in] svc_pty - GATT service property structure.
5472 * @see bluetooth_gatt_get_service_property()
5474 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5477 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5479 * @brief Provides characteristic value along with properties.
5481 * This function is a synchronous call.
5482 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5484 * @return BLUETOOTH_ERROR_NONE - Success \n
5485 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5488 * @param[in] char_pty - GATT characteristics property structure.
5491 * @see bluetooth_gatt_get_characteristics_property()
5493 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5496 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5498 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5500 * This function is a synchronous call.
5501 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5503 * @return BLUETOOTH_ERROR_NONE - Success \n
5504 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5507 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5510 * @see bluetooth_gatt_get_char_descriptor_property()
5512 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5514 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5516 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5519 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5521 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5523 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5525 * @return BLUETOOTH_ERROR_NONE - Success \n
5526 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5529 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5533 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5536 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5538 * @brief Read characteristic descriptor value.
5540 * This function is a asynchronous call.
5542 * @return BLUETOOTH_ERROR_NONE - Success \n
5543 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5544 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5545 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5548 * @param[in] desc_handle - Handle for Characteristic descriptor
5553 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5556 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5557 * const guint8 *value, int length);
5559 * @brief Set characteristic descriptor value.
5561 * This function is a asynchronous call.
5563 * @return BLUETOOTH_ERROR_NONE - Success \n
5564 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5565 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5566 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5569 * @param[in] desc_handle - Handle for Characteristic descriptor
5570 * @param[in] value - New value to set for characteristic descriptor
5571 * @param[in] length - Length of the value to be set.
5576 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5577 const guint8 *value, int length, gpointer app_data);
5579 /* @fn int bluetooth_gatt_init(void)
5581 * @brief Initializes the gatt service.
5583 * This function is a synchronous call.
5584 * @return BLUETOOTH_ERROR_NONE - Success \n
5585 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5586 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5587 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5590 * @remark Adapter should be enabled
5591 * @see bluetooth_gatt_deinit()
5593 int bluetooth_gatt_init(void);
5595 /* @fn int bluetooth_gatt_init(void)
5597 * @brief DeInitializes the gatt service.
5599 * This function is a synchronous call.
5600 * @return BLUETOOTH_ERROR_NONE - Success \n
5601 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5602 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5603 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5606 * @remark Adapter should be enabled
5607 * @see bluetooth_gatt_init()
5609 int bluetooth_gatt_deinit(void);
5611 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5612 unsigned char **svc_path)
5614 * @brief Exports a new gatt service to the service interface.
5616 * This function is a synchronous call.
5618 * @return BLUETOOTH_ERROR_NONE - Success \n
5619 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5620 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5621 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5624 * @param[in] svc_uuid Gatt service uuid.
5625 * @param[out] svc_path service object path of the exported service.
5626 * @remark Adapter should be enabled
5627 * @see bluetooth_gatt_init()
5629 int bluetooth_gatt_add_service(const char *svc_uuid,
5632 /* @fn int bluetooth_gatt_add_new_characteristic(
5633 const char *svc_path, const char *char_uuid,
5634 bt_gatt_permission_t permissions,
5635 bt_gatt_characteristic_property_t properties,
5636 int flags_length, char **char_path);;
5638 * @brief Exports a new gatt characteristic to the characteristic interface.
5640 * This function is a synchronous call.
5641 * @return BLUETOOTH_ERROR_NONE - Success \n
5642 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5643 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5644 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5646 * @param[in] svc_path service object path of the exported service.
5647 * @param[in] char_uuid Gatt service uuid.
5648 * @param[in] properties GATT characteristic properties.
5649 * @param[out] char_path characteristic object path of the exported characteristic.
5651 * @remark Adapter should be enabled
5652 * @see bluetooth_gatt_add_service()
5654 int bluetooth_gatt_add_new_characteristic(
5655 const char *svc_path, const char *char_uuid,
5656 bt_gatt_permission_t permissions,
5657 bt_gatt_characteristic_property_t properties,
5660 /* @fn bluetooth_gatt_set_characteristic_value(
5661 const char *characteristic, const char *char_value,
5664 * @brief adds gatt charactertisic value to the given charactertistic path.
5666 * This function is a synchronous call.
5667 * @return BLUETOOTH_ERROR_NONE - Success \n
5668 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5669 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5670 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5672 * @param[in] char_value Value of the GATT characteristic to be added.
5673 * @param[in] value_length length of the chantacteristic value..
5674 * @param[out] characteristic characteristic object path..
5676 * @remark Adapter should be enabled
5677 * @see bluetooth_gatt_add_service()
5679 int bluetooth_gatt_set_characteristic_value(
5680 const char *characteristic, const char *char_value,
5683 /* @fn int bluetooth_gatt_add_descriptor(
5684 const char *char_path, const char *desc_uuid,
5685 bt_gatt_permission_t permissions,
5688 * @brief Exports a new gatt descriptor to the descriptor interface.
5690 * 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
5698 * @param[in] desc_uuid Gatt descriptor uuid.
5699 * @param[in] desc_value GATT descriptor value.
5700 * @param[in] value_length Length of GATT descriptor value.
5701 * @param[in] permissions descriptor permissions.
5702 * @param[in] properties GATT descriptor properties.
5703 * @param[in] char_path characteristics object path of the exported character.
5705 * @remark Adapter should be enabled
5706 * @see bluetooth_gatt_add_service()
5707 * @see bluetooth_gatt_add_characteristics()
5709 int bluetooth_gatt_add_descriptor(
5710 const char *char_path, const char *desc_uuid,
5711 bt_gatt_permission_t permissions,
5714 /* @fn int bluetooth_gatt_set_descriptor_value(
5715 const char *desc_path, const char *desc_value,
5718 * @brief Adds value to the given descriptor handle.
5720 * This function is a synchronous call.
5722 * @return BLUETOOTH_ERROR_NONE - Success \n
5723 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5724 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5725 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5728 * @param[in] desc_value GATT descriptor value.
5729 * @param[in] value_length Length of GATT descriptor value.
5730 * @param[in] desc_path descriptor path to which the value needs to be added.
5732 * @remark Adapter should be enabled
5733 * @see bluetooth_gatt_add_service()
5734 * @see bluetooth_gatt_add_characteristics()
5736 int bluetooth_gatt_set_descriptor_value(
5737 const char *desc_path, const char *desc_value,
5740 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5742 * @brief Reads the Service registered on manager interface.
5744 * This function is a synchronous call.
5746 * @return BLUETOOTH_ERROR_NONE - Success \n
5747 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5748 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5749 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5752 * @param[in] svc_uuid Gatt Service uuid.
5754 * @remark Adapter should be enabled and service should be registered.
5755 * @see bluetooth_gatt_register_service()
5757 int bluetooth_gatt_get_service(const char *svc_uuid);
5759 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5761 * @brief Registers the given service path with the library.
5763 * This function is a synchronous call.
5765 * @return BLUETOOTH_ERROR_NONE - Success \n
5766 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5767 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5768 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5771 * @param[in] svc_path service object path of the exported service.
5773 * @remark Adapter should be enabled
5774 * @see bluetooth_gatt_add_service()
5775 * @see bluetooth_gatt_add_characteristics()
5776 * @see bluetooth_gatt_add_descriptor()
5777 * @see bluetooth_gatt_register_application()
5779 int bluetooth_gatt_register_service(const char *svc_path);
5781 /* @fn int bluetooth_gatt_register_application(void)
5783 * @brief Registers the application with the bluez gatt server.
5785 * This function is a synchronous call.
5787 * @return BLUETOOTH_ERROR_NONE - Success \n
5788 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5789 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5794 * @remark Adapter should be enabled
5795 * @see bluetooth_gatt_init()
5796 * @see bluetooth_gatt_add_service()
5797 * @see bluetooth_gatt_add_characteristics()
5798 * @see bluetooth_gatt_add_descriptor()
5799 * @see bluetooth_gatt_register_service()
5801 int bluetooth_gatt_register_application(void);
5803 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5805 * @brief Removes(unregister) service from the bluez gatt server db.
5807 * This function is a synchronous call.
5809 * @return BLUETOOTH_ERROR_NONE - Success \n
5810 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5811 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5812 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5815 * @param[in] svc_path service object path of the exported service.
5817 * @remark Adapter should be enabled
5818 * @see bluetooth_gatt_add_service()
5819 * @see bluetooth_gatt_add_characteristics()
5820 * @see bluetooth_gatt_add_descriptor()
5821 * @see bluetooth_gatt_register_service()
5823 int bluetooth_gatt_unregister_service(const char *svc_path);
5825 /* @fn int bluetooth_gatt_unregister_application(void)
5827 * @brief Removes(unregister) the application with the bluez gatt server,
5828 * and deletes all the service registered.
5830 * This function is a synchronous call.
5832 * @return BLUETOOTH_ERROR_NONE - Success \n
5833 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5834 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5835 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5839 * @remark Adapter should be enabled
5840 * @see bluetooth_gatt_init()
5841 * @see bluetooth_gatt_add_service()
5842 * @see bluetooth_gatt_add_characteristics()
5843 * @see bluetooth_gatt_add_descriptor()
5844 * @see bluetooth_gatt_register_service()
5845 * @see bluetooth_gatt_unregister_service()
5847 int bluetooth_gatt_unregister_application(void);
5849 /* @fn int bluetooth_gatt_send_response(int request_id,
5850 * int offset, char *value, int value_length)
5852 * @brief Updates the attribute value in local attribute list.
5854 * This function is a synchronous call.
5856 * @return BLUETOOTH_ERROR_NONE - Success \n
5857 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5858 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5859 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5862 * @param[in] request_id The identification of a read request
5863 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5864 * @param[in] resp_state The identification of response state
5865 * @param[in] offset The offset from where a value is read
5866 * @param[in] value The value to be sent. It will be sent from @a offset.
5867 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5868 * @param[in] value_length Value Length.
5870 * @remark Adapter should be enabled
5871 * @see bluetooth_gatt_add_service()
5872 * @see bluetooth_gatt_add_characteristics()
5873 * @see bluetooth_gatt_add_descriptor()
5874 * @see bluetooth_gatt_register_service()
5876 int bluetooth_gatt_send_response(int request_id, guint req_type,
5877 int resp_state, int offset, char *value, int value_length);
5879 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5881 * @brief Sets the notification property for a characteristic.
5883 * This function is a synchronous call.
5885 * @return BLUETOOTH_ERROR_NONE - Success \n
5886 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5887 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5888 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5891 * @param[in] char_path characteristic object path.
5892 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5894 * @remark Adapter should be enabled
5895 * @see bluetooth_gatt_update_characteristic()
5897 int bluetooth_gatt_server_set_notification(const char *char_path,
5898 bluetooth_device_address_t *unicast_address);
5900 /* @fn int bluetooth_gatt_delete_services(void)
5902 * @brief deletes (unregisters) all services from the gatt server database..
5904 * This function is a synchronous call.
5906 * @return BLUETOOTH_ERROR_NONE - Success \n
5907 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5908 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5909 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5913 * @remark Adapter should be enabled
5914 * @see bluetooth_gatt_add_service()
5915 * @see bluetooth_gatt_add_characteristics()
5916 * @see bluetooth_gatt_add_descriptor()
5917 * @see bluetooth_gatt_register_service()
5918 * @see bluetooth_gatt_unregister_service()
5920 int bluetooth_gatt_delete_services(void);
5922 /* @fn int bluetooth_gatt_update_characteristic(void)
5924 * @brief updates the given characteristic with a new value
5926 * This function is a synchronous call.
5928 * @return BLUETOOTH_ERROR_NONE - Success \n
5929 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5930 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5931 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5935 * @remark Adapter should be enabled
5936 * @see bluetooth_gatt_add_service()
5937 * @see bluetooth_gatt_add_characteristics()
5938 * @see bluetooth_gatt_add_descriptor()
5939 * @see bluetooth_gatt_register_service()
5940 * @see bluetooth_gatt_unregister_service()
5942 int bluetooth_gatt_update_characteristic(const char *char_path,
5943 const char* char_value, int value_length);
5946 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5948 * @brief Set advertising status.
5950 * This function is used to enable or disable LE advertising.
5951 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5953 * This function is a synchronous call.
5955 * @return BLUETOOTH_ERROR_NONE - Success \n
5956 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5957 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5960 * @param[in] enable - The status of advertising
5963 * @see bluetooth_set_advertising_data
5965 int bluetooth_set_advertising(int handle, gboolean enable);
5968 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5970 * @brief Set advertising status along with interval value.
5972 * This function is used to enable or disable LE advertising.
5973 * Interval_min and Interval_max is used to set the best advertising interval.
5974 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5976 * This function is a synchronous call.
5978 * @return BLUETOOTH_ERROR_NONE - Success \n
5979 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5980 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5983 * @param[in] enable - The status of advertising
5984 * @param[in] interval_min - Minimum interval of advertising (msec)
5985 * @param[in] interval_max - Maximum interval of advertising (msec)
5986 * @param[in] filter_policy - Advertising filter policy
5989 * @see bluetooth_set_advertising_data
5991 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5992 bluetooth_advertising_params_t *params);
5995 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5996 * @brief Get the advertising data
5998 * This function is used to get advertising data.
5999 * Before calling this API, the adapter should be enabled.
6001 * This function is a synchronous call.
6003 * @return BLUETOOTH_ERROR_NONE - Success \n
6004 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6005 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6006 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6008 * @param[out] value - Advertising data structure.
6009 * @param[out] length - The length of Advertising data.
6013 bluetooth_advertising_data_t *value = { {0} };
6016 ret = bluetooth_get_advertising_data(&value, &length);
6019 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6022 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6024 * @brief Set advertising data with value
6026 * This function is used to set advertising data and Maximum size of advertising data
6027 * is 28 byte (Except Flag)
6029 * This function is a synchronous call.
6031 * @return BLUETOOTH_ERROR_NONE - Success \n
6032 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6033 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6036 * @param[in] value - Advertising data structure.
6040 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6043 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6045 * @brief Check the privilege for advertising parameter setting
6047 * This function is a synchronous call.
6049 * @return BLUETOOTH_ERROR_NONE - Success \n
6050 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6056 int bluetooth_check_privilege_advertising_parameter(void);
6059 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6060 * @brief Get the LE scan response data
6062 * This function is used to get scan response data.
6063 * Before calling this API, the adapter should be enabled.
6065 * This function is a synchronous call.
6067 * @return BLUETOOTH_ERROR_NONE - Success \n
6068 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6069 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6070 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6072 * @param[out] value - Scan response data structure.
6073 * @param[out] length - The length of Scan response data.
6077 bluetooth_scan_resp_data_t *value = { {0} };
6080 ret = bluetooth_get_scan_response_data(&value, &length);
6083 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6086 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6088 * @brief Set scan response data with value
6090 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6092 * This function is a synchronous call.
6094 * @return BLUETOOTH_ERROR_NONE - Success \n
6095 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6096 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6099 * @param[in] value - LE Scan response data structure.
6103 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6106 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6108 * @brief Set scan interval and window
6110 * This function is used to set LE scan interval and window size
6112 * This function is a synchronous call.
6114 * @return BLUETOOTH_ERROR_NONE - Success \n
6115 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6116 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6119 * @param[in] interval - Interval of LE scan (msec)
6120 * @param[in] window - Window size of LE scan (msec)
6124 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6127 * @fn int bluetooth_is_advertising(void)
6128 * @brief Check for the advertising is in-progress or not.
6130 * This API is used to check the current status of the advertising procedure.
6131 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6134 * This function checks whether the advertising is started or not.
6136 * This function is a synchronous call.
6138 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6140 * @return BLUETOOTH_ERROR_NONE - Success \n
6141 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6144 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6148 gboolean is_advertising = 0;
6150 ret = bluetooth_is_advertising(&is_advertising);
6153 int bluetooth_is_advertising(gboolean *is_advertising);
6156 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6157 * @brief Add LE device to white list
6159 * This API is used to add LE device to white list
6160 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6164 * This function is a synchronous call.
6166 * @param[in] address The address of remote device
6168 * @return BLUETOOTH_ERROR_NONE - Success \n
6169 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6172 * @see bluetooth_set_custom_advertising
6174 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6177 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6178 * @brief Remove LE device from white list
6180 * This API is used to remove LE device from white list
6181 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6185 * This function is a synchronous call.
6187 * @param[in] address The address of remote device
6189 * @return BLUETOOTH_ERROR_NONE - Success \n
6190 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6193 * @see bluetooth_set_custom_advertising
6195 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6198 * @fn int bluetooth_clear_white_list(void)
6199 * @brief Clear white list
6201 * This API is used to clear white list
6202 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6206 * This function is a synchronous call.
6208 * @param[in] address The address of remote device
6210 * @return BLUETOOTH_ERROR_NONE - Success \n
6211 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6214 * @see bluetooth_set_custom_advertising
6216 int bluetooth_clear_white_list(void);
6219 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6220 * const bluetooth_le_connection_param_t *parameters)
6221 * @brief update connection paramter of LE connection.
6223 * This function is a synchronous call.
6225 * @return BLUETOOTH_ERROR_NONE - Success \n
6226 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6229 * @param[in] address - remote device address value.
6230 * @param[in] parameters - new connection parameters.
6233 * @see bluetooth_bond_device
6235 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6236 const bluetooth_le_connection_param_t *parameters);
6239 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6241 * @brief Enable/Disable LE Privacy feature.
6243 * This function is used to enable or disable LE Privacy feature.
6244 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6246 * This function is a synchronous call.
6248 * @return BLUETOOTH_ERROR_NONE - Success \n
6249 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6250 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6253 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6257 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6260 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6262 * @brief Enable/Disable LE static random address.
6264 * This function is used to enable or disable LE static random address.
6266 * This function is a synchronous call.
6268 * @return BLUETOOTH_ERROR_NONE - Success \n
6269 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6270 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6273 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6277 int bluetooth_set_le_static_random_address(gboolean enable);
6280 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6281 * bluetooth_le_connection_mode_t mode)
6282 * @brief update connection paramter of LE connection.
6284 * This function is a synchronous call.
6286 * @return BLUETOOTH_ERROR_NONE - Success \n
6287 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6288 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6291 * @param[in] address - remote device address value.
6292 * @param[in] mode - new connection mode.
6296 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6297 bluetooth_le_connection_mode_t mode);
6300 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6301 * @brief Request for new ATT MTU value.
6303 * This function is a asynchronous call.
6305 * @return BLUETOOTH_ERROR_NONE - Success \n
6306 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6307 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6310 * @param[in] address - remote device address value.
6311 * @param[in] mtu - MTU value to be set.
6315 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6318 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6319 * unsigned int *mtu)
6320 * @brief Gets the xisting MTU value set for a connection.
6322 * This function is a synchronous call.
6324 * @return BLUETOOTH_ERROR_NONE - Success \n
6325 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6326 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6329 * @param[in] address - remote device address value.
6330 * @param[out] mtu - MTU value set for the connection.
6334 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6338 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6339 * bluetooth_device_address_t *id_address)
6340 * @brief Gets the Identity address of remote device.
6342 * This function is a synchronous call.
6344 * @return BLUETOOTH_ERROR_NONE - Success \n
6345 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6346 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6349 * @param[in] device_rpa - remote Resolvable private address.
6350 * @param[out] id_address - remote Identity device address value.
6354 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6355 bluetooth_device_address_t *id_address);
6358 * @fn int bluetooth_le_read_maximum_data_length()
6359 * @brief reads the maximum LE data length supported in the controller.
6361 * This function is a synchronous call.
6363 * @return BLUETOOTH_ERROR_NONE - Success \n
6364 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6370 int bluetooth_le_read_maximum_data_length(
6371 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6373 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6374 * @brief writes the host suggested values for the controllers max transmitted no of payload
6375 * octects to be used for new connections.
6377 * This function is a synchronous call.
6379 * @return BLUETOOTH_ERROR_NONE - Success \n
6380 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6386 int bluetooth_le_write_host_suggested_default_data_length(
6387 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6389 int bluetooth_le_read_suggested_default_data_length(
6390 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6392 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6393 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6395 int bluetooth_pbap_init(void);
6396 int bluetooth_pbap_deinit(void);
6397 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6398 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6399 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6400 bt_pbap_folder_t *folder);
6401 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6402 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6403 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6404 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6405 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6406 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6407 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6408 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6411 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6413 * @brief Set manufacturer data with value
6415 * This function is used to set manufacturer data.
6417 * This function is a synchronous call.
6419 * @return BLUETOOTH_ERROR_NONE - Success \n
6420 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6421 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6424 * @param[in] value - Manufacturer data structure.
6428 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6430 int bluetooth_set_passkey_notification(gboolean enable);
6433 * @fn int bluetooth_dpm_is_mode_allowed(void);
6435 * @brief Checks Restriction for BT mode(BT allowed or not)
6437 * This function is a synchronous call.
6439 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6440 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6441 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6448 int bluetooth_dpm_is_mode_allowed(void);
6451 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6453 * @brief Sets Restriction for BT mode(BT allowed or not)
6455 * This function is a synchronous call.
6457 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6458 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6459 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6462 * @param[in] value - BT Allow value.
6463 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6464 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6465 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6466 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6470 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6473 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6475 * @brief Reads the Restriction for BT mode(BT allowed or not)
6477 * This function is a synchronous call.
6479 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6480 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6481 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6485 * @param[out] value - BT Allow value.
6486 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6487 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6488 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6489 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6493 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6496 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6498 * @brief Sets the Restriction for device.
6500 * This function is a synchronous call.
6502 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6503 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6504 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6507 * @param[in] value - State value.
6508 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6509 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6513 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6516 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6518 * @brief Reads the Restriction for device.
6520 * This function is a synchronous call.
6522 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6523 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6524 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6528 * @param[out] value - State value.
6529 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6530 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6534 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6537 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6539 * @brief Sets the Restriction for uuid.
6541 * This function is a synchronous call.
6543 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6544 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6545 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6548 * @param[in] value - State value.
6549 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6550 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6554 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6557 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6559 * @brief Reads the Restriction for uuid.
6561 * This function is a synchronous call.
6563 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6564 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6565 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6569 * @param[out] value - State value.
6570 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6571 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6575 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6578 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6580 * @brief Adds the device to blacklist.
6582 * This function is a synchronous call.
6584 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6585 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6586 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6589 * @param[in] device_address - Device address
6593 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6596 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6598 * @brief Adds the device to whitelist.
6600 * This function is a synchronous call.
6602 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6603 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6604 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6607 * @param[in] device_address - Device address
6611 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6614 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6616 * @brief Adds the Service UUIDS to blacklist.
6618 * This function is a synchronous call.
6620 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6621 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6622 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6625 * @param[in] service_uuids - profile or custom service uuids
6629 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6632 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6634 * @brief Adds the Service UUIDS to whitelist.
6636 * This function is a synchronous call.
6638 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6639 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6640 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6643 * @param[in] service_uuids - profile or custom service uuids
6647 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6650 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6652 * @brief Clears the devices from blacklist.
6654 * This function is a synchronous call.
6656 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6657 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6658 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6665 int bluetooth_dpm_clear_devices_from_blacklist(void);
6668 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6670 * @brief Clears the devices from whitelist.
6672 * This function is a synchronous call.
6674 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6675 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6676 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6683 int bluetooth_dpm_clear_devices_from_whitelist(void);
6686 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6688 * @brief Clears the uuids from blacklist.
6690 * This function is a synchronous call.
6692 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6693 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6694 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6701 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6704 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6706 * @brief Clears the uuids from whitelist.
6708 * This function is a synchronous call.
6710 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6711 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6712 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6719 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6722 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6724 * @brief reads the devices from blacklist.
6726 * This function is a synchronous call.
6728 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6729 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6730 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6733 * @param[out] device_list - list of devices
6737 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6740 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6742 * @brief reads the devices from whitelist.
6744 * This function is a synchronous call.
6746 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6747 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6748 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6751 * @param[out] device_list - list of devices
6755 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6758 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6760 * @brief reads the uuids from blacklist.
6762 * This function is a synchronous call.
6764 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6765 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6766 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6769 * @param[in] uuid_list - list of uuids
6773 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6776 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6778 * @brief reads the uuids from whitelist.
6780 * This function is a synchronous call.
6782 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6783 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6784 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6787 * @param[in] uuid_list - list of uuids
6791 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6794 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6796 * @brief Removes the device from whitelist.
6798 * This function is a synchronous call.
6800 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6801 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6802 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6805 * @param[in] device_address - Device address
6809 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6812 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6814 * @brief Removes the device from blacklist.
6816 * This function is a synchronous call.
6818 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6819 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6820 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6823 * @param[in] device_address - Device address
6827 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6830 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6832 * @brief Removes the Service UUIDS from whitelist.
6834 * This function is a synchronous call.
6836 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6837 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6838 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6841 * @param[in] service_uuids - profile or custom service uuids
6845 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6848 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6850 * @brief Removes the Service UUIDS from blacklist.
6852 * This function is a synchronous call.
6854 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6855 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6856 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6859 * @param[in] service_uuids - profile or custom service uuids
6863 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6866 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6868 * @brief Sets the Restriction for outgoing call.
6870 * This function is a synchronous call.
6872 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6873 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6874 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6877 * @param[in] value - State value.
6878 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6879 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6883 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6886 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6888 * @brief Reads the Restriction for outgoing call.
6890 * This function is a synchronous call.
6892 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6893 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6894 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6898 * @param[out] value - State value.
6899 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6900 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6904 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6907 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6909 * @brief Sets the Restriction for Pairing.
6911 * This function is a synchronous call.
6913 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6914 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6915 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6918 * @param[in] value - State value.
6919 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6920 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6924 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6927 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6929 * @brief Reads the Restriction for Pairing
6931 * This function is a synchronous call.
6933 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6934 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6935 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6939 * @param[out] value - State value.
6940 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6941 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6945 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6948 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6950 * @brief Sets the Restriction for using Profiles.
6952 * This function is a synchronous call.
6954 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6955 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6956 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6959 * @param[in]profile - Profile.
6960 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6961 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6962 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6963 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6964 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6965 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6966 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6967 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6968 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6969 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6970 * BLUETOOTH_DPM_PROFILE_NONE
6971 * @param[in] value - State value.
6972 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6973 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6977 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6980 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6982 * @brief Reads the Restriction for using Profiles.
6984 * This function is a synchronous call.
6986 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6987 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6988 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6991 * @param[in]profile - Profile.
6992 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6993 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6994 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6995 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6996 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6997 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6998 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6999 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7000 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7001 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7002 * BLUETOOTH_DPM_PROFILE_NONE
7003 * @param[out] value - State value.
7004 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7005 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7009 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7012 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7014 * @brief Sets the Restriction for Desktop Connectivity.
7016 * This function is a synchronous call.
7018 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7019 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7020 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7023 * @param[in] value - State value.
7024 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7025 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7029 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7032 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7034 * @brief Reads the Restriction for Desktop Connectivity.
7036 * This function is a synchronous call.
7038 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7039 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7040 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7044 * @param[out] value - State value.
7045 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7046 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7050 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7053 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7055 * @brief Sets the Restriction for Discoverable state.
7057 * This function is a synchronous call.
7059 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7060 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7061 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7064 * @param[in] value - State value.
7065 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7066 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7070 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7073 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7075 * @brief Reads the Restriction for Discoverable state.
7077 * This function is a synchronous call.
7079 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7080 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7081 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7085 * @param[out] value - State value.
7086 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7087 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7091 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7094 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7096 * @brief Sets the Restriction for linited discoverable state..
7098 * This function is a synchronous call.
7100 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7101 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7102 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7105 * @param[in] value - State value.
7106 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7107 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7111 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7114 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7116 * @brief Reads the Restriction for limited discoverable state.
7118 * This function is a synchronous call.
7120 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7121 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7122 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7126 * @param[out] value - State value.
7127 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7128 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7132 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7134 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7136 * @brief Sets the Restriction for Data trasnfer.
7138 * This function is a synchronous call.
7140 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7141 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7142 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7145 * @param[in] value - State value.
7146 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7147 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7151 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7155 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7157 * @brief Reads the Restriction for Data trasnfer.
7159 * This function is a synchronous call.
7161 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7162 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7163 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7167 * @param[out] value - State value.
7168 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7169 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7173 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7176 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7177 * bluetooth_pxp_poperty_t property, int value);
7179 * @brief Sets the Proximity alert level/properties for monitor role.
7181 * This function is a synchronous call.
7183 * @return BLUETOOTH_ERROR_NONE - Success \n
7184 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7185 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7186 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7189 * @param[in] device_address remote device address
7190 * @param[in] property proximity profile property
7191 * @param[in] value alert level/property value to be set
7196 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7197 bluetooth_pxp_poperty_t property, int value);
7200 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7201 * bluetooth_pxp_poperty_t property, int *value);
7203 * @brief Reads the Proximity alert level/properties for monitor role.
7205 * This function is a synchronous call.
7207 * @return BLUETOOTH_ERROR_NONE - Success \n
7208 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7209 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7210 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7213 * @param[in] device_address remote device address
7214 * @param[in] property proximity profile property
7215 * @param[out] value alert level/property value
7219 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7220 bluetooth_pxp_poperty_t property, int *value);
7223 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7224 * int *services_supported);
7226 * @brief Reads the Proximity Monitor profile supported properties/services.
7228 * This function is a synchronous call.
7230 * @return BLUETOOTH_ERROR_NONE - Success \n
7231 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7232 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7233 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7236 * @param[in] device_address remote device address
7237 * @param[out] services_supported proximity profile property/service
7241 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7242 int *services_supported);
7245 * @fn int bluetooth_proximity_reporter_register();
7247 * @brief Register all proximity related services in BlueZ.
7249 * This function is a synchronous call.
7251 * @return BLUETOOTH_ERROR_NONE - Success \n
7252 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7258 int bluetooth_proximity_reporter_register(void);
7261 * @fn int bluetooth_proximity_reporter_unregister();
7263 * @brief Unregister all proximity related services in BlueZ.
7265 * This function is a synchronous call.
7267 * @return BLUETOOTH_ERROR_NONE - Success \n
7268 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7274 int bluetooth_proximity_reporter_unregister(void);
7277 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7278 * bluetooth_pxp_poperty_t property, int *value);
7280 * @brief Reads the Proximity alert level/properties for reporter role.
7282 * This function is a synchronous call.
7284 * @return BLUETOOTH_ERROR_NONE - Success \n
7285 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7286 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7287 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7290 * @param[in] device_address remote device address
7291 * @param[in] property proximity profile property
7292 * @param[out] value alert level/property value
7296 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7297 bluetooth_pxp_poperty_t property, int *value);
7300 * @fn int bluetooth_tds_provider_register(void);
7302 * @brief Register Transport Discovery Provider role.
7304 * This function is a synchronous call.
7306 * @return BLUETOOTH_ERROR_NONE - Success \n
7307 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7308 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7309 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7317 int bluetooth_tds_provider_register(void);
7320 * @fn int bluetooth_tds_provider_unregister(void);
7322 * @brief Unregister Transport Discovery Provider role.
7324 * This function is a synchronous call.
7326 * @return BLUETOOTH_ERROR_NONE - Success \n
7327 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7328 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7329 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7337 int bluetooth_tds_provider_unregister(void);
7340 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7342 * @brief Create Transport Discovery Provider for a transport.
7344 * This function is a synchronous call.
7346 * @return BLUETOOTH_ERROR_NONE - Success \n
7347 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7348 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7349 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7352 * @param[in] Transport (BT, CUSTOM etc.)
7353 * @param[in] Unique handle for TDS provider.
7358 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7361 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7363 * @brief Remove previously created Transport Discovery Provider.
7365 * This function is a synchronous call.
7367 * @return BLUETOOTH_ERROR_NONE - Success \n
7368 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7371 * @param[in] Unique handle for previously created provider.
7376 int bluetooth_tds_provider_destroy(unsigned int handle);
7379 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7381 * @brief Set transport block for in advertisement and gatt db.
7383 * This function is a synchronous call.
7385 * @return BLUETOOTH_ERROR_NONE - Success \n
7386 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7387 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7388 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7391 * @param[in] Provider specific manufacturer data.
7392 * @param[in] Provider specific manufacturer data length.
7397 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7400 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7401 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7403 * @brief Set transport block for in advertisement and gatt db.
7405 * This function is a synchronous call.
7407 * @return BLUETOOTH_ERROR_NONE - Success \n
7408 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7409 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7410 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7413 * @param[in] Unique handle for TDS provider.
7414 * @param[in] Transport state (On/Off/Not Available).
7415 * @param[in] Transport specific data block.
7416 * @param[in] Transport specific data block length.
7421 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7422 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7425 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7426 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7428 * @brief Send response to TDS activation request from remoted device.
7430 * This function is a synchronous call.
7432 * @return BLUETOOTH_ERROR_NONE - Success \n
7433 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7434 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7435 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7438 * @param[in] Remote device BT address.
7439 * @param[in] Unique handle for TDS provider.
7440 * @param[in] Response for TDS activation request.
7441 * @param[in] Transport specific data block to be sent in activation response.
7442 * @param[in] Data block length.
7447 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7448 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7451 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7453 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7455 * This function is an asynchronous call.
7457 * @return BLUETOOTH_ERROR_NONE - Success \n
7458 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7459 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7460 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7461 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7464 * @param[in] device_address remote device address
7465 * @param[in] handle attribute handle
7467 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7468 * when TDS data is received from Remote provider
7470 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7471 const char *handle);
7474 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7476 * @brief Enables CCCD on Remote Provider.
7478 * This function is an asynchronous call.
7480 * @return BLUETOOTH_ERROR_NONE - Success \n
7481 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7482 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7483 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7484 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7487 * @param[in] device_address remote device address
7488 * @param[in] handle attribute handle
7490 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7491 * when Indication is enabled on Remote provider
7493 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7494 const char *handle);
7497 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7498 * unsigned char *buf, int length);
7499 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7501 * This function is an asynchronous call.
7503 * @return BLUETOOTH_ERROR_NONE - Success \n
7504 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7505 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7506 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7507 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7510 * @param[in] device_address remote device address
7511 * @param[in] handle attribute handle
7512 * @param[in] buf Control point activation param
7513 * @param[in] param length
7515 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7516 * is received from remote Provider
7518 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7519 unsigned char *buf, int length);
7527 #endif /* __cplusplus */
7528 #endif /* _BLUETOOTH_API_H_*/