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_LE_OOB_DATA_LENGTH 100
63 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
65 #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;
333 uint32_t session_connected_time;
334 uint32_t session_scan_time;
344 } bt_battery_app_data;
350 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
351 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
352 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
353 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
354 } bluetooth_adapter_state_t;
360 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
361 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
362 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
363 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
364 } bluetooth_adapter_le_state_t;
370 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
371 /*Changed the order to make it compatable with old method */
372 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
373 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
374 /**< Discoverable mode with time limit
375 After specific timeout, it is changed
376 to non discoverable mode */
377 } bluetooth_discoverable_mode_t;
380 * Network connect mode
383 BLUETOOTH_NETWORK_PANU_ROLE,
385 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
386 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
387 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
388 } bluetooth_network_role_t;
392 * Service type matched to bt_profile_type_t of bt-service-common.h
395 BLUETOOTH_RFCOMM_SERVICE = 0x01,
396 BLUETOOTH_A2DP_SERVICE = 0x02,
397 BLUETOOTH_HSP_SERVICE = 0x04,
398 BLUETOOTH_HID_SERVICE = 0x08,
399 BLUETOOTH_NAP_SERVICE = 0x10,
400 BLUETOOTH_HFG_SERVICE = 0x20,
401 BLUETOOTH_GATT_SERVICE = 0x40,
402 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
403 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
404 BLUETOOTH_PBAP_SERVICE = 0x200,
405 } bluetooth_service_type_t;
411 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
412 /* represents that connection
413 * type can both BR/EDR and LE */
414 BLUETOOTH_DEV_CONN_BREDR = 0x00,
415 BLUETOOTH_DEV_CONN_LE = 0x01,
416 } bluetooth_conn_type_t;
422 BLUETOOTH_CODEC_ID_CVSD = 0x01,
423 BLUETOOTH_CODEC_ID_MSBC = 0x02,
424 } bluetooth_codec_type_t;
430 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
431 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
432 } bluetooth_hf_audio_connected_type_t;
438 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
439 } bluetooth_advertising_data_t;
445 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
446 } bluetooth_scan_resp_data_t;
449 * Advertising filter policy
452 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
453 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
454 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
455 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
456 } bluetooth_advertising_filter_policy_t;
462 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
463 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
464 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
465 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
466 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
467 } bluetooth_advertising_type_t;
470 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
471 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
472 } bluetooth_gatt_service_change_type_t;
475 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
476 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
477 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
478 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
479 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
480 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
481 } bt_gatt_permission_t;
484 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
485 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
486 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
487 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
488 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
489 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
490 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
491 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
492 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
493 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
494 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
495 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
496 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
497 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
498 } bt_gatt_characteristic_property_t;
501 * Remote device request types for attributes
504 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
505 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
506 } bluetooth_gatt_att_request_tyep_t;
509 * Proximity Property Type
512 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
513 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
514 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
515 } bluetooth_pxp_poperty_t;
521 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
522 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
524 BLUETOOTH_TDS_TRANSPORT_INVALID
525 } bluetooth_tds_transport_t;
528 * TDS transport state
531 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
532 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
533 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
534 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
535 } bluetooth_tds_transport_state_t;
542 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
543 } bluetooth_tds_data_t;
546 * TDS activation request
549 bluetooth_device_address_t rem_addr;
550 bluetooth_tds_transport_t transport;
551 bluetooth_tds_data_t tds_data;
552 } bluetooth_tds_activation_req_t;
555 * TDS Control Point data
558 int length; /**< Control point data length */
559 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
560 } bluetooth_control_point_data_t;
563 * TDS Indication Response data
566 bluetooth_device_address_t rem_addr; /**< Device address */
567 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
568 } bluetooth_tds_indication_res_t;
571 * Structure to hold the TDS Complete data information which is read from remote TDS provider
574 bluetooth_device_address_t device_address; /**< Device address */
575 int data_length; /**< Data length */
576 char *data; /**< Complete Transport Specific data */
577 } bluetooth_tds_transport_data_info_t;
580 * OTP Characteristics Value
583 int length; /**< Characteristics value length */
584 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
585 } bluetooth_otp_charc_data_t;
588 * Structure to hold the OTP response data from remote OTP server
591 char *handle; /**< Handle */
592 int data_length; /**< Data length */
593 char *data; /**< Read data */
594 } bluetooth_otp_resp_info_t;
597 * Structure to hold the OTC Channel Info
600 gboolean connected; /**< Connection Status */
602 char *address; /**< Remote address */
603 } bluetooth_otc_info_t;
606 * Advertising parameters
611 guint8 filter_policy;
614 } bluetooth_advertising_params_t;
620 int type; /**< passive 0, active 1 */
621 float interval; /**< LE scan interval */
622 float window; /**< LE scan window */
623 } bluetooth_le_scan_params_t;
629 BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
630 BLUETOOTH_LE_ACTIVE_SCAN
631 } bluetooth_le_scan_type_t;
641 } bluetooth_le_connection_param_t;
644 LE Read Maximum Data Length
647 guint16 max_tx_octets;
649 guint16 max_rx_octets;
651 } bluetooth_le_read_maximum_data_length_t;
654 LE Read Host suggested default Data Length
657 guint16 def_tx_octets;
659 } bluetooth_le_read_host_suggested_data_length_t;
662 * Samsung XSAT Vendor dependent command
667 } bluetooth_vendor_dep_at_cmd_t;
673 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
674 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
675 } bluetooth_opp_transfer_type_t;
680 } bluetooth_hf_ciev_device_event_t;
682 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
683 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
684 /**< Base ID for GAP Event */
685 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
686 /**< Base ID for SDP events */
687 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
688 /**< Base ID for RFCOMM events */
689 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
690 /**< Base ID for NETWORK events */
691 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
692 /**< Base ID for HDP events */
693 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
694 /**< Base ID for OPC events */
695 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
696 /**< Base ID for Obex Server events */
697 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
698 /**< Base ID for GATT events */
700 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
701 /**< Base ID for Audio events */
702 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
703 /**< Base ID for HID events */
704 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
705 /**< Base ID for Advertising events */
706 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
707 /**< Base ID for PBAP Client events */
708 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
709 /**< Base ID for AVRCP events */
710 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
711 /**< Base ID for IPSP events */
712 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
713 /**< Base ID for MAP events */
714 #define BLUETOOTH_EVENT_MESH_BASE ((int)(BLUETOOTH_EVENT_MAP_BASE + 0x0020))
715 /**< Base ID for MAP events */
718 * Bluetooth event type
721 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
723 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
724 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
725 BLUETOOTH_EVENT_DISABLED_BATTERY_DATA, /**< Bluetooth event adapter disabled battery data*/
726 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
727 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
728 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
729 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
730 /**< Bluetooth event Discoverable timeout requested*/
731 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
732 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
733 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
734 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
735 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
736 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
737 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
738 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
739 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
740 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
741 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
742 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
743 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
744 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
745 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
746 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
747 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
748 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
749 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
750 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
751 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
753 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
754 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
755 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
756 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
757 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
759 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
760 /**< Bluetooth event serice search base id */
761 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
762 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
763 /**< RFCOMM data receive event */
764 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
765 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
767 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
769 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
770 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
772 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
774 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
775 /**< Bluetooth Network event */
776 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
777 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
778 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
779 /**< Network disconnected evnet in server */
781 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
782 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
784 BLUETOOTH_EVENT_HDP_CONNECTED
785 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
786 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
787 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
789 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
790 /* OPC Connected event */
791 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
792 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
793 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
794 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
796 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
797 BLUETOOTH_EVENT_MAP_DISCONNECTED,
799 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
800 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
801 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
802 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
803 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
805 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
806 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
807 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
808 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
809 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
810 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
811 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
812 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
813 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
814 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
815 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
816 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
817 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
819 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
820 /* Obex server authorize event*/
821 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
822 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
823 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
824 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
825 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
826 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
828 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
829 /**<Discovered GATT service characteristics event*/
830 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
831 /**<Remote GATT charateristic value changed event*/
832 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
833 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
834 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
835 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
836 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
837 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
838 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
839 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
840 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
841 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
842 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
843 BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
844 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
845 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
846 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
847 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
848 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
849 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
850 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
851 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
852 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
853 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
854 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
855 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
856 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
857 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
858 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
859 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
860 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
861 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
862 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
863 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
864 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
865 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
866 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
867 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
868 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
869 BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
870 BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
871 BLUETOOTH_EVENT_HF_CONNECTED,
872 BLUETOOTH_EVENT_HF_DISCONNECTED,
873 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
874 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
875 BLUETOOTH_EVENT_HF_RING_INDICATOR,
876 BLUETOOTH_EVENT_HF_CALL_WAITING,
877 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
878 BLUETOOTH_EVENT_HF_CALL_STARTED,
879 BLUETOOTH_EVENT_HF_CALL_ENDED,
880 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
881 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
882 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
883 BLUETOOTH_EVENT_HF_CALL_STATUS,
884 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
885 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
886 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
887 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
888 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
889 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
890 BLUETOOTH_EVENT_HF_CALL_IDLE,
891 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
892 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
893 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
894 BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
896 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
897 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
898 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
899 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
900 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
902 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
903 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
904 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
905 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
906 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
907 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
908 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
909 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
911 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
912 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
913 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
914 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
915 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
916 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
917 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
919 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
920 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
921 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
922 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
923 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
924 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
925 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
926 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
927 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
929 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
930 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
931 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
932 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
933 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
934 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
935 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
936 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
937 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
938 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
939 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
941 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
942 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
943 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
944 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
945 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
946 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
947 BLUETOOTH_EVENT_MESH_SCAN_STARTED = BLUETOOTH_EVENT_MESH_BASE,
948 BLUETOOTH_EVENT_MESH_SCAN_FINISHED,
949 BLUETOOTH_EVENT_MESH_SCAN_RESULT,
950 BLUETOOTH_EVENT_MESH_AUTHENTICATION_REQUEST,
951 BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED,
952 BLUETOOTH_EVENT_MESH_NODE_BROWSED,
953 BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES,
954 BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
955 BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED,
956 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
957 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST,
958 BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
959 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST,
960 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED,
961 BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED,
962 BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
963 } bluetooth_event_type_t;
966 * This bt_service_uuid_list_t enum indicates service uuid list .
967 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
971 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
972 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
973 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
974 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
975 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
976 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
977 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
978 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
979 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
980 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
981 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
982 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
983 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
985 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
986 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
987 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
988 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
989 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
990 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
991 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
992 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
993 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
994 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
995 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
996 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
997 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
998 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
1000 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
1001 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
1002 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
1003 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
1004 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
1005 /**<DIRECT PRINTING*/
1006 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
1007 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
1008 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
1009 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
1010 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
1011 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
1012 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
1013 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
1014 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
1015 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
1016 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
1017 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
1018 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
1019 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
1020 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
1021 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
1022 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
1023 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
1024 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
1025 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
1026 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
1027 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
1028 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
1029 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
1030 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
1031 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
1032 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
1033 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
1034 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
1035 } bluetooth_service_uuid_list_t;
1038 * Service class part of class of device returned from device discovery
1041 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1042 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1043 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1044 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1045 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1046 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1047 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1048 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1049 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1050 } bluetooth_device_service_class_t;
1054 * Major device mask (For device discovery)
1057 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1058 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1059 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1060 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1061 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1062 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1063 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1064 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1065 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1066 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1067 } bluetooth_device_major_mask_t;
1071 * Major device class (part of Class of Device)
1074 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1075 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1076 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1077 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1078 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1079 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1080 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1081 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1082 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1083 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1084 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1085 } bluetooth_device_major_class_t;
1088 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1090 /* About Computer Major class */
1091 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1093 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1094 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1095 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1096 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1097 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1099 /* About Phone Major class */
1100 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1101 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1102 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1103 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1104 /**< voice gateway minor class */
1105 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1107 /* About LAN/Network Access Point Major class */
1108 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1109 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1110 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1111 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1112 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1113 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1114 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1115 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1117 /* About Audio/Video Major class */
1118 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1119 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1121 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1122 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1123 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1124 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1125 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1126 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1127 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1128 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1129 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1130 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1131 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1132 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1133 /**< Video Display and Loud
1134 Speaker minor class */
1135 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1138 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1140 /* About Peripheral Major class */
1141 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1142 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1143 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1144 /**< Combo Keyboard or pointing
1145 device minorclass */
1147 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1149 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1150 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1151 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1153 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1154 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1155 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1157 /* About Imaging Major class */
1158 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1159 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1160 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1161 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1163 /* About Wearable Major class */
1164 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1165 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1166 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1167 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1168 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1170 /* About Toy Major class */
1171 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1172 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1173 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1174 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1175 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1177 /* About Health Major class */
1178 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1179 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1180 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1181 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1182 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1183 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1184 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1185 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1186 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1187 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1188 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1189 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1190 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1191 } bluetooth_device_minor_class_t;
1194 * structure to hold the device information
1197 bluetooth_device_major_class_t major_class; /**< major device class */
1198 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1199 bluetooth_device_service_class_t service_class;
1200 /**< service device class */
1201 } bluetooth_device_class_t;
1204 * Discovery Role types
1207 DISCOVERY_ROLE_BREDR = 0x1,
1209 DISCOVERY_ROLE_LE_BREDR
1210 } bt_discovery_role_type_t;
1213 * Connected state types
1216 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1217 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1218 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1219 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1220 } bluetooth_connected_link_t;
1226 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1227 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1228 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1229 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1230 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1231 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1232 BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80, /**< rssi high threshold */
1233 } bluetooth_le_scan_filter_feature_t;
1236 * LE connection mode
1239 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1240 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1241 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1242 } bluetooth_le_connection_mode_t;
1245 * structure to hold the device information
1248 bluetooth_device_address_t device_address; /**< device address */
1249 bluetooth_device_name_t device_name; /**< device name */
1250 bluetooth_device_class_t device_class; /**< device class */
1251 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1252 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1254 int rssi; /**< received strength signal*/
1255 gboolean paired; /**< paired flag */
1256 bluetooth_connected_link_t connected; /**< connected link type */
1257 gboolean trust; /**< trust flag */
1258 gboolean is_alias_set; /** is device alias set flag**/
1259 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1260 } bluetooth_device_info_t;
1263 * structure to hold the LE device information
1266 int data_len; /**< manafacturer specific data length */
1267 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1268 } bluetooth_le_advertising_data_t;
1271 bluetooth_device_address_t device_address; /**< device address */
1272 int addr_type; /**< address type*/
1273 int rssi; /**< received strength signal*/
1274 bluetooth_le_advertising_data_t adv_ind_data;
1275 bluetooth_le_advertising_data_t scan_resp_data;
1276 } bluetooth_le_device_info_t;
1280 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1281 bluetooth_device_address_t device_address; /**< device address */
1282 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1283 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1284 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1285 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1286 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1287 bluetooth_le_advertising_data_t service_data; /**< service data */
1288 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1289 int manufacturer_id; /**< manufacturer ID */
1290 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1291 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1292 int rssi_high_threshold; /**< rssi high threshold */
1293 } bluetooth_le_scan_filter_t;
1296 bluetooth_device_address_t device_address; /**< device address */
1297 unsigned int mtu; /** < MTU set for the ATT connection */
1298 unsigned int status; /** < status of the MTU exchange */
1299 } bluetooth_le_att_mtu_info_t;
1302 * structure to hold the paired device information
1305 bluetooth_device_address_t device_address; /**< paired device address */
1306 bluetooth_device_name_t device_name; /**< device name */
1307 bluetooth_device_class_t device_class; /**< device class */
1308 } bluetooth_paired_device_info_t;
1311 * structure to hold the paired device information
1314 bluetooth_device_address_t device_address;
1315 /**< device address */
1316 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1317 /**< network interface name */
1318 } bluetooth_network_device_info_t;
1321 * Authentication event types
1325 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1326 BLUETOOTH_AUTH_PIN_REQUEST,
1327 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1328 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1329 } bluetooth_auth_type_t;
1332 * structure to hold the pincode/pass-key req informations
1335 bluetooth_device_address_t device_address; /**< remote device address */
1336 bluetooth_device_name_t device_name; /**< device name */
1337 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1338 bool incoming; /**< stores if bonding request is incoming */
1339 } bluetooth_authentication_request_info_t;
1342 * Stucture to hold discovery option
1345 unsigned short max_response; /**< the number of maximum response */
1346 unsigned short discovery_duration;
1347 /**< duration of discovery (seconds) */
1348 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1349 classOfDevice variable */
1350 } bluetooth_discovery_option_t;
1353 * Stucture to hold event information
1356 int event; /**< event type */
1357 int result; /**< Success or error value */
1359 /**<parameter data pointer */
1361 } bluetooth_event_param_t;
1364 bluetooth_device_address_t device_addr;
1365 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1366 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1367 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1372 bluetooth_device_address_t device_addr;
1373 unsigned char addr_type;
1376 } bt_connection_info_t;
1379 * Stucture to rfcomm receive data
1384 /**< the socket fd */
1385 int buffer_size;/**< the length of the receive buffer */
1387 /**< the receive data buffer */
1388 } bluetooth_rfcomm_received_data_t;
1394 HTYPE_TRANS_HANDSHAKE,
1395 HTYPE_TRANS_HID_CONTROL,
1396 HTYPE_TRANS_GET_REPORT,
1397 HTYPE_TRANS_SET_REPORT,
1398 HTYPE_TRANS_GET_PROTOCOL,
1399 HTYPE_TRANS_SET_PROTOCOL,
1401 HTYPE_TRANS_UNKNOWN,
1402 HTYPE_TRANS_GET_IDLE = 0xF0,
1403 HTYPE_TRANS_SET_IDLE = 0xF1,
1404 } bt_hid_header_type_t;
1410 PTYPE_DATA_RTYPE_INPUT,
1411 PTYPE_DATA_RTYPE_OUTPUT
1412 } bt_hid_param_type_t;
1415 * Stucture to hid receive data
1418 const char *address;
1419 bt_hid_header_type_t type;
1420 /**< Header type containing */
1421 bt_hid_param_type_t param;
1422 /**< Param type in header like INPUT Report or OutPut Report */
1423 int buffer_size;/**< the length of the receive buffer */
1425 /**< the receive data buffer */
1426 } bluetooth_hid_received_data_t;
1429 * Stucture to rfcomm connection
1433 int socket_fd; /**< the socket fd */
1434 int server_id; /* Server id */
1435 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1436 bluetooth_device_address_t device_addr;
1437 /**< device address */
1438 char uuid[BLUETOOTH_UUID_STRING_MAX];
1439 } bluetooth_rfcomm_connection_t;
1442 * Stucture to rfcomm disconnection
1446 /**< the socket fd */
1447 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1448 bluetooth_device_address_t device_addr;
1449 /**< device address */
1450 char uuid[BLUETOOTH_UUID_STRING_MAX];
1451 } bluetooth_rfcomm_disconnection_t;
1455 /**< the socket fd */
1456 bluetooth_device_address_t device_addr;
1457 /**< device address */
1458 } bluetooth_rfcomm_connection_request_t;
1467 } bt_hdp_qos_type_t;
1473 HDP_ROLE_SOURCE = 0x0,
1475 } bt_hdp_role_type_t;
1479 * Stucture to HDP connected
1482 const char *app_handle; /**< the application handle */
1483 unsigned int channel_id; /**< the channel id */
1484 bt_hdp_qos_type_t type; /**< the QOS type */
1485 bluetooth_device_address_t device_address; /**< the remote address */
1486 } bt_hdp_connected_t;
1489 * Stucture to HDP disconnected
1492 unsigned int channel_id; /**< the channel id */
1493 bluetooth_device_address_t device_address; /**< the remote address */
1494 } bt_hdp_disconnected_t;
1497 * Stucture to HDP data indication
1500 unsigned int channel_id; /**< the channel id */
1501 const char *buffer; /**< the RX data buffer */
1502 unsigned int size; /**< the RX data size */
1503 } bt_hdp_data_ind_t;
1506 * Stucture to OPP client transfer information
1513 } bt_opc_transfer_info_t;
1515 /* TODO: MAP client structures, see above */
1517 * Stucture to Map filter fields
1522 } bt_map_list_filter_fields_info_t;
1524 /* Obex Server transfer type */
1525 #define TRANSFER_PUT "PUT"
1526 #define TRANSFER_GET "GET"
1528 * Stucture to OPP/FTP Server authorize information
1535 } bt_obex_server_authorize_into_t;
1543 } bt_obex_server_type_t;
1546 * Stucture to OPP/FTP server transfer information
1554 unsigned long file_size;
1556 bt_obex_server_type_t server_type;
1558 unsigned char *contact_auth_info;
1559 } bt_obex_server_transfer_info_t;
1562 * Stucture to OPP/FTP server connection/disconnection information
1568 } bt_obex_server_connection_info_t;
1572 * Stucture to OOB data
1576 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1577 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1578 unsigned int hash_len;
1579 unsigned int randomizer_len;
1581 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1582 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1583 unsigned int hash256_len;
1584 unsigned int randomizer256_len;
1586 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1587 unsigned int eir_len;
1591 * Structure to GATT attribute handle data
1597 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1598 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1599 } bt_gatt_handle_info_t;
1602 * Structure to a most basic GATT attribute handle data
1606 unsigned char uuid[16];
1607 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1608 } bt_gatt_handle_property_t;
1611 * Structure to GATT Remote service data
1618 bt_gatt_handle_info_t include_handles;
1619 bt_gatt_handle_info_t char_handle;
1620 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1621 } bt_gatt_service_property_t;
1624 * Structure to GATT Remote characteristic data
1628 char *service_handle;
1629 bt_gatt_handle_info_t handle_info;
1630 } bt_gatt_discovered_char_t;
1633 * Structure to format of GATT Characteristic Value
1637 unsigned char format;
1638 unsigned char exponent;
1639 unsigned short unit;
1640 unsigned char name_space;
1641 unsigned short description;
1642 } bt_gatt_char_format_t;
1645 * Structure to GATT Characteristic property
1653 bt_gatt_char_format_t format;
1655 unsigned int val_len;
1656 unsigned int permission;
1657 char *representation;
1658 bt_gatt_handle_info_t char_desc_handle;
1659 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1660 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1661 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1662 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1663 } bt_gatt_char_property_t;
1666 * Structure to GATT Characteristic descriptor property
1673 unsigned int val_len;
1674 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1675 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1676 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1677 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1678 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1679 } bt_gatt_char_descriptor_property_t;
1682 * Structure to GATT Characteristic value
1689 } bt_gatt_char_value_t;
1692 unsigned char UUID[16];
1696 } bt_gatt_notify_req_t ;
1699 * Structure to GATT Read Request
1703 char *service_handle;
1707 } bt_gatt_read_req_t;
1710 * Structure to GATT Value change
1714 char *service_handle;
1717 gboolean response_needed;
1721 } bt_gatt_value_change_t;
1724 bluetooth_device_address_t device_addr;
1726 bluetooth_gatt_service_change_type_t change_type;
1729 } bt_gatt_service_change_t;
1732 * Structure to GATT characteristc Notification change
1736 char *service_handle;
1737 gboolean att_notify;
1738 } bt_gatt_char_notify_change_t;
1741 * Structure to Indication confirmation
1745 char *service_handle;
1748 } bt_gatt_indicate_confirm_t;
1751 * Structure for GATT response data
1758 } bt_gatt_resp_data_t;
1761 * Structure to RSSI Signal Strength Alert
1772 * Structure to RSSI Signal Strength
1782 * Structure for RSSI Enabled or Disabled
1788 gboolean rssi_enabled;
1789 } bt_rssi_enabled_t;
1792 * Structure for RSSI Threshold
1797 int in_range_threshold;
1799 } bt_rssi_threshold_t;
1803 * Structure for Suppoted Profiles and Trusted Profiles
1810 } bt_supported_profile_trusted_t;
1813 * Structure for PBAP Folder Parameters
1816 unsigned char addressbook;
1817 unsigned char folder_type;
1821 * Structure for PBAP Pull application Parameters
1824 unsigned char format;
1825 unsigned char order;
1826 unsigned short offset;
1827 unsigned short maxlist;
1828 long long unsigned fields;
1829 } bt_pbap_pull_parameters_t;
1832 * Structure for PBAP List application Parameters
1835 unsigned char order;
1836 unsigned short offset;
1837 unsigned short maxlist;
1838 } bt_pbap_list_parameters_t;
1841 * Structure for PBAP Pull vCard application Parameters
1844 unsigned char format;
1845 long long unsigned fields;
1847 } bt_pbap_pull_vcard_parameters_t;
1850 * Structure for PBAP Search application Parameters
1853 unsigned char order;
1854 unsigned short offset;
1855 unsigned short maxlist;
1856 unsigned char search_attribute;
1857 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1858 } bt_pbap_search_parameters_t;
1861 * Structure for PBAP Connection Status
1864 bluetooth_device_address_t btaddr;
1866 } bt_pbap_connected_t;
1869 * Structure for PBAP Phonebook Size
1872 bluetooth_device_address_t btaddr;
1874 } bt_pbap_phonebook_size_t;
1877 * Structure for PBAP Phonebook Pull
1880 bluetooth_device_address_t btaddr;
1883 } bt_pbap_phonebook_pull_t;
1886 * Structure for PBAP vCard List
1889 bluetooth_device_address_t btaddr;
1893 } bt_pbap_vcard_list_t;
1896 * Structure for PBAP vCard Pull
1899 bluetooth_device_address_t btaddr;
1902 } bt_pbap_vcard_pull_t;
1905 * Structure for PBAP Phonebook search List
1908 bluetooth_device_address_t btaddr;
1912 } bt_pbap_phonebook_search_list_t;
1915 * Stucture to HF Call status information
1919 char *number; /*Phone Number */
1920 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1921 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1922 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1923 int idx; /*Call index/ID */
1924 } bt_hf_call_status_info_t;
1929 } bt_hf_call_list_s;
1935 TRUSTED_PROFILE_PBAP = 1,
1936 TRUSTED_PROFILE_MAP,
1937 TRUSTED_PROFILE_SAP,
1938 TRUSTED_PROFILE_HFP_HF,
1939 TRUSTED_PROFILE_A2DP,
1940 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1941 } bluetooth_trusted_profile_t;
1944 * Structure for LE data length change params
1947 bluetooth_device_address_t device_address;
1948 guint16 max_tx_octets;
1949 guint16 max_tx_time;
1950 guint16 max_rx_octets;
1951 guint16 max_rx_time;
1952 } bt_le_data_length_params_t;
1955 * Structure for proximity property change params
1958 bluetooth_device_address_t device_address;
1962 } bt_pxp_property_changed_params_t;
1965 * @brief DPM BT allowance state
1969 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1970 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1971 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1972 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1976 * @brief DPM API result
1980 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1981 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1982 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1983 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1984 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1985 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1989 * @brief DPM Policy status
1993 BLUETOOTH_DPM_STATUS_ERROR = -1,
1995 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1996 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1998 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1999 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
2001 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2002 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2006 /* policy-group : BLUETOOTH */
2007 BLUETOOTH_DPM_POLICY_ALLOW,
2008 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2009 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2010 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
2011 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
2012 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
2013 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
2014 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2015 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2016 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2017 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2018 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2019 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2020 BLUETOOTH_DPM_POLICY_END,
2021 } bt_dpm_policy_cmd_t;
2024 struct bt_dpm_policy {
2030 typedef struct bt_dpm_policy bt_dpm_policy_t;
2033 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2034 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2035 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2036 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2037 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2038 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2039 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2040 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2041 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2042 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2043 BLUETOOTH_DPM_PROFILE_NONE,
2046 struct bt_dpm_profile_val {
2047 int value; /* tells whether the profile is enabled or disabled */
2049 typedef struct dpm_profile_val dpm_profile_state_t;
2052 * Structure to DPM device list
2056 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2057 } bt_dpm_device_list_t;
2060 * Structure to DPM uuid list
2064 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2065 } bt_dpm_uuids_list_t;
2068 * Structure for IPSP Interface Info
2071 bluetooth_device_address_t btaddr;
2073 } bt_ipsp_connection_info_t;
2077 char* remote_address;
2078 } bt_map_client_session_info_s;
2080 typedef char* bt_map_client_message_object_t;
2085 } bt_map_client_list_folders_filter_t;
2090 int8_t subject_length;
2099 } bt_map_client_list_messages_filter_t;
2102 bt_map_client_message_object_t message_object;
2107 char *sender_address;
2110 char *recipient_address;
2115 int64_t attachment_size;
2120 } bt_map_client_message_item_t;
2126 } bt_map_client_push_message_args_t;
2133 char *sender_address;
2136 char *recipient_address;
2145 } bt_map_client_message_t;
2148 char **names; // holding %size null-terminated folder names
2150 } bt_map_client_folders_s;
2153 bt_map_client_message_item_t *message_items;
2155 } bt_map_client_message_items_s;
2158 const char* target_file;
2160 } bt_get_message_callback_data;
2163 * Callback pointer type
2165 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2168 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2169 * @brief Set the callback function pointer for bluetooth event
2172 * This API will register the callback function, when any response and event are received from
2173 * bluetooth framework. @n
2174 * this registered callback function will be get called with appropriate event and data structures.
2175 * This function is a synchronous call. An application developer can call
2176 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2177 * type. This registered function will receive events of bluetooth_event_type_t type along with
2181 * @param[in] callback_ptr A pointer to the callback function
2182 * @param[in] user_data A pointer to user data
2183 * @return BLUETOOTH_ERROR_NONE - Success
2187 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2189 GMainLoop *main_loop = (GMainLoop*) user_data;
2193 // Code for each event
2195 g_main_loop_quit(main_loop);
2202 GMainLoop *main_loop = NULL;
2205 main_loop = g_main_loop_new(NULL, FALSE);
2206 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2207 if (ret >= BLUETOOTH_ERROR_NONE)
2209 // bluetooth_register_callback returned Success
2213 // bluetooth_register_callback returned failiure
2215 g_main_loop_run(main_loop);
2219 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2222 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2223 * @brief Set the callback function pointer for bluetooth le event
2226 * This API will register the callback function, when any response and event are received from
2227 * bluetooth framework. @n
2228 * this registered callback function will be get called with appropriate event and data structures.
2229 * This function is a synchronous call. An application developer can call
2230 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2231 * type. This registered function will receive events of bluetooth_event_type_t type along with
2235 * @param[in] callback_ptr A pointer to the callback function
2236 * @param[in] user_data A pointer to user data
2237 * @return BLUETOOTH_ERROR_NONE - Success
2241 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2244 * @fn int bluetooth_le_unregister_callback(void)
2245 * @brief Set the callback function pointer for bluetooth le event
2248 * This API will register the callback function, when any response and event are received from
2249 * bluetooth framework. @n
2250 * this registered callback function will be get called with appropriate event and data structures.
2251 * This function is a synchronous call. An application developer can call
2252 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2253 * type. This registered function will receive events of bluetooth_event_type_t type along with
2258 * @return BLUETOOTH_ERROR_NONE - Success
2262 int bluetooth_le_unregister_callback(void);
2265 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2266 * @brief Set the callback function pointer for bluetooth event
2269 * This API will register the callback function, when any response and event are received from
2270 * bluetooth framework. @n
2271 * this registered callback function will be get called with appropriate event and data structures.
2272 * This function is a synchronous call. An application developer can call
2273 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2274 * type. This registered function will receive events of bluetooth_event_type_t type along with
2279 * @return BLUETOOTH_ERROR_NONE - Success
2283 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2285 GMainLoop *main_loop = (GMainLoop*) user_data;
2289 // Code for each event
2291 g_main_loop_quit(main_loop);
2298 GMainLoop *main_loop = NULL;
2301 main_loop = g_main_loop_new(NULL, FALSE);
2302 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2303 if (ret >= BLUETOOTH_ERROR_NONE)
2305 // bluetooth_register_callback returned Success
2309 // bluetooth_register_callback returned failiure
2311 ret = bluetooth_deregister_callback(void);
2312 g_main_loop_run(main_loop);
2316 int bluetooth_unregister_callback(void);
2319 * @fn int bluetooth_enable_adapter(void)
2320 * @brief Enable the Bluetooth H/W
2323 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2324 * send request to bluetooth chip for activation.
2325 * This function is typically called at startup or when Bluetooth services are required. This
2326 * function must be called before calling any other API of Bluetooth operations.
2328 * Before performing any operations like Device discover, service search etc.., the adapter must be
2331 * This function is a asynchronous call.
2332 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2333 * through registered callback function with appropriate result code
2334 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2335 * BLUETOOTH_ERROR_NONE - Success \n
2337 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2338 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2340 * @return BLUETOOTH_ERROR_NONE - Success\n
2341 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2342 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2343 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2344 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2346 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2348 void bt_event_callback(int event, bluetooth_event_param_t *param)
2352 case BLUETOOTH_EVENT_ENABLED:
2353 if (param->result == BLUETOOTH_ERROR_NONE)
2355 // Successfully Enabled
2368 ret = bluetooth_enable_adapter();
2372 int bluetooth_enable_adapter(void);
2375 * @fn int bluetooth_disable_adapter(void)
2376 * @brief Disable the Bluetooth H/W
2379 * This function disables Bluetooth protocol stack and hardware. This function is called when
2380 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2382 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2383 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2384 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2386 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2389 * This function is a asynchronous call.
2390 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2391 * through registered callback function.
2394 * @return BLUETOOTH_ERROR_NONE - Success\n
2395 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2396 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2397 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2399 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2401 void bt_event_callback(int event, bluetooth_event_param_t *param)
2405 case BLUETOOTH_EVENT_DISABLED:
2406 if (param->result == BLUETOOTH_ERROR_NONE)
2408 // Successfully disabled
2421 ret = bluetooth_disable_adapter();
2424 int bluetooth_disable_adapter(void);
2425 int bluetooth_read_battery_data(bt_battery_data *latest);
2426 int bluetooth_set_battery_monitor_state(bool state);
2427 int bluetooth_get_battery_monitor_state(void);
2428 int bluetooth_recover_adapter(void);
2429 int bluetooth_check_adapter_le(void);
2430 int bluetooth_enable_adapter_le(void);
2432 int bluetooth_disable_adapter_le(void);
2433 int bluetooth_get_uuid_name(const char *uuid, char **name);
2436 * @fn int bluetooth_reset_adapter(void)
2437 * @brief Reset the Bluetooth H/W and values
2440 * This function resets Bluetooth protocol stack and hardware. This function is called when
2441 * an user want to initialize Bluetooth environment.
2443 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2446 * This function is a synchronous call.
2448 * @return BLUETOOTH_ERROR_NONE - Success\n
2449 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2451 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2456 ret = bluetooth_reset_adapter();
2459 int bluetooth_reset_adapter(void);
2462 * @fn int bluetooth_is_supported(void)
2463 * @brief Check if the bluetooth is supported or not by the current target
2465 * This API checks whether the bluetooth is supported or not.
2466 * This API only run by root permission.
2468 * This function is a synchronous call.
2470 * @return 0 - if bluetooth is not supported\n
2471 * 1 - if bluetooth is supported\n
2472 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2477 ret = bluetooth_is_supported();
2480 int bluetooth_is_supported(void);
2484 * @fn int bluetooth_check_adapter(void)
2485 * @brief Check the current status of the Bluetooth adapter
2488 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2489 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2490 * bluetooth adapter.
2491 * This API get the adapter internal data structure and check current adapter status.
2493 * This function is a synchronous call.
2496 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2497 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2499 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2503 ret = bluetooth_check_adapter();
2506 int bluetooth_check_adapter(void);
2509 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2510 * @brief Get the local adapter bluetooth address
2513 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2514 * the adapter should be enabled.
2515 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2516 * contain Bluetooth address.
2517 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2518 * friendly name for each device.
2519 * There is no event callback for this API.
2521 * This function is a synchronous call.
2524 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2525 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2526 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2527 * @param[out] local_address a device address of local bluetooth adapter
2532 bluetooth_device_address_t local_address={0,};
2535 ret = bluetooth_get_local_address(&local_address);
2538 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2541 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2542 * @brief Get the hci version
2545 * This function is used to get the bluetooth hci version
2546 * Before calling this API make sure that the adapter is enabled.
2548 * This function is a synchronous call.
2551 * @return BLUETOOTH_ERROR_NONE - Success \n
2552 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2553 * @param[out] timeout remain visibility timeout value
2556 bluetooth_version_t *version;
2558 ret = bluetooth_get_local_version (&version);
2561 int bluetooth_get_local_version(bluetooth_version_t *version);
2564 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2565 * @brief Get the local device name
2568 * This function is used, get the local device name. Since its difficult to remember the Adapter
2569 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2570 * friendly name is retrived by the remote device and displaying.
2571 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2573 * This function is a synchronous call.
2576 * @return BLUETOOTH_ERROR_NONE - Success \n
2577 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2578 * @param[out] local_name a local device name
2582 bluetooth_device_name_t local_name={0,}
2584 ret = bluetooth_get_local_name (&local_name);
2587 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2590 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2591 * @brief Set the local device name
2594 * This function is used to set the local device name. This is a human friendly name whose
2595 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2597 * This function is a synchronous call.
2599 * @param[in] local_name bluetooth device name to set local device
2601 * @return BLUETOOTH_ERROR_NONE - Success \n
2602 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2603 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2604 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2605 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2606 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2611 bluetooth_device_name_t local_name={0,}
2613 ret = bluetooth_set_local_name (&local_name);
2616 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2620 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2621 * @brief Check if the uuid is used or not
2623 * This function is used to check if the uuid is used or not.
2625 * This function is a synchronous call.
2627 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2628 * @param[out] used if the uuid is used or not
2630 * @return BLUETOOTH_ERROR_NONE - Success \n
2631 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2632 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2633 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2638 gboolean used = FALSE;
2639 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2640 ret = bluetooth_is_service_used(uuid, &used);
2643 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2646 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2647 * @brief Check if the device is connected to the specific service
2649 * This function is used to check if if the device is connected to the specific service.
2651 * This function is a synchronous call.
2653 * @param[in] local_address a device address of remote bluetooth device
2654 * @param[in] type the service type
2655 * @param[out] is_connected if the device is connected or not
2657 * @return BLUETOOTH_ERROR_NONE - Success \n
2658 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2659 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2660 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2665 gboolean is_connected = FALSE;
2666 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2667 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2670 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2671 bluetooth_service_type_t type,
2672 gboolean *is_connected);
2675 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2676 * @brief Gets device's connected link type
2678 * This function is used to get device's connected link type
2680 * This function is a synchronous call.
2682 * @param[in] device_address a device address of remote bluetooth device
2683 * @param[out] connected_link a device's connected link type
2685 * @return BLUETOOTH_ERROR_NONE - Success \n
2686 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2687 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2688 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2693 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2694 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2695 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2698 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2699 bluetooth_connected_link_t *connected_link);
2702 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2703 * @brief Sets a profile trusted for a device
2705 * This function is used to Set a profile as trusted for a device
2707 * This function is a synchronous call.
2709 * @param[in] device_address a device address of remote bluetooth device
2710 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2711 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2713 * @return BLUETOOTH_ERROR_NONE - Success \n
2714 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2715 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2716 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2720 int bluetooth_set_profile_trusted(
2721 const bluetooth_device_address_t *device_address,
2722 int profile, int trust);
2725 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2726 * @brief Gets a profile is trusted for a device
2728 * This function is used to Get a profile is trusted or not for a device
2730 * This function is a synchronous call.
2732 * @param[in] device_address a device address of remote bluetooth device
2733 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2734 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2736 * @return BLUETOOTH_ERROR_NONE - Success \n
2737 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2738 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2739 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2743 int bluetooth_get_profile_trusted(
2744 const bluetooth_device_address_t *device_address,
2745 int profile, int *trust);
2748 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2749 * @brief Get the visibility mode
2752 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2753 * visibity mode, the property of the device is determined whether it can be discoverable, non
2754 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2756 * This function is a synchronous call.
2759 * @return BLUETOOTH_ERROR_NONE - Success \n
2760 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2761 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2762 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2763 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2764 * @param[out] discoverable_mode current bluetooth discoverable mode
2766 * @see bluetooth_set_discoverable_mode
2768 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2770 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2773 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2776 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2778 * @brief Set the visibility mode
2781 * This function is used to set the discoverable mode (Visibility option).
2783 * Many times user may want to keep his device discoverable so that when peer device is performing
2784 * device search, he/she can find user's device. Application programmer can keep the mode as
2785 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2786 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2787 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2788 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2790 * This function is a synchronous call.
2792 * @return BLUETOOTH_ERROR_NONE - Success \n
2793 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2795 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2796 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2798 * @see bluetooth_get_discoverable_mode
2802 bluetooth_discoverable_mode_t mode;
2804 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2805 ret = bluetooth_set_discoverable_mode (mode, 180);
2809 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2814 * @fn int bluetooth_get_timeout_value(int *timeout)
2815 * @brief Get the visibility timeout value
2818 * This function is used to get the visibility timeout
2819 * Before calling this API make sure that the adapter is enabled.
2821 * This function is a synchronous call.
2824 * @return BLUETOOTH_ERROR_NONE - Success \n
2825 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2826 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2827 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2828 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2829 * @param[out] timeout remain visibility timeout value
2831 * @see bluetooth_set_discoverable_mode
2835 ret = bluetooth_get_timeout_value (&timeout);
2838 int bluetooth_get_timeout_value(int *timeout);
2842 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2843 * unsigned int classOfDeviceMask)
2844 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2846 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2847 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2848 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2849 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2850 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2851 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2852 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2853 * please see bluetooth_device_info_t for more details.
2856 * This API provides searching options like max responses, discovery duration in seconds and class
2857 * of device mask to filter device search. some times there may be too many bluetooth devices in
2858 * vicinity of your device.in such scenario, application can request to reduce number of responces
2859 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2860 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2861 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2862 * application defined time. please note that discovery_duration should be mentioned in seconds.
2863 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2866 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2867 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2868 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2870 * This function is a asynchronous call.
2871 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2872 * through registered callback function.
2874 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2875 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2877 * The completion or cancellation of the discovery is indicated by an
2878 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2880 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2883 * @return BLUETOOTH_ERROR_NONE - Success \n
2884 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2885 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2886 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2887 agent is not running \n
2889 * @param[in] max_response define the maximum response of the number of founded devices
2891 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2892 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2893 (refer to class of device)
2895 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2898 void bt_event_callback(int event, bluetooth_event_param_t *param)
2902 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2904 bluetooth_device_info_t *device_info = NULL;
2905 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2907 device_info = (bluetooth_device_info_t *)param->param_data;
2908 memcpy(&searched_device, &device_info->device_address,
2909 sizeof(bluetooth_device_address_t));
2910 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2911 device_info->device_address.addr[0],
2912 device_info->device_address.addr[1],
2913 device_info->device_address.addr[2],
2914 device_info->device_address.addr[3],
2915 device_info->device_address.addr[4],
2916 device_info->device_address.addr[5]);
2919 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2921 bluetooth_device_info_t *device_info = NULL;
2922 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2924 device_info = (bluetooth_device_info_t *)param->param_data;
2925 memcpy(&searched_device, &device_info->device_address,
2926 sizeof(bluetooth_device_address_t));
2927 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2928 device_info->device_name.name,
2929 device_info->device_address.addr[0],
2930 device_info->device_address.addr[1],
2931 device_info->device_address.addr[2],
2932 device_info->device_address.addr[3],
2933 device_info->device_address.addr[4],
2934 device_info->device_address.addr[5]);
2938 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2939 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2944 unsigned short max_response;
2945 unsigned short discovery_duration;
2946 unsigned classOfDeviceMask;
2950 discovery_duration =0;
2951 classOfDeviceMask =0;
2953 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2958 int bluetooth_start_discovery(unsigned short max_response,
2959 unsigned short discovery_duration,
2960 unsigned int classOfDeviceMask);
2963 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2964 * unsigned short max_response,
2965 * unsigned short discovery_duration,
2966 * unsigned int classOfDeviceMask)
2967 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2969 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2970 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2971 * Please see bluetooth_start_discovery() for other parameters description.
2973 * This function is a asynchronous call.
2974 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2975 * through registered callback function.
2977 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2978 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2980 * The completion or cancellation of the discovery is indicated by an
2981 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2983 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2986 * @return BLUETOOTH_ERROR_NONE - Success \n
2987 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2988 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2989 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2990 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2991 agent is not running \n
2993 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2994 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2995 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2996 * @param[in] max_response define the maximum response of the number of founded devices
2998 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2999 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3000 (refer to class of device)
3002 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3005 unsigned short type;
3006 unsigned short max_response;
3007 unsigned short discovery_duration;
3008 unsigned classOfDeviceMask;
3013 discovery_duration =0;
3014 classOfDeviceMask =0;
3016 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3021 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3022 unsigned short max_response,
3023 unsigned short discovery_duration,
3024 unsigned int classOfDeviceMask);
3027 * @fn int bluetooth_cancel_discovery (void)
3028 * @brief Cancel the on-going device discovery operation
3031 * This function stops the on-going device discovery operation. This API has to be called after the
3032 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3033 * the bluetooth_start_discovery API
3035 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3036 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3037 * cancel the discover request once the user received the device to which he wish to connect.
3039 * This function is a asynchronous call.
3040 * If the call is success to cancel discovey then the application will receive
3041 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3042 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3043 * BLUETOOTH_ERROR_NONE
3046 * @return BLUETOOTH_ERROR_NONE - Success \n
3047 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3048 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3049 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3050 other application \n
3051 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3053 * @see bluetooth_start_discovery
3055 void bt_event_callback(int event, bluetooth_event_param_t *param)
3059 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3060 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3069 ret = bluetooth_cancel_discovery();
3072 int bluetooth_cancel_discovery(void);
3075 * @fn int bluetooth_start_le_discovery(void)
3076 * @brief Start the generic device discovery which finds the LE devices.
3078 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3079 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3080 * It try to find LE devices. Bluetooth device address and name are
3081 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3082 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3083 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3084 * please see bluetooth_device_info_t for more details.
3086 * This function is a asynchronous call.
3087 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3088 * through registered callback function.
3090 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3093 * The completion or cancellation of the discovery is indicated by an
3094 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3096 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3099 * @return BLUETOOTH_ERROR_NONE - Success \n
3100 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3101 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3102 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3103 agent is not running \n
3106 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3109 void bt_event_callback(int event, bluetooth_event_param_t *param)
3113 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3115 bluetooth_device_info_t *device_info = NULL;
3116 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3118 device_info = (bluetooth_device_info_t *)param->param_data;
3119 memcpy(&searched_device, &device_info->device_address,
3120 sizeof(bluetooth_device_address_t));
3121 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3122 device_info->device_address.addr[0],
3123 device_info->device_address.addr[1],
3124 device_info->device_address.addr[2],
3125 device_info->device_address.addr[3],
3126 device_info->device_address.addr[4],
3127 device_info->device_address.addr[5]);
3131 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3132 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3138 ret = bluetooth_start_discovery();
3143 int bluetooth_start_le_discovery(void);
3146 * @fn int bluetooth_stop_le_discovery (void)
3147 * @brief Cancel the on-going device LE discovery operation
3150 * This function stops the on-going device discovery operation. This API has to be called after the
3151 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3152 * the bluetooth_start_le_discovery API
3155 * This function is a asynchronous call.
3156 * If the call is success to cancel discovey then the application will receive
3157 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3158 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3159 * BLUETOOTH_ERROR_NONE
3162 * @return BLUETOOTH_ERROR_NONE - Success \n
3163 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3164 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3165 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3166 other application \n
3167 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3169 * @see bluetooth_start_discovery
3171 void bt_event_callback(int event, bluetooth_event_param_t *param)
3175 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3176 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3185 ret = bluetooth_stop_le_discovery();
3188 int bluetooth_stop_le_discovery(void);
3191 * @fn int bluetooth_is_discovering(void)
3192 * @brief Check for the device discovery is in-progress or not.
3194 * This API is used to check the current status of the Discovery operation.If discovery is in\
3195 * progress normally other operations are not allowed.
3196 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3197 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3198 * event before performing other operations. This API is used to get for the current discovery
3199 * operation status and using bluetooth_cancel_discovery()
3200 * we can cancell the ongoing discovery process.
3201 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3204 * This function checks whether the device discovery is started or not.
3206 * This function is a synchronous call.
3209 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3210 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3211 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3214 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3218 ret = bluetooth_is_discovering ();
3221 int bluetooth_is_discovering(void);
3224 * @fn int bluetooth_is_le_discovering(void)
3225 * @brief Check for the device LE discovery is in-progress or not.
3227 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3228 * progress normally other operations are not allowed.
3229 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3230 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3231 * event before performing other operations. This API is used to get for the current discovery
3232 * operation status and using bluetooth_stop_le_discovery()
3233 * we can cancell the ongoing LE discovery process.
3234 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3237 * This function checks whether the device LE discovery is started or not.
3239 * This function is a synchronous call.
3242 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3243 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3244 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3247 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3251 ret = bluetooth_is_le_discovering ();
3254 int bluetooth_is_le_discovering(void);
3257 * @fn int bluetooth_is_le_scanning(void)
3258 * @brief Check for the device LE scan is in-progress or not.
3260 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3261 * progress normally other operations are not allowed.
3263 * This function checks whether the device LE Scan is started or not.
3265 * This function is a synchronous call.
3267 * @return TRUE - LE Scan in progress \n
3268 * FALSE - LE Scan is not in progress \n
3273 gboolean is_le_scanning = 0;
3274 is_le_scanning = bluetooth_is_le_scanning ();
3277 gboolean bluetooth_is_le_scanning(void);
3279 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3282 * @fn int bluetooth_force_hcidump(int timeout)
3283 * @brief Enable /disable force-hcidump
3285 * This function control force-hcidump.
3287 * This function is a synchronous call.
3289 * @return BLUETOOTH_ERROR_NONE - Success \n
3290 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3291 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3293 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3298 int bluetooth_force_hcidump(int timeout);
3301 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3302 * @brief Register scan filter.
3304 * This function registers the scan filter.
3306 * This function is a synchronous call.
3308 * @return BLUETOOTH_ERROR_NONE - Success \n
3310 * @param[in] filter scan filter to register
3314 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3317 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3318 int link_type, bt_rssi_threshold_t rssi_threshold)
3319 * @brief Enable RSSI monitoring
3321 * This function enables RSSI monitoring and sets threshold for a connection
3323 * @return BLUETOOTH_ERROR_NONE - Success \n
3326 * @see bluetooth_get_rssi_strength
3328 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3329 int link_type, bt_rssi_threshold_t *rssi_threshold);
3332 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3333 * @brief Gets Raw RSSI signal Strength
3335 * This function gives the Raw RSSI signal strength for a connection.
3337 * @return BLUETOOTH_ERROR_NONE - Success \n
3340 * @see bluetooth_enable_rssi
3342 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3344 int bluetooth_set_connectable(gboolean is_connectable);
3346 int bluetooth_is_connectable(gboolean *is_connectable);
3348 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3351 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3352 * @brief Initiate a bonding process
3355 * This function initiates a bonding procedure with a peer device. The bonding procedure
3356 * enables authentication and optionally encryption on the Bluetooth link.
3358 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3359 * inititate the bonding request to the devices already in the paired list.
3361 * Usually we call this API after the device discovery.
3362 * This function is a asynchronous call.
3364 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3365 * mentioed result code
3366 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3367 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3368 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3369 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3370 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3372 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3373 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3376 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3379 * @return BLUETOOTH_ERROR_NONE - Success \n
3380 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3381 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3382 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3383 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3385 * @param[in] device_address This indicates an address of the device with which the pairing
3386 * should be initiated
3388 * @see bluetooth_cancel_bonding
3390 void bt_event_callback(int event, bluetooth_event_param_t *param)
3394 case BLUETOOTH_EVENT_BONDING_FINISHED:
3396 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3397 if (param->result >= BLUETOOTH_ERROR_NONE)
3399 bluetooth_device_info_t *device_info = NULL;
3400 device_info = (bluetooth_device_info_t *)param->param_data;
3401 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3402 mjr[%#x] min[%#x] srv[%#x]",
3403 device_info->device_name.name,
3404 device_info->device_address.addr[0],
3405 device_info->device_address.addr[1],
3406 device_info->device_address.addr[2],
3407 device_info->device_address.addr[3],
3408 device_info->device_address.addr[4],
3409 device_info->device_address.addr[5],
3410 device_info->device_class.major_class,
3411 device_info->device_class.minor_class,
3412 device_info->device_class.service_class);
3426 bluetooth_device_address_t device_address={{0}};
3428 ret = bluetooth_bond_device(&device_address);
3432 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3435 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3436 * bluetooth_conn_type_t conn_type)
3437 * @brief Initiate a bonding process
3440 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3441 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3443 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3444 * inititate the bonding request to the devices already in the paired list.
3446 * Usually we call this API after the device discovery.
3447 * This function is a asynchronous call.
3449 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3450 * mentioed result code
3451 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3452 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3453 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3454 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3455 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3457 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3458 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3461 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3464 * @return BLUETOOTH_ERROR_NONE - Success \n
3465 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3467 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3468 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3470 * @param[in] device_address This indicates an address of the device with which pairing
3471 * should be initiated
3472 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3475 * @see bluetooth_cancel_bonding
3477 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3478 bluetooth_conn_type_t conn_type);
3481 * @fn int bluetooth_cancel_bonding(void)
3482 * @brief Cancel the on-going bonding process
3484 * This API is called to cancel the on-going bonding procedure. It should be called before the
3485 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3486 * This API is useful when the remote device is not responding to the bond request or we wish to
3487 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3489 * This function is a synchronous call.
3491 * @return BLUETOOTH_ERROR_NONE - Success \n
3492 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3493 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3496 * @see bluetooth_bond_device
3502 ret = bluetooth_cancel_bonding();
3505 int bluetooth_cancel_bonding(void);
3508 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3509 * @brief Remove bonding
3512 * To communicate with remote device over bluetooth link, user should bond with peer device.
3513 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3514 * API is used to remove peer device from the list. Please note that after removing the device
3515 * from bonded device list, you cannot communication with peer device until bonding happens again.
3517 * User can call this function by passing bluetooth device address of any bonded device. Please note
3518 * that after successful return of this function, any bluetooth application running on your device
3519 * will not be able to communicate with unbonded device until bond operation happens again using
3520 * bluetooth_bond_device()
3523 * This function is a asynchronous call. The request to remove the specified device from the bonded
3524 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3525 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3526 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3530 * @return BLUETOOTH_ERROR_NONE - Success \n
3531 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3532 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3533 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3534 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3535 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3536 * agent is not running \n
3537 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3540 * @param[in] device_address This indicates an address of the device to remove bonding
3544 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3547 void bt_event_callback(int event, bluetooth_event_param_t *param)
3550 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3551 bluetooth_device_address_t *dev_addr = NULL;
3553 if (param->result == BLUETOOTH_ERROR_NONE) {
3554 dev_addr = (bluetooth_device_address_t *)param->param_data;
3556 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3557 dev_addr->addr[0], dev_addr->addr[1]
3558 dev_addr->addr[2], dev_addr->addr[3]
3559 dev_addr->addr[4], dev_addr->addr[5]
3570 bluetooth_device_address_t *device_address;
3572 // copy valid device address in device_address
3574 ret = bluetooth_unbond_device(device_address);
3577 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3580 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3581 * @brief Get bonded(paired) device list
3584 * This API gets all bonded device list.
3585 * The devices in the bonded device list further can be used to perform the authorization by calling
3586 * bluetooth_authorize_device API.
3588 * This function is a synchronous call.
3589 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3590 * there is no valid information in the dev_list.
3591 * The len field in the dev_list represents the number of bonded devices. The data structure for
3592 * bonded device information is bluetooth_device_info_t.
3595 * @return BLUETOOTH_ERROR_NONE - Success \n
3596 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3598 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3600 void bt_get_bonded_devices(void)
3604 GPtrArray *devinfo = NULL;
3605 bluetooth_device_info_t *ptr;
3607 // allocate the g_pointer_array
3608 devinfo = g_ptr_array_new();
3610 ret = bluetooth_get_bonded_device_list(&devinfo);
3611 if (ret != BLUETOOTH_ERROR_NONE)
3613 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3617 printf("g pointer arrary count : [%d]", devinfo->len);
3618 for (i=0; i<devinfo->len; i++)
3620 ptr = g_ptr_array_index(devinfo, i);
3623 printf("Name [%s]\n", ptr->device_name.name);
3624 printf("Major Class [%d]\n", ptr->device_class.major_class);
3625 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3626 printf("Service Class [%d]\n", ptr->device_class.service_class);
3627 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3628 ptr->device_address.addr[0],
3629 ptr->device_address.addr[1], ptr->device_address.addr[2],
3630 ptr->device_address.addr[3],
3631 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3638 // free g_pointer_array
3639 g_ptr_array_free(devinfo, TRUE);
3644 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3646 int bluetooth_get_profile_connected_device_list(
3647 const char *profile_uuid, GPtrArray **addr_list);
3650 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3651 * bluetooth_device_info_t *dev_info)
3652 * @brief Get a bonded(paired) device
3655 * This API gets a bonded device.
3657 * This function is a synchronous call.
3658 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3659 * there is no valid information in the dev_info.
3660 * The data structure for bonded device information is bluetooth_device_info_t.
3663 * @return BLUETOOTH_ERROR_NONE - Success \n
3664 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3666 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3668 void bt_get_bonded_device(void)
3672 bluetooth_device_info_t devinfo = {0};
3673 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3675 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3676 if (ret != BLUETOOTH_ERROR_NONE)
3678 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3682 printf("Name [%s]\n", devinfo.device_name.name);
3683 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3684 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3685 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3686 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3687 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3688 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3689 devinfo.device_address.addr[5]);
3698 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3699 bluetooth_device_info_t *dev_info);
3702 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3703 * gboolean *is_alias_set)
3704 * @brief Get is_alias_set property of device
3706 * This API gets is_alias_set property of a bonded device.
3708 * This function is a synchronous call.
3709 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3710 * If not,there is no valid information in the is_alias_set.
3712 * @return BLUETOOTH_ERROR_NONE - Success \n
3713 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3718 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3720 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3723 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3724 gboolean *is_alias_set);
3727 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3728 * @brief set alias for bonded device
3731 * This function set alias for bonded device.
3733 * This function is a synchronous call.
3736 * @return BLUETOOTH_ERROR_NONE - Success \n
3737 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3738 * @param[in] device_address This indicates an address of the remote device
3739 * @param[in] alias This indicates an alias to set
3744 ret = bluetooth_set_alias(&remote_address);
3747 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3751 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3752 * @brief Get remote deivice
3755 * This function gets specific remote device.
3757 * This function is a asynchronous call.
3758 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3761 * @return BLUETOOTH_ERROR_NONE - Success \n
3762 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3763 * @param[in] device_address This indicates an address of the remote device
3768 ret = bluetooth_get_remote_device(&remote_address);
3771 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3774 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3775 * gboolean authorized)
3776 * @brief Authorize/Unauthorize a bonded device
3779 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3780 * with/without user confirmation.
3782 * If we select a paired device and make it authorized by calling this API with the authorized
3783 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3784 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3785 * then it will ask for the user conformation before the connection.
3787 * This API supposed to be called on the paired devices. Which means we have to use this API only
3788 * after successful pairing.
3790 * This function is a asynchronous call.
3791 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3793 * @return BLUETOOTH_ERROR_NONE - Success \n
3794 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3795 * @param[in] device_address This indicates an address of the device to authorize \n
3796 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3798 * @see bluetooth_get_bonded_device_list
3800 void bt_event_callback(int event, bluetooth_event_param_t *param)
3804 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3806 if (param->result == BLUETOOTH_ERROR_NONE)
3810 //device authorization failed failure
3818 bluetooth_device_address_t device_address={{0}};
3819 gboolean authorized;
3823 ret = bluetooth_authorize_device(&device_address,authorized);
3826 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3827 gboolean authorized);
3829 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3830 const bluetooth_device_pin_code_t *pin_code);
3832 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3835 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3837 * @brief Receives Legacy Passkey\pin with following authentication response types
3839 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3840 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3843 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3846 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3848 * @brief This API sends user confirmation reply to the local adapter.
3850 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3853 int bluetooth_passkey_confirmation_reply(gboolean reply);
3856 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3857 * @brief Get all services supported by remote device
3860 * This API call initiates the search for the services supported by the specified device. Normally
3861 * the service search will take a couple of seconds to get it completed. Before calling this API
3862 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3863 * perform the service search. We can get the device address by doing a device discovery operation.
3866 * This function is a asynchronous call.
3867 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3869 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3870 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3871 * event is generated with appropriate result code.
3873 * @return BLUETOOTH_ERROR_NONE - Success \n
3874 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3875 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3876 * @param[in] device_address This indicates an address of the device
3877 * whose services need to be found
3879 * @see bluetooth_cancel_service_search
3881 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3884 * @fn int bluetooth_cancel_service_search(void)
3885 * @brief Cancel the ongoing service search operation
3888 * This function cancel the ongoing service search operation. This API is usually calling after the
3889 * bluetooth_search_service API.
3890 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3891 * if the user wish to cancel the Ongoing service search operation.
3893 * This API should be called just after the bluetooth_search_service API and before the
3894 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3896 * This function is a synchronous call.
3898 * @return BLUETOOTH_ERROR_NONE - Success \n
3899 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3900 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3901 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3904 * @see bluetooth_search_service
3909 ret = bluetooth_cancel_service_search();
3912 int bluetooth_cancel_service_search(void);
3915 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3916 * @brief Register rfcomm socket with a specific uuid
3919 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3920 * descriptor of the server.
3921 * This is the first API which is called to create the server. Once we created the server socket,
3922 * we will listen on that return socket.
3923 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3926 * @return socket FD on Success \n
3927 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3928 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3929 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3930 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3931 * @param[in] UUID (128 bits)
3934 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3938 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3939 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3943 int bluetooth_rfcomm_create_socket(const char *uuid);
3946 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3947 * @brief Register rfcomm socket with a specific uuid
3950 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3951 * descriptor of the server.
3952 * This is the first API which is called to create the server. Once we created the server socket,
3953 * we will listen on that return socket.
3954 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3957 * @return socket FD on Success \n
3958 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3959 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3960 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3961 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3962 * @param[in] UUID (128 bits)
3963 * @param[in] bus_name (const char)
3964 * @param[in] path (const char)
3967 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3971 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3972 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3976 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3979 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3980 * @brief De-register the rfcomm socket
3983 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3984 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3985 * descriptor else no event will come. We will call this API only after the
3986 * bluetooth_rfcomm_listen_and_accept.
3987 * This is a synchronous call.
3989 * @return BLUETOOTH_ERROR_NONE - Success \n
3990 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3991 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3992 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3993 * @param[in] int socket_fd
3996 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3999 void bt_event_callback(int event, bluetooth_event_param_t *param)
4003 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4005 bluetooth_rfcomm_connection_t *discon_ind =
4006 (bluetooth_rfcomm_connection_t *)param->param_data;
4008 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4016 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4017 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4019 ret = bluetooth_rfcomm_remove_socket(fd);
4022 int bluetooth_rfcomm_remove_socket(int socket_fd);
4025 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4026 * @brief De-register the rfcomm socket
4029 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4030 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4031 * descriptor else no event will come. We will call this API only after the
4032 * bluetooth_rfcomm_listen_and_accept_ex.
4033 * This is a synchronous call.
4035 * @return BLUETOOTH_ERROR_NONE - Success \n
4036 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4037 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4038 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4039 * @param[in] UUID (128 bits)
4042 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4045 void bt_event_callback(int event, bluetooth_event_param_t *param)
4049 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4051 bluetooth_rfcomm_connection_t *discon_ind =
4052 (bluetooth_rfcomm_connection_t *)param->param_data;
4054 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4062 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4063 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4065 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4068 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4071 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4072 * @brief Disconnect rfcomm connection
4075 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4076 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4079 * @return BLUETOOTH_ERROR_NONE - Success \n
4080 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4081 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4082 * @param[in] int socket_fd the sending socket fd
4088 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4090 printf("Disconnection failed");
4092 printf("Disconnection Success");
4096 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4099 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4100 * @brief Rfcomm socket listen
4103 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4104 * after the bluetooth_rfcomm_create_socket API.
4105 * This API listen for the incomming connection and once it receives a connection, it will give
4106 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4107 * event to the application. This is an Asynchronous API call.
4110 * @return BLUETOOTH_ERROR_NONE - Success \n
4111 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4112 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4114 * @param[in] int socket_fd
4115 * @param[in] max pending connection.
4118 * @see bluetooth_rfcomm_create_socket
4121 void bt_event_callback(int event, bluetooth_event_param_t* param)
4125 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4127 bluetooth_rfcomm_connection_t *conn_ind =
4128 (bluetooth_rfcomm_connection_t *)param->param_data;
4130 printf("\nConnected from FD %d", conn_ind->socket_fd);
4138 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4139 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4143 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4146 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4147 * @brief Rfcomm socket listen
4150 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4151 * after the bluetooth_rfcomm_create_socket API.
4152 * This API listen for the incomming connection and once it receives a connection, it will give
4153 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4154 * event to the application. This is an Asynchronous API call.
4157 * @return BLUETOOTH_ERROR_NONE - Success \n
4158 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4159 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4161 * @param[in] int socket_fd
4162 * @param[in] max pending connection.
4167 * @see bluetooth_rfcomm_create_socket_ex
4170 void bt_event_callback(int event, bluetooth_event_param_t* param)
4174 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4176 bluetooth_rfcomm_connection_t *conn_ind =
4177 (bluetooth_rfcomm_connection_t *)param->param_data;
4179 printf("\nConnected from FD %d", conn_ind->socket_fd);
4187 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4188 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4193 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4196 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4197 * @brief Rfcomm socket listen
4200 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4201 * after the bluetooth_rfcomm_create_socket API.
4202 * This API listen for the incomming connection and once it receives a connection, it will give
4203 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4204 * event to the application. This is an Asynchronous API call.
4207 * @return BLUETOOTH_ERROR_NONE - Success \n
4208 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4209 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4211 * @param[in] int socket_fd
4212 * @param[in] max pending connection.
4215 * @see bluetooth_rfcomm_create_socket
4218 void bt_event_callback(int event, bluetooth_event_param_t* param)
4222 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4224 char *name = (char *)param->param_data;
4226 printf("\nConnected from %s", name);
4228 bluetooth_rfcomm_accept_connection();
4236 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4237 ret = bluetooth_rfcomm_listen(fd, 1);
4241 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4244 * @fn int bluetooth_rfcomm_accept_connection()
4245 * @brief Accepts the authorization request indicated by the event
4246 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4248 * This function is a synchronous call.
4250 * @return BLUETOOTH_ERROR_NONE - Success \n
4251 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4253 * @param[in] the socket fd of the server
4254 * @param[out] the socket fd of the client
4258 * @see bluetooth_rfcomm_reject_connection
4260 int bluetooth_rfcomm_accept_connection(int server_fd);
4263 * @fn int bluetooth_rfcomm_reject_connection()
4264 * @brief Rejects the authorization request indicated by the event
4265 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4267 * This function is a synchronous call.
4269 * @return BLUETOOTH_ERROR_NONE - Success \n
4270 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4272 * @param[in] the socket fd of the server
4276 * @see bluetooth_rfcomm_accept_connection
4278 int bluetooth_rfcomm_reject_connection(int server_fd);
4281 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4282 * @brief Informs whether rfcomm server uuid is available or not.
4284 * This function is a synchronous call.
4286 * @return TRUE - RFCOMM uuid is available \n
4287 * FALSE - RFCOMM uuid is not available \n
4289 * @param[in] uuid UUID string
4295 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4298 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4299 * const char *remote_uuid)
4300 * @brief Connect to the remote device rfcomm *
4302 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4303 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4304 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4305 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4306 * initiating a connection.
4308 * @return BLUETOOTH_ERROR_NONE - Success \n
4309 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4310 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4311 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4312 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4313 * @param[in] bluetooth_device_address_t remote bt_address
4314 * @param[in] char remote uuid
4316 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4320 void bt_event_callback(int event, bluetooth_event_param_t *param)
4324 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4326 if (param->result >= BLUETOOTH_ERROR_NONE)
4328 bt_sdp_info_t *bt_sdp_info=param->param_data;
4330 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4331 bt_sdp_info->device_addr.addr[0],
4332 bt_sdp_info->device_addr.addr[1],
4333 bt_sdp_info->device_addr.addr[2],
4334 bt_sdp_info->device_addr.addr[3],
4335 bt_sdp_info->device_addr.addr[4],
4336 bt_sdp_info->device_addr.addr[5]);
4338 printf("Supported service list:\n");
4339 for(i=0; i<bt_sdp_info->service_index; i++)
4341 bt_sdp_info->service_list_array[i]);
4344 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4345 //rfcomm_test_uuid);
4349 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4351 bluetooth_rfcomm_connection_t *conn_ind =
4352 (bluetooth_rfcomm_connection_t *)param->param_data;
4354 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4355 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4356 "SERVER" : "CLIENT");
4361 bluetooth_device_address_t remote_address = {{0},};
4362 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4363 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4364 ret = bluetooth_search_service(&remote_address);
4366 printf("Seach failed, Reason = %d", ret);
4368 printf("Search Success, Ret = %d", ret);
4370 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4372 printf("Connection failed, Reason = %d", ret);
4374 printf("Connection Success, Ret = %d", ret);
4378 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4379 const char *remote_uuid);
4382 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4383 * @brief Disconnect rfcomm connection
4386 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4387 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4390 * @return BLUETOOTH_ERROR_NONE - Success \n
4391 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4392 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4393 * @param[in] char remote bt_address
4396 * @see bluetooth_rfcomm_connect
4400 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4402 printf("Disconnection failed");
4404 printf("Disconnection Success");
4409 int bluetooth_rfcomm_disconnect(int socket_fd);
4412 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4413 * @brief Write to rfcomm connection
4416 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4417 * API is used to send the data for server and the client.
4419 * @return BLUETOOTH_ERROR_NONE - Success \n
4420 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4421 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4423 * @param[in] const char *buff Data buffer to send
4424 * @param[in] int length Length of the data
4427 * @see bluetooth_rfcomm_connect
4430 char *buff = "Test data 123456789"
4431 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4433 printf("Send failed");
4435 printf("Send success");
4439 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4442 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4443 * @brief Informs whether rfcomm client is connected.
4445 * This function is a synchronous call.
4447 * @return TRUE - RFCOMM client is connected \n
4448 * FALSE - RFCOMM client is not connected \n
4454 gboolean bluetooth_rfcomm_is_client_connected(void);
4455 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4456 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4459 * @fn int bluetooth_network_activate_server(void)
4460 * @brief Activate the NAP (Network Access Point) service
4462 * This function is a asynchronous call.
4463 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4465 * @return BLUETOOTH_ERROR_NONE - Success \n
4466 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4467 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4468 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4471 * @see bluetooth_network_deactivate_server
4474 int bluetooth_network_activate_server(void);
4477 * @fn int bluetooth_network_deactivate_server(void)
4478 * @brief Deactivate the NAP (Network Access Point) service
4480 * This function is a asynchronous call.
4481 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4483 * @return BLUETOOTH_ERROR_NONE - Success \n
4484 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4485 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4486 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4489 * @see bluetooth_network_activate_server
4492 int bluetooth_network_deactivate_server(void);
4495 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4496 * bluetooth_network_role_t role,
4498 * @brief Connect the network server in the peer
4500 * This function is a asynchronous call.
4501 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4503 * @return BLUETOOTH_ERROR_NONE - Success \n
4504 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4505 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4506 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4509 * @param[in] device_address This indicates an address of the device with which the pairing
4510 * should be initiated
4511 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4512 * need to use the third parameter.
4513 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4514 * connect. UUID string
4516 * @see bluetooth_network_disconnect
4518 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4519 bluetooth_network_role_t role, char *custom_uuid);
4522 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4523 * bluetooth_network_role_t role,
4524 * char *custom_uuid)
4525 * @brief Connect the network server in the peer
4527 * This function is a asynchronous call.
4528 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4530 * @return BLUETOOTH_ERROR_NONE - Success \n
4531 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4532 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4533 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4536 * @param[in] device_address This indicates an address of the device with which the pairing
4537 * should be initiated
4539 * @see bluetooth_network_connect
4541 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4544 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4545 * @brief Disconnect the device from the network
4547 * This function is an asynchronous call.
4548 * The network server disconnect request is responded by
4549 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4551 * @return BLUETOOTH_ERROR_NONE - Success \n
4552 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4553 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4554 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4557 * @param[in] device_address This indicates an address of the connected client device
4559 * @see bluetooth_network_activate_server
4561 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4566 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4567 * bt_hdp_role_type_t role,
4568 * bt_hdp_qos_type_t channel_type,
4569 * char **app_handle)
4570 * @brief Activate the HDP service for a particular data type
4572 * This function is a synchronous call.
4574 * @return BLUETOOTH_ERROR_NONE - Success \n
4575 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4576 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4577 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4580 * @param[in] data_type The data type against corresponding service
4581 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4582 * @param[in] channel_type The QOS type for the channel.
4583 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4584 * For role = HDP_ROLE_SINK, the channel_type
4585 * should be HDP_QOS_ANY.
4586 * @param[out] app_handle The application handler against corresponding service
4588 * @see bluetooth_hdp_deactivate
4590 int bluetooth_hdp_activate(unsigned short data_type,
4591 bt_hdp_role_type_t role,
4592 bt_hdp_qos_type_t channel_type,
4595 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4596 * @brief Deactivate the HDP service for a particular service using the handler
4598 * This function is a synchronous call.
4600 * @return BLUETOOTH_ERROR_NONE - Success \n
4601 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4602 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4603 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4606 * @param[in] app_handle The application handler against corresponding service
4608 * @see bluetooth_hdp_deactivate
4610 int bluetooth_hdp_deactivate(const char *app_handle);
4613 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4614 * const char *buffer, unsigned int size)
4615 * @brief Send data to the remote HDP device
4617 * This function is a synchronous call.
4619 * @return BLUETOOTH_ERROR_NONE - Success \n
4620 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4621 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4622 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4623 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4626 * @param[in] channel_id The channel id for the connection.
4627 * @param[in] buffer The pdu buffer.
4628 * @param[in] size Size of the buffer.
4630 * @see bluetooth_hdp_connect
4632 int bluetooth_hdp_send_data(unsigned int channel_id,
4633 const char *buffer, unsigned int size);
4635 * @fn int bluetooth_hdp_connect(const char *app_handle,
4636 * bt_hdp_qos_type_t channel_type,
4637 * const bluetooth_device_address_t *device_address)
4638 * @brief Connect to the remote device(Mainly used by source)
4640 * This function is a asynchronous call.
4641 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4643 * @return BLUETOOTH_ERROR_NONE - Success \n
4644 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4645 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4646 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4647 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4650 * @param[in] app_handle The application handler against corresponding service
4651 * @param[in] channel_type The QOS type for the channel.
4652 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4653 * @param[in] device_address The remote device Bd address.
4656 * @see bluetooth_hdp_disconnect
4658 int bluetooth_hdp_connect(const char *app_handle,
4659 bt_hdp_qos_type_t channel_type,
4660 const bluetooth_device_address_t *device_address);
4662 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4663 * const bluetooth_device_address_t *device_address)
4664 * @brief Disconnect from the remote device(Mainly used by source)
4666 * This function is a asynchronous call.
4667 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4669 * @return BLUETOOTH_ERROR_NONE - Success \n
4670 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4671 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4672 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4673 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4676 * @param[in] channel_id The channel id for the connection.
4677 * @param[in] device_address The remote device Bd address.
4680 * @see bluetooth_hdp_connect
4682 int bluetooth_hdp_disconnect(unsigned int channel_id,
4683 const bluetooth_device_address_t *device_address);
4687 * @fn int bluetooth_opc_init(void)
4688 * @brief Initialize OPP client.
4690 * This function is a synchronous call.
4691 * No event corresponding to this api
4693 * @return BLUETOOTH_ERROR_NONE - Success \n
4694 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4695 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4696 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4697 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4702 * @see bluetooth_opc_deinit
4704 int bluetooth_opc_init(void);
4707 * @fn int bluetooth_opc_deinit(void)
4708 * @brief Deinitialize OPP client.
4710 * This function is a synchronous call.
4711 * No event corresponding to this api
4713 * @return BLUETOOTH_ERROR_NONE - Success \n
4714 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4715 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4720 * @see bluetooth_opc_init
4723 int bluetooth_opc_deinit(void);
4726 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4727 char **file_name_array)
4728 * @brief Send multiple files to a remote device.
4730 * This function is a asynchronous call.
4731 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4733 * @return BLUETOOTH_ERROR_NONE - Success \n
4734 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4735 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4736 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4737 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4738 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4739 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4742 * @param[in] device_address The remote device Bd address.
4743 * @param[in] file_name_array Array of filepaths to be sent.
4746 * @see bluetooth_opc_cancel_push
4749 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4750 char **file_name_array);
4753 * @fn int bluetooth_opc_cancel_push(void)
4754 * @brief Cancels the ongoing file push.
4756 * This function is a asynchronous call.
4757 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4758 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4760 * @return BLUETOOTH_ERROR_NONE - Success \n
4761 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4762 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4767 * @see bluetooth_opc_push_files
4770 int bluetooth_opc_cancel_push(void);
4773 * @fn gboolean bluetooth_opc_session_is_exist(void)
4774 * @brief Informs whether opc session exists or not.
4776 * This function is a synchronous call.
4778 * @return TRUE - OPC session exists \n
4779 * FALSE - OPC session does not exist \n
4787 gboolean bluetooth_opc_session_is_exist(void);
4790 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4791 * @brief Informs whether opc session exists or not.
4793 * This function is a synchronous call.
4795 * @return BLUETOOTH_ERROR_NONE - Success \n
4796 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4797 * BLUETOOTH_ERROR_INTERNAL \n
4800 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4805 int bluetooth_opc_is_sending(gboolean *is_sending);
4808 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4809 int transfer_id, unsigned char *progress)
4810 * @brief Gets the percentage progress for ongoing transfers.
4812 * This function is a synchronous call.
4814 * @return BLUETOOTH_ERROR_NONE - Success \n
4815 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4816 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4819 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4820 * @param[in] transfer_id Transfer ID
4821 * @param[out] progress Percentage Progress
4825 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4826 int transfer_id, unsigned char *progress);
4829 * @fn int bluetooth_obex_server_init(const char *dst_path)
4830 * @brief Initialize OPP and FTP server.
4832 * This function is a synchronous call.
4833 * No event corresponding to this api
4835 * @return BLUETOOTH_ERROR_NONE - Success \n
4836 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4837 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4838 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4839 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4842 * @param[in] dst_path OPS destination file path.
4844 * @see bluetooth_obex_server_deinit
4846 int bluetooth_obex_server_init(const char *dst_path);
4850 * @fn int bluetooth_obex_server_deinit(void)
4851 * @brief Deinitialize OPP and FTP server.
4853 * This function is a synchronous call.
4854 * No event corresponding to this api
4856 * @return BLUETOOTH_ERROR_NONE - Success \n
4857 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4858 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4863 * @see bluetooth_obex_server_init
4865 int bluetooth_obex_server_deinit(void);
4869 * @fn gboolean bluetooth_obex_server_is_activated(void)
4870 * @brief Informs whether obex server is activated or not.
4872 * This function is a synchronous call.
4874 * @return TRUE - OBEX server is activated \n
4875 * FALSE - OBEX server is not activated \n
4882 gboolean bluetooth_obex_server_is_activated(void);
4886 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4887 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4889 * This function is a synchronous call.
4890 * No event corresponding to this api
4892 * @return BLUETOOTH_ERROR_NONE - Success \n
4893 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4894 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4895 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4896 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4900 * @param[in] dst_path OPS destination file path.
4902 * @see bluetooth_obex_server_deinit_without_agent
4904 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4908 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4909 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4911 * This function is a synchronous call.
4912 * No event corresponding to this api
4914 * @return BLUETOOTH_ERROR_NONE - Success \n
4915 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4916 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4921 * @see bluetooth_obex_server_init_without_agent
4923 int bluetooth_obex_server_deinit_without_agent(void);
4927 * @fn int bluetooth_obex_server_accept_connection(void)
4928 * @brief Accepts the authorization request indicated by the event
4929 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4931 * This function is a synchronous call.
4933 * @return BLUETOOTH_ERROR_NONE - Success \n
4934 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4935 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4939 * @see bluetooth_obex_server_reject_authorize
4941 int bluetooth_obex_server_accept_connection(void);
4945 * @fn int bluetooth_obex_server_reject_connection(void)
4946 * @brief Rejects the authorization request indicated by the event
4947 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4949 * This function is a synchronous call.
4951 * @return BLUETOOTH_ERROR_NONE - Success \n
4952 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4953 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4957 * @see bluetooth_obex_server_reject_authorize
4959 int bluetooth_obex_server_reject_connection(void);
4963 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4964 * @brief Accepts the authorization request indicated by the event
4965 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4967 * This function is a asynchronous call.
4968 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4970 * @return BLUETOOTH_ERROR_NONE - Success \n
4971 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4972 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4973 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4976 * @param[in] filename Authorized filename.
4979 * @see bluetooth_obex_server_reject_authorize
4982 int bluetooth_obex_server_accept_authorize(const char *filename);
4985 * @fn int bluetooth_obex_server_reject_authorize(void)
4986 * @brief Reject the authorization request indicated by the event
4987 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4989 * This function is a asynchronous call.
4990 * No event for this api..
4992 * @return BLUETOOTH_ERROR_NONE - Success \n
4993 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4994 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4999 * @see bluetooth_obex_server_accept_authorize
5002 int bluetooth_obex_server_reject_authorize(void);
5005 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5006 * @brief Set the OPS destination file path..
5008 * This function is a asynchronous call.
5009 * No event for this api..
5011 * @return BLUETOOTH_ERROR_NONE - Success \n
5012 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5013 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5014 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5017 * @param[in] dst_path OPS destination file path.
5023 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5026 * @fn int bluetooth_obex_server_set_root(const char *root)
5027 * @brief Set the FTS root folder..
5029 * This function is a asynchronous call.
5030 * No event for this api..
5032 * @return BLUETOOTH_ERROR_NONE - Success \n
5033 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5034 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5035 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5036 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5037 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5040 * @param[in] root FTS root folder.
5046 int bluetooth_obex_server_set_root(const char *root);
5049 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5050 * @brief Cancel the transfer on server
5052 * This function is an asynchronous call.
5053 * If the function call that cancels transfer is successful, the application would receive
5054 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5055 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5056 * the error code will be BLUETOOTH_ERROR_NONE
5058 * @return BLUETOOTH_ERROR_NONE - Success \n
5059 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5060 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5061 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5062 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5065 * @param[in] transfer_id transfer ID
5070 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5074 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5075 * @brief Cancel the transfer on server
5077 * This function is an asynchronous call.
5078 * If the function call that cancels transfer is successful, the application would receive
5079 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5080 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5081 * the error code will be BLUETOOTH_ERROR_NONE
5083 * @return BLUETOOTH_ERROR_NONE - Success \n
5084 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5085 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5086 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5087 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5094 int bluetooth_obex_server_cancel_all_transfers(void);
5098 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5099 * @brief Informs whether obex server is receiving or not.
5101 * This function is a synchronous call.
5103 * @return BLUETOOTH_ERROR_NONE - Success \n
5104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5105 * BLUETOOTH_ERROR_INTERNAL \n
5108 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5113 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5117 * @fn int bluetooth_map_client_init(void)
5118 * @brief Initialize MAP client.
5120 * This function is a synchronous call.
5121 * No event corresponding to this api
5123 * @return BLUETOOTH_ERROR_NONE - Success \n
5124 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5125 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5126 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5127 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5132 * @see bluetooth_map_client_deinit
5134 int bluetooth_map_client_init(void);
5136 int bluetooth_map_client_deinit(void);
5138 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5140 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5142 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5144 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5145 bt_map_client_list_folders_filter_t *filter);
5148 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5149 * @brief Return all available fields that can be used in Fields filter.
5151 * This function is a asynchronous call.
5153 * @return BLUETOOTH_ERROR_NONE - Success \n
5154 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5155 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5158 * @param[in] session Information about session.
5161 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5163 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5165 bt_map_client_list_messages_filter_t *filter);
5167 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5169 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5170 const char *source_file,
5172 bt_map_client_push_message_args_t *args);
5174 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5175 const bt_map_client_message_object_t message_object,
5176 const char *target_file,
5181 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5182 * @brief Read the local Hash and Randmizer.
5184 * This function is a synchronous call.
5186 * @return BLUETOOTH_ERROR_NONE - Success \n
5187 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5191 * @param[out] local_oob_data - Pointer to the local OOB data
5197 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5201 * @fn int bluetooth_oob_add_remote_data(
5202 * const bluetooth_device_address_t *remote_device_address,
5203 * bluetooth_bdaddr_type_e address_type,
5204 * bt_oob_data_t *oob_data)
5205 * @brief Add/updated the remote device Hash and Randmizer.
5207 * This function is a synchronous call.
5208 * No event for this api..
5210 * @return BLUETOOTH_ERROR_NONE - Success \n
5211 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5214 * @param[in] remote_device_address - Remote device address
5215 * address_type - bdaddr type
5216 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5222 int bluetooth_oob_add_remote_data(
5223 const bluetooth_device_address_t *remote_device_address,
5224 bluetooth_bdaddr_type_e address_type,
5225 bt_oob_data_t *remote_oob_data);
5229 * @fn int bluetooth_oob_remove_remote_data(
5230 * const bluetooth_device_address_t *remote_device_address)
5231 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5233 * This function is a synchronous call.
5234 * No event for this api..
5236 * @return BLUETOOTH_ERROR_NONE - Success \n
5237 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5240 * @param[in] remote_device_address - Remote device address
5246 int bluetooth_oob_remove_remote_data(
5247 const bluetooth_device_address_t *remote_device_address);
5251 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5252 * @brief Read the local Hash and Randmizer.
5254 * This function is a synchronous call.
5256 * @return BLUETOOTH_ERROR_NONE - Success \n
5257 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5261 * @param[out] local_oob_data - Pointer to the local OOB data
5266 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5269 * @fn int bluetooth_le_oob_add_remote_data(
5270 * const bluetooth_device_address_t *remote_device_address,
5271 * bluetooth_bdaddr_type_e address_type,
5272 * bt_oob_data_t *oob_data)
5273 * @brief Add/updated the remote device Hash and Randmizer.
5275 * This function is a synchronous call.
5276 * No event for this api..
5278 * @return BLUETOOTH_ERROR_NONE - Success \n
5279 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5282 * @param[in] remote_device_address - Remote device address
5283 * address_type - bdaddr type
5284 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5289 int bluetooth_le_oob_add_remote_data(
5290 const bluetooth_device_address_t *remote_device_address,
5291 bluetooth_bdaddr_type_e address_type,
5292 bt_oob_data_t *remote_oob_data);
5295 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5296 * bt_gatt_handle_info_t *prim_svc);
5298 * @brief Gets the GATT based primary services handle supported by remote device
5300 * This function is a synchronous call.
5301 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5303 * @return BLUETOOTH_ERROR_NONE - Success \n
5304 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5305 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5306 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5309 * @param[in] address - Remote device address
5310 * @param[out] prim_svc - Structure containing remote service count and handle list.
5313 * @see bluetooth_gatt_free_primary_services()
5315 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5316 bt_gatt_handle_info_t *prim_svc);
5319 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5321 * @brief Discovers the characteristics of GATT based service of remote device
5323 * This function is an asynchronous call.
5324 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5326 * @return BLUETOOTH_ERROR_NONE - Success \n
5327 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5328 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5329 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5332 * @param[in] service_handle - Handle for remote service.
5337 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5339 int bluetooth_gatt_set_service_change_watcher(
5340 const bluetooth_device_address_t *address, gboolean enable);
5343 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5344 * bt_gatt_service_property_t *service);
5346 * @brief Gets the properties of GATT based service of remote device
5348 * This function is a synchronous call.
5349 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5351 * @return BLUETOOTH_ERROR_NONE - Success \n
5352 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5353 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5354 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5357 * @param[in] service_handle - Handle for remote service.
5358 * @param[out] service - Structure containing remote service property.
5361 * @see bluetooth_gatt_free_service_property()
5363 int bluetooth_gatt_get_service_property(const char *service_handle,
5364 bt_gatt_service_property_t *service);
5367 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5369 * @brief Register to GATT based service to receive value change notification/indication.
5371 * This function is a synchronous call.
5372 * No event for this api.
5374 * @return BLUETOOTH_ERROR_NONE - Success \n
5375 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5376 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5377 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5380 * @param[in] service_handle - Handle for remote service.
5381 * @param[in] service_name - Friednly name of service uuid.
5386 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5389 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5391 * @brief Unregister GATT based service to receive value change notification/indication.
5393 * This function is a synchronous call.
5394 * No event for this api.
5396 * @return BLUETOOTH_ERROR_NONE - Success \n
5397 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5398 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5399 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5402 * @param[in] service_handle - Handle for remote service.
5407 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5410 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5411 * bt_gatt_char_property_t *characteristic);
5413 * @brief Provides characteristic value along with properties.
5415 * This function is a synchronous call.
5416 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5418 * @return BLUETOOTH_ERROR_NONE - Success \n
5419 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5420 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5421 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5424 * @param[in] char_handle - Handle for Characteristic property.
5425 * @param[out] characteristic - Structure containing remote characteristic property.
5428 * @see bluetooth_gatt_free_char_property()
5430 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5431 bt_gatt_char_property_t *characteristic);
5434 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5435 * bt_gatt_char_property_t *characteristic);
5437 * @brief Provides characteristic descriptor value along with its UUID.
5439 * This function is a synchronous call.
5440 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5442 * @return BLUETOOTH_ERROR_NONE - Success \n
5443 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5444 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5445 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5448 * @param[in] desc_handle - Handle for Characteristic descriptor.
5449 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5452 * @see bluetooth_gatt_free_desc_property()
5454 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5455 bt_gatt_char_descriptor_property_t *descriptor);
5459 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5460 * const guint8 *value, int length)
5462 * @brief Set characteristic value.
5464 * This function is a synchronous call.
5466 * @return BLUETOOTH_ERROR_NONE - Success \n
5467 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5468 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5469 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5472 * @param[in] char_handle - Handle for Characteristic property.
5473 * @param[in] value - New value to set for characteristic property.
5474 * @param[in] length - Length of the value to be set.
5479 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5480 const guint8 *value, int length);
5483 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5484 * const guint8 *value, int length, guint8 write_type)
5486 * @brief Set characteristic value by write type.
5488 * This function is a synchronous call if write type is "write without resonse"
5489 * and it is an asynchronous call if write type is "write with response"
5491 * @return BLUETOOTH_ERROR_NONE - Success \n
5492 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5493 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5494 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5497 * @param[in] char_handle - Handle for Characteristic property.
5498 * @param[in] value - New value to set for characteristic property.
5499 * @param[in] length - Length of the value to be set.
5500 * @param[in] write_type - Type of write.
5505 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5506 const guint8 *value, int length,
5507 guint8 write_type, gpointer app_data);
5511 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5512 * const guint8 *value, int length)
5514 * @brief Set characteristic value request.
5516 * This function is an asynchronous call.
5518 * @return BLUETOOTH_ERROR_NONE - Success \n
5519 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5520 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5521 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5524 * @param[in] char_handle - Handle for Characteristic property.
5525 * @param[in] value - New value to set for characteristic property.
5526 * @param[in] length - Length of the value to be set.
5531 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5532 const guint8 *value, int length);
5535 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5537 * @brief Read characteristic value.
5539 * This function is a asynchronous call.
5541 * @return BLUETOOTH_ERROR_NONE - Success \n
5542 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5543 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5544 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5547 * @param[in] char_handle - Handle for Characteristic property.
5552 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5555 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5556 * const char *service_uuid,
5557 * bt_gatt_service_property_t *service)
5559 * @brief Gets the service property from a device based on a particular uuid
5561 * This function is a synchronous call.
5563 * @return BLUETOOTH_ERROR_NONE - Success \n
5564 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5565 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5566 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5569 * @param[in] address - BD address of the remote device
5570 * @param[in] service_uuid - uuid of the service.
5571 * @param[out] service - Structure containing the service property.
5576 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5577 const char *service_uuid,
5578 bt_gatt_service_property_t *service);
5581 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5582 * const char *char_uuid)
5584 * @brief Gets the characteristic property from a service based on a particular char uuid
5586 * This function is an asynchronous call.
5587 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5589 * @return BLUETOOTH_ERROR_NONE - Success \n
5590 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5591 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5592 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5595 * @param[in] service_handle - Service handle.
5596 * @param[in] uuid - Characteristic uuid.
5601 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5602 const char *char_uuid);
5605 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5607 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5609 * This function is a synchronous call.
5610 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5612 * @return BLUETOOTH_ERROR_NONE - Success \n
5613 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5616 * @param[in] prim_svc - GATT handle info structure
5619 * @see bluetooth_gatt_get_primary_services()
5621 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5624 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5626 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5628 * This function is a synchronous call.
5629 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5631 * @return BLUETOOTH_ERROR_NONE - Success \n
5632 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5635 * @param[in] svc_pty - GATT service property structure.
5638 * @see bluetooth_gatt_get_service_property()
5640 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5643 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5645 * @brief Provides characteristic value along with properties.
5647 * This function is a synchronous call.
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] char_pty - GATT characteristics property structure.
5657 * @see bluetooth_gatt_get_characteristics_property()
5659 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5662 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5664 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5666 * This function is a synchronous call.
5667 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5669 * @return BLUETOOTH_ERROR_NONE - Success \n
5670 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5673 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5676 * @see bluetooth_gatt_get_char_descriptor_property()
5678 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5680 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5681 gboolean auto_connect, int client_id);
5683 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5686 int bluetooth_get_gatt_data_batching_available_packets(
5687 int *available_packets);
5689 int bluetooth_enable_gatt_data_batching(
5690 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5692 int bluetooth_disable_gatt_data_batching(
5693 const bluetooth_device_address_t *device_address);
5696 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5698 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5700 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5702 * @return BLUETOOTH_ERROR_NONE - Success \n
5703 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5706 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5710 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5713 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5715 * @brief Read characteristic descriptor value.
5717 * This function is a asynchronous call.
5719 * @return BLUETOOTH_ERROR_NONE - Success \n
5720 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5721 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5722 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5725 * @param[in] desc_handle - Handle for Characteristic descriptor
5730 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5733 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5734 * const guint8 *value, int length);
5736 * @brief Set characteristic descriptor value.
5738 * This function is a asynchronous call.
5740 * @return BLUETOOTH_ERROR_NONE - Success \n
5741 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5742 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5743 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5746 * @param[in] desc_handle - Handle for Characteristic descriptor
5747 * @param[in] value - New value to set for characteristic descriptor
5748 * @param[in] length - Length of the value to be set.
5753 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5754 const guint8 *value, int length, gpointer app_data);
5756 /* @fn int bluetooth_gatt_init(void)
5758 * @brief Initializes the gatt service.
5760 * This function is a synchronous call.
5761 * @return BLUETOOTH_ERROR_NONE - Success \n
5762 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5763 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5764 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5767 * @remark Adapter should be enabled
5768 * @see bluetooth_gatt_deinit()
5770 int bluetooth_gatt_init(void);
5772 /* @fn int bluetooth_gatt_init(void)
5774 * @brief DeInitializes the gatt service.
5776 * This function is a synchronous call.
5777 * @return BLUETOOTH_ERROR_NONE - Success \n
5778 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5779 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5780 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5783 * @remark Adapter should be enabled
5784 * @see bluetooth_gatt_init()
5786 int bluetooth_gatt_deinit(void);
5788 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5789 unsigned char **svc_path)
5791 * @brief Exports a new gatt service to the service interface.
5793 * This function is a synchronous call.
5795 * @return BLUETOOTH_ERROR_NONE - Success \n
5796 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5797 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5798 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5801 * @param[in] svc_uuid Gatt service uuid.
5802 * @param[out] svc_path service object path of the exported service.
5803 * @remark Adapter should be enabled
5804 * @see bluetooth_gatt_init()
5806 int bluetooth_gatt_add_service(const char *svc_uuid,
5809 /* @fn int bluetooth_gatt_add_new_characteristic(
5810 const char *svc_path, const char *char_uuid,
5811 bt_gatt_permission_t permissions,
5812 bt_gatt_characteristic_property_t properties,
5813 int flags_length, char **char_path);;
5815 * @brief Exports a new gatt characteristic to the characteristic interface.
5817 * This function is a synchronous call.
5818 * @return BLUETOOTH_ERROR_NONE - Success \n
5819 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5820 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5821 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5823 * @param[in] svc_path service object path of the exported service.
5824 * @param[in] char_uuid Gatt service uuid.
5825 * @param[in] properties GATT characteristic properties.
5826 * @param[out] char_path characteristic object path of the exported characteristic.
5828 * @remark Adapter should be enabled
5829 * @see bluetooth_gatt_add_service()
5831 int bluetooth_gatt_add_new_characteristic(
5832 const char *svc_path, const char *char_uuid,
5833 bt_gatt_permission_t permissions,
5834 bt_gatt_characteristic_property_t properties,
5837 /* @fn bluetooth_gatt_set_characteristic_value(
5838 const char *characteristic, const char *char_value,
5841 * @brief adds gatt charactertisic value to the given charactertistic path.
5843 * This function is a synchronous call.
5844 * @return BLUETOOTH_ERROR_NONE - Success \n
5845 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5846 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5847 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5849 * @param[in] char_value Value of the GATT characteristic to be added.
5850 * @param[in] value_length length of the chantacteristic value..
5851 * @param[out] characteristic characteristic object path..
5853 * @remark Adapter should be enabled
5854 * @see bluetooth_gatt_add_service()
5856 int bluetooth_gatt_set_characteristic_value(
5857 const char *characteristic, const char *char_value,
5860 /* @fn int bluetooth_gatt_add_descriptor(
5861 const char *char_path, const char *desc_uuid,
5862 bt_gatt_permission_t permissions,
5865 * @brief Exports a new gatt descriptor to the descriptor interface.
5867 * This function is a synchronous call.
5869 * @return BLUETOOTH_ERROR_NONE - Success \n
5870 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5871 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5872 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5875 * @param[in] desc_uuid Gatt descriptor uuid.
5876 * @param[in] desc_value GATT descriptor value.
5877 * @param[in] value_length Length of GATT descriptor value.
5878 * @param[in] permissions descriptor permissions.
5879 * @param[in] properties GATT descriptor properties.
5880 * @param[in] char_path characteristics object path of the exported character.
5882 * @remark Adapter should be enabled
5883 * @see bluetooth_gatt_add_service()
5884 * @see bluetooth_gatt_add_characteristics()
5886 int bluetooth_gatt_add_descriptor(
5887 const char *char_path, const char *desc_uuid,
5888 bt_gatt_permission_t permissions,
5891 /* @fn int bluetooth_gatt_set_descriptor_value(
5892 const char *desc_path, const char *desc_value,
5895 * @brief Adds value to the given descriptor handle.
5897 * This function is a synchronous call.
5899 * @return BLUETOOTH_ERROR_NONE - Success \n
5900 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5901 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5902 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5905 * @param[in] desc_value GATT descriptor value.
5906 * @param[in] value_length Length of GATT descriptor value.
5907 * @param[in] desc_path descriptor path to which the value needs to be added.
5909 * @remark Adapter should be enabled
5910 * @see bluetooth_gatt_add_service()
5911 * @see bluetooth_gatt_add_characteristics()
5913 int bluetooth_gatt_set_descriptor_value(
5914 const char *desc_path, const char *desc_value,
5917 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5919 * @brief Reads the Service registered on manager interface.
5921 * This function is a synchronous call.
5923 * @return BLUETOOTH_ERROR_NONE - Success \n
5924 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5925 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5926 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5929 * @param[in] svc_uuid Gatt Service uuid.
5931 * @remark Adapter should be enabled and service should be registered.
5932 * @see bluetooth_gatt_register_service()
5934 int bluetooth_gatt_get_service(const char *svc_uuid);
5936 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5938 * @brief Registers the given service path with the library.
5940 * This function is a synchronous call.
5942 * @return BLUETOOTH_ERROR_NONE - Success \n
5943 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5944 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5945 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5948 * @param[in] svc_path service object path of the exported service.
5950 * @remark Adapter should be enabled
5951 * @see bluetooth_gatt_add_service()
5952 * @see bluetooth_gatt_add_characteristics()
5953 * @see bluetooth_gatt_add_descriptor()
5954 * @see bluetooth_gatt_register_application()
5956 int bluetooth_gatt_register_service(const char *svc_path);
5958 /* @fn int bluetooth_gatt_register_application(void)
5960 * @brief Registers the application with the bluez gatt server.
5962 * This function is a synchronous call.
5964 * @return BLUETOOTH_ERROR_NONE - Success \n
5965 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5966 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5967 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5971 * @remark Adapter should be enabled
5972 * @see bluetooth_gatt_init()
5973 * @see bluetooth_gatt_add_service()
5974 * @see bluetooth_gatt_add_characteristics()
5975 * @see bluetooth_gatt_add_descriptor()
5976 * @see bluetooth_gatt_register_service()
5978 int bluetooth_gatt_register_application(void);
5980 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5982 * @brief Removes(unregister) service from the bluez gatt server db.
5984 * This function is a synchronous call.
5986 * @return BLUETOOTH_ERROR_NONE - Success \n
5987 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5988 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5989 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5992 * @param[in] svc_path service object path of the exported service.
5994 * @remark Adapter should be enabled
5995 * @see bluetooth_gatt_add_service()
5996 * @see bluetooth_gatt_add_characteristics()
5997 * @see bluetooth_gatt_add_descriptor()
5998 * @see bluetooth_gatt_register_service()
6000 int bluetooth_gatt_unregister_service(const char *svc_path);
6002 /* @fn int bluetooth_gatt_unregister_application(void)
6004 * @brief Removes(unregister) the application with the bluez gatt server,
6005 * and deletes all the service registered.
6007 * This function is a synchronous call.
6009 * @return BLUETOOTH_ERROR_NONE - Success \n
6010 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6011 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6012 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6016 * @remark Adapter should be enabled
6017 * @see bluetooth_gatt_init()
6018 * @see bluetooth_gatt_add_service()
6019 * @see bluetooth_gatt_add_characteristics()
6020 * @see bluetooth_gatt_add_descriptor()
6021 * @see bluetooth_gatt_register_service()
6022 * @see bluetooth_gatt_unregister_service()
6024 int bluetooth_gatt_unregister_application(void);
6026 /* @fn int bluetooth_gatt_send_response(int request_id,
6027 * int offset, char *value, int value_length)
6029 * @brief Updates the attribute value in local attribute list.
6031 * This function is a synchronous call.
6033 * @return BLUETOOTH_ERROR_NONE - Success \n
6034 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6035 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6036 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6039 * @param[in] request_id The identification of a read request
6040 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6041 * @param[in] resp_state The identification of response state
6042 * @param[in] offset The offset from where a value is read
6043 * @param[in] value The value to be sent. It will be sent from @a offset.
6044 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6045 * @param[in] value_length Value Length.
6047 * @remark Adapter should be enabled
6048 * @see bluetooth_gatt_add_service()
6049 * @see bluetooth_gatt_add_characteristics()
6050 * @see bluetooth_gatt_add_descriptor()
6051 * @see bluetooth_gatt_register_service()
6053 int bluetooth_gatt_send_response(int request_id, guint req_type,
6054 int resp_state, int offset, char *value, int value_length);
6056 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6058 * @brief Sets the notification property for a characteristic.
6060 * This function is a synchronous call.
6062 * @return BLUETOOTH_ERROR_NONE - Success \n
6063 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6064 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6065 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6068 * @param[in] char_path characteristic object path.
6069 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6071 * @remark Adapter should be enabled
6072 * @see bluetooth_gatt_update_characteristic()
6074 int bluetooth_gatt_server_set_notification(const char *char_path,
6075 bluetooth_device_address_t *unicast_address);
6077 /* @fn int bluetooth_gatt_delete_services(void)
6079 * @brief deletes (unregisters) all services from the gatt server database..
6081 * This function is a synchronous call.
6083 * @return BLUETOOTH_ERROR_NONE - Success \n
6084 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6085 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6086 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6090 * @remark Adapter should be enabled
6091 * @see bluetooth_gatt_add_service()
6092 * @see bluetooth_gatt_add_characteristics()
6093 * @see bluetooth_gatt_add_descriptor()
6094 * @see bluetooth_gatt_register_service()
6095 * @see bluetooth_gatt_unregister_service()
6097 int bluetooth_gatt_delete_services(void);
6099 /* @fn int bluetooth_gatt_update_characteristic(void)
6101 * @brief updates the given characteristic with a new value
6103 * This function is a synchronous call.
6105 * @return BLUETOOTH_ERROR_NONE - Success \n
6106 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6107 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6108 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6112 * @remark Adapter should be enabled
6113 * @see bluetooth_gatt_add_service()
6114 * @see bluetooth_gatt_add_characteristics()
6115 * @see bluetooth_gatt_add_descriptor()
6116 * @see bluetooth_gatt_register_service()
6117 * @see bluetooth_gatt_unregister_service()
6119 int bluetooth_gatt_update_characteristic(const char *char_path,
6120 const char* char_value, int value_length);
6123 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6125 * @brief Set advertising status.
6127 * This function is used to enable or disable LE advertising.
6128 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6130 * This function is a synchronous call.
6132 * @return BLUETOOTH_ERROR_NONE - Success \n
6133 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6134 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6137 * @param[in] enable - The status of advertising
6140 * @see bluetooth_set_advertising_data
6142 int bluetooth_set_advertising(int handle, gboolean enable);
6145 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6147 * @brief Set advertising status along with interval value.
6149 * This function is used to enable or disable LE advertising.
6150 * Interval_min and Interval_max is used to set the best advertising interval.
6151 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6153 * This function is a synchronous call.
6155 * @return BLUETOOTH_ERROR_NONE - Success \n
6156 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6157 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6160 * @param[in] enable - The status of advertising
6161 * @param[in] interval_min - Minimum interval of advertising (msec)
6162 * @param[in] interval_max - Maximum interval of advertising (msec)
6163 * @param[in] filter_policy - Advertising filter policy
6166 * @see bluetooth_set_advertising_data
6168 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6169 bluetooth_advertising_params_t *params);
6172 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6173 * @brief Get the advertising data
6175 * This function is used to get advertising data.
6176 * Before calling this API, the adapter should be enabled.
6178 * This function is a synchronous call.
6180 * @return BLUETOOTH_ERROR_NONE - Success \n
6181 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6182 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6183 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6185 * @param[out] value - Advertising data structure.
6186 * @param[out] length - The length of Advertising data.
6190 bluetooth_advertising_data_t *value = { {0} };
6193 ret = bluetooth_get_advertising_data(&value, &length);
6196 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6199 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6201 * @brief Set advertising data with value
6203 * This function is used to set advertising data and Maximum size of advertising data
6204 * is 28 byte (Except Flag)
6206 * This function is a synchronous call.
6208 * @return BLUETOOTH_ERROR_NONE - Success \n
6209 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6210 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6213 * @param[in] value - Advertising data structure.
6217 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6220 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6222 * @brief Check the privilege for advertising parameter setting
6224 * This function is a synchronous call.
6226 * @return BLUETOOTH_ERROR_NONE - Success \n
6227 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6233 int bluetooth_check_privilege_advertising_parameter(void);
6236 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6237 * @brief Get the LE scan response data
6239 * This function is used to get scan response data.
6240 * Before calling this API, the adapter should be enabled.
6242 * This function is a synchronous call.
6244 * @return BLUETOOTH_ERROR_NONE - Success \n
6245 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6246 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6247 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6249 * @param[out] value - Scan response data structure.
6250 * @param[out] length - The length of Scan response data.
6254 bluetooth_scan_resp_data_t *value = { {0} };
6257 ret = bluetooth_get_scan_response_data(&value, &length);
6260 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6263 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6265 * @brief Set scan response data with value
6267 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6269 * This function is a synchronous call.
6271 * @return BLUETOOTH_ERROR_NONE - Success \n
6272 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6273 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6276 * @param[in] value - LE Scan response data structure.
6280 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6283 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6285 * @brief Set scan interval and window
6287 * This function is used to set LE scan interval and window size
6289 * This function is a synchronous call.
6291 * @return BLUETOOTH_ERROR_NONE - Success \n
6292 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6293 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6296 * @param[in] interval - Interval of LE scan (msec)
6297 * @param[in] window - Window size of LE scan (msec)
6301 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6304 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6306 * @brief Set scan type
6308 * This function is used to set LE scan type
6310 * This function is a synchronous call.
6312 * @return BLUETOOTH_ERROR_NONE - Success \n
6313 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6314 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6317 * @param[in] scan_type - LE scan type
6321 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6324 * @fn int bluetooth_is_advertising(void)
6325 * @brief Check for the advertising is in-progress or not.
6327 * This API is used to check the current status of the advertising procedure.
6328 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6331 * This function checks whether the advertising is started or not.
6333 * This function is a synchronous call.
6335 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6337 * @return BLUETOOTH_ERROR_NONE - Success \n
6338 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6341 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6345 gboolean is_advertising = 0;
6347 ret = bluetooth_is_advertising(&is_advertising);
6350 int bluetooth_is_advertising(gboolean *is_advertising);
6353 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6354 * @brief Add LE device to white list
6356 * This API is used to add LE device to white list
6357 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6361 * This function is a synchronous call.
6363 * @param[in] address The address of remote device
6365 * @return BLUETOOTH_ERROR_NONE - Success \n
6366 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6369 * @see bluetooth_set_custom_advertising
6371 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6374 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6375 * @brief Remove LE device from white list
6377 * This API is used to remove LE device from white list
6378 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6382 * This function is a synchronous call.
6384 * @param[in] address The address of remote device
6386 * @return BLUETOOTH_ERROR_NONE - Success \n
6387 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6390 * @see bluetooth_set_custom_advertising
6392 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6395 * @fn int bluetooth_clear_white_list(void)
6396 * @brief Clear white list
6398 * This API is used to clear white list
6399 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6403 * This function is a synchronous call.
6405 * @param[in] address The address of remote device
6407 * @return BLUETOOTH_ERROR_NONE - Success \n
6408 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6411 * @see bluetooth_set_custom_advertising
6413 int bluetooth_clear_white_list(void);
6416 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6417 * const bluetooth_le_connection_param_t *parameters)
6418 * @brief update connection paramter of LE connection.
6420 * This function is a synchronous call.
6422 * @return BLUETOOTH_ERROR_NONE - Success \n
6423 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6426 * @param[in] address - remote device address value.
6427 * @param[in] parameters - new connection parameters.
6430 * @see bluetooth_bond_device
6432 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6433 const bluetooth_le_connection_param_t *parameters);
6436 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6438 * @brief Enable/Disable LE Privacy feature.
6440 * This function is used to enable or disable LE Privacy feature.
6441 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6443 * This function is a synchronous call.
6445 * @return BLUETOOTH_ERROR_NONE - Success \n
6446 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6447 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6450 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6454 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6457 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6459 * @brief Enable/Disable LE static random address.
6461 * This function is used to enable or disable LE static random address.
6463 * This function is a synchronous call.
6465 * @return BLUETOOTH_ERROR_NONE - Success \n
6466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6467 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6470 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6474 int bluetooth_set_le_static_random_address(gboolean enable);
6477 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6478 * bluetooth_le_connection_mode_t mode)
6479 * @brief update connection paramter of LE connection.
6481 * This function is a synchronous call.
6483 * @return BLUETOOTH_ERROR_NONE - Success \n
6484 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6485 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6488 * @param[in] address - remote device address value.
6489 * @param[in] mode - new connection mode.
6493 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6494 bluetooth_le_connection_mode_t mode);
6497 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6498 * @brief Request for new ATT MTU value.
6500 * This function is a asynchronous call.
6502 * @return BLUETOOTH_ERROR_NONE - Success \n
6503 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6504 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6507 * @param[in] address - remote device address value.
6508 * @param[in] mtu - MTU value to be set.
6512 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6515 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6516 * unsigned int *mtu)
6517 * @brief Gets the xisting MTU value set for a connection.
6519 * This function is a synchronous call.
6521 * @return BLUETOOTH_ERROR_NONE - Success \n
6522 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6523 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6526 * @param[in] address - remote device address value.
6527 * @param[out] mtu - MTU value set for the connection.
6531 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6535 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6536 * bluetooth_device_address_t *id_address)
6537 * @brief Gets the Identity address of remote device.
6539 * This function is a synchronous call.
6541 * @return BLUETOOTH_ERROR_NONE - Success \n
6542 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6543 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6546 * @param[in] device_rpa - remote Resolvable private address.
6547 * @param[out] id_address - remote Identity device address value.
6551 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6552 bluetooth_device_address_t *id_address);
6555 * @fn int bluetooth_le_read_maximum_data_length()
6556 * @brief reads the maximum LE data length supported in the controller.
6558 * This function is a synchronous call.
6560 * @return BLUETOOTH_ERROR_NONE - Success \n
6561 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6567 int bluetooth_le_read_maximum_data_length(
6568 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6570 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6571 * @brief writes the host suggested values for the controllers max transmitted no of payload
6572 * octects to be used for new connections.
6574 * This function is a synchronous call.
6576 * @return BLUETOOTH_ERROR_NONE - Success \n
6577 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6583 int bluetooth_le_write_host_suggested_default_data_length(
6584 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6586 int bluetooth_le_read_suggested_default_data_length(
6587 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6589 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6590 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6592 int bluetooth_pbap_init(void);
6593 int bluetooth_pbap_deinit(void);
6594 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6595 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6596 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6597 bt_pbap_folder_t *folder);
6598 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6599 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6600 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6601 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6602 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6603 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6604 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6605 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6608 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6610 * @brief Set manufacturer data with value
6612 * This function is used to set manufacturer data.
6614 * This function is a synchronous call.
6616 * @return BLUETOOTH_ERROR_NONE - Success \n
6617 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6618 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6621 * @param[in] value - Manufacturer data structure.
6625 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6627 int bluetooth_set_passkey_notification(gboolean enable);
6630 * @fn int bluetooth_dpm_is_mode_allowed(void);
6632 * @brief Checks Restriction for BT mode(BT allowed or not)
6634 * This function is a synchronous call.
6636 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6637 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6638 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6645 int bluetooth_dpm_is_mode_allowed(void);
6648 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6650 * @brief Sets Restriction for BT mode(BT allowed or not)
6652 * This function is a synchronous call.
6654 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6655 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6656 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6659 * @param[in] value - BT Allow value.
6660 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6661 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6662 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6663 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6667 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6670 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6672 * @brief Reads the Restriction for BT mode(BT allowed or not)
6674 * This function is a synchronous call.
6676 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6677 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6678 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6682 * @param[out] value - BT Allow value.
6683 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6684 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6685 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6686 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6690 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6693 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6695 * @brief Sets the Restriction for device.
6697 * This function is a synchronous call.
6699 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6700 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6701 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6704 * @param[in] value - State value.
6705 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6706 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6710 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6713 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6715 * @brief Reads the Restriction for device.
6717 * This function is a synchronous call.
6719 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6720 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6721 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6725 * @param[out] value - State value.
6726 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6727 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6731 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6734 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6736 * @brief Sets the Restriction for uuid.
6738 * This function is a synchronous call.
6740 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6741 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6742 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6745 * @param[in] value - State value.
6746 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6747 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6751 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6754 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6756 * @brief Reads the Restriction for uuid.
6758 * This function is a synchronous call.
6760 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6761 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6762 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6766 * @param[out] value - State value.
6767 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6768 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6772 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6775 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6777 * @brief Adds the device to 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
6786 * @param[in] device_address - Device address
6790 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6793 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6795 * @brief Adds the device to 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
6804 * @param[in] device_address - Device address
6808 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6811 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6813 * @brief Adds the Service UUIDS to 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
6822 * @param[in] service_uuids - profile or custom service uuids
6826 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6829 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6831 * @brief Adds the Service UUIDS to 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
6840 * @param[in] service_uuids - profile or custom service uuids
6844 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6847 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6849 * @brief Clears 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
6862 int bluetooth_dpm_clear_devices_from_blacklist(void);
6865 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6867 * @brief Clears 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
6880 int bluetooth_dpm_clear_devices_from_whitelist(void);
6883 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6885 * @brief Clears 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
6898 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6901 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6903 * @brief Clears 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
6916 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6919 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6921 * @brief reads the devices from blacklist.
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[out] device_list - list of devices
6934 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6937 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6939 * @brief reads the devices from whitelist.
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[out] device_list - list of devices
6952 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6955 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6957 * @brief reads the uuids from blacklist.
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] uuid_list - list of uuids
6970 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6973 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6975 * @brief reads the uuids from whitelist.
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] uuid_list - list of uuids
6988 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6991 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6993 * @brief Removes the device from whitelist.
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] device_address - Device address
7006 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
7009 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7011 * @brief Removes the device from blacklist.
7013 * This function is a synchronous call.
7015 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7016 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7017 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7020 * @param[in] device_address - Device address
7024 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7027 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7029 * @brief Removes the Service UUIDS from whitelist.
7031 * This function is a synchronous call.
7033 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7034 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7035 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7038 * @param[in] service_uuids - profile or custom service uuids
7042 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7045 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7047 * @brief Removes the Service UUIDS from blacklist.
7049 * This function is a synchronous call.
7051 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7052 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7053 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7056 * @param[in] service_uuids - profile or custom service uuids
7060 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7063 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7065 * @brief Sets the Restriction for outgoing call.
7067 * This function is a synchronous call.
7069 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7070 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7071 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7074 * @param[in] value - State value.
7075 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7076 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7080 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7083 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7085 * @brief Reads the Restriction for outgoing call.
7087 * This function is a synchronous call.
7089 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7090 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7091 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7095 * @param[out] value - State value.
7096 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7097 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7101 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7104 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7106 * @brief Sets the Restriction for Pairing.
7108 * This function is a synchronous call.
7110 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7111 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7112 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7115 * @param[in] value - State value.
7116 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7117 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7121 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7124 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7126 * @brief Reads the Restriction for Pairing
7128 * This function is a synchronous call.
7130 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7131 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7132 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7136 * @param[out] value - State value.
7137 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7138 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7142 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7145 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7147 * @brief Sets the Restriction for using Profiles.
7149 * This function is a synchronous call.
7151 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7152 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7153 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7156 * @param[in]profile - Profile.
7157 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7158 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7159 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7160 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7161 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7162 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7163 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7164 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7165 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7166 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7167 * BLUETOOTH_DPM_PROFILE_NONE
7168 * @param[in] value - State value.
7169 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7170 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7174 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7177 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7179 * @brief Reads the Restriction for using Profiles.
7181 * This function is a synchronous call.
7183 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7184 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7185 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7188 * @param[in]profile - Profile.
7189 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7190 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7191 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7192 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7193 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7194 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7195 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7196 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7197 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7198 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7199 * BLUETOOTH_DPM_PROFILE_NONE
7200 * @param[out] value - State value.
7201 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7202 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7206 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7209 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7211 * @brief Sets the Restriction for Desktop Connectivity.
7213 * This function is a synchronous call.
7215 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7216 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7217 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7220 * @param[in] value - State value.
7221 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7222 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7226 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7229 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7231 * @brief Reads the Restriction for Desktop Connectivity.
7233 * This function is a synchronous call.
7235 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7236 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7237 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7241 * @param[out] value - State value.
7242 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7243 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7247 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7250 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7252 * @brief Sets the Restriction for Discoverable state.
7254 * This function is a synchronous call.
7256 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7257 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7258 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7261 * @param[in] value - State value.
7262 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7263 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7267 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7270 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7272 * @brief Reads the Restriction for Discoverable state.
7274 * This function is a synchronous call.
7276 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7277 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7278 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7282 * @param[out] value - State value.
7283 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7284 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7288 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7291 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7293 * @brief Sets the Restriction for linited discoverable state..
7295 * This function is a synchronous call.
7297 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7298 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7299 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7302 * @param[in] value - State value.
7303 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7304 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7308 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7311 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7313 * @brief Reads the Restriction for limited discoverable state.
7315 * This function is a synchronous call.
7317 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7318 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7319 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7323 * @param[out] value - State value.
7324 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7325 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7329 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7331 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7333 * @brief Sets the Restriction for Data trasnfer.
7335 * This function is a synchronous call.
7337 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7338 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7339 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7342 * @param[in] value - State value.
7343 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7344 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7348 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7352 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7354 * @brief Reads the Restriction for Data trasnfer.
7356 * This function is a synchronous call.
7358 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7359 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7360 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7364 * @param[out] value - State value.
7365 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7366 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7370 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7373 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7374 * bluetooth_pxp_poperty_t property, int value);
7376 * @brief Sets the Proximity alert level/properties for monitor role.
7378 * This function is a synchronous call.
7380 * @return BLUETOOTH_ERROR_NONE - Success \n
7381 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7382 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7383 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7386 * @param[in] device_address remote device address
7387 * @param[in] property proximity profile property
7388 * @param[in] value alert level/property value to be set
7393 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7394 bluetooth_pxp_poperty_t property, int value);
7397 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7398 * bluetooth_pxp_poperty_t property, int *value);
7400 * @brief Reads the Proximity alert level/properties for monitor role.
7402 * This function is a synchronous call.
7404 * @return BLUETOOTH_ERROR_NONE - Success \n
7405 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7406 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7407 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7410 * @param[in] device_address remote device address
7411 * @param[in] property proximity profile property
7412 * @param[out] value alert level/property value
7416 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7417 bluetooth_pxp_poperty_t property, int *value);
7420 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7421 * int *services_supported);
7423 * @brief Reads the Proximity Monitor profile supported properties/services.
7425 * This function is a synchronous call.
7427 * @return BLUETOOTH_ERROR_NONE - Success \n
7428 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7429 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7430 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7433 * @param[in] device_address remote device address
7434 * @param[out] services_supported proximity profile property/service
7438 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7439 int *services_supported);
7442 * @fn int bluetooth_proximity_reporter_register();
7444 * @brief Register all proximity related services in BlueZ.
7446 * This function is a synchronous call.
7448 * @return BLUETOOTH_ERROR_NONE - Success \n
7449 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7455 int bluetooth_proximity_reporter_register(void);
7458 * @fn int bluetooth_proximity_reporter_unregister();
7460 * @brief Unregister all proximity related services in BlueZ.
7462 * This function is a synchronous call.
7464 * @return BLUETOOTH_ERROR_NONE - Success \n
7465 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7471 int bluetooth_proximity_reporter_unregister(void);
7474 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7475 * bluetooth_pxp_poperty_t property, int *value);
7477 * @brief Reads the Proximity alert level/properties for reporter role.
7479 * This function is a synchronous call.
7481 * @return BLUETOOTH_ERROR_NONE - Success \n
7482 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7483 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7484 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7487 * @param[in] device_address remote device address
7488 * @param[in] property proximity profile property
7489 * @param[out] value alert level/property value
7493 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7494 bluetooth_pxp_poperty_t property, int *value);
7497 * @fn int bluetooth_tds_provider_register(void);
7499 * @brief Register Transport Discovery Provider role.
7501 * This function is a synchronous call.
7503 * @return BLUETOOTH_ERROR_NONE - Success \n
7504 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7505 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7506 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7514 int bluetooth_tds_provider_register(void);
7517 * @fn int bluetooth_tds_provider_unregister(void);
7519 * @brief Unregister Transport Discovery Provider role.
7521 * This function is a synchronous call.
7523 * @return BLUETOOTH_ERROR_NONE - Success \n
7524 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7525 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7526 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7534 int bluetooth_tds_provider_unregister(void);
7537 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7539 * @brief Create Transport Discovery Provider for a transport.
7541 * This function is a synchronous call.
7543 * @return BLUETOOTH_ERROR_NONE - Success \n
7544 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7545 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7546 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7549 * @param[in] Transport (BT, CUSTOM etc.)
7550 * @param[in] Unique handle for TDS provider.
7555 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7558 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7560 * @brief Remove previously created Transport Discovery Provider.
7562 * This function is a synchronous call.
7564 * @return BLUETOOTH_ERROR_NONE - Success \n
7565 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7568 * @param[in] Unique handle for previously created provider.
7573 int bluetooth_tds_provider_destroy(unsigned int handle);
7576 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7578 * @brief Set transport block for in advertisement and gatt db.
7580 * This function is a synchronous call.
7582 * @return BLUETOOTH_ERROR_NONE - Success \n
7583 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7584 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7585 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7588 * @param[in] Provider specific manufacturer data.
7589 * @param[in] Provider specific manufacturer data length.
7594 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7597 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7598 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7600 * @brief Set transport block for in advertisement and gatt db.
7602 * This function is a synchronous call.
7604 * @return BLUETOOTH_ERROR_NONE - Success \n
7605 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7606 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7607 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7610 * @param[in] Unique handle for TDS provider.
7611 * @param[in] Transport state (On/Off/Not Available).
7612 * @param[in] Transport specific data block.
7613 * @param[in] Transport specific data block length.
7618 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7619 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7622 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7623 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7625 * @brief Send response to TDS activation request from remoted device.
7627 * This function is a synchronous call.
7629 * @return BLUETOOTH_ERROR_NONE - Success \n
7630 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7631 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7632 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7635 * @param[in] Remote device BT address.
7636 * @param[in] Unique handle for TDS provider.
7637 * @param[in] Response for TDS activation request.
7638 * @param[in] Transport specific data block to be sent in activation response.
7639 * @param[in] Data block length.
7644 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7645 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7648 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7650 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7652 * This function is an asynchronous call.
7654 * @return BLUETOOTH_ERROR_NONE - Success \n
7655 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7656 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7657 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7658 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7661 * @param[in] device_address remote device address
7662 * @param[in] handle attribute handle
7664 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7665 * when TDS data is received from Remote provider
7667 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7668 const char *handle);
7671 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7673 * @brief Enables CCCD on Remote Provider.
7675 * This function is an asynchronous call.
7677 * @return BLUETOOTH_ERROR_NONE - Success \n
7678 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7679 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7680 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7681 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7684 * @param[in] device_address remote device address
7685 * @param[in] handle attribute handle
7687 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7688 * when Indication is enabled on Remote provider
7690 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7691 const char *handle);
7694 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7695 * unsigned char *buf, int length);
7696 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7698 * This function is an asynchronous call.
7700 * @return BLUETOOTH_ERROR_NONE - Success \n
7701 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7702 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7703 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7704 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7707 * @param[in] device_address remote device address
7708 * @param[in] handle attribute handle
7709 * @param[in] buf Control point activation param
7710 * @param[in] param length
7712 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7713 * is received from remote Provider
7715 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7716 unsigned char *buf, int length);
7719 * @fn int bluetooth_otp_server_init(const char *directory);
7721 * @brief Starts OTP server.
7723 * This function is a synchronous call.
7733 int bluetooth_otp_server_init(const char *directory);
7736 * @fn int bluetooth_otp_server_deinit();
7738 * @brief Stops OTP server.
7740 * This function is a synchronous call.
7750 int bluetooth_otp_server_deinit();
7753 * @fn int bluetooth_otp_enable_notification(const char *handle);
7755 * @brief Enable notification for remote OACP & OLCP characteristics.
7757 * This function is a synchronous call.
7767 int bluetooth_otp_enable_notification(const char *handle);
7770 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7771 * unsigned char *buf, int length);
7773 * @brief Write value on remote characteristics.
7775 * This function is a synchronous call.
7785 int bluetooth_otp_write_characteristics_value(const char *handle,
7786 unsigned char *buf, int length);
7789 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7791 * @brief Read value for remote characteristics.
7793 * This function is a synchronous call.
7803 int bluetooth_otp_read_characteristic_value(const char *handle);
7806 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7808 * @brief Read value for remote characteristics.
7810 * This function is a synchronous call.
7820 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7823 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7825 * @brief Read value for remote characteristics.
7827 * This function is a synchronous call.
7837 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7840 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7841 * @brief Check if Adapter supports LE 2M PHY feature or not.
7843 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7844 * in BT 5.0 specification.
7846 * This function is a synchronous call.
7848 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7849 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7850 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7851 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7852 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7856 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7859 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7860 * @brief Check if Adapter supports LE 2M CODED feature or not.
7862 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7863 * in BT 5.0 specification.
7865 * This function is a synchronous call.
7867 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7868 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7869 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7870 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7871 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
7875 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
7883 #endif /* __cplusplus */
7884 #endif /* _BLUETOOTH_API_H_*/