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 18 /**< 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_LE_OOB_DATA_LENGTH 100
61 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
63 #ifdef TIZEN_GATT_CLIENT
64 #define BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX 610 /**< GATT ATT value max len */
68 * This is Bluetooth Connected event role
70 #define RFCOMM_ROLE_SERVER 1
71 #define RFCOMM_ROLE_CLIENT 2
74 * This is RFCOMM default Channel Value
76 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
79 * This is maximum length for search value string for PBAP Phonebook Search
81 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
84 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
87 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
88 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
91 * < This defines the maximum size of OTP server directory name
93 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
95 #define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH 500 /**< OTP Characteristics Value Max length */
98 * This is Bluetooth error code
100 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
102 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
103 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
105 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
106 /**< Callback error */
107 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
108 /**< invalid paramerror */
109 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
110 /**< invalid data error */
111 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
112 /**< Memory allocation error */
113 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
114 /**< out of memory error */
115 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
116 /**< timeout error */
117 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
118 /**< No resource error */
119 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
120 /**< internal error */
121 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
122 /**< Not supported error */
123 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
124 /**< Operation is failed because
125 of not enabled BT Adapter */
126 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
127 /**< Enabling is failed because of
128 already enabled BT Adapter */
129 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
130 /**< Operation is failed because of
131 other on going operation */
132 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
133 /**< access denied error */
134 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
135 /**< max client error */
136 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
137 /**< not found error */
138 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
139 /**< service search fail */
140 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
141 /**< pairing failed error */
142 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
143 /**< Not paired error */
144 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
145 /**< no service error */
146 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
147 /**< no connection error */
148 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
149 /**< alread connected error */
150 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
151 /**< connection busy error */
152 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
153 /**< connection error */
154 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
155 /**< max connection error*/
156 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
157 /**< Not in operation */
158 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
159 /**< Cancelled by user */
160 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
161 /**< Service record registration failed */
162 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
163 /**< Operation in progress */
164 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
165 /**< authentication failed error when paring*/
166 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
167 /**< Remote host is down */
168 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
169 /**< End of device list */
171 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
172 /**< Obex agent already exists */
173 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
174 /**< Obex agent does not exist */
176 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
177 /**< Already initialized */
179 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
180 /**< Permission deined */
182 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
183 /**< Nap already done */
185 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
186 /**< Not initialized */
188 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
189 /**< Authentication rejected */
191 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
192 /**< Device Policy Restricted */
194 #define BLUETOOTH_ERROR_NO_DATA ((int)BLUETOOTH_ERROR_BASE - 0x29)
197 #define BLUETOOTH_ERROR_AUTHORIZATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x2a)
198 /**< Authorization rejected */
201 * Error codes for ATT Error response *
203 #define BLUETOOTH_ATT_ERROR_INTERNAL -1
204 #define BLUETOOTH_ATT_ERROR_NONE 0x00
205 #define BLUETOOTH_ATT_ERROR_INVALID_HANDLE 0x01
206 #define BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED 0x02
207 #define BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED 0x03
208 #define BLUETOOTH_ATT_ERROR_INVALID_PDU 0x04
209 #define BLUETOOTH_ATT_ERROR_AUTHENTICATION 0x05
210 #define BLUETOOTH_ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06
211 #define BLUETOOTH_ATT_ERROR_INVALID_OFFSET 0x07
212 #define BLUETOOTH_ATT_ERROR_AUTHORIZATION 0x08
213 #define BLUETOOTH_ATT_ERROR_PREPARE_QUEUE_FULL 0x09
214 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0A
215 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0B
216 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0C
217 #define BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN 0x0D
218 #define BLUETOOTH_ATT_ERROR_UNLIKELY 0x0E
219 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0F
220 #define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10
221 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
222 /* Common profile error codes */
223 #define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED 0xFC
224 #define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED 0xFD
225 #define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS 0xFE
226 #define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE 0xFF
229 * Bluetooth ATT error codes specific to OTP
231 #define BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED 0x80
232 #define BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED 0x81
233 #define BLUETOOTH_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
234 #define BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS 0x83
237 * Bluetooth OTP error codes
238 * TODO: Check error code conflict
240 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
241 #define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
244 * Device disconnection reasons; received from stack
246 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
247 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
248 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
249 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
250 #define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e
251 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
252 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
253 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
254 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
255 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
256 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
257 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
258 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
259 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
260 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
261 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
264 * Device disconnect reason
267 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
268 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
269 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
270 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
271 } bluetooth_device_disconnect_reason_t;
274 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
277 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
278 } bluetooth_device_address_t;
281 * This is Bluetooth device address type
284 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
285 BLUETOOTH_DEVICE_RANDOM_ADDRESS
286 } bluetooth_device_address_type_t;
289 * This is BD Address type defined in kernel BT header
292 BLUETOOTH_BDADDR_BREDR = 0x00,
293 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
294 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
295 } bluetooth_bdaddr_type_e;
298 * This is Bluetooth version
301 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
302 } bluetooth_version_t;
305 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
308 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
309 } bluetooth_device_name_t;
312 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
315 int data_len; /**< manafacturer specific data length */
316 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
317 } bluetooth_manufacturer_data_t;
320 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
321 } bluetooth_device_pin_code_t;
327 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
328 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
329 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
330 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
331 } bluetooth_adapter_state_t;
337 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
338 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
339 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
340 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
341 } bluetooth_adapter_le_state_t;
347 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
348 /*Changed the order to make it compatable with old method */
349 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
350 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
351 /**< Discoverable mode with time limit
352 After specific timeout, it is changed
353 to non discoverable mode */
354 } bluetooth_discoverable_mode_t;
357 * Network connect mode
360 BLUETOOTH_NETWORK_PANU_ROLE,
362 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
363 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
364 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
365 } bluetooth_network_role_t;
369 * Service type matched to bt_profile_type_t of bt-service-common.h
372 BLUETOOTH_RFCOMM_SERVICE = 0x01,
373 BLUETOOTH_A2DP_SERVICE = 0x02,
374 BLUETOOTH_HSP_SERVICE = 0x04,
375 BLUETOOTH_HID_SERVICE = 0x08,
376 BLUETOOTH_NAP_SERVICE = 0x10,
377 BLUETOOTH_HFG_SERVICE = 0x20,
378 BLUETOOTH_GATT_SERVICE = 0x40,
379 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
380 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
381 BLUETOOTH_PBAP_SERVICE = 0x200,
382 } bluetooth_service_type_t;
388 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
389 /* represents that connection
390 * type can both BR/EDR and LE */
391 BLUETOOTH_DEV_CONN_BREDR = 0x00,
392 BLUETOOTH_DEV_CONN_LE = 0x01,
393 } bluetooth_conn_type_t;
399 BLUETOOTH_CODEC_ID_CVSD = 0x01,
400 BLUETOOTH_CODEC_ID_MSBC = 0x02,
401 } bluetooth_codec_type_t;
407 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
408 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
409 } bluetooth_hf_audio_connected_type_t;
415 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
416 } bluetooth_advertising_data_t;
422 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
423 } bluetooth_scan_resp_data_t;
426 * Advertising filter policy
429 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
430 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
431 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
432 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
433 } bluetooth_advertising_filter_policy_t;
439 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
440 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
441 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
442 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
443 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
444 } bluetooth_advertising_type_t;
447 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
448 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
449 } bluetooth_gatt_service_change_type_t;
452 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
453 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
454 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
455 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
456 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
457 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
458 } bt_gatt_permission_t;
461 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
462 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
463 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
464 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
465 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
466 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
467 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
468 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
469 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
470 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
471 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
472 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
473 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
474 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
475 } bt_gatt_characteristic_property_t;
478 * Remote device request types for attributes
481 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
482 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
483 } bluetooth_gatt_att_request_tyep_t;
486 * Proximity Property Type
489 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
490 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
491 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
492 } bluetooth_pxp_poperty_t;
498 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
499 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
501 BLUETOOTH_TDS_TRANSPORT_INVALID
502 } bluetooth_tds_transport_t;
505 * TDS transport state
508 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
509 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
510 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
511 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
512 } bluetooth_tds_transport_state_t;
519 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
520 } bluetooth_tds_data_t;
523 * TDS activation request
526 bluetooth_device_address_t rem_addr;
527 bluetooth_tds_transport_t transport;
528 bluetooth_tds_data_t tds_data;
529 } bluetooth_tds_activation_req_t;
532 * TDS Control Point data
535 int length; /**< Control point data length */
536 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
537 } bluetooth_control_point_data_t;
540 * TDS Indication Response data
543 bluetooth_device_address_t rem_addr; /**< Device address */
544 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
545 } bluetooth_tds_indication_res_t;
548 * Structure to hold the TDS Complete data information which is read from remote TDS provider
551 bluetooth_device_address_t device_address; /**< Device address */
552 int data_length; /**< Data length */
553 char *data; /**< Complete Transport Specific data */
554 } bluetooth_tds_transport_data_info_t;
557 * OTP Characteristics Value
560 int length; /**< Characteristics value length */
561 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
562 } bluetooth_otp_charc_data_t;
565 * Structure to hold the OTP response data from remote OTP server
568 char *handle; /**< Handle */
569 int data_length; /**< Data length */
570 char *data; /**< Read data */
571 } bluetooth_otp_resp_info_t;
574 * Structure to hold the OTC Channel Info
577 gboolean connected; /**< Connection Status */
579 char *address; /**< Remote address */
580 } bluetooth_otc_info_t;
583 * Advertising parameters
588 guint8 filter_policy;
591 } bluetooth_advertising_params_t;
597 int type; /**< passive 0, active 1 */
598 float interval; /**< LE scan interval */
599 float window; /**< LE scan window */
600 } bluetooth_le_scan_params_t;
606 BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
607 BLUETOOTH_LE_ACTIVE_SCAN
608 } bluetooth_le_scan_type_t;
618 } bluetooth_le_connection_param_t;
621 LE Read Maximum Data Length
624 guint16 max_tx_octets;
626 guint16 max_rx_octets;
628 } bluetooth_le_read_maximum_data_length_t;
631 LE Read Host suggested default Data Length
634 guint16 def_tx_octets;
636 } bluetooth_le_read_host_suggested_data_length_t;
639 * Samsung XSAT Vendor dependent command
644 } bluetooth_vendor_dep_at_cmd_t;
650 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
651 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
652 } bluetooth_opp_transfer_type_t;
657 } bluetooth_hf_ciev_device_event_t;
659 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
660 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
661 /**< Base ID for GAP Event */
662 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
663 /**< Base ID for SDP events */
664 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
665 /**< Base ID for RFCOMM events */
666 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
667 /**< Base ID for NETWORK events */
668 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
669 /**< Base ID for HDP events */
670 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
671 /**< Base ID for OPC events */
672 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
673 /**< Base ID for Obex Server events */
674 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
675 /**< Base ID for GATT events */
677 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
678 /**< Base ID for Audio events */
679 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
680 /**< Base ID for HID events */
681 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
682 /**< Base ID for Advertising events */
683 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
684 /**< Base ID for PBAP Client events */
685 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
686 /**< Base ID for AVRCP events */
687 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
688 /**< Base ID for IPSP events */
689 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
690 /**< Base ID for MAP events */
693 * Bluetooth event type
696 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
698 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
699 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
700 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
701 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
702 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
703 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
704 /**< Bluetooth event Discoverable timeout requested*/
705 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
706 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
707 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
708 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
709 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
710 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
711 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
712 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
713 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
714 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
715 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
716 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
717 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
718 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
719 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
720 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
721 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
722 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
723 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
724 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
725 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
727 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
728 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
729 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
730 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
731 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
733 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
734 /**< Bluetooth event serice search base id */
735 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
736 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
737 /**< RFCOMM data receive event */
738 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
739 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
741 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
743 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
744 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
746 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
748 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
749 /**< Bluetooth Network event */
750 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
751 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
752 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
753 /**< Network disconnected evnet in server */
755 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
756 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
758 BLUETOOTH_EVENT_HDP_CONNECTED
759 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
760 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
761 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
763 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
764 /* OPC Connected event */
765 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
766 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
767 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
768 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
770 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
771 BLUETOOTH_EVENT_MAP_DISCONNECTED,
773 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
774 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
775 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
776 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
777 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
779 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
780 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
781 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
782 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
783 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
784 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
785 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
786 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
787 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
788 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
789 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
790 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
791 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
793 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
794 /* Obex server authorize event*/
795 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
796 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
797 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
798 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
799 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
800 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
802 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
803 /**<Discovered GATT service characteristics event*/
804 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
805 /**<Remote GATT charateristic value changed event*/
806 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
807 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
808 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
809 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
810 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
811 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
812 #ifdef TIZEN_GATT_CLIENT
813 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
814 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
815 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
816 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
818 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
819 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
821 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
822 BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
823 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
824 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
825 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
826 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
827 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
828 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
829 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
830 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
831 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
832 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
833 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
834 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
835 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
836 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
837 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
838 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
839 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
840 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
841 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
842 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
843 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
844 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
845 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
846 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
847 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
848 BLUETOOTH_EVENT_HF_CONNECTED,
849 BLUETOOTH_EVENT_HF_DISCONNECTED,
850 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
851 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
852 BLUETOOTH_EVENT_HF_RING_INDICATOR,
853 BLUETOOTH_EVENT_HF_CALL_WAITING,
854 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
855 BLUETOOTH_EVENT_HF_CALL_STARTED,
856 BLUETOOTH_EVENT_HF_CALL_ENDED,
857 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
858 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
859 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
860 BLUETOOTH_EVENT_HF_CALL_STATUS,
861 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
862 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
863 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
864 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
865 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
866 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
867 BLUETOOTH_EVENT_HF_CALL_IDLE,
868 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
869 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
870 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
872 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
873 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
874 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
875 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
876 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
878 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
879 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
880 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
881 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
882 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
883 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
884 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
885 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
887 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
888 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
889 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
890 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
891 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
892 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
893 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
895 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
896 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
897 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
898 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
899 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
900 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
901 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
902 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
903 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
905 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
906 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
907 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
908 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
909 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
910 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
911 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
912 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
913 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
914 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
915 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
917 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
918 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
919 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
920 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
921 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
922 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
923 } bluetooth_event_type_t;
926 * This bt_service_uuid_list_t enum indicates service uuid list .
927 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
931 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
932 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
933 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
934 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
935 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
936 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
937 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
938 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
939 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
940 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
941 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
942 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
943 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
945 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
946 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
947 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
948 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
949 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
950 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
951 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
952 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
953 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
954 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
955 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
956 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
957 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
958 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
960 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
961 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
962 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
963 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
964 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
965 /**<DIRECT PRINTING*/
966 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
967 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
968 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
969 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
970 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
971 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
972 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
973 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
974 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
975 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
976 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
977 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
978 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
979 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
980 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
981 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
982 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
983 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
984 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
985 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
986 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
987 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
988 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
989 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
990 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
991 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
992 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
993 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
994 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
995 } bluetooth_service_uuid_list_t;
998 * Service class part of class of device returned from device discovery
1001 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1002 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1003 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1004 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1005 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1006 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1007 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1008 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1009 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1010 } bluetooth_device_service_class_t;
1014 * Major device mask (For device discovery)
1017 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1018 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1019 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1020 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1021 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1022 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1023 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1024 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1025 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1026 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1027 } bluetooth_device_major_mask_t;
1031 * Major device class (part of Class of Device)
1034 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1035 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1036 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1037 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1038 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1039 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1040 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1041 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1042 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1043 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1044 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1045 } bluetooth_device_major_class_t;
1048 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1050 /* About Computer Major class */
1051 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1053 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1054 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1055 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1056 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1057 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1059 /* About Phone Major class */
1060 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1061 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1062 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1063 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1064 /**< voice gateway minor class */
1065 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1067 /* About LAN/Network Access Point Major class */
1068 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1069 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1070 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1071 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1072 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1073 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1074 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1075 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1077 /* About Audio/Video Major class */
1078 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1079 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1081 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1082 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1083 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1084 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1085 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1086 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1087 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1088 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1089 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1090 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1091 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1092 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1093 /**< Video Display and Loud
1094 Speaker minor class */
1095 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1098 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1100 /* About Peripheral Major class */
1101 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1102 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1103 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1104 /**< Combo Keyboard or pointing
1105 device minorclass */
1107 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1108 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1109 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1110 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1111 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1112 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1113 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1114 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1115 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1117 /* About Imaging Major class */
1118 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1119 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1120 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1121 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1123 /* About Wearable Major class */
1124 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1125 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1126 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1127 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1128 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1130 /* About Toy Major class */
1131 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1132 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1133 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1134 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1135 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1137 /* About Health Major class */
1138 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1139 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1140 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1141 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1142 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1143 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1144 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1145 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1146 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1147 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1149 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1150 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1151 } bluetooth_device_minor_class_t;
1154 * structure to hold the device information
1157 bluetooth_device_major_class_t major_class; /**< major device class */
1158 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1159 bluetooth_device_service_class_t service_class;
1160 /**< service device class */
1161 } bluetooth_device_class_t;
1164 * Discovery Role types
1167 DISCOVERY_ROLE_BREDR = 0x1,
1169 DISCOVERY_ROLE_LE_BREDR
1170 } bt_discovery_role_type_t;
1173 * Connected state types
1176 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1177 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1178 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1179 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1180 } bluetooth_connected_link_t;
1186 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1187 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1188 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1189 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1190 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1191 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1192 } bluetooth_le_scan_filter_feature_t;
1195 * LE connection mode
1198 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1199 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1200 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1201 } bluetooth_le_connection_mode_t;
1204 * structure to hold the device information
1207 bluetooth_device_address_t device_address; /**< device address */
1208 bluetooth_device_name_t device_name; /**< device name */
1209 bluetooth_device_class_t device_class; /**< device class */
1210 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1211 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1213 int rssi; /**< received strength signal*/
1214 gboolean paired; /**< paired flag */
1215 bluetooth_connected_link_t connected; /**< connected link type */
1216 gboolean trust; /**< trust flag */
1217 gboolean is_alias_set; /** is device alias set flag**/
1218 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1219 } bluetooth_device_info_t;
1222 * structure to hold the LE device information
1225 int data_len; /**< manafacturer specific data length */
1226 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1227 } bluetooth_le_advertising_data_t;
1230 bluetooth_device_address_t device_address; /**< device address */
1231 int addr_type; /**< address type*/
1232 int rssi; /**< received strength signal*/
1233 bluetooth_le_advertising_data_t adv_ind_data;
1234 bluetooth_le_advertising_data_t scan_resp_data;
1235 } bluetooth_le_device_info_t;
1239 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1240 bluetooth_device_address_t device_address; /**< device address */
1241 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1242 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1243 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1244 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1245 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1246 bluetooth_le_advertising_data_t service_data; /**< service data */
1247 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1248 int manufacturer_id; /**< manufacturer ID */
1249 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1250 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1251 } bluetooth_le_scan_filter_t;
1254 bluetooth_device_address_t device_address; /**< device address */
1255 unsigned int mtu; /** < MTU set for the ATT connection */
1256 unsigned int status; /** < status of the MTU exchange */
1257 } bluetooth_le_att_mtu_info_t;
1260 * structure to hold the paired device information
1263 bluetooth_device_address_t device_address; /**< paired device address */
1264 bluetooth_device_name_t device_name; /**< device name */
1265 bluetooth_device_class_t device_class; /**< device class */
1266 } bluetooth_paired_device_info_t;
1269 * structure to hold the paired device information
1272 bluetooth_device_address_t device_address;
1273 /**< device address */
1274 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1275 /**< network interface name */
1276 } bluetooth_network_device_info_t;
1279 * Authentication event types
1283 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1284 BLUETOOTH_AUTH_PIN_REQUEST,
1285 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1286 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1287 } bluetooth_auth_type_t;
1290 * structure to hold the pincode/pass-key req informations
1293 bluetooth_device_address_t device_address; /**< remote device address */
1294 bluetooth_device_name_t device_name; /**< device name */
1295 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1296 bool incoming; /**< stores if bonding request is incoming */
1297 } bluetooth_authentication_request_info_t;
1300 * Stucture to hold discovery option
1303 unsigned short max_response; /**< the number of maximum response */
1304 unsigned short discovery_duration;
1305 /**< duration of discovery (seconds) */
1306 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1307 classOfDevice variable */
1308 } bluetooth_discovery_option_t;
1311 * Stucture to hold event information
1314 int event; /**< event type */
1315 int result; /**< Success or error value */
1317 /**<parameter data pointer */
1319 } bluetooth_event_param_t;
1322 bluetooth_device_address_t device_addr;
1323 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1324 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1325 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1330 bluetooth_device_address_t device_addr;
1331 unsigned char addr_type;
1333 } bt_connection_info_t;
1336 * Stucture to rfcomm receive data
1341 /**< the socket fd */
1342 int buffer_size;/**< the length of the receive buffer */
1344 /**< the receive data buffer */
1345 } bluetooth_rfcomm_received_data_t;
1351 HTYPE_TRANS_HANDSHAKE,
1352 HTYPE_TRANS_HID_CONTROL,
1353 HTYPE_TRANS_GET_REPORT,
1354 HTYPE_TRANS_SET_REPORT,
1355 HTYPE_TRANS_GET_PROTOCOL,
1356 HTYPE_TRANS_SET_PROTOCOL,
1358 HTYPE_TRANS_UNKNOWN,
1359 HTYPE_TRANS_GET_IDLE = 0xF0,
1360 HTYPE_TRANS_SET_IDLE = 0xF1,
1361 } bt_hid_header_type_t;
1367 PTYPE_DATA_RTYPE_INPUT,
1368 PTYPE_DATA_RTYPE_OUTPUT
1369 } bt_hid_param_type_t;
1372 * Stucture to hid receive data
1375 const char *address;
1376 bt_hid_header_type_t type;
1377 /**< Header type containing */
1378 bt_hid_param_type_t param;
1379 /**< Param type in header like INPUT Report or OutPut Report */
1380 int buffer_size;/**< the length of the receive buffer */
1382 /**< the receive data buffer */
1383 } bluetooth_hid_received_data_t;
1386 * Stucture to rfcomm connection
1390 int socket_fd; /**< the socket fd */
1391 int server_id; /* Server id */
1392 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1393 bluetooth_device_address_t device_addr;
1394 /**< device address */
1395 char uuid[BLUETOOTH_UUID_STRING_MAX];
1396 } bluetooth_rfcomm_connection_t;
1399 * Stucture to rfcomm disconnection
1403 /**< the socket fd */
1404 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1405 bluetooth_device_address_t device_addr;
1406 /**< device address */
1407 char uuid[BLUETOOTH_UUID_STRING_MAX];
1408 } bluetooth_rfcomm_disconnection_t;
1412 /**< the socket fd */
1413 bluetooth_device_address_t device_addr;
1414 /**< device address */
1415 } bluetooth_rfcomm_connection_request_t;
1424 } bt_hdp_qos_type_t;
1430 HDP_ROLE_SOURCE = 0x0,
1432 } bt_hdp_role_type_t;
1436 * Stucture to HDP connected
1439 const char *app_handle; /**< the application handle */
1440 unsigned int channel_id; /**< the channel id */
1441 bt_hdp_qos_type_t type; /**< the QOS type */
1442 bluetooth_device_address_t device_address; /**< the remote address */
1443 } bt_hdp_connected_t;
1446 * Stucture to HDP disconnected
1449 unsigned int channel_id; /**< the channel id */
1450 bluetooth_device_address_t device_address; /**< the remote address */
1451 } bt_hdp_disconnected_t;
1454 * Stucture to HDP data indication
1457 unsigned int channel_id; /**< the channel id */
1458 const char *buffer; /**< the RX data buffer */
1459 unsigned int size; /**< the RX data size */
1460 } bt_hdp_data_ind_t;
1463 * Stucture to OPP client transfer information
1470 } bt_opc_transfer_info_t;
1472 /* TODO: MAP client structures, see above */
1474 * Stucture to Map filter fields
1479 } bt_map_list_filter_fields_info_t;
1481 /* Obex Server transfer type */
1482 #define TRANSFER_PUT "PUT"
1483 #define TRANSFER_GET "GET"
1485 * Stucture to OPP/FTP Server authorize information
1492 } bt_obex_server_authorize_into_t;
1500 } bt_obex_server_type_t;
1503 * Stucture to OPP/FTP server transfer information
1511 unsigned long file_size;
1513 bt_obex_server_type_t server_type;
1515 unsigned char *contact_auth_info;
1516 } bt_obex_server_transfer_info_t;
1519 * Stucture to OPP/FTP server connection/disconnection information
1525 } bt_obex_server_connection_info_t;
1529 * Stucture to OOB data
1533 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1534 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1535 unsigned int hash_len;
1536 unsigned int randomizer_len;
1538 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1539 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1540 unsigned int hash256_len;
1541 unsigned int randomizer256_len;
1543 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1544 unsigned int eir_len;
1548 * Structure to GATT attribute handle data
1554 #ifdef TIZEN_GATT_CLIENT
1555 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1556 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1558 } bt_gatt_handle_info_t;
1560 #ifdef TIZEN_GATT_CLIENT
1562 * Structure to a most basic GATT attribute handle data
1566 unsigned char uuid[16];
1567 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1568 } bt_gatt_handle_property_t;
1572 * Structure to GATT Remote service data
1579 bt_gatt_handle_info_t include_handles;
1580 bt_gatt_handle_info_t char_handle;
1581 #ifdef TIZEN_GATT_CLIENT
1582 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1584 } bt_gatt_service_property_t;
1587 * Structure to GATT Remote characteristic data
1591 char *service_handle;
1592 bt_gatt_handle_info_t handle_info;
1593 } bt_gatt_discovered_char_t;
1596 * Structure to format of GATT Characteristic Value
1600 unsigned char format;
1601 unsigned char exponent;
1602 unsigned short unit;
1603 unsigned char name_space;
1604 unsigned short description;
1605 } bt_gatt_char_format_t;
1608 * Structure to GATT Characteristic property
1616 bt_gatt_char_format_t format;
1618 unsigned int val_len;
1619 unsigned int permission;
1620 char *representation;
1621 bt_gatt_handle_info_t char_desc_handle;
1622 #ifdef TIZEN_GATT_CLIENT
1623 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1624 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1625 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1626 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1628 } bt_gatt_char_property_t;
1631 * Structure to GATT Characteristic descriptor property
1638 unsigned int val_len;
1639 #ifdef TIZEN_GATT_CLIENT
1640 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1641 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1642 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1643 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1644 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1646 } bt_gatt_char_descriptor_property_t;
1649 * Structure to GATT Characteristic value
1656 } bt_gatt_char_value_t;
1659 unsigned char UUID[16];
1663 } bt_gatt_notify_req_t ;
1666 * Structure to GATT Read Request
1670 char *service_handle;
1674 } bt_gatt_read_req_t;
1677 * Structure to GATT Value change
1681 char *service_handle;
1684 gboolean response_needed;
1688 } bt_gatt_value_change_t;
1691 bluetooth_device_address_t device_addr;
1693 bluetooth_gatt_service_change_type_t change_type;
1694 } bt_gatt_service_change_t;
1697 * Structure to GATT characteristc Notification change
1701 char *service_handle;
1702 gboolean att_notify;
1703 } bt_gatt_char_notify_change_t;
1706 * Structure to Indication confirmation
1710 char *service_handle;
1713 } bt_gatt_indicate_confirm_t;
1716 * Structure for GATT response data
1723 } bt_gatt_resp_data_t;
1726 * Structure to RSSI Signal Strength Alert
1737 * Structure to RSSI Signal Strength
1747 * Structure for RSSI Enabled or Disabled
1753 gboolean rssi_enabled;
1754 } bt_rssi_enabled_t;
1757 * Structure for RSSI Threshold
1762 int in_range_threshold;
1764 } bt_rssi_threshold_t;
1768 * Structure for Suppoted Profiles and Trusted Profiles
1775 } bt_supported_profile_trusted_t;
1778 * Structure for PBAP Folder Parameters
1781 unsigned char addressbook;
1782 unsigned char folder_type;
1786 * Structure for PBAP Pull application Parameters
1789 unsigned char format;
1790 unsigned char order;
1791 unsigned short offset;
1792 unsigned short maxlist;
1793 long long unsigned fields;
1794 } bt_pbap_pull_parameters_t;
1797 * Structure for PBAP List application Parameters
1800 unsigned char order;
1801 unsigned short offset;
1802 unsigned short maxlist;
1803 } bt_pbap_list_parameters_t;
1806 * Structure for PBAP Pull vCard application Parameters
1809 unsigned char format;
1810 long long unsigned fields;
1812 } bt_pbap_pull_vcard_parameters_t;
1815 * Structure for PBAP Search application Parameters
1818 unsigned char order;
1819 unsigned short offset;
1820 unsigned short maxlist;
1821 unsigned char search_attribute;
1822 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1823 } bt_pbap_search_parameters_t;
1826 * Structure for PBAP Connection Status
1829 bluetooth_device_address_t btaddr;
1831 } bt_pbap_connected_t;
1834 * Structure for PBAP Phonebook Size
1837 bluetooth_device_address_t btaddr;
1839 } bt_pbap_phonebook_size_t;
1842 * Structure for PBAP Phonebook Pull
1845 bluetooth_device_address_t btaddr;
1848 } bt_pbap_phonebook_pull_t;
1851 * Structure for PBAP vCard List
1854 bluetooth_device_address_t btaddr;
1858 } bt_pbap_vcard_list_t;
1861 * Structure for PBAP vCard Pull
1864 bluetooth_device_address_t btaddr;
1867 } bt_pbap_vcard_pull_t;
1870 * Structure for PBAP Phonebook search List
1873 bluetooth_device_address_t btaddr;
1877 } bt_pbap_phonebook_search_list_t;
1880 * Stucture to HF Call status information
1884 char *number; /*Phone Number */
1885 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1886 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1887 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1888 int idx; /*Call index/ID */
1889 } bt_hf_call_status_info_t;
1894 } bt_hf_call_list_s;
1900 TRUSTED_PROFILE_PBAP = 1,
1901 TRUSTED_PROFILE_MAP,
1902 TRUSTED_PROFILE_SAP,
1903 TRUSTED_PROFILE_HFP_HF,
1904 TRUSTED_PROFILE_A2DP,
1905 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1906 } bluetooth_trusted_profile_t;
1909 * Structure for LE data length change params
1912 bluetooth_device_address_t device_address;
1913 guint16 max_tx_octets;
1914 guint16 max_tx_time;
1915 guint16 max_rx_octets;
1916 guint16 max_rx_time;
1917 } bt_le_data_length_params_t;
1920 * Structure for proximity property change params
1923 bluetooth_device_address_t device_address;
1927 } bt_pxp_property_changed_params_t;
1930 * @brief DPM BT allowance state
1934 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1935 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1936 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1937 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1941 * @brief DPM API result
1945 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1946 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1947 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1948 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1949 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1950 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1954 * @brief DPM Policy status
1958 BLUETOOTH_DPM_STATUS_ERROR = -1,
1960 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1961 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1963 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1964 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1966 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1967 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1971 /* policy-group : BLUETOOTH */
1972 BLUETOOTH_DPM_POLICY_ALLOW,
1973 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1974 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1975 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1976 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1977 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1978 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1979 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1980 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1981 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1982 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1983 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1984 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1985 BLUETOOTH_DPM_POLICY_END,
1986 } bt_dpm_policy_cmd_t;
1989 struct bt_dpm_policy {
1995 typedef struct bt_dpm_policy bt_dpm_policy_t;
1998 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1999 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2000 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2001 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2002 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2003 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2004 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2005 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2006 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2007 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2008 BLUETOOTH_DPM_PROFILE_NONE,
2011 struct bt_dpm_profile_val {
2012 int value; /* tells whether the profile is enabled or disabled */
2014 typedef struct dpm_profile_val dpm_profile_state_t;
2017 * Structure to DPM device list
2021 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2022 } bt_dpm_device_list_t;
2025 * Structure to DPM uuid list
2029 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2030 } bt_dpm_uuids_list_t;
2033 * Structure for IPSP Interface Info
2036 bluetooth_device_address_t btaddr;
2038 } bt_ipsp_connection_info_t;
2042 char* remote_address;
2043 } bt_map_client_session_info_s;
2045 typedef char* bt_map_client_message_object_t;
2050 } bt_map_client_list_folders_filter_t;
2055 int8_t subject_length;
2064 } bt_map_client_list_messages_filter_t;
2067 bt_map_client_message_object_t message_object;
2072 char *sender_address;
2075 char *recipient_address;
2080 int64_t attachment_size;
2085 } bt_map_client_message_item_t;
2091 } bt_map_client_push_message_args_t;
2098 char *sender_address;
2101 char *recipient_address;
2110 } bt_map_client_message_t;
2113 char **names; // holding %size null-terminated folder names
2115 } bt_map_client_folders_s;
2118 bt_map_client_message_item_t *message_items;
2120 } bt_map_client_message_items_s;
2123 const char* target_file;
2125 } bt_get_message_callback_data;
2128 * Callback pointer type
2130 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2133 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2134 * @brief Set the callback function pointer for bluetooth event
2137 * This API will register the callback function, when any response and event are received from
2138 * bluetooth framework. @n
2139 * this registered callback function will be get called with appropriate event and data structures.
2140 * This function is a synchronous call. An application developer can call
2141 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2142 * type. This registered function will receive events of bluetooth_event_type_t type along with
2146 * @param[in] callback_ptr A pointer to the callback function
2147 * @param[in] user_data A pointer to user data
2148 * @return BLUETOOTH_ERROR_NONE - Success
2152 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2154 GMainLoop *main_loop = (GMainLoop*) user_data;
2158 // Code for each event
2160 g_main_loop_quit(main_loop);
2167 GMainLoop *main_loop = NULL;
2170 main_loop = g_main_loop_new(NULL, FALSE);
2171 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2172 if (ret >= BLUETOOTH_ERROR_NONE)
2174 // bluetooth_register_callback returned Success
2178 // bluetooth_register_callback returned failiure
2180 g_main_loop_run(main_loop);
2184 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2187 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2188 * @brief Set the callback function pointer for bluetooth le event
2191 * This API will register the callback function, when any response and event are received from
2192 * bluetooth framework. @n
2193 * this registered callback function will be get called with appropriate event and data structures.
2194 * This function is a synchronous call. An application developer can call
2195 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2196 * type. This registered function will receive events of bluetooth_event_type_t type along with
2200 * @param[in] callback_ptr A pointer to the callback function
2201 * @param[in] user_data A pointer to user data
2202 * @return BLUETOOTH_ERROR_NONE - Success
2206 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2209 * @fn int bluetooth_le_unregister_callback(void)
2210 * @brief Set the callback function pointer for bluetooth le event
2213 * This API will register the callback function, when any response and event are received from
2214 * bluetooth framework. @n
2215 * this registered callback function will be get called with appropriate event and data structures.
2216 * This function is a synchronous call. An application developer can call
2217 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2218 * type. This registered function will receive events of bluetooth_event_type_t type along with
2223 * @return BLUETOOTH_ERROR_NONE - Success
2227 int bluetooth_le_unregister_callback(void);
2230 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2231 * @brief Set the callback function pointer for bluetooth event
2234 * This API will register the callback function, when any response and event are received from
2235 * bluetooth framework. @n
2236 * this registered callback function will be get called with appropriate event and data structures.
2237 * This function is a synchronous call. An application developer can call
2238 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2239 * type. This registered function will receive events of bluetooth_event_type_t type along with
2244 * @return BLUETOOTH_ERROR_NONE - Success
2248 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2250 GMainLoop *main_loop = (GMainLoop*) user_data;
2254 // Code for each event
2256 g_main_loop_quit(main_loop);
2263 GMainLoop *main_loop = NULL;
2266 main_loop = g_main_loop_new(NULL, FALSE);
2267 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2268 if (ret >= BLUETOOTH_ERROR_NONE)
2270 // bluetooth_register_callback returned Success
2274 // bluetooth_register_callback returned failiure
2276 ret = bluetooth_deregister_callback(void);
2277 g_main_loop_run(main_loop);
2281 int bluetooth_unregister_callback(void);
2284 * @fn int bluetooth_enable_adapter(void)
2285 * @brief Enable the Bluetooth H/W
2288 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2289 * send request to bluetooth chip for activation.
2290 * This function is typically called at startup or when Bluetooth services are required. This
2291 * function must be called before calling any other API of Bluetooth operations.
2293 * Before performing any operations like Device discover, service search etc.., the adapter must be
2296 * This function is a asynchronous call.
2297 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2298 * through registered callback function with appropriate result code
2299 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2300 * BLUETOOTH_ERROR_NONE - Success \n
2302 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2303 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2305 * @return BLUETOOTH_ERROR_NONE - Success\n
2306 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2307 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2308 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2309 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2311 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2313 void bt_event_callback(int event, bluetooth_event_param_t *param)
2317 case BLUETOOTH_EVENT_ENABLED:
2318 if (param->result == BLUETOOTH_ERROR_NONE)
2320 // Successfully Enabled
2333 ret = bluetooth_enable_adapter();
2337 int bluetooth_enable_adapter(void);
2340 * @fn int bluetooth_disable_adapter(void)
2341 * @brief Disable the Bluetooth H/W
2344 * This function disables Bluetooth protocol stack and hardware. This function is called when
2345 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2347 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2348 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2349 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2351 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2354 * This function is a asynchronous call.
2355 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2356 * through registered callback function.
2359 * @return BLUETOOTH_ERROR_NONE - Success\n
2360 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2361 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2362 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2364 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2366 void bt_event_callback(int event, bluetooth_event_param_t *param)
2370 case BLUETOOTH_EVENT_DISABLED:
2371 if (param->result == BLUETOOTH_ERROR_NONE)
2373 // Successfully disabled
2386 ret = bluetooth_disable_adapter();
2389 int bluetooth_disable_adapter(void);
2390 int bluetooth_recover_adapter(void);
2391 int bluetooth_check_adapter_le(void);
2392 int bluetooth_enable_adapter_le(void);
2394 int bluetooth_disable_adapter_le(void);
2395 int bluetooth_get_uuid_name(const char *uuid, char **name);
2398 * @fn int bluetooth_reset_adapter(void)
2399 * @brief Reset the Bluetooth H/W and values
2402 * This function resets Bluetooth protocol stack and hardware. This function is called when
2403 * an user want to initialize Bluetooth environment.
2405 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2408 * This function is a synchronous call.
2410 * @return BLUETOOTH_ERROR_NONE - Success\n
2411 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2413 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2418 ret = bluetooth_reset_adapter();
2421 int bluetooth_reset_adapter(void);
2424 * @fn int bluetooth_is_supported(void)
2425 * @brief Check if the bluetooth is supported or not by the current target
2427 * This API checks whether the bluetooth is supported or not.
2428 * This API only run by root permission.
2430 * This function is a synchronous call.
2432 * @return 0 - if bluetooth is not supported\n
2433 * 1 - if bluetooth is supported\n
2434 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2439 ret = bluetooth_is_supported();
2442 int bluetooth_is_supported(void);
2446 * @fn int bluetooth_check_adapter(void)
2447 * @brief Check the current status of the Bluetooth adapter
2450 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2451 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2452 * bluetooth adapter.
2453 * This API get the adapter internal data structure and check current adapter status.
2455 * This function is a synchronous call.
2458 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2459 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2461 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2465 ret = bluetooth_check_adapter();
2468 int bluetooth_check_adapter(void);
2471 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2472 * @brief Get the local adapter bluetooth address
2475 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2476 * the adapter should be enabled.
2477 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2478 * contain Bluetooth address.
2479 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2480 * friendly name for each device.
2481 * There is no event callback for this API.
2483 * This function is a synchronous call.
2486 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2487 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2488 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2489 * @param[out] local_address a device address of local bluetooth adapter
2494 bluetooth_device_address_t local_address={0,};
2497 ret = bluetooth_get_local_address(&local_address);
2500 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2503 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2504 * @brief Get the hci version
2507 * This function is used to get the bluetooth hci version
2508 * Before calling this API make sure that the adapter is enabled.
2510 * This function is a synchronous call.
2513 * @return BLUETOOTH_ERROR_NONE - Success \n
2514 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2515 * @param[out] timeout remain visibility timeout value
2518 bluetooth_version_t *version;
2520 ret = bluetooth_get_local_version (&version);
2523 int bluetooth_get_local_version(bluetooth_version_t *version);
2526 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2527 * @brief Get the local device name
2530 * This function is used, get the local device name. Since its difficult to remember the Adapter
2531 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2532 * friendly name is retrived by the remote device and displaying.
2533 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2535 * This function is a synchronous call.
2538 * @return BLUETOOTH_ERROR_NONE - Success \n
2539 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2540 * @param[out] local_name a local device name
2544 bluetooth_device_name_t local_name={0,}
2546 ret = bluetooth_get_local_name (&local_name);
2549 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2552 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2553 * @brief Set the local device name
2556 * This function is used to set the local device name. This is a human friendly name whose
2557 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2559 * This function is a synchronous call.
2561 * @param[in] local_name bluetooth device name to set local device
2563 * @return BLUETOOTH_ERROR_NONE - Success \n
2564 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2565 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2566 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2567 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2568 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2573 bluetooth_device_name_t local_name={0,}
2575 ret = bluetooth_set_local_name (&local_name);
2578 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2582 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2583 * @brief Check if the uuid is used or not
2585 * This function is used to check if the uuid is used or not.
2587 * This function is a synchronous call.
2589 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2590 * @param[out] used if the uuid is used or not
2592 * @return BLUETOOTH_ERROR_NONE - Success \n
2593 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2594 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2595 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2600 gboolean used = FALSE;
2601 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2602 ret = bluetooth_is_service_used(uuid, &used);
2605 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2608 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2609 * @brief Check if the device is connected to the specific service
2611 * This function is used to check if if the device is connected to the specific service.
2613 * This function is a synchronous call.
2615 * @param[in] local_address a device address of remote bluetooth device
2616 * @param[in] type the service type
2617 * @param[out] is_connected if the device is connected or not
2619 * @return BLUETOOTH_ERROR_NONE - Success \n
2620 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2621 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2622 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2627 gboolean is_connected = FALSE;
2628 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2629 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2632 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2633 bluetooth_service_type_t type,
2634 gboolean *is_connected);
2637 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2638 * @brief Gets device's connected link type
2640 * This function is used to get device's connected link type
2642 * This function is a synchronous call.
2644 * @param[in] device_address a device address of remote bluetooth device
2645 * @param[out] connected_link a device's connected link type
2647 * @return BLUETOOTH_ERROR_NONE - Success \n
2648 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2649 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2650 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2655 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2656 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2657 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2660 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2661 bluetooth_connected_link_t *connected_link);
2664 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2665 * @brief Sets a profile trusted for a device
2667 * This function is used to Set a profile as trusted for a device
2669 * This function is a synchronous call.
2671 * @param[in] device_address a device address of remote bluetooth device
2672 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2673 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2675 * @return BLUETOOTH_ERROR_NONE - Success \n
2676 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2677 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2678 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2682 int bluetooth_set_profile_trusted(
2683 const bluetooth_device_address_t *device_address,
2684 int profile, int trust);
2687 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2688 * @brief Gets a profile is trusted for a device
2690 * This function is used to Get a profile is trusted or not for a device
2692 * This function is a synchronous call.
2694 * @param[in] device_address a device address of remote bluetooth device
2695 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2696 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2698 * @return BLUETOOTH_ERROR_NONE - Success \n
2699 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2700 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2701 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2705 int bluetooth_get_profile_trusted(
2706 const bluetooth_device_address_t *device_address,
2707 int profile, int *trust);
2710 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2711 * @brief Get the visibility mode
2714 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2715 * visibity mode, the property of the device is determined whether it can be discoverable, non
2716 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2718 * This function is a synchronous call.
2721 * @return BLUETOOTH_ERROR_NONE - Success \n
2722 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2723 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2724 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2725 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2726 * @param[out] discoverable_mode current bluetooth discoverable mode
2728 * @see bluetooth_set_discoverable_mode
2730 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2732 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2735 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2738 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2740 * @brief Set the visibility mode
2743 * This function is used to set the discoverable mode (Visibility option).
2745 * Many times user may want to keep his device discoverable so that when peer device is performing
2746 * device search, he/she can find user's device. Application programmer can keep the mode as
2747 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2748 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2749 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2750 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2752 * This function is a synchronous call.
2754 * @return BLUETOOTH_ERROR_NONE - Success \n
2755 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2757 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2758 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2760 * @see bluetooth_get_discoverable_mode
2764 bluetooth_discoverable_mode_t mode;
2766 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2767 ret = bluetooth_set_discoverable_mode (mode, 180);
2771 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2776 * @fn int bluetooth_get_timeout_value(int *timeout)
2777 * @brief Get the visibility timeout value
2780 * This function is used to get the visibility timeout
2781 * Before calling this API make sure that the adapter is enabled.
2783 * This function is a synchronous call.
2786 * @return BLUETOOTH_ERROR_NONE - Success \n
2787 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2788 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2789 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2790 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2791 * @param[out] timeout remain visibility timeout value
2793 * @see bluetooth_set_discoverable_mode
2797 ret = bluetooth_get_timeout_value (&timeout);
2800 int bluetooth_get_timeout_value(int *timeout);
2804 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2805 * unsigned int classOfDeviceMask)
2806 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2808 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2809 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2810 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2811 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2812 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2813 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2814 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2815 * please see bluetooth_device_info_t for more details.
2818 * This API provides searching options like max responses, discovery duration in seconds and class
2819 * of device mask to filter device search. some times there may be too many bluetooth devices in
2820 * vicinity of your device.in such scenario, application can request to reduce number of responces
2821 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2822 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2823 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2824 * application defined time. please note that discovery_duration should be mentioned in seconds.
2825 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2828 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2829 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2830 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2832 * This function is a asynchronous call.
2833 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2834 * through registered callback function.
2836 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2837 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2839 * The completion or cancellation of the discovery is indicated by an
2840 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2842 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2845 * @return BLUETOOTH_ERROR_NONE - Success \n
2846 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2847 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2848 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2849 agent is not running \n
2851 * @param[in] max_response define the maximum response of the number of founded devices
2853 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2854 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2855 (refer to class of device)
2857 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2860 void bt_event_callback(int event, bluetooth_event_param_t *param)
2864 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2866 bluetooth_device_info_t *device_info = NULL;
2867 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2869 device_info = (bluetooth_device_info_t *)param->param_data;
2870 memcpy(&searched_device, &device_info->device_address,
2871 sizeof(bluetooth_device_address_t));
2872 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2873 device_info->device_address.addr[0],
2874 device_info->device_address.addr[1],
2875 device_info->device_address.addr[2],
2876 device_info->device_address.addr[3],
2877 device_info->device_address.addr[4],
2878 device_info->device_address.addr[5]);
2881 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2883 bluetooth_device_info_t *device_info = NULL;
2884 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2886 device_info = (bluetooth_device_info_t *)param->param_data;
2887 memcpy(&searched_device, &device_info->device_address,
2888 sizeof(bluetooth_device_address_t));
2889 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2890 device_info->device_name.name,
2891 device_info->device_address.addr[0],
2892 device_info->device_address.addr[1],
2893 device_info->device_address.addr[2],
2894 device_info->device_address.addr[3],
2895 device_info->device_address.addr[4],
2896 device_info->device_address.addr[5]);
2900 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2901 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2906 unsigned short max_response;
2907 unsigned short discovery_duration;
2908 unsigned classOfDeviceMask;
2912 discovery_duration =0;
2913 classOfDeviceMask =0;
2915 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2920 int bluetooth_start_discovery(unsigned short max_response,
2921 unsigned short discovery_duration,
2922 unsigned int classOfDeviceMask);
2925 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2926 * unsigned short max_response,
2927 * unsigned short discovery_duration,
2928 * unsigned int classOfDeviceMask)
2929 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2931 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2932 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2933 * Please see bluetooth_start_discovery() for other parameters description.
2935 * This function is a asynchronous call.
2936 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2937 * through registered callback function.
2939 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2940 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2942 * The completion or cancellation of the discovery is indicated by an
2943 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2945 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2948 * @return BLUETOOTH_ERROR_NONE - Success \n
2949 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2950 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2951 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2952 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2953 agent is not running \n
2955 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2956 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2957 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2958 * @param[in] max_response define the maximum response of the number of founded devices
2960 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2961 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2962 (refer to class of device)
2964 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2967 unsigned short type;
2968 unsigned short max_response;
2969 unsigned short discovery_duration;
2970 unsigned classOfDeviceMask;
2975 discovery_duration =0;
2976 classOfDeviceMask =0;
2978 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2983 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2984 unsigned short max_response,
2985 unsigned short discovery_duration,
2986 unsigned int classOfDeviceMask);
2989 * @fn int bluetooth_cancel_discovery (void)
2990 * @brief Cancel the on-going device discovery operation
2993 * This function stops the on-going device discovery operation. This API has to be called after the
2994 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2995 * the bluetooth_start_discovery API
2997 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2998 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2999 * cancel the discover request once the user received the device to which he wish to connect.
3001 * This function is a asynchronous call.
3002 * If the call is success to cancel discovey then the application will receive
3003 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3004 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3005 * BLUETOOTH_ERROR_NONE
3008 * @return BLUETOOTH_ERROR_NONE - Success \n
3009 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3010 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3011 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3012 other application \n
3013 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3015 * @see bluetooth_start_discovery
3017 void bt_event_callback(int event, bluetooth_event_param_t *param)
3021 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3022 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3031 ret = bluetooth_cancel_discovery();
3034 int bluetooth_cancel_discovery(void);
3037 * @fn int bluetooth_start_le_discovery(void)
3038 * @brief Start the generic device discovery which finds the LE devices.
3040 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3041 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3042 * It try to find LE devices. Bluetooth device address and name are
3043 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3044 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3045 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3046 * please see bluetooth_device_info_t for more details.
3048 * This function is a asynchronous call.
3049 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3050 * through registered callback function.
3052 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3055 * The completion or cancellation of the discovery is indicated by an
3056 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3058 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3061 * @return BLUETOOTH_ERROR_NONE - Success \n
3062 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3063 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3064 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3065 agent is not running \n
3068 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3071 void bt_event_callback(int event, bluetooth_event_param_t *param)
3075 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3077 bluetooth_device_info_t *device_info = NULL;
3078 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3080 device_info = (bluetooth_device_info_t *)param->param_data;
3081 memcpy(&searched_device, &device_info->device_address,
3082 sizeof(bluetooth_device_address_t));
3083 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3084 device_info->device_address.addr[0],
3085 device_info->device_address.addr[1],
3086 device_info->device_address.addr[2],
3087 device_info->device_address.addr[3],
3088 device_info->device_address.addr[4],
3089 device_info->device_address.addr[5]);
3093 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3094 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3100 ret = bluetooth_start_discovery();
3105 int bluetooth_start_le_discovery(void);
3108 * @fn int bluetooth_stop_le_discovery (void)
3109 * @brief Cancel the on-going device LE discovery operation
3112 * This function stops the on-going device discovery operation. This API has to be called after the
3113 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3114 * the bluetooth_start_le_discovery API
3117 * This function is a asynchronous call.
3118 * If the call is success to cancel discovey then the application will receive
3119 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3120 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3121 * BLUETOOTH_ERROR_NONE
3124 * @return BLUETOOTH_ERROR_NONE - Success \n
3125 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3126 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3127 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3128 other application \n
3129 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3131 * @see bluetooth_start_discovery
3133 void bt_event_callback(int event, bluetooth_event_param_t *param)
3137 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3138 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3147 ret = bluetooth_stop_le_discovery();
3150 int bluetooth_stop_le_discovery(void);
3153 * @fn int bluetooth_is_discovering(void)
3154 * @brief Check for the device discovery is in-progress or not.
3156 * This API is used to check the current status of the Discovery operation.If discovery is in\
3157 * progress normally other operations are not allowed.
3158 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3159 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3160 * event before performing other operations. This API is used to get for the current discovery
3161 * operation status and using bluetooth_cancel_discovery()
3162 * we can cancell the ongoing discovery process.
3163 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3166 * This function checks whether the device discovery is started or not.
3168 * This function is a synchronous call.
3171 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3172 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3173 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3176 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3180 ret = bluetooth_is_discovering ();
3183 int bluetooth_is_discovering(void);
3186 * @fn int bluetooth_is_le_discovering(void)
3187 * @brief Check for the device LE discovery is in-progress or not.
3189 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3190 * progress normally other operations are not allowed.
3191 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3192 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3193 * event before performing other operations. This API is used to get for the current discovery
3194 * operation status and using bluetooth_stop_le_discovery()
3195 * we can cancell the ongoing LE discovery process.
3196 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3199 * This function checks whether the device LE discovery is started or not.
3201 * This function is a synchronous call.
3204 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3205 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3206 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3209 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3213 ret = bluetooth_is_le_discovering ();
3216 int bluetooth_is_le_discovering(void);
3219 * @fn int bluetooth_is_le_scanning(void)
3220 * @brief Check for the device LE scan is in-progress or not.
3222 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3223 * progress normally other operations are not allowed.
3225 * This function checks whether the device LE Scan is started or not.
3227 * This function is a synchronous call.
3229 * @return TRUE - LE Scan in progress \n
3230 * FALSE - LE Scan is not in progress \n
3235 gboolean is_le_scanning = 0;
3236 is_le_scanning = bluetooth_is_le_scanning ();
3239 gboolean bluetooth_is_le_scanning(void);
3241 gboolean bluetooth_is_scan_filter_supported(void);
3244 * @fn int bluetooth_force_hcidump(int timeout)
3245 * @brief Enable /disable force-hcidump
3247 * This function control force-hcidump.
3249 * This function is a synchronous call.
3251 * @return BLUETOOTH_ERROR_NONE - Success \n
3252 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3253 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3255 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3260 int bluetooth_force_hcidump(int timeout);
3263 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3264 * @brief Register scan filter.
3266 * This function registers the scan filter.
3268 * This function is a synchronous call.
3270 * @return BLUETOOTH_ERROR_NONE - Success \n
3272 * @param[in] filter scan filter to register
3273 * @param[out] slot_id the slot ID of scan filter
3277 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3280 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3281 * @brief Register scan filter.
3283 * This function unregisters the scan filter.
3285 * This function is a synchronous call.
3287 * @return BLUETOOTH_ERROR_NONE - Success \n
3289 * @param[in] slot_id the slot ID of scan filter
3293 int bluetooth_unregister_scan_filter(int slot_id);
3296 * @fn int bluetooth_unregister_all_scan_filters(void)
3297 * @brief Register scan filter.
3299 * This function usregisters all scan filters.
3301 * This function is a synchronous call.
3303 * @return BLUETOOTH_ERROR_NONE - Success \n
3307 int bluetooth_unregister_all_scan_filters(void);
3310 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3311 int link_type, bt_rssi_threshold_t rssi_threshold)
3312 * @brief Enable RSSI monitoring
3314 * This function enables RSSI monitoring and sets threshold for a connection
3316 * @return BLUETOOTH_ERROR_NONE - Success \n
3319 * @see bluetooth_get_rssi_strength
3321 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3322 int link_type, bt_rssi_threshold_t *rssi_threshold);
3325 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3326 * @brief Gets Raw RSSI signal Strength
3328 * This function gives the Raw RSSI signal strength for a connection.
3330 * @return BLUETOOTH_ERROR_NONE - Success \n
3333 * @see bluetooth_enable_rssi
3335 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3337 int bluetooth_set_connectable(gboolean is_connectable);
3339 int bluetooth_is_connectable(gboolean *is_connectable);
3341 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3344 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3345 * @brief Initiate a bonding process
3348 * This function initiates a bonding procedure with a peer device. The bonding procedure
3349 * enables authentication and optionally encryption on the Bluetooth link.
3351 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3352 * inititate the bonding request to the devices already in the paired list.
3354 * Usually we call this API after the device discovery.
3355 * This function is a asynchronous call.
3357 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3358 * mentioed result code
3359 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3360 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3361 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3362 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3363 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3365 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3366 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3369 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3372 * @return BLUETOOTH_ERROR_NONE - Success \n
3373 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3374 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3375 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3376 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3378 * @param[in] device_address This indicates an address of the device with which the pairing
3379 * should be initiated
3381 * @see bluetooth_cancel_bonding
3383 void bt_event_callback(int event, bluetooth_event_param_t *param)
3387 case BLUETOOTH_EVENT_BONDING_FINISHED:
3389 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3390 if (param->result >= BLUETOOTH_ERROR_NONE)
3392 bluetooth_device_info_t *device_info = NULL;
3393 device_info = (bluetooth_device_info_t *)param->param_data;
3394 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3395 mjr[%#x] min[%#x] srv[%#x]",
3396 device_info->device_name.name,
3397 device_info->device_address.addr[0],
3398 device_info->device_address.addr[1],
3399 device_info->device_address.addr[2],
3400 device_info->device_address.addr[3],
3401 device_info->device_address.addr[4],
3402 device_info->device_address.addr[5],
3403 device_info->device_class.major_class,
3404 device_info->device_class.minor_class,
3405 device_info->device_class.service_class);
3419 bluetooth_device_address_t device_address={{0}};
3421 ret = bluetooth_bond_device(&device_address);
3425 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3428 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3429 * bluetooth_conn_type_t conn_type)
3430 * @brief Initiate a bonding process
3433 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3434 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3436 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3437 * inititate the bonding request to the devices already in the paired list.
3439 * Usually we call this API after the device discovery.
3440 * This function is a asynchronous call.
3442 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3443 * mentioed result code
3444 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3445 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3446 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3447 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3448 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3450 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3451 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3454 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3457 * @return BLUETOOTH_ERROR_NONE - Success \n
3458 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3459 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3460 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3461 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3463 * @param[in] device_address This indicates an address of the device with which pairing
3464 * should be initiated
3465 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3468 * @see bluetooth_cancel_bonding
3470 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3471 bluetooth_conn_type_t conn_type);
3474 * @fn int bluetooth_cancel_bonding(void)
3475 * @brief Cancel the on-going bonding process
3477 * This API is called to cancel the on-going bonding procedure. It should be called before the
3478 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3479 * This API is useful when the remote device is not responding to the bond request or we wish to
3480 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3482 * This function is a synchronous call.
3484 * @return BLUETOOTH_ERROR_NONE - Success \n
3485 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3486 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3489 * @see bluetooth_bond_device
3495 ret = bluetooth_cancel_bonding();
3498 int bluetooth_cancel_bonding(void);
3501 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3502 * @brief Remove bonding
3505 * To communicate with remote device over bluetooth link, user should bond with peer device.
3506 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3507 * API is used to remove peer device from the list. Please note that after removing the device
3508 * from bonded device list, you cannot communication with peer device until bonding happens again.
3510 * User can call this function by passing bluetooth device address of any bonded device. Please note
3511 * that after successful return of this function, any bluetooth application running on your device
3512 * will not be able to communicate with unbonded device until bond operation happens again using
3513 * bluetooth_bond_device()
3516 * This function is a asynchronous call. The request to remove the specified device from the bonded
3517 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3518 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3519 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3523 * @return BLUETOOTH_ERROR_NONE - Success \n
3524 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3525 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3526 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3527 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3528 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3529 * agent is not running \n
3530 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3533 * @param[in] device_address This indicates an address of the device to remove bonding
3537 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3540 void bt_event_callback(int event, bluetooth_event_param_t *param)
3543 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3544 bluetooth_device_address_t *dev_addr = NULL;
3546 if (param->result == BLUETOOTH_ERROR_NONE) {
3547 dev_addr = (bluetooth_device_address_t *)param->param_data;
3549 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3550 dev_addr->addr[0], dev_addr->addr[1]
3551 dev_addr->addr[2], dev_addr->addr[3]
3552 dev_addr->addr[4], dev_addr->addr[5]
3563 bluetooth_device_address_t *device_address;
3565 // copy valid device address in device_address
3567 ret = bluetooth_unbond_device(device_address);
3570 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3573 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3574 * @brief Get bonded(paired) device list
3577 * This API gets all bonded device list.
3578 * The devices in the bonded device list further can be used to perform the authorization by calling
3579 * bluetooth_authorize_device API.
3581 * This function is a synchronous call.
3582 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3583 * there is no valid information in the dev_list.
3584 * The len field in the dev_list represents the number of bonded devices. The data structure for
3585 * bonded device information is bluetooth_device_info_t.
3588 * @return BLUETOOTH_ERROR_NONE - Success \n
3589 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3591 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3593 void bt_get_bonded_devices(void)
3597 GPtrArray *devinfo = NULL;
3598 bluetooth_device_info_t *ptr;
3600 // allocate the g_pointer_array
3601 devinfo = g_ptr_array_new();
3603 ret = bluetooth_get_bonded_device_list(&devinfo);
3604 if (ret != BLUETOOTH_ERROR_NONE)
3606 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3610 printf("g pointer arrary count : [%d]", devinfo->len);
3611 for (i=0; i<devinfo->len; i++)
3613 ptr = g_ptr_array_index(devinfo, i);
3616 printf("Name [%s]\n", ptr->device_name.name);
3617 printf("Major Class [%d]\n", ptr->device_class.major_class);
3618 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3619 printf("Service Class [%d]\n", ptr->device_class.service_class);
3620 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3621 ptr->device_address.addr[0],
3622 ptr->device_address.addr[1], ptr->device_address.addr[2],
3623 ptr->device_address.addr[3],
3624 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3631 // free g_pointer_array
3632 g_ptr_array_free(devinfo, TRUE);
3637 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3639 int bluetooth_get_profile_connected_device_list(
3640 const char *profile_uuid, GPtrArray **addr_list);
3643 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3644 * bluetooth_device_info_t *dev_info)
3645 * @brief Get a bonded(paired) device
3648 * This API gets a bonded device.
3650 * This function is a synchronous call.
3651 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3652 * there is no valid information in the dev_info.
3653 * The data structure for bonded device information is bluetooth_device_info_t.
3656 * @return BLUETOOTH_ERROR_NONE - Success \n
3657 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3659 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3661 void bt_get_bonded_device(void)
3665 bluetooth_device_info_t devinfo = {0};
3666 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3668 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3669 if (ret != BLUETOOTH_ERROR_NONE)
3671 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3675 printf("Name [%s]\n", devinfo.device_name.name);
3676 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3677 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3678 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3679 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3680 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3681 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3682 devinfo.device_address.addr[5]);
3691 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3692 bluetooth_device_info_t *dev_info);
3695 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3696 * gboolean *is_alias_set)
3697 * @brief Get is_alias_set property of device
3699 * This API gets is_alias_set property of a bonded device.
3701 * This function is a synchronous call.
3702 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3703 * If not,there is no valid information in the is_alias_set.
3705 * @return BLUETOOTH_ERROR_NONE - Success \n
3706 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3711 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3713 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3716 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3717 gboolean *is_alias_set);
3720 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3721 * @brief set alias for bonded device
3724 * This function set alias for bonded device.
3726 * This function is a synchronous call.
3729 * @return BLUETOOTH_ERROR_NONE - Success \n
3730 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3731 * @param[in] device_address This indicates an address of the remote device
3732 * @param[in] alias This indicates an alias to set
3737 ret = bluetooth_set_alias(&remote_address);
3740 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3744 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3745 * @brief Get remote deivice
3748 * This function gets specific remote device.
3750 * This function is a asynchronous call.
3751 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3754 * @return BLUETOOTH_ERROR_NONE - Success \n
3755 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3756 * @param[in] device_address This indicates an address of the remote device
3761 ret = bluetooth_get_remote_device(&remote_address);
3764 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3767 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3768 * gboolean authorized)
3769 * @brief Authorize/Unauthorize a bonded device
3772 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3773 * with/without user confirmation.
3775 * If we select a paired device and make it authorized by calling this API with the authorized
3776 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3777 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3778 * then it will ask for the user conformation before the connection.
3780 * This API supposed to be called on the paired devices. Which means we have to use this API only
3781 * after successful pairing.
3783 * This function is a asynchronous call.
3784 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3786 * @return BLUETOOTH_ERROR_NONE - Success \n
3787 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3788 * @param[in] device_address This indicates an address of the device to authorize \n
3789 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3791 * @see bluetooth_get_bonded_device_list
3793 void bt_event_callback(int event, bluetooth_event_param_t *param)
3797 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3799 if (param->result == BLUETOOTH_ERROR_NONE)
3803 //device authorization failed failure
3811 bluetooth_device_address_t device_address={{0}};
3812 gboolean authorized;
3816 ret = bluetooth_authorize_device(&device_address,authorized);
3819 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3820 gboolean authorized);
3822 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3823 const bluetooth_device_pin_code_t *pin_code);
3825 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3828 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3830 * @brief Receives Legacy Passkey\pin with following authentication response types
3832 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3833 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3836 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3839 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3841 * @brief This API sends user confirmation reply to the local adapter.
3843 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3846 int bluetooth_passkey_confirmation_reply(gboolean reply);
3849 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3850 * @brief Get all services supported by remote device
3853 * This API call initiates the search for the services supported by the specified device. Normally
3854 * the service search will take a couple of seconds to get it completed. Before calling this API
3855 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3856 * perform the service search. We can get the device address by doing a device discovery operation.
3859 * This function is a asynchronous call.
3860 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3862 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3863 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3864 * event is generated with appropriate result code.
3866 * @return BLUETOOTH_ERROR_NONE - Success \n
3867 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3868 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3869 * @param[in] device_address This indicates an address of the device
3870 * whose services need to be found
3872 * @see bluetooth_cancel_service_search
3874 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3877 * @fn int bluetooth_cancel_service_search(void)
3878 * @brief Cancel the ongoing service search operation
3881 * This function cancel the ongoing service search operation. This API is usually calling after the
3882 * bluetooth_search_service API.
3883 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3884 * if the user wish to cancel the Ongoing service search operation.
3886 * This API should be called just after the bluetooth_search_service API and before the
3887 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3889 * This function is a synchronous call.
3891 * @return BLUETOOTH_ERROR_NONE - Success \n
3892 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3893 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3894 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3897 * @see bluetooth_search_service
3902 ret = bluetooth_cancel_service_search();
3905 int bluetooth_cancel_service_search(void);
3908 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3909 * @brief Register rfcomm socket with a specific uuid
3912 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3913 * descriptor of the server.
3914 * This is the first API which is called to create the server. Once we created the server socket,
3915 * we will listen on that return socket.
3916 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3919 * @return socket FD on Success \n
3920 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3921 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3922 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3923 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3924 * @param[in] UUID (128 bits)
3927 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3931 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3932 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3936 int bluetooth_rfcomm_create_socket(const char *uuid);
3939 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3940 * @brief Register rfcomm socket with a specific uuid
3943 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3944 * descriptor of the server.
3945 * This is the first API which is called to create the server. Once we created the server socket,
3946 * we will listen on that return socket.
3947 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3950 * @return socket FD on Success \n
3951 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3952 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3953 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3954 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3955 * @param[in] UUID (128 bits)
3956 * @param[in] bus_name (const char)
3957 * @param[in] path (const char)
3960 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3964 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3965 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3969 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3972 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3973 * @brief De-register the rfcomm socket
3976 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3977 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3978 * descriptor else no event will come. We will call this API only after the
3979 * bluetooth_rfcomm_listen_and_accept.
3980 * This is a synchronous call.
3982 * @return BLUETOOTH_ERROR_NONE - Success \n
3983 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3984 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3985 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3986 * @param[in] int socket_fd
3989 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3992 void bt_event_callback(int event, bluetooth_event_param_t *param)
3996 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3998 bluetooth_rfcomm_connection_t *discon_ind =
3999 (bluetooth_rfcomm_connection_t *)param->param_data;
4001 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4009 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4010 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4012 ret = bluetooth_rfcomm_remove_socket(fd);
4015 int bluetooth_rfcomm_remove_socket(int socket_fd);
4018 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4019 * @brief De-register the rfcomm socket
4022 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4023 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4024 * descriptor else no event will come. We will call this API only after the
4025 * bluetooth_rfcomm_listen_and_accept_ex.
4026 * This is a synchronous call.
4028 * @return BLUETOOTH_ERROR_NONE - Success \n
4029 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4030 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4031 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4032 * @param[in] UUID (128 bits)
4035 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4038 void bt_event_callback(int event, bluetooth_event_param_t *param)
4042 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4044 bluetooth_rfcomm_connection_t *discon_ind =
4045 (bluetooth_rfcomm_connection_t *)param->param_data;
4047 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4055 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4056 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4058 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4061 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4064 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4065 * @brief Disconnect rfcomm connection
4068 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4069 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4072 * @return BLUETOOTH_ERROR_NONE - Success \n
4073 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4074 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4075 * @param[in] int socket_fd the sending socket fd
4081 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4083 printf("Disconnection failed");
4085 printf("Disconnection Success");
4089 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4092 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4093 * @brief Rfcomm socket listen
4096 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4097 * after the bluetooth_rfcomm_create_socket API.
4098 * This API listen for the incomming connection and once it receives a connection, it will give
4099 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4100 * event to the application. This is an Asynchronous API call.
4103 * @return BLUETOOTH_ERROR_NONE - Success \n
4104 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4105 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4107 * @param[in] int socket_fd
4108 * @param[in] max pending connection.
4111 * @see bluetooth_rfcomm_create_socket
4114 void bt_event_callback(int event, bluetooth_event_param_t* param)
4118 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4120 bluetooth_rfcomm_connection_t *conn_ind =
4121 (bluetooth_rfcomm_connection_t *)param->param_data;
4123 printf("\nConnected from FD %d", conn_ind->socket_fd);
4131 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4132 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4136 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4139 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4140 * @brief Rfcomm socket listen
4143 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4144 * after the bluetooth_rfcomm_create_socket API.
4145 * This API listen for the incomming connection and once it receives a connection, it will give
4146 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4147 * event to the application. This is an Asynchronous API call.
4150 * @return BLUETOOTH_ERROR_NONE - Success \n
4151 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4152 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4154 * @param[in] int socket_fd
4155 * @param[in] max pending connection.
4160 * @see bluetooth_rfcomm_create_socket_ex
4163 void bt_event_callback(int event, bluetooth_event_param_t* param)
4167 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4169 bluetooth_rfcomm_connection_t *conn_ind =
4170 (bluetooth_rfcomm_connection_t *)param->param_data;
4172 printf("\nConnected from FD %d", conn_ind->socket_fd);
4180 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4181 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4186 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4189 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4190 * @brief Rfcomm socket listen
4193 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4194 * after the bluetooth_rfcomm_create_socket API.
4195 * This API listen for the incomming connection and once it receives a connection, it will give
4196 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4197 * event to the application. This is an Asynchronous API call.
4200 * @return BLUETOOTH_ERROR_NONE - Success \n
4201 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4202 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4204 * @param[in] int socket_fd
4205 * @param[in] max pending connection.
4208 * @see bluetooth_rfcomm_create_socket
4211 void bt_event_callback(int event, bluetooth_event_param_t* param)
4215 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4217 char *name = (char *)param->param_data;
4219 printf("\nConnected from %s", name);
4221 bluetooth_rfcomm_accept_connection();
4229 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4230 ret = bluetooth_rfcomm_listen(fd, 1);
4234 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4237 * @fn int bluetooth_rfcomm_accept_connection()
4238 * @brief Accepts the authorization request indicated by the event
4239 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4241 * This function is a synchronous call.
4243 * @return BLUETOOTH_ERROR_NONE - Success \n
4244 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4246 * @param[in] the socket fd of the server
4247 * @param[out] the socket fd of the client
4251 * @see bluetooth_rfcomm_reject_connection
4253 int bluetooth_rfcomm_accept_connection(int server_fd);
4256 * @fn int bluetooth_rfcomm_reject_connection()
4257 * @brief Rejects the authorization request indicated by the event
4258 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4260 * This function is a synchronous call.
4262 * @return BLUETOOTH_ERROR_NONE - Success \n
4263 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4265 * @param[in] the socket fd of the server
4269 * @see bluetooth_rfcomm_accept_connection
4271 int bluetooth_rfcomm_reject_connection(int server_fd);
4274 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4275 * @brief Informs whether rfcomm server uuid is available or not.
4277 * This function is a synchronous call.
4279 * @return TRUE - RFCOMM uuid is available \n
4280 * FALSE - RFCOMM uuid is not available \n
4282 * @param[in] uuid UUID string
4288 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4291 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4292 * const char *remote_uuid)
4293 * @brief Connect to the remote device rfcomm *
4295 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4296 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4297 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4298 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4299 * initiating a connection.
4301 * @return BLUETOOTH_ERROR_NONE - Success \n
4302 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4303 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4304 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4305 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4306 * @param[in] bluetooth_device_address_t remote bt_address
4307 * @param[in] char remote uuid
4309 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4313 void bt_event_callback(int event, bluetooth_event_param_t *param)
4317 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4319 if (param->result >= BLUETOOTH_ERROR_NONE)
4321 bt_sdp_info_t *bt_sdp_info=param->param_data;
4323 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4324 bt_sdp_info->device_addr.addr[0],
4325 bt_sdp_info->device_addr.addr[1],
4326 bt_sdp_info->device_addr.addr[2],
4327 bt_sdp_info->device_addr.addr[3],
4328 bt_sdp_info->device_addr.addr[4],
4329 bt_sdp_info->device_addr.addr[5]);
4331 printf("Supported service list:\n");
4332 for(i=0; i<bt_sdp_info->service_index; i++)
4334 bt_sdp_info->service_list_array[i]);
4337 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4338 //rfcomm_test_uuid);
4342 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4344 bluetooth_rfcomm_connection_t *conn_ind =
4345 (bluetooth_rfcomm_connection_t *)param->param_data;
4347 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4348 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4349 "SERVER" : "CLIENT");
4354 bluetooth_device_address_t remote_address = {{0},};
4355 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4356 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4357 ret = bluetooth_search_service(&remote_address);
4359 printf("Seach failed, Reason = %d", ret);
4361 printf("Search Success, Ret = %d", ret);
4363 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4365 printf("Connection failed, Reason = %d", ret);
4367 printf("Connection Success, Ret = %d", ret);
4371 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4372 const char *remote_uuid);
4375 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4376 * @brief Disconnect rfcomm connection
4379 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4380 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4383 * @return BLUETOOTH_ERROR_NONE - Success \n
4384 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4385 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4386 * @param[in] char remote bt_address
4389 * @see bluetooth_rfcomm_connect
4393 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4395 printf("Disconnection failed");
4397 printf("Disconnection Success");
4402 int bluetooth_rfcomm_disconnect(int socket_fd);
4405 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4406 * @brief Write to rfcomm connection
4409 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4410 * API is used to send the data for server and the client.
4412 * @return BLUETOOTH_ERROR_NONE - Success \n
4413 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4414 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4416 * @param[in] const char *buff Data buffer to send
4417 * @param[in] int length Length of the data
4420 * @see bluetooth_rfcomm_connect
4423 char *buff = "Test data 123456789"
4424 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4426 printf("Send failed");
4428 printf("Send success");
4432 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4435 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4436 * @brief Informs whether rfcomm client is connected.
4438 * This function is a synchronous call.
4440 * @return TRUE - RFCOMM client is connected \n
4441 * FALSE - RFCOMM client is not connected \n
4447 gboolean bluetooth_rfcomm_is_client_connected(void);
4448 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4449 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4452 * @fn int bluetooth_network_activate_server(void)
4453 * @brief Activate the NAP (Network Access Point) service
4455 * This function is a asynchronous call.
4456 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4458 * @return BLUETOOTH_ERROR_NONE - Success \n
4459 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4460 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4461 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4464 * @see bluetooth_network_deactivate_server
4467 int bluetooth_network_activate_server(void);
4470 * @fn int bluetooth_network_deactivate_server(void)
4471 * @brief Deactivate the NAP (Network Access Point) service
4473 * This function is a asynchronous call.
4474 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4476 * @return BLUETOOTH_ERROR_NONE - Success \n
4477 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4478 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4479 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4482 * @see bluetooth_network_activate_server
4485 int bluetooth_network_deactivate_server(void);
4488 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4489 * bluetooth_network_role_t role,
4491 * @brief Connect the network server in the peer
4493 * This function is a asynchronous call.
4494 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4496 * @return BLUETOOTH_ERROR_NONE - Success \n
4497 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4498 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4499 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4502 * @param[in] device_address This indicates an address of the device with which the pairing
4503 * should be initiated
4504 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4505 * need to use the third parameter.
4506 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4507 * connect. UUID string
4509 * @see bluetooth_network_disconnect
4511 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4512 bluetooth_network_role_t role, char *custom_uuid);
4515 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4516 * bluetooth_network_role_t role,
4517 * char *custom_uuid)
4518 * @brief Connect the network server in the peer
4520 * This function is a asynchronous call.
4521 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4523 * @return BLUETOOTH_ERROR_NONE - Success \n
4524 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4525 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4526 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4529 * @param[in] device_address This indicates an address of the device with which the pairing
4530 * should be initiated
4532 * @see bluetooth_network_connect
4534 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4537 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4538 * @brief Disconnect the device from the network
4540 * This function is an asynchronous call.
4541 * The network server disconnect request is responded by
4542 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4544 * @return BLUETOOTH_ERROR_NONE - Success \n
4545 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4546 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4547 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4550 * @param[in] device_address This indicates an address of the connected client device
4552 * @see bluetooth_network_activate_server
4554 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4559 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4560 * bt_hdp_role_type_t role,
4561 * bt_hdp_qos_type_t channel_type,
4562 * char **app_handle)
4563 * @brief Activate the HDP service for a particular data type
4565 * This function is a synchronous call.
4567 * @return BLUETOOTH_ERROR_NONE - Success \n
4568 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4569 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4570 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4573 * @param[in] data_type The data type against corresponding service
4574 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4575 * @param[in] channel_type The QOS type for the channel.
4576 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4577 * For role = HDP_ROLE_SINK, the channel_type
4578 * should be HDP_QOS_ANY.
4579 * @param[out] app_handle The application handler against corresponding service
4581 * @see bluetooth_hdp_deactivate
4583 int bluetooth_hdp_activate(unsigned short data_type,
4584 bt_hdp_role_type_t role,
4585 bt_hdp_qos_type_t channel_type,
4588 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4589 * @brief Deactivate the HDP service for a particular service using the handler
4591 * This function is a synchronous call.
4593 * @return BLUETOOTH_ERROR_NONE - Success \n
4594 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4595 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4596 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4599 * @param[in] app_handle The application handler against corresponding service
4601 * @see bluetooth_hdp_deactivate
4603 int bluetooth_hdp_deactivate(const char *app_handle);
4606 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4607 * const char *buffer, unsigned int size)
4608 * @brief Send data to the remote HDP device
4610 * This function is a synchronous call.
4612 * @return BLUETOOTH_ERROR_NONE - Success \n
4613 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4614 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4615 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4616 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4619 * @param[in] channel_id The channel id for the connection.
4620 * @param[in] buffer The pdu buffer.
4621 * @param[in] size Size of the buffer.
4623 * @see bluetooth_hdp_connect
4625 int bluetooth_hdp_send_data(unsigned int channel_id,
4626 const char *buffer, unsigned int size);
4628 * @fn int bluetooth_hdp_connect(const char *app_handle,
4629 * bt_hdp_qos_type_t channel_type,
4630 * const bluetooth_device_address_t *device_address)
4631 * @brief Connect to the remote device(Mainly used by source)
4633 * This function is a asynchronous call.
4634 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4636 * @return BLUETOOTH_ERROR_NONE - Success \n
4637 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4638 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4639 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4640 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4643 * @param[in] app_handle The application handler against corresponding service
4644 * @param[in] channel_type The QOS type for the channel.
4645 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4646 * @param[in] device_address The remote device Bd address.
4649 * @see bluetooth_hdp_disconnect
4651 int bluetooth_hdp_connect(const char *app_handle,
4652 bt_hdp_qos_type_t channel_type,
4653 const bluetooth_device_address_t *device_address);
4655 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4656 * const bluetooth_device_address_t *device_address)
4657 * @brief Disconnect from the remote device(Mainly used by source)
4659 * This function is a asynchronous call.
4660 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4662 * @return BLUETOOTH_ERROR_NONE - Success \n
4663 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4664 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4665 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4666 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4669 * @param[in] channel_id The channel id for the connection.
4670 * @param[in] device_address The remote device Bd address.
4673 * @see bluetooth_hdp_connect
4675 int bluetooth_hdp_disconnect(unsigned int channel_id,
4676 const bluetooth_device_address_t *device_address);
4680 * @fn int bluetooth_opc_init(void)
4681 * @brief Initialize OPP client.
4683 * This function is a synchronous call.
4684 * No event corresponding to this api
4686 * @return BLUETOOTH_ERROR_NONE - Success \n
4687 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4688 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4689 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4690 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4695 * @see bluetooth_opc_deinit
4697 int bluetooth_opc_init(void);
4700 * @fn int bluetooth_opc_deinit(void)
4701 * @brief Deinitialize OPP client.
4703 * This function is a synchronous call.
4704 * No event corresponding to this api
4706 * @return BLUETOOTH_ERROR_NONE - Success \n
4707 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4708 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4713 * @see bluetooth_opc_init
4716 int bluetooth_opc_deinit(void);
4719 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4720 char **file_name_array)
4721 * @brief Send multiple files to a remote device.
4723 * This function is a asynchronous call.
4724 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4726 * @return BLUETOOTH_ERROR_NONE - Success \n
4727 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4728 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4729 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4730 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4731 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4732 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4735 * @param[in] device_address The remote device Bd address.
4736 * @param[in] file_name_array Array of filepaths to be sent.
4739 * @see bluetooth_opc_cancel_push
4742 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4743 char **file_name_array);
4746 * @fn int bluetooth_opc_cancel_push(void)
4747 * @brief Cancels the ongoing file push.
4749 * This function is a asynchronous call.
4750 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4751 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4753 * @return BLUETOOTH_ERROR_NONE - Success \n
4754 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4755 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4760 * @see bluetooth_opc_push_files
4763 int bluetooth_opc_cancel_push(void);
4766 * @fn gboolean bluetooth_opc_session_is_exist(void)
4767 * @brief Informs whether opc session exists or not.
4769 * This function is a synchronous call.
4771 * @return TRUE - OPC session exists \n
4772 * FALSE - OPC session does not exist \n
4780 gboolean bluetooth_opc_session_is_exist(void);
4783 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4784 * @brief Informs whether opc session exists or not.
4786 * This function is a synchronous call.
4788 * @return BLUETOOTH_ERROR_NONE - Success \n
4789 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4790 * BLUETOOTH_ERROR_INTERNAL \n
4793 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4798 int bluetooth_opc_is_sending(gboolean *is_sending);
4801 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4802 int transfer_id, unsigned char *progress)
4803 * @brief Gets the percentage progress for ongoing transfers.
4805 * This function is a synchronous call.
4807 * @return BLUETOOTH_ERROR_NONE - Success \n
4808 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4809 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4812 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4813 * @param[in] transfer_id Transfer ID
4814 * @param[out] progress Percentage Progress
4818 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4819 int transfer_id, unsigned char *progress);
4822 * @fn int bluetooth_obex_server_init(const char *dst_path)
4823 * @brief Initialize OPP and FTP server.
4825 * This function is a synchronous call.
4826 * No event corresponding to this api
4828 * @return BLUETOOTH_ERROR_NONE - Success \n
4829 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4830 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4831 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4832 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4835 * @param[in] dst_path OPS destination file path.
4837 * @see bluetooth_obex_server_deinit
4839 int bluetooth_obex_server_init(const char *dst_path);
4843 * @fn int bluetooth_obex_server_deinit(void)
4844 * @brief Deinitialize OPP and FTP server.
4846 * This function is a synchronous call.
4847 * No event corresponding to this api
4849 * @return BLUETOOTH_ERROR_NONE - Success \n
4850 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4851 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4856 * @see bluetooth_obex_server_init
4858 int bluetooth_obex_server_deinit(void);
4862 * @fn gboolean bluetooth_obex_server_is_activated(void)
4863 * @brief Informs whether obex server is activated or not.
4865 * This function is a synchronous call.
4867 * @return TRUE - OBEX server is activated \n
4868 * FALSE - OBEX server is not activated \n
4875 gboolean bluetooth_obex_server_is_activated(void);
4879 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4880 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4882 * This function is a synchronous call.
4883 * No event corresponding to this api
4885 * @return BLUETOOTH_ERROR_NONE - Success \n
4886 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4887 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4888 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4889 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4893 * @param[in] dst_path OPS destination file path.
4895 * @see bluetooth_obex_server_deinit_without_agent
4897 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4901 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4902 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4904 * This function is a synchronous call.
4905 * No event corresponding to this api
4907 * @return BLUETOOTH_ERROR_NONE - Success \n
4908 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4909 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4914 * @see bluetooth_obex_server_init_without_agent
4916 int bluetooth_obex_server_deinit_without_agent(void);
4920 * @fn int bluetooth_obex_server_accept_connection(void)
4921 * @brief Accepts the authorization request indicated by the event
4922 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4924 * This function is a synchronous call.
4926 * @return BLUETOOTH_ERROR_NONE - Success \n
4927 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4928 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4932 * @see bluetooth_obex_server_reject_authorize
4934 int bluetooth_obex_server_accept_connection(void);
4938 * @fn int bluetooth_obex_server_reject_connection(void)
4939 * @brief Rejects the authorization request indicated by the event
4940 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4942 * This function is a synchronous call.
4944 * @return BLUETOOTH_ERROR_NONE - Success \n
4945 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4946 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4950 * @see bluetooth_obex_server_reject_authorize
4952 int bluetooth_obex_server_reject_connection(void);
4956 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4957 * @brief Accepts the authorization request indicated by the event
4958 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4960 * This function is a asynchronous call.
4961 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4963 * @return BLUETOOTH_ERROR_NONE - Success \n
4964 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4965 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4966 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4969 * @param[in] filename Authorized filename.
4972 * @see bluetooth_obex_server_reject_authorize
4975 int bluetooth_obex_server_accept_authorize(const char *filename);
4978 * @fn int bluetooth_obex_server_reject_authorize(void)
4979 * @brief Reject the authorization request indicated by the event
4980 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4982 * This function is a asynchronous call.
4983 * No event for this api..
4985 * @return BLUETOOTH_ERROR_NONE - Success \n
4986 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4987 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4992 * @see bluetooth_obex_server_accept_authorize
4995 int bluetooth_obex_server_reject_authorize(void);
4998 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4999 * @brief Set the OPS destination file path..
5001 * This function is a asynchronous call.
5002 * No event for this api..
5004 * @return BLUETOOTH_ERROR_NONE - Success \n
5005 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5006 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5007 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5010 * @param[in] dst_path OPS destination file path.
5016 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5019 * @fn int bluetooth_obex_server_set_root(const char *root)
5020 * @brief Set the FTS root folder..
5022 * This function is a asynchronous call.
5023 * No event for this api..
5025 * @return BLUETOOTH_ERROR_NONE - Success \n
5026 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5027 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5028 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5029 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5030 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5033 * @param[in] root FTS root folder.
5039 int bluetooth_obex_server_set_root(const char *root);
5042 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5043 * @brief Cancel the transfer on server
5045 * This function is an asynchronous call.
5046 * If the function call that cancels transfer is successful, the application would receive
5047 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5048 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5049 * the error code will be BLUETOOTH_ERROR_NONE
5051 * @return BLUETOOTH_ERROR_NONE - Success \n
5052 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5053 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5054 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5055 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5058 * @param[in] transfer_id transfer ID
5063 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5067 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5068 * @brief Cancel the transfer on server
5070 * This function is an asynchronous call.
5071 * If the function call that cancels transfer is successful, the application would receive
5072 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5073 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5074 * the error code will be BLUETOOTH_ERROR_NONE
5076 * @return BLUETOOTH_ERROR_NONE - Success \n
5077 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5078 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5079 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5080 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5087 int bluetooth_obex_server_cancel_all_transfers(void);
5091 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5092 * @brief Informs whether obex server is receiving or not.
5094 * This function is a synchronous call.
5096 * @return BLUETOOTH_ERROR_NONE - Success \n
5097 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5098 * BLUETOOTH_ERROR_INTERNAL \n
5101 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5106 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5110 * @fn int bluetooth_map_client_init(void)
5111 * @brief Initialize MAP client.
5113 * This function is a synchronous call.
5114 * No event corresponding to this api
5116 * @return BLUETOOTH_ERROR_NONE - Success \n
5117 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5118 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5119 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5120 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5125 * @see bluetooth_map_client_deinit
5127 int bluetooth_map_client_init(void);
5129 int bluetooth_map_client_deinit(void);
5131 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5133 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5135 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5137 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5138 bt_map_client_list_folders_filter_t *filter);
5141 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5142 * @brief Return all available fields that can be used in Fields filter.
5144 * This function is a asynchronous call.
5146 * @return BLUETOOTH_ERROR_NONE - Success \n
5147 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5148 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5151 * @param[in] session Information about session.
5154 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5156 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5158 bt_map_client_list_messages_filter_t *filter);
5160 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5162 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5163 const char *source_file,
5165 bt_map_client_push_message_args_t *args);
5167 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5168 const bt_map_client_message_object_t message_object,
5169 const char *target_file,
5174 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5175 * @brief Read the local Hash and Randmizer.
5177 * This function is a synchronous call.
5179 * @return BLUETOOTH_ERROR_NONE - Success \n
5180 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5184 * @param[out] local_oob_data - Pointer to the local OOB data
5190 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5194 * @fn int bluetooth_oob_add_remote_data(
5195 * const bluetooth_device_address_t *remote_device_address,
5196 * bluetooth_bdaddr_type_e address_type,
5197 * bt_oob_data_t *oob_data)
5198 * @brief Add/updated the remote device Hash and Randmizer.
5200 * This function is a synchronous call.
5201 * No event for this api..
5203 * @return BLUETOOTH_ERROR_NONE - Success \n
5204 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5207 * @param[in] remote_device_address - Remote device address
5208 * address_type - bdaddr type
5209 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5215 int bluetooth_oob_add_remote_data(
5216 const bluetooth_device_address_t *remote_device_address,
5217 bluetooth_bdaddr_type_e address_type,
5218 bt_oob_data_t *remote_oob_data);
5222 * @fn int bluetooth_oob_remove_remote_data(
5223 * const bluetooth_device_address_t *remote_device_address)
5224 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5226 * This function is a synchronous call.
5227 * No event for this api..
5229 * @return BLUETOOTH_ERROR_NONE - Success \n
5230 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5233 * @param[in] remote_device_address - Remote device address
5239 int bluetooth_oob_remove_remote_data(
5240 const bluetooth_device_address_t *remote_device_address);
5244 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5245 * @brief Read the local Hash and Randmizer.
5247 * This function is a synchronous call.
5249 * @return BLUETOOTH_ERROR_NONE - Success \n
5250 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5254 * @param[out] local_oob_data - Pointer to the local OOB data
5259 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5262 * @fn int bluetooth_le_oob_add_remote_data(
5263 * const bluetooth_device_address_t *remote_device_address,
5264 * bluetooth_bdaddr_type_e address_type,
5265 * bt_oob_data_t *oob_data)
5266 * @brief Add/updated the remote device Hash and Randmizer.
5268 * This function is a synchronous call.
5269 * No event for this api..
5271 * @return BLUETOOTH_ERROR_NONE - Success \n
5272 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5275 * @param[in] remote_device_address - Remote device address
5276 * address_type - bdaddr type
5277 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5282 int bluetooth_le_oob_add_remote_data(
5283 const bluetooth_device_address_t *remote_device_address,
5284 bluetooth_bdaddr_type_e address_type,
5285 bt_oob_data_t *remote_oob_data);
5288 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5289 * bt_gatt_handle_info_t *prim_svc);
5291 * @brief Gets the GATT based primary services handle supported by remote device
5293 * This function is a synchronous call.
5294 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5296 * @return BLUETOOTH_ERROR_NONE - Success \n
5297 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5298 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5299 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5302 * @param[in] address - Remote device address
5303 * @param[out] prim_svc - Structure containing remote service count and handle list.
5306 * @see bluetooth_gatt_free_primary_services()
5308 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5309 bt_gatt_handle_info_t *prim_svc);
5312 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5314 * @brief Discovers the characteristics of GATT based service of remote device
5316 * This function is an asynchronous call.
5317 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5319 * @return BLUETOOTH_ERROR_NONE - Success \n
5320 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5321 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5322 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5325 * @param[in] service_handle - Handle for remote service.
5330 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5332 int bluetooth_gatt_set_service_change_watcher(
5333 const bluetooth_device_address_t *address, gboolean enable);
5336 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5337 * bt_gatt_service_property_t *service);
5339 * @brief Gets the properties of GATT based service of remote device
5341 * This function is a synchronous call.
5342 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5344 * @return BLUETOOTH_ERROR_NONE - Success \n
5345 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5346 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5347 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5350 * @param[in] service_handle - Handle for remote service.
5351 * @param[out] service - Structure containing remote service property.
5354 * @see bluetooth_gatt_free_service_property()
5356 int bluetooth_gatt_get_service_property(const char *service_handle,
5357 bt_gatt_service_property_t *service);
5360 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5362 * @brief Register to GATT based service to receive value change notification/indication.
5364 * This function is a synchronous call.
5365 * No event for this api.
5367 * @return BLUETOOTH_ERROR_NONE - Success \n
5368 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5369 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5370 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5373 * @param[in] service_handle - Handle for remote service.
5374 * @param[in] service_name - Friednly name of service uuid.
5379 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5382 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5384 * @brief Unregister GATT based service to receive value change notification/indication.
5386 * This function is a synchronous call.
5387 * No event for this api.
5389 * @return BLUETOOTH_ERROR_NONE - Success \n
5390 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5391 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5392 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5395 * @param[in] service_handle - Handle for remote service.
5400 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5403 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5404 * bt_gatt_char_property_t *characteristic);
5406 * @brief Provides characteristic value along with properties.
5408 * This function is a synchronous call.
5409 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5411 * @return BLUETOOTH_ERROR_NONE - Success \n
5412 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5413 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5414 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5417 * @param[in] char_handle - Handle for Characteristic property.
5418 * @param[out] characteristic - Structure containing remote characteristic property.
5421 * @see bluetooth_gatt_free_char_property()
5423 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5424 bt_gatt_char_property_t *characteristic);
5427 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5428 * bt_gatt_char_property_t *characteristic);
5430 * @brief Provides characteristic descriptor value along with its UUID.
5432 * This function is a synchronous call.
5433 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5435 * @return BLUETOOTH_ERROR_NONE - Success \n
5436 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5437 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5438 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5441 * @param[in] desc_handle - Handle for Characteristic descriptor.
5442 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5445 * @see bluetooth_gatt_free_desc_property()
5447 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5448 bt_gatt_char_descriptor_property_t *descriptor);
5452 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5453 * const guint8 *value, int length)
5455 * @brief Set characteristic value.
5457 * This function is a synchronous call.
5459 * @return BLUETOOTH_ERROR_NONE - Success \n
5460 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5461 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5462 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5465 * @param[in] char_handle - Handle for Characteristic property.
5466 * @param[in] value - New value to set for characteristic property.
5467 * @param[in] length - Length of the value to be set.
5472 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5473 const guint8 *value, int length);
5476 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5477 * const guint8 *value, int length, guint8 write_type)
5479 * @brief Set characteristic value by write type.
5481 * This function is a synchronous call if write type is "write without resonse"
5482 * and it is an asynchronous call if write type is "write with response"
5484 * @return BLUETOOTH_ERROR_NONE - Success \n
5485 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5486 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5487 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5490 * @param[in] char_handle - Handle for Characteristic property.
5491 * @param[in] value - New value to set for characteristic property.
5492 * @param[in] length - Length of the value to be set.
5493 * @param[in] write_type - Type of write.
5498 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5499 const guint8 *value, int length,
5500 guint8 write_type, gpointer app_data);
5504 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5505 * const guint8 *value, int length)
5507 * @brief Set characteristic value request.
5509 * This function is an asynchronous call.
5511 * @return BLUETOOTH_ERROR_NONE - Success \n
5512 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5513 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5514 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5517 * @param[in] char_handle - Handle for Characteristic property.
5518 * @param[in] value - New value to set for characteristic property.
5519 * @param[in] length - Length of the value to be set.
5524 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5525 const guint8 *value, int length);
5528 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5530 * @brief Read characteristic value.
5532 * This function is a asynchronous call.
5534 * @return BLUETOOTH_ERROR_NONE - Success \n
5535 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5536 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5537 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5540 * @param[in] char_handle - Handle for Characteristic property.
5545 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5548 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5549 * const char *service_uuid,
5550 * bt_gatt_service_property_t *service)
5552 * @brief Gets the service property from a device based on a particular uuid
5554 * This function is a synchronous call.
5556 * @return BLUETOOTH_ERROR_NONE - Success \n
5557 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5558 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5559 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5562 * @param[in] address - BD address of the remote device
5563 * @param[in] service_uuid - uuid of the service.
5564 * @param[out] service - Structure containing the service property.
5569 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5570 const char *service_uuid,
5571 bt_gatt_service_property_t *service);
5574 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5575 * const char *char_uuid)
5577 * @brief Gets the characteristic property from a service based on a particular char uuid
5579 * This function is an asynchronous call.
5580 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5582 * @return BLUETOOTH_ERROR_NONE - Success \n
5583 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5584 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5585 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5588 * @param[in] service_handle - Service handle.
5589 * @param[in] uuid - Characteristic uuid.
5594 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5595 const char *char_uuid);
5598 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5600 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5602 * This function is a synchronous call.
5603 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5605 * @return BLUETOOTH_ERROR_NONE - Success \n
5606 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5609 * @param[in] prim_svc - GATT handle info structure
5612 * @see bluetooth_gatt_get_primary_services()
5614 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5617 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5619 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5621 * This function is a synchronous call.
5622 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5624 * @return BLUETOOTH_ERROR_NONE - Success \n
5625 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5628 * @param[in] svc_pty - GATT service property structure.
5631 * @see bluetooth_gatt_get_service_property()
5633 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5636 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5638 * @brief Provides characteristic value along with properties.
5640 * This function is a synchronous call.
5641 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5643 * @return BLUETOOTH_ERROR_NONE - Success \n
5644 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5647 * @param[in] char_pty - GATT characteristics property structure.
5650 * @see bluetooth_gatt_get_characteristics_property()
5652 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5655 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5657 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5659 * This function is a synchronous call.
5660 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5662 * @return BLUETOOTH_ERROR_NONE - Success \n
5663 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5666 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5669 * @see bluetooth_gatt_get_char_descriptor_property()
5671 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5673 #ifdef TIZEN_GATT_CLIENT
5674 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5675 gboolean auto_connect, int client_id);
5677 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5680 #ifdef TIZEN_GATT_CLIENT
5681 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5684 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5688 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5690 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5692 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5694 * @return BLUETOOTH_ERROR_NONE - Success \n
5695 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5698 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5702 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5705 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5707 * @brief Read characteristic descriptor value.
5709 * This function is a asynchronous call.
5711 * @return BLUETOOTH_ERROR_NONE - Success \n
5712 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5713 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5714 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5717 * @param[in] desc_handle - Handle for Characteristic descriptor
5722 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5725 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5726 * const guint8 *value, int length);
5728 * @brief Set characteristic descriptor value.
5730 * This function is a asynchronous call.
5732 * @return BLUETOOTH_ERROR_NONE - Success \n
5733 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5734 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5735 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5738 * @param[in] desc_handle - Handle for Characteristic descriptor
5739 * @param[in] value - New value to set for characteristic descriptor
5740 * @param[in] length - Length of the value to be set.
5745 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5746 const guint8 *value, int length, gpointer app_data);
5748 /* @fn int bluetooth_gatt_init(void)
5750 * @brief Initializes the gatt service.
5752 * This function is a synchronous call.
5753 * @return BLUETOOTH_ERROR_NONE - Success \n
5754 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5755 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5756 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5759 * @remark Adapter should be enabled
5760 * @see bluetooth_gatt_deinit()
5762 int bluetooth_gatt_init(void);
5764 /* @fn int bluetooth_gatt_init(void)
5766 * @brief DeInitializes the gatt service.
5768 * This function is a synchronous call.
5769 * @return BLUETOOTH_ERROR_NONE - Success \n
5770 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5771 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5772 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5775 * @remark Adapter should be enabled
5776 * @see bluetooth_gatt_init()
5778 int bluetooth_gatt_deinit(void);
5780 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5781 unsigned char **svc_path)
5783 * @brief Exports a new gatt service to the service interface.
5785 * This function is a synchronous call.
5787 * @return BLUETOOTH_ERROR_NONE - Success \n
5788 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5789 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5793 * @param[in] svc_uuid Gatt service uuid.
5794 * @param[out] svc_path service object path of the exported service.
5795 * @remark Adapter should be enabled
5796 * @see bluetooth_gatt_init()
5798 int bluetooth_gatt_add_service(const char *svc_uuid,
5801 /* @fn int bluetooth_gatt_add_new_characteristic(
5802 const char *svc_path, const char *char_uuid,
5803 bt_gatt_permission_t permissions,
5804 bt_gatt_characteristic_property_t properties,
5805 int flags_length, char **char_path);;
5807 * @brief Exports a new gatt characteristic to the characteristic interface.
5809 * This function is a synchronous call.
5810 * @return BLUETOOTH_ERROR_NONE - Success \n
5811 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5812 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5813 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5815 * @param[in] svc_path service object path of the exported service.
5816 * @param[in] char_uuid Gatt service uuid.
5817 * @param[in] properties GATT characteristic properties.
5818 * @param[out] char_path characteristic object path of the exported characteristic.
5820 * @remark Adapter should be enabled
5821 * @see bluetooth_gatt_add_service()
5823 int bluetooth_gatt_add_new_characteristic(
5824 const char *svc_path, const char *char_uuid,
5825 bt_gatt_permission_t permissions,
5826 bt_gatt_characteristic_property_t properties,
5829 /* @fn bluetooth_gatt_set_characteristic_value(
5830 const char *characteristic, const char *char_value,
5833 * @brief adds gatt charactertisic value to the given charactertistic path.
5835 * This function is a synchronous call.
5836 * @return BLUETOOTH_ERROR_NONE - Success \n
5837 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5838 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5839 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5841 * @param[in] char_value Value of the GATT characteristic to be added.
5842 * @param[in] value_length length of the chantacteristic value..
5843 * @param[out] characteristic characteristic object path..
5845 * @remark Adapter should be enabled
5846 * @see bluetooth_gatt_add_service()
5848 int bluetooth_gatt_set_characteristic_value(
5849 const char *characteristic, const char *char_value,
5852 /* @fn int bluetooth_gatt_add_descriptor(
5853 const char *char_path, const char *desc_uuid,
5854 bt_gatt_permission_t permissions,
5857 * @brief Exports a new gatt descriptor to the descriptor interface.
5859 * This function is a synchronous call.
5861 * @return BLUETOOTH_ERROR_NONE - Success \n
5862 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5863 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5864 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5867 * @param[in] desc_uuid Gatt descriptor uuid.
5868 * @param[in] desc_value GATT descriptor value.
5869 * @param[in] value_length Length of GATT descriptor value.
5870 * @param[in] permissions descriptor permissions.
5871 * @param[in] properties GATT descriptor properties.
5872 * @param[in] char_path characteristics object path of the exported character.
5874 * @remark Adapter should be enabled
5875 * @see bluetooth_gatt_add_service()
5876 * @see bluetooth_gatt_add_characteristics()
5878 int bluetooth_gatt_add_descriptor(
5879 const char *char_path, const char *desc_uuid,
5880 bt_gatt_permission_t permissions,
5883 /* @fn int bluetooth_gatt_set_descriptor_value(
5884 const char *desc_path, const char *desc_value,
5887 * @brief Adds value to the given descriptor handle.
5889 * This function is a synchronous call.
5891 * @return BLUETOOTH_ERROR_NONE - Success \n
5892 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5893 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5894 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5897 * @param[in] desc_value GATT descriptor value.
5898 * @param[in] value_length Length of GATT descriptor value.
5899 * @param[in] desc_path descriptor path to which the value needs to be added.
5901 * @remark Adapter should be enabled
5902 * @see bluetooth_gatt_add_service()
5903 * @see bluetooth_gatt_add_characteristics()
5905 int bluetooth_gatt_set_descriptor_value(
5906 const char *desc_path, const char *desc_value,
5909 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5911 * @brief Reads the Service registered on manager interface.
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
5921 * @param[in] svc_uuid Gatt Service uuid.
5923 * @remark Adapter should be enabled and service should be registered.
5924 * @see bluetooth_gatt_register_service()
5926 int bluetooth_gatt_get_service(const char *svc_uuid);
5928 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5930 * @brief Registers the given service path with the library.
5932 * This function is a synchronous call.
5934 * @return BLUETOOTH_ERROR_NONE - Success \n
5935 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5936 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5937 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5940 * @param[in] svc_path service object path of the exported service.
5942 * @remark Adapter should be enabled
5943 * @see bluetooth_gatt_add_service()
5944 * @see bluetooth_gatt_add_characteristics()
5945 * @see bluetooth_gatt_add_descriptor()
5946 * @see bluetooth_gatt_register_application()
5948 int bluetooth_gatt_register_service(const char *svc_path);
5950 /* @fn int bluetooth_gatt_register_application(void)
5952 * @brief Registers the application with the bluez gatt server.
5954 * This function is a synchronous call.
5956 * @return BLUETOOTH_ERROR_NONE - Success \n
5957 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5958 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5959 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5963 * @remark Adapter should be enabled
5964 * @see bluetooth_gatt_init()
5965 * @see bluetooth_gatt_add_service()
5966 * @see bluetooth_gatt_add_characteristics()
5967 * @see bluetooth_gatt_add_descriptor()
5968 * @see bluetooth_gatt_register_service()
5970 int bluetooth_gatt_register_application(void);
5972 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5974 * @brief Removes(unregister) service from the bluez gatt server db.
5976 * This function is a synchronous call.
5978 * @return BLUETOOTH_ERROR_NONE - Success \n
5979 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5980 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5981 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5984 * @param[in] svc_path service object path of the exported service.
5986 * @remark Adapter should be enabled
5987 * @see bluetooth_gatt_add_service()
5988 * @see bluetooth_gatt_add_characteristics()
5989 * @see bluetooth_gatt_add_descriptor()
5990 * @see bluetooth_gatt_register_service()
5992 int bluetooth_gatt_unregister_service(const char *svc_path);
5994 /* @fn int bluetooth_gatt_unregister_application(void)
5996 * @brief Removes(unregister) the application with the bluez gatt server,
5997 * and deletes all the service registered.
5999 * This function is a synchronous call.
6001 * @return BLUETOOTH_ERROR_NONE - Success \n
6002 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6003 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6004 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6008 * @remark Adapter should be enabled
6009 * @see bluetooth_gatt_init()
6010 * @see bluetooth_gatt_add_service()
6011 * @see bluetooth_gatt_add_characteristics()
6012 * @see bluetooth_gatt_add_descriptor()
6013 * @see bluetooth_gatt_register_service()
6014 * @see bluetooth_gatt_unregister_service()
6016 int bluetooth_gatt_unregister_application(void);
6018 /* @fn int bluetooth_gatt_send_response(int request_id,
6019 * int offset, char *value, int value_length)
6021 * @brief Updates the attribute value in local attribute list.
6023 * This function is a synchronous call.
6025 * @return BLUETOOTH_ERROR_NONE - Success \n
6026 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6027 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6028 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6031 * @param[in] request_id The identification of a read request
6032 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6033 * @param[in] resp_state The identification of response state
6034 * @param[in] offset The offset from where a value is read
6035 * @param[in] value The value to be sent. It will be sent from @a offset.
6036 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6037 * @param[in] value_length Value Length.
6039 * @remark Adapter should be enabled
6040 * @see bluetooth_gatt_add_service()
6041 * @see bluetooth_gatt_add_characteristics()
6042 * @see bluetooth_gatt_add_descriptor()
6043 * @see bluetooth_gatt_register_service()
6045 int bluetooth_gatt_send_response(int request_id, guint req_type,
6046 int resp_state, int offset, char *value, int value_length);
6048 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6050 * @brief Sets the notification property for a characteristic.
6052 * This function is a synchronous call.
6054 * @return BLUETOOTH_ERROR_NONE - Success \n
6055 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6056 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6057 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6060 * @param[in] char_path characteristic object path.
6061 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6063 * @remark Adapter should be enabled
6064 * @see bluetooth_gatt_update_characteristic()
6066 int bluetooth_gatt_server_set_notification(const char *char_path,
6067 bluetooth_device_address_t *unicast_address);
6069 /* @fn int bluetooth_gatt_delete_services(void)
6071 * @brief deletes (unregisters) all services from the gatt server database..
6073 * This function is a synchronous call.
6075 * @return BLUETOOTH_ERROR_NONE - Success \n
6076 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6077 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6078 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6082 * @remark Adapter should be enabled
6083 * @see bluetooth_gatt_add_service()
6084 * @see bluetooth_gatt_add_characteristics()
6085 * @see bluetooth_gatt_add_descriptor()
6086 * @see bluetooth_gatt_register_service()
6087 * @see bluetooth_gatt_unregister_service()
6089 int bluetooth_gatt_delete_services(void);
6091 /* @fn int bluetooth_gatt_update_characteristic(void)
6093 * @brief updates the given characteristic with a new value
6095 * This function is a synchronous call.
6097 * @return BLUETOOTH_ERROR_NONE - Success \n
6098 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6099 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6100 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6104 * @remark Adapter should be enabled
6105 * @see bluetooth_gatt_add_service()
6106 * @see bluetooth_gatt_add_characteristics()
6107 * @see bluetooth_gatt_add_descriptor()
6108 * @see bluetooth_gatt_register_service()
6109 * @see bluetooth_gatt_unregister_service()
6111 int bluetooth_gatt_update_characteristic(const char *char_path,
6112 const char* char_value, int value_length);
6115 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6117 * @brief Set advertising status.
6119 * This function is used to enable or disable LE advertising.
6120 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6122 * This function is a synchronous call.
6124 * @return BLUETOOTH_ERROR_NONE - Success \n
6125 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6126 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6129 * @param[in] enable - The status of advertising
6132 * @see bluetooth_set_advertising_data
6134 int bluetooth_set_advertising(int handle, gboolean enable);
6137 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6139 * @brief Set advertising status along with interval value.
6141 * This function is used to enable or disable LE advertising.
6142 * Interval_min and Interval_max is used to set the best advertising interval.
6143 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6145 * This function is a synchronous call.
6147 * @return BLUETOOTH_ERROR_NONE - Success \n
6148 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6149 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6152 * @param[in] enable - The status of advertising
6153 * @param[in] interval_min - Minimum interval of advertising (msec)
6154 * @param[in] interval_max - Maximum interval of advertising (msec)
6155 * @param[in] filter_policy - Advertising filter policy
6158 * @see bluetooth_set_advertising_data
6160 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6161 bluetooth_advertising_params_t *params);
6164 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6165 * @brief Get the advertising data
6167 * This function is used to get advertising data.
6168 * Before calling this API, the adapter should be enabled.
6170 * This function is a synchronous call.
6172 * @return BLUETOOTH_ERROR_NONE - Success \n
6173 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6174 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6175 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6177 * @param[out] value - Advertising data structure.
6178 * @param[out] length - The length of Advertising data.
6182 bluetooth_advertising_data_t *value = { {0} };
6185 ret = bluetooth_get_advertising_data(&value, &length);
6188 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6191 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6193 * @brief Set advertising data with value
6195 * This function is used to set advertising data and Maximum size of advertising data
6196 * is 28 byte (Except Flag)
6198 * This function is a synchronous call.
6200 * @return BLUETOOTH_ERROR_NONE - Success \n
6201 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6202 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6205 * @param[in] value - Advertising data structure.
6209 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6212 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6214 * @brief Check the privilege for advertising parameter setting
6216 * This function is a synchronous call.
6218 * @return BLUETOOTH_ERROR_NONE - Success \n
6219 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6225 int bluetooth_check_privilege_advertising_parameter(void);
6228 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6229 * @brief Get the LE scan response data
6231 * This function is used to get scan response data.
6232 * Before calling this API, the adapter should be enabled.
6234 * This function is a synchronous call.
6236 * @return BLUETOOTH_ERROR_NONE - Success \n
6237 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6238 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6239 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6241 * @param[out] value - Scan response data structure.
6242 * @param[out] length - The length of Scan response data.
6246 bluetooth_scan_resp_data_t *value = { {0} };
6249 ret = bluetooth_get_scan_response_data(&value, &length);
6252 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6255 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6257 * @brief Set scan response data with value
6259 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6261 * This function is a synchronous call.
6263 * @return BLUETOOTH_ERROR_NONE - Success \n
6264 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6265 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6268 * @param[in] value - LE Scan response data structure.
6272 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6275 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6277 * @brief Set scan interval and window
6279 * This function is used to set LE scan interval and window size
6281 * This function is a synchronous call.
6283 * @return BLUETOOTH_ERROR_NONE - Success \n
6284 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6285 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6288 * @param[in] interval - Interval of LE scan (msec)
6289 * @param[in] window - Window size of LE scan (msec)
6293 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6296 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6298 * @brief Set scan type
6300 * This function is used to set LE scan type
6302 * This function is a synchronous call.
6304 * @return BLUETOOTH_ERROR_NONE - Success \n
6305 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6306 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6309 * @param[in] scan_type - LE scan type
6313 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6316 * @fn int bluetooth_is_advertising(void)
6317 * @brief Check for the advertising is in-progress or not.
6319 * This API is used to check the current status of the advertising procedure.
6320 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6323 * This function checks whether the advertising is started or not.
6325 * This function is a synchronous call.
6327 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6329 * @return BLUETOOTH_ERROR_NONE - Success \n
6330 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6333 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6337 gboolean is_advertising = 0;
6339 ret = bluetooth_is_advertising(&is_advertising);
6342 int bluetooth_is_advertising(gboolean *is_advertising);
6345 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6346 * @brief Add LE device to white list
6348 * This API is used to add LE device to white list
6349 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6353 * This function is a synchronous call.
6355 * @param[in] address The address of remote device
6357 * @return BLUETOOTH_ERROR_NONE - Success \n
6358 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6361 * @see bluetooth_set_custom_advertising
6363 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6366 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6367 * @brief Remove LE device from white list
6369 * This API is used to remove LE device from white list
6370 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6374 * This function is a synchronous call.
6376 * @param[in] address The address of remote device
6378 * @return BLUETOOTH_ERROR_NONE - Success \n
6379 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6382 * @see bluetooth_set_custom_advertising
6384 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6387 * @fn int bluetooth_clear_white_list(void)
6388 * @brief Clear white list
6390 * This API is used to clear white list
6391 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6395 * This function is a synchronous call.
6397 * @param[in] address The address of remote device
6399 * @return BLUETOOTH_ERROR_NONE - Success \n
6400 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6403 * @see bluetooth_set_custom_advertising
6405 int bluetooth_clear_white_list(void);
6408 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6409 * const bluetooth_le_connection_param_t *parameters)
6410 * @brief update connection paramter of LE connection.
6412 * This function is a synchronous call.
6414 * @return BLUETOOTH_ERROR_NONE - Success \n
6415 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6418 * @param[in] address - remote device address value.
6419 * @param[in] parameters - new connection parameters.
6422 * @see bluetooth_bond_device
6424 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6425 const bluetooth_le_connection_param_t *parameters);
6428 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6430 * @brief Enable/Disable LE Privacy feature.
6432 * This function is used to enable or disable LE Privacy feature.
6433 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6435 * This function is a synchronous call.
6437 * @return BLUETOOTH_ERROR_NONE - Success \n
6438 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6439 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6442 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6446 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6449 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6451 * @brief Enable/Disable LE static random address.
6453 * This function is used to enable or disable LE static random address.
6455 * This function is a synchronous call.
6457 * @return BLUETOOTH_ERROR_NONE - Success \n
6458 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6459 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6462 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6466 int bluetooth_set_le_static_random_address(gboolean enable);
6469 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6470 * bluetooth_le_connection_mode_t mode)
6471 * @brief update connection paramter of LE connection.
6473 * This function is a synchronous call.
6475 * @return BLUETOOTH_ERROR_NONE - Success \n
6476 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6477 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6480 * @param[in] address - remote device address value.
6481 * @param[in] mode - new connection mode.
6485 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6486 bluetooth_le_connection_mode_t mode);
6489 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6490 * @brief Request for new ATT MTU value.
6492 * This function is a asynchronous call.
6494 * @return BLUETOOTH_ERROR_NONE - Success \n
6495 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6496 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6499 * @param[in] address - remote device address value.
6500 * @param[in] mtu - MTU value to be set.
6504 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6507 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6508 * unsigned int *mtu)
6509 * @brief Gets the xisting MTU value set for a connection.
6511 * This function is a synchronous call.
6513 * @return BLUETOOTH_ERROR_NONE - Success \n
6514 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6515 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6518 * @param[in] address - remote device address value.
6519 * @param[out] mtu - MTU value set for the connection.
6523 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6527 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6528 * bluetooth_device_address_t *id_address)
6529 * @brief Gets the Identity address of remote device.
6531 * This function is a synchronous call.
6533 * @return BLUETOOTH_ERROR_NONE - Success \n
6534 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6535 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6538 * @param[in] device_rpa - remote Resolvable private address.
6539 * @param[out] id_address - remote Identity device address value.
6543 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6544 bluetooth_device_address_t *id_address);
6547 * @fn int bluetooth_le_read_maximum_data_length()
6548 * @brief reads the maximum LE data length supported in the controller.
6550 * This function is a synchronous call.
6552 * @return BLUETOOTH_ERROR_NONE - Success \n
6553 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6559 int bluetooth_le_read_maximum_data_length(
6560 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6562 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6563 * @brief writes the host suggested values for the controllers max transmitted no of payload
6564 * octects to be used for new connections.
6566 * This function is a synchronous call.
6568 * @return BLUETOOTH_ERROR_NONE - Success \n
6569 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6575 int bluetooth_le_write_host_suggested_default_data_length(
6576 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6578 int bluetooth_le_read_suggested_default_data_length(
6579 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6581 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6582 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6584 int bluetooth_pbap_init(void);
6585 int bluetooth_pbap_deinit(void);
6586 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6587 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6588 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6589 bt_pbap_folder_t *folder);
6590 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6591 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6592 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6593 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6594 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6595 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6596 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6597 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6600 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6602 * @brief Set manufacturer data with value
6604 * This function is used to set manufacturer data.
6606 * This function is a synchronous call.
6608 * @return BLUETOOTH_ERROR_NONE - Success \n
6609 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6610 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6613 * @param[in] value - Manufacturer data structure.
6617 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6619 int bluetooth_set_passkey_notification(gboolean enable);
6622 * @fn int bluetooth_dpm_is_mode_allowed(void);
6624 * @brief Checks Restriction for BT mode(BT allowed or not)
6626 * This function is a synchronous call.
6628 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6629 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6630 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6637 int bluetooth_dpm_is_mode_allowed(void);
6640 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6642 * @brief Sets Restriction for BT mode(BT allowed or not)
6644 * This function is a synchronous call.
6646 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6647 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6648 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6651 * @param[in] value - BT Allow value.
6652 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6653 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6654 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6655 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6659 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6662 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6664 * @brief Reads the Restriction for BT mode(BT allowed or not)
6666 * This function is a synchronous call.
6668 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6669 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6670 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6674 * @param[out] value - BT Allow value.
6675 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6676 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6677 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6678 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6682 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6685 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6687 * @brief Sets the Restriction for device.
6689 * This function is a synchronous call.
6691 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6692 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6693 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6696 * @param[in] value - State value.
6697 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6698 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6702 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6705 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6707 * @brief Reads the Restriction for device.
6709 * This function is a synchronous call.
6711 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6712 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6713 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6717 * @param[out] value - State value.
6718 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6719 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6723 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6726 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6728 * @brief Sets the Restriction for uuid.
6730 * This function is a synchronous call.
6732 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6733 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6734 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6737 * @param[in] value - State value.
6738 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6739 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6743 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6746 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6748 * @brief Reads the Restriction for uuid.
6750 * This function is a synchronous call.
6752 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6753 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6754 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6758 * @param[out] value - State value.
6759 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6760 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6764 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6767 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6769 * @brief Adds the device to 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] device_address - Device address
6782 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6785 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6787 * @brief Adds the device to 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] device_address - Device address
6800 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6803 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6805 * @brief Adds the Service UUIDS to blacklist.
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] service_uuids - profile or custom service uuids
6818 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6821 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6823 * @brief Adds the Service UUIDS to whitelist.
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] service_uuids - profile or custom service uuids
6836 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6839 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6841 * @brief Clears the devices from blacklist.
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
6854 int bluetooth_dpm_clear_devices_from_blacklist(void);
6857 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6859 * @brief Clears the devices from whitelist.
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
6872 int bluetooth_dpm_clear_devices_from_whitelist(void);
6875 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6877 * @brief Clears the uuids from blacklist.
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
6890 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6893 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6895 * @brief Clears the uuids from whitelist.
6897 * This function is a synchronous call.
6899 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6900 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6901 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6908 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6911 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6913 * @brief reads the devices from blacklist.
6915 * This function is a synchronous call.
6917 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6918 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6919 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6922 * @param[out] device_list - list of devices
6926 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6929 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6931 * @brief reads the devices from whitelist.
6933 * This function is a synchronous call.
6935 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6936 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6937 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6940 * @param[out] device_list - list of devices
6944 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6947 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6949 * @brief reads the uuids from blacklist.
6951 * This function is a synchronous call.
6953 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6954 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6955 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6958 * @param[in] uuid_list - list of uuids
6962 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6965 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6967 * @brief reads the uuids from whitelist.
6969 * This function is a synchronous call.
6971 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6972 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6973 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6976 * @param[in] uuid_list - list of uuids
6980 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6983 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6985 * @brief Removes the device from whitelist.
6987 * This function is a synchronous call.
6989 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6990 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6991 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6994 * @param[in] device_address - Device address
6998 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
7001 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7003 * @brief Removes the device from blacklist.
7005 * This function is a synchronous call.
7007 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7008 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7009 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7012 * @param[in] device_address - Device address
7016 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7019 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7021 * @brief Removes the Service UUIDS from whitelist.
7023 * This function is a synchronous call.
7025 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7026 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7027 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7030 * @param[in] service_uuids - profile or custom service uuids
7034 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7037 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7039 * @brief Removes the Service UUIDS from blacklist.
7041 * This function is a synchronous call.
7043 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7044 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7045 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7048 * @param[in] service_uuids - profile or custom service uuids
7052 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7055 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7057 * @brief Sets the Restriction for outgoing call.
7059 * This function is a synchronous call.
7061 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7062 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7063 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7066 * @param[in] value - State value.
7067 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7068 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7072 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7075 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7077 * @brief Reads the Restriction for outgoing call.
7079 * This function is a synchronous call.
7081 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7082 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7083 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7087 * @param[out] value - State value.
7088 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7089 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7093 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7096 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7098 * @brief Sets the Restriction for Pairing.
7100 * This function is a synchronous call.
7102 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7103 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7104 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7107 * @param[in] value - State value.
7108 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7109 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7113 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7116 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7118 * @brief Reads the Restriction for Pairing
7120 * This function is a synchronous call.
7122 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7123 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7124 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7128 * @param[out] value - State value.
7129 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7130 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7134 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7137 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7139 * @brief Sets the Restriction for using Profiles.
7141 * This function is a synchronous call.
7143 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7144 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7145 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7148 * @param[in]profile - Profile.
7149 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7150 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7151 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7152 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7153 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7154 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7155 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7156 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7157 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7158 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7159 * BLUETOOTH_DPM_PROFILE_NONE
7160 * @param[in] value - State value.
7161 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7162 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7166 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7169 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7171 * @brief Reads the Restriction for using Profiles.
7173 * This function is a synchronous call.
7175 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7176 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7177 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7180 * @param[in]profile - Profile.
7181 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7182 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7183 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7184 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7185 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7186 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7187 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7188 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7189 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7190 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7191 * BLUETOOTH_DPM_PROFILE_NONE
7192 * @param[out] value - State value.
7193 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7194 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7198 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7201 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7203 * @brief Sets the Restriction for Desktop Connectivity.
7205 * This function is a synchronous call.
7207 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7208 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7209 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7212 * @param[in] value - State value.
7213 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7214 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7218 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7221 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7223 * @brief Reads the Restriction for Desktop Connectivity.
7225 * This function is a synchronous call.
7227 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7228 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7229 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7233 * @param[out] value - State value.
7234 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7235 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7239 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7242 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7244 * @brief Sets the Restriction for Discoverable state.
7246 * This function is a synchronous call.
7248 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7249 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7250 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7253 * @param[in] value - State value.
7254 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7255 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7259 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7262 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7264 * @brief Reads the Restriction for Discoverable state.
7266 * This function is a synchronous call.
7268 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7269 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7270 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7274 * @param[out] value - State value.
7275 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7276 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7280 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7283 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7285 * @brief Sets the Restriction for linited discoverable state..
7287 * This function is a synchronous call.
7289 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7290 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7291 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7294 * @param[in] value - State value.
7295 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7296 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7300 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7303 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7305 * @brief Reads the Restriction for limited discoverable state.
7307 * This function is a synchronous call.
7309 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7310 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7311 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7315 * @param[out] value - State value.
7316 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7317 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7321 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7323 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7325 * @brief Sets the Restriction for Data trasnfer.
7327 * This function is a synchronous call.
7329 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7330 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7331 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7334 * @param[in] value - State value.
7335 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7336 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7340 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7344 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7346 * @brief Reads the Restriction for Data trasnfer.
7348 * This function is a synchronous call.
7350 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7351 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7352 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7356 * @param[out] value - State value.
7357 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7358 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7362 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7365 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7366 * bluetooth_pxp_poperty_t property, int value);
7368 * @brief Sets the Proximity alert level/properties for monitor role.
7370 * This function is a synchronous call.
7372 * @return BLUETOOTH_ERROR_NONE - Success \n
7373 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7374 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7375 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7378 * @param[in] device_address remote device address
7379 * @param[in] property proximity profile property
7380 * @param[in] value alert level/property value to be set
7385 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7386 bluetooth_pxp_poperty_t property, int value);
7389 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7390 * bluetooth_pxp_poperty_t property, int *value);
7392 * @brief Reads the Proximity alert level/properties for monitor role.
7394 * This function is a synchronous call.
7396 * @return BLUETOOTH_ERROR_NONE - Success \n
7397 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7398 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7399 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7402 * @param[in] device_address remote device address
7403 * @param[in] property proximity profile property
7404 * @param[out] value alert level/property value
7408 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7409 bluetooth_pxp_poperty_t property, int *value);
7412 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7413 * int *services_supported);
7415 * @brief Reads the Proximity Monitor profile supported properties/services.
7417 * This function is a synchronous call.
7419 * @return BLUETOOTH_ERROR_NONE - Success \n
7420 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7421 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7422 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7425 * @param[in] device_address remote device address
7426 * @param[out] services_supported proximity profile property/service
7430 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7431 int *services_supported);
7434 * @fn int bluetooth_proximity_reporter_register();
7436 * @brief Register all proximity related services in BlueZ.
7438 * This function is a synchronous call.
7440 * @return BLUETOOTH_ERROR_NONE - Success \n
7441 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7447 int bluetooth_proximity_reporter_register(void);
7450 * @fn int bluetooth_proximity_reporter_unregister();
7452 * @brief Unregister all proximity related services in BlueZ.
7454 * This function is a synchronous call.
7456 * @return BLUETOOTH_ERROR_NONE - Success \n
7457 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7463 int bluetooth_proximity_reporter_unregister(void);
7466 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7467 * bluetooth_pxp_poperty_t property, int *value);
7469 * @brief Reads the Proximity alert level/properties for reporter role.
7471 * This function is a synchronous call.
7473 * @return BLUETOOTH_ERROR_NONE - Success \n
7474 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7475 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7476 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7479 * @param[in] device_address remote device address
7480 * @param[in] property proximity profile property
7481 * @param[out] value alert level/property value
7485 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7486 bluetooth_pxp_poperty_t property, int *value);
7489 * @fn int bluetooth_tds_provider_register(void);
7491 * @brief Register Transport Discovery Provider role.
7493 * This function is a synchronous call.
7495 * @return BLUETOOTH_ERROR_NONE - Success \n
7496 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7497 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7498 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7506 int bluetooth_tds_provider_register(void);
7509 * @fn int bluetooth_tds_provider_unregister(void);
7511 * @brief Unregister Transport Discovery Provider role.
7513 * This function is a synchronous call.
7515 * @return BLUETOOTH_ERROR_NONE - Success \n
7516 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7517 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7518 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7526 int bluetooth_tds_provider_unregister(void);
7529 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7531 * @brief Create Transport Discovery Provider for a transport.
7533 * This function is a synchronous call.
7535 * @return BLUETOOTH_ERROR_NONE - Success \n
7536 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7537 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7538 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7541 * @param[in] Transport (BT, CUSTOM etc.)
7542 * @param[in] Unique handle for TDS provider.
7547 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7550 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7552 * @brief Remove previously created Transport Discovery Provider.
7554 * This function is a synchronous call.
7556 * @return BLUETOOTH_ERROR_NONE - Success \n
7557 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7560 * @param[in] Unique handle for previously created provider.
7565 int bluetooth_tds_provider_destroy(unsigned int handle);
7568 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7570 * @brief Set transport block for in advertisement and gatt db.
7572 * This function is a synchronous call.
7574 * @return BLUETOOTH_ERROR_NONE - Success \n
7575 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7576 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7577 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7580 * @param[in] Provider specific manufacturer data.
7581 * @param[in] Provider specific manufacturer data length.
7586 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7589 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7590 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7592 * @brief Set transport block for in advertisement and gatt db.
7594 * This function is a synchronous call.
7596 * @return BLUETOOTH_ERROR_NONE - Success \n
7597 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7598 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7599 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7602 * @param[in] Unique handle for TDS provider.
7603 * @param[in] Transport state (On/Off/Not Available).
7604 * @param[in] Transport specific data block.
7605 * @param[in] Transport specific data block length.
7610 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7611 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7614 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7615 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7617 * @brief Send response to TDS activation request from remoted device.
7619 * This function is a synchronous call.
7621 * @return BLUETOOTH_ERROR_NONE - Success \n
7622 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7623 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7624 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7627 * @param[in] Remote device BT address.
7628 * @param[in] Unique handle for TDS provider.
7629 * @param[in] Response for TDS activation request.
7630 * @param[in] Transport specific data block to be sent in activation response.
7631 * @param[in] Data block length.
7636 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7637 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7640 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7642 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7644 * This function is an asynchronous call.
7646 * @return BLUETOOTH_ERROR_NONE - Success \n
7647 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7648 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7649 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7650 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7653 * @param[in] device_address remote device address
7654 * @param[in] handle attribute handle
7656 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7657 * when TDS data is received from Remote provider
7659 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7660 const char *handle);
7663 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7665 * @brief Enables CCCD on Remote Provider.
7667 * This function is an asynchronous call.
7669 * @return BLUETOOTH_ERROR_NONE - Success \n
7670 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7671 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7672 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7673 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7676 * @param[in] device_address remote device address
7677 * @param[in] handle attribute handle
7679 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7680 * when Indication is enabled on Remote provider
7682 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7683 const char *handle);
7686 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7687 * unsigned char *buf, int length);
7688 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7690 * This function is an asynchronous call.
7692 * @return BLUETOOTH_ERROR_NONE - Success \n
7693 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7694 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7695 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7696 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7699 * @param[in] device_address remote device address
7700 * @param[in] handle attribute handle
7701 * @param[in] buf Control point activation param
7702 * @param[in] param length
7704 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7705 * is received from remote Provider
7707 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7708 unsigned char *buf, int length);
7711 * @fn int bluetooth_otp_server_init(const char *directory);
7713 * @brief Starts OTP server.
7715 * This function is a synchronous call.
7725 int bluetooth_otp_server_init(const char *directory);
7728 * @fn int bluetooth_otp_server_deinit();
7730 * @brief Stops OTP server.
7732 * This function is a synchronous call.
7742 int bluetooth_otp_server_deinit();
7745 * @fn int bluetooth_otp_enable_notification(const char *handle);
7747 * @brief Enable notification for remote OACP & OLCP characteristics.
7749 * This function is a synchronous call.
7759 int bluetooth_otp_enable_notification(const char *handle);
7762 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7763 * unsigned char *buf, int length);
7765 * @brief Write value on remote characteristics.
7767 * This function is a synchronous call.
7777 int bluetooth_otp_write_characteristics_value(const char *handle,
7778 unsigned char *buf, int length);
7781 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7783 * @brief Read value for remote characteristics.
7785 * This function is a synchronous call.
7795 int bluetooth_otp_read_characteristic_value(const char *handle);
7798 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7800 * @brief Read value for remote characteristics.
7802 * This function is a synchronous call.
7812 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7815 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7817 * @brief Read value for remote characteristics.
7819 * This function is a synchronous call.
7829 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7832 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7833 * @brief Check if Adapter supports LE 2M PHY feature or not.
7835 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7836 * in BT 5.0 specification.
7838 * This function is a synchronous call.
7840 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7841 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7842 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7843 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7844 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7848 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7851 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7852 * @brief Check if Adapter supports LE 2M CODED feature or not.
7854 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7855 * in BT 5.0 specification.
7857 * This function is a synchronous call.
7859 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7860 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7861 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7862 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7863 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
7867 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
7875 #endif /* __cplusplus */
7876 #endif /* _BLUETOOTH_API_H_*/