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_
30 #endif /* __cplusplus */
33 * @defgroup BLUETOOTHFW BluetoothFW
35 * A base library for bluetooth framework
37 * @addtogroup BLUETOOTHFW
41 #define BLUETOOTH_ADDRESS_STRING_LENGTH 18 /**< This specifies bluetooth device address length (AA:BB:CC:DD:EE:FF) */
42 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
43 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
44 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
45 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
46 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
47 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
48 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
49 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
51 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
52 a device can support */
54 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
56 #define BLUETOOTH_UUID_STRING_MAX 50
57 #define BLUETOOTH_PATH_STRING 50
59 #define BLUETOOTH_OOB_DATA_LENGTH 16
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;
324 * This is data for battery usage monitoring
328 time_t session_start_time;
329 time_t session_end_time;
330 uint16_t session_connected_time;
331 uint16_t session_scan_time;
339 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
340 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
341 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
342 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
343 } bluetooth_adapter_state_t;
349 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
350 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
351 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
352 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
353 } bluetooth_adapter_le_state_t;
359 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
360 /*Changed the order to make it compatable with old method */
361 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
362 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
363 /**< Discoverable mode with time limit
364 After specific timeout, it is changed
365 to non discoverable mode */
366 } bluetooth_discoverable_mode_t;
369 * Network connect mode
372 BLUETOOTH_NETWORK_PANU_ROLE,
374 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
375 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
376 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
377 } bluetooth_network_role_t;
381 * Service type matched to bt_profile_type_t of bt-service-common.h
384 BLUETOOTH_RFCOMM_SERVICE = 0x01,
385 BLUETOOTH_A2DP_SERVICE = 0x02,
386 BLUETOOTH_HSP_SERVICE = 0x04,
387 BLUETOOTH_HID_SERVICE = 0x08,
388 BLUETOOTH_NAP_SERVICE = 0x10,
389 BLUETOOTH_HFG_SERVICE = 0x20,
390 BLUETOOTH_GATT_SERVICE = 0x40,
391 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
392 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
393 BLUETOOTH_PBAP_SERVICE = 0x200,
394 } bluetooth_service_type_t;
400 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
401 /* represents that connection
402 * type can both BR/EDR and LE */
403 BLUETOOTH_DEV_CONN_BREDR = 0x00,
404 BLUETOOTH_DEV_CONN_LE = 0x01,
405 } bluetooth_conn_type_t;
411 BLUETOOTH_CODEC_ID_CVSD = 0x01,
412 BLUETOOTH_CODEC_ID_MSBC = 0x02,
413 } bluetooth_codec_type_t;
419 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
420 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
421 } bluetooth_hf_audio_connected_type_t;
427 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
428 } bluetooth_advertising_data_t;
434 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
435 } bluetooth_scan_resp_data_t;
438 * Advertising filter policy
441 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
442 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
443 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
444 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
445 } bluetooth_advertising_filter_policy_t;
451 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
452 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
453 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
454 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
455 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
456 } bluetooth_advertising_type_t;
459 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
460 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
461 } bluetooth_gatt_service_change_type_t;
464 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
465 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
466 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
467 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
468 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
469 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
470 } bt_gatt_permission_t;
473 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
474 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
475 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
476 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
477 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
478 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
479 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
480 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
481 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
482 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
483 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
484 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
485 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
486 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
487 } bt_gatt_characteristic_property_t;
490 * Remote device request types for attributes
493 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
494 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
495 } bluetooth_gatt_att_request_tyep_t;
498 * Proximity Property Type
501 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
502 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
503 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
504 } bluetooth_pxp_poperty_t;
510 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
511 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
513 BLUETOOTH_TDS_TRANSPORT_INVALID
514 } bluetooth_tds_transport_t;
517 * TDS transport state
520 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
521 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
522 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
523 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
524 } bluetooth_tds_transport_state_t;
531 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
532 } bluetooth_tds_data_t;
535 * TDS activation request
538 bluetooth_device_address_t rem_addr;
539 bluetooth_tds_transport_t transport;
540 bluetooth_tds_data_t tds_data;
541 } bluetooth_tds_activation_req_t;
544 * TDS Control Point data
547 int length; /**< Control point data length */
548 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
549 } bluetooth_control_point_data_t;
552 * TDS Indication Response data
555 bluetooth_device_address_t rem_addr; /**< Device address */
556 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
557 } bluetooth_tds_indication_res_t;
560 * Structure to hold the TDS Complete data information which is read from remote TDS provider
563 bluetooth_device_address_t device_address; /**< Device address */
564 int data_length; /**< Data length */
565 char *data; /**< Complete Transport Specific data */
566 } bluetooth_tds_transport_data_info_t;
569 * OTP Characteristics Value
572 int length; /**< Characteristics value length */
573 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
574 } bluetooth_otp_charc_data_t;
577 * Structure to hold the OTP response data from remote OTP server
580 char *handle; /**< Handle */
581 int data_length; /**< Data length */
582 char *data; /**< Read data */
583 } bluetooth_otp_resp_info_t;
586 * Structure to hold the OTC Channel Info
589 gboolean connected; /**< Connection Status */
591 char *address; /**< Remote address */
592 } bluetooth_otc_info_t;
595 * Advertising parameters
600 guint8 filter_policy;
603 } bluetooth_advertising_params_t;
609 int type; /**< passive 0, active 1 */
610 float interval; /**< LE scan interval */
611 float window; /**< LE scan window */
612 } bluetooth_le_scan_params_t;
622 } bluetooth_le_connection_param_t;
625 LE Read Maximum Data Length
628 guint16 max_tx_octets;
630 guint16 max_rx_octets;
632 } bluetooth_le_read_maximum_data_length_t;
635 LE Read Host suggested default Data Length
638 guint16 def_tx_octets;
640 } bluetooth_le_read_host_suggested_data_length_t;
643 * Samsung XSAT Vendor dependent command
648 } bluetooth_vendor_dep_at_cmd_t;
654 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
655 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
656 } bluetooth_opp_transfer_type_t;
661 } bluetooth_hf_ciev_device_event_t;
663 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
664 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
665 /**< Base ID for GAP Event */
666 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
667 /**< Base ID for SDP events */
668 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
669 /**< Base ID for RFCOMM events */
670 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
671 /**< Base ID for NETWORK events */
672 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
673 /**< Base ID for HDP events */
674 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
675 /**< Base ID for OPC events */
676 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
677 /**< Base ID for Obex Server events */
678 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
679 /**< Base ID for GATT events */
681 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
682 /**< Base ID for Audio events */
683 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
684 /**< Base ID for HID events */
685 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
686 /**< Base ID for Advertising events */
687 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
688 /**< Base ID for PBAP Client events */
689 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
690 /**< Base ID for AVRCP events */
691 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
692 /**< Base ID for IPSP events */
693 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
694 /**< Base ID for MAP events */
697 * Bluetooth event type
700 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
702 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
703 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
704 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
705 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
706 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
707 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
708 /**< Bluetooth event Discoverable timeout requested*/
709 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
710 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
711 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
712 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
713 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
714 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
715 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
716 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
717 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
718 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
719 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
720 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
721 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
722 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
723 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
724 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
725 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
726 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
727 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
728 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
729 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
731 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
732 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
733 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
734 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
735 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
737 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
738 /**< Bluetooth event serice search base id */
739 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
740 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
741 /**< RFCOMM data receive event */
742 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
743 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
745 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
747 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
748 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
750 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
752 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
753 /**< Bluetooth Network event */
754 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
755 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
756 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
757 /**< Network disconnected evnet in server */
759 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
760 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
762 BLUETOOTH_EVENT_HDP_CONNECTED
763 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
764 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
765 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
767 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
768 /* OPC Connected event */
769 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
770 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
771 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
772 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
774 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
775 BLUETOOTH_EVENT_MAP_DISCONNECTED,
777 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
778 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
779 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
780 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
781 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
783 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
784 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
785 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
786 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
787 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
788 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
789 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
790 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
791 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
792 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
793 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
794 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
795 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
797 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
798 /* Obex server authorize event*/
799 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
800 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
801 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
802 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
803 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
804 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
806 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
807 /**<Discovered GATT service characteristics event*/
808 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
809 /**<Remote GATT charateristic value changed event*/
810 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
811 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
812 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
813 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
814 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
815 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
816 #ifdef TIZEN_GATT_CLIENT
817 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
818 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
819 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
820 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
822 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
823 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
825 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
826 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
827 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
828 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
829 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
830 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
831 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
832 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
833 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
834 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
835 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
836 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
837 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
838 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
839 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
840 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
841 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
842 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
843 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
844 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
845 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
846 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
847 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
848 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
849 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
850 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
851 BLUETOOTH_EVENT_HF_CONNECTED,
852 BLUETOOTH_EVENT_HF_DISCONNECTED,
853 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
854 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
855 BLUETOOTH_EVENT_HF_RING_INDICATOR,
856 BLUETOOTH_EVENT_HF_CALL_WAITING,
857 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
858 BLUETOOTH_EVENT_HF_CALL_STARTED,
859 BLUETOOTH_EVENT_HF_CALL_ENDED,
860 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
861 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
862 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
863 BLUETOOTH_EVENT_HF_CALL_STATUS,
864 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
865 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
866 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
867 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
868 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
869 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
870 BLUETOOTH_EVENT_HF_CALL_IDLE,
871 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
872 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
873 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
875 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
876 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
877 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
878 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
879 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
881 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
882 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
883 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
884 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
885 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
886 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
887 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
888 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
890 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
891 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
892 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
893 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
894 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
895 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
896 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
898 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
899 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
900 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
901 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
902 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
903 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
904 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
905 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
906 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
908 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
909 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
910 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
911 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
912 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
913 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
914 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
915 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
916 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
917 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
918 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
920 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
921 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
922 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
923 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
924 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
925 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
926 } bluetooth_event_type_t;
929 * This bt_service_uuid_list_t enum indicates service uuid list .
930 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
934 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
935 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
936 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
937 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
938 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
939 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
940 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
941 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
942 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
943 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
944 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
945 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
946 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
948 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
949 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
950 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
951 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
952 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
953 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
954 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
955 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
956 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
957 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
958 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
959 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
960 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
961 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
963 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
964 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
965 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
966 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
967 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
968 /**<DIRECT PRINTING*/
969 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
970 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
971 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
972 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
973 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
974 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
975 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
976 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
977 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
978 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
979 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
980 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
981 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
982 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
983 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
984 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
985 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
986 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
987 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
988 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
989 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
990 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
991 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
992 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
993 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
994 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
995 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
996 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
997 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
998 } bluetooth_service_uuid_list_t;
1001 * Service class part of class of device returned from device discovery
1004 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1005 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1006 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1007 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1008 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1009 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1010 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1011 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1012 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1013 } bluetooth_device_service_class_t;
1017 * Major device mask (For device discovery)
1020 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1021 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1022 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1023 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1024 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1025 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1026 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1027 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1028 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1029 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1030 } bluetooth_device_major_mask_t;
1034 * Major device class (part of Class of Device)
1037 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1038 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1039 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1040 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1041 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1042 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1043 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1044 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1045 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1046 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1047 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1048 } bluetooth_device_major_class_t;
1051 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1053 /* About Computer Major class */
1054 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1056 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1057 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1058 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1059 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1060 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1062 /* About Phone Major class */
1063 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1064 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1065 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1066 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1067 /**< voice gateway minor class */
1068 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1070 /* About LAN/Network Access Point Major class */
1071 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1072 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1073 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1074 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1075 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1076 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1077 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1078 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1080 /* About Audio/Video Major class */
1081 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1082 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1084 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1085 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1086 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1087 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1088 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1089 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1090 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1091 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1092 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1093 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1094 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1095 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1096 /**< Video Display and Loud
1097 Speaker minor class */
1098 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1101 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1103 /* About Peripheral Major class */
1104 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1105 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1106 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1107 /**< Combo Keyboard or pointing
1108 device minorclass */
1110 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1111 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1112 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1113 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1114 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1115 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1116 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1117 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1118 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1120 /* About Imaging Major class */
1121 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1122 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1123 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1124 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1126 /* About Wearable Major class */
1127 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1128 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1129 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1130 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1131 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1133 /* About Toy Major class */
1134 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1135 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1136 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1137 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1138 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1140 /* About Health Major class */
1141 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1142 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1143 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1144 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1145 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1146 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1147 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1149 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1150 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1151 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1153 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1154 } bluetooth_device_minor_class_t;
1157 * structure to hold the device information
1160 bluetooth_device_major_class_t major_class; /**< major device class */
1161 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1162 bluetooth_device_service_class_t service_class;
1163 /**< service device class */
1164 } bluetooth_device_class_t;
1167 * Discovery Role types
1170 DISCOVERY_ROLE_BREDR = 0x1,
1172 DISCOVERY_ROLE_LE_BREDR
1173 } bt_discovery_role_type_t;
1176 * Connected state types
1179 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1180 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1181 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1182 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1183 } bluetooth_connected_link_t;
1189 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1190 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1191 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1192 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1193 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1194 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1195 } bluetooth_le_scan_filter_feature_t;
1198 * LE connection mode
1201 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1202 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1203 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1204 } bluetooth_le_connection_mode_t;
1207 * structure to hold the device information
1210 bluetooth_device_address_t device_address; /**< device address */
1211 bluetooth_device_name_t device_name; /**< device name */
1212 bluetooth_device_class_t device_class; /**< device class */
1213 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1214 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1216 int rssi; /**< received strength signal*/
1217 gboolean paired; /**< paired flag */
1218 bluetooth_connected_link_t connected; /**< connected link type */
1219 gboolean trust; /**< trust flag */
1220 gboolean is_alias_set; /** is device alias set flag**/
1221 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1222 } bluetooth_device_info_t;
1225 * structure to hold the LE device information
1228 int data_len; /**< manafacturer specific data length */
1229 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1230 } bluetooth_le_advertising_data_t;
1233 bluetooth_device_address_t device_address; /**< device address */
1234 int addr_type; /**< address type*/
1235 int rssi; /**< received strength signal*/
1236 bluetooth_le_advertising_data_t adv_ind_data;
1237 bluetooth_le_advertising_data_t scan_resp_data;
1238 } bluetooth_le_device_info_t;
1242 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1243 bluetooth_device_address_t device_address; /**< device address */
1244 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1245 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1246 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1247 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1248 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1249 bluetooth_le_advertising_data_t service_data; /**< service data */
1250 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1251 int manufacturer_id; /**< manufacturer ID */
1252 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1253 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1254 } bluetooth_le_scan_filter_t;
1257 bluetooth_device_address_t device_address; /**< device address */
1258 unsigned int mtu; /** < MTU set for the ATT connection */
1259 unsigned int status; /** < status of the MTU exchange */
1260 } bluetooth_le_att_mtu_info_t;
1263 * structure to hold the paired device information
1266 bluetooth_device_address_t device_address; /**< paired device address */
1267 bluetooth_device_name_t device_name; /**< device name */
1268 bluetooth_device_class_t device_class; /**< device class */
1269 } bluetooth_paired_device_info_t;
1272 * structure to hold the paired device information
1275 bluetooth_device_address_t device_address;
1276 /**< device address */
1277 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1278 /**< network interface name */
1279 } bluetooth_network_device_info_t;
1282 * Authentication event types
1286 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1287 BLUETOOTH_AUTH_PIN_REQUEST,
1288 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1289 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1290 } bluetooth_auth_type_t;
1293 * structure to hold the pincode/pass-key req informations
1296 bluetooth_device_address_t device_address; /**< remote device address */
1297 bluetooth_device_name_t device_name; /**< device name */
1298 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1299 bool incoming; /**< stores if bonding request is incoming */
1300 } bluetooth_authentication_request_info_t;
1303 * Stucture to hold discovery option
1306 unsigned short max_response; /**< the number of maximum response */
1307 unsigned short discovery_duration;
1308 /**< duration of discovery (seconds) */
1309 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1310 classOfDevice variable */
1311 } bluetooth_discovery_option_t;
1314 * Stucture to hold event information
1317 int event; /**< event type */
1318 int result; /**< Success or error value */
1320 /**<parameter data pointer */
1322 } bluetooth_event_param_t;
1325 bluetooth_device_address_t device_addr;
1326 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1327 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1328 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1333 bluetooth_device_address_t device_addr;
1334 unsigned char addr_type;
1336 } bt_connection_info_t;
1339 * Stucture to rfcomm receive data
1344 /**< the socket fd */
1345 int buffer_size;/**< the length of the receive buffer */
1347 /**< the receive data buffer */
1348 } bluetooth_rfcomm_received_data_t;
1354 HTYPE_TRANS_HANDSHAKE,
1355 HTYPE_TRANS_HID_CONTROL,
1356 HTYPE_TRANS_GET_REPORT,
1357 HTYPE_TRANS_SET_REPORT,
1358 HTYPE_TRANS_GET_PROTOCOL,
1359 HTYPE_TRANS_SET_PROTOCOL,
1361 HTYPE_TRANS_UNKNOWN,
1362 HTYPE_TRANS_GET_IDLE = 0xF0,
1363 HTYPE_TRANS_SET_IDLE = 0xF1,
1364 } bt_hid_header_type_t;
1370 PTYPE_DATA_RTYPE_INPUT,
1371 PTYPE_DATA_RTYPE_OUTPUT
1372 } bt_hid_param_type_t;
1375 * Stucture to hid receive data
1378 const char *address;
1379 bt_hid_header_type_t type;
1380 /**< Header type containing */
1381 bt_hid_param_type_t param;
1382 /**< Param type in header like INPUT Report or OutPut Report */
1383 int buffer_size;/**< the length of the receive buffer */
1385 /**< the receive data buffer */
1386 } bluetooth_hid_received_data_t;
1389 * Stucture to rfcomm connection
1393 int socket_fd; /**< the socket fd */
1394 int server_id; /* Server id */
1395 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1396 bluetooth_device_address_t device_addr;
1397 /**< device address */
1398 char uuid[BLUETOOTH_UUID_STRING_MAX];
1399 } bluetooth_rfcomm_connection_t;
1402 * Stucture to rfcomm disconnection
1406 /**< the socket fd */
1407 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1408 bluetooth_device_address_t device_addr;
1409 /**< device address */
1410 char uuid[BLUETOOTH_UUID_STRING_MAX];
1411 } bluetooth_rfcomm_disconnection_t;
1415 /**< the socket fd */
1416 bluetooth_device_address_t device_addr;
1417 /**< device address */
1418 } bluetooth_rfcomm_connection_request_t;
1427 } bt_hdp_qos_type_t;
1433 HDP_ROLE_SOURCE = 0x0,
1435 } bt_hdp_role_type_t;
1439 * Stucture to HDP connected
1442 const char *app_handle; /**< the application handle */
1443 unsigned int channel_id; /**< the channel id */
1444 bt_hdp_qos_type_t type; /**< the QOS type */
1445 bluetooth_device_address_t device_address; /**< the remote address */
1446 } bt_hdp_connected_t;
1449 * Stucture to HDP disconnected
1452 unsigned int channel_id; /**< the channel id */
1453 bluetooth_device_address_t device_address; /**< the remote address */
1454 } bt_hdp_disconnected_t;
1457 * Stucture to HDP data indication
1460 unsigned int channel_id; /**< the channel id */
1461 const char *buffer; /**< the RX data buffer */
1462 unsigned int size; /**< the RX data size */
1463 } bt_hdp_data_ind_t;
1466 * Stucture to OPP client transfer information
1473 } bt_opc_transfer_info_t;
1475 /* TODO: MAP client structures, see above */
1477 * Stucture to Map filter fields
1482 } bt_map_list_filter_fields_info_t;
1484 /* Obex Server transfer type */
1485 #define TRANSFER_PUT "PUT"
1486 #define TRANSFER_GET "GET"
1488 * Stucture to OPP/FTP Server authorize information
1495 } bt_obex_server_authorize_into_t;
1503 } bt_obex_server_type_t;
1506 * Stucture to OPP/FTP server transfer information
1514 unsigned long file_size;
1516 bt_obex_server_type_t server_type;
1518 unsigned char *contact_auth_info;
1519 } bt_obex_server_transfer_info_t;
1522 * Stucture to OPP/FTP server connection/disconnection information
1528 } bt_obex_server_connection_info_t;
1532 * Stucture to OOB data
1536 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1537 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1538 unsigned int hash_len;
1539 unsigned int randomizer_len;
1541 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1542 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1543 unsigned int hash256_len;
1544 unsigned int randomizer256_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_read_battery_data(bt_battery_data *latest);
2390 int bluetooth_disable_adapter(void);
2391 int bluetooth_recover_adapter(void);
2392 int bluetooth_check_adapter_le(void);
2393 int bluetooth_enable_adapter_le(void);
2395 int bluetooth_disable_adapter_le(void);
2396 int bluetooth_get_uuid_name(const char *uuid, char **name);
2399 * @fn int bluetooth_reset_adapter(void)
2400 * @brief Reset the Bluetooth H/W and values
2403 * This function resets Bluetooth protocol stack and hardware. This function is called when
2404 * an user want to initialize Bluetooth environment.
2406 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2409 * This function is a synchronous call.
2411 * @return BLUETOOTH_ERROR_NONE - Success\n
2412 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2414 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2419 ret = bluetooth_reset_adapter();
2422 int bluetooth_reset_adapter(void);
2425 * @fn int bluetooth_is_supported(void)
2426 * @brief Check if the bluetooth is supported or not by the current target
2428 * This API checks whether the bluetooth is supported or not.
2429 * This API only run by root permission.
2431 * This function is a synchronous call.
2433 * @return 0 - if bluetooth is not supported\n
2434 * 1 - if bluetooth is supported\n
2435 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2440 ret = bluetooth_is_supported();
2443 int bluetooth_is_supported(void);
2447 * @fn int bluetooth_check_adapter(void)
2448 * @brief Check the current status of the Bluetooth adapter
2451 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2452 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2453 * bluetooth adapter.
2454 * This API get the adapter internal data structure and check current adapter status.
2456 * This function is a synchronous call.
2459 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2460 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2462 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2466 ret = bluetooth_check_adapter();
2469 int bluetooth_check_adapter(void);
2472 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2473 * @brief Get the local adapter bluetooth address
2476 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2477 * the adapter should be enabled.
2478 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2479 * contain Bluetooth address.
2480 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2481 * friendly name for each device.
2482 * There is no event callback for this API.
2484 * This function is a synchronous call.
2487 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2488 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2489 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2490 * @param[out] local_address a device address of local bluetooth adapter
2495 bluetooth_device_address_t local_address={0,};
2498 ret = bluetooth_get_local_address(&local_address);
2501 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2504 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2505 * @brief Get the hci version
2508 * This function is used to get the bluetooth hci version
2509 * Before calling this API make sure that the adapter is enabled.
2511 * This function is a synchronous call.
2514 * @return BLUETOOTH_ERROR_NONE - Success \n
2515 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2516 * @param[out] timeout remain visibility timeout value
2519 bluetooth_version_t *version;
2521 ret = bluetooth_get_local_version (&version);
2524 int bluetooth_get_local_version(bluetooth_version_t *version);
2527 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2528 * @brief Get the local device name
2531 * This function is used, get the local device name. Since its difficult to remember the Adapter
2532 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2533 * friendly name is retrived by the remote device and displaying.
2534 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2536 * This function is a synchronous call.
2539 * @return BLUETOOTH_ERROR_NONE - Success \n
2540 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2541 * @param[out] local_name a local device name
2545 bluetooth_device_name_t local_name={0,}
2547 ret = bluetooth_get_local_name (&local_name);
2550 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2553 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2554 * @brief Set the local device name
2557 * This function is used to set the local device name. This is a human friendly name whose
2558 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2560 * This function is a synchronous call.
2562 * @param[in] local_name bluetooth device name to set local device
2564 * @return BLUETOOTH_ERROR_NONE - Success \n
2565 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2566 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2567 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2568 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2569 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2574 bluetooth_device_name_t local_name={0,}
2576 ret = bluetooth_set_local_name (&local_name);
2579 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2583 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2584 * @brief Check if the uuid is used or not
2586 * This function is used to check if the uuid is used or not.
2588 * This function is a synchronous call.
2590 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2591 * @param[out] used if the uuid is used or not
2593 * @return BLUETOOTH_ERROR_NONE - Success \n
2594 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2595 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2596 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2601 gboolean used = FALSE;
2602 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2603 ret = bluetooth_is_service_used(uuid, &used);
2606 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2609 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2610 * @brief Check if the device is connected to the specific service
2612 * This function is used to check if if the device is connected to the specific service.
2614 * This function is a synchronous call.
2616 * @param[in] local_address a device address of remote bluetooth device
2617 * @param[in] type the service type
2618 * @param[out] is_connected if the device is connected or not
2620 * @return BLUETOOTH_ERROR_NONE - Success \n
2621 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2622 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2623 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2628 gboolean is_connected = FALSE;
2629 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2630 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2633 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2634 bluetooth_service_type_t type,
2635 gboolean *is_connected);
2638 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2639 * @brief Gets device's connected link type
2641 * This function is used to get device's connected link type
2643 * This function is a synchronous call.
2645 * @param[in] device_address a device address of remote bluetooth device
2646 * @param[out] connected_link a device's connected link type
2648 * @return BLUETOOTH_ERROR_NONE - Success \n
2649 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2650 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2651 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2656 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2657 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2658 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2661 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2662 bluetooth_connected_link_t *connected_link);
2665 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2666 * @brief Sets a profile trusted for a device
2668 * This function is used to Set a profile as trusted for a device
2670 * This function is a synchronous call.
2672 * @param[in] device_address a device address of remote bluetooth device
2673 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2674 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2676 * @return BLUETOOTH_ERROR_NONE - Success \n
2677 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2678 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2679 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2683 int bluetooth_set_profile_trusted(
2684 const bluetooth_device_address_t *device_address,
2685 int profile, int trust);
2688 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2689 * @brief Gets a profile is trusted for a device
2691 * This function is used to Get a profile is trusted or not for a device
2693 * This function is a synchronous call.
2695 * @param[in] device_address a device address of remote bluetooth device
2696 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2697 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2699 * @return BLUETOOTH_ERROR_NONE - Success \n
2700 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2701 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2702 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2706 int bluetooth_get_profile_trusted(
2707 const bluetooth_device_address_t *device_address,
2708 int profile, int *trust);
2711 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2712 * @brief Get the visibility mode
2715 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2716 * visibity mode, the property of the device is determined whether it can be discoverable, non
2717 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2719 * This function is a synchronous call.
2722 * @return BLUETOOTH_ERROR_NONE - Success \n
2723 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2724 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2725 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2726 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2727 * @param[out] discoverable_mode current bluetooth discoverable mode
2729 * @see bluetooth_set_discoverable_mode
2731 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2733 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2736 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2739 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2741 * @brief Set the visibility mode
2744 * This function is used to set the discoverable mode (Visibility option).
2746 * Many times user may want to keep his device discoverable so that when peer device is performing
2747 * device search, he/she can find user's device. Application programmer can keep the mode as
2748 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2749 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2750 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2751 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2753 * This function is a synchronous call.
2755 * @return BLUETOOTH_ERROR_NONE - Success \n
2756 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2758 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2759 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2761 * @see bluetooth_get_discoverable_mode
2765 bluetooth_discoverable_mode_t mode;
2767 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2768 ret = bluetooth_set_discoverable_mode (mode, 180);
2772 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2777 * @fn int bluetooth_get_timeout_value(int *timeout)
2778 * @brief Get the visibility timeout value
2781 * This function is used to get the visibility timeout
2782 * Before calling this API make sure that the adapter is enabled.
2784 * This function is a synchronous call.
2787 * @return BLUETOOTH_ERROR_NONE - Success \n
2788 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2789 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2791 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2792 * @param[out] timeout remain visibility timeout value
2794 * @see bluetooth_set_discoverable_mode
2798 ret = bluetooth_get_timeout_value (&timeout);
2801 int bluetooth_get_timeout_value(int *timeout);
2805 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2806 * unsigned int classOfDeviceMask)
2807 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2809 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2810 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2811 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2812 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2813 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2814 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2815 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2816 * please see bluetooth_device_info_t for more details.
2819 * This API provides searching options like max responses, discovery duration in seconds and class
2820 * of device mask to filter device search. some times there may be too many bluetooth devices in
2821 * vicinity of your device.in such scenario, application can request to reduce number of responces
2822 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2823 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2824 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2825 * application defined time. please note that discovery_duration should be mentioned in seconds.
2826 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2829 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2830 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2831 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2833 * This function is a asynchronous call.
2834 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2835 * through registered callback function.
2837 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2838 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2840 * The completion or cancellation of the discovery is indicated by an
2841 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2843 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2846 * @return BLUETOOTH_ERROR_NONE - Success \n
2847 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2848 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2849 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2850 agent is not running \n
2852 * @param[in] max_response define the maximum response of the number of founded devices
2854 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2855 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2856 (refer to class of device)
2858 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2861 void bt_event_callback(int event, bluetooth_event_param_t *param)
2865 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2867 bluetooth_device_info_t *device_info = NULL;
2868 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2870 device_info = (bluetooth_device_info_t *)param->param_data;
2871 memcpy(&searched_device, &device_info->device_address,
2872 sizeof(bluetooth_device_address_t));
2873 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2874 device_info->device_address.addr[0],
2875 device_info->device_address.addr[1],
2876 device_info->device_address.addr[2],
2877 device_info->device_address.addr[3],
2878 device_info->device_address.addr[4],
2879 device_info->device_address.addr[5]);
2882 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2884 bluetooth_device_info_t *device_info = NULL;
2885 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2887 device_info = (bluetooth_device_info_t *)param->param_data;
2888 memcpy(&searched_device, &device_info->device_address,
2889 sizeof(bluetooth_device_address_t));
2890 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2891 device_info->device_name.name,
2892 device_info->device_address.addr[0],
2893 device_info->device_address.addr[1],
2894 device_info->device_address.addr[2],
2895 device_info->device_address.addr[3],
2896 device_info->device_address.addr[4],
2897 device_info->device_address.addr[5]);
2901 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2902 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2907 unsigned short max_response;
2908 unsigned short discovery_duration;
2909 unsigned classOfDeviceMask;
2913 discovery_duration =0;
2914 classOfDeviceMask =0;
2916 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2921 int bluetooth_start_discovery(unsigned short max_response,
2922 unsigned short discovery_duration,
2923 unsigned int classOfDeviceMask);
2926 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2927 * unsigned short max_response,
2928 * unsigned short discovery_duration,
2929 * unsigned int classOfDeviceMask)
2930 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2932 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2933 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2934 * Please see bluetooth_start_discovery() for other parameters description.
2936 * This function is a asynchronous call.
2937 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2938 * through registered callback function.
2940 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2941 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2943 * The completion or cancellation of the discovery is indicated by an
2944 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2946 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2949 * @return BLUETOOTH_ERROR_NONE - Success \n
2950 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2951 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2952 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2953 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2954 agent is not running \n
2956 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2957 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2958 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2959 * @param[in] max_response define the maximum response of the number of founded devices
2961 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2962 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2963 (refer to class of device)
2965 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2968 unsigned short type;
2969 unsigned short max_response;
2970 unsigned short discovery_duration;
2971 unsigned classOfDeviceMask;
2976 discovery_duration =0;
2977 classOfDeviceMask =0;
2979 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2984 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2985 unsigned short max_response,
2986 unsigned short discovery_duration,
2987 unsigned int classOfDeviceMask);
2990 * @fn int bluetooth_cancel_discovery (void)
2991 * @brief Cancel the on-going device discovery operation
2994 * This function stops the on-going device discovery operation. This API has to be called after the
2995 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2996 * the bluetooth_start_discovery API
2998 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2999 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3000 * cancel the discover request once the user received the device to which he wish to connect.
3002 * This function is a asynchronous call.
3003 * If the call is success to cancel discovey then the application will receive
3004 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3005 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3006 * BLUETOOTH_ERROR_NONE
3009 * @return BLUETOOTH_ERROR_NONE - Success \n
3010 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3011 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3012 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3013 other application \n
3014 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3016 * @see bluetooth_start_discovery
3018 void bt_event_callback(int event, bluetooth_event_param_t *param)
3022 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3023 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3032 ret = bluetooth_cancel_discovery();
3035 int bluetooth_cancel_discovery(void);
3038 * @fn int bluetooth_start_le_discovery(void)
3039 * @brief Start the generic device discovery which finds the LE devices.
3041 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3042 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3043 * It try to find LE devices. Bluetooth device address and name are
3044 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3045 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3046 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3047 * please see bluetooth_device_info_t for more details.
3049 * This function is a asynchronous call.
3050 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3051 * through registered callback function.
3053 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3056 * The completion or cancellation of the discovery is indicated by an
3057 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3059 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3062 * @return BLUETOOTH_ERROR_NONE - Success \n
3063 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3064 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3065 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3066 agent is not running \n
3069 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3072 void bt_event_callback(int event, bluetooth_event_param_t *param)
3076 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3078 bluetooth_device_info_t *device_info = NULL;
3079 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3081 device_info = (bluetooth_device_info_t *)param->param_data;
3082 memcpy(&searched_device, &device_info->device_address,
3083 sizeof(bluetooth_device_address_t));
3084 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3085 device_info->device_address.addr[0],
3086 device_info->device_address.addr[1],
3087 device_info->device_address.addr[2],
3088 device_info->device_address.addr[3],
3089 device_info->device_address.addr[4],
3090 device_info->device_address.addr[5]);
3094 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3095 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3101 ret = bluetooth_start_discovery();
3106 int bluetooth_start_le_discovery(void);
3109 * @fn int bluetooth_stop_le_discovery (void)
3110 * @brief Cancel the on-going device LE discovery operation
3113 * This function stops the on-going device discovery operation. This API has to be called after the
3114 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3115 * the bluetooth_start_le_discovery API
3118 * This function is a asynchronous call.
3119 * If the call is success to cancel discovey then the application will receive
3120 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3121 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3122 * BLUETOOTH_ERROR_NONE
3125 * @return BLUETOOTH_ERROR_NONE - Success \n
3126 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3127 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3128 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3129 other application \n
3130 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3132 * @see bluetooth_start_discovery
3134 void bt_event_callback(int event, bluetooth_event_param_t *param)
3138 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3139 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3148 ret = bluetooth_stop_le_discovery();
3151 int bluetooth_stop_le_discovery(void);
3154 * @fn int bluetooth_is_discovering(void)
3155 * @brief Check for the device discovery is in-progress or not.
3157 * This API is used to check the current status of the Discovery operation.If discovery is in\
3158 * progress normally other operations are not allowed.
3159 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3160 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3161 * event before performing other operations. This API is used to get for the current discovery
3162 * operation status and using bluetooth_cancel_discovery()
3163 * we can cancell the ongoing discovery process.
3164 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3167 * This function checks whether the device discovery is started or not.
3169 * This function is a synchronous call.
3172 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3173 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3174 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3177 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3181 ret = bluetooth_is_discovering ();
3184 int bluetooth_is_discovering(void);
3187 * @fn int bluetooth_is_le_discovering(void)
3188 * @brief Check for the device LE discovery is in-progress or not.
3190 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3191 * progress normally other operations are not allowed.
3192 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3193 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3194 * event before performing other operations. This API is used to get for the current discovery
3195 * operation status and using bluetooth_stop_le_discovery()
3196 * we can cancell the ongoing LE discovery process.
3197 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3200 * This function checks whether the device LE discovery is started or not.
3202 * This function is a synchronous call.
3205 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3206 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3207 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3210 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3214 ret = bluetooth_is_le_discovering ();
3217 int bluetooth_is_le_discovering(void);
3220 * @fn int bluetooth_is_le_scanning(void)
3221 * @brief Check for the device LE scan is in-progress or not.
3223 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3224 * progress normally other operations are not allowed.
3226 * This function checks whether the device LE Scan is started or not.
3228 * This function is a synchronous call.
3230 * @return TRUE - LE Scan in progress \n
3231 * FALSE - LE Scan is not in progress \n
3236 gboolean is_le_scanning = 0;
3237 is_le_scanning = bluetooth_is_le_scanning ();
3240 gboolean bluetooth_is_le_scanning(void);
3242 gboolean bluetooth_is_scan_filter_supported(void);
3245 * @fn int bluetooth_force_hcidump(int timeout)
3246 * @brief Enable /disable force-hcidump
3248 * This function control force-hcidump.
3250 * This function is a synchronous call.
3252 * @return BLUETOOTH_ERROR_NONE - Success \n
3253 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3254 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3256 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3261 int bluetooth_force_hcidump(int timeout);
3264 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3265 * @brief Register scan filter.
3267 * This function registers the scan filter.
3269 * This function is a synchronous call.
3271 * @return BLUETOOTH_ERROR_NONE - Success \n
3273 * @param[in] filter scan filter to register
3274 * @param[out] slot_id the slot ID of scan filter
3278 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3281 * @fn int bluetooth_unregister_scan_filter(int slot_id)
3282 * @brief Register scan filter.
3284 * This function unregisters the scan filter.
3286 * This function is a synchronous call.
3288 * @return BLUETOOTH_ERROR_NONE - Success \n
3290 * @param[in] slot_id the slot ID of scan filter
3294 int bluetooth_unregister_scan_filter(int slot_id);
3297 * @fn int bluetooth_unregister_all_scan_filters(void)
3298 * @brief Register scan filter.
3300 * This function usregisters all scan filters.
3302 * This function is a synchronous call.
3304 * @return BLUETOOTH_ERROR_NONE - Success \n
3308 int bluetooth_unregister_all_scan_filters(void);
3311 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3312 int link_type, bt_rssi_threshold_t rssi_threshold)
3313 * @brief Enable RSSI monitoring
3315 * This function enables RSSI monitoring and sets threshold for a connection
3317 * @return BLUETOOTH_ERROR_NONE - Success \n
3320 * @see bluetooth_get_rssi_strength
3322 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3323 int link_type, bt_rssi_threshold_t *rssi_threshold);
3326 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3327 * @brief Gets Raw RSSI signal Strength
3329 * This function gives the Raw RSSI signal strength for a connection.
3331 * @return BLUETOOTH_ERROR_NONE - Success \n
3334 * @see bluetooth_enable_rssi
3336 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3338 int bluetooth_set_connectable(gboolean is_connectable);
3340 int bluetooth_is_connectable(gboolean *is_connectable);
3342 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3345 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3346 * @brief Initiate a bonding process
3349 * This function initiates a bonding procedure with a peer device. The bonding procedure
3350 * enables authentication and optionally encryption on the Bluetooth link.
3352 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3353 * inititate the bonding request to the devices already in the paired list.
3355 * Usually we call this API after the device discovery.
3356 * This function is a asynchronous call.
3358 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3359 * mentioed result code
3360 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3361 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3362 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3363 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3364 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3366 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3367 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3370 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3373 * @return BLUETOOTH_ERROR_NONE - Success \n
3374 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3375 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3376 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3377 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3379 * @param[in] device_address This indicates an address of the device with which the pairing
3380 * should be initiated
3382 * @see bluetooth_cancel_bonding
3384 void bt_event_callback(int event, bluetooth_event_param_t *param)
3388 case BLUETOOTH_EVENT_BONDING_FINISHED:
3390 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3391 if (param->result >= BLUETOOTH_ERROR_NONE)
3393 bluetooth_device_info_t *device_info = NULL;
3394 device_info = (bluetooth_device_info_t *)param->param_data;
3395 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3396 mjr[%#x] min[%#x] srv[%#x]",
3397 device_info->device_name.name,
3398 device_info->device_address.addr[0],
3399 device_info->device_address.addr[1],
3400 device_info->device_address.addr[2],
3401 device_info->device_address.addr[3],
3402 device_info->device_address.addr[4],
3403 device_info->device_address.addr[5],
3404 device_info->device_class.major_class,
3405 device_info->device_class.minor_class,
3406 device_info->device_class.service_class);
3420 bluetooth_device_address_t device_address={{0}};
3422 ret = bluetooth_bond_device(&device_address);
3426 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3429 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3430 * bluetooth_conn_type_t conn_type)
3431 * @brief Initiate a bonding process
3434 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3435 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3437 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3438 * inititate the bonding request to the devices already in the paired list.
3440 * Usually we call this API after the device discovery.
3441 * This function is a asynchronous call.
3443 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3444 * mentioed result code
3445 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3446 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3447 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3448 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3449 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3451 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3452 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3455 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3458 * @return BLUETOOTH_ERROR_NONE - Success \n
3459 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3460 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3461 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3462 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3464 * @param[in] device_address This indicates an address of the device with which pairing
3465 * should be initiated
3466 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3469 * @see bluetooth_cancel_bonding
3471 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3472 bluetooth_conn_type_t conn_type);
3475 * @fn int bluetooth_cancel_bonding(void)
3476 * @brief Cancel the on-going bonding process
3478 * This API is called to cancel the on-going bonding procedure. It should be called before the
3479 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3480 * This API is useful when the remote device is not responding to the bond request or we wish to
3481 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3483 * This function is a synchronous call.
3485 * @return BLUETOOTH_ERROR_NONE - Success \n
3486 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3487 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3490 * @see bluetooth_bond_device
3496 ret = bluetooth_cancel_bonding();
3499 int bluetooth_cancel_bonding(void);
3502 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3503 * @brief Remove bonding
3506 * To communicate with remote device over bluetooth link, user should bond with peer device.
3507 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3508 * API is used to remove peer device from the list. Please note that after removing the device
3509 * from bonded device list, you cannot communication with peer device until bonding happens again.
3511 * User can call this function by passing bluetooth device address of any bonded device. Please note
3512 * that after successful return of this function, any bluetooth application running on your device
3513 * will not be able to communicate with unbonded device until bond operation happens again using
3514 * bluetooth_bond_device()
3517 * This function is a asynchronous call. The request to remove the specified device from the bonded
3518 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3519 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3520 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3524 * @return BLUETOOTH_ERROR_NONE - Success \n
3525 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3526 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3527 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3528 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3529 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3530 * agent is not running \n
3531 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3534 * @param[in] device_address This indicates an address of the device to remove bonding
3538 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3541 void bt_event_callback(int event, bluetooth_event_param_t *param)
3544 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3545 bluetooth_device_address_t *dev_addr = NULL;
3547 if (param->result == BLUETOOTH_ERROR_NONE) {
3548 dev_addr = (bluetooth_device_address_t *)param->param_data;
3550 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3551 dev_addr->addr[0], dev_addr->addr[1]
3552 dev_addr->addr[2], dev_addr->addr[3]
3553 dev_addr->addr[4], dev_addr->addr[5]
3564 bluetooth_device_address_t *device_address;
3566 // copy valid device address in device_address
3568 ret = bluetooth_unbond_device(device_address);
3571 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3574 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3575 * @brief Get bonded(paired) device list
3578 * This API gets all bonded device list.
3579 * The devices in the bonded device list further can be used to perform the authorization by calling
3580 * bluetooth_authorize_device API.
3582 * This function is a synchronous call.
3583 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3584 * there is no valid information in the dev_list.
3585 * The len field in the dev_list represents the number of bonded devices. The data structure for
3586 * bonded device information is bluetooth_device_info_t.
3589 * @return BLUETOOTH_ERROR_NONE - Success \n
3590 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3592 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3594 void bt_get_bonded_devices(void)
3598 GPtrArray *devinfo = NULL;
3599 bluetooth_device_info_t *ptr;
3601 // allocate the g_pointer_array
3602 devinfo = g_ptr_array_new();
3604 ret = bluetooth_get_bonded_device_list(&devinfo);
3605 if (ret != BLUETOOTH_ERROR_NONE)
3607 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3611 printf("g pointer arrary count : [%d]", devinfo->len);
3612 for (i=0; i<devinfo->len; i++)
3614 ptr = g_ptr_array_index(devinfo, i);
3617 printf("Name [%s]\n", ptr->device_name.name);
3618 printf("Major Class [%d]\n", ptr->device_class.major_class);
3619 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3620 printf("Service Class [%d]\n", ptr->device_class.service_class);
3621 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3622 ptr->device_address.addr[0],
3623 ptr->device_address.addr[1], ptr->device_address.addr[2],
3624 ptr->device_address.addr[3],
3625 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3632 // free g_pointer_array
3633 g_ptr_array_free(devinfo, TRUE);
3638 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3640 int bluetooth_get_profile_connected_device_list(
3641 const char *profile_uuid, GPtrArray **addr_list);
3644 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3645 * bluetooth_device_info_t *dev_info)
3646 * @brief Get a bonded(paired) device
3649 * This API gets a bonded device.
3651 * This function is a synchronous call.
3652 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3653 * there is no valid information in the dev_info.
3654 * The data structure for bonded device information is bluetooth_device_info_t.
3657 * @return BLUETOOTH_ERROR_NONE - Success \n
3658 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3660 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3662 void bt_get_bonded_device(void)
3666 bluetooth_device_info_t devinfo = {0};
3667 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3669 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3670 if (ret != BLUETOOTH_ERROR_NONE)
3672 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3676 printf("Name [%s]\n", devinfo.device_name.name);
3677 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3678 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3679 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3680 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3681 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3682 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3683 devinfo.device_address.addr[5]);
3692 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3693 bluetooth_device_info_t *dev_info);
3696 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3697 * gboolean *is_alias_set)
3698 * @brief Get is_alias_set property of device
3700 * This API gets is_alias_set property of a bonded device.
3702 * This function is a synchronous call.
3703 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3704 * If not,there is no valid information in the is_alias_set.
3706 * @return BLUETOOTH_ERROR_NONE - Success \n
3707 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3712 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3714 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3717 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3718 gboolean *is_alias_set);
3721 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3722 * @brief set alias for bonded device
3725 * This function set alias for bonded device.
3727 * This function is a synchronous call.
3730 * @return BLUETOOTH_ERROR_NONE - Success \n
3731 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3732 * @param[in] device_address This indicates an address of the remote device
3733 * @param[in] alias This indicates an alias to set
3738 ret = bluetooth_set_alias(&remote_address);
3741 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3745 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3746 * @brief Get remote deivice
3749 * This function gets specific remote device.
3751 * This function is a asynchronous call.
3752 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3755 * @return BLUETOOTH_ERROR_NONE - Success \n
3756 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3757 * @param[in] device_address This indicates an address of the remote device
3762 ret = bluetooth_get_remote_device(&remote_address);
3765 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3768 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3769 * gboolean authorized)
3770 * @brief Authorize/Unauthorize a bonded device
3773 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3774 * with/without user confirmation.
3776 * If we select a paired device and make it authorized by calling this API with the authorized
3777 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3778 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3779 * then it will ask for the user conformation before the connection.
3781 * This API supposed to be called on the paired devices. Which means we have to use this API only
3782 * after successful pairing.
3784 * This function is a asynchronous call.
3785 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3787 * @return BLUETOOTH_ERROR_NONE - Success \n
3788 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3789 * @param[in] device_address This indicates an address of the device to authorize \n
3790 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3792 * @see bluetooth_get_bonded_device_list
3794 void bt_event_callback(int event, bluetooth_event_param_t *param)
3798 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3800 if (param->result == BLUETOOTH_ERROR_NONE)
3804 //device authorization failed failure
3812 bluetooth_device_address_t device_address={{0}};
3813 gboolean authorized;
3817 ret = bluetooth_authorize_device(&device_address,authorized);
3820 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3821 gboolean authorized);
3823 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3824 const bluetooth_device_pin_code_t *pin_code);
3826 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3829 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3831 * @brief Receives Legacy Passkey\pin with following authentication response types
3833 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3834 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3837 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3840 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3842 * @brief This API sends user confirmation reply to the local adapter.
3844 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3847 int bluetooth_passkey_confirmation_reply(gboolean reply);
3850 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3851 * @brief Get all services supported by remote device
3854 * This API call initiates the search for the services supported by the specified device. Normally
3855 * the service search will take a couple of seconds to get it completed. Before calling this API
3856 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3857 * perform the service search. We can get the device address by doing a device discovery operation.
3860 * This function is a asynchronous call.
3861 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3863 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3864 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3865 * event is generated with appropriate result code.
3867 * @return BLUETOOTH_ERROR_NONE - Success \n
3868 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3869 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3870 * @param[in] device_address This indicates an address of the device
3871 * whose services need to be found
3873 * @see bluetooth_cancel_service_search
3875 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3878 * @fn int bluetooth_cancel_service_search(void)
3879 * @brief Cancel the ongoing service search operation
3882 * This function cancel the ongoing service search operation. This API is usually calling after the
3883 * bluetooth_search_service API.
3884 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3885 * if the user wish to cancel the Ongoing service search operation.
3887 * This API should be called just after the bluetooth_search_service API and before the
3888 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3890 * This function is a synchronous call.
3892 * @return BLUETOOTH_ERROR_NONE - Success \n
3893 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3894 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3895 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3898 * @see bluetooth_search_service
3903 ret = bluetooth_cancel_service_search();
3906 int bluetooth_cancel_service_search(void);
3909 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3910 * @brief Register rfcomm socket with a specific uuid
3913 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3914 * descriptor of the server.
3915 * This is the first API which is called to create the server. Once we created the server socket,
3916 * we will listen on that return socket.
3917 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3920 * @return socket FD on Success \n
3921 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3922 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3923 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3924 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3925 * @param[in] UUID (128 bits)
3928 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3932 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3933 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3937 int bluetooth_rfcomm_create_socket(const char *uuid);
3940 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3941 * @brief Register rfcomm socket with a specific uuid
3944 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3945 * descriptor of the server.
3946 * This is the first API which is called to create the server. Once we created the server socket,
3947 * we will listen on that return socket.
3948 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3951 * @return socket FD on Success \n
3952 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3953 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3954 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3955 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3956 * @param[in] UUID (128 bits)
3957 * @param[in] bus_name (const char)
3958 * @param[in] path (const char)
3961 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3965 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3966 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3970 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3973 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3974 * @brief De-register the rfcomm socket
3977 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3978 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3979 * descriptor else no event will come. We will call this API only after the
3980 * bluetooth_rfcomm_listen_and_accept.
3981 * This is a synchronous call.
3983 * @return BLUETOOTH_ERROR_NONE - Success \n
3984 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3985 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3986 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3987 * @param[in] int socket_fd
3990 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3993 void bt_event_callback(int event, bluetooth_event_param_t *param)
3997 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3999 bluetooth_rfcomm_connection_t *discon_ind =
4000 (bluetooth_rfcomm_connection_t *)param->param_data;
4002 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4010 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4011 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4013 ret = bluetooth_rfcomm_remove_socket(fd);
4016 int bluetooth_rfcomm_remove_socket(int socket_fd);
4019 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4020 * @brief De-register the rfcomm socket
4023 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4024 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4025 * descriptor else no event will come. We will call this API only after the
4026 * bluetooth_rfcomm_listen_and_accept_ex.
4027 * This is a synchronous call.
4029 * @return BLUETOOTH_ERROR_NONE - Success \n
4030 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4031 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4032 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4033 * @param[in] UUID (128 bits)
4036 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4039 void bt_event_callback(int event, bluetooth_event_param_t *param)
4043 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4045 bluetooth_rfcomm_connection_t *discon_ind =
4046 (bluetooth_rfcomm_connection_t *)param->param_data;
4048 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4056 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4057 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4059 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4062 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4065 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4066 * @brief Disconnect rfcomm connection
4069 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4070 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4073 * @return BLUETOOTH_ERROR_NONE - Success \n
4074 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4075 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4076 * @param[in] int socket_fd the sending socket fd
4082 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4084 printf("Disconnection failed");
4086 printf("Disconnection Success");
4090 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4093 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4094 * @brief Rfcomm socket listen
4097 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4098 * after the bluetooth_rfcomm_create_socket API.
4099 * This API listen for the incomming connection and once it receives a connection, it will give
4100 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4101 * event to the application. This is an Asynchronous API call.
4104 * @return BLUETOOTH_ERROR_NONE - Success \n
4105 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4106 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4108 * @param[in] int socket_fd
4109 * @param[in] max pending connection.
4112 * @see bluetooth_rfcomm_create_socket
4115 void bt_event_callback(int event, bluetooth_event_param_t* param)
4119 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4121 bluetooth_rfcomm_connection_t *conn_ind =
4122 (bluetooth_rfcomm_connection_t *)param->param_data;
4124 printf("\nConnected from FD %d", conn_ind->socket_fd);
4132 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4133 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4137 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4140 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4141 * @brief Rfcomm socket listen
4144 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4145 * after the bluetooth_rfcomm_create_socket API.
4146 * This API listen for the incomming connection and once it receives a connection, it will give
4147 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4148 * event to the application. This is an Asynchronous API call.
4151 * @return BLUETOOTH_ERROR_NONE - Success \n
4152 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4153 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4155 * @param[in] int socket_fd
4156 * @param[in] max pending connection.
4161 * @see bluetooth_rfcomm_create_socket_ex
4164 void bt_event_callback(int event, bluetooth_event_param_t* param)
4168 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4170 bluetooth_rfcomm_connection_t *conn_ind =
4171 (bluetooth_rfcomm_connection_t *)param->param_data;
4173 printf("\nConnected from FD %d", conn_ind->socket_fd);
4181 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4182 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4187 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4190 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4191 * @brief Rfcomm socket listen
4194 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4195 * after the bluetooth_rfcomm_create_socket API.
4196 * This API listen for the incomming connection and once it receives a connection, it will give
4197 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4198 * event to the application. This is an Asynchronous API call.
4201 * @return BLUETOOTH_ERROR_NONE - Success \n
4202 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4203 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4205 * @param[in] int socket_fd
4206 * @param[in] max pending connection.
4209 * @see bluetooth_rfcomm_create_socket
4212 void bt_event_callback(int event, bluetooth_event_param_t* param)
4216 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4218 char *name = (char *)param->param_data;
4220 printf("\nConnected from %s", name);
4222 bluetooth_rfcomm_accept_connection();
4230 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4231 ret = bluetooth_rfcomm_listen(fd, 1);
4235 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4238 * @fn int bluetooth_rfcomm_accept_connection()
4239 * @brief Accepts the authorization request indicated by the event
4240 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4242 * This function is a synchronous call.
4244 * @return BLUETOOTH_ERROR_NONE - Success \n
4245 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4247 * @param[in] the socket fd of the server
4248 * @param[out] the socket fd of the client
4252 * @see bluetooth_rfcomm_reject_connection
4254 int bluetooth_rfcomm_accept_connection(int server_fd);
4257 * @fn int bluetooth_rfcomm_reject_connection()
4258 * @brief Rejects the authorization request indicated by the event
4259 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4261 * This function is a synchronous call.
4263 * @return BLUETOOTH_ERROR_NONE - Success \n
4264 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4266 * @param[in] the socket fd of the server
4270 * @see bluetooth_rfcomm_accept_connection
4272 int bluetooth_rfcomm_reject_connection(int server_fd);
4275 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4276 * @brief Informs whether rfcomm server uuid is available or not.
4278 * This function is a synchronous call.
4280 * @return TRUE - RFCOMM uuid is available \n
4281 * FALSE - RFCOMM uuid is not available \n
4283 * @param[in] uuid UUID string
4289 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4292 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4293 * const char *remote_uuid)
4294 * @brief Connect to the remote device rfcomm *
4296 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4297 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4298 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4299 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4300 * initiating a connection.
4302 * @return BLUETOOTH_ERROR_NONE - Success \n
4303 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4304 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4305 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4306 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4307 * @param[in] bluetooth_device_address_t remote bt_address
4308 * @param[in] char remote uuid
4310 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4314 void bt_event_callback(int event, bluetooth_event_param_t *param)
4318 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4320 if (param->result >= BLUETOOTH_ERROR_NONE)
4322 bt_sdp_info_t *bt_sdp_info=param->param_data;
4324 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4325 bt_sdp_info->device_addr.addr[0],
4326 bt_sdp_info->device_addr.addr[1],
4327 bt_sdp_info->device_addr.addr[2],
4328 bt_sdp_info->device_addr.addr[3],
4329 bt_sdp_info->device_addr.addr[4],
4330 bt_sdp_info->device_addr.addr[5]);
4332 printf("Supported service list:\n");
4333 for(i=0; i<bt_sdp_info->service_index; i++)
4335 bt_sdp_info->service_list_array[i]);
4338 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4339 //rfcomm_test_uuid);
4343 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4345 bluetooth_rfcomm_connection_t *conn_ind =
4346 (bluetooth_rfcomm_connection_t *)param->param_data;
4348 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4349 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4350 "SERVER" : "CLIENT");
4355 bluetooth_device_address_t remote_address = {{0},};
4356 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4357 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4358 ret = bluetooth_search_service(&remote_address);
4360 printf("Seach failed, Reason = %d", ret);
4362 printf("Search Success, Ret = %d", ret);
4364 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4366 printf("Connection failed, Reason = %d", ret);
4368 printf("Connection Success, Ret = %d", ret);
4372 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4373 const char *remote_uuid);
4376 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4377 * @brief Disconnect rfcomm connection
4380 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4381 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4384 * @return BLUETOOTH_ERROR_NONE - Success \n
4385 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4386 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4387 * @param[in] char remote bt_address
4390 * @see bluetooth_rfcomm_connect
4394 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4396 printf("Disconnection failed");
4398 printf("Disconnection Success");
4403 int bluetooth_rfcomm_disconnect(int socket_fd);
4406 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4407 * @brief Write to rfcomm connection
4410 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4411 * API is used to send the data for server and the client.
4413 * @return BLUETOOTH_ERROR_NONE - Success \n
4414 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4415 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4417 * @param[in] const char *buff Data buffer to send
4418 * @param[in] int length Length of the data
4421 * @see bluetooth_rfcomm_connect
4424 char *buff = "Test data 123456789"
4425 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4427 printf("Send failed");
4429 printf("Send success");
4433 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4436 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4437 * @brief Informs whether rfcomm client is connected.
4439 * This function is a synchronous call.
4441 * @return TRUE - RFCOMM client is connected \n
4442 * FALSE - RFCOMM client is not connected \n
4448 gboolean bluetooth_rfcomm_is_client_connected(void);
4449 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4450 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4453 * @fn int bluetooth_network_activate_server(void)
4454 * @brief Activate the NAP (Network Access Point) service
4456 * This function is a asynchronous call.
4457 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4459 * @return BLUETOOTH_ERROR_NONE - Success \n
4460 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4461 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4462 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4465 * @see bluetooth_network_deactivate_server
4468 int bluetooth_network_activate_server(void);
4471 * @fn int bluetooth_network_deactivate_server(void)
4472 * @brief Deactivate the NAP (Network Access Point) service
4474 * This function is a asynchronous call.
4475 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4477 * @return BLUETOOTH_ERROR_NONE - Success \n
4478 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4479 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4480 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4483 * @see bluetooth_network_activate_server
4486 int bluetooth_network_deactivate_server(void);
4489 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4490 * bluetooth_network_role_t role,
4492 * @brief Connect the network server in the peer
4494 * This function is a asynchronous call.
4495 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4497 * @return BLUETOOTH_ERROR_NONE - Success \n
4498 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4499 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4500 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4503 * @param[in] device_address This indicates an address of the device with which the pairing
4504 * should be initiated
4505 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4506 * need to use the third parameter.
4507 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4508 * connect. UUID string
4510 * @see bluetooth_network_disconnect
4512 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4513 bluetooth_network_role_t role, char *custom_uuid);
4516 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4517 * bluetooth_network_role_t role,
4518 * char *custom_uuid)
4519 * @brief Connect the network server in the peer
4521 * This function is a asynchronous call.
4522 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4524 * @return BLUETOOTH_ERROR_NONE - Success \n
4525 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4526 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4527 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4530 * @param[in] device_address This indicates an address of the device with which the pairing
4531 * should be initiated
4533 * @see bluetooth_network_connect
4535 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4538 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4539 * @brief Disconnect the device from the network
4541 * This function is an asynchronous call.
4542 * The network server disconnect request is responded by
4543 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4545 * @return BLUETOOTH_ERROR_NONE - Success \n
4546 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4547 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4548 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4551 * @param[in] device_address This indicates an address of the connected client device
4553 * @see bluetooth_network_activate_server
4555 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4560 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4561 * bt_hdp_role_type_t role,
4562 * bt_hdp_qos_type_t channel_type,
4563 * char **app_handle)
4564 * @brief Activate the HDP service for a particular data type
4566 * This function is a synchronous call.
4568 * @return BLUETOOTH_ERROR_NONE - Success \n
4569 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4570 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4571 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4574 * @param[in] data_type The data type against corresponding service
4575 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4576 * @param[in] channel_type The QOS type for the channel.
4577 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4578 * For role = HDP_ROLE_SINK, the channel_type
4579 * should be HDP_QOS_ANY.
4580 * @param[out] app_handle The application handler against corresponding service
4582 * @see bluetooth_hdp_deactivate
4584 int bluetooth_hdp_activate(unsigned short data_type,
4585 bt_hdp_role_type_t role,
4586 bt_hdp_qos_type_t channel_type,
4589 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4590 * @brief Deactivate the HDP service for a particular service using the handler
4592 * This function is a synchronous call.
4594 * @return BLUETOOTH_ERROR_NONE - Success \n
4595 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4596 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4597 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4600 * @param[in] app_handle The application handler against corresponding service
4602 * @see bluetooth_hdp_deactivate
4604 int bluetooth_hdp_deactivate(const char *app_handle);
4607 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4608 * const char *buffer, unsigned int size)
4609 * @brief Send data to the remote HDP device
4611 * This function is a synchronous call.
4613 * @return BLUETOOTH_ERROR_NONE - Success \n
4614 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4615 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4616 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4617 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4620 * @param[in] channel_id The channel id for the connection.
4621 * @param[in] buffer The pdu buffer.
4622 * @param[in] size Size of the buffer.
4624 * @see bluetooth_hdp_connect
4626 int bluetooth_hdp_send_data(unsigned int channel_id,
4627 const char *buffer, unsigned int size);
4629 * @fn int bluetooth_hdp_connect(const char *app_handle,
4630 * bt_hdp_qos_type_t channel_type,
4631 * const bluetooth_device_address_t *device_address)
4632 * @brief Connect to the remote device(Mainly used by source)
4634 * This function is a asynchronous call.
4635 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4637 * @return BLUETOOTH_ERROR_NONE - Success \n
4638 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4639 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4640 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4641 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4644 * @param[in] app_handle The application handler against corresponding service
4645 * @param[in] channel_type The QOS type for the channel.
4646 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4647 * @param[in] device_address The remote device Bd address.
4650 * @see bluetooth_hdp_disconnect
4652 int bluetooth_hdp_connect(const char *app_handle,
4653 bt_hdp_qos_type_t channel_type,
4654 const bluetooth_device_address_t *device_address);
4656 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4657 * const bluetooth_device_address_t *device_address)
4658 * @brief Disconnect from the remote device(Mainly used by source)
4660 * This function is a asynchronous call.
4661 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4663 * @return BLUETOOTH_ERROR_NONE - Success \n
4664 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4665 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4666 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4667 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4670 * @param[in] channel_id The channel id for the connection.
4671 * @param[in] device_address The remote device Bd address.
4674 * @see bluetooth_hdp_connect
4676 int bluetooth_hdp_disconnect(unsigned int channel_id,
4677 const bluetooth_device_address_t *device_address);
4681 * @fn int bluetooth_opc_init(void)
4682 * @brief Initialize OPP client.
4684 * This function is a synchronous call.
4685 * No event corresponding to this api
4687 * @return BLUETOOTH_ERROR_NONE - Success \n
4688 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4689 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4690 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4691 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4696 * @see bluetooth_opc_deinit
4698 int bluetooth_opc_init(void);
4701 * @fn int bluetooth_opc_deinit(void)
4702 * @brief Deinitialize OPP client.
4704 * This function is a synchronous call.
4705 * No event corresponding to this api
4707 * @return BLUETOOTH_ERROR_NONE - Success \n
4708 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4709 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4714 * @see bluetooth_opc_init
4717 int bluetooth_opc_deinit(void);
4720 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4721 char **file_name_array)
4722 * @brief Send multiple files to a remote device.
4724 * This function is a asynchronous call.
4725 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4727 * @return BLUETOOTH_ERROR_NONE - Success \n
4728 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4729 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4730 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4731 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4732 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4733 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4736 * @param[in] device_address The remote device Bd address.
4737 * @param[in] file_name_array Array of filepaths to be sent.
4740 * @see bluetooth_opc_cancel_push
4743 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4744 char **file_name_array);
4747 * @fn int bluetooth_opc_cancel_push(void)
4748 * @brief Cancels the ongoing file push.
4750 * This function is a asynchronous call.
4751 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4752 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4754 * @return BLUETOOTH_ERROR_NONE - Success \n
4755 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4756 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4761 * @see bluetooth_opc_push_files
4764 int bluetooth_opc_cancel_push(void);
4767 * @fn gboolean bluetooth_opc_session_is_exist(void)
4768 * @brief Informs whether opc session exists or not.
4770 * This function is a synchronous call.
4772 * @return TRUE - OPC session exists \n
4773 * FALSE - OPC session does not exist \n
4781 gboolean bluetooth_opc_session_is_exist(void);
4784 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4785 * @brief Informs whether opc session exists or not.
4787 * This function is a synchronous call.
4789 * @return BLUETOOTH_ERROR_NONE - Success \n
4790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4791 * BLUETOOTH_ERROR_INTERNAL \n
4794 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4799 int bluetooth_opc_is_sending(gboolean *is_sending);
4802 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4803 int transfer_id, unsigned char *progress)
4804 * @brief Gets the percentage progress for ongoing transfers.
4806 * This function is a synchronous call.
4808 * @return BLUETOOTH_ERROR_NONE - Success \n
4809 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4810 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4813 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4814 * @param[in] transfer_id Transfer ID
4815 * @param[out] progress Percentage Progress
4819 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4820 int transfer_id, unsigned char *progress);
4823 * @fn int bluetooth_obex_server_init(const char *dst_path)
4824 * @brief Initialize OPP and FTP server.
4826 * This function is a synchronous call.
4827 * No event corresponding to this api
4829 * @return BLUETOOTH_ERROR_NONE - Success \n
4830 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4831 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4832 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4833 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4836 * @param[in] dst_path OPS destination file path.
4838 * @see bluetooth_obex_server_deinit
4840 int bluetooth_obex_server_init(const char *dst_path);
4844 * @fn int bluetooth_obex_server_deinit(void)
4845 * @brief Deinitialize OPP and FTP server.
4847 * This function is a synchronous call.
4848 * No event corresponding to this api
4850 * @return BLUETOOTH_ERROR_NONE - Success \n
4851 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4852 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4857 * @see bluetooth_obex_server_init
4859 int bluetooth_obex_server_deinit(void);
4863 * @fn gboolean bluetooth_obex_server_is_activated(void)
4864 * @brief Informs whether obex server is activated or not.
4866 * This function is a synchronous call.
4868 * @return TRUE - OBEX server is activated \n
4869 * FALSE - OBEX server is not activated \n
4876 gboolean bluetooth_obex_server_is_activated(void);
4880 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4881 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4883 * This function is a synchronous call.
4884 * No event corresponding to this api
4886 * @return BLUETOOTH_ERROR_NONE - Success \n
4887 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4888 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4889 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4890 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4894 * @param[in] dst_path OPS destination file path.
4896 * @see bluetooth_obex_server_deinit_without_agent
4898 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4902 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4903 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4905 * This function is a synchronous call.
4906 * No event corresponding to this api
4908 * @return BLUETOOTH_ERROR_NONE - Success \n
4909 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4910 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4915 * @see bluetooth_obex_server_init_without_agent
4917 int bluetooth_obex_server_deinit_without_agent(void);
4921 * @fn int bluetooth_obex_server_accept_connection(void)
4922 * @brief Accepts the authorization request indicated by the event
4923 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4925 * This function is a synchronous call.
4927 * @return BLUETOOTH_ERROR_NONE - Success \n
4928 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4929 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4933 * @see bluetooth_obex_server_reject_authorize
4935 int bluetooth_obex_server_accept_connection(void);
4939 * @fn int bluetooth_obex_server_reject_connection(void)
4940 * @brief Rejects the authorization request indicated by the event
4941 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4943 * This function is a synchronous call.
4945 * @return BLUETOOTH_ERROR_NONE - Success \n
4946 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4947 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4951 * @see bluetooth_obex_server_reject_authorize
4953 int bluetooth_obex_server_reject_connection(void);
4957 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4958 * @brief Accepts the authorization request indicated by the event
4959 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4961 * This function is a asynchronous call.
4962 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4964 * @return BLUETOOTH_ERROR_NONE - Success \n
4965 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4966 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4967 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4970 * @param[in] filename Authorized filename.
4973 * @see bluetooth_obex_server_reject_authorize
4976 int bluetooth_obex_server_accept_authorize(const char *filename);
4979 * @fn int bluetooth_obex_server_reject_authorize(void)
4980 * @brief Reject the authorization request indicated by the event
4981 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4983 * This function is a asynchronous call.
4984 * No event for this api..
4986 * @return BLUETOOTH_ERROR_NONE - Success \n
4987 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4988 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4993 * @see bluetooth_obex_server_accept_authorize
4996 int bluetooth_obex_server_reject_authorize(void);
4999 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5000 * @brief Set the OPS destination file path..
5002 * This function is a asynchronous call.
5003 * No event for this api..
5005 * @return BLUETOOTH_ERROR_NONE - Success \n
5006 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5007 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5008 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5011 * @param[in] dst_path OPS destination file path.
5017 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5020 * @fn int bluetooth_obex_server_set_root(const char *root)
5021 * @brief Set the FTS root folder..
5023 * This function is a asynchronous call.
5024 * No event for this api..
5026 * @return BLUETOOTH_ERROR_NONE - Success \n
5027 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5028 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5029 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5030 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5031 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5034 * @param[in] root FTS root folder.
5040 int bluetooth_obex_server_set_root(const char *root);
5043 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5044 * @brief Cancel the transfer on server
5046 * This function is an asynchronous call.
5047 * If the function call that cancels transfer is successful, the application would receive
5048 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5049 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5050 * the error code will be BLUETOOTH_ERROR_NONE
5052 * @return BLUETOOTH_ERROR_NONE - Success \n
5053 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5054 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5055 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5056 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5059 * @param[in] transfer_id transfer ID
5064 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5068 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5069 * @brief Cancel the transfer on server
5071 * This function is an asynchronous call.
5072 * If the function call that cancels transfer is successful, the application would receive
5073 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5074 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5075 * the error code will be BLUETOOTH_ERROR_NONE
5077 * @return BLUETOOTH_ERROR_NONE - Success \n
5078 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5079 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5080 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5081 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5088 int bluetooth_obex_server_cancel_all_transfers(void);
5092 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5093 * @brief Informs whether obex server is receiving or not.
5095 * This function is a synchronous call.
5097 * @return BLUETOOTH_ERROR_NONE - Success \n
5098 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5099 * BLUETOOTH_ERROR_INTERNAL \n
5102 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5107 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5111 * @fn int bluetooth_map_client_init(void)
5112 * @brief Initialize MAP client.
5114 * This function is a synchronous call.
5115 * No event corresponding to this api
5117 * @return BLUETOOTH_ERROR_NONE - Success \n
5118 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5119 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5120 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5121 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5126 * @see bluetooth_map_client_deinit
5128 int bluetooth_map_client_init(void);
5130 int bluetooth_map_client_deinit(void);
5132 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5134 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5136 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5138 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5139 bt_map_client_list_folders_filter_t *filter);
5142 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5143 * @brief Return all available fields that can be used in Fields filter.
5145 * This function is a asynchronous call.
5147 * @return BLUETOOTH_ERROR_NONE - Success \n
5148 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5149 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5152 * @param[in] session Information about session.
5155 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5157 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5159 bt_map_client_list_messages_filter_t *filter);
5161 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5163 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5164 const char *source_file,
5166 bt_map_client_push_message_args_t *args);
5168 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5169 const bt_map_client_message_object_t message_object,
5170 const char *target_file,
5175 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5176 * @brief Read the local Hash and Randmizer.
5178 * This function is a synchronous call.
5180 * @return BLUETOOTH_ERROR_NONE - Success \n
5181 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5185 * @param[out] local_oob_data - Pointer to the local OOB data
5191 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5195 * @fn int bluetooth_oob_add_remote_data(
5196 * const bluetooth_device_address_t *remote_device_address,
5197 * bluetooth_bdaddr_type_e address_type,
5198 * bt_oob_data_t *oob_data)
5199 * @brief Add/updated the remote device Hash and Randmizer.
5201 * This function is a synchronous call.
5202 * No event for this api..
5204 * @return BLUETOOTH_ERROR_NONE - Success \n
5205 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5208 * @param[in] remote_device_address - Remote device address
5209 * address_type - bdaddr type
5210 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5216 int bluetooth_oob_add_remote_data(
5217 const bluetooth_device_address_t *remote_device_address,
5218 bluetooth_bdaddr_type_e address_type,
5219 bt_oob_data_t *remote_oob_data);
5223 * @fn int bluetooth_oob_remove_remote_data(
5224 * const bluetooth_device_address_t *remote_device_address)
5225 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5227 * This function is a synchronous call.
5228 * No event for this api..
5230 * @return BLUETOOTH_ERROR_NONE - Success \n
5231 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5234 * @param[in] remote_device_address - Remote device address
5240 int bluetooth_oob_remove_remote_data(
5241 const bluetooth_device_address_t *remote_device_address);
5244 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5245 * bt_gatt_handle_info_t *prim_svc);
5247 * @brief Gets the GATT based primary services handle supported by remote device
5249 * This function is a synchronous call.
5250 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5252 * @return BLUETOOTH_ERROR_NONE - Success \n
5253 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5254 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5255 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5258 * @param[in] address - Remote device address
5259 * @param[out] prim_svc - Structure containing remote service count and handle list.
5262 * @see bluetooth_gatt_free_primary_services()
5264 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5265 bt_gatt_handle_info_t *prim_svc);
5268 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5270 * @brief Discovers the characteristics of GATT based service of remote device
5272 * This function is an asynchronous call.
5273 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5275 * @return BLUETOOTH_ERROR_NONE - Success \n
5276 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5277 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5278 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5281 * @param[in] service_handle - Handle for remote service.
5286 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5288 int bluetooth_gatt_set_service_change_watcher(
5289 const bluetooth_device_address_t *address, gboolean enable);
5292 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5293 * bt_gatt_service_property_t *service);
5295 * @brief Gets the properties of GATT based service of remote device
5297 * This function is a synchronous call.
5298 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5300 * @return BLUETOOTH_ERROR_NONE - Success \n
5301 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5302 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5303 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5306 * @param[in] service_handle - Handle for remote service.
5307 * @param[out] service - Structure containing remote service property.
5310 * @see bluetooth_gatt_free_service_property()
5312 int bluetooth_gatt_get_service_property(const char *service_handle,
5313 bt_gatt_service_property_t *service);
5316 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5318 * @brief Register to GATT based service to receive value change notification/indication.
5320 * This function is a synchronous call.
5321 * No event for this api.
5323 * @return BLUETOOTH_ERROR_NONE - Success \n
5324 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5325 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5326 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5329 * @param[in] service_handle - Handle for remote service.
5330 * @param[in] service_name - Friednly name of service uuid.
5335 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5338 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5340 * @brief Unregister GATT based service to receive value change notification/indication.
5342 * This function is a synchronous call.
5343 * No event for this api.
5345 * @return BLUETOOTH_ERROR_NONE - Success \n
5346 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5347 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5348 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5351 * @param[in] service_handle - Handle for remote service.
5356 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5359 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5360 * bt_gatt_char_property_t *characteristic);
5362 * @brief Provides characteristic value along with properties.
5364 * This function is a synchronous call.
5365 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
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] char_handle - Handle for Characteristic property.
5374 * @param[out] characteristic - Structure containing remote characteristic property.
5377 * @see bluetooth_gatt_free_char_property()
5379 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5380 bt_gatt_char_property_t *characteristic);
5383 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5384 * bt_gatt_char_property_t *characteristic);
5386 * @brief Provides characteristic descriptor value along with its UUID.
5388 * This function is a synchronous call.
5389 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5391 * @return BLUETOOTH_ERROR_NONE - Success \n
5392 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5393 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5394 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5397 * @param[in] desc_handle - Handle for Characteristic descriptor.
5398 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5401 * @see bluetooth_gatt_free_desc_property()
5403 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5404 bt_gatt_char_descriptor_property_t *descriptor);
5408 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5409 * const guint8 *value, int length)
5411 * @brief Set characteristic value.
5413 * This function is a synchronous call.
5415 * @return BLUETOOTH_ERROR_NONE - Success \n
5416 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5417 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5418 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5421 * @param[in] char_handle - Handle for Characteristic property.
5422 * @param[in] value - New value to set for characteristic property.
5423 * @param[in] length - Length of the value to be set.
5428 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5429 const guint8 *value, int length);
5432 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5433 * const guint8 *value, int length, guint8 write_type)
5435 * @brief Set characteristic value by write type.
5437 * This function is a synchronous call if write type is "write without resonse"
5438 * and it is an asynchronous call if write type is "write with response"
5440 * @return BLUETOOTH_ERROR_NONE - Success \n
5441 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5442 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5443 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5446 * @param[in] char_handle - Handle for Characteristic property.
5447 * @param[in] value - New value to set for characteristic property.
5448 * @param[in] length - Length of the value to be set.
5449 * @param[in] write_type - Type of write.
5454 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5455 const guint8 *value, int length,
5456 guint8 write_type, gpointer app_data);
5460 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5461 * const guint8 *value, int length)
5463 * @brief Set characteristic value request.
5465 * This function is an asynchronous call.
5467 * @return BLUETOOTH_ERROR_NONE - Success \n
5468 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5469 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5470 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5473 * @param[in] char_handle - Handle for Characteristic property.
5474 * @param[in] value - New value to set for characteristic property.
5475 * @param[in] length - Length of the value to be set.
5480 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5481 const guint8 *value, int length);
5484 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5486 * @brief Read characteristic value.
5488 * This function is a asynchronous call.
5490 * @return BLUETOOTH_ERROR_NONE - Success \n
5491 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5492 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5493 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5496 * @param[in] char_handle - Handle for Characteristic property.
5501 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5504 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5505 * const char *service_uuid,
5506 * bt_gatt_service_property_t *service)
5508 * @brief Gets the service property from a device based on a particular uuid
5510 * This function is a synchronous call.
5512 * @return BLUETOOTH_ERROR_NONE - Success \n
5513 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5514 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5515 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5518 * @param[in] address - BD address of the remote device
5519 * @param[in] service_uuid - uuid of the service.
5520 * @param[out] service - Structure containing the service property.
5525 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5526 const char *service_uuid,
5527 bt_gatt_service_property_t *service);
5530 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5531 * const char *char_uuid)
5533 * @brief Gets the characteristic property from a service based on a particular char uuid
5535 * This function is an asynchronous call.
5536 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5538 * @return BLUETOOTH_ERROR_NONE - Success \n
5539 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5540 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5541 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5544 * @param[in] service_handle - Service handle.
5545 * @param[in] uuid - Characteristic uuid.
5550 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5551 const char *char_uuid);
5554 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5556 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5558 * This function is a synchronous call.
5559 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5561 * @return BLUETOOTH_ERROR_NONE - Success \n
5562 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5565 * @param[in] prim_svc - GATT handle info structure
5568 * @see bluetooth_gatt_get_primary_services()
5570 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5573 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5575 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5577 * This function is a synchronous call.
5578 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5580 * @return BLUETOOTH_ERROR_NONE - Success \n
5581 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5584 * @param[in] svc_pty - GATT service property structure.
5587 * @see bluetooth_gatt_get_service_property()
5589 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5592 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5594 * @brief Provides characteristic value along with properties.
5596 * This function is a synchronous call.
5597 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5599 * @return BLUETOOTH_ERROR_NONE - Success \n
5600 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5603 * @param[in] char_pty - GATT characteristics property structure.
5606 * @see bluetooth_gatt_get_characteristics_property()
5608 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5611 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5613 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5615 * This function is a synchronous call.
5616 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5618 * @return BLUETOOTH_ERROR_NONE - Success \n
5619 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5622 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5625 * @see bluetooth_gatt_get_char_descriptor_property()
5627 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5629 #ifdef TIZEN_GATT_CLIENT
5630 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5631 gboolean auto_connect, int client_id);
5633 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5636 #ifdef TIZEN_GATT_CLIENT
5637 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5640 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5644 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5646 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5648 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5650 * @return BLUETOOTH_ERROR_NONE - Success \n
5651 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5654 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5658 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5661 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5663 * @brief Read characteristic descriptor value.
5665 * This function is a asynchronous call.
5667 * @return BLUETOOTH_ERROR_NONE - Success \n
5668 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5669 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5670 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5673 * @param[in] desc_handle - Handle for Characteristic descriptor
5678 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5681 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5682 * const guint8 *value, int length);
5684 * @brief Set characteristic descriptor value.
5686 * This function is a asynchronous call.
5688 * @return BLUETOOTH_ERROR_NONE - Success \n
5689 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5690 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5691 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5694 * @param[in] desc_handle - Handle for Characteristic descriptor
5695 * @param[in] value - New value to set for characteristic descriptor
5696 * @param[in] length - Length of the value to be set.
5701 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5702 const guint8 *value, int length, gpointer app_data);
5704 /* @fn int bluetooth_gatt_init(void)
5706 * @brief Initializes the gatt service.
5708 * This function is a synchronous call.
5709 * @return BLUETOOTH_ERROR_NONE - Success \n
5710 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5711 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5712 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5715 * @remark Adapter should be enabled
5716 * @see bluetooth_gatt_deinit()
5718 int bluetooth_gatt_init(void);
5720 /* @fn int bluetooth_gatt_init(void)
5722 * @brief DeInitializes the gatt service.
5724 * This function is a synchronous call.
5725 * @return BLUETOOTH_ERROR_NONE - Success \n
5726 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5727 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5728 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5731 * @remark Adapter should be enabled
5732 * @see bluetooth_gatt_init()
5734 int bluetooth_gatt_deinit(void);
5736 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5737 unsigned char **svc_path)
5739 * @brief Exports a new gatt service to the service interface.
5741 * This function is a synchronous call.
5743 * @return BLUETOOTH_ERROR_NONE - Success \n
5744 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5745 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5746 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5749 * @param[in] svc_uuid Gatt service uuid.
5750 * @param[out] svc_path service object path of the exported service.
5751 * @remark Adapter should be enabled
5752 * @see bluetooth_gatt_init()
5754 int bluetooth_gatt_add_service(const char *svc_uuid,
5757 /* @fn int bluetooth_gatt_add_new_characteristic(
5758 const char *svc_path, const char *char_uuid,
5759 bt_gatt_permission_t permissions,
5760 bt_gatt_characteristic_property_t properties,
5761 int flags_length, char **char_path);;
5763 * @brief Exports a new gatt characteristic to the characteristic interface.
5765 * This function is a synchronous call.
5766 * @return BLUETOOTH_ERROR_NONE - Success \n
5767 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5768 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5769 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5771 * @param[in] svc_path service object path of the exported service.
5772 * @param[in] char_uuid Gatt service uuid.
5773 * @param[in] properties GATT characteristic properties.
5774 * @param[out] char_path characteristic object path of the exported characteristic.
5776 * @remark Adapter should be enabled
5777 * @see bluetooth_gatt_add_service()
5779 int bluetooth_gatt_add_new_characteristic(
5780 const char *svc_path, const char *char_uuid,
5781 bt_gatt_permission_t permissions,
5782 bt_gatt_characteristic_property_t properties,
5785 /* @fn bluetooth_gatt_set_characteristic_value(
5786 const char *characteristic, const char *char_value,
5789 * @brief adds gatt charactertisic value to the given charactertistic path.
5791 * This function is a synchronous call.
5792 * @return BLUETOOTH_ERROR_NONE - Success \n
5793 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5794 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5795 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5797 * @param[in] char_value Value of the GATT characteristic to be added.
5798 * @param[in] value_length length of the chantacteristic value..
5799 * @param[out] characteristic characteristic object path..
5801 * @remark Adapter should be enabled
5802 * @see bluetooth_gatt_add_service()
5804 int bluetooth_gatt_set_characteristic_value(
5805 const char *characteristic, const char *char_value,
5808 /* @fn int bluetooth_gatt_add_descriptor(
5809 const char *char_path, const char *desc_uuid,
5810 bt_gatt_permission_t permissions,
5813 * @brief Exports a new gatt descriptor to the descriptor interface.
5815 * This function is a synchronous call.
5817 * @return BLUETOOTH_ERROR_NONE - Success \n
5818 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5819 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5820 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5823 * @param[in] desc_uuid Gatt descriptor uuid.
5824 * @param[in] desc_value GATT descriptor value.
5825 * @param[in] value_length Length of GATT descriptor value.
5826 * @param[in] permissions descriptor permissions.
5827 * @param[in] properties GATT descriptor properties.
5828 * @param[in] char_path characteristics object path of the exported character.
5830 * @remark Adapter should be enabled
5831 * @see bluetooth_gatt_add_service()
5832 * @see bluetooth_gatt_add_characteristics()
5834 int bluetooth_gatt_add_descriptor(
5835 const char *char_path, const char *desc_uuid,
5836 bt_gatt_permission_t permissions,
5839 /* @fn int bluetooth_gatt_set_descriptor_value(
5840 const char *desc_path, const char *desc_value,
5843 * @brief Adds value to the given descriptor handle.
5845 * This function is a synchronous call.
5847 * @return BLUETOOTH_ERROR_NONE - Success \n
5848 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5849 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5850 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5853 * @param[in] desc_value GATT descriptor value.
5854 * @param[in] value_length Length of GATT descriptor value.
5855 * @param[in] desc_path descriptor path to which the value needs to be added.
5857 * @remark Adapter should be enabled
5858 * @see bluetooth_gatt_add_service()
5859 * @see bluetooth_gatt_add_characteristics()
5861 int bluetooth_gatt_set_descriptor_value(
5862 const char *desc_path, const char *desc_value,
5865 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5867 * @brief Reads the Service registered on manager interface.
5869 * This function is a synchronous call.
5871 * @return BLUETOOTH_ERROR_NONE - Success \n
5872 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5873 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5874 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5877 * @param[in] svc_uuid Gatt Service uuid.
5879 * @remark Adapter should be enabled and service should be registered.
5880 * @see bluetooth_gatt_register_service()
5882 int bluetooth_gatt_get_service(const char *svc_uuid);
5884 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5886 * @brief Registers the given service path with the library.
5888 * This function is a synchronous call.
5890 * @return BLUETOOTH_ERROR_NONE - Success \n
5891 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5892 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5893 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5896 * @param[in] svc_path service object path of the exported service.
5898 * @remark Adapter should be enabled
5899 * @see bluetooth_gatt_add_service()
5900 * @see bluetooth_gatt_add_characteristics()
5901 * @see bluetooth_gatt_add_descriptor()
5902 * @see bluetooth_gatt_register_application()
5904 int bluetooth_gatt_register_service(const char *svc_path);
5906 /* @fn int bluetooth_gatt_register_application(void)
5908 * @brief Registers the application with the bluez gatt server.
5910 * This function is a synchronous call.
5912 * @return BLUETOOTH_ERROR_NONE - Success \n
5913 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5914 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5915 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5919 * @remark Adapter should be enabled
5920 * @see bluetooth_gatt_init()
5921 * @see bluetooth_gatt_add_service()
5922 * @see bluetooth_gatt_add_characteristics()
5923 * @see bluetooth_gatt_add_descriptor()
5924 * @see bluetooth_gatt_register_service()
5926 int bluetooth_gatt_register_application(void);
5928 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5930 * @brief Removes(unregister) service from the bluez gatt server db.
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_service()
5948 int bluetooth_gatt_unregister_service(const char *svc_path);
5950 /* @fn int bluetooth_gatt_unregister_application(void)
5952 * @brief Removes(unregister) the application with the bluez gatt server,
5953 * and deletes all the service registered.
5955 * This function is a synchronous call.
5957 * @return BLUETOOTH_ERROR_NONE - Success \n
5958 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5959 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5960 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5964 * @remark Adapter should be enabled
5965 * @see bluetooth_gatt_init()
5966 * @see bluetooth_gatt_add_service()
5967 * @see bluetooth_gatt_add_characteristics()
5968 * @see bluetooth_gatt_add_descriptor()
5969 * @see bluetooth_gatt_register_service()
5970 * @see bluetooth_gatt_unregister_service()
5972 int bluetooth_gatt_unregister_application(void);
5974 /* @fn int bluetooth_gatt_send_response(int request_id,
5975 * int offset, char *value, int value_length)
5977 * @brief Updates the attribute value in local attribute list.
5979 * This function is a synchronous call.
5981 * @return BLUETOOTH_ERROR_NONE - Success \n
5982 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5983 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5984 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5987 * @param[in] request_id The identification of a read request
5988 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5989 * @param[in] resp_state The identification of response state
5990 * @param[in] offset The offset from where a value is read
5991 * @param[in] value The value to be sent. It will be sent from @a offset.
5992 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5993 * @param[in] value_length Value Length.
5995 * @remark Adapter should be enabled
5996 * @see bluetooth_gatt_add_service()
5997 * @see bluetooth_gatt_add_characteristics()
5998 * @see bluetooth_gatt_add_descriptor()
5999 * @see bluetooth_gatt_register_service()
6001 int bluetooth_gatt_send_response(int request_id, guint req_type,
6002 int resp_state, int offset, char *value, int value_length);
6004 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6006 * @brief Sets the notification property for a characteristic.
6008 * This function is a synchronous call.
6010 * @return BLUETOOTH_ERROR_NONE - Success \n
6011 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6012 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6013 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6016 * @param[in] char_path characteristic object path.
6017 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6019 * @remark Adapter should be enabled
6020 * @see bluetooth_gatt_update_characteristic()
6022 int bluetooth_gatt_server_set_notification(const char *char_path,
6023 bluetooth_device_address_t *unicast_address);
6025 /* @fn int bluetooth_gatt_delete_services(void)
6027 * @brief deletes (unregisters) all services from the gatt server database..
6029 * This function is a synchronous call.
6031 * @return BLUETOOTH_ERROR_NONE - Success \n
6032 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6033 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6034 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6038 * @remark Adapter should be enabled
6039 * @see bluetooth_gatt_add_service()
6040 * @see bluetooth_gatt_add_characteristics()
6041 * @see bluetooth_gatt_add_descriptor()
6042 * @see bluetooth_gatt_register_service()
6043 * @see bluetooth_gatt_unregister_service()
6045 int bluetooth_gatt_delete_services(void);
6047 /* @fn int bluetooth_gatt_update_characteristic(void)
6049 * @brief updates the given characteristic with a new value
6051 * This function is a synchronous call.
6053 * @return BLUETOOTH_ERROR_NONE - Success \n
6054 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6055 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6056 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6060 * @remark Adapter should be enabled
6061 * @see bluetooth_gatt_add_service()
6062 * @see bluetooth_gatt_add_characteristics()
6063 * @see bluetooth_gatt_add_descriptor()
6064 * @see bluetooth_gatt_register_service()
6065 * @see bluetooth_gatt_unregister_service()
6067 int bluetooth_gatt_update_characteristic(const char *char_path,
6068 const char* char_value, int value_length);
6071 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6073 * @brief Set advertising status.
6075 * This function is used to enable or disable LE advertising.
6076 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6078 * This function is a synchronous call.
6080 * @return BLUETOOTH_ERROR_NONE - Success \n
6081 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6082 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6085 * @param[in] enable - The status of advertising
6088 * @see bluetooth_set_advertising_data
6090 int bluetooth_set_advertising(int handle, gboolean enable);
6093 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6095 * @brief Set advertising status along with interval value.
6097 * This function is used to enable or disable LE advertising.
6098 * Interval_min and Interval_max is used to set the best advertising interval.
6099 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6101 * This function is a synchronous call.
6103 * @return BLUETOOTH_ERROR_NONE - Success \n
6104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6105 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6108 * @param[in] enable - The status of advertising
6109 * @param[in] interval_min - Minimum interval of advertising (msec)
6110 * @param[in] interval_max - Maximum interval of advertising (msec)
6111 * @param[in] filter_policy - Advertising filter policy
6114 * @see bluetooth_set_advertising_data
6116 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6117 bluetooth_advertising_params_t *params);
6120 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6121 * @brief Get the advertising data
6123 * This function is used to get advertising data.
6124 * Before calling this API, the adapter should be enabled.
6126 * This function is a synchronous call.
6128 * @return BLUETOOTH_ERROR_NONE - Success \n
6129 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6130 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6131 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6133 * @param[out] value - Advertising data structure.
6134 * @param[out] length - The length of Advertising data.
6138 bluetooth_advertising_data_t *value = { {0} };
6141 ret = bluetooth_get_advertising_data(&value, &length);
6144 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6147 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6149 * @brief Set advertising data with value
6151 * This function is used to set advertising data and Maximum size of advertising data
6152 * is 28 byte (Except Flag)
6154 * This function is a synchronous call.
6156 * @return BLUETOOTH_ERROR_NONE - Success \n
6157 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6158 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6161 * @param[in] value - Advertising data structure.
6165 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6168 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6170 * @brief Check the privilege for advertising parameter setting
6172 * This function is a synchronous call.
6174 * @return BLUETOOTH_ERROR_NONE - Success \n
6175 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6181 int bluetooth_check_privilege_advertising_parameter(void);
6184 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6185 * @brief Get the LE scan response data
6187 * This function is used to get scan response data.
6188 * Before calling this API, the adapter should be enabled.
6190 * This function is a synchronous call.
6192 * @return BLUETOOTH_ERROR_NONE - Success \n
6193 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6194 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6195 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6197 * @param[out] value - Scan response data structure.
6198 * @param[out] length - The length of Scan response data.
6202 bluetooth_scan_resp_data_t *value = { {0} };
6205 ret = bluetooth_get_scan_response_data(&value, &length);
6208 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6211 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6213 * @brief Set scan response data with value
6215 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6217 * This function is a synchronous call.
6219 * @return BLUETOOTH_ERROR_NONE - Success \n
6220 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6221 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6224 * @param[in] value - LE Scan response data structure.
6228 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6231 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6233 * @brief Set scan interval and window
6235 * This function is used to set LE scan interval and window size
6237 * This function is a synchronous call.
6239 * @return BLUETOOTH_ERROR_NONE - Success \n
6240 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6241 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6244 * @param[in] interval - Interval of LE scan (msec)
6245 * @param[in] window - Window size of LE scan (msec)
6249 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6252 * @fn int bluetooth_is_advertising(void)
6253 * @brief Check for the advertising is in-progress or not.
6255 * This API is used to check the current status of the advertising procedure.
6256 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6259 * This function checks whether the advertising is started or not.
6261 * This function is a synchronous call.
6263 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6265 * @return BLUETOOTH_ERROR_NONE - Success \n
6266 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6269 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6273 gboolean is_advertising = 0;
6275 ret = bluetooth_is_advertising(&is_advertising);
6278 int bluetooth_is_advertising(gboolean *is_advertising);
6281 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6282 * @brief Add LE device to white list
6284 * This API is used to add LE device to white list
6285 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6289 * This function is a synchronous call.
6291 * @param[in] address The address of remote device
6293 * @return BLUETOOTH_ERROR_NONE - Success \n
6294 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6297 * @see bluetooth_set_custom_advertising
6299 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6302 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6303 * @brief Remove LE device from white list
6305 * This API is used to remove LE device from white list
6306 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6310 * This function is a synchronous call.
6312 * @param[in] address The address of remote device
6314 * @return BLUETOOTH_ERROR_NONE - Success \n
6315 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6318 * @see bluetooth_set_custom_advertising
6320 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6323 * @fn int bluetooth_clear_white_list(void)
6324 * @brief Clear white list
6326 * This API is used to clear white list
6327 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6331 * This function is a synchronous call.
6333 * @param[in] address The address of remote device
6335 * @return BLUETOOTH_ERROR_NONE - Success \n
6336 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6339 * @see bluetooth_set_custom_advertising
6341 int bluetooth_clear_white_list(void);
6344 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6345 * const bluetooth_le_connection_param_t *parameters)
6346 * @brief update connection paramter of LE connection.
6348 * This function is a synchronous call.
6350 * @return BLUETOOTH_ERROR_NONE - Success \n
6351 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6354 * @param[in] address - remote device address value.
6355 * @param[in] parameters - new connection parameters.
6358 * @see bluetooth_bond_device
6360 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6361 const bluetooth_le_connection_param_t *parameters);
6364 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6366 * @brief Enable/Disable LE Privacy feature.
6368 * This function is used to enable or disable LE Privacy feature.
6369 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6371 * This function is a synchronous call.
6373 * @return BLUETOOTH_ERROR_NONE - Success \n
6374 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6375 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6378 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6382 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6385 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6387 * @brief Enable/Disable LE static random address.
6389 * This function is used to enable or disable LE static random address.
6391 * This function is a synchronous call.
6393 * @return BLUETOOTH_ERROR_NONE - Success \n
6394 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6395 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6398 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6402 int bluetooth_set_le_static_random_address(gboolean enable);
6405 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6406 * bluetooth_le_connection_mode_t mode)
6407 * @brief update connection paramter of LE connection.
6409 * This function is a synchronous call.
6411 * @return BLUETOOTH_ERROR_NONE - Success \n
6412 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6413 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6416 * @param[in] address - remote device address value.
6417 * @param[in] mode - new connection mode.
6421 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6422 bluetooth_le_connection_mode_t mode);
6425 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6426 * @brief Request for new ATT MTU value.
6428 * This function is a asynchronous call.
6430 * @return BLUETOOTH_ERROR_NONE - Success \n
6431 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6432 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6435 * @param[in] address - remote device address value.
6436 * @param[in] mtu - MTU value to be set.
6440 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6443 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6444 * unsigned int *mtu)
6445 * @brief Gets the xisting MTU value set for a connection.
6447 * This function is a synchronous call.
6449 * @return BLUETOOTH_ERROR_NONE - Success \n
6450 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6451 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6454 * @param[in] address - remote device address value.
6455 * @param[out] mtu - MTU value set for the connection.
6459 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6463 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6464 * bluetooth_device_address_t *id_address)
6465 * @brief Gets the Identity address of remote device.
6467 * This function is a synchronous call.
6469 * @return BLUETOOTH_ERROR_NONE - Success \n
6470 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6471 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6474 * @param[in] device_rpa - remote Resolvable private address.
6475 * @param[out] id_address - remote Identity device address value.
6479 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6480 bluetooth_device_address_t *id_address);
6483 * @fn int bluetooth_le_read_maximum_data_length()
6484 * @brief reads the maximum LE data length supported in the controller.
6486 * This function is a synchronous call.
6488 * @return BLUETOOTH_ERROR_NONE - Success \n
6489 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6495 int bluetooth_le_read_maximum_data_length(
6496 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6498 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6499 * @brief writes the host suggested values for the controllers max transmitted no of payload
6500 * octects to be used for new connections.
6502 * This function is a synchronous call.
6504 * @return BLUETOOTH_ERROR_NONE - Success \n
6505 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6511 int bluetooth_le_write_host_suggested_default_data_length(
6512 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6514 int bluetooth_le_read_suggested_default_data_length(
6515 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6517 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6518 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6520 int bluetooth_pbap_init(void);
6521 int bluetooth_pbap_deinit(void);
6522 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6523 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6524 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6525 bt_pbap_folder_t *folder);
6526 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6527 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6528 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6529 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6530 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6531 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6532 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6533 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6536 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6538 * @brief Set manufacturer data with value
6540 * This function is used to set manufacturer data.
6542 * This function is a synchronous call.
6544 * @return BLUETOOTH_ERROR_NONE - Success \n
6545 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6546 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6549 * @param[in] value - Manufacturer data structure.
6553 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6555 int bluetooth_set_passkey_notification(gboolean enable);
6558 * @fn int bluetooth_dpm_is_mode_allowed(void);
6560 * @brief Checks Restriction for BT mode(BT allowed or not)
6562 * This function is a synchronous call.
6564 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6565 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6566 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6573 int bluetooth_dpm_is_mode_allowed(void);
6576 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6578 * @brief Sets Restriction for BT mode(BT allowed or not)
6580 * This function is a synchronous call.
6582 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6583 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6584 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6587 * @param[in] value - BT Allow value.
6588 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6589 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6590 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6591 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6595 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6598 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6600 * @brief Reads the Restriction for BT mode(BT allowed or not)
6602 * This function is a synchronous call.
6604 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6605 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6606 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6610 * @param[out] value - BT Allow value.
6611 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6612 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6613 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6614 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6618 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6621 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6623 * @brief Sets the Restriction for device.
6625 * This function is a synchronous call.
6627 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6628 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6629 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6632 * @param[in] value - State value.
6633 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6634 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6638 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6641 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6643 * @brief Reads the Restriction for device.
6645 * This function is a synchronous call.
6647 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6648 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6649 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6653 * @param[out] value - State value.
6654 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6655 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6659 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6662 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6664 * @brief Sets the Restriction for uuid.
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
6673 * @param[in] value - State value.
6674 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6675 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6679 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6682 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6684 * @brief Reads the Restriction for uuid.
6686 * This function is a synchronous call.
6688 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6689 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6690 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6694 * @param[out] value - State value.
6695 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6696 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6700 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6703 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6705 * @brief Adds the device to blacklist.
6707 * This function is a synchronous call.
6709 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6710 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6711 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6714 * @param[in] device_address - Device address
6718 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6721 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6723 * @brief Adds the device to whitelist.
6725 * This function is a synchronous call.
6727 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6728 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6729 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6732 * @param[in] device_address - Device address
6736 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6739 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6741 * @brief Adds the Service UUIDS to blacklist.
6743 * This function is a synchronous call.
6745 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6746 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6747 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6750 * @param[in] service_uuids - profile or custom service uuids
6754 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6757 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6759 * @brief Adds the Service UUIDS to whitelist.
6761 * This function is a synchronous call.
6763 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6764 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6765 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6768 * @param[in] service_uuids - profile or custom service uuids
6772 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6775 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6777 * @brief Clears the devices from blacklist.
6779 * This function is a synchronous call.
6781 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6782 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6783 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6790 int bluetooth_dpm_clear_devices_from_blacklist(void);
6793 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6795 * @brief Clears the devices from whitelist.
6797 * This function is a synchronous call.
6799 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6800 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6801 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6808 int bluetooth_dpm_clear_devices_from_whitelist(void);
6811 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6813 * @brief Clears the uuids from blacklist.
6815 * This function is a synchronous call.
6817 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6818 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6819 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6826 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6829 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6831 * @brief Clears the uuids from whitelist.
6833 * This function is a synchronous call.
6835 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6836 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6837 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6844 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6847 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6849 * @brief reads the devices from blacklist.
6851 * This function is a synchronous call.
6853 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6854 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6855 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6858 * @param[out] device_list - list of devices
6862 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6865 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6867 * @brief reads the devices from whitelist.
6869 * This function is a synchronous call.
6871 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6872 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6873 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6876 * @param[out] device_list - list of devices
6880 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6883 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6885 * @brief reads the uuids from blacklist.
6887 * This function is a synchronous call.
6889 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6890 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6891 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6894 * @param[in] uuid_list - list of uuids
6898 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6901 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6903 * @brief reads the uuids from whitelist.
6905 * This function is a synchronous call.
6907 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6908 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6909 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6912 * @param[in] uuid_list - list of uuids
6916 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6919 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6921 * @brief Removes the device from whitelist.
6923 * This function is a synchronous call.
6925 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6926 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6927 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6930 * @param[in] device_address - Device address
6934 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6937 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6939 * @brief Removes the device from blacklist.
6941 * This function is a synchronous call.
6943 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6944 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6945 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6948 * @param[in] device_address - Device address
6952 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6955 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6957 * @brief Removes the Service UUIDS from whitelist.
6959 * This function is a synchronous call.
6961 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6962 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6963 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6966 * @param[in] service_uuids - profile or custom service uuids
6970 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6973 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6975 * @brief Removes the Service UUIDS from blacklist.
6977 * This function is a synchronous call.
6979 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6980 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6981 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6984 * @param[in] service_uuids - profile or custom service uuids
6988 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6991 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6993 * @brief Sets the Restriction for outgoing call.
6995 * This function is a synchronous call.
6997 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6998 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6999 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7002 * @param[in] value - State value.
7003 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7004 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7008 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7011 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7013 * @brief Reads the Restriction for outgoing call.
7015 * This function is a synchronous call.
7017 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7018 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7019 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7023 * @param[out] value - State value.
7024 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7025 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7029 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7032 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7034 * @brief Sets the Restriction for Pairing.
7036 * This function is a synchronous call.
7038 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7039 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7040 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7043 * @param[in] value - State value.
7044 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7045 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7049 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7052 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7054 * @brief Reads the Restriction for Pairing
7056 * This function is a synchronous call.
7058 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7059 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7060 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7064 * @param[out] value - State value.
7065 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7066 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7070 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7073 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7075 * @brief Sets the Restriction for using Profiles.
7077 * This function is a synchronous call.
7079 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7080 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7081 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7084 * @param[in]profile - Profile.
7085 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7086 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7087 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7088 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7089 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7090 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7091 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7092 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7093 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7094 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7095 * BLUETOOTH_DPM_PROFILE_NONE
7096 * @param[in] value - State value.
7097 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7098 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7102 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7105 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7107 * @brief Reads the Restriction for using Profiles.
7109 * This function is a synchronous call.
7111 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7112 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7113 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7116 * @param[in]profile - Profile.
7117 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7118 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7119 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7120 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7121 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7122 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7123 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7124 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7125 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7126 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7127 * BLUETOOTH_DPM_PROFILE_NONE
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_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7137 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7139 * @brief Sets the Restriction for Desktop Connectivity.
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] value - State value.
7149 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7150 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7154 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7157 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7159 * @brief Reads the Restriction for Desktop Connectivity.
7161 * This function is a synchronous call.
7163 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7164 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7165 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7169 * @param[out] value - State value.
7170 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7171 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7175 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7178 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7180 * @brief Sets the Restriction for Discoverable state.
7182 * This function is a synchronous call.
7184 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7185 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7186 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7189 * @param[in] value - State value.
7190 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7191 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7195 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7198 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7200 * @brief Reads the Restriction for Discoverable state.
7202 * This function is a synchronous call.
7204 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7205 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7206 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7210 * @param[out] value - State value.
7211 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7212 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7216 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7219 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7221 * @brief Sets the Restriction for linited discoverable state..
7223 * This function is a synchronous call.
7225 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7226 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7227 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7230 * @param[in] value - State value.
7231 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7232 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7236 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7239 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7241 * @brief Reads the Restriction for limited discoverable state.
7243 * This function is a synchronous call.
7245 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7246 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7247 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7251 * @param[out] value - State value.
7252 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7253 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7257 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7259 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7261 * @brief Sets the Restriction for Data trasnfer.
7263 * This function is a synchronous call.
7265 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7266 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7267 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7270 * @param[in] value - State value.
7271 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7272 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7276 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7280 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7282 * @brief Reads the Restriction for Data trasnfer.
7284 * This function is a synchronous call.
7286 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7287 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7288 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7292 * @param[out] value - State value.
7293 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7294 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7298 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7301 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7302 * bluetooth_pxp_poperty_t property, int value);
7304 * @brief Sets the Proximity alert level/properties for monitor role.
7306 * This function is a synchronous call.
7308 * @return BLUETOOTH_ERROR_NONE - Success \n
7309 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7310 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7311 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7314 * @param[in] device_address remote device address
7315 * @param[in] property proximity profile property
7316 * @param[in] value alert level/property value to be set
7321 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7322 bluetooth_pxp_poperty_t property, int value);
7325 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7326 * bluetooth_pxp_poperty_t property, int *value);
7328 * @brief Reads the Proximity alert level/properties for monitor role.
7330 * This function is a synchronous call.
7332 * @return BLUETOOTH_ERROR_NONE - Success \n
7333 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7334 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7335 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7338 * @param[in] device_address remote device address
7339 * @param[in] property proximity profile property
7340 * @param[out] value alert level/property value
7344 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7345 bluetooth_pxp_poperty_t property, int *value);
7348 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7349 * int *services_supported);
7351 * @brief Reads the Proximity Monitor profile supported properties/services.
7353 * This function is a synchronous call.
7355 * @return BLUETOOTH_ERROR_NONE - Success \n
7356 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7357 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7358 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7361 * @param[in] device_address remote device address
7362 * @param[out] services_supported proximity profile property/service
7366 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7367 int *services_supported);
7370 * @fn int bluetooth_proximity_reporter_register();
7372 * @brief Register all proximity related services in BlueZ.
7374 * This function is a synchronous call.
7376 * @return BLUETOOTH_ERROR_NONE - Success \n
7377 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7383 int bluetooth_proximity_reporter_register(void);
7386 * @fn int bluetooth_proximity_reporter_unregister();
7388 * @brief Unregister all proximity related services in BlueZ.
7390 * This function is a synchronous call.
7392 * @return BLUETOOTH_ERROR_NONE - Success \n
7393 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7399 int bluetooth_proximity_reporter_unregister(void);
7402 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7403 * bluetooth_pxp_poperty_t property, int *value);
7405 * @brief Reads the Proximity alert level/properties for reporter role.
7407 * This function is a synchronous call.
7409 * @return BLUETOOTH_ERROR_NONE - Success \n
7410 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7411 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7412 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7415 * @param[in] device_address remote device address
7416 * @param[in] property proximity profile property
7417 * @param[out] value alert level/property value
7421 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7422 bluetooth_pxp_poperty_t property, int *value);
7425 * @fn int bluetooth_tds_provider_register(void);
7427 * @brief Register Transport Discovery Provider role.
7429 * This function is a synchronous call.
7431 * @return BLUETOOTH_ERROR_NONE - Success \n
7432 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7433 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7434 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7442 int bluetooth_tds_provider_register(void);
7445 * @fn int bluetooth_tds_provider_unregister(void);
7447 * @brief Unregister Transport Discovery Provider role.
7449 * This function is a synchronous call.
7451 * @return BLUETOOTH_ERROR_NONE - Success \n
7452 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7453 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7454 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7462 int bluetooth_tds_provider_unregister(void);
7465 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7467 * @brief Create Transport Discovery Provider for a transport.
7469 * This function is a synchronous call.
7471 * @return BLUETOOTH_ERROR_NONE - Success \n
7472 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7473 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7474 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7477 * @param[in] Transport (BT, CUSTOM etc.)
7478 * @param[in] Unique handle for TDS provider.
7483 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7486 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7488 * @brief Remove previously created Transport Discovery Provider.
7490 * This function is a synchronous call.
7492 * @return BLUETOOTH_ERROR_NONE - Success \n
7493 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7496 * @param[in] Unique handle for previously created provider.
7501 int bluetooth_tds_provider_destroy(unsigned int handle);
7504 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7506 * @brief Set transport block for in advertisement and gatt db.
7508 * This function is a synchronous call.
7510 * @return BLUETOOTH_ERROR_NONE - Success \n
7511 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7512 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7513 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7516 * @param[in] Provider specific manufacturer data.
7517 * @param[in] Provider specific manufacturer data length.
7522 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7525 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7526 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7528 * @brief Set transport block for in advertisement and gatt db.
7530 * This function is a synchronous call.
7532 * @return BLUETOOTH_ERROR_NONE - Success \n
7533 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7534 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7535 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7538 * @param[in] Unique handle for TDS provider.
7539 * @param[in] Transport state (On/Off/Not Available).
7540 * @param[in] Transport specific data block.
7541 * @param[in] Transport specific data block length.
7546 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7547 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7550 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7551 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7553 * @brief Send response to TDS activation request from remoted device.
7555 * This function is a synchronous call.
7557 * @return BLUETOOTH_ERROR_NONE - Success \n
7558 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7559 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7560 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7563 * @param[in] Remote device BT address.
7564 * @param[in] Unique handle for TDS provider.
7565 * @param[in] Response for TDS activation request.
7566 * @param[in] Transport specific data block to be sent in activation response.
7567 * @param[in] Data block length.
7572 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7573 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7576 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7578 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7580 * This function is an asynchronous call.
7582 * @return BLUETOOTH_ERROR_NONE - Success \n
7583 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7584 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7585 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7586 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7589 * @param[in] device_address remote device address
7590 * @param[in] handle attribute handle
7592 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7593 * when TDS data is received from Remote provider
7595 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7596 const char *handle);
7599 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7601 * @brief Enables CCCD on Remote Provider.
7603 * This function is an asynchronous call.
7605 * @return BLUETOOTH_ERROR_NONE - Success \n
7606 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7607 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7608 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7609 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7612 * @param[in] device_address remote device address
7613 * @param[in] handle attribute handle
7615 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7616 * when Indication is enabled on Remote provider
7618 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7619 const char *handle);
7622 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7623 * unsigned char *buf, int length);
7624 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7626 * This function is an asynchronous call.
7628 * @return BLUETOOTH_ERROR_NONE - Success \n
7629 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7630 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7631 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7632 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7635 * @param[in] device_address remote device address
7636 * @param[in] handle attribute handle
7637 * @param[in] buf Control point activation param
7638 * @param[in] param length
7640 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7641 * is received from remote Provider
7643 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7644 unsigned char *buf, int length);
7647 * @fn int bluetooth_otp_server_init(const char *directory);
7649 * @brief Starts OTP server.
7651 * This function is a synchronous call.
7661 int bluetooth_otp_server_init(const char *directory);
7664 * @fn int bluetooth_otp_server_deinit();
7666 * @brief Stops OTP server.
7668 * This function is a synchronous call.
7678 int bluetooth_otp_server_deinit();
7681 * @fn int bluetooth_otp_enable_notification(const char *handle);
7683 * @brief Enable notification for remote OACP & OLCP characteristics.
7685 * This function is a synchronous call.
7695 int bluetooth_otp_enable_notification(const char *handle);
7698 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7699 * unsigned char *buf, int length);
7701 * @brief Write value on remote characteristics.
7703 * This function is a synchronous call.
7713 int bluetooth_otp_write_characteristics_value(const char *handle,
7714 unsigned char *buf, int length);
7717 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7719 * @brief Read value for remote characteristics.
7721 * This function is a synchronous call.
7731 int bluetooth_otp_read_characteristic_value(const char *handle);
7734 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7736 * @brief Read value for remote characteristics.
7738 * This function is a synchronous call.
7748 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7751 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7753 * @brief Read value for remote characteristics.
7755 * This function is a synchronous call.
7765 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7768 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7769 * @brief Check if Adapter supports LE 2M PHY feature or not.
7771 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7772 * in BT 5.0 specification.
7774 * This function is a synchronous call.
7776 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7777 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7778 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7779 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7780 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7784 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7787 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7788 * @brief Check if Adapter supports LE 2M CODED feature or not.
7790 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7791 * in BT 5.0 specification.
7793 * This function is a synchronous call.
7795 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7796 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7797 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7798 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7799 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
7803 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
7811 #endif /* __cplusplus */
7812 #endif /* _BLUETOOTH_API_H_*/