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,
1235 HTYPE_TRANS_UNKNOWN,
1236 HTYPE_TRANS_GET_IDLE = 0xF0,
1237 HTYPE_TRANS_SET_IDLE = 0xF1,
1238 } bt_hid_header_type_t;
1244 PTYPE_DATA_RTYPE_INPUT,
1245 PTYPE_DATA_RTYPE_OUTPUT
1246 } bt_hid_param_type_t;
1249 * Stucture to hid receive data
1252 const char *address;
1253 bt_hid_header_type_t type;
1254 /**< Header type containing */
1255 bt_hid_param_type_t param;
1256 /**< Param type in header like INPUT Report or OutPut Report */
1257 int buffer_size;/**< the length of the receive buffer */
1259 /**< the receive data buffer */
1260 } bluetooth_hid_received_data_t;
1263 * Stucture to rfcomm connection
1267 int socket_fd; /**< the socket fd */
1268 int server_id; /* Server id */
1269 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1270 bluetooth_device_address_t device_addr;
1271 /**< device address */
1272 char uuid[BLUETOOTH_UUID_STRING_MAX];
1273 } bluetooth_rfcomm_connection_t;
1276 * Stucture to rfcomm disconnection
1280 /**< the socket fd */
1281 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1282 bluetooth_device_address_t device_addr;
1283 /**< device address */
1284 char uuid[BLUETOOTH_UUID_STRING_MAX];
1285 } bluetooth_rfcomm_disconnection_t;
1289 /**< the socket fd */
1290 bluetooth_device_address_t device_addr;
1291 /**< device address */
1292 } bluetooth_rfcomm_connection_request_t;
1296 /**< the socket fd */
1297 bluetooth_device_address_t device_addr;
1298 /**< device address */
1299 } bluetooth_hid_request_t;
1308 } bt_hdp_qos_type_t;
1314 HDP_ROLE_SOURCE = 0x0,
1316 } bt_hdp_role_type_t;
1320 * Stucture to HDP connected
1323 const char *app_handle; /**< the application handle */
1324 unsigned int channel_id; /**< the channel id */
1325 bt_hdp_qos_type_t type; /**< the QOS type */
1326 bluetooth_device_address_t device_address; /**< the remote address */
1327 } bt_hdp_connected_t;
1330 * Stucture to HDP disconnected
1333 unsigned int channel_id; /**< the channel id */
1334 bluetooth_device_address_t device_address; /**< the remote address */
1335 } bt_hdp_disconnected_t;
1338 * Stucture to HDP data indication
1341 unsigned int channel_id; /**< the channel id */
1342 const char *buffer; /**< the RX data buffer */
1343 unsigned int size; /**< the RX data size */
1344 } bt_hdp_data_ind_t;
1347 * Stucture to OPP client transfer information
1354 } bt_opc_transfer_info_t;
1356 /* TODO: MAP client structures, see above */
1358 * Stucture to Map filter fields
1363 } bt_map_list_filter_fields_info_t;
1365 /* Obex Server transfer type */
1366 #define TRANSFER_PUT "PUT"
1367 #define TRANSFER_GET "GET"
1369 * Stucture to OPP/FTP Server authorize information
1376 } bt_obex_server_authorize_into_t;
1384 } bt_obex_server_type_t;
1387 * Stucture to OPP/FTP server transfer information
1395 unsigned long file_size;
1397 bt_obex_server_type_t server_type;
1399 unsigned char *contact_auth_info;
1400 } bt_obex_server_transfer_info_t;
1403 * Stucture to OPP/FTP server connection/disconnection information
1409 } bt_obex_server_connection_info_t;
1413 * Stucture to OOB data
1417 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1418 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1419 unsigned int hash_len;
1420 unsigned int randomizer_len;
1422 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1423 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1424 unsigned int hash256_len;
1425 unsigned int randomizer256_len;
1429 * Structure to GATT attribute handle data
1435 } bt_gatt_handle_info_t;
1438 * Structure to GATT Remote service data
1445 bt_gatt_handle_info_t include_handles;
1446 bt_gatt_handle_info_t char_handle;
1447 } bt_gatt_service_property_t;
1450 * Structure to GATT Remote characteristic data
1454 char *service_handle;
1455 bt_gatt_handle_info_t handle_info;
1456 } bt_gatt_discovered_char_t;
1459 * Structure to format of GATT Characteristic Value
1463 unsigned char format;
1464 unsigned char exponent;
1465 unsigned short unit;
1466 unsigned char name_space;
1467 unsigned short description;
1468 } bt_gatt_char_format_t;
1471 * Structure to GATT Characteristic property
1479 bt_gatt_char_format_t format;
1481 unsigned int val_len;
1482 unsigned int permission;
1483 char *representation;
1484 bt_gatt_handle_info_t char_desc_handle;
1485 } bt_gatt_char_property_t;
1488 * Structure to GATT Characteristic descriptor property
1495 unsigned int val_len;
1496 } bt_gatt_char_descriptor_property_t;
1499 * Structure to GATT Characteristic value
1506 } bt_gatt_char_value_t;
1509 * Structure to GATT Read Request
1513 char *service_handle;
1517 } bt_gatt_read_req_t;
1520 * Structure to GATT Value change
1524 char *service_handle;
1527 gboolean response_needed;
1531 } bt_gatt_value_change_t;
1534 bluetooth_device_address_t device_addr;
1536 bluetooth_gatt_service_change_type_t change_type;
1537 } bt_gatt_service_change_t;
1540 * Structure to GATT characteristc Notification change
1544 char *service_handle;
1545 gboolean att_notify;
1546 } bt_gatt_char_notify_change_t;
1549 * Structure to Indication confirmation
1553 char *service_handle;
1556 } bt_gatt_indicate_confirm_t;
1559 * Structure for GATT response data
1565 } bt_gatt_resp_data_t;
1568 * Structure to RSSI Signal Strength Alert
1579 * Structure to RSSI Signal Strength
1589 * Structure for RSSI Enabled or Disabled
1595 gboolean rssi_enabled;
1596 } bt_rssi_enabled_t;
1599 * Structure for RSSI Threshold
1604 int in_range_threshold;
1606 } bt_rssi_threshold_t;
1610 * Structure for Suppoted Profiles and Trusted Profiles
1617 } bt_supported_profile_trusted_t;
1620 * Structure for PBAP Folder Parameters
1623 unsigned char addressbook;
1624 unsigned char folder_type;
1628 * Structure for PBAP Pull application Parameters
1631 unsigned char format;
1632 unsigned char order;
1633 unsigned short offset;
1634 unsigned short maxlist;
1635 long long unsigned fields;
1636 } bt_pbap_pull_parameters_t;
1639 * Structure for PBAP List application Parameters
1642 unsigned char order;
1643 unsigned short offset;
1644 unsigned short maxlist;
1645 } bt_pbap_list_parameters_t;
1648 * Structure for PBAP Pull vCard application Parameters
1651 unsigned char format;
1652 long long unsigned fields;
1654 } bt_pbap_pull_vcard_parameters_t;
1657 * Structure for PBAP Search application Parameters
1660 unsigned char order;
1661 unsigned short offset;
1662 unsigned short maxlist;
1663 unsigned char search_attribute;
1664 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1665 } bt_pbap_search_parameters_t;
1668 * Structure for PBAP Connection Status
1671 bluetooth_device_address_t btaddr;
1673 } bt_pbap_connected_t;
1676 * Structure for PBAP Phonebook Size
1679 bluetooth_device_address_t btaddr;
1681 } bt_pbap_phonebook_size_t;
1684 * Structure for PBAP Phonebook Pull
1687 bluetooth_device_address_t btaddr;
1690 } bt_pbap_phonebook_pull_t;
1693 * Structure for PBAP vCard List
1696 bluetooth_device_address_t btaddr;
1700 } bt_pbap_vcard_list_t;
1703 * Structure for PBAP vCard Pull
1706 bluetooth_device_address_t btaddr;
1709 } bt_pbap_vcard_pull_t;
1712 * Structure for PBAP Phonebook search List
1715 bluetooth_device_address_t btaddr;
1719 } bt_pbap_phonebook_search_list_t;
1722 * Stucture to HF Call status information
1726 char *number; /*Phone Number */
1727 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1728 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1729 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1730 int idx; /*Call index/ID */
1731 } bt_hf_call_status_info_t;
1736 } bt_hf_call_list_s;
1742 TRUSTED_PROFILE_PBAP = 1,
1743 TRUSTED_PROFILE_MAP,
1744 TRUSTED_PROFILE_SAP,
1745 TRUSTED_PROFILE_HFP_HF,
1746 TRUSTED_PROFILE_A2DP,
1747 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1748 } bluetooth_trusted_profile_t;
1751 * Structure for LE data length change params
1754 bluetooth_device_address_t device_address;
1755 guint16 max_tx_octets;
1756 guint16 max_tx_time;
1757 guint16 max_rx_octets;
1758 guint16 max_rx_time;
1759 } bt_le_data_length_params_t;
1762 * Structure for proximity property change params
1765 bluetooth_device_address_t device_address;
1769 } bt_pxp_property_changed_params_t;
1772 * @brief DPM BT allowance state
1776 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1777 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1778 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1779 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1783 * @brief DPM API result
1787 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1788 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1789 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1790 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1791 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1792 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1796 * @brief DPM Policy status
1800 BLUETOOTH_DPM_STATUS_ERROR = -1,
1802 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1803 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1805 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1806 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1808 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1809 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1813 /* policy-group : BLUETOOTH */
1814 BLUETOOTH_DPM_POLICY_ALLOW,
1815 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1816 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1817 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1818 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1819 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1820 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1821 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1822 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1823 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1824 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1825 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1826 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1827 BLUETOOTH_DPM_POLICY_END,
1828 } bt_dpm_policy_cmd_t;
1831 struct bt_dpm_policy {
1837 typedef struct bt_dpm_policy bt_dpm_policy_t;
1840 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1841 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1842 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1843 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1844 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1845 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1846 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1847 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1848 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1849 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1850 BLUETOOTH_DPM_PROFILE_NONE,
1853 struct bt_dpm_profile_val {
1854 int value; /* tells whether the profile is enabled or disabled */
1856 typedef struct dpm_profile_val dpm_profile_state_t;
1859 * Structure to DPM device list
1863 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1864 } bt_dpm_device_list_t;
1867 * Structure to DPM uuid list
1871 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1872 } bt_dpm_uuids_list_t;
1875 * Structure for IPSP Interface Info
1878 bluetooth_device_address_t btaddr;
1880 } bt_ipsp_connection_info_t;
1884 char* remote_address;
1885 } bt_map_client_session_info_s;
1887 typedef char* bt_map_client_message_object_t;
1892 } bt_map_client_list_folders_filter_t;
1897 int8_t subject_length;
1906 } bt_map_client_list_messages_filter_t;
1909 bt_map_client_message_object_t message_object;
1914 char *sender_address;
1917 char *recipient_address;
1922 int64_t attachment_size;
1927 } bt_map_client_message_item_t;
1933 } bt_map_client_push_message_args_t;
1940 char *sender_address;
1943 char *recipient_address;
1952 } bt_map_client_message_t;
1955 char **names; // holding %size null-terminated folder names
1957 } bt_map_client_folders_s;
1960 bt_map_client_message_item_t *message_items;
1962 } bt_map_client_message_items_s;
1965 const char* target_file;
1967 } bt_get_message_callback_data;
1970 * Callback pointer type
1972 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1975 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1976 * @brief Set the callback function pointer for bluetooth event
1979 * This API will register the callback function, when any response and event are received from
1980 * bluetooth framework. @n
1981 * this registered callback function will be get called with appropriate event and data structures.
1982 * This function is a synchronous call. An application developer can call
1983 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1984 * type. This registered function will receive events of bluetooth_event_type_t type along with
1988 * @param[in] callback_ptr A pointer to the callback function
1989 * @param[in] user_data A pointer to user data
1990 * @return BLUETOOTH_ERROR_NONE - Success
1994 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1996 GMainLoop *main_loop = (GMainLoop*) user_data;
2000 // Code for each event
2002 g_main_loop_quit(main_loop);
2009 GMainLoop *main_loop = NULL;
2012 main_loop = g_main_loop_new(NULL, FALSE);
2013 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2014 if (ret >= BLUETOOTH_ERROR_NONE)
2016 // bluetooth_register_callback returned Success
2020 // bluetooth_register_callback returned failiure
2022 g_main_loop_run(main_loop);
2026 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2029 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2030 * @brief Set the callback function pointer for bluetooth le event
2033 * This API will register the callback function, when any response and event are received from
2034 * bluetooth framework. @n
2035 * this registered callback function will be get called with appropriate event and data structures.
2036 * This function is a synchronous call. An application developer can call
2037 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2038 * type. This registered function will receive events of bluetooth_event_type_t type along with
2042 * @param[in] callback_ptr A pointer to the callback function
2043 * @param[in] user_data A pointer to user data
2044 * @return BLUETOOTH_ERROR_NONE - Success
2048 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2051 * @fn int bluetooth_le_unregister_callback(void)
2052 * @brief Set the callback function pointer for bluetooth le event
2055 * This API will register the callback function, when any response and event are received from
2056 * bluetooth framework. @n
2057 * this registered callback function will be get called with appropriate event and data structures.
2058 * This function is a synchronous call. An application developer can call
2059 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2060 * type. This registered function will receive events of bluetooth_event_type_t type along with
2065 * @return BLUETOOTH_ERROR_NONE - Success
2069 int bluetooth_le_unregister_callback(void);
2072 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2073 * @brief Set the callback function pointer for bluetooth event
2076 * This API will register the callback function, when any response and event are received from
2077 * bluetooth framework. @n
2078 * this registered callback function will be get called with appropriate event and data structures.
2079 * This function is a synchronous call. An application developer can call
2080 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2081 * type. This registered function will receive events of bluetooth_event_type_t type along with
2086 * @return BLUETOOTH_ERROR_NONE - Success
2090 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2092 GMainLoop *main_loop = (GMainLoop*) user_data;
2096 // Code for each event
2098 g_main_loop_quit(main_loop);
2105 GMainLoop *main_loop = NULL;
2108 main_loop = g_main_loop_new(NULL, FALSE);
2109 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2110 if (ret >= BLUETOOTH_ERROR_NONE)
2112 // bluetooth_register_callback returned Success
2116 // bluetooth_register_callback returned failiure
2118 ret = bluetooth_deregister_callback(void);
2119 g_main_loop_run(main_loop);
2123 int bluetooth_unregister_callback(void);
2126 * @fn int bluetooth_enable_adapter(void)
2127 * @brief Enable the Bluetooth H/W
2130 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2131 * send request to bluetooth chip for activation.
2132 * This function is typically called at startup or when Bluetooth services are required. This
2133 * function must be called before calling any other API of Bluetooth operations.
2135 * Before performing any operations like Device discover, service search etc.., the adapter must be
2138 * This function is a asynchronous call.
2139 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2140 * through registered callback function with appropriate result code
2141 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2142 * BLUETOOTH_ERROR_NONE - Success \n
2144 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2145 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2147 * @return BLUETOOTH_ERROR_NONE - Success\n
2148 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2149 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2150 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2151 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2153 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2155 void bt_event_callback(int event, bluetooth_event_param_t *param)
2159 case BLUETOOTH_EVENT_ENABLED:
2160 if (param->result == BLUETOOTH_ERROR_NONE)
2162 // Successfully Enabled
2175 ret = bluetooth_enable_adapter();
2179 int bluetooth_enable_adapter(void);
2182 * @fn int bluetooth_disable_adapter(void)
2183 * @brief Disable the Bluetooth H/W
2186 * This function disables Bluetooth protocol stack and hardware. This function is called when
2187 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2189 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2190 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2191 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2193 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2196 * This function is a asynchronous call.
2197 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2198 * through registered callback function.
2201 * @return BLUETOOTH_ERROR_NONE - Success\n
2202 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2203 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2204 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2206 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2208 void bt_event_callback(int event, bluetooth_event_param_t *param)
2212 case BLUETOOTH_EVENT_DISABLED:
2213 if (param->result == BLUETOOTH_ERROR_NONE)
2215 // Successfully disabled
2228 ret = bluetooth_disable_adapter();
2231 int bluetooth_disable_adapter(void);
2232 int bluetooth_recover_adapter(void);
2233 int bluetooth_check_adapter_le(void);
2234 int bluetooth_enable_adapter_le(void);
2236 int bluetooth_disable_adapter_le(void);
2239 * @fn int bluetooth_reset_adapter(void)
2240 * @brief Reset the Bluetooth H/W and values
2243 * This function resets Bluetooth protocol stack and hardware. This function is called when
2244 * an user want to initialize Bluetooth environment.
2246 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2249 * This function is a synchronous call.
2251 * @return BLUETOOTH_ERROR_NONE - Success\n
2252 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2254 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2259 ret = bluetooth_reset_adapter();
2262 int bluetooth_reset_adapter(void);
2265 * @fn int bluetooth_is_supported(void)
2266 * @brief Check if the bluetooth is supported or not by the current target
2268 * This API checks whether the bluetooth is supported or not.
2269 * This API only run by root permission.
2271 * This function is a synchronous call.
2273 * @return 0 - if bluetooth is not supported\n
2274 * 1 - if bluetooth is supported\n
2275 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2280 ret = bluetooth_is_supported();
2283 int bluetooth_is_supported(void);
2287 * @fn int bluetooth_check_adapter(void)
2288 * @brief Check the current status of the Bluetooth adapter
2291 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2292 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2293 * bluetooth adapter.
2294 * This API get the adapter internal data structure and check current adapter status.
2296 * This function is a synchronous call.
2299 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2300 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2302 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2306 ret = bluetooth_check_adapter();
2309 int bluetooth_check_adapter(void);
2312 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2313 * @brief Get the local adapter bluetooth address
2316 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2317 * the adapter should be enabled.
2318 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2319 * contain Bluetooth address.
2320 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2321 * friendly name for each device.
2322 * There is no event callback for this API.
2324 * This function is a synchronous call.
2327 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2328 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2329 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2330 * @param[out] local_address a device address of local bluetooth adapter
2335 bluetooth_device_address_t local_address={0,};
2338 ret = bluetooth_get_local_address(&local_address);
2341 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2344 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2345 * @brief Get the hci version
2348 * This function is used to get the bluetooth hci version
2349 * Before calling this API make sure that the adapter is enabled.
2351 * This function is a synchronous call.
2354 * @return BLUETOOTH_ERROR_NONE - Success \n
2355 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2356 * @param[out] timeout remain visibility timeout value
2359 bluetooth_version_t *version;
2361 ret = bluetooth_get_local_version (&version);
2364 int bluetooth_get_local_version(bluetooth_version_t *version);
2367 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2368 * @brief Get the local device name
2371 * This function is used, get the local device name. Since its difficult to remember the Adapter
2372 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2373 * friendly name is retrived by the remote device and displaying.
2374 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2376 * This function is a synchronous call.
2379 * @return BLUETOOTH_ERROR_NONE - Success \n
2380 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2381 * @param[out] local_name a local device name
2385 bluetooth_device_name_t local_name={0,}
2387 ret = bluetooth_get_local_name (&local_name);
2390 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2393 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2394 * @brief Set the local device name
2397 * This function is used to set the local device name. This is a human friendly name whose
2398 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2400 * This function is a synchronous call.
2402 * @param[in] local_name bluetooth device name to set local device
2404 * @return BLUETOOTH_ERROR_NONE - Success \n
2405 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2406 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2407 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2408 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2409 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2414 bluetooth_device_name_t local_name={0,}
2416 ret = bluetooth_set_local_name (&local_name);
2419 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2423 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2424 * @brief Check if the uuid is used or not
2426 * This function is used to check if the uuid is used or not.
2428 * This function is a synchronous call.
2430 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2431 * @param[out] used if the uuid is used or not
2433 * @return BLUETOOTH_ERROR_NONE - Success \n
2434 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2435 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2436 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2441 gboolean used = FALSE;
2442 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2443 ret = bluetooth_is_service_used(uuid, &used);
2446 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2449 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2450 * @brief Check if the device is connected to the specific service
2452 * This function is used to check if if the device is connected to the specific service.
2454 * This function is a synchronous call.
2456 * @param[in] local_address a device address of remote bluetooth device
2457 * @param[in] type the service type
2458 * @param[out] is_connected if the device is connected or not
2460 * @return BLUETOOTH_ERROR_NONE - Success \n
2461 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2462 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2463 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2468 gboolean is_connected = FALSE;
2469 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2470 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2473 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2474 bluetooth_service_type_t type,
2475 gboolean *is_connected);
2478 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2479 * @brief Gets device's connected link type
2481 * This function is used to get device's connected link type
2483 * This function is a synchronous call.
2485 * @param[in] device_address a device address of remote bluetooth device
2486 * @param[out] connected_link a device's connected link type
2488 * @return BLUETOOTH_ERROR_NONE - Success \n
2489 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2490 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2491 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2496 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2497 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2498 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2501 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2502 bluetooth_connected_link_t *connected_link);
2505 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2506 * @brief Sets a profile trusted for a device
2508 * This function is used to Set a profile as trusted for a device
2510 * This function is a synchronous call.
2512 * @param[in] device_address a device address of remote bluetooth device
2513 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2514 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2516 * @return BLUETOOTH_ERROR_NONE - Success \n
2517 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2518 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2519 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2523 int bluetooth_set_profile_trusted(
2524 const bluetooth_device_address_t *device_address,
2525 int profile, int trust);
2528 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2529 * @brief Gets a profile is trusted for a device
2531 * This function is used to Get a profile is trusted or not for a device
2533 * This function is a synchronous call.
2535 * @param[in] device_address a device address of remote bluetooth device
2536 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2537 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2539 * @return BLUETOOTH_ERROR_NONE - Success \n
2540 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2541 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2542 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2546 int bluetooth_get_profile_trusted(
2547 const bluetooth_device_address_t *device_address,
2548 int profile, int *trust);
2551 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2552 * @brief Get the visibility mode
2555 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2556 * visibity mode, the property of the device is determined whether it can be discoverable, non
2557 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2559 * This function is a synchronous call.
2562 * @return BLUETOOTH_ERROR_NONE - Success \n
2563 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2564 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2565 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2566 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2567 * @param[out] discoverable_mode current bluetooth discoverable mode
2569 * @see bluetooth_set_discoverable_mode
2571 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2573 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2576 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2579 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2581 * @brief Set the visibility mode
2584 * This function is used to set the discoverable mode (Visibility option).
2586 * Many times user may want to keep his device discoverable so that when peer device is performing
2587 * device search, he/she can find user's device. Application programmer can keep the mode as
2588 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2589 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2590 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2591 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2593 * This function is a synchronous call.
2595 * @return BLUETOOTH_ERROR_NONE - Success \n
2596 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2598 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2599 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2601 * @see bluetooth_get_discoverable_mode
2605 bluetooth_discoverable_mode_t mode;
2607 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2608 ret = bluetooth_set_discoverable_mode (mode, 180);
2612 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2617 * @fn int bluetooth_get_timeout_value(int *timeout)
2618 * @brief Get the visibility timeout value
2621 * This function is used to get the visibility timeout
2622 * Before calling this API make sure that the adapter is enabled.
2624 * This function is a synchronous call.
2627 * @return BLUETOOTH_ERROR_NONE - Success \n
2628 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2629 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2630 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2631 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2632 * @param[out] timeout remain visibility timeout value
2634 * @see bluetooth_set_discoverable_mode
2638 ret = bluetooth_get_timeout_value (&timeout);
2641 int bluetooth_get_timeout_value(int *timeout);
2645 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2646 * unsigned int classOfDeviceMask)
2647 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2649 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2650 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2651 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2652 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2653 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2654 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2655 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2656 * please see bluetooth_device_info_t for more details.
2659 * This API provides searching options like max responses, discovery duration in seconds and class
2660 * of device mask to filter device search. some times there may be too many bluetooth devices in
2661 * vicinity of your device.in such scenario, application can request to reduce number of responces
2662 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2663 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2664 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2665 * application defined time. please note that discovery_duration should be mentioned in seconds.
2666 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2669 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2670 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2671 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2673 * This function is a asynchronous call.
2674 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2675 * through registered callback function.
2677 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2678 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2680 * The completion or cancellation of the discovery is indicated by an
2681 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2683 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2686 * @return BLUETOOTH_ERROR_NONE - Success \n
2687 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2688 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2689 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2690 agent is not running \n
2692 * @param[in] max_response define the maximum response of the number of founded devices
2694 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2695 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2696 (refer to class of device)
2698 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2701 void bt_event_callback(int event, bluetooth_event_param_t *param)
2705 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2707 bluetooth_device_info_t *device_info = NULL;
2708 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2710 device_info = (bluetooth_device_info_t *)param->param_data;
2711 memcpy(&searched_device, &device_info->device_address,
2712 sizeof(bluetooth_device_address_t));
2713 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2714 device_info->device_address.addr[0],
2715 device_info->device_address.addr[1],
2716 device_info->device_address.addr[2],
2717 device_info->device_address.addr[3],
2718 device_info->device_address.addr[4],
2719 device_info->device_address.addr[5]);
2722 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2724 bluetooth_device_info_t *device_info = NULL;
2725 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2727 device_info = (bluetooth_device_info_t *)param->param_data;
2728 memcpy(&searched_device, &device_info->device_address,
2729 sizeof(bluetooth_device_address_t));
2730 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2731 device_info->device_name.name,
2732 device_info->device_address.addr[0],
2733 device_info->device_address.addr[1],
2734 device_info->device_address.addr[2],
2735 device_info->device_address.addr[3],
2736 device_info->device_address.addr[4],
2737 device_info->device_address.addr[5]);
2741 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2742 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2747 unsigned short max_response;
2748 unsigned short discovery_duration;
2749 unsigned classOfDeviceMask;
2753 discovery_duration =0;
2754 classOfDeviceMask =0;
2756 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2761 int bluetooth_start_discovery(unsigned short max_response,
2762 unsigned short discovery_duration,
2763 unsigned int classOfDeviceMask);
2766 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2767 * unsigned short max_response,
2768 * unsigned short discovery_duration,
2769 * unsigned int classOfDeviceMask)
2770 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2772 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2773 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2774 * Please see bluetooth_start_discovery() for other parameters description.
2776 * This function is a asynchronous call.
2777 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2778 * through registered callback function.
2780 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2781 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2783 * The completion or cancellation of the discovery is indicated by an
2784 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2786 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2789 * @return BLUETOOTH_ERROR_NONE - Success \n
2790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2791 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2792 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2793 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2794 agent is not running \n
2796 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2797 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2798 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2799 * @param[in] max_response define the maximum response of the number of founded devices
2801 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2802 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2803 (refer to class of device)
2805 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2808 unsigned short type;
2809 unsigned short max_response;
2810 unsigned short discovery_duration;
2811 unsigned classOfDeviceMask;
2816 discovery_duration =0;
2817 classOfDeviceMask =0;
2819 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2824 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2825 unsigned short max_response,
2826 unsigned short discovery_duration,
2827 unsigned int classOfDeviceMask);
2830 * @fn int bluetooth_cancel_discovery (void)
2831 * @brief Cancel the on-going device discovery operation
2834 * This function stops the on-going device discovery operation. This API has to be called after the
2835 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2836 * the bluetooth_start_discovery API
2838 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2839 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2840 * cancel the discover request once the user received the device to which he wish to connect.
2842 * This function is a asynchronous call.
2843 * If the call is success to cancel discovey then the application will receive
2844 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2845 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2846 * BLUETOOTH_ERROR_NONE
2849 * @return BLUETOOTH_ERROR_NONE - Success \n
2850 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2851 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2852 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2853 other application \n
2854 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2856 * @see bluetooth_start_discovery
2858 void bt_event_callback(int event, bluetooth_event_param_t *param)
2862 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2863 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2872 ret = bluetooth_cancel_discovery();
2875 int bluetooth_cancel_discovery(void);
2878 * @fn int bluetooth_start_le_discovery(void)
2879 * @brief Start the generic device discovery which finds the LE devices.
2881 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2882 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2883 * It try to find LE devices. Bluetooth device address and name are
2884 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2885 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2886 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2887 * please see bluetooth_device_info_t for more details.
2889 * This function is a asynchronous call.
2890 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2891 * through registered callback function.
2893 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2896 * The completion or cancellation of the discovery is indicated by an
2897 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2899 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2902 * @return BLUETOOTH_ERROR_NONE - Success \n
2903 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2904 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2905 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2906 agent is not running \n
2909 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2912 void bt_event_callback(int event, bluetooth_event_param_t *param)
2916 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2918 bluetooth_device_info_t *device_info = NULL;
2919 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2921 device_info = (bluetooth_device_info_t *)param->param_data;
2922 memcpy(&searched_device, &device_info->device_address,
2923 sizeof(bluetooth_device_address_t));
2924 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2925 device_info->device_address.addr[0],
2926 device_info->device_address.addr[1],
2927 device_info->device_address.addr[2],
2928 device_info->device_address.addr[3],
2929 device_info->device_address.addr[4],
2930 device_info->device_address.addr[5]);
2934 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2935 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2941 ret = bluetooth_start_discovery();
2946 int bluetooth_start_le_discovery(void);
2949 * @fn int bluetooth_stop_le_discovery (void)
2950 * @brief Cancel the on-going device LE discovery operation
2953 * This function stops the on-going device discovery operation. This API has to be called after the
2954 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2955 * the bluetooth_start_le_discovery API
2958 * This function is a asynchronous call.
2959 * If the call is success to cancel discovey then the application will receive
2960 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2961 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2962 * BLUETOOTH_ERROR_NONE
2965 * @return BLUETOOTH_ERROR_NONE - Success \n
2966 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2967 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2968 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2969 other application \n
2970 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2972 * @see bluetooth_start_discovery
2974 void bt_event_callback(int event, bluetooth_event_param_t *param)
2978 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2979 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2988 ret = bluetooth_stop_le_discovery();
2991 int bluetooth_stop_le_discovery(void);
2994 * @fn int bluetooth_is_discovering(void)
2995 * @brief Check for the device discovery is in-progress or not.
2997 * This API is used to check the current status of the Discovery operation.If discovery is in\
2998 * progress normally other operations are not allowed.
2999 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3000 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3001 * event before performing other operations. This API is used to get for the current discovery
3002 * operation status and using bluetooth_cancel_discovery()
3003 * we can cancell the ongoing discovery process.
3004 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3007 * This function checks whether the device discovery is started or not.
3009 * This function is a synchronous call.
3012 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3013 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3014 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3017 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3021 ret = bluetooth_is_discovering ();
3024 int bluetooth_is_discovering(void);
3027 * @fn int bluetooth_is_le_discovering(void)
3028 * @brief Check for the device LE discovery is in-progress or not.
3030 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3031 * progress normally other operations are not allowed.
3032 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3033 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3034 * event before performing other operations. This API is used to get for the current discovery
3035 * operation status and using bluetooth_stop_le_discovery()
3036 * we can cancell the ongoing LE discovery process.
3037 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3040 * This function checks whether the device LE discovery is started or not.
3042 * This function is a synchronous call.
3045 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3046 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3047 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3050 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3054 ret = bluetooth_is_le_discovering ();
3057 int bluetooth_is_le_discovering(void);
3060 * @fn int bluetooth_is_le_scanning(void)
3061 * @brief Check for the device LE scan is in-progress or not.
3063 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3064 * progress normally other operations are not allowed.
3066 * This function checks whether the device LE Scan is started or not.
3068 * This function is a synchronous call.
3070 * @return TRUE - LE Scan in progress \n
3071 * FALSE - LE Scan is not in progress \n
3076 gboolean is_le_scanning = 0;
3077 is_le_scanning = bluetooth_is_le_scanning ();
3080 gboolean bluetooth_is_le_scanning(void);
3082 gboolean bluetooth_is_scan_filter_supported(void);
3085 * @fn int bluetooth_force_hcidump(int timeout)
3086 * @brief Enable /disable force-hcidump
3088 * This function control force-hcidump.
3090 * This function is a synchronous call.
3092 * @return BLUETOOTH_ERROR_NONE - Success \n
3093 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3094 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3096 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3101 int bluetooth_force_hcidump(int timeout);
3104 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3105 * @brief Register scan filter.
3107 * This function registers the scan filter.
3109 * This function is a synchronous call.
3111 * @return BLUETOOTH_ERROR_NONE - Success \n
3113 * @param[in] filter scan filter to register
3114 * @param[out] slot_id the slot ID of scan filter
3118 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3121 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3122 * @brief Register scan filter.
3124 * This function unregisters the scan filter.
3126 * This function is a synchronous call.
3128 * @return BLUETOOTH_ERROR_NONE - Success \n
3130 * @param[in] slot_id the slot ID of scan filter
3134 int bluetooth_unregister_scan_filter(int slot_id);
3137 * @fn int bluetooth_unregister_all_scan_filters(void)
3138 * @brief Register scan filter.
3140 * This function usregisters all scan filters.
3142 * This function is a synchronous call.
3144 * @return BLUETOOTH_ERROR_NONE - Success \n
3148 int bluetooth_unregister_all_scan_filters(void);
3151 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3152 int link_type, bt_rssi_threshold_t rssi_threshold)
3153 * @brief Enable RSSI monitoring
3155 * This function enables RSSI monitoring and sets threshold for a connection
3157 * @return BLUETOOTH_ERROR_NONE - Success \n
3160 * @see bluetooth_get_rssi_strength
3162 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3163 int link_type, bt_rssi_threshold_t *rssi_threshold);
3166 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3167 * @brief Gets Raw RSSI signal Strength
3169 * This function gives the Raw RSSI signal strength for a connection.
3171 * @return BLUETOOTH_ERROR_NONE - Success \n
3174 * @see bluetooth_enable_rssi
3176 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3178 int bluetooth_set_connectable(gboolean is_connectable);
3180 int bluetooth_is_connectable(gboolean *is_connectable);
3183 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3184 * @brief Initiate a bonding process
3187 * This function initiates a bonding procedure with a peer device. The bonding procedure
3188 * enables authentication and optionally encryption on the Bluetooth link.
3190 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3191 * inititate the bonding request to the devices already in the paired list.
3193 * Usually we call this API after the device discovery.
3194 * This function is a asynchronous call.
3196 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3197 * mentioed result code
3198 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3199 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3200 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3201 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3202 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3204 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3205 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3208 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3211 * @return BLUETOOTH_ERROR_NONE - Success \n
3212 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3213 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3214 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3215 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3217 * @param[in] device_address This indicates an address of the device with which the pairing
3218 * should be initiated
3220 * @see bluetooth_cancel_bonding
3222 void bt_event_callback(int event, bluetooth_event_param_t *param)
3226 case BLUETOOTH_EVENT_BONDING_FINISHED:
3228 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3229 if (param->result >= BLUETOOTH_ERROR_NONE)
3231 bluetooth_device_info_t *device_info = NULL;
3232 device_info = (bluetooth_device_info_t *)param->param_data;
3233 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3234 mjr[%#x] min[%#x] srv[%#x]",
3235 device_info->device_name.name,
3236 device_info->device_address.addr[0],
3237 device_info->device_address.addr[1],
3238 device_info->device_address.addr[2],
3239 device_info->device_address.addr[3],
3240 device_info->device_address.addr[4],
3241 device_info->device_address.addr[5],
3242 device_info->device_class.major_class,
3243 device_info->device_class.minor_class,
3244 device_info->device_class.service_class);
3258 bluetooth_device_address_t device_address={{0}};
3260 ret = bluetooth_bond_device(&device_address);
3264 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3267 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3268 * bluetooth_conn_type_t conn_type)
3269 * @brief Initiate a bonding process
3272 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3273 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3275 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3276 * inititate the bonding request to the devices already in the paired list.
3278 * Usually we call this API after the device discovery.
3279 * This function is a asynchronous call.
3281 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3282 * mentioed result code
3283 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3284 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3285 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3286 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3287 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3289 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3290 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3293 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3296 * @return BLUETOOTH_ERROR_NONE - Success \n
3297 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3298 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3299 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3300 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3302 * @param[in] device_address This indicates an address of the device with which pairing
3303 * should be initiated
3304 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3307 * @see bluetooth_cancel_bonding
3309 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3310 bluetooth_conn_type_t conn_type);
3313 * @fn int bluetooth_cancel_bonding(void)
3314 * @brief Cancel the on-going bonding process
3316 * This API is called to cancel the on-going bonding procedure. It should be called before the
3317 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3318 * This API is useful when the remote device is not responding to the bond request or we wish to
3319 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3321 * This function is a synchronous call.
3323 * @return BLUETOOTH_ERROR_NONE - Success \n
3324 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3325 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3328 * @see bluetooth_bond_device
3334 ret = bluetooth_cancel_bonding();
3337 int bluetooth_cancel_bonding(void);
3340 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3341 * @brief Remove bonding
3344 * To communicate with remote device over bluetooth link, user should bond with peer device.
3345 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3346 * API is used to remove peer device from the list. Please note that after removing the device
3347 * from bonded device list, you cannot communication with peer device until bonding happens again.
3349 * User can call this function by passing bluetooth device address of any bonded device. Please note
3350 * that after successful return of this function, any bluetooth application running on your device
3351 * will not be able to communicate with unbonded device until bond operation happens again using
3352 * bluetooth_bond_device()
3355 * This function is a asynchronous call. The request to remove the specified device from the bonded
3356 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3357 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3358 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3362 * @return BLUETOOTH_ERROR_NONE - Success \n
3363 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3364 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3365 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3366 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3367 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3368 * agent is not running \n
3369 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3372 * @param[in] device_address This indicates an address of the device to remove bonding
3376 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3379 void bt_event_callback(int event, bluetooth_event_param_t *param)
3382 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3383 bluetooth_device_address_t *dev_addr = NULL;
3385 if (param->result == BLUETOOTH_ERROR_NONE) {
3386 dev_addr = (bluetooth_device_address_t *)param->param_data;
3388 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3389 dev_addr->addr[0], dev_addr->addr[1]
3390 dev_addr->addr[2], dev_addr->addr[3]
3391 dev_addr->addr[4], dev_addr->addr[5]
3402 bluetooth_device_address_t *device_address;
3404 // copy valid device address in device_address
3406 ret = bluetooth_unbond_device(device_address);
3409 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3412 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3413 * @brief Get bonded(paired) device list
3416 * This API gets all bonded device list.
3417 * The devices in the bonded device list further can be used to perform the authorization by calling
3418 * bluetooth_authorize_device API.
3420 * This function is a synchronous call.
3421 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3422 * there is no valid information in the dev_list.
3423 * The len field in the dev_list represents the number of bonded devices. The data structure for
3424 * bonded device information is bluetooth_device_info_t.
3427 * @return BLUETOOTH_ERROR_NONE - Success \n
3428 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3430 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3432 void bt_get_bonded_devices(void)
3436 GPtrArray *devinfo = NULL;
3437 bluetooth_device_info_t *ptr;
3439 // allocate the g_pointer_array
3440 devinfo = g_ptr_array_new();
3442 ret = bluetooth_get_bonded_device_list(&devinfo);
3443 if (ret != BLUETOOTH_ERROR_NONE)
3445 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3449 printf("g pointer arrary count : [%d]", devinfo->len);
3450 for (i=0; i<devinfo->len; i++)
3452 ptr = g_ptr_array_index(devinfo, i);
3455 printf("Name [%s]\n", ptr->device_name.name);
3456 printf("Major Class [%d]\n", ptr->device_class.major_class);
3457 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3458 printf("Service Class [%d]\n", ptr->device_class.service_class);
3459 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3460 ptr->device_address.addr[0],
3461 ptr->device_address.addr[1], ptr->device_address.addr[2],
3462 ptr->device_address.addr[3],
3463 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3470 // free g_pointer_array
3471 g_ptr_array_free(devinfo, TRUE);
3476 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3478 int bluetooth_get_profile_connected_device_list(
3479 const char *profile_uuid, GPtrArray **addr_list);
3482 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3483 * bluetooth_device_info_t *dev_info)
3484 * @brief Get a bonded(paired) device
3487 * This API gets a bonded device.
3489 * This function is a synchronous call.
3490 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3491 * there is no valid information in the dev_info.
3492 * The data structure for bonded device information is bluetooth_device_info_t.
3495 * @return BLUETOOTH_ERROR_NONE - Success \n
3496 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3498 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3500 void bt_get_bonded_device(void)
3504 bluetooth_device_info_t devinfo = {0};
3505 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3507 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3508 if (ret != BLUETOOTH_ERROR_NONE)
3510 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3514 printf("Name [%s]\n", devinfo.device_name.name);
3515 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3516 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3517 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3518 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3519 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3520 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3521 devinfo.device_address.addr[5]);
3530 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3531 bluetooth_device_info_t *dev_info);
3535 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3536 * gboolean *is_alias_set)
3537 * @brief Get is_alias_set property of device
3539 * This API gets is_alias_set property of a bonded device.
3541 * This function is a synchronous call.
3542 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3543 * If not,there is no valid information in the is_alias_set.
3545 * @return BLUETOOTH_ERROR_NONE - Success \n
3546 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3551 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3553 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3556 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3557 gboolean *is_alias_set);
3560 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3561 * @brief set alias for bonded device
3564 * This function set alias for bonded device.
3566 * This function is a synchronous call.
3569 * @return BLUETOOTH_ERROR_NONE - Success \n
3570 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3571 * @param[in] device_address This indicates an address of the remote device
3572 * @param[in] alias This indicates an alias to set
3577 ret = bluetooth_set_alias(&remote_address);
3580 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3584 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3585 * @brief Get remote deivice
3588 * This function gets specific remote device.
3590 * This function is a asynchronous call.
3591 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3594 * @return BLUETOOTH_ERROR_NONE - Success \n
3595 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3596 * @param[in] device_address This indicates an address of the remote device
3601 ret = bluetooth_get_remote_device(&remote_address);
3604 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3607 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3608 * gboolean authorized)
3609 * @brief Authorize/Unauthorize a bonded device
3612 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3613 * with/without user confirmation.
3615 * If we select a paired device and make it authorized by calling this API with the authorized
3616 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3617 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3618 * then it will ask for the user conformation before the connection.
3620 * This API supposed to be called on the paired devices. Which means we have to use this API only
3621 * after successful pairing.
3623 * This function is a asynchronous call.
3624 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3626 * @return BLUETOOTH_ERROR_NONE - Success \n
3627 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3628 * @param[in] device_address This indicates an address of the device to authorize \n
3629 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3631 * @see bluetooth_get_bonded_device_list
3633 void bt_event_callback(int event, bluetooth_event_param_t *param)
3637 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3639 if (param->result == BLUETOOTH_ERROR_NONE)
3643 //device authorization failed failure
3651 bluetooth_device_address_t device_address={{0}};
3652 gboolean authorized;
3656 ret = bluetooth_authorize_device(&device_address,authorized);
3659 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3660 gboolean authorized);
3662 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3663 const bluetooth_device_pin_code_t *pin_code);
3665 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3668 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3670 * @brief Receives Legacy Passkey\pin with following authentication response types
3672 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3673 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3676 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3679 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3681 * @brief This API sends user confirmation reply to the local adapter.
3683 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3686 int bluetooth_passkey_confirmation_reply(gboolean reply);
3689 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3690 * @brief Get all services supported by remote device
3693 * This API call initiates the search for the services supported by the specified device. Normally
3694 * the service search will take a couple of seconds to get it completed. Before calling this API
3695 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3696 * perform the service search. We can get the device address by doing a device discovery operation.
3699 * This function is a asynchronous call.
3700 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3702 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3703 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3704 * event is generated with appropriate result code.
3706 * @return BLUETOOTH_ERROR_NONE - Success \n
3707 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3708 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3709 * @param[in] device_address This indicates an address of the device
3710 * whose services need to be found
3712 * @see bluetooth_cancel_service_search
3714 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3717 * @fn int bluetooth_cancel_service_search(void)
3718 * @brief Cancel the ongoing service search operation
3721 * This function cancel the ongoing service search operation. This API is usually calling after the
3722 * bluetooth_search_service API.
3723 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3724 * if the user wish to cancel the Ongoing service search operation.
3726 * This API should be called just after the bluetooth_search_service API and before the
3727 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3729 * This function is a synchronous call.
3731 * @return BLUETOOTH_ERROR_NONE - Success \n
3732 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3733 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3734 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3737 * @see bluetooth_search_service
3742 ret = bluetooth_cancel_service_search();
3745 int bluetooth_cancel_service_search(void);
3748 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3749 * @brief Register rfcomm socket with a specific uuid
3752 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3753 * descriptor of the server.
3754 * This is the first API which is called to create the server. Once we created the server socket,
3755 * we will listen on that return socket.
3756 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3759 * @return socket FD on Success \n
3760 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3761 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3762 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3763 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3764 * @param[in] UUID (128 bits)
3767 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3771 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3772 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3776 int bluetooth_rfcomm_create_socket(const char *uuid);
3779 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3780 * @brief Register rfcomm socket with a specific uuid
3783 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3784 * descriptor of the server.
3785 * This is the first API which is called to create the server. Once we created the server socket,
3786 * we will listen on that return socket.
3787 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3790 * @return socket FD on Success \n
3791 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3792 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3793 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3794 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3795 * @param[in] UUID (128 bits)
3796 * @param[in] bus_name (const char)
3797 * @param[in] path (const char)
3800 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3804 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3805 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3809 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3812 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3813 * @brief De-register the rfcomm socket
3816 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3817 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3818 * descriptor else no event will come. We will call this API only after the
3819 * bluetooth_rfcomm_listen_and_accept.
3820 * This is a synchronous call.
3822 * @return BLUETOOTH_ERROR_NONE - Success \n
3823 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3824 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3825 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3826 * @param[in] int socket_fd
3829 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3832 void bt_event_callback(int event, bluetooth_event_param_t *param)
3836 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3838 bluetooth_rfcomm_connection_t *discon_ind =
3839 (bluetooth_rfcomm_connection_t *)param->param_data;
3841 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3849 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3850 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3852 ret = bluetooth_rfcomm_remove_socket(fd);
3855 int bluetooth_rfcomm_remove_socket(int socket_fd);
3858 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3859 * @brief De-register the rfcomm socket
3862 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3863 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3864 * descriptor else no event will come. We will call this API only after the
3865 * bluetooth_rfcomm_listen_and_accept_ex.
3866 * This is a synchronous call.
3868 * @return BLUETOOTH_ERROR_NONE - Success \n
3869 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3870 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3871 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3872 * @param[in] UUID (128 bits)
3875 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3878 void bt_event_callback(int event, bluetooth_event_param_t *param)
3882 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3884 bluetooth_rfcomm_connection_t *discon_ind =
3885 (bluetooth_rfcomm_connection_t *)param->param_data;
3887 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3895 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3896 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3898 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3901 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3904 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3905 * @brief Disconnect rfcomm connection
3908 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3909 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3912 * @return BLUETOOTH_ERROR_NONE - Success \n
3913 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3914 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3915 * @param[in] int socket_fd the sending socket fd
3921 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3923 printf("Disconnection failed");
3925 printf("Disconnection Success");
3929 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3932 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3933 * @brief Rfcomm socket listen
3936 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3937 * after the bluetooth_rfcomm_create_socket API.
3938 * This API listen for the incomming connection and once it receives a connection, it will give
3939 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3940 * event to the application. This is an Asynchronous API call.
3943 * @return BLUETOOTH_ERROR_NONE - Success \n
3944 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3945 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3947 * @param[in] int socket_fd
3948 * @param[in] max pending connection.
3951 * @see bluetooth_rfcomm_create_socket
3954 void bt_event_callback(int event, bluetooth_event_param_t* param)
3958 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3960 bluetooth_rfcomm_connection_t *conn_ind =
3961 (bluetooth_rfcomm_connection_t *)param->param_data;
3963 printf("\nConnected from FD %d", conn_ind->socket_fd);
3971 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3972 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3976 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3979 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3980 * @brief Rfcomm socket listen
3983 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3984 * after the bluetooth_rfcomm_create_socket API.
3985 * This API listen for the incomming connection and once it receives a connection, it will give
3986 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3987 * event to the application. This is an Asynchronous API call.
3990 * @return BLUETOOTH_ERROR_NONE - Success \n
3991 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3992 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3994 * @param[in] int socket_fd
3995 * @param[in] max pending connection.
4000 * @see bluetooth_rfcomm_create_socket_ex
4003 void bt_event_callback(int event, bluetooth_event_param_t* param)
4007 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4009 bluetooth_rfcomm_connection_t *conn_ind =
4010 (bluetooth_rfcomm_connection_t *)param->param_data;
4012 printf("\nConnected from FD %d", conn_ind->socket_fd);
4020 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4021 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4026 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4029 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
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_AUTHORIZE
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.
4048 * @see bluetooth_rfcomm_create_socket
4051 void bt_event_callback(int event, bluetooth_event_param_t* param)
4055 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4057 char *name = (char *)param->param_data;
4059 printf("\nConnected from %s", name);
4061 bluetooth_rfcomm_accept_connection();
4069 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4070 ret = bluetooth_rfcomm_listen(fd, 1);
4074 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4077 * @fn int bluetooth_rfcomm_accept_connection()
4078 * @brief Accepts the authorization request indicated by the event
4079 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4081 * This function is a synchronous call.
4083 * @return BLUETOOTH_ERROR_NONE - Success \n
4084 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4086 * @param[in] the socket fd of the server
4087 * @param[out] the socket fd of the client
4091 * @see bluetooth_rfcomm_reject_connection
4093 int bluetooth_rfcomm_accept_connection(int server_fd);
4096 * @fn int bluetooth_rfcomm_reject_connection()
4097 * @brief Rejects the authorization request indicated by the event
4098 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4100 * This function is a synchronous call.
4102 * @return BLUETOOTH_ERROR_NONE - Success \n
4103 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4105 * @param[in] the socket fd of the server
4109 * @see bluetooth_rfcomm_accept_connection
4111 int bluetooth_rfcomm_reject_connection(int server_fd);
4114 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4115 * @brief Informs whether rfcomm server uuid is available or not.
4117 * This function is a synchronous call.
4119 * @return TRUE - RFCOMM uuid is available \n
4120 * FALSE - RFCOMM uuid is not available \n
4122 * @param[in] uuid UUID string
4128 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4131 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4132 * const char *remote_uuid)
4133 * @brief Connect to the remote device rfcomm *
4135 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4136 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4137 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4138 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4139 * initiating a connection.
4141 * @return BLUETOOTH_ERROR_NONE - Success \n
4142 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4143 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4144 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4145 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4146 * @param[in] bluetooth_device_address_t remote bt_address
4147 * @param[in] char remote uuid
4149 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4153 void bt_event_callback(int event, bluetooth_event_param_t *param)
4157 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4159 if (param->result >= BLUETOOTH_ERROR_NONE)
4161 bt_sdp_info_t *bt_sdp_info=param->param_data;
4163 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4164 bt_sdp_info->device_addr.addr[0],
4165 bt_sdp_info->device_addr.addr[1],
4166 bt_sdp_info->device_addr.addr[2],
4167 bt_sdp_info->device_addr.addr[3],
4168 bt_sdp_info->device_addr.addr[4],
4169 bt_sdp_info->device_addr.addr[5]);
4171 printf("Supported service list:\n");
4172 for(i=0; i<bt_sdp_info->service_index; i++)
4174 bt_sdp_info->service_list_array[i]);
4177 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4178 //rfcomm_test_uuid);
4182 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4184 bluetooth_rfcomm_connection_t *conn_ind =
4185 (bluetooth_rfcomm_connection_t *)param->param_data;
4187 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4188 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4189 "SERVER" : "CLIENT");
4194 bluetooth_device_address_t remote_address = {{0},};
4195 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4196 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4197 ret = bluetooth_search_service(&remote_address);
4199 printf("Seach failed, Reason = %d", ret);
4201 printf("Search Success, Ret = %d", ret);
4203 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4205 printf("Connection failed, Reason = %d", ret);
4207 printf("Connection Success, Ret = %d", ret);
4211 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4212 const char *remote_uuid);
4215 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4216 * @brief Disconnect rfcomm connection
4219 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4220 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4223 * @return BLUETOOTH_ERROR_NONE - Success \n
4224 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4225 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4226 * @param[in] char remote bt_address
4229 * @see bluetooth_rfcomm_connect
4233 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4235 printf("Disconnection failed");
4237 printf("Disconnection Success");
4242 int bluetooth_rfcomm_disconnect(int socket_fd);
4245 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4246 * @brief Write to rfcomm connection
4249 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4250 * API is used to send the data for server and the client.
4252 * @return BLUETOOTH_ERROR_NONE - Success \n
4253 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4254 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4256 * @param[in] const char *buff Data buffer to send
4257 * @param[in] int length Length of the data
4260 * @see bluetooth_rfcomm_connect
4263 char *buff = "Test data 123456789"
4264 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4266 printf("Send failed");
4268 printf("Send success");
4272 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4275 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4276 * @brief Informs whether rfcomm client is connected.
4278 * This function is a synchronous call.
4280 * @return TRUE - RFCOMM client is connected \n
4281 * FALSE - RFCOMM client is not connected \n
4287 gboolean bluetooth_rfcomm_is_client_connected(void);
4288 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4289 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4292 * @fn int bluetooth_network_activate_server(void)
4293 * @brief Activate the NAP (Network Access Point) service
4295 * This function is a asynchronous call.
4296 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4298 * @return BLUETOOTH_ERROR_NONE - Success \n
4299 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4300 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4301 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4304 * @see bluetooth_network_deactivate_server
4307 int bluetooth_network_activate_server(void);
4310 * @fn int bluetooth_network_deactivate_server(void)
4311 * @brief Deactivate the NAP (Network Access Point) service
4313 * This function is a asynchronous call.
4314 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4316 * @return BLUETOOTH_ERROR_NONE - Success \n
4317 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4318 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4319 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4322 * @see bluetooth_network_activate_server
4325 int bluetooth_network_deactivate_server(void);
4328 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4329 * bluetooth_network_role_t role,
4331 * @brief Connect the network server in the peer
4333 * This function is a asynchronous call.
4334 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4336 * @return BLUETOOTH_ERROR_NONE - Success \n
4337 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4338 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4339 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4342 * @param[in] device_address This indicates an address of the device with which the pairing
4343 * should be initiated
4344 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4345 * need to use the third parameter.
4346 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4347 * connect. UUID string
4349 * @see bluetooth_network_disconnect
4351 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4352 bluetooth_network_role_t role, char *custom_uuid);
4355 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4356 * bluetooth_network_role_t role,
4357 * char *custom_uuid)
4358 * @brief Connect the network server in the peer
4360 * This function is a asynchronous call.
4361 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4363 * @return BLUETOOTH_ERROR_NONE - Success \n
4364 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4365 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4366 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4369 * @param[in] device_address This indicates an address of the device with which the pairing
4370 * should be initiated
4372 * @see bluetooth_network_connect
4374 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4377 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4378 * @brief Disconnect the device from the network
4380 * This function is an asynchronous call.
4381 * The network server disconnect request is responded by
4382 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4384 * @return BLUETOOTH_ERROR_NONE - Success \n
4385 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4386 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4387 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4390 * @param[in] device_address This indicates an address of the connected client device
4392 * @see bluetooth_network_activate_server
4394 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4399 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4400 * bt_hdp_role_type_t role,
4401 * bt_hdp_qos_type_t channel_type,
4402 * char **app_handle)
4403 * @brief Activate the HDP service for a particular data type
4405 * This function is a synchronous call.
4407 * @return BLUETOOTH_ERROR_NONE - Success \n
4408 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4409 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4410 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4413 * @param[in] data_type The data type against corresponding service
4414 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4415 * @param[in] channel_type The QOS type for the channel.
4416 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4417 * For role = HDP_ROLE_SINK, the channel_type
4418 * should be HDP_QOS_ANY.
4419 * @param[out] app_handle The application handler against corresponding service
4421 * @see bluetooth_hdp_deactivate
4423 int bluetooth_hdp_activate(unsigned short data_type,
4424 bt_hdp_role_type_t role,
4425 bt_hdp_qos_type_t channel_type,
4428 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4429 * @brief Deactivate the HDP service for a particular service using the handler
4431 * This function is a synchronous call.
4433 * @return BLUETOOTH_ERROR_NONE - Success \n
4434 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4435 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4436 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4439 * @param[in] app_handle The application handler against corresponding service
4441 * @see bluetooth_hdp_deactivate
4443 int bluetooth_hdp_deactivate(const char *app_handle);
4446 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4447 * const char *buffer, unsigned int size)
4448 * @brief Send data to the remote HDP device
4450 * This function is a synchronous call.
4452 * @return BLUETOOTH_ERROR_NONE - Success \n
4453 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4454 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4455 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4456 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4459 * @param[in] channel_id The channel id for the connection.
4460 * @param[in] buffer The pdu buffer.
4461 * @param[in] size Size of the buffer.
4463 * @see bluetooth_hdp_connect
4465 int bluetooth_hdp_send_data(unsigned int channel_id,
4466 const char *buffer, unsigned int size);
4468 * @fn int bluetooth_hdp_connect(const char *app_handle,
4469 * bt_hdp_qos_type_t channel_type,
4470 * const bluetooth_device_address_t *device_address)
4471 * @brief Connect to the remote device(Mainly used by source)
4473 * This function is a asynchronous call.
4474 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4476 * @return BLUETOOTH_ERROR_NONE - Success \n
4477 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4478 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4479 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4480 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4483 * @param[in] app_handle The application handler against corresponding service
4484 * @param[in] channel_type The QOS type for the channel.
4485 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4486 * @param[in] device_address The remote device Bd address.
4489 * @see bluetooth_hdp_disconnect
4491 int bluetooth_hdp_connect(const char *app_handle,
4492 bt_hdp_qos_type_t channel_type,
4493 const bluetooth_device_address_t *device_address);
4495 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4496 * const bluetooth_device_address_t *device_address)
4497 * @brief Disconnect from the remote device(Mainly used by source)
4499 * This function is a asynchronous call.
4500 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
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_MEMORY_ALLOCATION -Memory allocation failed \n
4509 * @param[in] channel_id The channel id for the connection.
4510 * @param[in] device_address The remote device Bd address.
4513 * @see bluetooth_hdp_connect
4515 int bluetooth_hdp_disconnect(unsigned int channel_id,
4516 const bluetooth_device_address_t *device_address);
4520 * @fn int bluetooth_opc_init(void)
4521 * @brief Initialize OPP client.
4523 * This function is a synchronous call.
4524 * No event corresponding to this api
4526 * @return BLUETOOTH_ERROR_NONE - Success \n
4527 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4528 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4529 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4530 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4535 * @see bluetooth_opc_deinit
4537 int bluetooth_opc_init(void);
4540 * @fn int bluetooth_opc_deinit(void)
4541 * @brief Deinitialize OPP client.
4543 * This function is a synchronous call.
4544 * No event corresponding to this api
4546 * @return BLUETOOTH_ERROR_NONE - Success \n
4547 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4548 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4553 * @see bluetooth_opc_init
4556 int bluetooth_opc_deinit(void);
4559 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4560 char **file_name_array)
4561 * @brief Send multiple files to a remote device.
4563 * This function is a asynchronous call.
4564 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4566 * @return BLUETOOTH_ERROR_NONE - Success \n
4567 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4568 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4569 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4570 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4571 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4572 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4575 * @param[in] device_address The remote device Bd address.
4576 * @param[in] file_name_array Array of filepaths to be sent.
4579 * @see bluetooth_opc_cancel_push
4582 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4583 char **file_name_array);
4586 * @fn int bluetooth_opc_cancel_push(void)
4587 * @brief Cancels the ongoing file push.
4589 * This function is a asynchronous call.
4590 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4591 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4593 * @return BLUETOOTH_ERROR_NONE - Success \n
4594 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4595 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4600 * @see bluetooth_opc_push_files
4603 int bluetooth_opc_cancel_push(void);
4606 * @fn gboolean bluetooth_opc_session_is_exist(void)
4607 * @brief Informs whether opc session exists or not.
4609 * This function is a synchronous call.
4611 * @return TRUE - OPC session exists \n
4612 * FALSE - OPC session does not exist \n
4620 gboolean bluetooth_opc_session_is_exist(void);
4623 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4624 * @brief Informs whether opc session exists or not.
4626 * This function is a synchronous call.
4628 * @return BLUETOOTH_ERROR_NONE - Success \n
4629 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4630 * BLUETOOTH_ERROR_INTERNAL \n
4633 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4638 int bluetooth_opc_is_sending(gboolean *is_sending);
4641 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4642 int transfer_id, unsigned char *progress)
4643 * @brief Gets the percentage progress for ongoing transfers.
4645 * This function is a synchronous call.
4647 * @return BLUETOOTH_ERROR_NONE - Success \n
4648 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4649 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4652 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4653 * @param[in] transfer_id Transfer ID
4654 * @param[out] progress Percentage Progress
4658 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4659 int transfer_id, unsigned char *progress);
4662 * @fn int bluetooth_obex_server_init(const char *dst_path)
4663 * @brief Initialize OPP and FTP server.
4665 * This function is a synchronous call.
4666 * No event corresponding to this api
4668 * @return BLUETOOTH_ERROR_NONE - Success \n
4669 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4670 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4671 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4672 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4675 * @param[in] dst_path OPS destination file path.
4677 * @see bluetooth_obex_server_deinit
4679 int bluetooth_obex_server_init(const char *dst_path);
4683 * @fn int bluetooth_obex_server_deinit(void)
4684 * @brief Deinitialize OPP and FTP server.
4686 * This function is a synchronous call.
4687 * No event corresponding to this api
4689 * @return BLUETOOTH_ERROR_NONE - Success \n
4690 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4691 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4696 * @see bluetooth_obex_server_init
4698 int bluetooth_obex_server_deinit(void);
4702 * @fn gboolean bluetooth_obex_server_is_activated(void)
4703 * @brief Informs whether obex server is activated or not.
4705 * This function is a synchronous call.
4707 * @return TRUE - OBEX server is activated \n
4708 * FALSE - OBEX server is not activated \n
4715 gboolean bluetooth_obex_server_is_activated(void);
4719 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4720 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4722 * This function is a synchronous call.
4723 * No event corresponding to this api
4725 * @return BLUETOOTH_ERROR_NONE - Success \n
4726 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4727 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4728 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4729 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4733 * @param[in] dst_path OPS destination file path.
4735 * @see bluetooth_obex_server_deinit_without_agent
4737 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4741 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4742 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4744 * This function is a synchronous call.
4745 * No event corresponding to this api
4747 * @return BLUETOOTH_ERROR_NONE - Success \n
4748 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4749 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4754 * @see bluetooth_obex_server_init_without_agent
4756 int bluetooth_obex_server_deinit_without_agent(void);
4760 * @fn int bluetooth_obex_server_accept_connection(void)
4761 * @brief Accepts the authorization request indicated by the event
4762 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4764 * This function is a synchronous call.
4766 * @return BLUETOOTH_ERROR_NONE - Success \n
4767 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4768 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4772 * @see bluetooth_obex_server_reject_authorize
4774 int bluetooth_obex_server_accept_connection(void);
4778 * @fn int bluetooth_obex_server_reject_connection(void)
4779 * @brief Rejects the authorization request indicated by the event
4780 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4782 * This function is a synchronous call.
4784 * @return BLUETOOTH_ERROR_NONE - Success \n
4785 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4786 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4790 * @see bluetooth_obex_server_reject_authorize
4792 int bluetooth_obex_server_reject_connection(void);
4796 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4797 * @brief Accepts the authorization request indicated by the event
4798 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4800 * This function is a asynchronous call.
4801 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4803 * @return BLUETOOTH_ERROR_NONE - Success \n
4804 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4805 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4806 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4809 * @param[in] filename Authorized filename.
4812 * @see bluetooth_obex_server_reject_authorize
4815 int bluetooth_obex_server_accept_authorize(const char *filename);
4818 * @fn int bluetooth_obex_server_reject_authorize(void)
4819 * @brief Reject the authorization request indicated by the event
4820 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4822 * This function is a asynchronous call.
4823 * No event for this api..
4825 * @return BLUETOOTH_ERROR_NONE - Success \n
4826 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4827 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4832 * @see bluetooth_obex_server_accept_authorize
4835 int bluetooth_obex_server_reject_authorize(void);
4838 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4839 * @brief Set the OPS destination file path..
4841 * This function is a asynchronous call.
4842 * No event for this api..
4844 * @return BLUETOOTH_ERROR_NONE - Success \n
4845 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4846 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4847 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4850 * @param[in] dst_path OPS destination file path.
4856 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4859 * @fn int bluetooth_obex_server_set_root(const char *root)
4860 * @brief Set the FTS root folder..
4862 * This function is a asynchronous call.
4863 * No event for this api..
4865 * @return BLUETOOTH_ERROR_NONE - Success \n
4866 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4867 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4868 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4869 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4870 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4873 * @param[in] root FTS root folder.
4879 int bluetooth_obex_server_set_root(const char *root);
4882 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4883 * @brief Cancel the transfer on server
4885 * This function is an asynchronous call.
4886 * If the function call that cancels transfer is successful, the application would receive
4887 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4888 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4889 * the error code will be BLUETOOTH_ERROR_NONE
4891 * @return BLUETOOTH_ERROR_NONE - Success \n
4892 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4893 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4894 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4895 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4898 * @param[in] transfer_id transfer ID
4903 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4907 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4908 * @brief Cancel the transfer on server
4910 * This function is an asynchronous call.
4911 * If the function call that cancels transfer is successful, the application would receive
4912 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4913 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4914 * the error code will be BLUETOOTH_ERROR_NONE
4916 * @return BLUETOOTH_ERROR_NONE - Success \n
4917 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4918 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4919 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4920 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4927 int bluetooth_obex_server_cancel_all_transfers(void);
4931 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4932 * @brief Informs whether obex server is receiving or not.
4934 * This function is a synchronous call.
4936 * @return BLUETOOTH_ERROR_NONE - Success \n
4937 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4938 * BLUETOOTH_ERROR_INTERNAL \n
4941 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4946 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4950 * @fn int bluetooth_map_client_init(void)
4951 * @brief Initialize MAP client.
4953 * This function is a synchronous call.
4954 * No event corresponding to this api
4956 * @return BLUETOOTH_ERROR_NONE - Success \n
4957 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4958 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4959 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4960 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4965 * @see bluetooth_map_client_deinit
4967 int bluetooth_map_client_init(void);
4969 int bluetooth_map_client_deinit(void);
4971 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
4973 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
4975 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
4977 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
4978 bt_map_client_list_folders_filter_t *filter);
4981 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
4982 * @brief Return all available fields that can be used in Fields filter.
4984 * This function is a asynchronous call.
4986 * @return BLUETOOTH_ERROR_NONE - Success \n
4987 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4988 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
4991 * @param[in] session Information about session.
4994 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
4996 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
4998 bt_map_client_list_messages_filter_t *filter);
5000 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5002 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5003 const char *source_file,
5005 bt_map_client_push_message_args_t *args);
5007 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5008 const bt_map_client_message_object_t message_object,
5009 const char *target_file,
5014 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5015 * @brief Read the local Hash and Randmizer.
5017 * This function is a synchronous call.
5019 * @return BLUETOOTH_ERROR_NONE - Success \n
5020 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5024 * @param[out] local_oob_data - Pointer to the local OOB data
5030 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5034 * @fn int bluetooth_oob_add_remote_data(
5035 * const bluetooth_device_address_t *remote_device_address,
5036 * bt_oob_data_t *oob_data)
5037 * @brief Add/updated the remote device Hash and Randmizer.
5039 * This function is a synchronous call.
5040 * No event for this api..
5042 * @return BLUETOOTH_ERROR_NONE - Success \n
5043 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5046 * @param[in] remote_device_address - Remote device address
5047 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5053 int bluetooth_oob_add_remote_data(
5054 const bluetooth_device_address_t *remote_device_address,
5055 bt_oob_data_t *remote_oob_data);
5059 * @fn int bluetooth_oob_remove_remote_data(
5060 * const bluetooth_device_address_t *remote_device_address)
5061 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5063 * This function is a synchronous call.
5064 * No event for this api..
5066 * @return BLUETOOTH_ERROR_NONE - Success \n
5067 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5070 * @param[in] remote_device_address - Remote device address
5076 int bluetooth_oob_remove_remote_data(
5077 const bluetooth_device_address_t *remote_device_address);
5080 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5081 * bt_gatt_handle_info_t *prim_svc);
5083 * @brief Gets the GATT based primary services handle supported by remote device
5085 * This function is a synchronous call.
5086 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5088 * @return BLUETOOTH_ERROR_NONE - Success \n
5089 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5090 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5091 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5094 * @param[in] address - Remote device address
5095 * @param[out] prim_svc - Structure containing remote service count and handle list.
5098 * @see bluetooth_gatt_free_primary_services()
5100 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5101 bt_gatt_handle_info_t *prim_svc);
5104 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5106 * @brief Discovers the characteristics of GATT based service of remote device
5108 * This function is an asynchronous call.
5109 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5111 * @return BLUETOOTH_ERROR_NONE - Success \n
5112 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5113 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5114 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5117 * @param[in] service_handle - Handle for remote service.
5122 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5124 int bluetooth_gatt_set_service_change_watcher(
5125 const bluetooth_device_address_t *address, gboolean enable);
5128 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5129 * bt_gatt_service_property_t *service);
5131 * @brief Gets the properties of GATT based service of remote device
5133 * This function is a synchronous call.
5134 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5136 * @return BLUETOOTH_ERROR_NONE - Success \n
5137 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5138 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5139 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5142 * @param[in] service_handle - Handle for remote service.
5143 * @param[out] service - Structure containing remote service property.
5146 * @see bluetooth_gatt_free_service_property()
5148 int bluetooth_gatt_get_service_property(const char *service_handle,
5149 bt_gatt_service_property_t *service);
5152 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5154 * @brief Register to GATT based service to receive value change notification/indication.
5156 * This function is a synchronous call.
5157 * No event for this api.
5159 * @return BLUETOOTH_ERROR_NONE - Success \n
5160 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5161 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5162 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5165 * @param[in] service_handle - Handle for remote service.
5170 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5173 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5175 * @brief Unregister GATT based service to receive value change notification/indication.
5177 * This function is a synchronous call.
5178 * No event for this api.
5180 * @return BLUETOOTH_ERROR_NONE - Success \n
5181 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5182 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5183 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5186 * @param[in] service_handle - Handle for remote service.
5191 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5194 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5195 * bt_gatt_char_property_t *characteristic);
5197 * @brief Provides characteristic value along with properties.
5199 * This function is a synchronous call.
5200 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5202 * @return BLUETOOTH_ERROR_NONE - Success \n
5203 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5204 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5205 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5208 * @param[in] char_handle - Handle for Characteristic property.
5209 * @param[out] characteristic - Structure containing remote characteristic property.
5212 * @see bluetooth_gatt_free_char_property()
5214 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5215 bt_gatt_char_property_t *characteristic);
5218 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5219 * bt_gatt_char_property_t *characteristic);
5221 * @brief Provides characteristic descriptor value along with its UUID.
5223 * This function is a synchronous call.
5224 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5226 * @return BLUETOOTH_ERROR_NONE - Success \n
5227 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5228 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5229 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5232 * @param[in] desc_handle - Handle for Characteristic descriptor.
5233 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5236 * @see bluetooth_gatt_free_desc_property()
5238 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5239 bt_gatt_char_descriptor_property_t *descriptor);
5243 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5244 * const guint8 *value, int length)
5246 * @brief Set characteristic value.
5248 * This function is a synchronous call.
5250 * @return BLUETOOTH_ERROR_NONE - Success \n
5251 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5252 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5253 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5256 * @param[in] char_handle - Handle for Characteristic property.
5257 * @param[in] value - New value to set for characteristic property.
5258 * @param[in] length - Length of the value to be set.
5263 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5264 const guint8 *value, int length);
5267 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5268 * const guint8 *value, int length, guint8 write_type)
5270 * @brief Set characteristic value by write type.
5272 * This function is a synchronous call if write type is "write without resonse"
5273 * and it is an asynchronous call if write type is "write with response"
5275 * @return BLUETOOTH_ERROR_NONE - Success \n
5276 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5277 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5278 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5281 * @param[in] char_handle - Handle for Characteristic property.
5282 * @param[in] value - New value to set for characteristic property.
5283 * @param[in] length - Length of the value to be set.
5284 * @param[in] write_type - Type of write.
5289 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5290 const guint8 *value, int length,
5291 guint8 write_type, gpointer app_data);
5295 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5296 * const guint8 *value, int length)
5298 * @brief Set characteristic value request.
5300 * This function is an asynchronous call.
5302 * @return BLUETOOTH_ERROR_NONE - Success \n
5303 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5304 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5305 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5308 * @param[in] char_handle - Handle for Characteristic property.
5309 * @param[in] value - New value to set for characteristic property.
5310 * @param[in] length - Length of the value to be set.
5315 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5316 const guint8 *value, int length);
5319 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5321 * @brief Read characteristic value.
5323 * This function is a asynchronous call.
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.
5336 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5339 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5340 * const char *service_uuid,
5341 * bt_gatt_service_property_t *service)
5343 * @brief Gets the service property from a device based on a particular uuid
5345 * This function is a synchronous call.
5347 * @return BLUETOOTH_ERROR_NONE - Success \n
5348 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5349 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5350 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5353 * @param[in] address - BD address of the remote device
5354 * @param[in] service_uuid - uuid of the service.
5355 * @param[out] service - Structure containing the service property.
5360 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5361 const char *service_uuid,
5362 bt_gatt_service_property_t *service);
5365 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5366 * const char *char_uuid)
5368 * @brief Gets the characteristic property from a service based on a particular char uuid
5370 * This function is an asynchronous call.
5371 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5373 * @return BLUETOOTH_ERROR_NONE - Success \n
5374 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5375 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5376 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5379 * @param[in] service_handle - Service handle.
5380 * @param[in] uuid - Characteristic uuid.
5385 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5386 const char *char_uuid);
5389 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5391 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5393 * This function is a synchronous call.
5394 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5396 * @return BLUETOOTH_ERROR_NONE - Success \n
5397 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5400 * @param[in] prim_svc - GATT handle info structure
5403 * @see bluetooth_gatt_get_primary_services()
5405 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5408 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5410 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5412 * This function is a synchronous call.
5413 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5415 * @return BLUETOOTH_ERROR_NONE - Success \n
5416 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5419 * @param[in] svc_pty - GATT service property structure.
5422 * @see bluetooth_gatt_get_service_property()
5424 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5427 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5429 * @brief Provides characteristic value along with properties.
5431 * This function is a synchronous call.
5432 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5434 * @return BLUETOOTH_ERROR_NONE - Success \n
5435 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5438 * @param[in] char_pty - GATT characteristics property structure.
5441 * @see bluetooth_gatt_get_characteristics_property()
5443 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5446 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5448 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5450 * This function is a synchronous call.
5451 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5453 * @return BLUETOOTH_ERROR_NONE - Success \n
5454 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5457 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5460 * @see bluetooth_gatt_get_char_descriptor_property()
5462 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5464 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5466 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5469 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5471 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5473 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5475 * @return BLUETOOTH_ERROR_NONE - Success \n
5476 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5479 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5483 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5486 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5488 * @brief Read characteristic descriptor value.
5490 * This function is a asynchronous call.
5492 * @return BLUETOOTH_ERROR_NONE - Success \n
5493 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5494 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5495 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5498 * @param[in] desc_handle - Handle for Characteristic descriptor
5503 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5506 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5507 * const guint8 *value, int length);
5509 * @brief Set characteristic descriptor value.
5511 * This function is a asynchronous call.
5513 * @return BLUETOOTH_ERROR_NONE - Success \n
5514 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5515 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5516 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5519 * @param[in] desc_handle - Handle for Characteristic descriptor
5520 * @param[in] value - New value to set for characteristic descriptor
5521 * @param[in] length - Length of the value to be set.
5526 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5527 const guint8 *value, int length, gpointer app_data);
5529 /* @fn int bluetooth_gatt_init(void)
5531 * @brief Initializes the gatt service.
5533 * This function is a synchronous call.
5534 * @return BLUETOOTH_ERROR_NONE - Success \n
5535 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5536 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5537 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5540 * @remark Adapter should be enabled
5541 * @see bluetooth_gatt_deinit()
5543 int bluetooth_gatt_init(void);
5545 /* @fn int bluetooth_gatt_init(void)
5547 * @brief DeInitializes the gatt service.
5549 * This function is a synchronous call.
5550 * @return BLUETOOTH_ERROR_NONE - Success \n
5551 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5552 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5553 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5556 * @remark Adapter should be enabled
5557 * @see bluetooth_gatt_init()
5559 int bluetooth_gatt_deinit(void);
5561 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5562 unsigned char **svc_path)
5564 * @brief Exports a new gatt service to the service interface.
5566 * This function is a synchronous call.
5568 * @return BLUETOOTH_ERROR_NONE - Success \n
5569 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5570 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5571 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5574 * @param[in] svc_uuid Gatt service uuid.
5575 * @param[out] svc_path service object path of the exported service.
5576 * @remark Adapter should be enabled
5577 * @see bluetooth_gatt_init()
5579 int bluetooth_gatt_add_service(const char *svc_uuid,
5582 /* @fn int bluetooth_gatt_add_new_characteristic(
5583 const char *svc_path, const char *char_uuid,
5584 bt_gatt_permission_t permissions,
5585 bt_gatt_characteristic_property_t properties,
5586 int flags_length, char **char_path);;
5588 * @brief Exports a new gatt characteristic to the characteristic interface.
5590 * This function is a synchronous call.
5591 * @return BLUETOOTH_ERROR_NONE - Success \n
5592 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5593 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5594 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5596 * @param[in] svc_path service object path of the exported service.
5597 * @param[in] char_uuid Gatt service uuid.
5598 * @param[in] properties GATT characteristic properties.
5599 * @param[out] char_path characteristic object path of the exported characteristic.
5601 * @remark Adapter should be enabled
5602 * @see bluetooth_gatt_add_service()
5604 int bluetooth_gatt_add_new_characteristic(
5605 const char *svc_path, const char *char_uuid,
5606 bt_gatt_permission_t permissions,
5607 bt_gatt_characteristic_property_t properties,
5610 /* @fn bluetooth_gatt_set_characteristic_value(
5611 const char *characteristic, const char *char_value,
5614 * @brief adds gatt charactertisic value to the given charactertistic path.
5616 * This function is a synchronous call.
5617 * @return BLUETOOTH_ERROR_NONE - Success \n
5618 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5619 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5620 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5622 * @param[in] char_value Value of the GATT characteristic to be added.
5623 * @param[in] value_length length of the chantacteristic value..
5624 * @param[out] characteristic characteristic object path..
5626 * @remark Adapter should be enabled
5627 * @see bluetooth_gatt_add_service()
5629 int bluetooth_gatt_set_characteristic_value(
5630 const char *characteristic, const char *char_value,
5633 /* @fn int bluetooth_gatt_add_descriptor(
5634 const char *char_path, const char *desc_uuid,
5635 bt_gatt_permission_t permissions,
5638 * @brief Exports a new gatt descriptor to the descriptor interface.
5640 * This function is a synchronous call.
5642 * @return BLUETOOTH_ERROR_NONE - Success \n
5643 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5644 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5645 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5648 * @param[in] desc_uuid Gatt descriptor uuid.
5649 * @param[in] desc_value GATT descriptor value.
5650 * @param[in] value_length Length of GATT descriptor value.
5651 * @param[in] permissions descriptor permissions.
5652 * @param[in] properties GATT descriptor properties.
5653 * @param[in] char_path characteristics object path of the exported character.
5655 * @remark Adapter should be enabled
5656 * @see bluetooth_gatt_add_service()
5657 * @see bluetooth_gatt_add_characteristics()
5659 int bluetooth_gatt_add_descriptor(
5660 const char *char_path, const char *desc_uuid,
5661 bt_gatt_permission_t permissions,
5664 /* @fn int bluetooth_gatt_set_descriptor_value(
5665 const char *desc_path, const char *desc_value,
5668 * @brief Adds value to the given descriptor handle.
5670 * This function is a synchronous call.
5672 * @return BLUETOOTH_ERROR_NONE - Success \n
5673 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5674 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5675 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5678 * @param[in] desc_value GATT descriptor value.
5679 * @param[in] value_length Length of GATT descriptor value.
5680 * @param[in] desc_path descriptor path to which the value needs to be added.
5682 * @remark Adapter should be enabled
5683 * @see bluetooth_gatt_add_service()
5684 * @see bluetooth_gatt_add_characteristics()
5686 int bluetooth_gatt_set_descriptor_value(
5687 const char *desc_path, const char *desc_value,
5690 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5692 * @brief Reads the Service registered on manager interface.
5694 * This function is a synchronous call.
5696 * @return BLUETOOTH_ERROR_NONE - Success \n
5697 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5698 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5699 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5702 * @param[in] svc_uuid Gatt Service uuid.
5704 * @remark Adapter should be enabled and service should be registered.
5705 * @see bluetooth_gatt_register_service()
5707 int bluetooth_gatt_get_service(const char *svc_uuid);
5709 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5711 * @brief Registers the given service path with the library.
5713 * This function is a synchronous call.
5715 * @return BLUETOOTH_ERROR_NONE - Success \n
5716 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5717 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5718 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5721 * @param[in] svc_path service object path of the exported service.
5723 * @remark Adapter should be enabled
5724 * @see bluetooth_gatt_add_service()
5725 * @see bluetooth_gatt_add_characteristics()
5726 * @see bluetooth_gatt_add_descriptor()
5727 * @see bluetooth_gatt_register_application()
5729 int bluetooth_gatt_register_service(const char *svc_path);
5731 /* @fn int bluetooth_gatt_register_application(void)
5733 * @brief Registers the application with the bluez gatt server.
5735 * This function is a synchronous call.
5737 * @return BLUETOOTH_ERROR_NONE - Success \n
5738 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5739 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5740 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5744 * @remark Adapter should be enabled
5745 * @see bluetooth_gatt_init()
5746 * @see bluetooth_gatt_add_service()
5747 * @see bluetooth_gatt_add_characteristics()
5748 * @see bluetooth_gatt_add_descriptor()
5749 * @see bluetooth_gatt_register_service()
5751 int bluetooth_gatt_register_application(void);
5753 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5755 * @brief Removes(unregister) service from the bluez gatt server db.
5757 * This function is a synchronous call.
5759 * @return BLUETOOTH_ERROR_NONE - Success \n
5760 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5761 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5762 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5765 * @param[in] svc_path service object path of the exported service.
5767 * @remark Adapter should be enabled
5768 * @see bluetooth_gatt_add_service()
5769 * @see bluetooth_gatt_add_characteristics()
5770 * @see bluetooth_gatt_add_descriptor()
5771 * @see bluetooth_gatt_register_service()
5773 int bluetooth_gatt_unregister_service(const char *svc_path);
5775 /* @fn int bluetooth_gatt_unregister_application(void)
5777 * @brief Removes(unregister) the application with the bluez gatt server,
5778 * and deletes all the service registered.
5780 * This function is a synchronous call.
5782 * @return BLUETOOTH_ERROR_NONE - Success \n
5783 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5784 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5785 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5789 * @remark Adapter should be enabled
5790 * @see bluetooth_gatt_init()
5791 * @see bluetooth_gatt_add_service()
5792 * @see bluetooth_gatt_add_characteristics()
5793 * @see bluetooth_gatt_add_descriptor()
5794 * @see bluetooth_gatt_register_service()
5795 * @see bluetooth_gatt_unregister_service()
5797 int bluetooth_gatt_unregister_application(void);
5799 /* @fn int bluetooth_gatt_send_response(int request_id,
5800 * int offset, char *value, int value_length)
5802 * @brief Updates the attribute value in local attribute list.
5804 * This function is a synchronous call.
5806 * @return BLUETOOTH_ERROR_NONE - Success \n
5807 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5808 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5809 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5812 * @param[in] request_id The identification of a read request
5813 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5814 * @param[in] resp_state The identification of response state
5815 * @param[in] offset The offset from where a value is read
5816 * @param[in] value The value to be sent. It will be sent from @a offset.
5817 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5818 * @param[in] value_length Value Length.
5820 * @remark Adapter should be enabled
5821 * @see bluetooth_gatt_add_service()
5822 * @see bluetooth_gatt_add_characteristics()
5823 * @see bluetooth_gatt_add_descriptor()
5824 * @see bluetooth_gatt_register_service()
5826 int bluetooth_gatt_send_response(int request_id, guint req_type,
5827 int resp_state, int offset, char *value, int value_length);
5829 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5831 * @brief Sets the notification property for a characteristic.
5833 * This function is a synchronous call.
5835 * @return BLUETOOTH_ERROR_NONE - Success \n
5836 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5837 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5838 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5841 * @param[in] char_path characteristic object path.
5842 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5844 * @remark Adapter should be enabled
5845 * @see bluetooth_gatt_update_characteristic()
5847 int bluetooth_gatt_server_set_notification(const char *char_path,
5848 bluetooth_device_address_t *unicast_address);
5850 /* @fn int bluetooth_gatt_delete_services(void)
5852 * @brief deletes (unregisters) all services from the gatt server database..
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
5863 * @remark Adapter should be enabled
5864 * @see bluetooth_gatt_add_service()
5865 * @see bluetooth_gatt_add_characteristics()
5866 * @see bluetooth_gatt_add_descriptor()
5867 * @see bluetooth_gatt_register_service()
5868 * @see bluetooth_gatt_unregister_service()
5870 int bluetooth_gatt_delete_services(void);
5872 /* @fn int bluetooth_gatt_update_characteristic(void)
5874 * @brief updates the given characteristic with a new value
5876 * This function is a synchronous call.
5878 * @return BLUETOOTH_ERROR_NONE - Success \n
5879 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5880 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5881 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5885 * @remark Adapter should be enabled
5886 * @see bluetooth_gatt_add_service()
5887 * @see bluetooth_gatt_add_characteristics()
5888 * @see bluetooth_gatt_add_descriptor()
5889 * @see bluetooth_gatt_register_service()
5890 * @see bluetooth_gatt_unregister_service()
5892 int bluetooth_gatt_update_characteristic(const char *char_path,
5893 const char* char_value, int value_length);
5896 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5898 * @brief Set advertising status.
5900 * This function is used to enable or disable LE advertising.
5901 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5903 * This function is a synchronous call.
5905 * @return BLUETOOTH_ERROR_NONE - Success \n
5906 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5907 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5910 * @param[in] enable - The status of advertising
5913 * @see bluetooth_set_advertising_data
5915 int bluetooth_set_advertising(int handle, gboolean enable);
5918 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5920 * @brief Set advertising status along with interval value.
5922 * This function is used to enable or disable LE advertising.
5923 * Interval_min and Interval_max is used to set the best advertising interval.
5924 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5926 * This function is a synchronous call.
5928 * @return BLUETOOTH_ERROR_NONE - Success \n
5929 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5930 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5933 * @param[in] enable - The status of advertising
5934 * @param[in] interval_min - Minimum interval of advertising (msec)
5935 * @param[in] interval_max - Maximum interval of advertising (msec)
5936 * @param[in] filter_policy - Advertising filter policy
5939 * @see bluetooth_set_advertising_data
5941 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5942 bluetooth_advertising_params_t *params);
5945 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5946 * @brief Get the advertising data
5948 * This function is used to get advertising data.
5949 * Before calling this API, the adapter should be enabled.
5951 * This function is a synchronous call.
5953 * @return BLUETOOTH_ERROR_NONE - Success \n
5954 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5955 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5956 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5958 * @param[out] value - Advertising data structure.
5959 * @param[out] length - The length of Advertising data.
5963 bluetooth_advertising_data_t *value = { {0} };
5966 ret = bluetooth_get_advertising_data(&value, &length);
5969 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5972 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5974 * @brief Set advertising data with value
5976 * This function is used to set advertising data and Maximum size of advertising data
5977 * is 28 byte (Except Flag)
5979 * This function is a synchronous call.
5981 * @return BLUETOOTH_ERROR_NONE - Success \n
5982 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5983 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5986 * @param[in] value - Advertising data structure.
5990 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5993 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5995 * @brief Check the privilege for advertising parameter setting
5997 * This function is a synchronous call.
5999 * @return BLUETOOTH_ERROR_NONE - Success \n
6000 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6006 int bluetooth_check_privilege_advertising_parameter(void);
6009 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6010 * @brief Get the LE scan response data
6012 * This function is used to get scan response data.
6013 * Before calling this API, the adapter should be enabled.
6015 * This function is a synchronous call.
6017 * @return BLUETOOTH_ERROR_NONE - Success \n
6018 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6019 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6020 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6022 * @param[out] value - Scan response data structure.
6023 * @param[out] length - The length of Scan response data.
6027 bluetooth_scan_resp_data_t *value = { {0} };
6030 ret = bluetooth_get_scan_response_data(&value, &length);
6033 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6036 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6038 * @brief Set scan response data with value
6040 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6042 * This function is a synchronous call.
6044 * @return BLUETOOTH_ERROR_NONE - Success \n
6045 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6046 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6049 * @param[in] value - LE Scan response data structure.
6053 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6056 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6058 * @brief Set scan interval and window
6060 * This function is used to set LE scan interval and window size
6062 * This function is a synchronous call.
6064 * @return BLUETOOTH_ERROR_NONE - Success \n
6065 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6066 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6069 * @param[in] interval - Interval of LE scan (msec)
6070 * @param[in] window - Window size of LE scan (msec)
6074 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6077 * @fn int bluetooth_is_advertising(void)
6078 * @brief Check for the advertising is in-progress or not.
6080 * This API is used to check the current status of the advertising procedure.
6081 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6084 * This function checks whether the advertising is started or not.
6086 * This function is a synchronous call.
6088 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6090 * @return BLUETOOTH_ERROR_NONE - Success \n
6091 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6094 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6098 gboolean is_advertising = 0;
6100 ret = bluetooth_is_advertising(&is_advertising);
6103 int bluetooth_is_advertising(gboolean *is_advertising);
6106 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6107 * @brief Add LE device to white list
6109 * This API is used to add LE device to white list
6110 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6114 * This function is a synchronous call.
6116 * @param[in] address The address of remote device
6118 * @return BLUETOOTH_ERROR_NONE - Success \n
6119 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6122 * @see bluetooth_set_custom_advertising
6124 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6127 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6128 * @brief Remove LE device from white list
6130 * This API is used to remove LE device from white list
6131 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6135 * This function is a synchronous call.
6137 * @param[in] address The address of remote device
6139 * @return BLUETOOTH_ERROR_NONE - Success \n
6140 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6143 * @see bluetooth_set_custom_advertising
6145 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6148 * @fn int bluetooth_clear_white_list(void)
6149 * @brief Clear white list
6151 * This API is used to clear white list
6152 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6156 * This function is a synchronous call.
6158 * @param[in] address The address of remote device
6160 * @return BLUETOOTH_ERROR_NONE - Success \n
6161 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6164 * @see bluetooth_set_custom_advertising
6166 int bluetooth_clear_white_list(void);
6169 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6170 * const bluetooth_le_connection_param_t *parameters)
6171 * @brief update connection paramter of LE connection.
6173 * This function is a synchronous call.
6175 * @return BLUETOOTH_ERROR_NONE - Success \n
6176 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6179 * @param[in] address - remote device address value.
6180 * @param[in] parameters - new connection parameters.
6183 * @see bluetooth_bond_device
6185 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6186 const bluetooth_le_connection_param_t *parameters);
6189 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6191 * @brief Enable/Disable LE Privacy feature.
6193 * This function is used to enable or disable LE Privacy feature.
6194 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6196 * This function is a synchronous call.
6198 * @return BLUETOOTH_ERROR_NONE - Success \n
6199 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6200 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6203 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6207 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6210 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6212 * @brief Enable/Disable LE static random address.
6214 * This function is used to enable or disable LE static random address.
6216 * This function is a synchronous call.
6218 * @return BLUETOOTH_ERROR_NONE - Success \n
6219 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6220 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6223 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6227 int bluetooth_set_le_static_random_address(gboolean enable);
6230 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6231 * bluetooth_le_connection_mode_t mode)
6232 * @brief update connection paramter of LE connection.
6234 * This function is a synchronous call.
6236 * @return BLUETOOTH_ERROR_NONE - Success \n
6237 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6238 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6241 * @param[in] address - remote device address value.
6242 * @param[in] mode - new connection mode.
6246 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6247 bluetooth_le_connection_mode_t mode);
6250 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6251 * @brief Request for new ATT MTU value.
6253 * This function is a asynchronous call.
6255 * @return BLUETOOTH_ERROR_NONE - Success \n
6256 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6257 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6260 * @param[in] address - remote device address value.
6261 * @param[in] mtu - MTU value to be set.
6265 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6268 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6269 * unsigned int *mtu)
6270 * @brief Gets the xisting MTU value set for a connection.
6272 * This function is a synchronous call.
6274 * @return BLUETOOTH_ERROR_NONE - Success \n
6275 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6276 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6279 * @param[in] address - remote device address value.
6280 * @param[out] mtu - MTU value set for the connection.
6284 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6288 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6289 * bluetooth_device_address_t *id_address)
6290 * @brief Gets the Identity address of remote device.
6292 * This function is a synchronous call.
6294 * @return BLUETOOTH_ERROR_NONE - Success \n
6295 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6296 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6299 * @param[in] device_rpa - remote Resolvable private address.
6300 * @param[out] id_address - remote Identity device address value.
6304 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6305 bluetooth_device_address_t *id_address);
6308 * @fn int bluetooth_le_read_maximum_data_length()
6309 * @brief reads the maximum LE data length supported in the controller.
6311 * This function is a synchronous call.
6313 * @return BLUETOOTH_ERROR_NONE - Success \n
6314 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6320 int bluetooth_le_read_maximum_data_length(
6321 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6323 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6324 * @brief writes the host suggested values for the controllers max transmitted no of payload
6325 * octects to be used for new connections.
6327 * This function is a synchronous call.
6329 * @return BLUETOOTH_ERROR_NONE - Success \n
6330 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6336 int bluetooth_le_write_host_suggested_default_data_length(
6337 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6339 int bluetooth_le_read_suggested_default_data_length(
6340 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6342 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6343 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6345 int bluetooth_pbap_init(void);
6346 int bluetooth_pbap_deinit(void);
6347 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6348 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6349 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6350 bt_pbap_folder_t *folder);
6351 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6352 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6353 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6354 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6355 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6356 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6357 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6358 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6361 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6363 * @brief Set manufacturer data with value
6365 * This function is used to set manufacturer data.
6367 * This function is a synchronous call.
6369 * @return BLUETOOTH_ERROR_NONE - Success \n
6370 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6371 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6374 * @param[in] value - Manufacturer data structure.
6378 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6380 int bluetooth_set_passkey_notification(gboolean enable);
6383 * @fn int bluetooth_dpm_is_mode_allowed(void);
6385 * @brief Checks Restriction for BT mode(BT allowed or not)
6387 * This function is a synchronous call.
6389 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6390 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6391 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6398 int bluetooth_dpm_is_mode_allowed(void);
6401 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6403 * @brief Sets Restriction for BT mode(BT allowed or not)
6405 * This function is a synchronous call.
6407 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6408 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6409 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6412 * @param[in] value - BT Allow value.
6413 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6414 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6415 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6416 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6420 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6423 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6425 * @brief Reads the Restriction for BT mode(BT allowed or not)
6427 * This function is a synchronous call.
6429 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6430 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6431 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6435 * @param[out] value - BT Allow value.
6436 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6437 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6438 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6439 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6443 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6446 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6448 * @brief Sets the Restriction for device.
6450 * This function is a synchronous call.
6452 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6453 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6454 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6457 * @param[in] value - State value.
6458 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6459 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6463 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6466 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6468 * @brief Reads the Restriction for device.
6470 * This function is a synchronous call.
6472 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6473 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6474 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6478 * @param[out] value - State value.
6479 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6480 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6484 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6487 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6489 * @brief Sets the Restriction for uuid.
6491 * This function is a synchronous call.
6493 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6494 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6495 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6498 * @param[in] value - State value.
6499 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6500 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6504 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6507 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6509 * @brief Reads the Restriction for uuid.
6511 * This function is a synchronous call.
6513 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6514 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6515 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6519 * @param[out] value - State value.
6520 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6521 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6525 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6528 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6530 * @brief Adds the device to blacklist.
6532 * This function is a synchronous call.
6534 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6535 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6536 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6539 * @param[in] device_address - Device address
6543 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6546 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6548 * @brief Adds the device to whitelist.
6550 * This function is a synchronous call.
6552 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6553 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6554 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6557 * @param[in] device_address - Device address
6561 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6564 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6566 * @brief Adds the Service UUIDS to blacklist.
6568 * This function is a synchronous call.
6570 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6571 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6572 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6575 * @param[in] service_uuids - profile or custom service uuids
6579 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6582 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6584 * @brief Adds the Service UUIDS to whitelist.
6586 * This function is a synchronous call.
6588 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6589 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6590 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6593 * @param[in] service_uuids - profile or custom service uuids
6597 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6600 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6602 * @brief Clears the devices from blacklist.
6604 * This function is a synchronous call.
6606 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6607 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6608 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6615 int bluetooth_dpm_clear_devices_from_blacklist(void);
6618 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6620 * @brief Clears the devices from whitelist.
6622 * This function is a synchronous call.
6624 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6625 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6626 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6633 int bluetooth_dpm_clear_devices_from_whitelist(void);
6636 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6638 * @brief Clears the uuids from blacklist.
6640 * This function is a synchronous call.
6642 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6643 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6644 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6651 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6654 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6656 * @brief Clears the uuids from whitelist.
6658 * This function is a synchronous call.
6660 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6661 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6662 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6669 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6672 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6674 * @brief reads the devices from blacklist.
6676 * This function is a synchronous call.
6678 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6679 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6680 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6683 * @param[out] device_list - list of devices
6687 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6690 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6692 * @brief reads the devices from whitelist.
6694 * This function is a synchronous call.
6696 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6697 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6698 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6701 * @param[out] device_list - list of devices
6705 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6708 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6710 * @brief reads the uuids from blacklist.
6712 * This function is a synchronous call.
6714 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6715 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6716 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6719 * @param[in] uuid_list - list of uuids
6723 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6726 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6728 * @brief reads the uuids from whitelist.
6730 * This function is a synchronous call.
6732 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6733 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6734 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6737 * @param[in] uuid_list - list of uuids
6741 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6744 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6746 * @brief Removes the device from whitelist.
6748 * This function is a synchronous call.
6750 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6751 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6752 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6755 * @param[in] device_address - Device address
6759 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6762 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6764 * @brief Removes the device from blacklist.
6766 * This function is a synchronous call.
6768 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6769 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6770 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6773 * @param[in] device_address - Device address
6777 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6780 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6782 * @brief Removes the Service UUIDS from whitelist.
6784 * This function is a synchronous call.
6786 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6787 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6788 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6791 * @param[in] service_uuids - profile or custom service uuids
6795 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6798 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6800 * @brief Removes the Service UUIDS from blacklist.
6802 * This function is a synchronous call.
6804 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6805 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6806 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6809 * @param[in] service_uuids - profile or custom service uuids
6813 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6816 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6818 * @brief Sets the Restriction for outgoing call.
6820 * This function is a synchronous call.
6822 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6823 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6824 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6827 * @param[in] value - State value.
6828 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6829 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6833 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6836 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6838 * @brief Reads the Restriction for outgoing call.
6840 * This function is a synchronous call.
6842 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6843 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6844 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6848 * @param[out] value - State value.
6849 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6850 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6854 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6857 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6859 * @brief Sets the Restriction for Pairing.
6861 * This function is a synchronous call.
6863 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6864 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6865 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6868 * @param[in] value - State value.
6869 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6870 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6874 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6877 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6879 * @brief Reads the Restriction for Pairing
6881 * This function is a synchronous call.
6883 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6884 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6885 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6889 * @param[out] value - State value.
6890 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6891 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6895 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6898 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6900 * @brief Sets the Restriction for using Profiles.
6902 * This function is a synchronous call.
6904 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6905 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6906 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6909 * @param[in]profile - Profile.
6910 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6911 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6912 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6913 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6914 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6915 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6916 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6917 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6918 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6919 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6920 * BLUETOOTH_DPM_PROFILE_NONE
6921 * @param[in] value - State value.
6922 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6923 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6927 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6930 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6932 * @brief Reads the Restriction for using Profiles.
6934 * This function is a synchronous call.
6936 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6937 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6938 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6941 * @param[in]profile - Profile.
6942 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6943 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6944 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6945 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6946 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6947 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6948 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6949 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6950 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6951 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6952 * BLUETOOTH_DPM_PROFILE_NONE
6953 * @param[out] value - State value.
6954 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6955 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6959 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6962 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6964 * @brief Sets the Restriction for Desktop Connectivity.
6966 * This function is a synchronous call.
6968 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6969 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6970 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6973 * @param[in] value - State value.
6974 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6975 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6979 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6982 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6984 * @brief Reads the Restriction for Desktop Connectivity.
6986 * This function is a synchronous call.
6988 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6989 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6990 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6994 * @param[out] value - State value.
6995 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6996 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7000 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7003 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7005 * @brief Sets the Restriction for Discoverable state.
7007 * This function is a synchronous call.
7009 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7010 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7011 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7014 * @param[in] value - State value.
7015 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7016 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7020 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7023 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7025 * @brief Reads the Restriction for Discoverable state.
7027 * This function is a synchronous call.
7029 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7030 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7031 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7035 * @param[out] value - State value.
7036 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7037 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7041 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7044 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7046 * @brief Sets the Restriction for linited discoverable state..
7048 * This function is a synchronous call.
7050 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7051 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7052 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7055 * @param[in] value - State value.
7056 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7057 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7061 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7064 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7066 * @brief Reads the Restriction for limited discoverable state.
7068 * This function is a synchronous call.
7070 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7071 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7072 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7076 * @param[out] value - State value.
7077 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7078 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7082 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7084 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7086 * @brief Sets the Restriction for Data trasnfer.
7088 * This function is a synchronous call.
7090 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7091 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7092 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7095 * @param[in] value - State value.
7096 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7097 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7101 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7105 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7107 * @brief Reads the Restriction for Data trasnfer.
7109 * This function is a synchronous call.
7111 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7112 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7113 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7117 * @param[out] value - State value.
7118 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7119 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7123 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7126 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7127 * bluetooth_pxp_poperty_t property, int value);
7129 * @brief Sets the Proximity alert level/properties for monitor role.
7131 * This function is a synchronous call.
7133 * @return BLUETOOTH_ERROR_NONE - Success \n
7134 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7135 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7136 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7139 * @param[in] device_address remote device address
7140 * @param[in] property proximity profile property
7141 * @param[in] value alert level/property value to be set
7146 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7147 bluetooth_pxp_poperty_t property, int value);
7150 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7151 * bluetooth_pxp_poperty_t property, int *value);
7153 * @brief Reads the Proximity alert level/properties for monitor role.
7155 * This function is a synchronous call.
7157 * @return BLUETOOTH_ERROR_NONE - Success \n
7158 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7159 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7160 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7163 * @param[in] device_address remote device address
7164 * @param[in] property proximity profile property
7165 * @param[out] value alert level/property value
7169 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7170 bluetooth_pxp_poperty_t property, int *value);
7173 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7174 * int *services_supported);
7176 * @brief Reads the Proximity Monitor profile supported properties/services.
7178 * This function is a synchronous call.
7180 * @return BLUETOOTH_ERROR_NONE - Success \n
7181 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7182 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7183 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7186 * @param[in] device_address remote device address
7187 * @param[out] services_supported proximity profile property/service
7191 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7192 int *services_supported);
7195 * @fn int bluetooth_proximity_reporter_register();
7197 * @brief Register all proximity related services in BlueZ.
7199 * This function is a synchronous call.
7201 * @return BLUETOOTH_ERROR_NONE - Success \n
7202 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7208 int bluetooth_proximity_reporter_register(void);
7211 * @fn int bluetooth_proximity_reporter_unregister();
7213 * @brief Unregister all proximity related services in BlueZ.
7215 * This function is a synchronous call.
7217 * @return BLUETOOTH_ERROR_NONE - Success \n
7218 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7224 int bluetooth_proximity_reporter_unregister(void);
7227 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7228 * bluetooth_pxp_poperty_t property, int *value);
7230 * @brief Reads the Proximity alert level/properties for reporter role.
7232 * This function is a synchronous call.
7234 * @return BLUETOOTH_ERROR_NONE - Success \n
7235 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7236 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7237 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7240 * @param[in] device_address remote device address
7241 * @param[in] property proximity profile property
7242 * @param[out] value alert level/property value
7246 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7247 bluetooth_pxp_poperty_t property, int *value);
7250 * @fn int bluetooth_tds_provider_register(void);
7252 * @brief Register Transport Discovery Provider role.
7254 * This function is a synchronous call.
7256 * @return BLUETOOTH_ERROR_NONE - Success \n
7257 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7258 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7259 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7267 int bluetooth_tds_provider_register(void);
7270 * @fn int bluetooth_tds_provider_unregister(void);
7272 * @brief Unregister Transport Discovery Provider role.
7274 * This function is a synchronous call.
7276 * @return BLUETOOTH_ERROR_NONE - Success \n
7277 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7278 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7279 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7287 int bluetooth_tds_provider_unregister(void);
7290 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7292 * @brief Create Transport Discovery Provider for a transport.
7294 * This function is a synchronous call.
7296 * @return BLUETOOTH_ERROR_NONE - Success \n
7297 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7298 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7299 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7302 * @param[in] Transport (BT, CUSTOM etc.)
7303 * @param[in] Unique handle for TDS provider.
7308 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7311 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7313 * @brief Remove previously created Transport Discovery Provider.
7315 * This function is a synchronous call.
7317 * @return BLUETOOTH_ERROR_NONE - Success \n
7318 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7321 * @param[in] Unique handle for previously created provider.
7326 int bluetooth_tds_provider_destroy(unsigned int handle);
7329 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7331 * @brief Set transport block for in advertisement and gatt db.
7333 * This function is a synchronous call.
7335 * @return BLUETOOTH_ERROR_NONE - Success \n
7336 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7337 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7338 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7341 * @param[in] Provider specific manufacturer data.
7342 * @param[in] Provider specific manufacturer data length.
7347 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7350 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7351 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7353 * @brief Set transport block for in advertisement and gatt db.
7355 * This function is a synchronous call.
7357 * @return BLUETOOTH_ERROR_NONE - Success \n
7358 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7359 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7360 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7363 * @param[in] Unique handle for TDS provider.
7364 * @param[in] Transport state (On/Off/Not Available).
7365 * @param[in] Transport specific data block.
7366 * @param[in] Transport specific data block length.
7371 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7372 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7375 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7376 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7378 * @brief Send response to TDS activation request from remoted device.
7380 * This function is a synchronous call.
7382 * @return BLUETOOTH_ERROR_NONE - Success \n
7383 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7384 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7385 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7388 * @param[in] Remote device BT address.
7389 * @param[in] Unique handle for TDS provider.
7390 * @param[in] Response for TDS activation request.
7391 * @param[in] Transport specific data block to be sent in activation response.
7392 * @param[in] Data block length.
7397 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7398 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7401 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7403 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7405 * This function is an asynchronous call.
7407 * @return BLUETOOTH_ERROR_NONE - Success \n
7408 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7409 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7410 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7411 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7414 * @param[in] device_address remote device address
7415 * @param[in] handle attribute handle
7417 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7418 * when TDS data is received from Remote provider
7420 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7421 const char *handle);
7424 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7426 * @brief Enables CCCD on Remote Provider.
7428 * This function is an asynchronous call.
7430 * @return BLUETOOTH_ERROR_NONE - Success \n
7431 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7432 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7433 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7434 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7437 * @param[in] device_address remote device address
7438 * @param[in] handle attribute handle
7440 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7441 * when Indication is enabled on Remote provider
7443 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7444 const char *handle);
7447 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7448 * unsigned char *buf, int length);
7449 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7451 * This function is an asynchronous call.
7453 * @return BLUETOOTH_ERROR_NONE - Success \n
7454 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7455 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7456 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7457 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7460 * @param[in] device_address remote device address
7461 * @param[in] handle attribute handle
7462 * @param[in] buf Control point activation param
7463 * @param[in] param length
7465 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7466 * is received from remote Provider
7468 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7469 unsigned char *buf, int length);
7477 #endif /* __cplusplus */
7478 #endif /* _BLUETOOTH_API_H_*/