2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef _BLUETOOTH_API_H_
19 #define _BLUETOOTH_API_H_
28 #endif /* __cplusplus */
31 * @defgroup BLUETOOTHFW BluetoothFW
33 * A base library for bluetooth framework
35 * @addtogroup BLUETOOTHFW
39 #define BLUETOOTH_ADDRESS_STRING_LENGTH 17 /**< This specifies bluetooth device address length (AA:BB:CC:DD:EE:FF) */
40 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
41 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
42 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
43 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
44 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
45 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
46 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
47 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
49 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
50 a device can support */
52 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
54 #define BLUETOOTH_UUID_STRING_MAX 50
55 #define BLUETOOTH_PATH_STRING 50
57 #define BLUETOOTH_OOB_DATA_LENGTH 16
59 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
62 * This is Bluetooth Connected event role
64 #define RFCOMM_ROLE_SERVER 1
65 #define RFCOMM_ROLE_CLIENT 2
68 * This is RFCOMM default Channel Value
70 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
73 * This is maximum length for search value string for PBAP Phonebook Search
75 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
78 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
81 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
82 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
85 * < This defines the maximum size of OTP server directory name
87 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
90 * This is Bluetooth error code
92 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
94 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
95 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
97 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
98 /**< Callback error */
99 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
100 /**< invalid paramerror */
101 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
102 /**< invalid data error */
103 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
104 /**< Memory allocation error */
105 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
106 /**< out of memory error */
107 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
108 /**< timeout error */
109 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
110 /**< No resource error */
111 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
112 /**< internal error */
113 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
114 /**< Not supported error */
115 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
116 /**< Operation is failed because
117 of not enabled BT Adapter */
118 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
119 /**< Enabling is failed because of
120 already enabled BT Adapter */
121 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
122 /**< Operation is failed because of
123 other on going operation */
124 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
125 /**< access denied error */
126 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
127 /**< max client error */
128 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
129 /**< not found error */
130 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
131 /**< service search fail */
132 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
133 /**< pairing failed error */
134 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
135 /**< Not paired error */
136 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
137 /**< no service error */
138 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
139 /**< no connection error */
140 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
141 /**< alread connected error */
142 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
143 /**< connection busy error */
144 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
145 /**< connection error */
146 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
147 /**< max connection error*/
148 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
149 /**< Not in operation */
150 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
151 /**< Cancelled by user */
152 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
153 /**< Service record registration failed */
154 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
155 /**< Operation in progress */
156 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
157 /**< authentication failed error when paring*/
158 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
159 /**< Remote host is down */
160 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
161 /**< End of device list */
163 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
164 /**< Obex agent already exists */
165 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
166 /**< Obex agent does not exist */
168 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
169 /**< Already initialized */
171 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
172 /**< Permission deined */
174 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
175 /**< Nap already done */
177 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
178 /**< Not initialized */
180 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
181 /**< Authentication rejected */
183 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
184 /**< Device Policy Restricted */
187 * Device disconnection reasons; received from stack
189 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
190 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
191 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
192 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
193 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
194 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
195 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
196 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
197 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
198 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
199 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
200 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
201 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
202 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
203 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
205 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
208 * Device disconnect reason
211 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
212 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
213 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
214 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
215 } bluetooth_device_disconnect_reason_t;
218 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
221 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
222 } bluetooth_device_address_t;
225 * This is Bluetooth device address type
228 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
229 BLUETOOTH_DEVICE_RANDOM_ADDRESS
230 } bluetooth_device_address_type_t;
233 * This is BD Address type defined in kernel BT header
236 BLUETOOTH_BDADDR_BREDR = 0x00,
237 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
238 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
239 } bluetooth_bdaddr_type_e;
242 * This is Bluetooth version
245 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
246 } bluetooth_version_t;
249 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
252 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
253 } bluetooth_device_name_t;
256 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
259 int data_len; /**< manafacturer specific data length */
260 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
261 } bluetooth_manufacturer_data_t;
264 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
265 } bluetooth_device_pin_code_t;
271 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
272 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
273 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
274 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
275 } bluetooth_adapter_state_t;
281 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
282 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
283 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
284 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
285 } bluetooth_adapter_le_state_t;
291 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
292 /*Changed the order to make it compatable with old method */
293 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
294 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
295 /**< Discoverable mode with time limit
296 After specific timeout, it is changed
297 to non discoverable mode */
298 } bluetooth_discoverable_mode_t;
301 * Network connect mode
304 BLUETOOTH_NETWORK_PANU_ROLE,
306 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
307 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
308 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
309 } bluetooth_network_role_t;
313 * Service type matched to bt_profile_type_t of bt-service-common.h
316 BLUETOOTH_RFCOMM_SERVICE = 0x01,
317 BLUETOOTH_A2DP_SERVICE = 0x02,
318 BLUETOOTH_HSP_SERVICE = 0x04,
319 BLUETOOTH_HID_SERVICE = 0x08,
320 BLUETOOTH_NAP_SERVICE = 0x10,
321 BLUETOOTH_HFG_SERVICE = 0x20,
322 BLUETOOTH_GATT_SERVICE = 0x40,
323 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
324 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
325 BLUETOOTH_PBAP_SERVICE = 0x200,
326 } bluetooth_service_type_t;
332 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
333 /* represents that connection
334 * type can both BR/EDR and LE */
335 BLUETOOTH_DEV_CONN_BREDR = 0x00,
336 BLUETOOTH_DEV_CONN_LE = 0x01,
337 } bluetooth_conn_type_t;
343 BLUETOOTH_CODEC_ID_CVSD = 0x01,
344 BLUETOOTH_CODEC_ID_MSBC = 0x02,
345 } bluetooth_codec_type_t;
351 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
352 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
353 } bluetooth_hf_audio_connected_type_t;
359 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
360 } bluetooth_advertising_data_t;
366 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
367 } bluetooth_scan_resp_data_t;
370 * Advertising filter policy
373 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
374 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
375 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
376 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
377 } bluetooth_advertising_filter_policy_t;
383 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
384 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
385 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
386 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
387 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
388 } bluetooth_advertising_type_t;
391 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
392 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
393 } bluetooth_gatt_service_change_type_t;
396 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
397 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
398 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
399 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
400 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
401 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
402 } bt_gatt_permission_t;
405 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
406 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
407 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
408 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
409 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
410 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
411 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
412 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
413 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
414 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
415 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
416 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
417 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
418 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
419 } bt_gatt_characteristic_property_t;
422 * Remote device request types for attributes
425 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
426 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
427 } bluetooth_gatt_att_request_tyep_t;
430 * Proximity Property Type
433 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
434 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
435 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
436 } bluetooth_pxp_poperty_t;
442 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
443 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
445 BLUETOOTH_TDS_TRANSPORT_INVALID
446 } bluetooth_tds_transport_t;
449 * TDS transport state
452 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
453 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
454 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
455 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
456 } bluetooth_tds_transport_state_t;
463 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
464 } bluetooth_tds_data_t;
467 * TDS activation request
470 bluetooth_device_address_t rem_addr;
471 bluetooth_tds_transport_t transport;
472 bluetooth_tds_data_t tds_data;
473 } bluetooth_tds_activation_req_t;
476 * TDS Control Point data
479 int length; /**< Control point data length */
480 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
481 } bluetooth_control_point_data_t;
484 * TDS Indication Response data
487 bluetooth_device_address_t rem_addr; /**< Device address */
488 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
489 } bluetooth_tds_indication_res_t;
492 * Structure to hold the TDS Complete data information which is read from remote TDS provider
495 bluetooth_device_address_t device_address; /**< Device address */
496 int data_length; /**< Data length */
497 char *data; /**< Complete Transport Specific data */
498 } bluetooth_tds_transport_data_info_t;
501 * Advertising parameters
506 guint8 filter_policy;
508 } bluetooth_advertising_params_t;
514 int type; /**< passive 0, active 1 */
515 float interval; /**< LE scan interval */
516 float window; /**< LE scan window */
517 } bluetooth_le_scan_params_t;
527 } bluetooth_le_connection_param_t;
530 LE Read Maximum Data Length
533 guint16 max_tx_octets;
535 guint16 max_rx_octets;
537 } bluetooth_le_read_maximum_data_length_t;
540 LE Read Host suggested default Data Length
543 guint16 def_tx_octets;
545 } bluetooth_le_read_host_suggested_data_length_t;
548 * Samsung XSAT Vendor dependent command
553 } bluetooth_vendor_dep_at_cmd_t;
559 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
560 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
561 } bluetooth_opp_transfer_type_t;
566 } bluetooth_hf_ciev_device_event_t;
568 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
569 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
570 /**< Base ID for GAP Event */
571 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
572 /**< Base ID for SDP events */
573 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
574 /**< Base ID for RFCOMM events */
575 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
576 /**< Base ID for NETWORK events */
577 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
578 /**< Base ID for HDP events */
579 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
580 /**< Base ID for OPC events */
581 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
582 /**< Base ID for Obex Server events */
583 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
584 /**< Base ID for GATT events */
586 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
587 /**< Base ID for Audio events */
588 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
589 /**< Base ID for HID events */
590 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
591 /**< Base ID for Advertising events */
592 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
593 /**< Base ID for PBAP Client events */
594 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
595 /**< Base ID for AVRCP events */
596 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
597 /**< Base ID for IPSP events */
598 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
599 /**< Base ID for MAP events */
602 * Bluetooth event type
605 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
607 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
608 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
609 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
610 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
611 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
612 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
613 /**< Bluetooth event Discoverable timeout requested*/
614 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
615 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
616 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
617 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
618 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
619 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
620 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
621 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
622 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
623 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
624 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
625 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
626 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
627 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
628 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
629 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
630 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
631 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
632 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
633 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
634 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
636 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
637 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
638 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
639 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
640 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
642 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
643 /**< Bluetooth event serice search base id */
644 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
645 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
646 /**< RFCOMM data receive event */
647 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
648 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
650 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
652 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
653 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
655 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
657 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
658 /**< Bluetooth Network event */
659 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
660 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
661 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
662 /**< Network disconnected evnet in server */
664 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
665 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
667 BLUETOOTH_EVENT_HDP_CONNECTED
668 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
669 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
670 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
672 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
673 /* OPC Connected event */
674 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
675 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
676 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
677 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
679 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
680 BLUETOOTH_EVENT_MAP_DISCONNECTED,
682 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
683 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
684 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
685 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
686 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
688 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
689 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
690 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
691 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
692 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
693 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
694 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
695 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
696 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
697 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
698 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
699 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
700 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
702 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
703 /* Obex server authorize event*/
704 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
705 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
706 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
707 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
708 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
709 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
711 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
712 /**<Discovered GATT service characteristics event*/
713 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
714 /**<Remote GATT charateristic value changed event*/
715 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
716 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
717 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
718 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
719 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
720 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
721 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
722 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
723 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
724 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
725 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
726 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
727 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
728 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
729 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
731 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
732 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
733 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
734 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
735 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
736 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
737 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
738 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
739 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
740 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
741 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
742 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
743 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
744 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
745 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
746 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
747 BLUETOOTH_EVENT_HF_CONNECTED,
748 BLUETOOTH_EVENT_HF_DISCONNECTED,
749 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
750 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
751 BLUETOOTH_EVENT_HF_RING_INDICATOR,
752 BLUETOOTH_EVENT_HF_CALL_WAITING,
753 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
754 BLUETOOTH_EVENT_HF_CALL_STARTED,
755 BLUETOOTH_EVENT_HF_CALL_ENDED,
756 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
757 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
758 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
759 BLUETOOTH_EVENT_HF_CALL_STATUS,
760 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
761 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
762 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
763 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
764 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
765 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
766 BLUETOOTH_EVENT_HF_CALL_IDLE,
767 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
768 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
769 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
771 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
772 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
773 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
774 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
775 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
777 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
778 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
779 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
780 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
781 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
782 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
783 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
784 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
786 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
787 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
788 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
789 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
790 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
791 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
792 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
794 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
795 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
796 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
797 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
798 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
799 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
800 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
801 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
802 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
804 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
805 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
806 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
807 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
808 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
809 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
810 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
811 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
812 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
813 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
814 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
816 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
817 } bluetooth_event_type_t;
820 * This bt_service_uuid_list_t enum indicates service uuid list .
821 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
825 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
826 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
827 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
828 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
829 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
830 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
831 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
832 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
833 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
834 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
835 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
836 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
837 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
839 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
840 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
841 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
842 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
843 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
844 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
845 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
846 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
847 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
848 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
849 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
850 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
851 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
852 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
854 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
855 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
856 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
857 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
858 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
859 /**<DIRECT PRINTING*/
860 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
861 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
862 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
863 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
864 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
865 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
866 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
867 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
868 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
869 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
870 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
871 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
872 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
873 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
874 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
875 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
876 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
877 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
878 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
879 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
880 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
881 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
882 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
883 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
884 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
885 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
886 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
887 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
888 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
889 } bluetooth_service_uuid_list_t;
892 * Service class part of class of device returned from device discovery
895 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
896 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
897 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
898 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
899 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
900 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
901 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
902 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
903 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
904 } bluetooth_device_service_class_t;
908 * Major device mask (For device discovery)
911 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
912 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
913 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
914 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
915 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
916 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
917 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
918 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
919 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
920 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
921 } bluetooth_device_major_mask_t;
925 * Major device class (part of Class of Device)
928 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
929 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
930 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
931 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
932 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
933 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
934 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
935 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
936 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
937 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
938 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
939 } bluetooth_device_major_class_t;
942 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
944 /* About Computer Major class */
945 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
947 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
948 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
949 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
950 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
951 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
953 /* About Phone Major class */
954 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
955 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
956 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
957 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
958 /**< voice gateway minor class */
959 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
961 /* About LAN/Network Access Point Major class */
962 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
963 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
964 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
965 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
966 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
967 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
968 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
969 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
971 /* About Audio/Video Major class */
972 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
973 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
975 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
976 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
977 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
978 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
979 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
980 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
981 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
982 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
983 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
984 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
985 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
986 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
987 /**< Video Display and Loud
988 Speaker minor class */
989 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
992 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
994 /* About Peripheral Major class */
995 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
996 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
997 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
998 /**< Combo Keyboard or pointing
1001 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1002 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1003 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1004 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1005 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1006 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1007 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1008 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1009 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1011 /* About Imaging Major class */
1012 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1013 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1014 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1015 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1017 /* About Wearable Major class */
1018 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1019 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1020 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1021 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1022 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1024 /* About Toy Major class */
1025 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1026 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1027 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1028 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1029 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1031 /* About Health Major class */
1032 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1033 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1034 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1035 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1036 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1037 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1038 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1039 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1040 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1041 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1042 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1043 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1044 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1045 } bluetooth_device_minor_class_t;
1048 * structure to hold the device information
1051 bluetooth_device_major_class_t major_class; /**< major device class */
1052 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1053 bluetooth_device_service_class_t service_class;
1054 /**< service device class */
1055 } bluetooth_device_class_t;
1058 * Discovery Role types
1061 DISCOVERY_ROLE_BREDR = 0x1,
1063 DISCOVERY_ROLE_LE_BREDR
1064 } bt_discovery_role_type_t;
1067 * Connected state types
1070 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1071 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1072 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1073 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1074 } bluetooth_connected_link_t;
1080 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1081 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1082 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1083 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1084 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1085 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1086 } bluetooth_le_scan_filter_feature_t;
1089 * LE connection mode
1092 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1093 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1094 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1095 } bluetooth_le_connection_mode_t;
1098 * structure to hold the device information
1101 bluetooth_device_address_t device_address; /**< device address */
1102 bluetooth_device_name_t device_name; /**< device name */
1103 bluetooth_device_class_t device_class; /**< device class */
1104 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1105 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1107 int rssi; /**< received strength signal*/
1108 gboolean paired; /**< paired flag */
1109 bluetooth_connected_link_t connected; /**< connected link type */
1110 gboolean trust; /**< trust flag */
1111 gboolean is_alias_set; /** is device alias set flag**/
1112 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1113 } bluetooth_device_info_t;
1116 * structure to hold the LE device information
1119 int data_len; /**< manafacturer specific data length */
1120 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1121 } bluetooth_le_advertising_data_t;
1124 bluetooth_device_address_t device_address; /**< device address */
1125 int addr_type; /**< address type*/
1126 int rssi; /**< received strength signal*/
1127 bluetooth_le_advertising_data_t adv_ind_data;
1128 bluetooth_le_advertising_data_t scan_resp_data;
1129 } bluetooth_le_device_info_t;
1133 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1134 bluetooth_device_address_t device_address; /**< device address */
1135 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1136 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1137 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1138 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1139 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1140 bluetooth_le_advertising_data_t service_data; /**< service data */
1141 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1142 int manufacturer_id; /**< manufacturer ID */
1143 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1144 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1145 } bluetooth_le_scan_filter_t;
1148 bluetooth_device_address_t device_address; /**< device address */
1149 unsigned int mtu; /** < MTU set for the ATT connection */
1150 unsigned int status; /** < status of the MTU exchange */
1151 } bluetooth_le_att_mtu_info_t;
1154 * structure to hold the paired device information
1157 bluetooth_device_address_t device_address; /**< paired device address */
1158 bluetooth_device_name_t device_name; /**< device name */
1159 bluetooth_device_class_t device_class; /**< device class */
1160 } bluetooth_paired_device_info_t;
1163 * structure to hold the paired device information
1166 bluetooth_device_address_t device_address;
1167 /**< device address */
1168 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1169 /**< network interface name */
1170 } bluetooth_network_device_info_t;
1173 * Authentication event types
1177 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1178 BLUETOOTH_AUTH_PIN_REQUEST,
1179 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1180 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1181 } bluetooth_auth_type_t;
1184 * structure to hold the pincode/pass-key req informations
1187 bluetooth_device_address_t device_address; /**< remote device address */
1188 bluetooth_device_name_t device_name; /**< device name */
1189 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1190 } bluetooth_authentication_request_info_t;
1193 * Stucture to hold discovery option
1196 unsigned short max_response; /**< the number of maximum response */
1197 unsigned short discovery_duration;
1198 /**< duration of discovery (seconds) */
1199 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1200 classOfDevice variable */
1201 } bluetooth_discovery_option_t;
1204 * Stucture to hold event information
1207 int event; /**< event type */
1208 int result; /**< Success or error value */
1210 /**<parameter data pointer */
1212 } bluetooth_event_param_t;
1215 bluetooth_device_address_t device_addr;
1216 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1217 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1218 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1223 bluetooth_device_address_t device_addr;
1224 unsigned char addr_type;
1226 } bt_connection_info_t;
1229 * Stucture to rfcomm receive data
1234 /**< the socket fd */
1235 int buffer_size;/**< the length of the receive buffer */
1237 /**< the receive data buffer */
1238 } bluetooth_rfcomm_received_data_t;
1244 HTYPE_TRANS_HANDSHAKE,
1245 HTYPE_TRANS_HID_CONTROL,
1246 HTYPE_TRANS_GET_REPORT,
1247 HTYPE_TRANS_SET_REPORT,
1248 HTYPE_TRANS_GET_PROTOCOL,
1249 HTYPE_TRANS_SET_PROTOCOL,
1252 } bt_hid_header_type_t;
1258 PTYPE_DATA_RTYPE_INPUT,
1259 PTYPE_DATA_RTYPE_OUTPUT
1260 } bt_hid_param_type_t;
1263 * Stucture to hid receive data
1266 const char *address;
1267 bt_hid_header_type_t type;
1268 /**< Header type containing */
1269 bt_hid_param_type_t param;
1270 /**< Param type in header like INPUT Report or OutPut Report */
1271 int buffer_size;/**< the length of the receive buffer */
1273 /**< the receive data buffer */
1274 } bluetooth_hid_received_data_t;
1277 * Stucture to rfcomm connection
1281 int socket_fd; /**< the socket fd */
1282 int server_id; /* Server id */
1283 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1284 bluetooth_device_address_t device_addr;
1285 /**< device address */
1286 char uuid[BLUETOOTH_UUID_STRING_MAX];
1287 } bluetooth_rfcomm_connection_t;
1290 * Stucture to rfcomm disconnection
1294 /**< the socket fd */
1295 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1296 bluetooth_device_address_t device_addr;
1297 /**< device address */
1298 char uuid[BLUETOOTH_UUID_STRING_MAX];
1299 } bluetooth_rfcomm_disconnection_t;
1303 /**< the socket fd */
1304 bluetooth_device_address_t device_addr;
1305 /**< device address */
1306 } bluetooth_rfcomm_connection_request_t;
1310 /**< the socket fd */
1311 bluetooth_device_address_t device_addr;
1312 /**< device address */
1313 } bluetooth_hid_request_t;
1322 } bt_hdp_qos_type_t;
1328 HDP_ROLE_SOURCE = 0x0,
1330 } bt_hdp_role_type_t;
1334 * Stucture to HDP connected
1337 const char *app_handle; /**< the application handle */
1338 unsigned int channel_id; /**< the channel id */
1339 bt_hdp_qos_type_t type; /**< the QOS type */
1340 bluetooth_device_address_t device_address; /**< the remote address */
1341 } bt_hdp_connected_t;
1344 * Stucture to HDP disconnected
1347 unsigned int channel_id; /**< the channel id */
1348 bluetooth_device_address_t device_address; /**< the remote address */
1349 } bt_hdp_disconnected_t;
1352 * Stucture to HDP data indication
1355 unsigned int channel_id; /**< the channel id */
1356 const char *buffer; /**< the RX data buffer */
1357 unsigned int size; /**< the RX data size */
1358 } bt_hdp_data_ind_t;
1361 * Stucture to OPP client transfer information
1368 } bt_opc_transfer_info_t;
1370 /* TODO: MAP client structures, see above */
1372 * Stucture to Map filter fields
1377 } bt_map_list_filter_fields_info_t;
1379 /* Obex Server transfer type */
1380 #define TRANSFER_PUT "PUT"
1381 #define TRANSFER_GET "GET"
1383 * Stucture to OPP/FTP Server authorize information
1390 } bt_obex_server_authorize_into_t;
1398 } bt_obex_server_type_t;
1401 * Stucture to OPP/FTP server transfer information
1409 unsigned long file_size;
1411 bt_obex_server_type_t server_type;
1413 unsigned char *contact_auth_info;
1414 } bt_obex_server_transfer_info_t;
1417 * Stucture to OPP/FTP server connection/disconnection information
1423 } bt_obex_server_connection_info_t;
1427 * Stucture to OOB data
1431 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1432 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1433 unsigned int hash_len;
1434 unsigned int randomizer_len;
1436 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1437 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1438 unsigned int hash256_len;
1439 unsigned int randomizer256_len;
1443 * Structure to GATT attribute handle data
1449 } bt_gatt_handle_info_t;
1452 * Structure to GATT Remote service data
1459 bt_gatt_handle_info_t include_handles;
1460 bt_gatt_handle_info_t char_handle;
1461 } bt_gatt_service_property_t;
1464 * Structure to GATT Remote characteristic data
1468 char *service_handle;
1469 bt_gatt_handle_info_t handle_info;
1470 } bt_gatt_discovered_char_t;
1473 * Structure to format of GATT Characteristic Value
1477 unsigned char format;
1478 unsigned char exponent;
1479 unsigned short unit;
1480 unsigned char name_space;
1481 unsigned short description;
1482 } bt_gatt_char_format_t;
1485 * Structure to GATT Characteristic property
1493 bt_gatt_char_format_t format;
1495 unsigned int val_len;
1496 unsigned int permission;
1497 char *representation;
1498 bt_gatt_handle_info_t char_desc_handle;
1499 } bt_gatt_char_property_t;
1502 * Structure to GATT Characteristic descriptor property
1509 unsigned int val_len;
1510 } bt_gatt_char_descriptor_property_t;
1513 * Structure to GATT Characteristic value
1520 } bt_gatt_char_value_t;
1523 * Structure to GATT Read Request
1527 char *service_handle;
1531 } bt_gatt_read_req_t;
1534 * Structure to GATT Value change
1538 char *service_handle;
1541 gboolean response_needed;
1545 } bt_gatt_value_change_t;
1548 bluetooth_device_address_t device_addr;
1550 bluetooth_gatt_service_change_type_t change_type;
1551 } bt_gatt_service_change_t;
1554 * Structure to GATT characteristc Notification change
1558 char *service_handle;
1559 gboolean att_notify;
1560 } bt_gatt_char_notify_change_t;
1563 * Structure to Indication confirmation
1567 char *service_handle;
1570 } bt_gatt_indicate_confirm_t;
1573 * Structure to RSSI Signal Strength Alert
1584 * Structure to RSSI Signal Strength
1594 * Structure for RSSI Enabled or Disabled
1600 gboolean rssi_enabled;
1601 } bt_rssi_enabled_t;
1604 * Structure for RSSI Threshold
1609 int in_range_threshold;
1611 } bt_rssi_threshold_t;
1615 * Structure for Suppoted Profiles and Trusted Profiles
1622 } bt_supported_profile_trusted_t;
1625 * Structure for PBAP Folder Parameters
1628 unsigned char addressbook;
1629 unsigned char folder_type;
1633 * Structure for PBAP Pull application Parameters
1636 unsigned char format;
1637 unsigned char order;
1638 unsigned short offset;
1639 unsigned short maxlist;
1640 long long unsigned fields;
1641 } bt_pbap_pull_parameters_t;
1644 * Structure for PBAP List application Parameters
1647 unsigned char order;
1648 unsigned short offset;
1649 unsigned short maxlist;
1650 } bt_pbap_list_parameters_t;
1653 * Structure for PBAP Pull vCard application Parameters
1656 unsigned char format;
1657 long long unsigned fields;
1659 } bt_pbap_pull_vcard_parameters_t;
1662 * Structure for PBAP Search application Parameters
1665 unsigned char order;
1666 unsigned short offset;
1667 unsigned short maxlist;
1668 unsigned char search_attribute;
1669 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1670 } bt_pbap_search_parameters_t;
1673 * Structure for PBAP Connection Status
1676 bluetooth_device_address_t btaddr;
1678 } bt_pbap_connected_t;
1681 * Structure for PBAP Phonebook Size
1684 bluetooth_device_address_t btaddr;
1686 } bt_pbap_phonebook_size_t;
1689 * Structure for PBAP Phonebook Pull
1692 bluetooth_device_address_t btaddr;
1695 } bt_pbap_phonebook_pull_t;
1698 * Structure for PBAP vCard List
1701 bluetooth_device_address_t btaddr;
1705 } bt_pbap_vcard_list_t;
1708 * Structure for PBAP vCard Pull
1711 bluetooth_device_address_t btaddr;
1714 } bt_pbap_vcard_pull_t;
1717 * Structure for PBAP Phonebook search List
1720 bluetooth_device_address_t btaddr;
1724 } bt_pbap_phonebook_search_list_t;
1727 * Stucture to HF Call status information
1731 char *number; /*Phone Number */
1732 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1733 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1734 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1735 int idx; /*Call index/ID */
1736 } bt_hf_call_status_info_t;
1741 } bt_hf_call_list_s;
1747 TRUSTED_PROFILE_PBAP = 1,
1748 TRUSTED_PROFILE_MAP,
1749 TRUSTED_PROFILE_SAP,
1750 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1751 } bluetooth_trusted_profile_t;
1754 * Restricted Profile types
1757 RESTRICTED_PROFILE_HFP_HS = 1,
1758 RESTRICTED_PROFILE_A2DP,
1759 } bluetooth_restricted_profile_t;
1762 * Structure for LE data length change params
1765 bluetooth_device_address_t device_address;
1766 guint16 max_tx_octets;
1767 guint16 max_tx_time;
1768 guint16 max_rx_octets;
1769 guint16 max_rx_time;
1770 } bt_le_data_length_params_t;
1773 * Structure for proximity property change params
1776 bluetooth_device_address_t device_address;
1780 } bt_pxp_property_changed_params_t;
1783 * @brief DPM BT allowance state
1787 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1788 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1789 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1790 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1794 * @brief DPM API result
1798 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1799 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1800 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1801 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1802 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1803 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1807 * @brief DPM Policy status
1811 BLUETOOTH_DPM_STATUS_ERROR = -1,
1813 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1814 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1816 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1817 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1819 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1820 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1824 /* policy-group : BLUETOOTH */
1825 BLUETOOTH_DPM_POLICY_ALLOW,
1826 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1827 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1828 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1829 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1830 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1831 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1832 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1833 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1834 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1835 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1836 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1837 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1838 BLUETOOTH_DPM_POLICY_END,
1839 } bt_dpm_policy_cmd_t;
1842 struct bt_dpm_policy {
1848 typedef struct bt_dpm_policy bt_dpm_policy_t;
1851 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1852 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1853 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1854 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1855 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1856 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1857 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1858 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1859 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1860 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1861 BLUETOOTH_DPM_PROFILE_NONE,
1864 struct bt_dpm_profile_val {
1865 int value; /* tells whether the profile is enabled or disabled */
1867 typedef struct dpm_profile_val dpm_profile_state_t;
1870 * Structure to DPM device list
1874 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1875 } bt_dpm_device_list_t;
1878 * Structure to DPM uuid list
1882 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1883 } bt_dpm_uuids_list_t;
1886 * Structure for IPSP Interface Info
1889 bluetooth_device_address_t btaddr;
1891 } bt_ipsp_connection_info_t;
1895 char* remote_address;
1896 } bt_map_client_session_info_s;
1898 typedef char* bt_map_client_message_object_t;
1903 } bt_map_client_list_folders_filter_t;
1908 int8_t subject_length;
1917 } bt_map_client_list_messages_filter_t;
1920 bt_map_client_message_object_t message_object;
1925 char *sender_address;
1928 char *recipient_address;
1933 int64_t attachment_size;
1938 } bt_map_client_message_item_t;
1944 } bt_map_client_push_message_args_t;
1951 char *sender_address;
1954 char *recipient_address;
1963 } bt_map_client_message_t;
1966 char **names; // holding %size null-terminated folder names
1968 } bt_map_client_folders_s;
1971 bt_map_client_message_item_t *message_items;
1973 } bt_map_client_message_items_s;
1976 const char* target_file;
1978 } bt_get_message_callback_data;
1981 * Callback pointer type
1983 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1986 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1987 * @brief Set the callback function pointer for bluetooth event
1990 * This API will register the callback function, when any response and event are received from
1991 * bluetooth framework. @n
1992 * this registered callback function will be get called with appropriate event and data structures.
1993 * This function is a synchronous call. An application developer can call
1994 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1995 * type. This registered function will receive events of bluetooth_event_type_t type along with
1999 * @param[in] callback_ptr A pointer to the callback function
2000 * @param[in] user_data A pointer to user data
2001 * @return BLUETOOTH_ERROR_NONE - Success
2005 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2007 GMainLoop *main_loop = (GMainLoop*) user_data;
2011 // Code for each event
2013 g_main_loop_quit(main_loop);
2020 GMainLoop *main_loop = NULL;
2023 main_loop = g_main_loop_new(NULL, FALSE);
2024 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2025 if (ret >= BLUETOOTH_ERROR_NONE)
2027 // bluetooth_register_callback returned Success
2031 // bluetooth_register_callback returned failiure
2033 g_main_loop_run(main_loop);
2037 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2040 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2041 * @brief Set the callback function pointer for bluetooth le event
2044 * This API will register the callback function, when any response and event are received from
2045 * bluetooth framework. @n
2046 * this registered callback function will be get called with appropriate event and data structures.
2047 * This function is a synchronous call. An application developer can call
2048 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2049 * type. This registered function will receive events of bluetooth_event_type_t type along with
2053 * @param[in] callback_ptr A pointer to the callback function
2054 * @param[in] user_data A pointer to user data
2055 * @return BLUETOOTH_ERROR_NONE - Success
2059 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2062 * @fn int bluetooth_le_unregister_callback(void)
2063 * @brief Set the callback function pointer for bluetooth le event
2066 * This API will register the callback function, when any response and event are received from
2067 * bluetooth framework. @n
2068 * this registered callback function will be get called with appropriate event and data structures.
2069 * This function is a synchronous call. An application developer can call
2070 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2071 * type. This registered function will receive events of bluetooth_event_type_t type along with
2076 * @return BLUETOOTH_ERROR_NONE - Success
2080 int bluetooth_le_unregister_callback(void);
2083 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2084 * @brief Set the callback function pointer for bluetooth event
2087 * This API will register the callback function, when any response and event are received from
2088 * bluetooth framework. @n
2089 * this registered callback function will be get called with appropriate event and data structures.
2090 * This function is a synchronous call. An application developer can call
2091 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2092 * type. This registered function will receive events of bluetooth_event_type_t type along with
2097 * @return BLUETOOTH_ERROR_NONE - Success
2101 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2103 GMainLoop *main_loop = (GMainLoop*) user_data;
2107 // Code for each event
2109 g_main_loop_quit(main_loop);
2116 GMainLoop *main_loop = NULL;
2119 main_loop = g_main_loop_new(NULL, FALSE);
2120 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2121 if (ret >= BLUETOOTH_ERROR_NONE)
2123 // bluetooth_register_callback returned Success
2127 // bluetooth_register_callback returned failiure
2129 ret = bluetooth_deregister_callback(void);
2130 g_main_loop_run(main_loop);
2134 int bluetooth_unregister_callback(void);
2137 * @fn int bluetooth_enable_adapter(void)
2138 * @brief Enable the Bluetooth H/W
2141 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2142 * send request to bluetooth chip for activation.
2143 * This function is typically called at startup or when Bluetooth services are required. This
2144 * function must be called before calling any other API of Bluetooth operations.
2146 * Before performing any operations like Device discover, service search etc.., the adapter must be
2149 * This function is a asynchronous call.
2150 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2151 * through registered callback function with appropriate result code
2152 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2153 * BLUETOOTH_ERROR_NONE - Success \n
2155 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2156 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2158 * @return BLUETOOTH_ERROR_NONE - Success\n
2159 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2160 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2161 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2162 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2164 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2166 void bt_event_callback(int event, bluetooth_event_param_t *param)
2170 case BLUETOOTH_EVENT_ENABLED:
2171 if (param->result == BLUETOOTH_ERROR_NONE)
2173 // Successfully Enabled
2186 ret = bluetooth_enable_adapter();
2190 int bluetooth_enable_adapter(void);
2193 * @fn int bluetooth_disable_adapter(void)
2194 * @brief Disable the Bluetooth H/W
2197 * This function disables Bluetooth protocol stack and hardware. This function is called when
2198 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2200 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2201 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2202 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2204 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2207 * This function is a asynchronous call.
2208 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2209 * through registered callback function.
2212 * @return BLUETOOTH_ERROR_NONE - Success\n
2213 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2214 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2215 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2217 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2219 void bt_event_callback(int event, bluetooth_event_param_t *param)
2223 case BLUETOOTH_EVENT_DISABLED:
2224 if (param->result == BLUETOOTH_ERROR_NONE)
2226 // Successfully disabled
2239 ret = bluetooth_disable_adapter();
2242 int bluetooth_disable_adapter(void);
2243 int bluetooth_recover_adapter(void);
2244 int bluetooth_check_adapter_le(void);
2245 int bluetooth_enable_adapter_le(void);
2247 int bluetooth_disable_adapter_le(void);
2250 * @fn int bluetooth_reset_adapter(void)
2251 * @brief Reset the Bluetooth H/W and values
2254 * This function resets Bluetooth protocol stack and hardware. This function is called when
2255 * an user want to initialize Bluetooth environment.
2257 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2260 * This function is a synchronous call.
2262 * @return BLUETOOTH_ERROR_NONE - Success\n
2263 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2265 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2270 ret = bluetooth_reset_adapter();
2273 int bluetooth_reset_adapter(void);
2276 * @fn int bluetooth_is_supported(void)
2277 * @brief Check if the bluetooth is supported or not by the current target
2279 * This API checks whether the bluetooth is supported or not.
2280 * This API only run by root permission.
2282 * This function is a synchronous call.
2284 * @return 0 - if bluetooth is not supported\n
2285 * 1 - if bluetooth is supported\n
2286 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2291 ret = bluetooth_is_supported();
2294 int bluetooth_is_supported(void);
2298 * @fn int bluetooth_check_adapter(void)
2299 * @brief Check the current status of the Bluetooth adapter
2302 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2303 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2304 * bluetooth adapter.
2305 * This API get the adapter internal data structure and check current adapter status.
2307 * This function is a synchronous call.
2310 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2311 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2313 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2317 ret = bluetooth_check_adapter();
2320 int bluetooth_check_adapter(void);
2323 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2324 * @brief Get the local adapter bluetooth address
2327 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2328 * the adapter should be enabled.
2329 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2330 * contain Bluetooth address.
2331 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2332 * friendly name for each device.
2333 * There is no event callback for this API.
2335 * This function is a synchronous call.
2338 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2339 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2340 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2341 * @param[out] local_address a device address of local bluetooth adapter
2346 bluetooth_device_address_t local_address={0,};
2349 ret = bluetooth_get_local_address(&local_address);
2352 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2355 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2356 * @brief Get the hci version
2359 * This function is used to get the bluetooth hci version
2360 * Before calling this API make sure that the adapter is enabled.
2362 * This function is a synchronous call.
2365 * @return BLUETOOTH_ERROR_NONE - Success \n
2366 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2367 * @param[out] timeout remain visibility timeout value
2370 bluetooth_version_t *version;
2372 ret = bluetooth_get_local_version (&version);
2375 int bluetooth_get_local_version(bluetooth_version_t *version);
2378 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2379 * @brief Get the local device name
2382 * This function is used, get the local device name. Since its difficult to remember the Adapter
2383 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2384 * friendly name is retrived by the remote device and displaying.
2385 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2387 * This function is a synchronous call.
2390 * @return BLUETOOTH_ERROR_NONE - Success \n
2391 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2392 * @param[out] local_name a local device name
2396 bluetooth_device_name_t local_name={0,}
2398 ret = bluetooth_get_local_name (&local_name);
2401 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2404 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2405 * @brief Set the local device name
2408 * This function is used to set the local device name. This is a human friendly name whose
2409 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2411 * This function is a synchronous call.
2413 * @param[in] local_name bluetooth device name to set local device
2415 * @return BLUETOOTH_ERROR_NONE - Success \n
2416 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2417 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2418 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2419 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2420 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2425 bluetooth_device_name_t local_name={0,}
2427 ret = bluetooth_set_local_name (&local_name);
2430 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2434 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2435 * @brief Check if the uuid is used or not
2437 * This function is used to check if the uuid is used or not.
2439 * This function is a synchronous call.
2441 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2442 * @param[out] used if the uuid is used or not
2444 * @return BLUETOOTH_ERROR_NONE - Success \n
2445 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2446 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2447 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2452 gboolean used = FALSE;
2453 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2454 ret = bluetooth_is_service_used(uuid, &used);
2457 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2460 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2461 * @brief Check if the device is connected to the specific service
2463 * This function is used to check if if the device is connected to the specific service.
2465 * This function is a synchronous call.
2467 * @param[in] local_address a device address of remote bluetooth device
2468 * @param[in] type the service type
2469 * @param[out] is_connected if the device is connected or not
2471 * @return BLUETOOTH_ERROR_NONE - Success \n
2472 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2473 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2474 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2479 gboolean is_connected = FALSE;
2480 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2481 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2484 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2485 bluetooth_service_type_t type,
2486 gboolean *is_connected);
2489 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2490 * @brief Gets device's connected link type
2492 * This function is used to get device's connected link type
2494 * This function is a synchronous call.
2496 * @param[in] device_address a device address of remote bluetooth device
2497 * @param[out] connected_link a device's connected link type
2499 * @return BLUETOOTH_ERROR_NONE - Success \n
2500 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2501 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2502 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2507 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2508 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2509 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2512 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2513 bluetooth_connected_link_t *connected_link);
2516 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2517 * @brief Sets a profile trusted for a device
2519 * This function is used to Set a profile as trusted for a device
2521 * This function is a synchronous call.
2523 * @param[in] device_address a device address of remote bluetooth device
2524 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2525 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2527 * @return BLUETOOTH_ERROR_NONE - Success \n
2528 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2529 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2530 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2534 int bluetooth_set_profile_trusted(
2535 const bluetooth_device_address_t *device_address,
2536 int profile, int trust);
2539 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2540 * @brief Gets a profile is trusted for a device
2542 * This function is used to Get a profile is trusted or not for a device
2544 * This function is a synchronous call.
2546 * @param[in] device_address a device address of remote bluetooth device
2547 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2548 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2550 * @return BLUETOOTH_ERROR_NONE - Success \n
2551 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2552 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2553 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2557 int bluetooth_get_profile_trusted(
2558 const bluetooth_device_address_t *device_address,
2559 int profile, int *trust);
2562 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2563 * @brief Sets a profile restricted connection for a device
2565 * This function is used to Set a profile as restricted for a device
2567 * This function is a synchronous call.
2569 * @param[in] device_address a device address of remote bluetooth device
2570 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2571 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2573 * @return BLUETOOTH_ERROR_NONE - Success \n
2574 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2575 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2576 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2580 int bluetooth_set_profile_restricted(
2581 const bluetooth_device_address_t *device_address,
2582 int profile, int restricted);
2585 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2586 * @brief Gets a restricted connection state
2588 * This function is used to Get a profile is restricted or not for a device
2590 * This function is a synchronous call.
2592 * @param[in] device_address a device address of remote bluetooth device
2593 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2594 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2596 * @return BLUETOOTH_ERROR_NONE - Success \n
2597 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2598 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2599 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2603 int bluetooth_get_profile_restricted(
2604 const bluetooth_device_address_t *device_address,
2605 int profile, int *restricted);
2608 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2609 * @brief Get the visibility mode
2612 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2613 * visibity mode, the property of the device is determined whether it can be discoverable, non
2614 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2616 * This function is a synchronous call.
2619 * @return BLUETOOTH_ERROR_NONE - Success \n
2620 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2621 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2622 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2623 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2624 * @param[out] discoverable_mode current bluetooth discoverable mode
2626 * @see bluetooth_set_discoverable_mode
2628 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2630 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2633 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2636 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2638 * @brief Set the visibility mode
2641 * This function is used to set the discoverable mode (Visibility option).
2643 * Many times user may want to keep his device discoverable so that when peer device is performing
2644 * device search, he/she can find user's device. Application programmer can keep the mode as
2645 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2646 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2647 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2648 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2650 * This function is a synchronous call.
2652 * @return BLUETOOTH_ERROR_NONE - Success \n
2653 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2655 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2656 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2658 * @see bluetooth_get_discoverable_mode
2662 bluetooth_discoverable_mode_t mode;
2664 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2665 ret = bluetooth_set_discoverable_mode (mode, 180);
2669 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2674 * @fn int bluetooth_get_timeout_value(int *timeout)
2675 * @brief Get the visibility timeout value
2678 * This function is used to get the visibility timeout
2679 * Before calling this API make sure that the adapter is enabled.
2681 * This function is a synchronous call.
2684 * @return BLUETOOTH_ERROR_NONE - Success \n
2685 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2686 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2687 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2688 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2689 * @param[out] timeout remain visibility timeout value
2691 * @see bluetooth_set_discoverable_mode
2695 ret = bluetooth_get_timeout_value (&timeout);
2698 int bluetooth_get_timeout_value(int *timeout);
2702 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2703 * unsigned int classOfDeviceMask)
2704 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2706 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2707 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2708 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2709 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2710 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2711 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2712 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2713 * please see bluetooth_device_info_t for more details.
2716 * This API provides searching options like max responses, discovery duration in seconds and class
2717 * of device mask to filter device search. some times there may be too many bluetooth devices in
2718 * vicinity of your device.in such scenario, application can request to reduce number of responces
2719 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2720 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2721 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2722 * application defined time. please note that discovery_duration should be mentioned in seconds.
2723 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2726 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2727 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2728 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2730 * This function is a asynchronous call.
2731 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2732 * through registered callback function.
2734 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2735 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2737 * The completion or cancellation of the discovery is indicated by an
2738 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2740 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2743 * @return BLUETOOTH_ERROR_NONE - Success \n
2744 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2745 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2746 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2747 agent is not running \n
2749 * @param[in] max_response define the maximum response of the number of founded devices
2751 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2752 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2753 (refer to class of device)
2755 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2758 void bt_event_callback(int event, bluetooth_event_param_t *param)
2762 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2764 bluetooth_device_info_t *device_info = NULL;
2765 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2767 device_info = (bluetooth_device_info_t *)param->param_data;
2768 memcpy(&searched_device, &device_info->device_address,
2769 sizeof(bluetooth_device_address_t));
2770 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2771 device_info->device_address.addr[0],
2772 device_info->device_address.addr[1],
2773 device_info->device_address.addr[2],
2774 device_info->device_address.addr[3],
2775 device_info->device_address.addr[4],
2776 device_info->device_address.addr[5]);
2779 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2781 bluetooth_device_info_t *device_info = NULL;
2782 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2784 device_info = (bluetooth_device_info_t *)param->param_data;
2785 memcpy(&searched_device, &device_info->device_address,
2786 sizeof(bluetooth_device_address_t));
2787 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2788 device_info->device_name.name,
2789 device_info->device_address.addr[0],
2790 device_info->device_address.addr[1],
2791 device_info->device_address.addr[2],
2792 device_info->device_address.addr[3],
2793 device_info->device_address.addr[4],
2794 device_info->device_address.addr[5]);
2798 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2799 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2804 unsigned short max_response;
2805 unsigned short discovery_duration;
2806 unsigned classOfDeviceMask;
2810 discovery_duration =0;
2811 classOfDeviceMask =0;
2813 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2818 int bluetooth_start_discovery(unsigned short max_response,
2819 unsigned short discovery_duration,
2820 unsigned int classOfDeviceMask);
2823 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2824 * unsigned short max_response,
2825 * unsigned short discovery_duration,
2826 * unsigned int classOfDeviceMask)
2827 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2829 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2830 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2831 * Please see bluetooth_start_discovery() for other parameters description.
2833 * This function is a asynchronous call.
2834 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2835 * through registered callback function.
2837 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2838 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2840 * The completion or cancellation of the discovery is indicated by an
2841 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2843 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2846 * @return BLUETOOTH_ERROR_NONE - Success \n
2847 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2848 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2849 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2850 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2851 agent is not running \n
2853 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2854 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2855 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2856 * @param[in] max_response define the maximum response of the number of founded devices
2858 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2859 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2860 (refer to class of device)
2862 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2865 unsigned short type;
2866 unsigned short max_response;
2867 unsigned short discovery_duration;
2868 unsigned classOfDeviceMask;
2873 discovery_duration =0;
2874 classOfDeviceMask =0;
2876 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2881 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2882 unsigned short max_response,
2883 unsigned short discovery_duration,
2884 unsigned int classOfDeviceMask);
2887 * @fn int bluetooth_cancel_discovery (void)
2888 * @brief Cancel the on-going device discovery operation
2891 * This function stops the on-going device discovery operation. This API has to be called after the
2892 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2893 * the bluetooth_start_discovery API
2895 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2896 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2897 * cancel the discover request once the user received the device to which he wish to connect.
2899 * This function is a asynchronous call.
2900 * If the call is success to cancel discovey then the application will receive
2901 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2902 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2903 * BLUETOOTH_ERROR_NONE
2906 * @return BLUETOOTH_ERROR_NONE - Success \n
2907 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2908 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2909 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2910 other application \n
2911 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2913 * @see bluetooth_start_discovery
2915 void bt_event_callback(int event, bluetooth_event_param_t *param)
2919 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2920 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2929 ret = bluetooth_cancel_discovery();
2932 int bluetooth_cancel_discovery(void);
2935 * @fn int bluetooth_start_le_discovery(void)
2936 * @brief Start the generic device discovery which finds the LE devices.
2938 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2939 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2940 * It try to find LE devices. Bluetooth device address and name are
2941 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2942 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2943 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2944 * please see bluetooth_device_info_t for more details.
2946 * This function is a asynchronous call.
2947 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2948 * through registered callback function.
2950 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2953 * The completion or cancellation of the discovery is indicated by an
2954 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2956 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2959 * @return BLUETOOTH_ERROR_NONE - Success \n
2960 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2961 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2962 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2963 agent is not running \n
2966 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2969 void bt_event_callback(int event, bluetooth_event_param_t *param)
2973 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2975 bluetooth_device_info_t *device_info = NULL;
2976 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2978 device_info = (bluetooth_device_info_t *)param->param_data;
2979 memcpy(&searched_device, &device_info->device_address,
2980 sizeof(bluetooth_device_address_t));
2981 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2982 device_info->device_address.addr[0],
2983 device_info->device_address.addr[1],
2984 device_info->device_address.addr[2],
2985 device_info->device_address.addr[3],
2986 device_info->device_address.addr[4],
2987 device_info->device_address.addr[5]);
2991 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2992 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2998 ret = bluetooth_start_discovery();
3003 int bluetooth_start_le_discovery(void);
3006 * @fn int bluetooth_stop_le_discovery (void)
3007 * @brief Cancel the on-going device LE discovery operation
3010 * This function stops the on-going device discovery operation. This API has to be called after the
3011 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3012 * the bluetooth_start_le_discovery API
3015 * This function is a asynchronous call.
3016 * If the call is success to cancel discovey then the application will receive
3017 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3018 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3019 * BLUETOOTH_ERROR_NONE
3022 * @return BLUETOOTH_ERROR_NONE - Success \n
3023 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3024 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3025 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3026 other application \n
3027 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3029 * @see bluetooth_start_discovery
3031 void bt_event_callback(int event, bluetooth_event_param_t *param)
3035 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3036 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3045 ret = bluetooth_stop_le_discovery();
3048 int bluetooth_stop_le_discovery(void);
3051 * @fn int bluetooth_is_discovering(void)
3052 * @brief Check for the device discovery is in-progress or not.
3054 * This API is used to check the current status of the Discovery operation.If discovery is in\
3055 * progress normally other operations are not allowed.
3056 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3057 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3058 * event before performing other operations. This API is used to get for the current discovery
3059 * operation status and using bluetooth_cancel_discovery()
3060 * we can cancell the ongoing discovery process.
3061 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3064 * This function checks whether the device discovery is started or not.
3066 * This function is a synchronous call.
3069 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3070 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3071 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3074 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3078 ret = bluetooth_is_discovering ();
3081 int bluetooth_is_discovering(void);
3084 * @fn int bluetooth_is_le_discovering(void)
3085 * @brief Check for the device LE discovery is in-progress or not.
3087 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3088 * progress normally other operations are not allowed.
3089 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3090 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3091 * event before performing other operations. This API is used to get for the current discovery
3092 * operation status and using bluetooth_stop_le_discovery()
3093 * we can cancell the ongoing LE discovery process.
3094 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3097 * This function checks whether the device LE discovery is started or not.
3099 * This function is a synchronous call.
3102 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3103 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3107 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3111 ret = bluetooth_is_le_discovering ();
3114 int bluetooth_is_le_discovering(void);
3117 * @fn int bluetooth_is_le_scanning(void)
3118 * @brief Check for the device LE scan is in-progress or not.
3120 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3121 * progress normally other operations are not allowed.
3123 * This function checks whether the device LE Scan is started or not.
3125 * This function is a synchronous call.
3127 * @return TRUE - LE Scan in progress \n
3128 * FALSE - LE Scan is not in progress \n
3133 gboolean is_le_scanning = 0;
3134 is_le_scanning = bluetooth_is_le_scanning ();
3137 gboolean bluetooth_is_le_scanning(void);
3139 gboolean bluetooth_is_scan_filter_supported(void);
3142 * @fn int bluetooth_force_hcidump(int timeout)
3143 * @brief Enable /disable force-hcidump
3145 * This function control force-hcidump.
3147 * This function is a synchronous call.
3149 * @return BLUETOOTH_ERROR_NONE - Success \n
3150 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3151 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3153 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3158 int bluetooth_force_hcidump(int timeout);
3161 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3162 * @brief Register scan filter.
3164 * This function registers the scan filter.
3166 * This function is a synchronous call.
3168 * @return BLUETOOTH_ERROR_NONE - Success \n
3170 * @param[in] filter scan filter to register
3171 * @param[out] slot_id the slot ID of scan filter
3175 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3178 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3179 * @brief Register scan filter.
3181 * This function unregisters the scan filter.
3183 * This function is a synchronous call.
3185 * @return BLUETOOTH_ERROR_NONE - Success \n
3187 * @param[in] slot_id the slot ID of scan filter
3191 int bluetooth_unregister_scan_filter(int slot_id);
3194 * @fn int bluetooth_unregister_all_scan_filters(void)
3195 * @brief Register scan filter.
3197 * This function usregisters all scan filters.
3199 * This function is a synchronous call.
3201 * @return BLUETOOTH_ERROR_NONE - Success \n
3205 int bluetooth_unregister_all_scan_filters(void);
3208 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3209 int link_type, bt_rssi_threshold_t rssi_threshold)
3210 * @brief Enable RSSI monitoring
3212 * This function enables RSSI monitoring and sets threshold for a connection
3214 * @return BLUETOOTH_ERROR_NONE - Success \n
3217 * @see bluetooth_get_rssi_strength
3219 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3220 int link_type, bt_rssi_threshold_t *rssi_threshold);
3223 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3224 * @brief Gets Raw RSSI signal Strength
3226 * This function gives the Raw RSSI signal strength for a connection.
3228 * @return BLUETOOTH_ERROR_NONE - Success \n
3231 * @see bluetooth_enable_rssi
3233 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3235 int bluetooth_set_connectable(gboolean is_connectable);
3237 int bluetooth_is_connectable(gboolean *is_connectable);
3240 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3241 * @brief Initiate a bonding process
3244 * This function initiates a bonding procedure with a peer device. The bonding procedure
3245 * enables authentication and optionally encryption on the Bluetooth link.
3247 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3248 * inititate the bonding request to the devices already in the paired list.
3250 * Usually we call this API after the device discovery.
3251 * This function is a asynchronous call.
3253 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3254 * mentioed result code
3255 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3256 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3257 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3258 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3259 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3261 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3262 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3265 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3268 * @return BLUETOOTH_ERROR_NONE - Success \n
3269 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3270 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3271 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3272 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3274 * @param[in] device_address This indicates an address of the device with which the pairing
3275 * should be initiated
3277 * @see bluetooth_cancel_bonding
3279 void bt_event_callback(int event, bluetooth_event_param_t *param)
3283 case BLUETOOTH_EVENT_BONDING_FINISHED:
3285 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3286 if (param->result >= BLUETOOTH_ERROR_NONE)
3288 bluetooth_device_info_t *device_info = NULL;
3289 device_info = (bluetooth_device_info_t *)param->param_data;
3290 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3291 mjr[%#x] min[%#x] srv[%#x]",
3292 device_info->device_name.name,
3293 device_info->device_address.addr[0],
3294 device_info->device_address.addr[1],
3295 device_info->device_address.addr[2],
3296 device_info->device_address.addr[3],
3297 device_info->device_address.addr[4],
3298 device_info->device_address.addr[5],
3299 device_info->device_class.major_class,
3300 device_info->device_class.minor_class,
3301 device_info->device_class.service_class);
3315 bluetooth_device_address_t device_address={{0}};
3317 ret = bluetooth_bond_device(&device_address);
3321 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3324 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3325 * bluetooth_conn_type_t conn_type)
3326 * @brief Initiate a bonding process
3329 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3330 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3332 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3333 * inititate the bonding request to the devices already in the paired list.
3335 * Usually we call this API after the device discovery.
3336 * This function is a asynchronous call.
3338 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3339 * mentioed result code
3340 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3341 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3342 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3343 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3344 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3346 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3347 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3350 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3353 * @return BLUETOOTH_ERROR_NONE - Success \n
3354 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3355 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3356 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3357 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3359 * @param[in] device_address This indicates an address of the device with which pairing
3360 * should be initiated
3361 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3364 * @see bluetooth_cancel_bonding
3366 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3367 bluetooth_conn_type_t conn_type);
3370 * @fn int bluetooth_cancel_bonding(void)
3371 * @brief Cancel the on-going bonding process
3373 * This API is called to cancel the on-going bonding procedure. It should be called before the
3374 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3375 * This API is useful when the remote device is not responding to the bond request or we wish to
3376 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3378 * This function is a synchronous call.
3380 * @return BLUETOOTH_ERROR_NONE - Success \n
3381 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3382 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3385 * @see bluetooth_bond_device
3391 ret = bluetooth_cancel_bonding();
3394 int bluetooth_cancel_bonding(void);
3397 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3398 * @brief Remove bonding
3401 * To communicate with remote device over bluetooth link, user should bond with peer device.
3402 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3403 * API is used to remove peer device from the list. Please note that after removing the device
3404 * from bonded device list, you cannot communication with peer device until bonding happens again.
3406 * User can call this function by passing bluetooth device address of any bonded device. Please note
3407 * that after successful return of this function, any bluetooth application running on your device
3408 * will not be able to communicate with unbonded device until bond operation happens again using
3409 * bluetooth_bond_device()
3412 * This function is a asynchronous call. The request to remove the specified device from the bonded
3413 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3414 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3415 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3419 * @return BLUETOOTH_ERROR_NONE - Success \n
3420 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3421 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3422 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3423 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3424 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3425 * agent is not running \n
3426 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3429 * @param[in] device_address This indicates an address of the device to remove bonding
3433 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3436 void bt_event_callback(int event, bluetooth_event_param_t *param)
3439 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3440 bluetooth_device_address_t *dev_addr = NULL;
3442 if (param->result == BLUETOOTH_ERROR_NONE) {
3443 dev_addr = (bluetooth_device_address_t *)param->param_data;
3445 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3446 dev_addr->addr[0], dev_addr->addr[1]
3447 dev_addr->addr[2], dev_addr->addr[3]
3448 dev_addr->addr[4], dev_addr->addr[5]
3459 bluetooth_device_address_t *device_address;
3461 // copy valid device address in device_address
3463 ret = bluetooth_unbond_device(device_address);
3466 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3469 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3470 * @brief Get bonded(paired) device list
3473 * This API gets all bonded device list.
3474 * The devices in the bonded device list further can be used to perform the authorization by calling
3475 * bluetooth_authorize_device API.
3477 * This function is a synchronous call.
3478 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3479 * there is no valid information in the dev_list.
3480 * The len field in the dev_list represents the number of bonded devices. The data structure for
3481 * bonded device information is bluetooth_device_info_t.
3484 * @return BLUETOOTH_ERROR_NONE - Success \n
3485 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3487 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3489 void bt_get_bonded_devices(void)
3493 GPtrArray *devinfo = NULL;
3494 bluetooth_device_info_t *ptr;
3496 // allocate the g_pointer_array
3497 devinfo = g_ptr_array_new();
3499 ret = bluetooth_get_bonded_device_list(&devinfo);
3500 if (ret != BLUETOOTH_ERROR_NONE)
3502 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3506 printf("g pointer arrary count : [%d]", devinfo->len);
3507 for (i=0; i<devinfo->len; i++)
3509 ptr = g_ptr_array_index(devinfo, i);
3512 printf("Name [%s]\n", ptr->device_name.name);
3513 printf("Major Class [%d]\n", ptr->device_class.major_class);
3514 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3515 printf("Service Class [%d]\n", ptr->device_class.service_class);
3516 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3517 ptr->device_address.addr[0],
3518 ptr->device_address.addr[1], ptr->device_address.addr[2],
3519 ptr->device_address.addr[3],
3520 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3527 // free g_pointer_array
3528 g_ptr_array_free(devinfo, TRUE);
3533 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3535 int bluetooth_get_profile_connected_device_list(
3536 const char *profile_uuid, GPtrArray **addr_list);
3539 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3540 * bluetooth_device_info_t *dev_info)
3541 * @brief Get a bonded(paired) device
3544 * This API gets a bonded device.
3546 * This function is a synchronous call.
3547 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3548 * there is no valid information in the dev_info.
3549 * The data structure for bonded device information is bluetooth_device_info_t.
3552 * @return BLUETOOTH_ERROR_NONE - Success \n
3553 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3555 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3557 void bt_get_bonded_device(void)
3561 bluetooth_device_info_t devinfo = {0};
3562 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3564 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3565 if (ret != BLUETOOTH_ERROR_NONE)
3567 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3571 printf("Name [%s]\n", devinfo.device_name.name);
3572 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3573 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3574 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3575 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3576 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3577 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3578 devinfo.device_address.addr[5]);
3587 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3588 bluetooth_device_info_t *dev_info);
3592 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3593 * gboolean *is_alias_set)
3594 * @brief Get is_alias_set property of device
3596 * This API gets is_alias_set property of a bonded device.
3598 * This function is a synchronous call.
3599 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3600 * If not,there is no valid information in the is_alias_set.
3602 * @return BLUETOOTH_ERROR_NONE - Success \n
3603 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3608 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3610 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3613 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3614 gboolean *is_alias_set);
3617 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3618 * @brief set alias for bonded device
3621 * This function set alias for bonded device.
3623 * This function is a synchronous call.
3626 * @return BLUETOOTH_ERROR_NONE - Success \n
3627 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3628 * @param[in] device_address This indicates an address of the remote device
3629 * @param[in] alias This indicates an alias to set
3634 ret = bluetooth_set_alias(&remote_address);
3637 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3641 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3642 * @brief Get remote deivice
3645 * This function gets specific remote device.
3647 * This function is a asynchronous call.
3648 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3651 * @return BLUETOOTH_ERROR_NONE - Success \n
3652 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3653 * @param[in] device_address This indicates an address of the remote device
3658 ret = bluetooth_get_remote_device(&remote_address);
3661 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3664 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3665 * gboolean authorized)
3666 * @brief Authorize/Unauthorize a bonded device
3669 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3670 * with/without user confirmation.
3672 * If we select a paired device and make it authorized by calling this API with the authorized
3673 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3674 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3675 * then it will ask for the user conformation before the connection.
3677 * This API supposed to be called on the paired devices. Which means we have to use this API only
3678 * after successful pairing.
3680 * This function is a asynchronous call.
3681 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3683 * @return BLUETOOTH_ERROR_NONE - Success \n
3684 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3685 * @param[in] device_address This indicates an address of the device to authorize \n
3686 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3688 * @see bluetooth_get_bonded_device_list
3690 void bt_event_callback(int event, bluetooth_event_param_t *param)
3694 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3696 if (param->result == BLUETOOTH_ERROR_NONE)
3700 //device authorization failed failure
3708 bluetooth_device_address_t device_address={{0}};
3709 gboolean authorized;
3713 ret = bluetooth_authorize_device(&device_address,authorized);
3716 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3717 gboolean authorized);
3719 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3720 const bluetooth_device_pin_code_t *pin_code);
3722 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3725 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3727 * @brief Receives Legacy Passkey\pin with following authentication response types
3729 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3730 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3733 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3736 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3738 * @brief This API sends user confirmation reply to the local adapter.
3740 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3743 int bluetooth_passkey_confirmation_reply(gboolean reply);
3746 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3747 * @brief Get all services supported by remote device
3750 * This API call initiates the search for the services supported by the specified device. Normally
3751 * the service search will take a couple of seconds to get it completed. Before calling this API
3752 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3753 * perform the service search. We can get the device address by doing a device discovery operation.
3756 * This function is a asynchronous call.
3757 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3759 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3760 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3761 * event is generated with appropriate result code.
3763 * @return BLUETOOTH_ERROR_NONE - Success \n
3764 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3765 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3766 * @param[in] device_address This indicates an address of the device
3767 * whose services need to be found
3769 * @see bluetooth_cancel_service_search
3771 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3774 * @fn int bluetooth_cancel_service_search(void)
3775 * @brief Cancel the ongoing service search operation
3778 * This function cancel the ongoing service search operation. This API is usually calling after the
3779 * bluetooth_search_service API.
3780 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3781 * if the user wish to cancel the Ongoing service search operation.
3783 * This API should be called just after the bluetooth_search_service API and before the
3784 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3786 * This function is a synchronous call.
3788 * @return BLUETOOTH_ERROR_NONE - Success \n
3789 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3790 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3791 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3794 * @see bluetooth_search_service
3799 ret = bluetooth_cancel_service_search();
3802 int bluetooth_cancel_service_search(void);
3805 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3806 * @brief Register rfcomm socket with a specific uuid
3809 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3810 * descriptor of the server.
3811 * This is the first API which is called to create the server. Once we created the server socket,
3812 * we will listen on that return socket.
3813 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3816 * @return socket FD on Success \n
3817 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3818 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3819 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3820 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3821 * @param[in] UUID (128 bits)
3824 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3828 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3829 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3833 int bluetooth_rfcomm_create_socket(const char *uuid);
3836 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3837 * @brief Register rfcomm socket with a specific uuid
3840 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3841 * descriptor of the server.
3842 * This is the first API which is called to create the server. Once we created the server socket,
3843 * we will listen on that return socket.
3844 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3847 * @return socket FD on Success \n
3848 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3849 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3850 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3851 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3852 * @param[in] UUID (128 bits)
3853 * @param[in] bus_name (const char)
3854 * @param[in] path (const char)
3857 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3861 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3862 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3866 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3869 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3870 * @brief De-register the rfcomm socket
3873 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3874 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3875 * descriptor else no event will come. We will call this API only after the
3876 * bluetooth_rfcomm_listen_and_accept.
3877 * This is a synchronous call.
3879 * @return BLUETOOTH_ERROR_NONE - Success \n
3880 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3881 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3882 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3883 * @param[in] int socket_fd
3886 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3889 void bt_event_callback(int event, bluetooth_event_param_t *param)
3893 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3895 bluetooth_rfcomm_connection_t *discon_ind =
3896 (bluetooth_rfcomm_connection_t *)param->param_data;
3898 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3906 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3907 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3909 ret = bluetooth_rfcomm_remove_socket(fd);
3912 int bluetooth_rfcomm_remove_socket(int socket_fd);
3915 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3916 * @brief De-register the rfcomm socket
3919 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3920 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3921 * descriptor else no event will come. We will call this API only after the
3922 * bluetooth_rfcomm_listen_and_accept_ex.
3923 * This is a synchronous call.
3925 * @return BLUETOOTH_ERROR_NONE - Success \n
3926 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3927 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3928 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3929 * @param[in] UUID (128 bits)
3932 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3935 void bt_event_callback(int event, bluetooth_event_param_t *param)
3939 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3941 bluetooth_rfcomm_connection_t *discon_ind =
3942 (bluetooth_rfcomm_connection_t *)param->param_data;
3944 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3952 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3953 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3955 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3958 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3961 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3962 * @brief Disconnect rfcomm connection
3965 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3966 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3969 * @return BLUETOOTH_ERROR_NONE - Success \n
3970 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3971 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3972 * @param[in] int socket_fd the sending socket fd
3978 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3980 printf("Disconnection failed");
3982 printf("Disconnection Success");
3986 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3989 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3990 * @brief Rfcomm socket listen
3993 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3994 * after the bluetooth_rfcomm_create_socket API.
3995 * This API listen for the incomming connection and once it receives a connection, it will give
3996 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3997 * event to the application. This is an Asynchronous API call.
4000 * @return BLUETOOTH_ERROR_NONE - Success \n
4001 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4002 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4004 * @param[in] int socket_fd
4005 * @param[in] max pending connection.
4008 * @see bluetooth_rfcomm_create_socket
4011 void bt_event_callback(int event, bluetooth_event_param_t* param)
4015 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4017 bluetooth_rfcomm_connection_t *conn_ind =
4018 (bluetooth_rfcomm_connection_t *)param->param_data;
4020 printf("\nConnected from FD %d", conn_ind->socket_fd);
4028 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4029 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4033 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4036 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4037 * @brief Rfcomm socket listen
4040 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4041 * after the bluetooth_rfcomm_create_socket API.
4042 * This API listen for the incomming connection and once it receives a connection, it will give
4043 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4044 * event to the application. This is an Asynchronous API call.
4047 * @return BLUETOOTH_ERROR_NONE - Success \n
4048 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4049 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4051 * @param[in] int socket_fd
4052 * @param[in] max pending connection.
4057 * @see bluetooth_rfcomm_create_socket_ex
4060 void bt_event_callback(int event, bluetooth_event_param_t* param)
4064 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4066 bluetooth_rfcomm_connection_t *conn_ind =
4067 (bluetooth_rfcomm_connection_t *)param->param_data;
4069 printf("\nConnected from FD %d", conn_ind->socket_fd);
4077 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4078 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4083 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4086 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4087 * @brief Rfcomm socket listen
4090 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4091 * after the bluetooth_rfcomm_create_socket API.
4092 * This API listen for the incomming connection and once it receives a connection, it will give
4093 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4094 * event to the application. This is an Asynchronous API call.
4097 * @return BLUETOOTH_ERROR_NONE - Success \n
4098 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4099 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4101 * @param[in] int socket_fd
4102 * @param[in] max pending connection.
4105 * @see bluetooth_rfcomm_create_socket
4108 void bt_event_callback(int event, bluetooth_event_param_t* param)
4112 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4114 char *name = (char *)param->param_data;
4116 printf("\nConnected from %s", name);
4118 bluetooth_rfcomm_accept_connection();
4126 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4127 ret = bluetooth_rfcomm_listen(fd, 1);
4131 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4134 * @fn int bluetooth_rfcomm_accept_connection()
4135 * @brief Accepts the authorization request indicated by the event
4136 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4138 * This function is a synchronous call.
4140 * @return BLUETOOTH_ERROR_NONE - Success \n
4141 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4143 * @param[in] the socket fd of the server
4144 * @param[out] the socket fd of the client
4148 * @see bluetooth_rfcomm_reject_connection
4150 int bluetooth_rfcomm_accept_connection(int server_fd);
4153 * @fn int bluetooth_rfcomm_reject_connection()
4154 * @brief Rejects the authorization request indicated by the event
4155 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4157 * This function is a synchronous call.
4159 * @return BLUETOOTH_ERROR_NONE - Success \n
4160 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4162 * @param[in] the socket fd of the server
4166 * @see bluetooth_rfcomm_accept_connection
4168 int bluetooth_rfcomm_reject_connection(int server_fd);
4171 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4172 * @brief Informs whether rfcomm server uuid is available or not.
4174 * This function is a synchronous call.
4176 * @return TRUE - RFCOMM uuid is available \n
4177 * FALSE - RFCOMM uuid is not available \n
4179 * @param[in] uuid UUID string
4185 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4188 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4189 * const char *remote_uuid)
4190 * @brief Connect to the remote device rfcomm *
4192 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4193 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4194 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4195 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4196 * initiating a connection.
4198 * @return BLUETOOTH_ERROR_NONE - Success \n
4199 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4200 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4201 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4202 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4203 * @param[in] bluetooth_device_address_t remote bt_address
4204 * @param[in] char remote uuid
4206 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4210 void bt_event_callback(int event, bluetooth_event_param_t *param)
4214 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4216 if (param->result >= BLUETOOTH_ERROR_NONE)
4218 bt_sdp_info_t *bt_sdp_info=param->param_data;
4220 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4221 bt_sdp_info->device_addr.addr[0],
4222 bt_sdp_info->device_addr.addr[1],
4223 bt_sdp_info->device_addr.addr[2],
4224 bt_sdp_info->device_addr.addr[3],
4225 bt_sdp_info->device_addr.addr[4],
4226 bt_sdp_info->device_addr.addr[5]);
4228 printf("Supported service list:\n");
4229 for(i=0; i<bt_sdp_info->service_index; i++)
4231 bt_sdp_info->service_list_array[i]);
4234 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4235 //rfcomm_test_uuid);
4239 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4241 bluetooth_rfcomm_connection_t *conn_ind =
4242 (bluetooth_rfcomm_connection_t *)param->param_data;
4244 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4245 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4246 "SERVER" : "CLIENT");
4251 bluetooth_device_address_t remote_address = {{0},};
4252 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4253 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4254 ret = bluetooth_search_service(&remote_address);
4256 printf("Seach failed, Reason = %d", ret);
4258 printf("Search Success, Ret = %d", ret);
4260 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4262 printf("Connection failed, Reason = %d", ret);
4264 printf("Connection Success, Ret = %d", ret);
4268 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4269 const char *remote_uuid);
4272 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4273 * @brief Disconnect rfcomm connection
4276 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4277 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4280 * @return BLUETOOTH_ERROR_NONE - Success \n
4281 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4282 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4283 * @param[in] char remote bt_address
4286 * @see bluetooth_rfcomm_connect
4290 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4292 printf("Disconnection failed");
4294 printf("Disconnection Success");
4299 int bluetooth_rfcomm_disconnect(int socket_fd);
4302 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4303 * @brief Write to rfcomm connection
4306 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4307 * API is used to send the data for server and the client.
4309 * @return BLUETOOTH_ERROR_NONE - Success \n
4310 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4311 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4313 * @param[in] const char *buff Data buffer to send
4314 * @param[in] int length Length of the data
4317 * @see bluetooth_rfcomm_connect
4320 char *buff = "Test data 123456789"
4321 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4323 printf("Send failed");
4325 printf("Send success");
4329 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4332 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4333 * @brief Informs whether rfcomm client is connected.
4335 * This function is a synchronous call.
4337 * @return TRUE - RFCOMM client is connected \n
4338 * FALSE - RFCOMM client is not connected \n
4344 gboolean bluetooth_rfcomm_is_client_connected(void);
4345 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4346 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4349 * @fn int bluetooth_network_activate_server(void)
4350 * @brief Activate the NAP (Network Access Point) service
4352 * This function is a asynchronous call.
4353 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4355 * @return BLUETOOTH_ERROR_NONE - Success \n
4356 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4357 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4358 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4361 * @see bluetooth_network_deactivate_server
4364 int bluetooth_network_activate_server(void);
4367 * @fn int bluetooth_network_deactivate_server(void)
4368 * @brief Deactivate the NAP (Network Access Point) service
4370 * This function is a asynchronous call.
4371 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4373 * @return BLUETOOTH_ERROR_NONE - Success \n
4374 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4375 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4376 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4379 * @see bluetooth_network_activate_server
4382 int bluetooth_network_deactivate_server(void);
4385 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4386 * bluetooth_network_role_t role,
4388 * @brief Connect the network server in the peer
4390 * This function is a asynchronous call.
4391 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4393 * @return BLUETOOTH_ERROR_NONE - Success \n
4394 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4395 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4396 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4399 * @param[in] device_address This indicates an address of the device with which the pairing
4400 * should be initiated
4401 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4402 * need to use the third parameter.
4403 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4404 * connect. UUID string
4406 * @see bluetooth_network_disconnect
4408 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4409 bluetooth_network_role_t role, char *custom_uuid);
4412 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4413 * bluetooth_network_role_t role,
4414 * char *custom_uuid)
4415 * @brief Connect the network server in the peer
4417 * This function is a asynchronous call.
4418 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4420 * @return BLUETOOTH_ERROR_NONE - Success \n
4421 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4422 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4423 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4426 * @param[in] device_address This indicates an address of the device with which the pairing
4427 * should be initiated
4429 * @see bluetooth_network_connect
4431 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4434 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4435 * @brief Disconnect the device from the network
4437 * This function is an asynchronous call.
4438 * The network server disconnect request is responded by
4439 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4441 * @return BLUETOOTH_ERROR_NONE - Success \n
4442 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4443 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4444 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4447 * @param[in] device_address This indicates an address of the connected client device
4449 * @see bluetooth_network_activate_server
4451 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4456 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4457 * bt_hdp_role_type_t role,
4458 * bt_hdp_qos_type_t channel_type,
4459 * char **app_handle)
4460 * @brief Activate the HDP service for a particular data type
4462 * This function is a synchronous call.
4464 * @return BLUETOOTH_ERROR_NONE - Success \n
4465 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4466 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4467 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4470 * @param[in] data_type The data type against corresponding service
4471 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4472 * @param[in] channel_type The QOS type for the channel.
4473 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4474 * For role = HDP_ROLE_SINK, the channel_type
4475 * should be HDP_QOS_ANY.
4476 * @param[out] app_handle The application handler against corresponding service
4478 * @see bluetooth_hdp_deactivate
4480 int bluetooth_hdp_activate(unsigned short data_type,
4481 bt_hdp_role_type_t role,
4482 bt_hdp_qos_type_t channel_type,
4485 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4486 * @brief Deactivate the HDP service for a particular service using the handler
4488 * This function is a synchronous call.
4490 * @return BLUETOOTH_ERROR_NONE - Success \n
4491 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4492 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4493 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4496 * @param[in] app_handle The application handler against corresponding service
4498 * @see bluetooth_hdp_deactivate
4500 int bluetooth_hdp_deactivate(const char *app_handle);
4503 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4504 * const char *buffer, unsigned int size)
4505 * @brief Send data to the remote HDP device
4507 * This function is a synchronous call.
4509 * @return BLUETOOTH_ERROR_NONE - Success \n
4510 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4511 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4512 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4513 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4516 * @param[in] channel_id The channel id for the connection.
4517 * @param[in] buffer The pdu buffer.
4518 * @param[in] size Size of the buffer.
4520 * @see bluetooth_hdp_connect
4522 int bluetooth_hdp_send_data(unsigned int channel_id,
4523 const char *buffer, unsigned int size);
4525 * @fn int bluetooth_hdp_connect(const char *app_handle,
4526 * bt_hdp_qos_type_t channel_type,
4527 * const bluetooth_device_address_t *device_address)
4528 * @brief Connect to the remote device(Mainly used by source)
4530 * This function is a asynchronous call.
4531 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4533 * @return BLUETOOTH_ERROR_NONE - Success \n
4534 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4535 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4536 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4537 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4540 * @param[in] app_handle The application handler against corresponding service
4541 * @param[in] channel_type The QOS type for the channel.
4542 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4543 * @param[in] device_address The remote device Bd address.
4546 * @see bluetooth_hdp_disconnect
4548 int bluetooth_hdp_connect(const char *app_handle,
4549 bt_hdp_qos_type_t channel_type,
4550 const bluetooth_device_address_t *device_address);
4552 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4553 * const bluetooth_device_address_t *device_address)
4554 * @brief Disconnect from the remote device(Mainly used by source)
4556 * This function is a asynchronous call.
4557 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4559 * @return BLUETOOTH_ERROR_NONE - Success \n
4560 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4561 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4562 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4563 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4566 * @param[in] channel_id The channel id for the connection.
4567 * @param[in] device_address The remote device Bd address.
4570 * @see bluetooth_hdp_connect
4572 int bluetooth_hdp_disconnect(unsigned int channel_id,
4573 const bluetooth_device_address_t *device_address);
4577 * @fn int bluetooth_opc_init(void)
4578 * @brief Initialize OPP client.
4580 * This function is a synchronous call.
4581 * No event corresponding to this api
4583 * @return BLUETOOTH_ERROR_NONE - Success \n
4584 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4585 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4586 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4587 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4592 * @see bluetooth_opc_deinit
4594 int bluetooth_opc_init(void);
4597 * @fn int bluetooth_opc_deinit(void)
4598 * @brief Deinitialize OPP client.
4600 * This function is a synchronous call.
4601 * No event corresponding to this api
4603 * @return BLUETOOTH_ERROR_NONE - Success \n
4604 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4605 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4610 * @see bluetooth_opc_init
4613 int bluetooth_opc_deinit(void);
4616 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4617 char **file_name_array)
4618 * @brief Send multiple files to a remote device.
4620 * This function is a asynchronous call.
4621 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4623 * @return BLUETOOTH_ERROR_NONE - Success \n
4624 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4625 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4626 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4627 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4628 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4629 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4632 * @param[in] device_address The remote device Bd address.
4633 * @param[in] file_name_array Array of filepaths to be sent.
4636 * @see bluetooth_opc_cancel_push
4639 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4640 char **file_name_array);
4643 * @fn int bluetooth_opc_cancel_push(void)
4644 * @brief Cancels the ongoing file push.
4646 * This function is a asynchronous call.
4647 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4648 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4650 * @return BLUETOOTH_ERROR_NONE - Success \n
4651 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4652 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4657 * @see bluetooth_opc_push_files
4660 int bluetooth_opc_cancel_push(void);
4663 * @fn gboolean bluetooth_opc_session_is_exist(void)
4664 * @brief Informs whether opc session exists or not.
4666 * This function is a synchronous call.
4668 * @return TRUE - OPC session exists \n
4669 * FALSE - OPC session does not exist \n
4677 gboolean bluetooth_opc_session_is_exist(void);
4680 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4681 * @brief Informs whether opc session exists or not.
4683 * This function is a synchronous call.
4685 * @return BLUETOOTH_ERROR_NONE - Success \n
4686 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4687 * BLUETOOTH_ERROR_INTERNAL \n
4690 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4695 int bluetooth_opc_is_sending(gboolean *is_sending);
4698 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4699 int transfer_id, unsigned char *progress)
4700 * @brief Gets the percentage progress for ongoing transfers.
4702 * This function is a synchronous call.
4704 * @return BLUETOOTH_ERROR_NONE - Success \n
4705 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4706 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4709 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4710 * @param[in] transfer_id Transfer ID
4711 * @param[out] progress Percentage Progress
4715 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4716 int transfer_id, unsigned char *progress);
4719 * @fn int bluetooth_obex_server_init(const char *dst_path)
4720 * @brief Initialize OPP and FTP server.
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
4732 * @param[in] dst_path OPS destination file path.
4734 * @see bluetooth_obex_server_deinit
4736 int bluetooth_obex_server_init(const char *dst_path);
4740 * @fn int bluetooth_obex_server_deinit(void)
4741 * @brief Deinitialize OPP and FTP server.
4743 * This function is a synchronous call.
4744 * No event corresponding to this api
4746 * @return BLUETOOTH_ERROR_NONE - Success \n
4747 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4748 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4753 * @see bluetooth_obex_server_init
4755 int bluetooth_obex_server_deinit(void);
4759 * @fn gboolean bluetooth_obex_server_is_activated(void)
4760 * @brief Informs whether obex server is activated or not.
4762 * This function is a synchronous call.
4764 * @return TRUE - OBEX server is activated \n
4765 * FALSE - OBEX server is not activated \n
4772 gboolean bluetooth_obex_server_is_activated(void);
4776 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4777 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4779 * This function is a synchronous call.
4780 * No event corresponding to this api
4782 * @return BLUETOOTH_ERROR_NONE - Success \n
4783 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4784 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4785 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4786 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4790 * @param[in] dst_path OPS destination file path.
4792 * @see bluetooth_obex_server_deinit_without_agent
4794 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4798 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4799 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4801 * This function is a synchronous call.
4802 * No event corresponding to this api
4804 * @return BLUETOOTH_ERROR_NONE - Success \n
4805 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4806 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4811 * @see bluetooth_obex_server_init_without_agent
4813 int bluetooth_obex_server_deinit_without_agent(void);
4817 * @fn int bluetooth_obex_server_accept_connection(void)
4818 * @brief Accepts the authorization request indicated by the event
4819 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4821 * This function is a synchronous call.
4823 * @return BLUETOOTH_ERROR_NONE - Success \n
4824 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4825 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4829 * @see bluetooth_obex_server_reject_authorize
4831 int bluetooth_obex_server_accept_connection(void);
4835 * @fn int bluetooth_obex_server_reject_connection(void)
4836 * @brief Rejects the authorization request indicated by the event
4837 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4839 * This function is a synchronous call.
4841 * @return BLUETOOTH_ERROR_NONE - Success \n
4842 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4843 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4847 * @see bluetooth_obex_server_reject_authorize
4849 int bluetooth_obex_server_reject_connection(void);
4853 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4854 * @brief Accepts the authorization request indicated by the event
4855 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4857 * This function is a asynchronous call.
4858 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4860 * @return BLUETOOTH_ERROR_NONE - Success \n
4861 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4862 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4863 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4866 * @param[in] filename Authorized filename.
4869 * @see bluetooth_obex_server_reject_authorize
4872 int bluetooth_obex_server_accept_authorize(const char *filename);
4875 * @fn int bluetooth_obex_server_reject_authorize(void)
4876 * @brief Reject the authorization request indicated by the event
4877 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4879 * This function is a asynchronous call.
4880 * No event for this api..
4882 * @return BLUETOOTH_ERROR_NONE - Success \n
4883 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4884 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4889 * @see bluetooth_obex_server_accept_authorize
4892 int bluetooth_obex_server_reject_authorize(void);
4895 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4896 * @brief Set the OPS destination file path..
4898 * This function is a asynchronous call.
4899 * No event for this api..
4901 * @return BLUETOOTH_ERROR_NONE - Success \n
4902 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4903 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4904 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4907 * @param[in] dst_path OPS destination file path.
4913 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4916 * @fn int bluetooth_obex_server_set_root(const char *root)
4917 * @brief Set the FTS root folder..
4919 * This function is a asynchronous call.
4920 * No event for this api..
4922 * @return BLUETOOTH_ERROR_NONE - Success \n
4923 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4924 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4925 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4926 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4927 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4930 * @param[in] root FTS root folder.
4936 int bluetooth_obex_server_set_root(const char *root);
4939 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4940 * @brief Cancel the transfer on server
4942 * This function is an asynchronous call.
4943 * If the function call that cancels transfer is successful, the application would receive
4944 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4945 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4946 * the error code will be BLUETOOTH_ERROR_NONE
4948 * @return BLUETOOTH_ERROR_NONE - Success \n
4949 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4950 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4951 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4952 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4955 * @param[in] transfer_id transfer ID
4960 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4964 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4965 * @brief Cancel the transfer on server
4967 * This function is an asynchronous call.
4968 * If the function call that cancels transfer is successful, the application would receive
4969 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4970 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4971 * the error code will be BLUETOOTH_ERROR_NONE
4973 * @return BLUETOOTH_ERROR_NONE - Success \n
4974 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4975 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4976 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4977 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4984 int bluetooth_obex_server_cancel_all_transfers(void);
4988 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4989 * @brief Informs whether obex server is receiving or not.
4991 * This function is a synchronous call.
4993 * @return BLUETOOTH_ERROR_NONE - Success \n
4994 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4995 * BLUETOOTH_ERROR_INTERNAL \n
4998 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5003 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5007 * @fn int bluetooth_map_client_init(void)
5008 * @brief Initialize MAP client.
5010 * This function is a synchronous call.
5011 * No event corresponding to this api
5013 * @return BLUETOOTH_ERROR_NONE - Success \n
5014 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5015 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5016 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5017 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5022 * @see bluetooth_map_client_deinit
5024 int bluetooth_map_client_init(void);
5026 int bluetooth_map_client_deinit(void);
5028 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5030 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5032 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5034 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5035 bt_map_client_list_folders_filter_t *filter);
5038 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5039 * @brief Return all available fields that can be used in Fields filter.
5041 * This function is a asynchronous call.
5043 * @return BLUETOOTH_ERROR_NONE - Success \n
5044 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5045 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5048 * @param[in] session Information about session.
5051 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5053 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5055 bt_map_client_list_messages_filter_t *filter);
5057 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5059 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5060 const char *source_file,
5062 bt_map_client_push_message_args_t *args);
5064 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5065 const bt_map_client_message_object_t message_object,
5066 const char *target_file,
5071 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5072 * @brief Read the local Hash and Randmizer.
5074 * This function is a synchronous call.
5076 * @return BLUETOOTH_ERROR_NONE - Success \n
5077 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5081 * @param[out] local_oob_data - Pointer to the local OOB data
5087 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5091 * @fn int bluetooth_oob_add_remote_data(
5092 * const bluetooth_device_address_t *remote_device_address,
5093 * bluetooth_bdaddr_type_e address_type,
5094 * bt_oob_data_t *oob_data)
5095 * @brief Add/updated the remote device Hash and Randmizer.
5097 * This function is a synchronous call.
5098 * No event for this api..
5100 * @return BLUETOOTH_ERROR_NONE - Success \n
5101 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5104 * @param[in] remote_device_address - Remote device address
5105 * address_type - bdaddr type
5106 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5112 int bluetooth_oob_add_remote_data(
5113 const bluetooth_device_address_t *remote_device_address,
5114 bluetooth_bdaddr_type_e address_type,
5115 bt_oob_data_t *remote_oob_data);
5119 * @fn int bluetooth_oob_remove_remote_data(
5120 * const bluetooth_device_address_t *remote_device_address)
5121 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5123 * This function is a synchronous call.
5124 * No event for this api..
5126 * @return BLUETOOTH_ERROR_NONE - Success \n
5127 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5130 * @param[in] remote_device_address - Remote device address
5136 int bluetooth_oob_remove_remote_data(
5137 const bluetooth_device_address_t *remote_device_address);
5140 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5141 * bt_gatt_handle_info_t *prim_svc);
5143 * @brief Gets the GATT based primary services handle supported by remote device
5145 * This function is a synchronous call.
5146 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5148 * @return BLUETOOTH_ERROR_NONE - Success \n
5149 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5150 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5151 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5154 * @param[in] address - Remote device address
5155 * @param[out] prim_svc - Structure containing remote service count and handle list.
5158 * @see bluetooth_gatt_free_primary_services()
5160 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5161 bt_gatt_handle_info_t *prim_svc);
5164 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5166 * @brief Discovers the characteristics of GATT based service of remote device
5168 * This function is an asynchronous call.
5169 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5171 * @return BLUETOOTH_ERROR_NONE - Success \n
5172 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5173 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5174 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5177 * @param[in] service_handle - Handle for remote service.
5182 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5184 int bluetooth_gatt_set_service_change_watcher(
5185 const bluetooth_device_address_t *address, gboolean enable);
5188 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5189 * bt_gatt_service_property_t *service);
5191 * @brief Gets the properties of GATT based service of remote device
5193 * This function is a synchronous call.
5194 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5196 * @return BLUETOOTH_ERROR_NONE - Success \n
5197 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5198 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5199 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5202 * @param[in] service_handle - Handle for remote service.
5203 * @param[out] service - Structure containing remote service property.
5206 * @see bluetooth_gatt_free_service_property()
5208 int bluetooth_gatt_get_service_property(const char *service_handle,
5209 bt_gatt_service_property_t *service);
5212 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5214 * @brief Register to GATT based service to receive value change notification/indication.
5216 * This function is a synchronous call.
5217 * No event for this api.
5219 * @return BLUETOOTH_ERROR_NONE - Success \n
5220 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5221 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5222 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5225 * @param[in] service_handle - Handle for remote service.
5230 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5233 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5235 * @brief Unregister GATT based service to receive value change notification/indication.
5237 * This function is a synchronous call.
5238 * No event for this api.
5240 * @return BLUETOOTH_ERROR_NONE - Success \n
5241 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5242 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5243 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5246 * @param[in] service_handle - Handle for remote service.
5251 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5254 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5255 * bt_gatt_char_property_t *characteristic);
5257 * @brief Provides characteristic value along with properties.
5259 * This function is a synchronous call.
5260 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5262 * @return BLUETOOTH_ERROR_NONE - Success \n
5263 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5264 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5265 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5268 * @param[in] char_handle - Handle for Characteristic property.
5269 * @param[out] characteristic - Structure containing remote characteristic property.
5272 * @see bluetooth_gatt_free_char_property()
5274 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5275 bt_gatt_char_property_t *characteristic);
5278 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5279 * bt_gatt_char_property_t *characteristic);
5281 * @brief Provides characteristic descriptor value along with its UUID.
5283 * This function is a synchronous call.
5284 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5286 * @return BLUETOOTH_ERROR_NONE - Success \n
5287 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5288 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5289 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5292 * @param[in] desc_handle - Handle for Characteristic descriptor.
5293 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5296 * @see bluetooth_gatt_free_desc_property()
5298 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5299 bt_gatt_char_descriptor_property_t *descriptor);
5303 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5304 * const guint8 *value, int length)
5306 * @brief Set characteristic value.
5308 * This function is a synchronous call.
5310 * @return BLUETOOTH_ERROR_NONE - Success \n
5311 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5312 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5313 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5316 * @param[in] char_handle - Handle for Characteristic property.
5317 * @param[in] value - New value to set for characteristic property.
5318 * @param[in] length - Length of the value to be set.
5323 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5324 const guint8 *value, int length);
5327 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5328 * const guint8 *value, int length, guint8 write_type)
5330 * @brief Set characteristic value by write type.
5332 * This function is a synchronous call if write type is "write without resonse"
5333 * and it is an asynchronous call if write type is "write with response"
5335 * @return BLUETOOTH_ERROR_NONE - Success \n
5336 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5337 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5338 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5341 * @param[in] char_handle - Handle for Characteristic property.
5342 * @param[in] value - New value to set for characteristic property.
5343 * @param[in] length - Length of the value to be set.
5344 * @param[in] write_type - Type of write.
5349 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5350 const guint8 *value, int length, guint8 write_type);
5354 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5355 * const guint8 *value, int length)
5357 * @brief Set characteristic value request.
5359 * This function is an asynchronous call.
5361 * @return BLUETOOTH_ERROR_NONE - Success \n
5362 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5363 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5364 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5367 * @param[in] char_handle - Handle for Characteristic property.
5368 * @param[in] value - New value to set for characteristic property.
5369 * @param[in] length - Length of the value to be set.
5374 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5375 const guint8 *value, int length);
5378 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5380 * @brief Read characteristic value.
5382 * This function is a asynchronous call.
5384 * @return BLUETOOTH_ERROR_NONE - Success \n
5385 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5386 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5387 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5390 * @param[in] char_handle - Handle for Characteristic property.
5395 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5398 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5399 * const char *service_uuid,
5400 * bt_gatt_service_property_t *service)
5402 * @brief Gets the service property from a device based on a particular uuid
5404 * This function is a synchronous call.
5406 * @return BLUETOOTH_ERROR_NONE - Success \n
5407 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5408 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5409 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5412 * @param[in] address - BD address of the remote device
5413 * @param[in] service_uuid - uuid of the service.
5414 * @param[out] service - Structure containing the service property.
5419 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5420 const char *service_uuid,
5421 bt_gatt_service_property_t *service);
5424 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5425 * const char *char_uuid)
5427 * @brief Gets the characteristic property from a service based on a particular char uuid
5429 * This function is an asynchronous call.
5430 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5432 * @return BLUETOOTH_ERROR_NONE - Success \n
5433 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5434 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5435 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5438 * @param[in] service_handle - Service handle.
5439 * @param[in] uuid - Characteristic uuid.
5444 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5445 const char *char_uuid);
5448 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5450 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5452 * This function is a synchronous call.
5453 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5455 * @return BLUETOOTH_ERROR_NONE - Success \n
5456 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5459 * @param[in] prim_svc - GATT handle info structure
5462 * @see bluetooth_gatt_get_primary_services()
5464 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5467 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5469 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5471 * This function is a synchronous call.
5472 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5474 * @return BLUETOOTH_ERROR_NONE - Success \n
5475 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5478 * @param[in] svc_pty - GATT service property structure.
5481 * @see bluetooth_gatt_get_service_property()
5483 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5486 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5488 * @brief Provides characteristic value along with properties.
5490 * This function is a synchronous call.
5491 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5493 * @return BLUETOOTH_ERROR_NONE - Success \n
5494 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5497 * @param[in] char_pty - GATT characteristics property structure.
5500 * @see bluetooth_gatt_get_characteristics_property()
5502 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5505 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5507 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5509 * This function is a synchronous call.
5510 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5512 * @return BLUETOOTH_ERROR_NONE - Success \n
5513 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5516 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5519 * @see bluetooth_gatt_get_char_descriptor_property()
5521 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5523 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5525 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5528 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5530 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5532 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5534 * @return BLUETOOTH_ERROR_NONE - Success \n
5535 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5538 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5542 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5545 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5547 * @brief Read characteristic descriptor value.
5549 * This function is a asynchronous call.
5551 * @return BLUETOOTH_ERROR_NONE - Success \n
5552 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5553 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5554 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5557 * @param[in] desc_handle - Handle for Characteristic descriptor
5562 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5565 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5566 * const guint8 *value, int length);
5568 * @brief Set characteristic descriptor value.
5570 * This function is a asynchronous call.
5572 * @return BLUETOOTH_ERROR_NONE - Success \n
5573 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5574 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5575 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5578 * @param[in] desc_handle - Handle for Characteristic descriptor
5579 * @param[in] value - New value to set for characteristic descriptor
5580 * @param[in] length - Length of the value to be set.
5585 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5586 const guint8 *value, int length);
5588 /* @fn int bluetooth_gatt_init(void)
5590 * @brief Initializes the gatt service.
5592 * This function is a synchronous call.
5593 * @return BLUETOOTH_ERROR_NONE - Success \n
5594 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5595 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5596 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5599 * @remark Adapter should be enabled
5600 * @see bluetooth_gatt_deinit()
5602 int bluetooth_gatt_init(void);
5604 /* @fn int bluetooth_gatt_init(void)
5606 * @brief DeInitializes the gatt service.
5608 * This function is a synchronous call.
5609 * @return BLUETOOTH_ERROR_NONE - Success \n
5610 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5611 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5612 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5615 * @remark Adapter should be enabled
5616 * @see bluetooth_gatt_init()
5618 int bluetooth_gatt_deinit(void);
5620 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5621 unsigned char **svc_path)
5623 * @brief Exports a new gatt service to the service interface.
5625 * This function is a synchronous call.
5627 * @return BLUETOOTH_ERROR_NONE - Success \n
5628 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5629 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5630 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5633 * @param[in] svc_uuid Gatt service uuid.
5634 * @param[out] svc_path service object path of the exported service.
5635 * @remark Adapter should be enabled
5636 * @see bluetooth_gatt_init()
5638 int bluetooth_gatt_add_service(const char *svc_uuid,
5641 /* @fn int bluetooth_gatt_add_new_characteristic(
5642 const char *svc_path, const char *char_uuid,
5643 bt_gatt_permission_t permissions,
5644 bt_gatt_characteristic_property_t properties,
5645 int flags_length, char **char_path);;
5647 * @brief Exports a new gatt characteristic to the characteristic interface.
5649 * This function is a synchronous call.
5650 * @return BLUETOOTH_ERROR_NONE - Success \n
5651 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5652 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5653 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5655 * @param[in] svc_path service object path of the exported service.
5656 * @param[in] char_uuid Gatt service uuid.
5657 * @param[in] properties GATT characteristic properties.
5658 * @param[out] char_path characteristic object path of the exported characteristic.
5660 * @remark Adapter should be enabled
5661 * @see bluetooth_gatt_add_service()
5663 int bluetooth_gatt_add_new_characteristic(
5664 const char *svc_path, const char *char_uuid,
5665 bt_gatt_permission_t permissions,
5666 bt_gatt_characteristic_property_t properties,
5669 /* @fn bluetooth_gatt_set_characteristic_value(
5670 const char *characteristic, const char *char_value,
5673 * @brief adds gatt charactertisic value to the given charactertistic path.
5675 * This function is a synchronous call.
5676 * @return BLUETOOTH_ERROR_NONE - Success \n
5677 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5678 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5679 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5681 * @param[in] char_value Value of the GATT characteristic to be added.
5682 * @param[in] value_length length of the chantacteristic value..
5683 * @param[out] characteristic characteristic object path..
5685 * @remark Adapter should be enabled
5686 * @see bluetooth_gatt_add_service()
5688 int bluetooth_gatt_set_characteristic_value(
5689 const char *characteristic, const char *char_value,
5692 /* @fn int bluetooth_gatt_add_descriptor(
5693 const char *char_path, const char *desc_uuid,
5694 bt_gatt_permission_t permissions,
5697 * @brief Exports a new gatt descriptor to the descriptor interface.
5699 * This function is a synchronous call.
5701 * @return BLUETOOTH_ERROR_NONE - Success \n
5702 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5703 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5704 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5707 * @param[in] desc_uuid Gatt descriptor uuid.
5708 * @param[in] desc_value GATT descriptor value.
5709 * @param[in] value_length Length of GATT descriptor value.
5710 * @param[in] permissions descriptor permissions.
5711 * @param[in] properties GATT descriptor properties.
5712 * @param[in] char_path characteristics object path of the exported character.
5714 * @remark Adapter should be enabled
5715 * @see bluetooth_gatt_add_service()
5716 * @see bluetooth_gatt_add_characteristics()
5718 int bluetooth_gatt_add_descriptor(
5719 const char *char_path, const char *desc_uuid,
5720 bt_gatt_permission_t permissions,
5723 /* @fn int bluetooth_gatt_set_descriptor_value(
5724 const char *desc_path, const char *desc_value,
5727 * @brief Adds value to the given descriptor handle.
5729 * This function is a synchronous call.
5731 * @return BLUETOOTH_ERROR_NONE - Success \n
5732 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5733 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5734 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5737 * @param[in] desc_value GATT descriptor value.
5738 * @param[in] value_length Length of GATT descriptor value.
5739 * @param[in] desc_path descriptor path to which the value needs to be added.
5741 * @remark Adapter should be enabled
5742 * @see bluetooth_gatt_add_service()
5743 * @see bluetooth_gatt_add_characteristics()
5745 int bluetooth_gatt_set_descriptor_value(
5746 const char *desc_path, const char *desc_value,
5749 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5751 * @brief Reads the Service registered on manager interface.
5753 * This function is a synchronous call.
5755 * @return BLUETOOTH_ERROR_NONE - Success \n
5756 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5757 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5758 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5761 * @param[in] svc_uuid Gatt Service uuid.
5763 * @remark Adapter should be enabled and service should be registered.
5764 * @see bluetooth_gatt_register_service()
5766 int bluetooth_gatt_get_service(const char *svc_uuid);
5768 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5770 * @brief Registers the given service path with the library.
5772 * This function is a synchronous call.
5774 * @return BLUETOOTH_ERROR_NONE - Success \n
5775 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5776 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5777 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5780 * @param[in] svc_path service object path of the exported service.
5782 * @remark Adapter should be enabled
5783 * @see bluetooth_gatt_add_service()
5784 * @see bluetooth_gatt_add_characteristics()
5785 * @see bluetooth_gatt_add_descriptor()
5786 * @see bluetooth_gatt_register_application()
5788 int bluetooth_gatt_register_service(const char *svc_path);
5790 /* @fn int bluetooth_gatt_register_application(void)
5792 * @brief Registers the application with the bluez gatt server.
5794 * This function is a synchronous call.
5796 * @return BLUETOOTH_ERROR_NONE - Success \n
5797 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5798 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5799 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5803 * @remark Adapter should be enabled
5804 * @see bluetooth_gatt_init()
5805 * @see bluetooth_gatt_add_service()
5806 * @see bluetooth_gatt_add_characteristics()
5807 * @see bluetooth_gatt_add_descriptor()
5808 * @see bluetooth_gatt_register_service()
5810 int bluetooth_gatt_register_application(void);
5812 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5814 * @brief Removes(unregister) service from the bluez gatt server db.
5816 * This function is a synchronous call.
5818 * @return BLUETOOTH_ERROR_NONE - Success \n
5819 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5820 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5821 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5824 * @param[in] svc_path service object path of the exported service.
5826 * @remark Adapter should be enabled
5827 * @see bluetooth_gatt_add_service()
5828 * @see bluetooth_gatt_add_characteristics()
5829 * @see bluetooth_gatt_add_descriptor()
5830 * @see bluetooth_gatt_register_service()
5832 int bluetooth_gatt_unregister_service(const char *svc_path);
5834 /* @fn int bluetooth_gatt_unregister_application(void)
5836 * @brief Removes(unregister) the application with the bluez gatt server,
5837 * and deletes all the service registered.
5839 * This function is a synchronous call.
5841 * @return BLUETOOTH_ERROR_NONE - Success \n
5842 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5843 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5844 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5848 * @remark Adapter should be enabled
5849 * @see bluetooth_gatt_init()
5850 * @see bluetooth_gatt_add_service()
5851 * @see bluetooth_gatt_add_characteristics()
5852 * @see bluetooth_gatt_add_descriptor()
5853 * @see bluetooth_gatt_register_service()
5854 * @see bluetooth_gatt_unregister_service()
5856 int bluetooth_gatt_unregister_application(void);
5858 /* @fn int bluetooth_gatt_send_response(int request_id,
5859 * int offset, char *value, int value_length)
5861 * @brief Updates the attribute value in local attribute list.
5863 * This function is a synchronous call.
5865 * @return BLUETOOTH_ERROR_NONE - Success \n
5866 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5867 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5868 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5871 * @param[in] request_id The identification of a read request
5872 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5873 * @param[in] resp_state The identification of response state
5874 * @param[in] offset The offset from where a value is read
5875 * @param[in] value The value to be sent. It will be sent from @a offset.
5876 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5877 * @param[in] value_length Value Length.
5879 * @remark Adapter should be enabled
5880 * @see bluetooth_gatt_add_service()
5881 * @see bluetooth_gatt_add_characteristics()
5882 * @see bluetooth_gatt_add_descriptor()
5883 * @see bluetooth_gatt_register_service()
5885 int bluetooth_gatt_send_response(int request_id, guint req_type,
5886 int resp_state, int offset, char *value, int value_length);
5888 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5890 * @brief Sets the notification property for a characteristic.
5892 * This function is a synchronous call.
5894 * @return BLUETOOTH_ERROR_NONE - Success \n
5895 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5896 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5897 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5900 * @param[in] char_path characteristic object path.
5901 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5903 * @remark Adapter should be enabled
5904 * @see bluetooth_gatt_update_characteristic()
5906 int bluetooth_gatt_server_set_notification(const char *char_path,
5907 bluetooth_device_address_t *unicast_address);
5909 /* @fn int bluetooth_gatt_delete_services(void)
5911 * @brief deletes (unregisters) all services from the gatt server database..
5913 * This function is a synchronous call.
5915 * @return BLUETOOTH_ERROR_NONE - Success \n
5916 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5917 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5918 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5922 * @remark Adapter should be enabled
5923 * @see bluetooth_gatt_add_service()
5924 * @see bluetooth_gatt_add_characteristics()
5925 * @see bluetooth_gatt_add_descriptor()
5926 * @see bluetooth_gatt_register_service()
5927 * @see bluetooth_gatt_unregister_service()
5929 int bluetooth_gatt_delete_services(void);
5931 /* @fn int bluetooth_gatt_update_characteristic(void)
5933 * @brief updates the given characteristic with a new value
5935 * This function is a synchronous call.
5937 * @return BLUETOOTH_ERROR_NONE - Success \n
5938 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5939 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5940 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5944 * @remark Adapter should be enabled
5945 * @see bluetooth_gatt_add_service()
5946 * @see bluetooth_gatt_add_characteristics()
5947 * @see bluetooth_gatt_add_descriptor()
5948 * @see bluetooth_gatt_register_service()
5949 * @see bluetooth_gatt_unregister_service()
5951 int bluetooth_gatt_update_characteristic(const char *char_path,
5952 const char* char_value, int value_length);
5955 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5957 * @brief Set advertising status.
5959 * This function is used to enable or disable LE advertising.
5960 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5962 * This function is a synchronous call.
5964 * @return BLUETOOTH_ERROR_NONE - Success \n
5965 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5966 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5969 * @param[in] enable - The status of advertising
5972 * @see bluetooth_set_advertising_data
5974 int bluetooth_set_advertising(int handle, gboolean enable);
5977 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5979 * @brief Set advertising status along with interval value.
5981 * This function is used to enable or disable LE advertising.
5982 * Interval_min and Interval_max is used to set the best advertising interval.
5983 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5985 * This function is a synchronous call.
5987 * @return BLUETOOTH_ERROR_NONE - Success \n
5988 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5989 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5992 * @param[in] enable - The status of advertising
5993 * @param[in] interval_min - Minimum interval of advertising (msec)
5994 * @param[in] interval_max - Maximum interval of advertising (msec)
5995 * @param[in] filter_policy - Advertising filter policy
5998 * @see bluetooth_set_advertising_data
6000 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6001 bluetooth_advertising_params_t *params);
6004 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6005 * @brief Get the advertising data
6007 * This function is used to get advertising data.
6008 * Before calling this API, the adapter should be enabled.
6010 * This function is a synchronous call.
6012 * @return BLUETOOTH_ERROR_NONE - Success \n
6013 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6014 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6015 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6017 * @param[out] value - Advertising data structure.
6018 * @param[out] length - The length of Advertising data.
6022 bluetooth_advertising_data_t *value = { {0} };
6025 ret = bluetooth_get_advertising_data(&value, &length);
6028 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6031 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6033 * @brief Set advertising data with value
6035 * This function is used to set advertising data and Maximum size of advertising data
6036 * is 28 byte (Except Flag)
6038 * This function is a synchronous call.
6040 * @return BLUETOOTH_ERROR_NONE - Success \n
6041 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6042 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6045 * @param[in] value - Advertising data structure.
6049 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6052 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6054 * @brief Check the privilege for advertising parameter setting
6056 * This function is a synchronous call.
6058 * @return BLUETOOTH_ERROR_NONE - Success \n
6059 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6065 int bluetooth_check_privilege_advertising_parameter(void);
6068 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6069 * @brief Get the LE scan response data
6071 * This function is used to get scan response data.
6072 * Before calling this API, the adapter should be enabled.
6074 * This function is a synchronous call.
6076 * @return BLUETOOTH_ERROR_NONE - Success \n
6077 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6078 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6079 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6081 * @param[out] value - Scan response data structure.
6082 * @param[out] length - The length of Scan response data.
6086 bluetooth_scan_resp_data_t *value = { {0} };
6089 ret = bluetooth_get_scan_response_data(&value, &length);
6092 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6095 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6097 * @brief Set scan response data with value
6099 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6101 * This function is a synchronous call.
6103 * @return BLUETOOTH_ERROR_NONE - Success \n
6104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6105 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6108 * @param[in] value - LE Scan response data structure.
6112 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6115 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6117 * @brief Set scan interval and window
6119 * This function is used to set LE scan interval and window size
6121 * This function is a synchronous call.
6123 * @return BLUETOOTH_ERROR_NONE - Success \n
6124 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6125 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6128 * @param[in] interval - Interval of LE scan (msec)
6129 * @param[in] window - Window size of LE scan (msec)
6133 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6136 * @fn int bluetooth_is_advertising(void)
6137 * @brief Check for the advertising is in-progress or not.
6139 * This API is used to check the current status of the advertising procedure.
6140 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6143 * This function checks whether the advertising is started or not.
6145 * This function is a synchronous call.
6147 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6149 * @return BLUETOOTH_ERROR_NONE - Success \n
6150 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6153 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6157 gboolean is_advertising = 0;
6159 ret = bluetooth_is_advertising(&is_advertising);
6162 int bluetooth_is_advertising(gboolean *is_advertising);
6165 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6166 * @brief Add LE device to white list
6168 * This API is used to add LE device to white list
6169 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6173 * This function is a synchronous call.
6175 * @param[in] address The address of remote device
6177 * @return BLUETOOTH_ERROR_NONE - Success \n
6178 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6181 * @see bluetooth_set_custom_advertising
6183 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6186 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6187 * @brief Remove LE device from white list
6189 * This API is used to remove LE device from white list
6190 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6194 * This function is a synchronous call.
6196 * @param[in] address The address of remote device
6198 * @return BLUETOOTH_ERROR_NONE - Success \n
6199 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6202 * @see bluetooth_set_custom_advertising
6204 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6207 * @fn int bluetooth_clear_white_list(void)
6208 * @brief Clear white list
6210 * This API is used to clear white list
6211 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6215 * This function is a synchronous call.
6217 * @param[in] address The address of remote device
6219 * @return BLUETOOTH_ERROR_NONE - Success \n
6220 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6223 * @see bluetooth_set_custom_advertising
6225 int bluetooth_clear_white_list(void);
6228 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6229 * const bluetooth_le_connection_param_t *parameters)
6230 * @brief update connection paramter of LE connection.
6232 * This function is a synchronous call.
6234 * @return BLUETOOTH_ERROR_NONE - Success \n
6235 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6238 * @param[in] address - remote device address value.
6239 * @param[in] parameters - new connection parameters.
6242 * @see bluetooth_bond_device
6244 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6245 const bluetooth_le_connection_param_t *parameters);
6248 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6250 * @brief Enable/Disable LE Privacy feature.
6252 * This function is used to enable or disable LE Privacy feature.
6253 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6255 * This function is a synchronous call.
6257 * @return BLUETOOTH_ERROR_NONE - Success \n
6258 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6259 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6262 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6266 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6269 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6271 * @brief Enable/Disable LE static random address.
6273 * This function is used to enable or disable LE static random address.
6275 * This function is a synchronous call.
6277 * @return BLUETOOTH_ERROR_NONE - Success \n
6278 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6279 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6282 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6286 int bluetooth_set_le_static_random_address(gboolean enable);
6289 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6290 * bluetooth_le_connection_mode_t mode)
6291 * @brief update connection paramter of LE connection.
6293 * This function is a synchronous call.
6295 * @return BLUETOOTH_ERROR_NONE - Success \n
6296 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6297 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6300 * @param[in] address - remote device address value.
6301 * @param[in] mode - new connection mode.
6305 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6306 bluetooth_le_connection_mode_t mode);
6309 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6310 * @brief Request for new ATT MTU value.
6312 * This function is a asynchronous call.
6314 * @return BLUETOOTH_ERROR_NONE - Success \n
6315 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6316 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6319 * @param[in] address - remote device address value.
6320 * @param[in] mtu - MTU value to be set.
6324 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6327 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6328 * unsigned int *mtu)
6329 * @brief Gets the xisting MTU value set for a connection.
6331 * This function is a synchronous call.
6333 * @return BLUETOOTH_ERROR_NONE - Success \n
6334 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6335 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6338 * @param[in] address - remote device address value.
6339 * @param[out] mtu - MTU value set for the connection.
6343 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6347 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6348 * bluetooth_device_address_t *id_address)
6349 * @brief Gets the Identity address of remote device.
6351 * This function is a synchronous call.
6353 * @return BLUETOOTH_ERROR_NONE - Success \n
6354 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6355 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6358 * @param[in] device_rpa - remote Resolvable private address.
6359 * @param[out] id_address - remote Identity device address value.
6363 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6364 bluetooth_device_address_t *id_address);
6367 * @fn int bluetooth_le_read_maximum_data_length()
6368 * @brief reads the maximum LE data length supported in the controller.
6370 * This function is a synchronous call.
6372 * @return BLUETOOTH_ERROR_NONE - Success \n
6373 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6379 int bluetooth_le_read_maximum_data_length(
6380 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6382 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6383 * @brief writes the host suggested values for the controllers max transmitted no of payload
6384 * octects to be used for new connections.
6386 * This function is a synchronous call.
6388 * @return BLUETOOTH_ERROR_NONE - Success \n
6389 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6395 int bluetooth_le_write_host_suggested_default_data_length(
6396 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6398 int bluetooth_le_read_suggested_default_data_length(
6399 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6401 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6402 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6404 int bluetooth_pbap_init(void);
6405 int bluetooth_pbap_deinit(void);
6406 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6407 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6408 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6409 bt_pbap_folder_t *folder);
6410 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6411 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6412 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6413 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6414 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6415 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6416 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6417 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6420 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6422 * @brief Set manufacturer data with value
6424 * This function is used to set manufacturer data.
6426 * This function is a synchronous call.
6428 * @return BLUETOOTH_ERROR_NONE - Success \n
6429 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6430 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6433 * @param[in] value - Manufacturer data structure.
6437 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6439 int bluetooth_set_passkey_notification(gboolean enable);
6442 * @fn int bluetooth_dpm_is_mode_allowed(void);
6444 * @brief Checks Restriction for BT mode(BT allowed or not)
6446 * This function is a synchronous call.
6448 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6449 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6450 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6457 int bluetooth_dpm_is_mode_allowed(void);
6460 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6462 * @brief Sets Restriction for BT mode(BT allowed or not)
6464 * This function is a synchronous call.
6466 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6467 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6468 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6471 * @param[in] value - BT Allow value.
6472 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6473 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6474 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6475 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6479 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6482 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6484 * @brief Reads the Restriction for BT mode(BT allowed or not)
6486 * This function is a synchronous call.
6488 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6489 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6490 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6494 * @param[out] value - BT Allow value.
6495 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6496 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6497 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6498 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6502 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6505 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6507 * @brief Sets the Restriction for device.
6509 * This function is a synchronous call.
6511 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6512 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6513 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6516 * @param[in] value - State value.
6517 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6518 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6522 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6525 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6527 * @brief Reads the Restriction for device.
6529 * This function is a synchronous call.
6531 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6532 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6533 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6537 * @param[out] value - State value.
6538 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6539 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6543 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6546 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6548 * @brief Sets the Restriction for uuid.
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] value - State value.
6558 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6559 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6563 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6566 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6568 * @brief Reads the Restriction for uuid.
6570 * This function is a synchronous call.
6572 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6573 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6574 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6578 * @param[out] value - State value.
6579 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6580 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6584 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6587 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6589 * @brief Adds the device to blacklist.
6591 * This function is a synchronous call.
6593 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6594 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6595 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6598 * @param[in] device_address - Device address
6602 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6605 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6607 * @brief Adds the device to whitelist.
6609 * This function is a synchronous call.
6611 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6612 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6613 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6616 * @param[in] device_address - Device address
6620 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6623 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6625 * @brief Adds the Service UUIDS to blacklist.
6627 * This function is a synchronous call.
6629 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6630 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6631 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6634 * @param[in] service_uuids - profile or custom service uuids
6638 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6641 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6643 * @brief Adds the Service UUIDS to whitelist.
6645 * This function is a synchronous call.
6647 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6648 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6649 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6652 * @param[in] service_uuids - profile or custom service uuids
6656 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6659 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6661 * @brief Clears the devices from blacklist.
6663 * This function is a synchronous call.
6665 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6666 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6667 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6674 int bluetooth_dpm_clear_devices_from_blacklist(void);
6677 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6679 * @brief Clears the devices from whitelist.
6681 * This function is a synchronous call.
6683 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6684 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6685 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6692 int bluetooth_dpm_clear_devices_from_whitelist(void);
6695 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6697 * @brief Clears the uuids from blacklist.
6699 * This function is a synchronous call.
6701 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6702 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6703 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6710 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6713 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6715 * @brief Clears the uuids from whitelist.
6717 * This function is a synchronous call.
6719 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6720 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6721 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6728 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6731 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6733 * @brief reads the devices from blacklist.
6735 * This function is a synchronous call.
6737 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6738 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6739 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6742 * @param[out] device_list - list of devices
6746 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6749 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6751 * @brief reads the devices from whitelist.
6753 * This function is a synchronous call.
6755 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6756 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6757 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6760 * @param[out] device_list - list of devices
6764 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6767 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6769 * @brief reads the uuids from blacklist.
6771 * This function is a synchronous call.
6773 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6774 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6775 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6778 * @param[in] uuid_list - list of uuids
6782 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6785 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6787 * @brief reads the uuids from whitelist.
6789 * This function is a synchronous call.
6791 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6792 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6793 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6796 * @param[in] uuid_list - list of uuids
6800 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6803 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6805 * @brief Removes the device from whitelist.
6807 * This function is a synchronous call.
6809 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6810 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6811 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6814 * @param[in] device_address - Device address
6818 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6821 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6823 * @brief Removes the device from blacklist.
6825 * This function is a synchronous call.
6827 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6828 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6829 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6832 * @param[in] device_address - Device address
6836 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6839 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6841 * @brief Removes the Service UUIDS from whitelist.
6843 * This function is a synchronous call.
6845 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6846 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6847 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6850 * @param[in] service_uuids - profile or custom service uuids
6854 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6857 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6859 * @brief Removes the Service UUIDS from blacklist.
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] service_uuids - profile or custom service uuids
6872 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6875 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6877 * @brief Sets the Restriction for outgoing call.
6879 * This function is a synchronous call.
6881 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6882 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6883 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6886 * @param[in] value - State value.
6887 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6888 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6892 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6895 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6897 * @brief Reads the Restriction for outgoing call.
6899 * This function is a synchronous call.
6901 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6902 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6903 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6907 * @param[out] value - State value.
6908 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6909 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6913 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6916 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6918 * @brief Sets the Restriction for Pairing.
6920 * This function is a synchronous call.
6922 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6923 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6924 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6927 * @param[in] value - State value.
6928 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6929 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6933 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6936 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6938 * @brief Reads the Restriction for Pairing
6940 * This function is a synchronous call.
6942 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6943 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6944 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6948 * @param[out] value - State value.
6949 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6950 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6954 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6957 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6959 * @brief Sets the Restriction for using Profiles.
6961 * This function is a synchronous call.
6963 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6964 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6965 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6968 * @param[in]profile - Profile.
6969 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6970 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6971 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6972 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6973 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6974 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6975 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6976 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6977 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6978 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6979 * BLUETOOTH_DPM_PROFILE_NONE
6980 * @param[in] value - State value.
6981 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6982 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6986 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6989 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6991 * @brief Reads the Restriction for using Profiles.
6993 * This function is a synchronous call.
6995 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6996 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6997 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7000 * @param[in]profile - Profile.
7001 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7002 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7003 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7004 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7005 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7006 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7007 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7008 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7009 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7010 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7011 * BLUETOOTH_DPM_PROFILE_NONE
7012 * @param[out] value - State value.
7013 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7014 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7018 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7021 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7023 * @brief Sets the Restriction for Desktop Connectivity.
7025 * This function is a synchronous call.
7027 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7028 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7029 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7032 * @param[in] value - State value.
7033 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7034 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7038 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7041 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7043 * @brief Reads the Restriction for Desktop Connectivity.
7045 * This function is a synchronous call.
7047 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7048 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7049 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7053 * @param[out] value - State value.
7054 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7055 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7059 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7062 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7064 * @brief Sets the Restriction for Discoverable state.
7066 * This function is a synchronous call.
7068 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7069 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7070 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7073 * @param[in] value - State value.
7074 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7075 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7079 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7082 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7084 * @brief Reads the Restriction for Discoverable state.
7086 * This function is a synchronous call.
7088 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7089 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7090 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7094 * @param[out] value - State value.
7095 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7096 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7100 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7103 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7105 * @brief Sets the Restriction for linited discoverable state..
7107 * This function is a synchronous call.
7109 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7110 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7111 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7114 * @param[in] value - State value.
7115 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7116 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7120 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7123 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7125 * @brief Reads the Restriction for limited discoverable state.
7127 * This function is a synchronous call.
7129 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7130 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7131 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7135 * @param[out] value - State value.
7136 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7137 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7141 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7143 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7145 * @brief Sets the Restriction for Data trasnfer.
7147 * This function is a synchronous call.
7149 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7150 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7151 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7154 * @param[in] value - State value.
7155 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7156 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7160 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7164 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7166 * @brief Reads the Restriction for Data trasnfer.
7168 * This function is a synchronous call.
7170 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7171 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7172 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7176 * @param[out] value - State value.
7177 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7178 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7182 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7185 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7186 * bluetooth_pxp_poperty_t property, int value);
7188 * @brief Sets the Proximity alert level/properties for monitor role.
7190 * This function is a synchronous call.
7192 * @return BLUETOOTH_ERROR_NONE - Success \n
7193 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7194 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7195 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7198 * @param[in] device_address remote device address
7199 * @param[in] property proximity profile property
7200 * @param[in] value alert level/property value to be set
7205 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7206 bluetooth_pxp_poperty_t property, int value);
7209 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7210 * bluetooth_pxp_poperty_t property, int *value);
7212 * @brief Reads the Proximity alert level/properties for monitor role.
7214 * This function is a synchronous call.
7216 * @return BLUETOOTH_ERROR_NONE - Success \n
7217 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7218 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7219 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7222 * @param[in] device_address remote device address
7223 * @param[in] property proximity profile property
7224 * @param[out] value alert level/property value
7228 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7229 bluetooth_pxp_poperty_t property, int *value);
7232 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7233 * int *services_supported);
7235 * @brief Reads the Proximity Monitor profile supported properties/services.
7237 * This function is a synchronous call.
7239 * @return BLUETOOTH_ERROR_NONE - Success \n
7240 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7241 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7242 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7245 * @param[in] device_address remote device address
7246 * @param[out] services_supported proximity profile property/service
7250 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7251 int *services_supported);
7254 * @fn int bluetooth_proximity_reporter_register();
7256 * @brief Register all proximity related services in BlueZ.
7258 * This function is a synchronous call.
7260 * @return BLUETOOTH_ERROR_NONE - Success \n
7261 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7267 int bluetooth_proximity_reporter_register(void);
7270 * @fn int bluetooth_proximity_reporter_unregister();
7272 * @brief Unregister all proximity related services in BlueZ.
7274 * This function is a synchronous call.
7276 * @return BLUETOOTH_ERROR_NONE - Success \n
7277 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7283 int bluetooth_proximity_reporter_unregister(void);
7286 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7287 * bluetooth_pxp_poperty_t property, int *value);
7289 * @brief Reads the Proximity alert level/properties for reporter role.
7291 * This function is a synchronous call.
7293 * @return BLUETOOTH_ERROR_NONE - Success \n
7294 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7295 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7296 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7299 * @param[in] device_address remote device address
7300 * @param[in] property proximity profile property
7301 * @param[out] value alert level/property value
7305 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7306 bluetooth_pxp_poperty_t property, int *value);
7309 * @fn int bluetooth_tds_provider_register(void);
7311 * @brief Register Transport Discovery Provider role.
7313 * This function is a synchronous call.
7315 * @return BLUETOOTH_ERROR_NONE - Success \n
7316 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7317 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7318 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7326 int bluetooth_tds_provider_register(void);
7329 * @fn int bluetooth_tds_provider_unregister(void);
7331 * @brief Unregister Transport Discovery Provider role.
7333 * This function is a synchronous call.
7335 * @return BLUETOOTH_ERROR_NONE - Success \n
7336 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7337 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7338 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7346 int bluetooth_tds_provider_unregister(void);
7349 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7351 * @brief Create Transport Discovery Provider for a transport.
7353 * This function is a synchronous call.
7355 * @return BLUETOOTH_ERROR_NONE - Success \n
7356 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7357 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7358 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7361 * @param[in] Transport (BT, CUSTOM etc.)
7362 * @param[in] Unique handle for TDS provider.
7367 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7370 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7372 * @brief Remove previously created Transport Discovery Provider.
7374 * This function is a synchronous call.
7376 * @return BLUETOOTH_ERROR_NONE - Success \n
7377 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7380 * @param[in] Unique handle for previously created provider.
7385 int bluetooth_tds_provider_destroy(unsigned int handle);
7388 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7390 * @brief Set transport block for in advertisement and gatt db.
7392 * This function is a synchronous call.
7394 * @return BLUETOOTH_ERROR_NONE - Success \n
7395 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7396 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7397 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7400 * @param[in] Provider specific manufacturer data.
7401 * @param[in] Provider specific manufacturer data length.
7406 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7409 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7410 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7412 * @brief Set transport block for in advertisement and gatt db.
7414 * This function is a synchronous call.
7416 * @return BLUETOOTH_ERROR_NONE - Success \n
7417 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7418 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7419 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7422 * @param[in] Unique handle for TDS provider.
7423 * @param[in] Transport state (On/Off/Not Available).
7424 * @param[in] Transport specific data block.
7425 * @param[in] Transport specific data block length.
7430 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7431 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7434 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7435 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7437 * @brief Send response to TDS activation request from remoted device.
7439 * This function is a synchronous call.
7441 * @return BLUETOOTH_ERROR_NONE - Success \n
7442 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7443 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7444 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7447 * @param[in] Remote device BT address.
7448 * @param[in] Unique handle for TDS provider.
7449 * @param[in] Response for TDS activation request.
7450 * @param[in] Transport specific data block to be sent in activation response.
7451 * @param[in] Data block length.
7456 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7457 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7460 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7462 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7464 * This function is an asynchronous call.
7466 * @return BLUETOOTH_ERROR_NONE - Success \n
7467 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7468 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7469 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7470 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7473 * @param[in] device_address remote device address
7474 * @param[in] handle attribute handle
7476 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7477 * when TDS data is received from Remote provider
7479 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7480 const char *handle);
7483 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7485 * @brief Enables CCCD on Remote Provider.
7487 * This function is an asynchronous call.
7489 * @return BLUETOOTH_ERROR_NONE - Success \n
7490 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7491 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7492 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7493 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7496 * @param[in] device_address remote device address
7497 * @param[in] handle attribute handle
7499 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7500 * when Indication is enabled on Remote provider
7502 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7503 const char *handle);
7506 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7507 * unsigned char *buf, int length);
7508 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7510 * This function is an asynchronous call.
7512 * @return BLUETOOTH_ERROR_NONE - Success \n
7513 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7514 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7515 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7516 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7519 * @param[in] device_address remote device address
7520 * @param[in] handle attribute handle
7521 * @param[in] buf Control point activation param
7522 * @param[in] param length
7524 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7525 * is received from remote Provider
7527 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7528 unsigned char *buf, int length);
7531 * @fn int bluetooth_otp_server_init(const char *directory);
7533 * @brief Starts OTP server.
7535 * This function is a synchronous call.
7545 int bluetooth_otp_server_init(const char *directory);
7548 * @fn int bluetooth_otp_server_deinit();
7550 * @brief Stops OTP server.
7552 * This function is a synchronous call.
7562 int bluetooth_otp_server_deinit();
7570 #endif /* __cplusplus */
7571 #endif /* _BLUETOOTH_API_H_*/