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_t;
1235 * LE connection mode
1238 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1239 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1240 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1241 } bluetooth_le_connection_mode_t;
1244 * structure to hold the device information
1247 bluetooth_device_address_t device_address; /**< device address */
1248 bluetooth_device_name_t device_name; /**< device name */
1249 bluetooth_device_class_t device_class; /**< device class */
1250 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1251 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1253 int rssi; /**< received strength signal*/
1254 gboolean paired; /**< paired flag */
1255 bluetooth_connected_link_t connected; /**< connected link type */
1256 gboolean trust; /**< trust flag */
1257 gboolean is_alias_set; /** is device alias set flag**/
1258 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1259 } bluetooth_device_info_t;
1262 * structure to hold the LE device information
1265 int data_len; /**< manafacturer specific data length */
1266 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1267 } bluetooth_le_advertising_data_t;
1270 bluetooth_device_address_t device_address; /**< device address */
1271 int addr_type; /**< address type*/
1272 int rssi; /**< received strength signal*/
1273 bluetooth_le_advertising_data_t adv_ind_data;
1274 bluetooth_le_advertising_data_t scan_resp_data;
1275 } bluetooth_le_device_info_t;
1279 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1280 bluetooth_device_address_t device_address; /**< device address */
1281 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1282 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1283 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1284 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1285 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1286 bluetooth_le_advertising_data_t service_data; /**< service data */
1287 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1288 int manufacturer_id; /**< manufacturer ID */
1289 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1290 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1291 } bluetooth_le_scan_filter_t;
1294 bluetooth_device_address_t device_address; /**< device address */
1295 unsigned int mtu; /** < MTU set for the ATT connection */
1296 unsigned int status; /** < status of the MTU exchange */
1297 } bluetooth_le_att_mtu_info_t;
1300 * structure to hold the paired device information
1303 bluetooth_device_address_t device_address; /**< paired device address */
1304 bluetooth_device_name_t device_name; /**< device name */
1305 bluetooth_device_class_t device_class; /**< device class */
1306 } bluetooth_paired_device_info_t;
1309 * structure to hold the paired device information
1312 bluetooth_device_address_t device_address;
1313 /**< device address */
1314 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1315 /**< network interface name */
1316 } bluetooth_network_device_info_t;
1319 * Authentication event types
1323 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1324 BLUETOOTH_AUTH_PIN_REQUEST,
1325 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1326 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1327 } bluetooth_auth_type_t;
1330 * structure to hold the pincode/pass-key req informations
1333 bluetooth_device_address_t device_address; /**< remote device address */
1334 bluetooth_device_name_t device_name; /**< device name */
1335 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1336 bool incoming; /**< stores if bonding request is incoming */
1337 } bluetooth_authentication_request_info_t;
1340 * Stucture to hold discovery option
1343 unsigned short max_response; /**< the number of maximum response */
1344 unsigned short discovery_duration;
1345 /**< duration of discovery (seconds) */
1346 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1347 classOfDevice variable */
1348 } bluetooth_discovery_option_t;
1351 * Stucture to hold event information
1354 int event; /**< event type */
1355 int result; /**< Success or error value */
1357 /**<parameter data pointer */
1359 } bluetooth_event_param_t;
1362 bluetooth_device_address_t device_addr;
1363 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1364 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1365 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1370 bluetooth_device_address_t device_addr;
1371 unsigned char addr_type;
1374 } bt_connection_info_t;
1377 * Stucture to rfcomm receive data
1382 /**< the socket fd */
1383 int buffer_size;/**< the length of the receive buffer */
1385 /**< the receive data buffer */
1386 } bluetooth_rfcomm_received_data_t;
1392 HTYPE_TRANS_HANDSHAKE,
1393 HTYPE_TRANS_HID_CONTROL,
1394 HTYPE_TRANS_GET_REPORT,
1395 HTYPE_TRANS_SET_REPORT,
1396 HTYPE_TRANS_GET_PROTOCOL,
1397 HTYPE_TRANS_SET_PROTOCOL,
1399 HTYPE_TRANS_UNKNOWN,
1400 HTYPE_TRANS_GET_IDLE = 0xF0,
1401 HTYPE_TRANS_SET_IDLE = 0xF1,
1402 } bt_hid_header_type_t;
1408 PTYPE_DATA_RTYPE_INPUT,
1409 PTYPE_DATA_RTYPE_OUTPUT
1410 } bt_hid_param_type_t;
1413 * Stucture to hid receive data
1416 const char *address;
1417 bt_hid_header_type_t type;
1418 /**< Header type containing */
1419 bt_hid_param_type_t param;
1420 /**< Param type in header like INPUT Report or OutPut Report */
1421 int buffer_size;/**< the length of the receive buffer */
1423 /**< the receive data buffer */
1424 } bluetooth_hid_received_data_t;
1427 * Stucture to rfcomm connection
1431 int socket_fd; /**< the socket fd */
1432 int server_id; /* Server id */
1433 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1434 bluetooth_device_address_t device_addr;
1435 /**< device address */
1436 char uuid[BLUETOOTH_UUID_STRING_MAX];
1437 } bluetooth_rfcomm_connection_t;
1440 * Stucture to rfcomm disconnection
1444 /**< the socket fd */
1445 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1446 bluetooth_device_address_t device_addr;
1447 /**< device address */
1448 char uuid[BLUETOOTH_UUID_STRING_MAX];
1449 } bluetooth_rfcomm_disconnection_t;
1453 /**< the socket fd */
1454 bluetooth_device_address_t device_addr;
1455 /**< device address */
1456 } bluetooth_rfcomm_connection_request_t;
1465 } bt_hdp_qos_type_t;
1471 HDP_ROLE_SOURCE = 0x0,
1473 } bt_hdp_role_type_t;
1477 * Stucture to HDP connected
1480 const char *app_handle; /**< the application handle */
1481 unsigned int channel_id; /**< the channel id */
1482 bt_hdp_qos_type_t type; /**< the QOS type */
1483 bluetooth_device_address_t device_address; /**< the remote address */
1484 } bt_hdp_connected_t;
1487 * Stucture to HDP disconnected
1490 unsigned int channel_id; /**< the channel id */
1491 bluetooth_device_address_t device_address; /**< the remote address */
1492 } bt_hdp_disconnected_t;
1495 * Stucture to HDP data indication
1498 unsigned int channel_id; /**< the channel id */
1499 const char *buffer; /**< the RX data buffer */
1500 unsigned int size; /**< the RX data size */
1501 } bt_hdp_data_ind_t;
1504 * Stucture to OPP client transfer information
1511 } bt_opc_transfer_info_t;
1513 /* TODO: MAP client structures, see above */
1515 * Stucture to Map filter fields
1520 } bt_map_list_filter_fields_info_t;
1522 /* Obex Server transfer type */
1523 #define TRANSFER_PUT "PUT"
1524 #define TRANSFER_GET "GET"
1526 * Stucture to OPP/FTP Server authorize information
1533 } bt_obex_server_authorize_into_t;
1541 } bt_obex_server_type_t;
1544 * Stucture to OPP/FTP server transfer information
1552 unsigned long file_size;
1554 bt_obex_server_type_t server_type;
1556 unsigned char *contact_auth_info;
1557 } bt_obex_server_transfer_info_t;
1560 * Stucture to OPP/FTP server connection/disconnection information
1566 } bt_obex_server_connection_info_t;
1570 * Stucture to OOB data
1574 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1575 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1576 unsigned int hash_len;
1577 unsigned int randomizer_len;
1579 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1580 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1581 unsigned int hash256_len;
1582 unsigned int randomizer256_len;
1584 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1585 unsigned int eir_len;
1589 * Structure to GATT attribute handle data
1595 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1596 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1597 } bt_gatt_handle_info_t;
1600 * Structure to a most basic GATT attribute handle data
1604 unsigned char uuid[16];
1605 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1606 } bt_gatt_handle_property_t;
1609 * Structure to GATT Remote service data
1616 bt_gatt_handle_info_t include_handles;
1617 bt_gatt_handle_info_t char_handle;
1618 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1619 } bt_gatt_service_property_t;
1622 * Structure to GATT Remote characteristic data
1626 char *service_handle;
1627 bt_gatt_handle_info_t handle_info;
1628 } bt_gatt_discovered_char_t;
1631 * Structure to format of GATT Characteristic Value
1635 unsigned char format;
1636 unsigned char exponent;
1637 unsigned short unit;
1638 unsigned char name_space;
1639 unsigned short description;
1640 } bt_gatt_char_format_t;
1643 * Structure to GATT Characteristic property
1651 bt_gatt_char_format_t format;
1653 unsigned int val_len;
1654 unsigned int permission;
1655 char *representation;
1656 bt_gatt_handle_info_t char_desc_handle;
1657 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1658 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1659 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1660 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1661 } bt_gatt_char_property_t;
1664 * Structure to GATT Characteristic descriptor property
1671 unsigned int val_len;
1672 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1673 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1674 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1675 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1676 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1677 } bt_gatt_char_descriptor_property_t;
1680 * Structure to GATT Characteristic value
1687 } bt_gatt_char_value_t;
1690 unsigned char UUID[16];
1694 } bt_gatt_notify_req_t ;
1697 * Structure to GATT Read Request
1701 char *service_handle;
1705 } bt_gatt_read_req_t;
1708 * Structure to GATT Value change
1712 char *service_handle;
1715 gboolean response_needed;
1719 } bt_gatt_value_change_t;
1722 bluetooth_device_address_t device_addr;
1724 bluetooth_gatt_service_change_type_t change_type;
1727 } bt_gatt_service_change_t;
1730 * Structure to GATT characteristc Notification change
1734 char *service_handle;
1735 gboolean att_notify;
1736 } bt_gatt_char_notify_change_t;
1739 * Structure to Indication confirmation
1743 char *service_handle;
1746 } bt_gatt_indicate_confirm_t;
1749 * Structure for GATT response data
1756 } bt_gatt_resp_data_t;
1759 * Structure to RSSI Signal Strength Alert
1770 * Structure to RSSI Signal Strength
1780 * Structure for RSSI Enabled or Disabled
1786 gboolean rssi_enabled;
1787 } bt_rssi_enabled_t;
1790 * Structure for RSSI Threshold
1795 int in_range_threshold;
1797 } bt_rssi_threshold_t;
1801 * Structure for Suppoted Profiles and Trusted Profiles
1808 } bt_supported_profile_trusted_t;
1811 * Structure for PBAP Folder Parameters
1814 unsigned char addressbook;
1815 unsigned char folder_type;
1819 * Structure for PBAP Pull application Parameters
1822 unsigned char format;
1823 unsigned char order;
1824 unsigned short offset;
1825 unsigned short maxlist;
1826 long long unsigned fields;
1827 } bt_pbap_pull_parameters_t;
1830 * Structure for PBAP List application Parameters
1833 unsigned char order;
1834 unsigned short offset;
1835 unsigned short maxlist;
1836 } bt_pbap_list_parameters_t;
1839 * Structure for PBAP Pull vCard application Parameters
1842 unsigned char format;
1843 long long unsigned fields;
1845 } bt_pbap_pull_vcard_parameters_t;
1848 * Structure for PBAP Search application Parameters
1851 unsigned char order;
1852 unsigned short offset;
1853 unsigned short maxlist;
1854 unsigned char search_attribute;
1855 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1856 } bt_pbap_search_parameters_t;
1859 * Structure for PBAP Connection Status
1862 bluetooth_device_address_t btaddr;
1864 } bt_pbap_connected_t;
1867 * Structure for PBAP Phonebook Size
1870 bluetooth_device_address_t btaddr;
1872 } bt_pbap_phonebook_size_t;
1875 * Structure for PBAP Phonebook Pull
1878 bluetooth_device_address_t btaddr;
1881 } bt_pbap_phonebook_pull_t;
1884 * Structure for PBAP vCard List
1887 bluetooth_device_address_t btaddr;
1891 } bt_pbap_vcard_list_t;
1894 * Structure for PBAP vCard Pull
1897 bluetooth_device_address_t btaddr;
1900 } bt_pbap_vcard_pull_t;
1903 * Structure for PBAP Phonebook search List
1906 bluetooth_device_address_t btaddr;
1910 } bt_pbap_phonebook_search_list_t;
1913 * Stucture to HF Call status information
1917 char *number; /*Phone Number */
1918 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1919 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1920 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1921 int idx; /*Call index/ID */
1922 } bt_hf_call_status_info_t;
1927 } bt_hf_call_list_s;
1933 TRUSTED_PROFILE_PBAP = 1,
1934 TRUSTED_PROFILE_MAP,
1935 TRUSTED_PROFILE_SAP,
1936 TRUSTED_PROFILE_HFP_HF,
1937 TRUSTED_PROFILE_A2DP,
1938 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1939 } bluetooth_trusted_profile_t;
1942 * Structure for LE data length change params
1945 bluetooth_device_address_t device_address;
1946 guint16 max_tx_octets;
1947 guint16 max_tx_time;
1948 guint16 max_rx_octets;
1949 guint16 max_rx_time;
1950 } bt_le_data_length_params_t;
1953 * Structure for proximity property change params
1956 bluetooth_device_address_t device_address;
1960 } bt_pxp_property_changed_params_t;
1963 * @brief DPM BT allowance state
1967 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1968 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1969 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1970 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1974 * @brief DPM API result
1978 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1979 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1980 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1981 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1982 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1983 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1987 * @brief DPM Policy status
1991 BLUETOOTH_DPM_STATUS_ERROR = -1,
1993 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1994 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1996 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1997 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1999 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2000 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2004 /* policy-group : BLUETOOTH */
2005 BLUETOOTH_DPM_POLICY_ALLOW,
2006 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2007 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2008 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
2009 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
2010 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
2011 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
2012 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2013 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2014 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2015 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2016 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2017 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2018 BLUETOOTH_DPM_POLICY_END,
2019 } bt_dpm_policy_cmd_t;
2022 struct bt_dpm_policy {
2028 typedef struct bt_dpm_policy bt_dpm_policy_t;
2031 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2032 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2033 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2034 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2035 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2036 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2037 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2038 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2039 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2040 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2041 BLUETOOTH_DPM_PROFILE_NONE,
2044 struct bt_dpm_profile_val {
2045 int value; /* tells whether the profile is enabled or disabled */
2047 typedef struct dpm_profile_val dpm_profile_state_t;
2050 * Structure to DPM device list
2054 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2055 } bt_dpm_device_list_t;
2058 * Structure to DPM uuid list
2062 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2063 } bt_dpm_uuids_list_t;
2066 * Structure for IPSP Interface Info
2069 bluetooth_device_address_t btaddr;
2071 } bt_ipsp_connection_info_t;
2075 char* remote_address;
2076 } bt_map_client_session_info_s;
2078 typedef char* bt_map_client_message_object_t;
2083 } bt_map_client_list_folders_filter_t;
2088 int8_t subject_length;
2097 } bt_map_client_list_messages_filter_t;
2100 bt_map_client_message_object_t message_object;
2105 char *sender_address;
2108 char *recipient_address;
2113 int64_t attachment_size;
2118 } bt_map_client_message_item_t;
2124 } bt_map_client_push_message_args_t;
2131 char *sender_address;
2134 char *recipient_address;
2143 } bt_map_client_message_t;
2146 char **names; // holding %size null-terminated folder names
2148 } bt_map_client_folders_s;
2151 bt_map_client_message_item_t *message_items;
2153 } bt_map_client_message_items_s;
2156 const char* target_file;
2158 } bt_get_message_callback_data;
2161 * Callback pointer type
2163 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2166 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2167 * @brief Set the callback function pointer for bluetooth event
2170 * This API will register the callback function, when any response and event are received from
2171 * bluetooth framework. @n
2172 * this registered callback function will be get called with appropriate event and data structures.
2173 * This function is a synchronous call. An application developer can call
2174 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2175 * type. This registered function will receive events of bluetooth_event_type_t type along with
2179 * @param[in] callback_ptr A pointer to the callback function
2180 * @param[in] user_data A pointer to user data
2181 * @return BLUETOOTH_ERROR_NONE - Success
2185 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2187 GMainLoop *main_loop = (GMainLoop*) user_data;
2191 // Code for each event
2193 g_main_loop_quit(main_loop);
2200 GMainLoop *main_loop = NULL;
2203 main_loop = g_main_loop_new(NULL, FALSE);
2204 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2205 if (ret >= BLUETOOTH_ERROR_NONE)
2207 // bluetooth_register_callback returned Success
2211 // bluetooth_register_callback returned failiure
2213 g_main_loop_run(main_loop);
2217 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2220 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2221 * @brief Set the callback function pointer for bluetooth le event
2224 * This API will register the callback function, when any response and event are received from
2225 * bluetooth framework. @n
2226 * this registered callback function will be get called with appropriate event and data structures.
2227 * This function is a synchronous call. An application developer can call
2228 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2229 * type. This registered function will receive events of bluetooth_event_type_t type along with
2233 * @param[in] callback_ptr A pointer to the callback function
2234 * @param[in] user_data A pointer to user data
2235 * @return BLUETOOTH_ERROR_NONE - Success
2239 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2242 * @fn int bluetooth_le_unregister_callback(void)
2243 * @brief Set the callback function pointer for bluetooth le event
2246 * This API will register the callback function, when any response and event are received from
2247 * bluetooth framework. @n
2248 * this registered callback function will be get called with appropriate event and data structures.
2249 * This function is a synchronous call. An application developer can call
2250 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2251 * type. This registered function will receive events of bluetooth_event_type_t type along with
2256 * @return BLUETOOTH_ERROR_NONE - Success
2260 int bluetooth_le_unregister_callback(void);
2263 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2264 * @brief Set the callback function pointer for bluetooth event
2267 * This API will register the callback function, when any response and event are received from
2268 * bluetooth framework. @n
2269 * this registered callback function will be get called with appropriate event and data structures.
2270 * This function is a synchronous call. An application developer can call
2271 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2272 * type. This registered function will receive events of bluetooth_event_type_t type along with
2277 * @return BLUETOOTH_ERROR_NONE - Success
2281 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2283 GMainLoop *main_loop = (GMainLoop*) user_data;
2287 // Code for each event
2289 g_main_loop_quit(main_loop);
2296 GMainLoop *main_loop = NULL;
2299 main_loop = g_main_loop_new(NULL, FALSE);
2300 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2301 if (ret >= BLUETOOTH_ERROR_NONE)
2303 // bluetooth_register_callback returned Success
2307 // bluetooth_register_callback returned failiure
2309 ret = bluetooth_deregister_callback(void);
2310 g_main_loop_run(main_loop);
2314 int bluetooth_unregister_callback(void);
2317 * @fn int bluetooth_enable_adapter(void)
2318 * @brief Enable the Bluetooth H/W
2321 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2322 * send request to bluetooth chip for activation.
2323 * This function is typically called at startup or when Bluetooth services are required. This
2324 * function must be called before calling any other API of Bluetooth operations.
2326 * Before performing any operations like Device discover, service search etc.., the adapter must be
2329 * This function is a asynchronous call.
2330 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2331 * through registered callback function with appropriate result code
2332 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2333 * BLUETOOTH_ERROR_NONE - Success \n
2335 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2336 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2338 * @return BLUETOOTH_ERROR_NONE - Success\n
2339 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2340 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2341 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2342 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2344 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2346 void bt_event_callback(int event, bluetooth_event_param_t *param)
2350 case BLUETOOTH_EVENT_ENABLED:
2351 if (param->result == BLUETOOTH_ERROR_NONE)
2353 // Successfully Enabled
2366 ret = bluetooth_enable_adapter();
2370 int bluetooth_enable_adapter(void);
2373 * @fn int bluetooth_disable_adapter(void)
2374 * @brief Disable the Bluetooth H/W
2377 * This function disables Bluetooth protocol stack and hardware. This function is called when
2378 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2380 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2381 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2382 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2384 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2387 * This function is a asynchronous call.
2388 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2389 * through registered callback function.
2392 * @return BLUETOOTH_ERROR_NONE - Success\n
2393 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2394 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2395 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2397 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2399 void bt_event_callback(int event, bluetooth_event_param_t *param)
2403 case BLUETOOTH_EVENT_DISABLED:
2404 if (param->result == BLUETOOTH_ERROR_NONE)
2406 // Successfully disabled
2419 ret = bluetooth_disable_adapter();
2422 int bluetooth_disable_adapter(void);
2423 int bluetooth_read_battery_data(bt_battery_data *latest);
2424 int bluetooth_set_battery_monitor_state(bool state);
2425 int bluetooth_get_battery_monitor_state(void);
2426 int bluetooth_recover_adapter(void);
2427 int bluetooth_check_adapter_le(void);
2428 int bluetooth_enable_adapter_le(void);
2430 int bluetooth_disable_adapter_le(void);
2431 int bluetooth_get_uuid_name(const char *uuid, char **name);
2434 * @fn int bluetooth_reset_adapter(void)
2435 * @brief Reset the Bluetooth H/W and values
2438 * This function resets Bluetooth protocol stack and hardware. This function is called when
2439 * an user want to initialize Bluetooth environment.
2441 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2444 * This function is a synchronous call.
2446 * @return BLUETOOTH_ERROR_NONE - Success\n
2447 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2449 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2454 ret = bluetooth_reset_adapter();
2457 int bluetooth_reset_adapter(void);
2460 * @fn int bluetooth_is_supported(void)
2461 * @brief Check if the bluetooth is supported or not by the current target
2463 * This API checks whether the bluetooth is supported or not.
2464 * This API only run by root permission.
2466 * This function is a synchronous call.
2468 * @return 0 - if bluetooth is not supported\n
2469 * 1 - if bluetooth is supported\n
2470 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2475 ret = bluetooth_is_supported();
2478 int bluetooth_is_supported(void);
2482 * @fn int bluetooth_check_adapter(void)
2483 * @brief Check the current status of the Bluetooth adapter
2486 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2487 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2488 * bluetooth adapter.
2489 * This API get the adapter internal data structure and check current adapter status.
2491 * This function is a synchronous call.
2494 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2495 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2497 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2501 ret = bluetooth_check_adapter();
2504 int bluetooth_check_adapter(void);
2507 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2508 * @brief Get the local adapter bluetooth address
2511 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2512 * the adapter should be enabled.
2513 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2514 * contain Bluetooth address.
2515 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2516 * friendly name for each device.
2517 * There is no event callback for this API.
2519 * This function is a synchronous call.
2522 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2523 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2524 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2525 * @param[out] local_address a device address of local bluetooth adapter
2530 bluetooth_device_address_t local_address={0,};
2533 ret = bluetooth_get_local_address(&local_address);
2536 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2539 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2540 * @brief Get the hci version
2543 * This function is used to get the bluetooth hci version
2544 * Before calling this API make sure that the adapter is enabled.
2546 * This function is a synchronous call.
2549 * @return BLUETOOTH_ERROR_NONE - Success \n
2550 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2551 * @param[out] timeout remain visibility timeout value
2554 bluetooth_version_t *version;
2556 ret = bluetooth_get_local_version (&version);
2559 int bluetooth_get_local_version(bluetooth_version_t *version);
2562 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2563 * @brief Get the local device name
2566 * This function is used, get the local device name. Since its difficult to remember the Adapter
2567 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2568 * friendly name is retrived by the remote device and displaying.
2569 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2571 * This function is a synchronous call.
2574 * @return BLUETOOTH_ERROR_NONE - Success \n
2575 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2576 * @param[out] local_name a local device name
2580 bluetooth_device_name_t local_name={0,}
2582 ret = bluetooth_get_local_name (&local_name);
2585 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2588 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2589 * @brief Set the local device name
2592 * This function is used to set the local device name. This is a human friendly name whose
2593 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2595 * This function is a synchronous call.
2597 * @param[in] local_name bluetooth device name to set local device
2599 * @return BLUETOOTH_ERROR_NONE - Success \n
2600 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2601 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2602 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2603 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2604 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2609 bluetooth_device_name_t local_name={0,}
2611 ret = bluetooth_set_local_name (&local_name);
2614 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2618 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2619 * @brief Check if the uuid is used or not
2621 * This function is used to check if the uuid is used or not.
2623 * This function is a synchronous call.
2625 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2626 * @param[out] used if the uuid is used or not
2628 * @return BLUETOOTH_ERROR_NONE - Success \n
2629 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2630 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2631 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2636 gboolean used = FALSE;
2637 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2638 ret = bluetooth_is_service_used(uuid, &used);
2641 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2644 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2645 * @brief Check if the device is connected to the specific service
2647 * This function is used to check if if the device is connected to the specific service.
2649 * This function is a synchronous call.
2651 * @param[in] local_address a device address of remote bluetooth device
2652 * @param[in] type the service type
2653 * @param[out] is_connected if the device is connected or not
2655 * @return BLUETOOTH_ERROR_NONE - Success \n
2656 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2657 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2658 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2663 gboolean is_connected = FALSE;
2664 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2665 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2668 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2669 bluetooth_service_type_t type,
2670 gboolean *is_connected);
2673 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2674 * @brief Gets device's connected link type
2676 * This function is used to get device's connected link type
2678 * This function is a synchronous call.
2680 * @param[in] device_address a device address of remote bluetooth device
2681 * @param[out] connected_link a device's connected link type
2683 * @return BLUETOOTH_ERROR_NONE - Success \n
2684 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2685 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2686 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2691 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2692 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2693 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2696 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2697 bluetooth_connected_link_t *connected_link);
2700 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2701 * @brief Sets a profile trusted for a device
2703 * This function is used to Set a profile as trusted for a device
2705 * This function is a synchronous call.
2707 * @param[in] device_address a device address of remote bluetooth device
2708 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2709 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2711 * @return BLUETOOTH_ERROR_NONE - Success \n
2712 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2713 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2714 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2718 int bluetooth_set_profile_trusted(
2719 const bluetooth_device_address_t *device_address,
2720 int profile, int trust);
2723 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2724 * @brief Gets a profile is trusted for a device
2726 * This function is used to Get a profile is trusted or not for a device
2728 * This function is a synchronous call.
2730 * @param[in] device_address a device address of remote bluetooth device
2731 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2732 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2734 * @return BLUETOOTH_ERROR_NONE - Success \n
2735 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2736 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2737 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2741 int bluetooth_get_profile_trusted(
2742 const bluetooth_device_address_t *device_address,
2743 int profile, int *trust);
2746 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2747 * @brief Get the visibility mode
2750 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2751 * visibity mode, the property of the device is determined whether it can be discoverable, non
2752 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2754 * This function is a synchronous call.
2757 * @return BLUETOOTH_ERROR_NONE - Success \n
2758 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2759 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2760 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2761 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2762 * @param[out] discoverable_mode current bluetooth discoverable mode
2764 * @see bluetooth_set_discoverable_mode
2766 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2768 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2771 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2774 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2776 * @brief Set the visibility mode
2779 * This function is used to set the discoverable mode (Visibility option).
2781 * Many times user may want to keep his device discoverable so that when peer device is performing
2782 * device search, he/she can find user's device. Application programmer can keep the mode as
2783 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2784 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2785 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2786 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2788 * This function is a synchronous call.
2790 * @return BLUETOOTH_ERROR_NONE - Success \n
2791 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2793 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2794 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2796 * @see bluetooth_get_discoverable_mode
2800 bluetooth_discoverable_mode_t mode;
2802 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2803 ret = bluetooth_set_discoverable_mode (mode, 180);
2807 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2812 * @fn int bluetooth_get_timeout_value(int *timeout)
2813 * @brief Get the visibility timeout value
2816 * This function is used to get the visibility timeout
2817 * Before calling this API make sure that the adapter is enabled.
2819 * This function is a synchronous call.
2822 * @return BLUETOOTH_ERROR_NONE - Success \n
2823 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2824 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2825 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2826 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2827 * @param[out] timeout remain visibility timeout value
2829 * @see bluetooth_set_discoverable_mode
2833 ret = bluetooth_get_timeout_value (&timeout);
2836 int bluetooth_get_timeout_value(int *timeout);
2840 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2841 * unsigned int classOfDeviceMask)
2842 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2844 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2845 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2846 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2847 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2848 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2849 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2850 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2851 * please see bluetooth_device_info_t for more details.
2854 * This API provides searching options like max responses, discovery duration in seconds and class
2855 * of device mask to filter device search. some times there may be too many bluetooth devices in
2856 * vicinity of your device.in such scenario, application can request to reduce number of responces
2857 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2858 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2859 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2860 * application defined time. please note that discovery_duration should be mentioned in seconds.
2861 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2864 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2865 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2866 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2868 * This function is a asynchronous call.
2869 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2870 * through registered callback function.
2872 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2873 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2875 * The completion or cancellation of the discovery is indicated by an
2876 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2878 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2881 * @return BLUETOOTH_ERROR_NONE - Success \n
2882 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2883 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2884 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2885 agent is not running \n
2887 * @param[in] max_response define the maximum response of the number of founded devices
2889 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2890 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2891 (refer to class of device)
2893 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2896 void bt_event_callback(int event, bluetooth_event_param_t *param)
2900 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2902 bluetooth_device_info_t *device_info = NULL;
2903 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2905 device_info = (bluetooth_device_info_t *)param->param_data;
2906 memcpy(&searched_device, &device_info->device_address,
2907 sizeof(bluetooth_device_address_t));
2908 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2909 device_info->device_address.addr[0],
2910 device_info->device_address.addr[1],
2911 device_info->device_address.addr[2],
2912 device_info->device_address.addr[3],
2913 device_info->device_address.addr[4],
2914 device_info->device_address.addr[5]);
2917 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2919 bluetooth_device_info_t *device_info = NULL;
2920 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2922 device_info = (bluetooth_device_info_t *)param->param_data;
2923 memcpy(&searched_device, &device_info->device_address,
2924 sizeof(bluetooth_device_address_t));
2925 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2926 device_info->device_name.name,
2927 device_info->device_address.addr[0],
2928 device_info->device_address.addr[1],
2929 device_info->device_address.addr[2],
2930 device_info->device_address.addr[3],
2931 device_info->device_address.addr[4],
2932 device_info->device_address.addr[5]);
2936 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2937 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2942 unsigned short max_response;
2943 unsigned short discovery_duration;
2944 unsigned classOfDeviceMask;
2948 discovery_duration =0;
2949 classOfDeviceMask =0;
2951 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2956 int bluetooth_start_discovery(unsigned short max_response,
2957 unsigned short discovery_duration,
2958 unsigned int classOfDeviceMask);
2961 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2962 * unsigned short max_response,
2963 * unsigned short discovery_duration,
2964 * unsigned int classOfDeviceMask)
2965 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2967 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2968 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2969 * Please see bluetooth_start_discovery() for other parameters description.
2971 * This function is a asynchronous call.
2972 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2973 * through registered callback function.
2975 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2976 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2978 * The completion or cancellation of the discovery is indicated by an
2979 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2981 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2984 * @return BLUETOOTH_ERROR_NONE - Success \n
2985 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2986 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2987 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2988 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2989 agent is not running \n
2991 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2992 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2993 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2994 * @param[in] max_response define the maximum response of the number of founded devices
2996 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2997 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2998 (refer to class of device)
3000 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3003 unsigned short type;
3004 unsigned short max_response;
3005 unsigned short discovery_duration;
3006 unsigned classOfDeviceMask;
3011 discovery_duration =0;
3012 classOfDeviceMask =0;
3014 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3019 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3020 unsigned short max_response,
3021 unsigned short discovery_duration,
3022 unsigned int classOfDeviceMask);
3025 * @fn int bluetooth_cancel_discovery (void)
3026 * @brief Cancel the on-going device discovery operation
3029 * This function stops the on-going device discovery operation. This API has to be called after the
3030 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3031 * the bluetooth_start_discovery API
3033 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3034 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3035 * cancel the discover request once the user received the device to which he wish to connect.
3037 * This function is a asynchronous call.
3038 * If the call is success to cancel discovey then the application will receive
3039 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3040 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3041 * BLUETOOTH_ERROR_NONE
3044 * @return BLUETOOTH_ERROR_NONE - Success \n
3045 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3046 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3047 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3048 other application \n
3049 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3051 * @see bluetooth_start_discovery
3053 void bt_event_callback(int event, bluetooth_event_param_t *param)
3057 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3058 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3067 ret = bluetooth_cancel_discovery();
3070 int bluetooth_cancel_discovery(void);
3073 * @fn int bluetooth_start_le_discovery(void)
3074 * @brief Start the generic device discovery which finds the LE devices.
3076 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3077 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3078 * It try to find LE devices. Bluetooth device address and name are
3079 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3080 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3081 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3082 * please see bluetooth_device_info_t for more details.
3084 * This function is a asynchronous call.
3085 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3086 * through registered callback function.
3088 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3091 * The completion or cancellation of the discovery is indicated by an
3092 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3094 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3097 * @return BLUETOOTH_ERROR_NONE - Success \n
3098 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3099 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3100 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3101 agent is not running \n
3104 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3107 void bt_event_callback(int event, bluetooth_event_param_t *param)
3111 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3113 bluetooth_device_info_t *device_info = NULL;
3114 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3116 device_info = (bluetooth_device_info_t *)param->param_data;
3117 memcpy(&searched_device, &device_info->device_address,
3118 sizeof(bluetooth_device_address_t));
3119 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3120 device_info->device_address.addr[0],
3121 device_info->device_address.addr[1],
3122 device_info->device_address.addr[2],
3123 device_info->device_address.addr[3],
3124 device_info->device_address.addr[4],
3125 device_info->device_address.addr[5]);
3129 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3130 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3136 ret = bluetooth_start_discovery();
3141 int bluetooth_start_le_discovery(void);
3144 * @fn int bluetooth_stop_le_discovery (void)
3145 * @brief Cancel the on-going device LE discovery operation
3148 * This function stops the on-going device discovery operation. This API has to be called after the
3149 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3150 * the bluetooth_start_le_discovery API
3153 * This function is a asynchronous call.
3154 * If the call is success to cancel discovey then the application will receive
3155 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3156 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3157 * BLUETOOTH_ERROR_NONE
3160 * @return BLUETOOTH_ERROR_NONE - Success \n
3161 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3162 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3163 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3164 other application \n
3165 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3167 * @see bluetooth_start_discovery
3169 void bt_event_callback(int event, bluetooth_event_param_t *param)
3173 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3174 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3183 ret = bluetooth_stop_le_discovery();
3186 int bluetooth_stop_le_discovery(void);
3189 * @fn int bluetooth_is_discovering(void)
3190 * @brief Check for the device discovery is in-progress or not.
3192 * This API is used to check the current status of the Discovery operation.If discovery is in\
3193 * progress normally other operations are not allowed.
3194 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3195 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3196 * event before performing other operations. This API is used to get for the current discovery
3197 * operation status and using bluetooth_cancel_discovery()
3198 * we can cancell the ongoing discovery process.
3199 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3202 * This function checks whether the device discovery is started or not.
3204 * This function is a synchronous call.
3207 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3208 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3209 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3212 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3216 ret = bluetooth_is_discovering ();
3219 int bluetooth_is_discovering(void);
3222 * @fn int bluetooth_is_le_discovering(void)
3223 * @brief Check for the device LE discovery is in-progress or not.
3225 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3226 * progress normally other operations are not allowed.
3227 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3228 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3229 * event before performing other operations. This API is used to get for the current discovery
3230 * operation status and using bluetooth_stop_le_discovery()
3231 * we can cancell the ongoing LE discovery process.
3232 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3235 * This function checks whether the device LE discovery is started or not.
3237 * This function is a synchronous call.
3240 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3241 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3242 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3245 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3249 ret = bluetooth_is_le_discovering ();
3252 int bluetooth_is_le_discovering(void);
3255 * @fn int bluetooth_is_le_scanning(void)
3256 * @brief Check for the device LE scan is in-progress or not.
3258 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3259 * progress normally other operations are not allowed.
3261 * This function checks whether the device LE Scan is started or not.
3263 * This function is a synchronous call.
3265 * @return TRUE - LE Scan in progress \n
3266 * FALSE - LE Scan is not in progress \n
3271 gboolean is_le_scanning = 0;
3272 is_le_scanning = bluetooth_is_le_scanning ();
3275 gboolean bluetooth_is_le_scanning(void);
3277 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3280 * @fn int bluetooth_force_hcidump(int timeout)
3281 * @brief Enable /disable force-hcidump
3283 * This function control force-hcidump.
3285 * This function is a synchronous call.
3287 * @return BLUETOOTH_ERROR_NONE - Success \n
3288 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3289 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3291 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3296 int bluetooth_force_hcidump(int timeout);
3299 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3300 * @brief Register scan filter.
3302 * This function registers the scan filter.
3304 * This function is a synchronous call.
3306 * @return BLUETOOTH_ERROR_NONE - Success \n
3308 * @param[in] filter scan filter to register
3312 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3315 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3316 int link_type, bt_rssi_threshold_t rssi_threshold)
3317 * @brief Enable RSSI monitoring
3319 * This function enables RSSI monitoring and sets threshold for a connection
3321 * @return BLUETOOTH_ERROR_NONE - Success \n
3324 * @see bluetooth_get_rssi_strength
3326 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3327 int link_type, bt_rssi_threshold_t *rssi_threshold);
3330 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3331 * @brief Gets Raw RSSI signal Strength
3333 * This function gives the Raw RSSI signal strength for a connection.
3335 * @return BLUETOOTH_ERROR_NONE - Success \n
3338 * @see bluetooth_enable_rssi
3340 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3342 int bluetooth_set_connectable(gboolean is_connectable);
3344 int bluetooth_is_connectable(gboolean *is_connectable);
3346 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3349 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3350 * @brief Initiate a bonding process
3353 * This function initiates a bonding procedure with a peer device. The bonding procedure
3354 * enables authentication and optionally encryption on the Bluetooth link.
3356 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3357 * inititate the bonding request to the devices already in the paired list.
3359 * Usually we call this API after the device discovery.
3360 * This function is a asynchronous call.
3362 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3363 * mentioed result code
3364 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3365 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3366 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3367 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3368 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3370 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3371 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3374 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3377 * @return BLUETOOTH_ERROR_NONE - Success \n
3378 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3379 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3380 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3381 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3383 * @param[in] device_address This indicates an address of the device with which the pairing
3384 * should be initiated
3386 * @see bluetooth_cancel_bonding
3388 void bt_event_callback(int event, bluetooth_event_param_t *param)
3392 case BLUETOOTH_EVENT_BONDING_FINISHED:
3394 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3395 if (param->result >= BLUETOOTH_ERROR_NONE)
3397 bluetooth_device_info_t *device_info = NULL;
3398 device_info = (bluetooth_device_info_t *)param->param_data;
3399 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3400 mjr[%#x] min[%#x] srv[%#x]",
3401 device_info->device_name.name,
3402 device_info->device_address.addr[0],
3403 device_info->device_address.addr[1],
3404 device_info->device_address.addr[2],
3405 device_info->device_address.addr[3],
3406 device_info->device_address.addr[4],
3407 device_info->device_address.addr[5],
3408 device_info->device_class.major_class,
3409 device_info->device_class.minor_class,
3410 device_info->device_class.service_class);
3424 bluetooth_device_address_t device_address={{0}};
3426 ret = bluetooth_bond_device(&device_address);
3430 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3433 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3434 * bluetooth_conn_type_t conn_type)
3435 * @brief Initiate a bonding process
3438 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3439 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3441 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3442 * inititate the bonding request to the devices already in the paired list.
3444 * Usually we call this API after the device discovery.
3445 * This function is a asynchronous call.
3447 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3448 * mentioed result code
3449 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3450 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3451 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3452 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3453 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3455 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3456 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3459 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3462 * @return BLUETOOTH_ERROR_NONE - Success \n
3463 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3464 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3465 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3466 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3468 * @param[in] device_address This indicates an address of the device with which pairing
3469 * should be initiated
3470 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3473 * @see bluetooth_cancel_bonding
3475 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3476 bluetooth_conn_type_t conn_type);
3479 * @fn int bluetooth_cancel_bonding(void)
3480 * @brief Cancel the on-going bonding process
3482 * This API is called to cancel the on-going bonding procedure. It should be called before the
3483 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3484 * This API is useful when the remote device is not responding to the bond request or we wish to
3485 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3487 * This function is a synchronous call.
3489 * @return BLUETOOTH_ERROR_NONE - Success \n
3490 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3491 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3494 * @see bluetooth_bond_device
3500 ret = bluetooth_cancel_bonding();
3503 int bluetooth_cancel_bonding(void);
3506 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3507 * @brief Remove bonding
3510 * To communicate with remote device over bluetooth link, user should bond with peer device.
3511 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3512 * API is used to remove peer device from the list. Please note that after removing the device
3513 * from bonded device list, you cannot communication with peer device until bonding happens again.
3515 * User can call this function by passing bluetooth device address of any bonded device. Please note
3516 * that after successful return of this function, any bluetooth application running on your device
3517 * will not be able to communicate with unbonded device until bond operation happens again using
3518 * bluetooth_bond_device()
3521 * This function is a asynchronous call. The request to remove the specified device from the bonded
3522 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3523 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3524 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3528 * @return BLUETOOTH_ERROR_NONE - Success \n
3529 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3530 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3531 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3532 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3533 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3534 * agent is not running \n
3535 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3538 * @param[in] device_address This indicates an address of the device to remove bonding
3542 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3545 void bt_event_callback(int event, bluetooth_event_param_t *param)
3548 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3549 bluetooth_device_address_t *dev_addr = NULL;
3551 if (param->result == BLUETOOTH_ERROR_NONE) {
3552 dev_addr = (bluetooth_device_address_t *)param->param_data;
3554 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3555 dev_addr->addr[0], dev_addr->addr[1]
3556 dev_addr->addr[2], dev_addr->addr[3]
3557 dev_addr->addr[4], dev_addr->addr[5]
3568 bluetooth_device_address_t *device_address;
3570 // copy valid device address in device_address
3572 ret = bluetooth_unbond_device(device_address);
3575 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3578 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3579 * @brief Get bonded(paired) device list
3582 * This API gets all bonded device list.
3583 * The devices in the bonded device list further can be used to perform the authorization by calling
3584 * bluetooth_authorize_device API.
3586 * This function is a synchronous call.
3587 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3588 * there is no valid information in the dev_list.
3589 * The len field in the dev_list represents the number of bonded devices. The data structure for
3590 * bonded device information is bluetooth_device_info_t.
3593 * @return BLUETOOTH_ERROR_NONE - Success \n
3594 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3596 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3598 void bt_get_bonded_devices(void)
3602 GPtrArray *devinfo = NULL;
3603 bluetooth_device_info_t *ptr;
3605 // allocate the g_pointer_array
3606 devinfo = g_ptr_array_new();
3608 ret = bluetooth_get_bonded_device_list(&devinfo);
3609 if (ret != BLUETOOTH_ERROR_NONE)
3611 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3615 printf("g pointer arrary count : [%d]", devinfo->len);
3616 for (i=0; i<devinfo->len; i++)
3618 ptr = g_ptr_array_index(devinfo, i);
3621 printf("Name [%s]\n", ptr->device_name.name);
3622 printf("Major Class [%d]\n", ptr->device_class.major_class);
3623 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3624 printf("Service Class [%d]\n", ptr->device_class.service_class);
3625 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3626 ptr->device_address.addr[0],
3627 ptr->device_address.addr[1], ptr->device_address.addr[2],
3628 ptr->device_address.addr[3],
3629 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3636 // free g_pointer_array
3637 g_ptr_array_free(devinfo, TRUE);
3642 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3644 int bluetooth_get_profile_connected_device_list(
3645 const char *profile_uuid, GPtrArray **addr_list);
3648 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3649 * bluetooth_device_info_t *dev_info)
3650 * @brief Get a bonded(paired) device
3653 * This API gets a bonded device.
3655 * This function is a synchronous call.
3656 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3657 * there is no valid information in the dev_info.
3658 * The data structure for bonded device information is bluetooth_device_info_t.
3661 * @return BLUETOOTH_ERROR_NONE - Success \n
3662 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3664 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3666 void bt_get_bonded_device(void)
3670 bluetooth_device_info_t devinfo = {0};
3671 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3673 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3674 if (ret != BLUETOOTH_ERROR_NONE)
3676 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3680 printf("Name [%s]\n", devinfo.device_name.name);
3681 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3682 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3683 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3684 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3685 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3686 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3687 devinfo.device_address.addr[5]);
3696 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3697 bluetooth_device_info_t *dev_info);
3700 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3701 * gboolean *is_alias_set)
3702 * @brief Get is_alias_set property of device
3704 * This API gets is_alias_set property of a bonded device.
3706 * This function is a synchronous call.
3707 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3708 * If not,there is no valid information in the is_alias_set.
3710 * @return BLUETOOTH_ERROR_NONE - Success \n
3711 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3716 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3718 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3721 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3722 gboolean *is_alias_set);
3725 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3726 * @brief set alias for bonded device
3729 * This function set alias for bonded device.
3731 * This function is a synchronous call.
3734 * @return BLUETOOTH_ERROR_NONE - Success \n
3735 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3736 * @param[in] device_address This indicates an address of the remote device
3737 * @param[in] alias This indicates an alias to set
3742 ret = bluetooth_set_alias(&remote_address);
3745 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3749 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3750 * @brief Get remote deivice
3753 * This function gets specific remote device.
3755 * This function is a asynchronous call.
3756 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3759 * @return BLUETOOTH_ERROR_NONE - Success \n
3760 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3761 * @param[in] device_address This indicates an address of the remote device
3766 ret = bluetooth_get_remote_device(&remote_address);
3769 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3772 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3773 * gboolean authorized)
3774 * @brief Authorize/Unauthorize a bonded device
3777 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3778 * with/without user confirmation.
3780 * If we select a paired device and make it authorized by calling this API with the authorized
3781 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3782 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3783 * then it will ask for the user conformation before the connection.
3785 * This API supposed to be called on the paired devices. Which means we have to use this API only
3786 * after successful pairing.
3788 * This function is a asynchronous call.
3789 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3791 * @return BLUETOOTH_ERROR_NONE - Success \n
3792 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3793 * @param[in] device_address This indicates an address of the device to authorize \n
3794 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3796 * @see bluetooth_get_bonded_device_list
3798 void bt_event_callback(int event, bluetooth_event_param_t *param)
3802 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3804 if (param->result == BLUETOOTH_ERROR_NONE)
3808 //device authorization failed failure
3816 bluetooth_device_address_t device_address={{0}};
3817 gboolean authorized;
3821 ret = bluetooth_authorize_device(&device_address,authorized);
3824 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3825 gboolean authorized);
3827 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3828 const bluetooth_device_pin_code_t *pin_code);
3830 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3833 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3835 * @brief Receives Legacy Passkey\pin with following authentication response types
3837 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3838 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3841 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3844 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3846 * @brief This API sends user confirmation reply to the local adapter.
3848 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3851 int bluetooth_passkey_confirmation_reply(gboolean reply);
3854 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3855 * @brief Get all services supported by remote device
3858 * This API call initiates the search for the services supported by the specified device. Normally
3859 * the service search will take a couple of seconds to get it completed. Before calling this API
3860 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3861 * perform the service search. We can get the device address by doing a device discovery operation.
3864 * This function is a asynchronous call.
3865 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3867 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3868 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3869 * event is generated with appropriate result code.
3871 * @return BLUETOOTH_ERROR_NONE - Success \n
3872 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3873 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3874 * @param[in] device_address This indicates an address of the device
3875 * whose services need to be found
3877 * @see bluetooth_cancel_service_search
3879 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3882 * @fn int bluetooth_cancel_service_search(void)
3883 * @brief Cancel the ongoing service search operation
3886 * This function cancel the ongoing service search operation. This API is usually calling after the
3887 * bluetooth_search_service API.
3888 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3889 * if the user wish to cancel the Ongoing service search operation.
3891 * This API should be called just after the bluetooth_search_service API and before the
3892 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3894 * This function is a synchronous call.
3896 * @return BLUETOOTH_ERROR_NONE - Success \n
3897 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3898 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3899 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3902 * @see bluetooth_search_service
3907 ret = bluetooth_cancel_service_search();
3910 int bluetooth_cancel_service_search(void);
3913 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3914 * @brief Register rfcomm socket with a specific uuid
3917 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3918 * descriptor of the server.
3919 * This is the first API which is called to create the server. Once we created the server socket,
3920 * we will listen on that return socket.
3921 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3924 * @return socket FD on Success \n
3925 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3926 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3927 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3928 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3929 * @param[in] UUID (128 bits)
3932 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3936 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3937 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3941 int bluetooth_rfcomm_create_socket(const char *uuid);
3944 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3945 * @brief Register rfcomm socket with a specific uuid
3948 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3949 * descriptor of the server.
3950 * This is the first API which is called to create the server. Once we created the server socket,
3951 * we will listen on that return socket.
3952 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3955 * @return socket FD on Success \n
3956 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3957 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3958 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3959 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3960 * @param[in] UUID (128 bits)
3961 * @param[in] bus_name (const char)
3962 * @param[in] path (const char)
3965 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3969 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3970 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3974 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3977 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3978 * @brief De-register the rfcomm socket
3981 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3982 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3983 * descriptor else no event will come. We will call this API only after the
3984 * bluetooth_rfcomm_listen_and_accept.
3985 * This is a synchronous call.
3987 * @return BLUETOOTH_ERROR_NONE - Success \n
3988 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3989 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3990 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3991 * @param[in] int socket_fd
3994 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3997 void bt_event_callback(int event, bluetooth_event_param_t *param)
4001 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4003 bluetooth_rfcomm_connection_t *discon_ind =
4004 (bluetooth_rfcomm_connection_t *)param->param_data;
4006 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4014 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4015 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4017 ret = bluetooth_rfcomm_remove_socket(fd);
4020 int bluetooth_rfcomm_remove_socket(int socket_fd);
4023 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4024 * @brief De-register the rfcomm socket
4027 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4028 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4029 * descriptor else no event will come. We will call this API only after the
4030 * bluetooth_rfcomm_listen_and_accept_ex.
4031 * This is a synchronous call.
4033 * @return BLUETOOTH_ERROR_NONE - Success \n
4034 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4035 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4036 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4037 * @param[in] UUID (128 bits)
4040 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4043 void bt_event_callback(int event, bluetooth_event_param_t *param)
4047 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4049 bluetooth_rfcomm_connection_t *discon_ind =
4050 (bluetooth_rfcomm_connection_t *)param->param_data;
4052 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4060 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4061 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4063 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4066 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4069 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4070 * @brief Disconnect rfcomm connection
4073 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4074 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4077 * @return BLUETOOTH_ERROR_NONE - Success \n
4078 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4079 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4080 * @param[in] int socket_fd the sending socket fd
4086 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4088 printf("Disconnection failed");
4090 printf("Disconnection Success");
4094 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4097 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4098 * @brief Rfcomm socket listen
4101 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4102 * after the bluetooth_rfcomm_create_socket API.
4103 * This API listen for the incomming connection and once it receives a connection, it will give
4104 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4105 * event to the application. This is an Asynchronous API call.
4108 * @return BLUETOOTH_ERROR_NONE - Success \n
4109 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4110 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4112 * @param[in] int socket_fd
4113 * @param[in] max pending connection.
4116 * @see bluetooth_rfcomm_create_socket
4119 void bt_event_callback(int event, bluetooth_event_param_t* param)
4123 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4125 bluetooth_rfcomm_connection_t *conn_ind =
4126 (bluetooth_rfcomm_connection_t *)param->param_data;
4128 printf("\nConnected from FD %d", conn_ind->socket_fd);
4136 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4137 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4141 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4144 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4145 * @brief Rfcomm socket listen
4148 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4149 * after the bluetooth_rfcomm_create_socket API.
4150 * This API listen for the incomming connection and once it receives a connection, it will give
4151 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4152 * event to the application. This is an Asynchronous API call.
4155 * @return BLUETOOTH_ERROR_NONE - Success \n
4156 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4157 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4159 * @param[in] int socket_fd
4160 * @param[in] max pending connection.
4165 * @see bluetooth_rfcomm_create_socket_ex
4168 void bt_event_callback(int event, bluetooth_event_param_t* param)
4172 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4174 bluetooth_rfcomm_connection_t *conn_ind =
4175 (bluetooth_rfcomm_connection_t *)param->param_data;
4177 printf("\nConnected from FD %d", conn_ind->socket_fd);
4185 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4186 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4191 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4194 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4195 * @brief Rfcomm socket listen
4198 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4199 * after the bluetooth_rfcomm_create_socket API.
4200 * This API listen for the incomming connection and once it receives a connection, it will give
4201 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4202 * event to the application. This is an Asynchronous API call.
4205 * @return BLUETOOTH_ERROR_NONE - Success \n
4206 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4207 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4209 * @param[in] int socket_fd
4210 * @param[in] max pending connection.
4213 * @see bluetooth_rfcomm_create_socket
4216 void bt_event_callback(int event, bluetooth_event_param_t* param)
4220 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4222 char *name = (char *)param->param_data;
4224 printf("\nConnected from %s", name);
4226 bluetooth_rfcomm_accept_connection();
4234 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4235 ret = bluetooth_rfcomm_listen(fd, 1);
4239 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4242 * @fn int bluetooth_rfcomm_accept_connection()
4243 * @brief Accepts the authorization request indicated by the event
4244 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4246 * This function is a synchronous call.
4248 * @return BLUETOOTH_ERROR_NONE - Success \n
4249 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4251 * @param[in] the socket fd of the server
4252 * @param[out] the socket fd of the client
4256 * @see bluetooth_rfcomm_reject_connection
4258 int bluetooth_rfcomm_accept_connection(int server_fd);
4261 * @fn int bluetooth_rfcomm_reject_connection()
4262 * @brief Rejects the authorization request indicated by the event
4263 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4265 * This function is a synchronous call.
4267 * @return BLUETOOTH_ERROR_NONE - Success \n
4268 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4270 * @param[in] the socket fd of the server
4274 * @see bluetooth_rfcomm_accept_connection
4276 int bluetooth_rfcomm_reject_connection(int server_fd);
4279 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4280 * @brief Informs whether rfcomm server uuid is available or not.
4282 * This function is a synchronous call.
4284 * @return TRUE - RFCOMM uuid is available \n
4285 * FALSE - RFCOMM uuid is not available \n
4287 * @param[in] uuid UUID string
4293 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4296 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4297 * const char *remote_uuid)
4298 * @brief Connect to the remote device rfcomm *
4300 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4301 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4302 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4303 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4304 * initiating a connection.
4306 * @return BLUETOOTH_ERROR_NONE - Success \n
4307 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4308 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4309 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4310 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4311 * @param[in] bluetooth_device_address_t remote bt_address
4312 * @param[in] char remote uuid
4314 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4318 void bt_event_callback(int event, bluetooth_event_param_t *param)
4322 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4324 if (param->result >= BLUETOOTH_ERROR_NONE)
4326 bt_sdp_info_t *bt_sdp_info=param->param_data;
4328 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4329 bt_sdp_info->device_addr.addr[0],
4330 bt_sdp_info->device_addr.addr[1],
4331 bt_sdp_info->device_addr.addr[2],
4332 bt_sdp_info->device_addr.addr[3],
4333 bt_sdp_info->device_addr.addr[4],
4334 bt_sdp_info->device_addr.addr[5]);
4336 printf("Supported service list:\n");
4337 for(i=0; i<bt_sdp_info->service_index; i++)
4339 bt_sdp_info->service_list_array[i]);
4342 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4343 //rfcomm_test_uuid);
4347 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4349 bluetooth_rfcomm_connection_t *conn_ind =
4350 (bluetooth_rfcomm_connection_t *)param->param_data;
4352 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4353 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4354 "SERVER" : "CLIENT");
4359 bluetooth_device_address_t remote_address = {{0},};
4360 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4361 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4362 ret = bluetooth_search_service(&remote_address);
4364 printf("Seach failed, Reason = %d", ret);
4366 printf("Search Success, Ret = %d", ret);
4368 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4370 printf("Connection failed, Reason = %d", ret);
4372 printf("Connection Success, Ret = %d", ret);
4376 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4377 const char *remote_uuid);
4380 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4381 * @brief Disconnect rfcomm connection
4384 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4385 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4388 * @return BLUETOOTH_ERROR_NONE - Success \n
4389 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4390 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4391 * @param[in] char remote bt_address
4394 * @see bluetooth_rfcomm_connect
4398 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4400 printf("Disconnection failed");
4402 printf("Disconnection Success");
4407 int bluetooth_rfcomm_disconnect(int socket_fd);
4410 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4411 * @brief Write to rfcomm connection
4414 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4415 * API is used to send the data for server and the client.
4417 * @return BLUETOOTH_ERROR_NONE - Success \n
4418 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4419 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4421 * @param[in] const char *buff Data buffer to send
4422 * @param[in] int length Length of the data
4425 * @see bluetooth_rfcomm_connect
4428 char *buff = "Test data 123456789"
4429 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4431 printf("Send failed");
4433 printf("Send success");
4437 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4440 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4441 * @brief Informs whether rfcomm client is connected.
4443 * This function is a synchronous call.
4445 * @return TRUE - RFCOMM client is connected \n
4446 * FALSE - RFCOMM client is not connected \n
4452 gboolean bluetooth_rfcomm_is_client_connected(void);
4453 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4454 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4457 * @fn int bluetooth_network_activate_server(void)
4458 * @brief Activate the NAP (Network Access Point) service
4460 * This function is a asynchronous call.
4461 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4463 * @return BLUETOOTH_ERROR_NONE - Success \n
4464 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4465 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4469 * @see bluetooth_network_deactivate_server
4472 int bluetooth_network_activate_server(void);
4475 * @fn int bluetooth_network_deactivate_server(void)
4476 * @brief Deactivate the NAP (Network Access Point) service
4478 * This function is a asynchronous call.
4479 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4481 * @return BLUETOOTH_ERROR_NONE - Success \n
4482 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4483 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4484 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4487 * @see bluetooth_network_activate_server
4490 int bluetooth_network_deactivate_server(void);
4493 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4494 * bluetooth_network_role_t role,
4496 * @brief Connect the network server in the peer
4498 * This function is a asynchronous call.
4499 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4501 * @return BLUETOOTH_ERROR_NONE - Success \n
4502 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4503 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4504 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4507 * @param[in] device_address This indicates an address of the device with which the pairing
4508 * should be initiated
4509 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4510 * need to use the third parameter.
4511 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4512 * connect. UUID string
4514 * @see bluetooth_network_disconnect
4516 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4517 bluetooth_network_role_t role, char *custom_uuid);
4520 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4521 * bluetooth_network_role_t role,
4522 * char *custom_uuid)
4523 * @brief Connect the network server in the peer
4525 * This function is a asynchronous call.
4526 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4528 * @return BLUETOOTH_ERROR_NONE - Success \n
4529 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4530 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4531 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4534 * @param[in] device_address This indicates an address of the device with which the pairing
4535 * should be initiated
4537 * @see bluetooth_network_connect
4539 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4542 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4543 * @brief Disconnect the device from the network
4545 * This function is an asynchronous call.
4546 * The network server disconnect request is responded by
4547 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4549 * @return BLUETOOTH_ERROR_NONE - Success \n
4550 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4551 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4552 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4555 * @param[in] device_address This indicates an address of the connected client device
4557 * @see bluetooth_network_activate_server
4559 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4564 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4565 * bt_hdp_role_type_t role,
4566 * bt_hdp_qos_type_t channel_type,
4567 * char **app_handle)
4568 * @brief Activate the HDP service for a particular data type
4570 * This function is a synchronous call.
4572 * @return BLUETOOTH_ERROR_NONE - Success \n
4573 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4574 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4575 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4578 * @param[in] data_type The data type against corresponding service
4579 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4580 * @param[in] channel_type The QOS type for the channel.
4581 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4582 * For role = HDP_ROLE_SINK, the channel_type
4583 * should be HDP_QOS_ANY.
4584 * @param[out] app_handle The application handler against corresponding service
4586 * @see bluetooth_hdp_deactivate
4588 int bluetooth_hdp_activate(unsigned short data_type,
4589 bt_hdp_role_type_t role,
4590 bt_hdp_qos_type_t channel_type,
4593 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4594 * @brief Deactivate the HDP service for a particular service using the handler
4596 * This function is a synchronous call.
4598 * @return BLUETOOTH_ERROR_NONE - Success \n
4599 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4600 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4601 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4604 * @param[in] app_handle The application handler against corresponding service
4606 * @see bluetooth_hdp_deactivate
4608 int bluetooth_hdp_deactivate(const char *app_handle);
4611 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4612 * const char *buffer, unsigned int size)
4613 * @brief Send data to the remote HDP device
4615 * This function is a synchronous call.
4617 * @return BLUETOOTH_ERROR_NONE - Success \n
4618 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4619 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4620 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4621 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4624 * @param[in] channel_id The channel id for the connection.
4625 * @param[in] buffer The pdu buffer.
4626 * @param[in] size Size of the buffer.
4628 * @see bluetooth_hdp_connect
4630 int bluetooth_hdp_send_data(unsigned int channel_id,
4631 const char *buffer, unsigned int size);
4633 * @fn int bluetooth_hdp_connect(const char *app_handle,
4634 * bt_hdp_qos_type_t channel_type,
4635 * const bluetooth_device_address_t *device_address)
4636 * @brief Connect to the remote device(Mainly used by source)
4638 * This function is a asynchronous call.
4639 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4641 * @return BLUETOOTH_ERROR_NONE - Success \n
4642 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4643 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4644 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4645 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4648 * @param[in] app_handle The application handler against corresponding service
4649 * @param[in] channel_type The QOS type for the channel.
4650 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4651 * @param[in] device_address The remote device Bd address.
4654 * @see bluetooth_hdp_disconnect
4656 int bluetooth_hdp_connect(const char *app_handle,
4657 bt_hdp_qos_type_t channel_type,
4658 const bluetooth_device_address_t *device_address);
4660 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4661 * const bluetooth_device_address_t *device_address)
4662 * @brief Disconnect from the remote device(Mainly used by source)
4664 * This function is a asynchronous call.
4665 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4667 * @return BLUETOOTH_ERROR_NONE - Success \n
4668 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4669 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4670 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4671 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4674 * @param[in] channel_id The channel id for the connection.
4675 * @param[in] device_address The remote device Bd address.
4678 * @see bluetooth_hdp_connect
4680 int bluetooth_hdp_disconnect(unsigned int channel_id,
4681 const bluetooth_device_address_t *device_address);
4685 * @fn int bluetooth_opc_init(void)
4686 * @brief Initialize OPP client.
4688 * This function is a synchronous call.
4689 * No event corresponding to this api
4691 * @return BLUETOOTH_ERROR_NONE - Success \n
4692 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4693 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4694 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4695 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4700 * @see bluetooth_opc_deinit
4702 int bluetooth_opc_init(void);
4705 * @fn int bluetooth_opc_deinit(void)
4706 * @brief Deinitialize OPP client.
4708 * This function is a synchronous call.
4709 * No event corresponding to this api
4711 * @return BLUETOOTH_ERROR_NONE - Success \n
4712 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4713 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4718 * @see bluetooth_opc_init
4721 int bluetooth_opc_deinit(void);
4724 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4725 char **file_name_array)
4726 * @brief Send multiple files to a remote device.
4728 * This function is a asynchronous call.
4729 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4731 * @return BLUETOOTH_ERROR_NONE - Success \n
4732 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4733 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4734 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4735 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4736 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4737 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4740 * @param[in] device_address The remote device Bd address.
4741 * @param[in] file_name_array Array of filepaths to be sent.
4744 * @see bluetooth_opc_cancel_push
4747 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4748 char **file_name_array);
4751 * @fn int bluetooth_opc_cancel_push(void)
4752 * @brief Cancels the ongoing file push.
4754 * This function is a asynchronous call.
4755 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4756 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4758 * @return BLUETOOTH_ERROR_NONE - Success \n
4759 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4760 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4765 * @see bluetooth_opc_push_files
4768 int bluetooth_opc_cancel_push(void);
4771 * @fn gboolean bluetooth_opc_session_is_exist(void)
4772 * @brief Informs whether opc session exists or not.
4774 * This function is a synchronous call.
4776 * @return TRUE - OPC session exists \n
4777 * FALSE - OPC session does not exist \n
4785 gboolean bluetooth_opc_session_is_exist(void);
4788 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4789 * @brief Informs whether opc session exists or not.
4791 * This function is a synchronous call.
4793 * @return BLUETOOTH_ERROR_NONE - Success \n
4794 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4795 * BLUETOOTH_ERROR_INTERNAL \n
4798 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4803 int bluetooth_opc_is_sending(gboolean *is_sending);
4806 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4807 int transfer_id, unsigned char *progress)
4808 * @brief Gets the percentage progress for ongoing transfers.
4810 * This function is a synchronous call.
4812 * @return BLUETOOTH_ERROR_NONE - Success \n
4813 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4814 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4817 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4818 * @param[in] transfer_id Transfer ID
4819 * @param[out] progress Percentage Progress
4823 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4824 int transfer_id, unsigned char *progress);
4827 * @fn int bluetooth_obex_server_init(const char *dst_path)
4828 * @brief Initialize OPP and FTP server.
4830 * This function is a synchronous call.
4831 * No event corresponding to this api
4833 * @return BLUETOOTH_ERROR_NONE - Success \n
4834 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4835 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4836 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4837 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4840 * @param[in] dst_path OPS destination file path.
4842 * @see bluetooth_obex_server_deinit
4844 int bluetooth_obex_server_init(const char *dst_path);
4848 * @fn int bluetooth_obex_server_deinit(void)
4849 * @brief Deinitialize OPP and FTP server.
4851 * This function is a synchronous call.
4852 * No event corresponding to this api
4854 * @return BLUETOOTH_ERROR_NONE - Success \n
4855 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4856 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4861 * @see bluetooth_obex_server_init
4863 int bluetooth_obex_server_deinit(void);
4867 * @fn gboolean bluetooth_obex_server_is_activated(void)
4868 * @brief Informs whether obex server is activated or not.
4870 * This function is a synchronous call.
4872 * @return TRUE - OBEX server is activated \n
4873 * FALSE - OBEX server is not activated \n
4880 gboolean bluetooth_obex_server_is_activated(void);
4884 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4885 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4887 * This function is a synchronous call.
4888 * No event corresponding to this api
4890 * @return BLUETOOTH_ERROR_NONE - Success \n
4891 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4892 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4893 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4894 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4898 * @param[in] dst_path OPS destination file path.
4900 * @see bluetooth_obex_server_deinit_without_agent
4902 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4906 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4907 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4909 * This function is a synchronous call.
4910 * No event corresponding to this api
4912 * @return BLUETOOTH_ERROR_NONE - Success \n
4913 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4914 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4919 * @see bluetooth_obex_server_init_without_agent
4921 int bluetooth_obex_server_deinit_without_agent(void);
4925 * @fn int bluetooth_obex_server_accept_connection(void)
4926 * @brief Accepts the authorization request indicated by the event
4927 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4929 * This function is a synchronous call.
4931 * @return BLUETOOTH_ERROR_NONE - Success \n
4932 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4933 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4937 * @see bluetooth_obex_server_reject_authorize
4939 int bluetooth_obex_server_accept_connection(void);
4943 * @fn int bluetooth_obex_server_reject_connection(void)
4944 * @brief Rejects the authorization request indicated by the event
4945 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4947 * This function is a synchronous call.
4949 * @return BLUETOOTH_ERROR_NONE - Success \n
4950 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4951 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4955 * @see bluetooth_obex_server_reject_authorize
4957 int bluetooth_obex_server_reject_connection(void);
4961 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4962 * @brief Accepts the authorization request indicated by the event
4963 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4965 * This function is a asynchronous call.
4966 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4968 * @return BLUETOOTH_ERROR_NONE - Success \n
4969 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4970 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4971 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4974 * @param[in] filename Authorized filename.
4977 * @see bluetooth_obex_server_reject_authorize
4980 int bluetooth_obex_server_accept_authorize(const char *filename);
4983 * @fn int bluetooth_obex_server_reject_authorize(void)
4984 * @brief Reject the authorization request indicated by the event
4985 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4987 * This function is a asynchronous call.
4988 * No event for this api..
4990 * @return BLUETOOTH_ERROR_NONE - Success \n
4991 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4992 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4997 * @see bluetooth_obex_server_accept_authorize
5000 int bluetooth_obex_server_reject_authorize(void);
5003 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5004 * @brief Set the OPS destination file path..
5006 * This function is a asynchronous call.
5007 * No event for this api..
5009 * @return BLUETOOTH_ERROR_NONE - Success \n
5010 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5011 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5012 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5015 * @param[in] dst_path OPS destination file path.
5021 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5024 * @fn int bluetooth_obex_server_set_root(const char *root)
5025 * @brief Set the FTS root folder..
5027 * This function is a asynchronous call.
5028 * No event for this api..
5030 * @return BLUETOOTH_ERROR_NONE - Success \n
5031 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5032 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5033 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5034 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5035 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5038 * @param[in] root FTS root folder.
5044 int bluetooth_obex_server_set_root(const char *root);
5047 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5048 * @brief Cancel the transfer on server
5050 * This function is an asynchronous call.
5051 * If the function call that cancels transfer is successful, the application would receive
5052 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5053 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5054 * the error code will be BLUETOOTH_ERROR_NONE
5056 * @return BLUETOOTH_ERROR_NONE - Success \n
5057 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5058 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5059 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5060 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5063 * @param[in] transfer_id transfer ID
5068 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5072 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5073 * @brief Cancel the transfer on server
5075 * This function is an asynchronous call.
5076 * If the function call that cancels transfer is successful, the application would receive
5077 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5078 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5079 * the error code will be BLUETOOTH_ERROR_NONE
5081 * @return BLUETOOTH_ERROR_NONE - Success \n
5082 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5083 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5084 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5085 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5092 int bluetooth_obex_server_cancel_all_transfers(void);
5096 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5097 * @brief Informs whether obex server is receiving or not.
5099 * This function is a synchronous call.
5101 * @return BLUETOOTH_ERROR_NONE - Success \n
5102 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5103 * BLUETOOTH_ERROR_INTERNAL \n
5106 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5111 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5115 * @fn int bluetooth_map_client_init(void)
5116 * @brief Initialize MAP client.
5118 * This function is a synchronous call.
5119 * No event corresponding to this api
5121 * @return BLUETOOTH_ERROR_NONE - Success \n
5122 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5123 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5124 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5125 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5130 * @see bluetooth_map_client_deinit
5132 int bluetooth_map_client_init(void);
5134 int bluetooth_map_client_deinit(void);
5136 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5138 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5140 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5142 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5143 bt_map_client_list_folders_filter_t *filter);
5146 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5147 * @brief Return all available fields that can be used in Fields filter.
5149 * This function is a asynchronous call.
5151 * @return BLUETOOTH_ERROR_NONE - Success \n
5152 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5153 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5156 * @param[in] session Information about session.
5159 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5161 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5163 bt_map_client_list_messages_filter_t *filter);
5165 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5167 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5168 const char *source_file,
5170 bt_map_client_push_message_args_t *args);
5172 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5173 const bt_map_client_message_object_t message_object,
5174 const char *target_file,
5179 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5180 * @brief Read the local Hash and Randmizer.
5182 * This function is a synchronous call.
5184 * @return BLUETOOTH_ERROR_NONE - Success \n
5185 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5189 * @param[out] local_oob_data - Pointer to the local OOB data
5195 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5199 * @fn int bluetooth_oob_add_remote_data(
5200 * const bluetooth_device_address_t *remote_device_address,
5201 * bluetooth_bdaddr_type_e address_type,
5202 * bt_oob_data_t *oob_data)
5203 * @brief Add/updated the remote device Hash and Randmizer.
5205 * This function is a synchronous call.
5206 * No event for this api..
5208 * @return BLUETOOTH_ERROR_NONE - Success \n
5209 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5212 * @param[in] remote_device_address - Remote device address
5213 * address_type - bdaddr type
5214 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5220 int bluetooth_oob_add_remote_data(
5221 const bluetooth_device_address_t *remote_device_address,
5222 bluetooth_bdaddr_type_e address_type,
5223 bt_oob_data_t *remote_oob_data);
5227 * @fn int bluetooth_oob_remove_remote_data(
5228 * const bluetooth_device_address_t *remote_device_address)
5229 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5231 * This function is a synchronous call.
5232 * No event for this api..
5234 * @return BLUETOOTH_ERROR_NONE - Success \n
5235 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5238 * @param[in] remote_device_address - Remote device address
5244 int bluetooth_oob_remove_remote_data(
5245 const bluetooth_device_address_t *remote_device_address);
5249 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5250 * @brief Read the local Hash and Randmizer.
5252 * This function is a synchronous call.
5254 * @return BLUETOOTH_ERROR_NONE - Success \n
5255 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5259 * @param[out] local_oob_data - Pointer to the local OOB data
5264 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5267 * @fn int bluetooth_le_oob_add_remote_data(
5268 * const bluetooth_device_address_t *remote_device_address,
5269 * bluetooth_bdaddr_type_e address_type,
5270 * bt_oob_data_t *oob_data)
5271 * @brief Add/updated the remote device Hash and Randmizer.
5273 * This function is a synchronous call.
5274 * No event for this api..
5276 * @return BLUETOOTH_ERROR_NONE - Success \n
5277 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5280 * @param[in] remote_device_address - Remote device address
5281 * address_type - bdaddr type
5282 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5287 int bluetooth_le_oob_add_remote_data(
5288 const bluetooth_device_address_t *remote_device_address,
5289 bluetooth_bdaddr_type_e address_type,
5290 bt_oob_data_t *remote_oob_data);
5293 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5294 * bt_gatt_handle_info_t *prim_svc);
5296 * @brief Gets the GATT based primary services handle supported by remote device
5298 * This function is a synchronous call.
5299 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5301 * @return BLUETOOTH_ERROR_NONE - Success \n
5302 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5303 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5304 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5307 * @param[in] address - Remote device address
5308 * @param[out] prim_svc - Structure containing remote service count and handle list.
5311 * @see bluetooth_gatt_free_primary_services()
5313 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5314 bt_gatt_handle_info_t *prim_svc);
5317 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5319 * @brief Discovers the characteristics of GATT based service of remote device
5321 * This function is an asynchronous call.
5322 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5324 * @return BLUETOOTH_ERROR_NONE - Success \n
5325 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5326 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5327 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5330 * @param[in] service_handle - Handle for remote service.
5335 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5337 int bluetooth_gatt_set_service_change_watcher(
5338 const bluetooth_device_address_t *address, gboolean enable);
5341 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5342 * bt_gatt_service_property_t *service);
5344 * @brief Gets the properties of GATT based service of remote device
5346 * This function is a synchronous call.
5347 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5349 * @return BLUETOOTH_ERROR_NONE - Success \n
5350 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5351 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5352 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5355 * @param[in] service_handle - Handle for remote service.
5356 * @param[out] service - Structure containing remote service property.
5359 * @see bluetooth_gatt_free_service_property()
5361 int bluetooth_gatt_get_service_property(const char *service_handle,
5362 bt_gatt_service_property_t *service);
5365 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5367 * @brief Register to GATT based service to receive value change notification/indication.
5369 * This function is a synchronous call.
5370 * No event for this api.
5372 * @return BLUETOOTH_ERROR_NONE - Success \n
5373 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5374 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5375 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5378 * @param[in] service_handle - Handle for remote service.
5379 * @param[in] service_name - Friednly name of service uuid.
5384 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5387 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5389 * @brief Unregister GATT based service to receive value change notification/indication.
5391 * This function is a synchronous call.
5392 * No event for this api.
5394 * @return BLUETOOTH_ERROR_NONE - Success \n
5395 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5396 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5397 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5400 * @param[in] service_handle - Handle for remote service.
5405 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5408 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5409 * bt_gatt_char_property_t *characteristic);
5411 * @brief Provides characteristic value along with properties.
5413 * This function is a synchronous call.
5414 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5416 * @return BLUETOOTH_ERROR_NONE - Success \n
5417 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5418 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5419 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5422 * @param[in] char_handle - Handle for Characteristic property.
5423 * @param[out] characteristic - Structure containing remote characteristic property.
5426 * @see bluetooth_gatt_free_char_property()
5428 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5429 bt_gatt_char_property_t *characteristic);
5432 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5433 * bt_gatt_char_property_t *characteristic);
5435 * @brief Provides characteristic descriptor value along with its UUID.
5437 * This function is a synchronous call.
5438 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5440 * @return BLUETOOTH_ERROR_NONE - Success \n
5441 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5442 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5443 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5446 * @param[in] desc_handle - Handle for Characteristic descriptor.
5447 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5450 * @see bluetooth_gatt_free_desc_property()
5452 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5453 bt_gatt_char_descriptor_property_t *descriptor);
5457 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5458 * const guint8 *value, int length)
5460 * @brief Set characteristic value.
5462 * This function is a synchronous call.
5464 * @return BLUETOOTH_ERROR_NONE - Success \n
5465 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5466 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5467 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5470 * @param[in] char_handle - Handle for Characteristic property.
5471 * @param[in] value - New value to set for characteristic property.
5472 * @param[in] length - Length of the value to be set.
5477 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5478 const guint8 *value, int length);
5481 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5482 * const guint8 *value, int length, guint8 write_type)
5484 * @brief Set characteristic value by write type.
5486 * This function is a synchronous call if write type is "write without resonse"
5487 * and it is an asynchronous call if write type is "write with response"
5489 * @return BLUETOOTH_ERROR_NONE - Success \n
5490 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5491 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5492 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5495 * @param[in] char_handle - Handle for Characteristic property.
5496 * @param[in] value - New value to set for characteristic property.
5497 * @param[in] length - Length of the value to be set.
5498 * @param[in] write_type - Type of write.
5503 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5504 const guint8 *value, int length,
5505 guint8 write_type, gpointer app_data);
5509 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5510 * const guint8 *value, int length)
5512 * @brief Set characteristic value request.
5514 * This function is an asynchronous call.
5516 * @return BLUETOOTH_ERROR_NONE - Success \n
5517 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5518 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5519 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5522 * @param[in] char_handle - Handle for Characteristic property.
5523 * @param[in] value - New value to set for characteristic property.
5524 * @param[in] length - Length of the value to be set.
5529 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5530 const guint8 *value, int length);
5533 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5535 * @brief Read characteristic value.
5537 * This function is a asynchronous call.
5539 * @return BLUETOOTH_ERROR_NONE - Success \n
5540 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5541 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5542 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5545 * @param[in] char_handle - Handle for Characteristic property.
5550 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5553 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5554 * const char *service_uuid,
5555 * bt_gatt_service_property_t *service)
5557 * @brief Gets the service property from a device based on a particular uuid
5559 * This function is a synchronous call.
5561 * @return BLUETOOTH_ERROR_NONE - Success \n
5562 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5563 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5564 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5567 * @param[in] address - BD address of the remote device
5568 * @param[in] service_uuid - uuid of the service.
5569 * @param[out] service - Structure containing the service property.
5574 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5575 const char *service_uuid,
5576 bt_gatt_service_property_t *service);
5579 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5580 * const char *char_uuid)
5582 * @brief Gets the characteristic property from a service based on a particular char uuid
5584 * This function is an asynchronous call.
5585 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5587 * @return BLUETOOTH_ERROR_NONE - Success \n
5588 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5589 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5590 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5593 * @param[in] service_handle - Service handle.
5594 * @param[in] uuid - Characteristic uuid.
5599 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5600 const char *char_uuid);
5603 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5605 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5607 * This function is a synchronous call.
5608 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5610 * @return BLUETOOTH_ERROR_NONE - Success \n
5611 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5614 * @param[in] prim_svc - GATT handle info structure
5617 * @see bluetooth_gatt_get_primary_services()
5619 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5622 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5624 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5626 * This function is a synchronous call.
5627 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5629 * @return BLUETOOTH_ERROR_NONE - Success \n
5630 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5633 * @param[in] svc_pty - GATT service property structure.
5636 * @see bluetooth_gatt_get_service_property()
5638 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5641 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5643 * @brief Provides characteristic value along with properties.
5645 * This function is a synchronous call.
5646 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5648 * @return BLUETOOTH_ERROR_NONE - Success \n
5649 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5652 * @param[in] char_pty - GATT characteristics property structure.
5655 * @see bluetooth_gatt_get_characteristics_property()
5657 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5660 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5662 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5664 * This function is a synchronous call.
5665 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5667 * @return BLUETOOTH_ERROR_NONE - Success \n
5668 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5671 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5674 * @see bluetooth_gatt_get_char_descriptor_property()
5676 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5678 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5679 gboolean auto_connect, int client_id);
5681 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5684 int bluetooth_get_gatt_data_batching_available_packets(
5685 int *available_packets);
5687 int bluetooth_enable_gatt_data_batching(
5688 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5690 int bluetooth_disable_gatt_data_batching(
5691 const bluetooth_device_address_t *device_address);
5694 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5696 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5698 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5700 * @return BLUETOOTH_ERROR_NONE - Success \n
5701 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5704 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5708 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5711 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5713 * @brief Read characteristic descriptor value.
5715 * This function is a asynchronous call.
5717 * @return BLUETOOTH_ERROR_NONE - Success \n
5718 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5719 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5720 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5723 * @param[in] desc_handle - Handle for Characteristic descriptor
5728 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5731 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5732 * const guint8 *value, int length);
5734 * @brief Set characteristic descriptor value.
5736 * This function is a asynchronous call.
5738 * @return BLUETOOTH_ERROR_NONE - Success \n
5739 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5740 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5741 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5744 * @param[in] desc_handle - Handle for Characteristic descriptor
5745 * @param[in] value - New value to set for characteristic descriptor
5746 * @param[in] length - Length of the value to be set.
5751 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5752 const guint8 *value, int length, gpointer app_data);
5754 /* @fn int bluetooth_gatt_init(void)
5756 * @brief Initializes the gatt service.
5758 * This function is a synchronous call.
5759 * @return BLUETOOTH_ERROR_NONE - Success \n
5760 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5761 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5762 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5765 * @remark Adapter should be enabled
5766 * @see bluetooth_gatt_deinit()
5768 int bluetooth_gatt_init(void);
5770 /* @fn int bluetooth_gatt_init(void)
5772 * @brief DeInitializes the gatt service.
5774 * This function is a synchronous call.
5775 * @return BLUETOOTH_ERROR_NONE - Success \n
5776 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5777 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5778 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5781 * @remark Adapter should be enabled
5782 * @see bluetooth_gatt_init()
5784 int bluetooth_gatt_deinit(void);
5786 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5787 unsigned char **svc_path)
5789 * @brief Exports a new gatt service to the service interface.
5791 * This function is a synchronous call.
5793 * @return BLUETOOTH_ERROR_NONE - Success \n
5794 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5795 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5796 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5799 * @param[in] svc_uuid Gatt service uuid.
5800 * @param[out] svc_path service object path of the exported service.
5801 * @remark Adapter should be enabled
5802 * @see bluetooth_gatt_init()
5804 int bluetooth_gatt_add_service(const char *svc_uuid,
5807 /* @fn int bluetooth_gatt_add_new_characteristic(
5808 const char *svc_path, const char *char_uuid,
5809 bt_gatt_permission_t permissions,
5810 bt_gatt_characteristic_property_t properties,
5811 int flags_length, char **char_path);;
5813 * @brief Exports a new gatt characteristic to the characteristic interface.
5815 * This function is a synchronous call.
5816 * @return BLUETOOTH_ERROR_NONE - Success \n
5817 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5818 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5819 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5821 * @param[in] svc_path service object path of the exported service.
5822 * @param[in] char_uuid Gatt service uuid.
5823 * @param[in] properties GATT characteristic properties.
5824 * @param[out] char_path characteristic object path of the exported characteristic.
5826 * @remark Adapter should be enabled
5827 * @see bluetooth_gatt_add_service()
5829 int bluetooth_gatt_add_new_characteristic(
5830 const char *svc_path, const char *char_uuid,
5831 bt_gatt_permission_t permissions,
5832 bt_gatt_characteristic_property_t properties,
5835 /* @fn bluetooth_gatt_set_characteristic_value(
5836 const char *characteristic, const char *char_value,
5839 * @brief adds gatt charactertisic value to the given charactertistic path.
5841 * This function is a synchronous call.
5842 * @return BLUETOOTH_ERROR_NONE - Success \n
5843 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5844 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5845 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5847 * @param[in] char_value Value of the GATT characteristic to be added.
5848 * @param[in] value_length length of the chantacteristic value..
5849 * @param[out] characteristic characteristic object path..
5851 * @remark Adapter should be enabled
5852 * @see bluetooth_gatt_add_service()
5854 int bluetooth_gatt_set_characteristic_value(
5855 const char *characteristic, const char *char_value,
5858 /* @fn int bluetooth_gatt_add_descriptor(
5859 const char *char_path, const char *desc_uuid,
5860 bt_gatt_permission_t permissions,
5863 * @brief Exports a new gatt descriptor to the descriptor interface.
5865 * This function is a synchronous call.
5867 * @return BLUETOOTH_ERROR_NONE - Success \n
5868 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5869 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5870 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5873 * @param[in] desc_uuid Gatt descriptor uuid.
5874 * @param[in] desc_value GATT descriptor value.
5875 * @param[in] value_length Length of GATT descriptor value.
5876 * @param[in] permissions descriptor permissions.
5877 * @param[in] properties GATT descriptor properties.
5878 * @param[in] char_path characteristics object path of the exported character.
5880 * @remark Adapter should be enabled
5881 * @see bluetooth_gatt_add_service()
5882 * @see bluetooth_gatt_add_characteristics()
5884 int bluetooth_gatt_add_descriptor(
5885 const char *char_path, const char *desc_uuid,
5886 bt_gatt_permission_t permissions,
5889 /* @fn int bluetooth_gatt_set_descriptor_value(
5890 const char *desc_path, const char *desc_value,
5893 * @brief Adds value to the given descriptor handle.
5895 * This function is a synchronous call.
5897 * @return BLUETOOTH_ERROR_NONE - Success \n
5898 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5899 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5900 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5903 * @param[in] desc_value GATT descriptor value.
5904 * @param[in] value_length Length of GATT descriptor value.
5905 * @param[in] desc_path descriptor path to which the value needs to be added.
5907 * @remark Adapter should be enabled
5908 * @see bluetooth_gatt_add_service()
5909 * @see bluetooth_gatt_add_characteristics()
5911 int bluetooth_gatt_set_descriptor_value(
5912 const char *desc_path, const char *desc_value,
5915 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5917 * @brief Reads the Service registered on manager interface.
5919 * This function is a synchronous call.
5921 * @return BLUETOOTH_ERROR_NONE - Success \n
5922 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5923 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5924 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5927 * @param[in] svc_uuid Gatt Service uuid.
5929 * @remark Adapter should be enabled and service should be registered.
5930 * @see bluetooth_gatt_register_service()
5932 int bluetooth_gatt_get_service(const char *svc_uuid);
5934 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5936 * @brief Registers the given service path with the library.
5938 * This function is a synchronous call.
5940 * @return BLUETOOTH_ERROR_NONE - Success \n
5941 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5942 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5943 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5946 * @param[in] svc_path service object path of the exported service.
5948 * @remark Adapter should be enabled
5949 * @see bluetooth_gatt_add_service()
5950 * @see bluetooth_gatt_add_characteristics()
5951 * @see bluetooth_gatt_add_descriptor()
5952 * @see bluetooth_gatt_register_application()
5954 int bluetooth_gatt_register_service(const char *svc_path);
5956 /* @fn int bluetooth_gatt_register_application(void)
5958 * @brief Registers the application with the bluez gatt server.
5960 * This function is a synchronous call.
5962 * @return BLUETOOTH_ERROR_NONE - Success \n
5963 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5964 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5965 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5969 * @remark Adapter should be enabled
5970 * @see bluetooth_gatt_init()
5971 * @see bluetooth_gatt_add_service()
5972 * @see bluetooth_gatt_add_characteristics()
5973 * @see bluetooth_gatt_add_descriptor()
5974 * @see bluetooth_gatt_register_service()
5976 int bluetooth_gatt_register_application(void);
5978 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5980 * @brief Removes(unregister) service from the bluez gatt server db.
5982 * This function is a synchronous call.
5984 * @return BLUETOOTH_ERROR_NONE - Success \n
5985 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5986 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5987 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5990 * @param[in] svc_path service object path of the exported service.
5992 * @remark Adapter should be enabled
5993 * @see bluetooth_gatt_add_service()
5994 * @see bluetooth_gatt_add_characteristics()
5995 * @see bluetooth_gatt_add_descriptor()
5996 * @see bluetooth_gatt_register_service()
5998 int bluetooth_gatt_unregister_service(const char *svc_path);
6000 /* @fn int bluetooth_gatt_unregister_application(void)
6002 * @brief Removes(unregister) the application with the bluez gatt server,
6003 * and deletes all the service registered.
6005 * This function is a synchronous call.
6007 * @return BLUETOOTH_ERROR_NONE - Success \n
6008 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6009 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6010 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6014 * @remark Adapter should be enabled
6015 * @see bluetooth_gatt_init()
6016 * @see bluetooth_gatt_add_service()
6017 * @see bluetooth_gatt_add_characteristics()
6018 * @see bluetooth_gatt_add_descriptor()
6019 * @see bluetooth_gatt_register_service()
6020 * @see bluetooth_gatt_unregister_service()
6022 int bluetooth_gatt_unregister_application(void);
6024 /* @fn int bluetooth_gatt_send_response(int request_id,
6025 * int offset, char *value, int value_length)
6027 * @brief Updates the attribute value in local attribute list.
6029 * This function is a synchronous call.
6031 * @return BLUETOOTH_ERROR_NONE - Success \n
6032 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6033 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6034 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6037 * @param[in] request_id The identification of a read request
6038 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6039 * @param[in] resp_state The identification of response state
6040 * @param[in] offset The offset from where a value is read
6041 * @param[in] value The value to be sent. It will be sent from @a offset.
6042 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6043 * @param[in] value_length Value Length.
6045 * @remark Adapter should be enabled
6046 * @see bluetooth_gatt_add_service()
6047 * @see bluetooth_gatt_add_characteristics()
6048 * @see bluetooth_gatt_add_descriptor()
6049 * @see bluetooth_gatt_register_service()
6051 int bluetooth_gatt_send_response(int request_id, guint req_type,
6052 int resp_state, int offset, char *value, int value_length);
6054 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6056 * @brief Sets the notification property for a characteristic.
6058 * This function is a synchronous call.
6060 * @return BLUETOOTH_ERROR_NONE - Success \n
6061 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6062 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6063 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6066 * @param[in] char_path characteristic object path.
6067 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6069 * @remark Adapter should be enabled
6070 * @see bluetooth_gatt_update_characteristic()
6072 int bluetooth_gatt_server_set_notification(const char *char_path,
6073 bluetooth_device_address_t *unicast_address);
6075 /* @fn int bluetooth_gatt_delete_services(void)
6077 * @brief deletes (unregisters) all services from the gatt server database..
6079 * This function is a synchronous call.
6081 * @return BLUETOOTH_ERROR_NONE - Success \n
6082 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6083 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6084 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6088 * @remark Adapter should be enabled
6089 * @see bluetooth_gatt_add_service()
6090 * @see bluetooth_gatt_add_characteristics()
6091 * @see bluetooth_gatt_add_descriptor()
6092 * @see bluetooth_gatt_register_service()
6093 * @see bluetooth_gatt_unregister_service()
6095 int bluetooth_gatt_delete_services(void);
6097 /* @fn int bluetooth_gatt_update_characteristic(void)
6099 * @brief updates the given characteristic with a new value
6101 * This function is a synchronous call.
6103 * @return BLUETOOTH_ERROR_NONE - Success \n
6104 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6105 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6106 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6110 * @remark Adapter should be enabled
6111 * @see bluetooth_gatt_add_service()
6112 * @see bluetooth_gatt_add_characteristics()
6113 * @see bluetooth_gatt_add_descriptor()
6114 * @see bluetooth_gatt_register_service()
6115 * @see bluetooth_gatt_unregister_service()
6117 int bluetooth_gatt_update_characteristic(const char *char_path,
6118 const char* char_value, int value_length);
6121 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6123 * @brief Set advertising status.
6125 * This function is used to enable or disable LE advertising.
6126 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6128 * This function is a synchronous call.
6130 * @return BLUETOOTH_ERROR_NONE - Success \n
6131 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6132 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6135 * @param[in] enable - The status of advertising
6138 * @see bluetooth_set_advertising_data
6140 int bluetooth_set_advertising(int handle, gboolean enable);
6143 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6145 * @brief Set advertising status along with interval value.
6147 * This function is used to enable or disable LE advertising.
6148 * Interval_min and Interval_max is used to set the best advertising interval.
6149 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6151 * This function is a synchronous call.
6153 * @return BLUETOOTH_ERROR_NONE - Success \n
6154 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6155 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6158 * @param[in] enable - The status of advertising
6159 * @param[in] interval_min - Minimum interval of advertising (msec)
6160 * @param[in] interval_max - Maximum interval of advertising (msec)
6161 * @param[in] filter_policy - Advertising filter policy
6164 * @see bluetooth_set_advertising_data
6166 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6167 bluetooth_advertising_params_t *params);
6170 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6171 * @brief Get the advertising data
6173 * This function is used to get advertising data.
6174 * Before calling this API, the adapter should be enabled.
6176 * This function is a synchronous call.
6178 * @return BLUETOOTH_ERROR_NONE - Success \n
6179 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6180 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6181 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6183 * @param[out] value - Advertising data structure.
6184 * @param[out] length - The length of Advertising data.
6188 bluetooth_advertising_data_t *value = { {0} };
6191 ret = bluetooth_get_advertising_data(&value, &length);
6194 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6197 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6199 * @brief Set advertising data with value
6201 * This function is used to set advertising data and Maximum size of advertising data
6202 * is 28 byte (Except Flag)
6204 * This function is a synchronous call.
6206 * @return BLUETOOTH_ERROR_NONE - Success \n
6207 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6208 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6211 * @param[in] value - Advertising data structure.
6215 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6218 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6220 * @brief Check the privilege for advertising parameter setting
6222 * This function is a synchronous call.
6224 * @return BLUETOOTH_ERROR_NONE - Success \n
6225 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6231 int bluetooth_check_privilege_advertising_parameter(void);
6234 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6235 * @brief Get the LE scan response data
6237 * This function is used to get scan response data.
6238 * Before calling this API, the adapter should be enabled.
6240 * This function is a synchronous call.
6242 * @return BLUETOOTH_ERROR_NONE - Success \n
6243 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6244 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6245 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6247 * @param[out] value - Scan response data structure.
6248 * @param[out] length - The length of Scan response data.
6252 bluetooth_scan_resp_data_t *value = { {0} };
6255 ret = bluetooth_get_scan_response_data(&value, &length);
6258 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6261 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6263 * @brief Set scan response data with value
6265 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6267 * This function is a synchronous call.
6269 * @return BLUETOOTH_ERROR_NONE - Success \n
6270 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6271 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6274 * @param[in] value - LE Scan response data structure.
6278 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6281 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6283 * @brief Set scan interval and window
6285 * This function is used to set LE scan interval and window size
6287 * This function is a synchronous call.
6289 * @return BLUETOOTH_ERROR_NONE - Success \n
6290 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6291 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6294 * @param[in] interval - Interval of LE scan (msec)
6295 * @param[in] window - Window size of LE scan (msec)
6299 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6302 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6304 * @brief Set scan type
6306 * This function is used to set LE scan type
6308 * This function is a synchronous call.
6310 * @return BLUETOOTH_ERROR_NONE - Success \n
6311 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6312 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6315 * @param[in] scan_type - LE scan type
6319 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6322 * @fn int bluetooth_is_advertising(void)
6323 * @brief Check for the advertising is in-progress or not.
6325 * This API is used to check the current status of the advertising procedure.
6326 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6329 * This function checks whether the advertising is started or not.
6331 * This function is a synchronous call.
6333 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6335 * @return BLUETOOTH_ERROR_NONE - Success \n
6336 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6339 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6343 gboolean is_advertising = 0;
6345 ret = bluetooth_is_advertising(&is_advertising);
6348 int bluetooth_is_advertising(gboolean *is_advertising);
6351 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6352 * @brief Add LE device to white list
6354 * This API is used to add LE device to white list
6355 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6359 * This function is a synchronous call.
6361 * @param[in] address The address of remote device
6363 * @return BLUETOOTH_ERROR_NONE - Success \n
6364 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6367 * @see bluetooth_set_custom_advertising
6369 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6372 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6373 * @brief Remove LE device from white list
6375 * This API is used to remove LE device from white list
6376 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6380 * This function is a synchronous call.
6382 * @param[in] address The address of remote device
6384 * @return BLUETOOTH_ERROR_NONE - Success \n
6385 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6388 * @see bluetooth_set_custom_advertising
6390 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6393 * @fn int bluetooth_clear_white_list(void)
6394 * @brief Clear white list
6396 * This API is used to clear white list
6397 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6401 * This function is a synchronous call.
6403 * @param[in] address The address of remote device
6405 * @return BLUETOOTH_ERROR_NONE - Success \n
6406 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6409 * @see bluetooth_set_custom_advertising
6411 int bluetooth_clear_white_list(void);
6414 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6415 * const bluetooth_le_connection_param_t *parameters)
6416 * @brief update connection paramter of LE connection.
6418 * This function is a synchronous call.
6420 * @return BLUETOOTH_ERROR_NONE - Success \n
6421 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6424 * @param[in] address - remote device address value.
6425 * @param[in] parameters - new connection parameters.
6428 * @see bluetooth_bond_device
6430 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6431 const bluetooth_le_connection_param_t *parameters);
6434 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6436 * @brief Enable/Disable LE Privacy feature.
6438 * This function is used to enable or disable LE Privacy feature.
6439 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6441 * This function is a synchronous call.
6443 * @return BLUETOOTH_ERROR_NONE - Success \n
6444 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6445 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6448 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6452 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6455 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6457 * @brief Enable/Disable LE static random address.
6459 * This function is used to enable or disable LE static random address.
6461 * This function is a synchronous call.
6463 * @return BLUETOOTH_ERROR_NONE - Success \n
6464 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6465 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6468 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6472 int bluetooth_set_le_static_random_address(gboolean enable);
6475 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6476 * bluetooth_le_connection_mode_t mode)
6477 * @brief update connection paramter of LE connection.
6479 * This function is a synchronous call.
6481 * @return BLUETOOTH_ERROR_NONE - Success \n
6482 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6483 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6486 * @param[in] address - remote device address value.
6487 * @param[in] mode - new connection mode.
6491 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6492 bluetooth_le_connection_mode_t mode);
6495 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6496 * @brief Request for new ATT MTU value.
6498 * This function is a asynchronous call.
6500 * @return BLUETOOTH_ERROR_NONE - Success \n
6501 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6502 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6505 * @param[in] address - remote device address value.
6506 * @param[in] mtu - MTU value to be set.
6510 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6513 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6514 * unsigned int *mtu)
6515 * @brief Gets the xisting MTU value set for a connection.
6517 * This function is a synchronous call.
6519 * @return BLUETOOTH_ERROR_NONE - Success \n
6520 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6521 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6524 * @param[in] address - remote device address value.
6525 * @param[out] mtu - MTU value set for the connection.
6529 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6533 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6534 * bluetooth_device_address_t *id_address)
6535 * @brief Gets the Identity address of remote device.
6537 * This function is a synchronous call.
6539 * @return BLUETOOTH_ERROR_NONE - Success \n
6540 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6541 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6544 * @param[in] device_rpa - remote Resolvable private address.
6545 * @param[out] id_address - remote Identity device address value.
6549 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6550 bluetooth_device_address_t *id_address);
6553 * @fn int bluetooth_le_read_maximum_data_length()
6554 * @brief reads the maximum LE data length supported in the controller.
6556 * This function is a synchronous call.
6558 * @return BLUETOOTH_ERROR_NONE - Success \n
6559 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6565 int bluetooth_le_read_maximum_data_length(
6566 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6568 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6569 * @brief writes the host suggested values for the controllers max transmitted no of payload
6570 * octects to be used for new connections.
6572 * This function is a synchronous call.
6574 * @return BLUETOOTH_ERROR_NONE - Success \n
6575 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6581 int bluetooth_le_write_host_suggested_default_data_length(
6582 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6584 int bluetooth_le_read_suggested_default_data_length(
6585 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6587 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6588 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6590 int bluetooth_pbap_init(void);
6591 int bluetooth_pbap_deinit(void);
6592 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6593 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6594 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6595 bt_pbap_folder_t *folder);
6596 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6597 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6598 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6599 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6600 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6601 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6602 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6603 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6606 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6608 * @brief Set manufacturer data with value
6610 * This function is used to set manufacturer data.
6612 * This function is a synchronous call.
6614 * @return BLUETOOTH_ERROR_NONE - Success \n
6615 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6616 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6619 * @param[in] value - Manufacturer data structure.
6623 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6625 int bluetooth_set_passkey_notification(gboolean enable);
6628 * @fn int bluetooth_dpm_is_mode_allowed(void);
6630 * @brief Checks Restriction for BT mode(BT allowed or not)
6632 * This function is a synchronous call.
6634 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6635 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6636 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6643 int bluetooth_dpm_is_mode_allowed(void);
6646 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6648 * @brief Sets Restriction for BT mode(BT allowed or not)
6650 * This function is a synchronous call.
6652 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6653 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6654 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6657 * @param[in] value - BT Allow value.
6658 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6659 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6660 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6661 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6665 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6668 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6670 * @brief Reads the Restriction for BT mode(BT allowed or not)
6672 * This function is a synchronous call.
6674 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6675 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6676 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6680 * @param[out] value - BT Allow value.
6681 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6682 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6683 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6684 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6688 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6691 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6693 * @brief Sets the Restriction for device.
6695 * This function is a synchronous call.
6697 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6698 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6699 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6702 * @param[in] value - State value.
6703 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6704 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6708 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6711 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6713 * @brief Reads the Restriction for device.
6715 * This function is a synchronous call.
6717 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6718 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6719 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6723 * @param[out] value - State value.
6724 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6725 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6729 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6732 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6734 * @brief Sets the Restriction for uuid.
6736 * This function is a synchronous call.
6738 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6739 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6740 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6743 * @param[in] value - State value.
6744 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6745 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6749 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6752 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6754 * @brief Reads the Restriction for uuid.
6756 * This function is a synchronous call.
6758 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6759 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6760 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6764 * @param[out] value - State value.
6765 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6766 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6770 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6773 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6775 * @brief Adds the device to blacklist.
6777 * This function is a synchronous call.
6779 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6780 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6781 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6784 * @param[in] device_address - Device address
6788 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6791 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6793 * @brief Adds the device to whitelist.
6795 * This function is a synchronous call.
6797 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6798 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6799 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6802 * @param[in] device_address - Device address
6806 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6809 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6811 * @brief Adds the Service UUIDS to blacklist.
6813 * This function is a synchronous call.
6815 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6816 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6817 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6820 * @param[in] service_uuids - profile or custom service uuids
6824 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6827 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6829 * @brief Adds the Service UUIDS to whitelist.
6831 * This function is a synchronous call.
6833 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6834 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6835 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6838 * @param[in] service_uuids - profile or custom service uuids
6842 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6845 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6847 * @brief Clears the devices from blacklist.
6849 * This function is a synchronous call.
6851 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6852 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6853 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6860 int bluetooth_dpm_clear_devices_from_blacklist(void);
6863 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6865 * @brief Clears the devices from whitelist.
6867 * This function is a synchronous call.
6869 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6870 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6871 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6878 int bluetooth_dpm_clear_devices_from_whitelist(void);
6881 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6883 * @brief Clears the uuids from blacklist.
6885 * This function is a synchronous call.
6887 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6888 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6889 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6896 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6899 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6901 * @brief Clears the uuids from whitelist.
6903 * This function is a synchronous call.
6905 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6906 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6907 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6914 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6917 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6919 * @brief reads the devices from blacklist.
6921 * This function is a synchronous call.
6923 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6924 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6925 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6928 * @param[out] device_list - list of devices
6932 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6935 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6937 * @brief reads the devices from whitelist.
6939 * This function is a synchronous call.
6941 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6942 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6943 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6946 * @param[out] device_list - list of devices
6950 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6953 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6955 * @brief reads the uuids from blacklist.
6957 * This function is a synchronous call.
6959 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6960 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6961 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6964 * @param[in] uuid_list - list of uuids
6968 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6971 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6973 * @brief reads the uuids from whitelist.
6975 * This function is a synchronous call.
6977 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6978 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6979 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6982 * @param[in] uuid_list - list of uuids
6986 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6989 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6991 * @brief Removes the device from whitelist.
6993 * This function is a synchronous call.
6995 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6996 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6997 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7000 * @param[in] device_address - Device address
7004 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
7007 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7009 * @brief Removes the device from blacklist.
7011 * This function is a synchronous call.
7013 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7014 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7015 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7018 * @param[in] device_address - Device address
7022 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7025 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7027 * @brief Removes the Service UUIDS from whitelist.
7029 * This function is a synchronous call.
7031 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7032 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7033 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7036 * @param[in] service_uuids - profile or custom service uuids
7040 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7043 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7045 * @brief Removes the Service UUIDS from blacklist.
7047 * This function is a synchronous call.
7049 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7050 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7051 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7054 * @param[in] service_uuids - profile or custom service uuids
7058 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7061 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7063 * @brief Sets the Restriction for outgoing call.
7065 * This function is a synchronous call.
7067 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7068 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7069 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7072 * @param[in] value - State value.
7073 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7074 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7078 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7081 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7083 * @brief Reads the Restriction for outgoing call.
7085 * This function is a synchronous call.
7087 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7088 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7089 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7093 * @param[out] value - State value.
7094 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7095 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7099 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7102 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7104 * @brief Sets the Restriction for Pairing.
7106 * This function is a synchronous call.
7108 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7109 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7110 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7113 * @param[in] value - State value.
7114 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7115 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7119 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7122 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7124 * @brief Reads the Restriction for Pairing
7126 * This function is a synchronous call.
7128 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7129 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7130 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7134 * @param[out] value - State value.
7135 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7136 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7140 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7143 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7145 * @brief Sets the Restriction for using Profiles.
7147 * This function is a synchronous call.
7149 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7150 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7151 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7154 * @param[in]profile - Profile.
7155 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7156 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7157 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7158 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7159 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7160 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7161 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7162 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7163 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7164 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7165 * BLUETOOTH_DPM_PROFILE_NONE
7166 * @param[in] value - State value.
7167 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7168 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7172 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7175 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7177 * @brief Reads the Restriction for using Profiles.
7179 * This function is a synchronous call.
7181 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7182 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7183 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7186 * @param[in]profile - Profile.
7187 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7188 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7189 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7190 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7191 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7192 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7193 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7194 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7195 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7196 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7197 * BLUETOOTH_DPM_PROFILE_NONE
7198 * @param[out] value - State value.
7199 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7200 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7204 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7207 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7209 * @brief Sets the Restriction for Desktop Connectivity.
7211 * This function is a synchronous call.
7213 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7214 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7215 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7218 * @param[in] value - State value.
7219 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7220 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7224 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7227 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7229 * @brief Reads the Restriction for Desktop Connectivity.
7231 * This function is a synchronous call.
7233 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7234 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7235 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7239 * @param[out] value - State value.
7240 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7241 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7245 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7248 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7250 * @brief Sets the Restriction for Discoverable state.
7252 * This function is a synchronous call.
7254 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7255 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7256 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7259 * @param[in] value - State value.
7260 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7261 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7265 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7268 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7270 * @brief Reads the Restriction for Discoverable state.
7272 * This function is a synchronous call.
7274 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7275 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7276 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7280 * @param[out] value - State value.
7281 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7282 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7286 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7289 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7291 * @brief Sets the Restriction for linited discoverable state..
7293 * This function is a synchronous call.
7295 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7296 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7297 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7300 * @param[in] value - State value.
7301 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7302 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7306 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7309 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7311 * @brief Reads the Restriction for limited discoverable state.
7313 * This function is a synchronous call.
7315 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7316 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7317 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7321 * @param[out] value - State value.
7322 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7323 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7327 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7329 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7331 * @brief Sets the Restriction for Data trasnfer.
7333 * This function is a synchronous call.
7335 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7336 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7337 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7340 * @param[in] value - State value.
7341 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7342 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7346 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7350 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7352 * @brief Reads the Restriction for Data trasnfer.
7354 * This function is a synchronous call.
7356 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7357 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7358 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7362 * @param[out] value - State value.
7363 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7364 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7368 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7371 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7372 * bluetooth_pxp_poperty_t property, int value);
7374 * @brief Sets the Proximity alert level/properties for monitor role.
7376 * This function is a synchronous call.
7378 * @return BLUETOOTH_ERROR_NONE - Success \n
7379 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7380 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7381 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7384 * @param[in] device_address remote device address
7385 * @param[in] property proximity profile property
7386 * @param[in] value alert level/property value to be set
7391 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7392 bluetooth_pxp_poperty_t property, int value);
7395 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7396 * bluetooth_pxp_poperty_t property, int *value);
7398 * @brief Reads the Proximity alert level/properties for monitor role.
7400 * This function is a synchronous call.
7402 * @return BLUETOOTH_ERROR_NONE - Success \n
7403 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7404 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7405 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7408 * @param[in] device_address remote device address
7409 * @param[in] property proximity profile property
7410 * @param[out] value alert level/property value
7414 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7415 bluetooth_pxp_poperty_t property, int *value);
7418 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7419 * int *services_supported);
7421 * @brief Reads the Proximity Monitor profile supported properties/services.
7423 * This function is a synchronous call.
7425 * @return BLUETOOTH_ERROR_NONE - Success \n
7426 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7427 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7428 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7431 * @param[in] device_address remote device address
7432 * @param[out] services_supported proximity profile property/service
7436 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7437 int *services_supported);
7440 * @fn int bluetooth_proximity_reporter_register();
7442 * @brief Register all proximity related services in BlueZ.
7444 * This function is a synchronous call.
7446 * @return BLUETOOTH_ERROR_NONE - Success \n
7447 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7453 int bluetooth_proximity_reporter_register(void);
7456 * @fn int bluetooth_proximity_reporter_unregister();
7458 * @brief Unregister all proximity related services in BlueZ.
7460 * This function is a synchronous call.
7462 * @return BLUETOOTH_ERROR_NONE - Success \n
7463 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7469 int bluetooth_proximity_reporter_unregister(void);
7472 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7473 * bluetooth_pxp_poperty_t property, int *value);
7475 * @brief Reads the Proximity alert level/properties for reporter role.
7477 * This function is a synchronous call.
7479 * @return BLUETOOTH_ERROR_NONE - Success \n
7480 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7481 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7482 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7485 * @param[in] device_address remote device address
7486 * @param[in] property proximity profile property
7487 * @param[out] value alert level/property value
7491 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7492 bluetooth_pxp_poperty_t property, int *value);
7495 * @fn int bluetooth_tds_provider_register(void);
7497 * @brief Register Transport Discovery Provider role.
7499 * This function is a synchronous call.
7501 * @return BLUETOOTH_ERROR_NONE - Success \n
7502 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7503 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7504 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7512 int bluetooth_tds_provider_register(void);
7515 * @fn int bluetooth_tds_provider_unregister(void);
7517 * @brief Unregister Transport Discovery Provider role.
7519 * This function is a synchronous call.
7521 * @return BLUETOOTH_ERROR_NONE - Success \n
7522 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7523 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7524 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7532 int bluetooth_tds_provider_unregister(void);
7535 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7537 * @brief Create Transport Discovery Provider for a transport.
7539 * This function is a synchronous call.
7541 * @return BLUETOOTH_ERROR_NONE - Success \n
7542 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7543 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7544 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7547 * @param[in] Transport (BT, CUSTOM etc.)
7548 * @param[in] Unique handle for TDS provider.
7553 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7556 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7558 * @brief Remove previously created Transport Discovery Provider.
7560 * This function is a synchronous call.
7562 * @return BLUETOOTH_ERROR_NONE - Success \n
7563 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7566 * @param[in] Unique handle for previously created provider.
7571 int bluetooth_tds_provider_destroy(unsigned int handle);
7574 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7576 * @brief Set transport block for in advertisement and gatt db.
7578 * This function is a synchronous call.
7580 * @return BLUETOOTH_ERROR_NONE - Success \n
7581 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7582 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7583 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7586 * @param[in] Provider specific manufacturer data.
7587 * @param[in] Provider specific manufacturer data length.
7592 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7595 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7596 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7598 * @brief Set transport block for in advertisement and gatt db.
7600 * This function is a synchronous call.
7602 * @return BLUETOOTH_ERROR_NONE - Success \n
7603 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7604 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7605 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7608 * @param[in] Unique handle for TDS provider.
7609 * @param[in] Transport state (On/Off/Not Available).
7610 * @param[in] Transport specific data block.
7611 * @param[in] Transport specific data block length.
7616 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7617 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7620 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7621 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7623 * @brief Send response to TDS activation request from remoted device.
7625 * This function is a synchronous call.
7627 * @return BLUETOOTH_ERROR_NONE - Success \n
7628 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7629 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7630 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7633 * @param[in] Remote device BT address.
7634 * @param[in] Unique handle for TDS provider.
7635 * @param[in] Response for TDS activation request.
7636 * @param[in] Transport specific data block to be sent in activation response.
7637 * @param[in] Data block length.
7642 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7643 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7646 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7648 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7650 * This function is an asynchronous call.
7652 * @return BLUETOOTH_ERROR_NONE - Success \n
7653 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7654 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7655 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7656 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7659 * @param[in] device_address remote device address
7660 * @param[in] handle attribute handle
7662 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7663 * when TDS data is received from Remote provider
7665 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7666 const char *handle);
7669 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7671 * @brief Enables CCCD on Remote Provider.
7673 * This function is an asynchronous call.
7675 * @return BLUETOOTH_ERROR_NONE - Success \n
7676 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7677 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7678 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7679 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7682 * @param[in] device_address remote device address
7683 * @param[in] handle attribute handle
7685 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7686 * when Indication is enabled on Remote provider
7688 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7689 const char *handle);
7692 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7693 * unsigned char *buf, int length);
7694 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7696 * This function is an asynchronous call.
7698 * @return BLUETOOTH_ERROR_NONE - Success \n
7699 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7700 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7701 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7702 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7705 * @param[in] device_address remote device address
7706 * @param[in] handle attribute handle
7707 * @param[in] buf Control point activation param
7708 * @param[in] param length
7710 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7711 * is received from remote Provider
7713 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7714 unsigned char *buf, int length);
7717 * @fn int bluetooth_otp_server_init(const char *directory);
7719 * @brief Starts OTP server.
7721 * This function is a synchronous call.
7731 int bluetooth_otp_server_init(const char *directory);
7734 * @fn int bluetooth_otp_server_deinit();
7736 * @brief Stops OTP server.
7738 * This function is a synchronous call.
7748 int bluetooth_otp_server_deinit();
7751 * @fn int bluetooth_otp_enable_notification(const char *handle);
7753 * @brief Enable notification for remote OACP & OLCP characteristics.
7755 * This function is a synchronous call.
7765 int bluetooth_otp_enable_notification(const char *handle);
7768 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7769 * unsigned char *buf, int length);
7771 * @brief Write value on remote characteristics.
7773 * This function is a synchronous call.
7783 int bluetooth_otp_write_characteristics_value(const char *handle,
7784 unsigned char *buf, int length);
7787 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7789 * @brief Read value for remote characteristics.
7791 * This function is a synchronous call.
7801 int bluetooth_otp_read_characteristic_value(const char *handle);
7804 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7806 * @brief Read value for remote characteristics.
7808 * This function is a synchronous call.
7818 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7821 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7823 * @brief Read value for remote characteristics.
7825 * This function is a synchronous call.
7835 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7838 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7839 * @brief Check if Adapter supports LE 2M PHY feature or not.
7841 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7842 * in BT 5.0 specification.
7844 * This function is a synchronous call.
7846 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7847 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7848 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7849 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7850 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7854 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7857 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7858 * @brief Check if Adapter supports LE 2M CODED feature or not.
7860 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7861 * in BT 5.0 specification.
7863 * This function is a synchronous call.
7865 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7866 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7867 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7868 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7869 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
7873 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
7881 #endif /* __cplusplus */
7882 #endif /* _BLUETOOTH_API_H_*/