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
77 #define RFCOMM_ROBOT_PROFILE_CHANNEL 22
80 * This is maximum length for search value string for PBAP Phonebook Search
82 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
85 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
88 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
89 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
92 * < This defines the maximum size of OTP server directory name
94 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
96 #define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH 500 /**< OTP Characteristics Value Max length */
99 * This is Bluetooth error code
101 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
103 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
104 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
106 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
107 /**< Callback error */
108 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
109 /**< invalid paramerror */
110 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
111 /**< invalid data error */
112 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
113 /**< Memory allocation error */
114 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
115 /**< out of memory error */
116 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
117 /**< timeout error */
118 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
119 /**< No resource error */
120 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
121 /**< internal error */
122 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
123 /**< Not supported error */
124 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
125 /**< Operation is failed because
126 of not enabled BT Adapter */
127 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
128 /**< Enabling is failed because of
129 already enabled BT Adapter */
130 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
131 /**< Operation is failed because of
132 other on going operation */
133 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
134 /**< access denied error */
135 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
136 /**< max client error */
137 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
138 /**< not found error */
139 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
140 /**< service search fail */
141 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
142 /**< pairing failed error */
143 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
144 /**< Not paired error */
145 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
146 /**< no service error */
147 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
148 /**< no connection error */
149 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
150 /**< alread connected error */
151 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
152 /**< connection busy error */
153 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
154 /**< connection error */
155 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
156 /**< max connection error*/
157 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
158 /**< Not in operation */
159 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
160 /**< Cancelled by user */
161 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
162 /**< Service record registration failed */
163 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
164 /**< Operation in progress */
165 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
166 /**< authentication failed error when paring*/
167 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
168 /**< Remote host is down */
169 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
170 /**< End of device list */
172 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
173 /**< Obex agent already exists */
174 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
175 /**< Obex agent does not exist */
177 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
178 /**< Already initialized */
180 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
181 /**< Permission deined */
183 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
184 /**< Nap already done */
186 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
187 /**< Not initialized */
189 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
190 /**< Authentication rejected */
192 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
193 /**< Device Policy Restricted */
195 #define BLUETOOTH_ERROR_NO_DATA ((int)BLUETOOTH_ERROR_BASE - 0x29)
198 #define BLUETOOTH_ERROR_AUTHORIZATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x2a)
199 /**< Authorization rejected */
202 * Error codes for ATT Error response *
204 #define BLUETOOTH_ATT_ERROR_INTERNAL -1
205 #define BLUETOOTH_ATT_ERROR_NONE 0x00
206 #define BLUETOOTH_ATT_ERROR_INVALID_HANDLE 0x01
207 #define BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED 0x02
208 #define BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED 0x03
209 #define BLUETOOTH_ATT_ERROR_INVALID_PDU 0x04
210 #define BLUETOOTH_ATT_ERROR_AUTHENTICATION 0x05
211 #define BLUETOOTH_ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06
212 #define BLUETOOTH_ATT_ERROR_INVALID_OFFSET 0x07
213 #define BLUETOOTH_ATT_ERROR_AUTHORIZATION 0x08
214 #define BLUETOOTH_ATT_ERROR_PREPARE_QUEUE_FULL 0x09
215 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0A
216 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0B
217 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0C
218 #define BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN 0x0D
219 #define BLUETOOTH_ATT_ERROR_UNLIKELY 0x0E
220 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0F
221 #define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10
222 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
223 /* Common profile error codes */
224 #define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED 0xFC
225 #define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED 0xFD
226 #define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS 0xFE
227 #define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE 0xFF
230 * Bluetooth ATT error codes specific to OTP
232 #define BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED 0x80
233 #define BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED 0x81
234 #define BLUETOOTH_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
235 #define BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS 0x83
238 * Bluetooth OTP error codes
239 * TODO: Check error code conflict
241 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
242 #define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
245 * Device disconnection reasons; received from stack
247 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
248 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
249 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
250 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
251 #define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e
252 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
253 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
254 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
255 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
256 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
257 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
258 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
259 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
260 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
261 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
262 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
265 * Device disconnect reason
268 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
269 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
270 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
271 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
272 } bluetooth_device_disconnect_reason_t;
275 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
278 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
279 } bluetooth_device_address_t;
282 * This is Bluetooth device address type
285 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
286 BLUETOOTH_DEVICE_RANDOM_ADDRESS
287 } bluetooth_device_address_type_t;
290 * This is BD Address type defined in kernel BT header
293 BLUETOOTH_BDADDR_BREDR = 0x00,
294 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
295 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
296 } bluetooth_bdaddr_type_e;
299 * This is Bluetooth version
302 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
303 } bluetooth_version_t;
306 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
309 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
310 } bluetooth_device_name_t;
313 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
316 int data_len; /**< manafacturer specific data length */
317 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
318 } bluetooth_manufacturer_data_t;
321 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
322 } bluetooth_device_pin_code_t;
325 * This is data for battery usage monitoring
329 time_t session_start_time;
330 time_t session_end_time;
334 uint32_t session_connected_time;
335 uint32_t session_scan_time;
345 } bt_battery_app_data;
351 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
352 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
353 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
354 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
355 } bluetooth_adapter_state_t;
361 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
362 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
363 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
364 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
365 } bluetooth_adapter_le_state_t;
371 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
372 /*Changed the order to make it compatable with old method */
373 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
374 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
375 /**< Discoverable mode with time limit
376 After specific timeout, it is changed
377 to non discoverable mode */
378 } bluetooth_discoverable_mode_t;
381 * Network connect mode
384 BLUETOOTH_NETWORK_PANU_ROLE,
386 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
387 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
388 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
389 } bluetooth_network_role_t;
393 * Service type matched to bt_profile_type_t of bt-service-common.h
396 BLUETOOTH_RFCOMM_SERVICE = 0x01,
397 BLUETOOTH_A2DP_SERVICE = 0x02,
398 BLUETOOTH_HSP_SERVICE = 0x04,
399 BLUETOOTH_HID_SERVICE = 0x08,
400 BLUETOOTH_NAP_SERVICE = 0x10,
401 BLUETOOTH_HFG_SERVICE = 0x20,
402 BLUETOOTH_GATT_SERVICE = 0x40,
403 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
404 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
405 BLUETOOTH_PBAP_SERVICE = 0x200,
406 } bluetooth_service_type_t;
412 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
413 /* represents that connection
414 * type can both BR/EDR and LE */
415 BLUETOOTH_DEV_CONN_BREDR = 0x00,
416 BLUETOOTH_DEV_CONN_LE = 0x01,
417 } bluetooth_conn_type_t;
423 BLUETOOTH_CODEC_ID_CVSD = 0x01,
424 BLUETOOTH_CODEC_ID_MSBC = 0x02,
425 } bluetooth_codec_type_t;
431 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
432 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
433 } bluetooth_hf_audio_connected_type_t;
439 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
440 } bluetooth_advertising_data_t;
446 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
447 } bluetooth_scan_resp_data_t;
450 * Advertising filter policy
453 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
454 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
455 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
456 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
457 } bluetooth_advertising_filter_policy_t;
463 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
464 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
465 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
466 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
467 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
468 } bluetooth_advertising_type_t;
471 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
472 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
473 } bluetooth_gatt_service_change_type_t;
476 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
477 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
478 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
479 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
480 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
481 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
482 } bt_gatt_permission_t;
485 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
486 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
487 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
488 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
489 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
490 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
491 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
492 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
493 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
494 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
495 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
496 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
497 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
498 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
499 } bt_gatt_characteristic_property_t;
502 * Remote device request types for attributes
505 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
506 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
507 } bluetooth_gatt_att_request_tyep_t;
510 * Proximity Property Type
513 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
514 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
515 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
516 } bluetooth_pxp_poperty_t;
522 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
523 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
524 BLUETOOTH_TDS_TRANSPORT_WIFI_NAN, /* Wi-Fi Alliance Neighbor Awareness Networking */
525 BLUETOOTH_TDS_TRANSPORT_WIFI_SVC_ADV, /* Wi-Fi Alliance Service Advertisement */
527 BLUETOOTH_TDS_TRANSPORT_INVALID
528 } bluetooth_tds_transport_t;
531 * TDS transport state
534 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
535 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
536 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
537 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
538 } bluetooth_tds_transport_state_t;
545 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
546 } bluetooth_tds_data_t;
549 * TDS activation request
552 bluetooth_device_address_t rem_addr;
553 bluetooth_tds_transport_t transport;
554 bluetooth_tds_data_t tds_data;
555 } bluetooth_tds_activation_req_t;
558 * TDS Control Point data
561 int length; /**< Control point data length */
562 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
563 } bluetooth_control_point_data_t;
566 * TDS Indication Response data
569 bluetooth_device_address_t rem_addr; /**< Device address */
570 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
571 } bluetooth_tds_indication_res_t;
574 * Structure to hold the TDS Complete data information which is read from remote TDS provider
577 bluetooth_device_address_t device_address; /**< Device address */
578 int data_length; /**< Data length */
579 char *data; /**< Complete Transport Specific data */
580 } bluetooth_tds_transport_data_info_t;
583 * OTP Characteristics Value
586 int length; /**< Characteristics value length */
587 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
588 } bluetooth_otp_charc_data_t;
591 * Structure to hold the OTP response data from remote OTP server
594 char *handle; /**< Handle */
595 int data_length; /**< Data length */
596 char *data; /**< Read data */
597 } bluetooth_otp_resp_info_t;
600 * Structure to hold the OTC Channel Info
603 gboolean connected; /**< Connection Status */
605 char *address; /**< Remote address */
606 } bluetooth_otc_info_t;
609 * Advertising parameters
614 guint8 filter_policy;
617 } bluetooth_advertising_params_t;
623 int type; /**< passive 0, active 1 */
624 float interval; /**< LE scan interval */
625 float window; /**< LE scan window */
626 } bluetooth_le_scan_params_t;
632 BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
633 BLUETOOTH_LE_ACTIVE_SCAN
634 } bluetooth_le_scan_type_t;
644 } bluetooth_le_connection_param_t;
647 LE Read Maximum Data Length
650 guint16 max_tx_octets;
652 guint16 max_rx_octets;
654 } bluetooth_le_read_maximum_data_length_t;
657 LE Read Host suggested default Data Length
660 guint16 def_tx_octets;
662 } bluetooth_le_read_host_suggested_data_length_t;
665 * Samsung XSAT Vendor dependent command
670 } bluetooth_vendor_dep_at_cmd_t;
676 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
677 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
678 } bluetooth_opp_transfer_type_t;
683 } bluetooth_hf_ciev_device_event_t;
685 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
686 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
687 /**< Base ID for GAP Event */
688 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
689 /**< Base ID for SDP events */
690 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
691 /**< Base ID for RFCOMM events */
692 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
693 /**< Base ID for NETWORK events */
694 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
695 /**< Base ID for HDP events */
696 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
697 /**< Base ID for OPC events */
698 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
699 /**< Base ID for Obex Server events */
700 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
701 /**< Base ID for GATT events */
703 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
704 /**< Base ID for Audio events */
705 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
706 /**< Base ID for HID events */
707 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
708 /**< Base ID for Advertising events */
709 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
710 /**< Base ID for PBAP Client events */
711 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
712 /**< Base ID for AVRCP events */
713 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
714 /**< Base ID for IPSP events */
715 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
716 /**< Base ID for MAP events */
717 #define BLUETOOTH_EVENT_MESH_BASE ((int)(BLUETOOTH_EVENT_MAP_BASE + 0x0020))
718 /**< Base ID for MAP events */
721 * Bluetooth event type
724 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
726 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
727 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
728 BLUETOOTH_EVENT_DISABLED_BATTERY_DATA, /**< Bluetooth event adapter disabled battery data*/
729 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
730 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
731 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
732 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
733 /**< Bluetooth event Discoverable timeout requested*/
734 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
735 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
736 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
737 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
738 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
739 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
740 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
741 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
742 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
743 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
744 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
745 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
746 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
747 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
748 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
749 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
750 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
751 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
752 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
753 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
754 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
756 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
757 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
758 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
759 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
760 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
762 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
763 /**< Bluetooth event serice search base id */
764 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
765 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
766 /**< RFCOMM data receive event */
767 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
768 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
770 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
772 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
773 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
775 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
777 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
778 /**< Bluetooth Network event */
779 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
780 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
781 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
782 /**< Network disconnected evnet in server */
784 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
785 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
787 BLUETOOTH_EVENT_HDP_CONNECTED
788 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
789 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
790 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
792 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
793 /* OPC Connected event */
794 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
795 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
796 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
797 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
799 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
800 BLUETOOTH_EVENT_MAP_DISCONNECTED,
802 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
803 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
804 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
805 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
806 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
808 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
809 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
810 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
811 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
812 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
813 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
814 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
815 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
816 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
817 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
818 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
819 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
820 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
822 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
823 /* Obex server authorize event*/
824 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
825 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
826 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
827 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
828 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
829 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
831 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
832 /**<Discovered GATT service characteristics event*/
833 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
834 /**<Remote GATT charateristic value changed event*/
835 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
836 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
837 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
838 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
839 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
840 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
841 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
842 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
843 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
844 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
845 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
846 BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
847 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
848 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
849 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
850 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
851 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
852 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
853 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
854 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
855 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
856 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
857 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
858 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
859 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
860 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
861 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
862 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
863 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
864 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
865 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
866 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
867 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
868 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
869 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
870 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
871 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
872 BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
873 BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
874 BLUETOOTH_EVENT_HF_CONNECTED,
875 BLUETOOTH_EVENT_HF_DISCONNECTED,
876 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
877 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
878 BLUETOOTH_EVENT_HF_RING_INDICATOR,
879 BLUETOOTH_EVENT_HF_CALL_WAITING,
880 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
881 BLUETOOTH_EVENT_HF_CALL_STARTED,
882 BLUETOOTH_EVENT_HF_CALL_ENDED,
883 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
884 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
885 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
886 BLUETOOTH_EVENT_HF_CALL_STATUS,
887 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
888 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
889 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
890 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
891 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
892 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
893 BLUETOOTH_EVENT_HF_CALL_IDLE,
894 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
895 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
896 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
897 BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
899 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
900 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
901 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
902 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
903 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
905 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
906 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
907 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
908 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
909 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
910 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
911 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
912 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
914 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
915 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
916 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
917 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
918 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
919 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
920 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
922 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
923 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
924 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
925 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
926 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
927 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
928 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
929 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
930 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
932 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
933 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
934 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
935 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
936 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
937 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
938 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
939 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
940 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
941 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
942 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
944 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
945 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
946 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
947 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
948 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
949 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
950 BLUETOOTH_EVENT_MESH_SCAN_STARTED = BLUETOOTH_EVENT_MESH_BASE,
951 BLUETOOTH_EVENT_MESH_SCAN_FINISHED,
952 BLUETOOTH_EVENT_MESH_SCAN_RESULT,
953 BLUETOOTH_EVENT_MESH_AUTHENTICATION_REQUEST,
954 BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED,
955 BLUETOOTH_EVENT_MESH_NODE_BROWSED,
956 BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES,
957 BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
958 BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED,
959 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
960 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST,
961 BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
962 BLUETOOTH_EVENT_MESH_MODEL_MSG_RECEIVED,
963 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST,
964 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED,
965 BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED,
966 BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
967 BLUETOOTH_EVENT_MESH_JOIN_COMPLETED
968 } bluetooth_event_type_t;
971 * This bt_service_uuid_list_t enum indicates service uuid list .
972 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
976 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
977 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
978 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
979 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
980 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
981 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
982 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
983 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
984 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
985 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
986 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
987 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
988 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
990 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
991 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
992 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
993 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
994 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
995 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
996 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
997 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
998 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
999 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
1000 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
1001 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
1002 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
1003 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
1005 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
1006 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
1007 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
1008 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
1009 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
1010 /**<DIRECT PRINTING*/
1011 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
1012 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
1013 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
1014 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
1015 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
1016 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
1017 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
1018 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
1019 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
1020 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
1021 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
1022 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
1023 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
1024 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
1025 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
1026 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
1027 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
1028 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
1029 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
1030 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
1031 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
1032 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
1033 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
1034 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
1035 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
1036 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
1037 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
1038 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
1039 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
1040 } bluetooth_service_uuid_list_t;
1043 * Service class part of class of device returned from device discovery
1046 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1047 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1048 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1049 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1050 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1051 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1052 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1053 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1054 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1055 } bluetooth_device_service_class_t;
1059 * Major device mask (For device discovery)
1062 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1063 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1064 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1065 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1066 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1067 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1068 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1069 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1070 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1071 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1072 } bluetooth_device_major_mask_t;
1076 * Major device class (part of Class of Device)
1079 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1080 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1081 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1082 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1083 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1084 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1085 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1086 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1087 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1088 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1089 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1090 } bluetooth_device_major_class_t;
1093 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1095 /* About Computer Major class */
1096 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1098 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1099 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1100 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1101 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1102 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1104 /* About Phone Major class */
1105 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1106 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1107 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1108 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1109 /**< voice gateway minor class */
1110 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1112 /* About LAN/Network Access Point Major class */
1113 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1114 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1115 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1116 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1117 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1118 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1119 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1120 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1122 /* About Audio/Video Major class */
1123 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1124 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1126 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1127 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1128 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1129 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1130 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1131 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1132 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1133 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1134 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1135 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1136 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1137 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1138 /**< Video Display and Loud
1139 Speaker minor class */
1140 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1143 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1145 /* About Peripheral Major class */
1146 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1147 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1149 /**< Combo Keyboard or pointing
1150 device minorclass */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1153 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1154 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1155 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1156 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1157 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1158 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1159 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1160 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1162 /* About Imaging Major class */
1163 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1164 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1165 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1166 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1168 /* About Wearable Major class */
1169 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1170 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1171 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1172 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1173 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1175 /* About Toy Major class */
1176 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1177 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1178 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1179 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1180 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1182 /* About Health Major class */
1183 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1184 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1185 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1186 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1187 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1188 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1189 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1190 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1191 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1192 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1193 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1194 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1195 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1196 } bluetooth_device_minor_class_t;
1199 * structure to hold the device information
1202 bluetooth_device_major_class_t major_class; /**< major device class */
1203 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1204 bluetooth_device_service_class_t service_class;
1205 /**< service device class */
1206 } bluetooth_device_class_t;
1209 * Discovery Role types
1212 DISCOVERY_ROLE_BREDR = 0x1,
1214 DISCOVERY_ROLE_LE_BREDR
1215 } bt_discovery_role_type_t;
1218 * Connected state types
1221 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1222 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1223 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1224 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1225 } bluetooth_connected_link_t;
1231 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1232 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1233 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1234 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1235 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1236 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1237 BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80, /**< rssi high threshold */
1238 } bluetooth_le_scan_filter_feature_t;
1241 * LE connection mode
1244 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1245 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1246 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1247 } bluetooth_le_connection_mode_t;
1250 * structure to hold the device information
1253 bluetooth_device_address_t device_address; /**< device address */
1254 bluetooth_device_name_t device_name; /**< device name */
1255 bluetooth_device_class_t device_class; /**< device class */
1256 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1257 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1259 int rssi; /**< received strength signal*/
1260 gboolean paired; /**< paired flag */
1261 bluetooth_connected_link_t connected; /**< connected link type */
1262 gboolean trust; /**< trust flag */
1263 gboolean is_alias_set; /** is device alias set flag**/
1264 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1265 } bluetooth_device_info_t;
1268 * structure to hold the LE device information
1271 int data_len; /**< manafacturer specific data length */
1272 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1273 } bluetooth_le_advertising_data_t;
1276 bluetooth_device_address_t device_address; /**< device address */
1277 int addr_type; /**< address type*/
1278 int rssi; /**< received strength signal*/
1279 bluetooth_le_advertising_data_t adv_ind_data;
1280 bluetooth_le_advertising_data_t scan_resp_data;
1281 } bluetooth_le_device_info_t;
1285 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1286 bluetooth_device_address_t device_address; /**< device address */
1287 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1288 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1289 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1290 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1291 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1292 bluetooth_le_advertising_data_t service_data; /**< service data */
1293 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1294 int manufacturer_id; /**< manufacturer ID */
1295 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1296 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1297 int rssi_high_threshold; /**< rssi high threshold */
1298 } bluetooth_le_scan_filter_t;
1301 bluetooth_device_address_t device_address; /**< device address */
1302 unsigned int mtu; /** < MTU set for the ATT connection */
1303 unsigned int status; /** < status of the MTU exchange */
1304 } bluetooth_le_att_mtu_info_t;
1307 * structure to hold the paired device information
1310 bluetooth_device_address_t device_address; /**< paired device address */
1311 bluetooth_device_name_t device_name; /**< device name */
1312 bluetooth_device_class_t device_class; /**< device class */
1313 } bluetooth_paired_device_info_t;
1316 * structure to hold the paired device information
1319 bluetooth_device_address_t device_address;
1320 /**< device address */
1321 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1322 /**< network interface name */
1323 } bluetooth_network_device_info_t;
1326 * Authentication event types
1330 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1331 BLUETOOTH_AUTH_PIN_REQUEST,
1332 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1333 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1334 } bluetooth_auth_type_t;
1337 * structure to hold the pincode/pass-key req informations
1340 bluetooth_device_address_t device_address; /**< remote device address */
1341 bluetooth_device_name_t device_name; /**< device name */
1342 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1343 bool incoming; /**< stores if bonding request is incoming */
1344 } bluetooth_authentication_request_info_t;
1347 * Stucture to hold discovery option
1350 unsigned short max_response; /**< the number of maximum response */
1351 unsigned short discovery_duration;
1352 /**< duration of discovery (seconds) */
1353 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1354 classOfDevice variable */
1355 } bluetooth_discovery_option_t;
1358 * Stucture to hold event information
1361 int event; /**< event type */
1362 int result; /**< Success or error value */
1364 /**<parameter data pointer */
1366 } bluetooth_event_param_t;
1369 bluetooth_device_address_t device_addr;
1370 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1371 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1372 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1377 bluetooth_device_address_t device_addr;
1378 unsigned char addr_type;
1381 } bt_connection_info_t;
1384 * Stucture to rfcomm receive data
1389 /**< the socket fd */
1390 int buffer_size;/**< the length of the receive buffer */
1392 /**< the receive data buffer */
1393 } bluetooth_rfcomm_received_data_t;
1399 HTYPE_TRANS_HANDSHAKE,
1400 HTYPE_TRANS_HID_CONTROL,
1401 HTYPE_TRANS_GET_REPORT,
1402 HTYPE_TRANS_SET_REPORT,
1403 HTYPE_TRANS_GET_PROTOCOL,
1404 HTYPE_TRANS_SET_PROTOCOL,
1406 HTYPE_TRANS_UNKNOWN,
1407 HTYPE_TRANS_GET_IDLE = 0xF0,
1408 HTYPE_TRANS_SET_IDLE = 0xF1,
1409 } bt_hid_header_type_t;
1415 PTYPE_DATA_RTYPE_INPUT,
1416 PTYPE_DATA_RTYPE_OUTPUT
1417 } bt_hid_param_type_t;
1420 * Stucture to hid receive data
1423 const char *address;
1424 bt_hid_header_type_t type;
1425 /**< Header type containing */
1426 bt_hid_param_type_t param;
1427 /**< Param type in header like INPUT Report or OutPut Report */
1428 int buffer_size;/**< the length of the receive buffer */
1430 /**< the receive data buffer */
1431 } bluetooth_hid_received_data_t;
1434 * Stucture to rfcomm connection
1438 int socket_fd; /**< the socket fd */
1439 int server_id; /* Server id */
1440 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1441 bluetooth_device_address_t device_addr;
1442 /**< device address */
1443 char uuid[BLUETOOTH_UUID_STRING_MAX];
1444 } bluetooth_rfcomm_connection_t;
1447 * Stucture to rfcomm disconnection
1451 /**< the socket fd */
1452 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1453 bluetooth_device_address_t device_addr;
1454 /**< device address */
1455 char uuid[BLUETOOTH_UUID_STRING_MAX];
1456 } bluetooth_rfcomm_disconnection_t;
1460 /**< the socket fd */
1461 bluetooth_device_address_t device_addr;
1462 /**< device address */
1463 } bluetooth_rfcomm_connection_request_t;
1472 } bt_hdp_qos_type_t;
1478 HDP_ROLE_SOURCE = 0x0,
1480 } bt_hdp_role_type_t;
1484 * Stucture to HDP connected
1487 const char *app_handle; /**< the application handle */
1488 unsigned int channel_id; /**< the channel id */
1489 bt_hdp_qos_type_t type; /**< the QOS type */
1490 bluetooth_device_address_t device_address; /**< the remote address */
1491 } bt_hdp_connected_t;
1494 * Stucture to HDP disconnected
1497 unsigned int channel_id; /**< the channel id */
1498 bluetooth_device_address_t device_address; /**< the remote address */
1499 } bt_hdp_disconnected_t;
1502 * Stucture to HDP data indication
1505 unsigned int channel_id; /**< the channel id */
1506 const char *buffer; /**< the RX data buffer */
1507 unsigned int size; /**< the RX data size */
1508 } bt_hdp_data_ind_t;
1511 * Stucture to OPP client transfer information
1518 } bt_opc_transfer_info_t;
1520 /* TODO: MAP client structures, see above */
1522 * Stucture to Map filter fields
1527 } bt_map_list_filter_fields_info_t;
1529 /* Obex Server transfer type */
1530 #define TRANSFER_PUT "PUT"
1531 #define TRANSFER_GET "GET"
1533 * Stucture to OPP/FTP Server authorize information
1540 } bt_obex_server_authorize_into_t;
1548 } bt_obex_server_type_t;
1551 * Stucture to OPP/FTP server transfer information
1559 unsigned long file_size;
1561 bt_obex_server_type_t server_type;
1563 unsigned char *contact_auth_info;
1564 } bt_obex_server_transfer_info_t;
1567 * Stucture to OPP/FTP server connection/disconnection information
1573 } bt_obex_server_connection_info_t;
1577 * Stucture to OOB data
1581 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1582 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1583 unsigned int hash_len;
1584 unsigned int randomizer_len;
1586 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1587 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1588 unsigned int hash256_len;
1589 unsigned int randomizer256_len;
1591 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1592 unsigned int eir_len;
1596 * Structure to GATT attribute handle data
1602 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1603 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1604 } bt_gatt_handle_info_t;
1607 * Structure to a most basic GATT attribute handle data
1611 unsigned char uuid[16];
1612 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1613 } bt_gatt_handle_property_t;
1616 * Structure to GATT Remote service data
1623 bt_gatt_handle_info_t include_handles;
1624 bt_gatt_handle_info_t char_handle;
1625 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1626 } bt_gatt_service_property_t;
1629 * Structure to GATT Remote characteristic data
1633 char *service_handle;
1634 bt_gatt_handle_info_t handle_info;
1635 } bt_gatt_discovered_char_t;
1638 * Structure to format of GATT Characteristic Value
1642 unsigned char format;
1643 unsigned char exponent;
1644 unsigned short unit;
1645 unsigned char name_space;
1646 unsigned short description;
1647 } bt_gatt_char_format_t;
1650 * Structure to GATT Characteristic property
1658 bt_gatt_char_format_t format;
1660 unsigned int val_len;
1661 unsigned int permission;
1662 char *representation;
1663 bt_gatt_handle_info_t char_desc_handle;
1664 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1665 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1666 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1667 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1668 } bt_gatt_char_property_t;
1671 * Structure to GATT Characteristic descriptor property
1678 unsigned int val_len;
1679 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1680 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1681 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1682 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1683 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1684 } bt_gatt_char_descriptor_property_t;
1687 * Structure to GATT Characteristic value
1694 } bt_gatt_char_value_t;
1697 unsigned char UUID[16];
1701 } bt_gatt_notify_req_t ;
1704 * Structure to GATT Read Request
1708 char *service_handle;
1712 } bt_gatt_read_req_t;
1715 * Structure to GATT Value change
1719 char *service_handle;
1722 gboolean response_needed;
1726 } bt_gatt_value_change_t;
1729 bluetooth_device_address_t device_addr;
1731 bluetooth_gatt_service_change_type_t change_type;
1734 } bt_gatt_service_change_t;
1737 * Structure to GATT characteristc Notification change
1741 char *service_handle;
1742 gboolean att_notify;
1743 } bt_gatt_char_notify_change_t;
1746 * Structure to Indication confirmation
1750 char *service_handle;
1753 } bt_gatt_indicate_confirm_t;
1756 * Structure for GATT response data
1763 } bt_gatt_resp_data_t;
1766 * Structure to RSSI Signal Strength Alert
1777 * Structure to RSSI Signal Strength
1787 * Structure for RSSI Enabled or Disabled
1793 gboolean rssi_enabled;
1794 } bt_rssi_enabled_t;
1797 * Structure for RSSI Threshold
1802 int in_range_threshold;
1804 } bt_rssi_threshold_t;
1808 * Structure for Suppoted Profiles and Trusted Profiles
1815 } bt_supported_profile_trusted_t;
1818 * Structure for PBAP Folder Parameters
1821 unsigned char addressbook;
1822 unsigned char folder_type;
1826 * Structure for PBAP Pull application Parameters
1829 unsigned char format;
1830 unsigned char order;
1831 unsigned short offset;
1832 unsigned short maxlist;
1833 long long unsigned fields;
1834 } bt_pbap_pull_parameters_t;
1837 * Structure for PBAP List application Parameters
1840 unsigned char order;
1841 unsigned short offset;
1842 unsigned short maxlist;
1843 } bt_pbap_list_parameters_t;
1846 * Structure for PBAP Pull vCard application Parameters
1849 unsigned char format;
1850 long long unsigned fields;
1852 } bt_pbap_pull_vcard_parameters_t;
1855 * Structure for PBAP Search application Parameters
1858 unsigned char order;
1859 unsigned short offset;
1860 unsigned short maxlist;
1861 unsigned char search_attribute;
1862 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1863 } bt_pbap_search_parameters_t;
1866 * Structure for PBAP Connection Status
1869 bluetooth_device_address_t btaddr;
1871 } bt_pbap_connected_t;
1874 * Structure for PBAP Phonebook Size
1877 bluetooth_device_address_t btaddr;
1879 } bt_pbap_phonebook_size_t;
1882 * Structure for PBAP Phonebook Pull
1885 bluetooth_device_address_t btaddr;
1888 } bt_pbap_phonebook_pull_t;
1891 * Structure for PBAP vCard List
1894 bluetooth_device_address_t btaddr;
1898 } bt_pbap_vcard_list_t;
1901 * Structure for PBAP vCard Pull
1904 bluetooth_device_address_t btaddr;
1907 } bt_pbap_vcard_pull_t;
1910 * Structure for PBAP Phonebook search List
1913 bluetooth_device_address_t btaddr;
1917 } bt_pbap_phonebook_search_list_t;
1920 * Stucture to HF Call status information
1924 char *number; /*Phone Number */
1925 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1926 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1927 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1928 int idx; /*Call index/ID */
1929 } bt_hf_call_status_info_t;
1934 } bt_hf_call_list_s;
1940 TRUSTED_PROFILE_PBAP = 1,
1941 TRUSTED_PROFILE_MAP,
1942 TRUSTED_PROFILE_SAP,
1943 TRUSTED_PROFILE_HFP_HF,
1944 TRUSTED_PROFILE_A2DP,
1945 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1946 } bluetooth_trusted_profile_t;
1949 * Structure for LE data length change params
1952 bluetooth_device_address_t device_address;
1953 guint16 max_tx_octets;
1954 guint16 max_tx_time;
1955 guint16 max_rx_octets;
1956 guint16 max_rx_time;
1957 } bt_le_data_length_params_t;
1960 * Structure for proximity property change params
1963 bluetooth_device_address_t device_address;
1967 } bt_pxp_property_changed_params_t;
1970 * @brief DPM BT allowance state
1974 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1975 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1976 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1977 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1981 * @brief DPM API result
1985 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1986 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1987 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1988 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1989 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1990 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1994 * @brief DPM Policy status
1998 BLUETOOTH_DPM_STATUS_ERROR = -1,
2000 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
2001 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
2003 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
2004 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
2006 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2007 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2011 /* policy-group : BLUETOOTH */
2012 BLUETOOTH_DPM_POLICY_ALLOW,
2013 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2014 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2015 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
2016 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
2017 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
2018 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
2019 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2020 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2021 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2022 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2023 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2024 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2025 BLUETOOTH_DPM_POLICY_END,
2026 } bt_dpm_policy_cmd_t;
2029 struct bt_dpm_policy {
2035 typedef struct bt_dpm_policy bt_dpm_policy_t;
2038 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2039 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2040 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2041 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2042 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2043 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2044 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2045 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2046 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2047 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2048 BLUETOOTH_DPM_PROFILE_NONE,
2051 struct bt_dpm_profile_val {
2052 int value; /* tells whether the profile is enabled or disabled */
2054 typedef struct dpm_profile_val dpm_profile_state_t;
2057 * Structure to DPM device list
2061 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2062 } bt_dpm_device_list_t;
2065 * Structure to DPM uuid list
2069 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2070 } bt_dpm_uuids_list_t;
2073 * Structure for IPSP Interface Info
2076 bluetooth_device_address_t btaddr;
2078 } bt_ipsp_connection_info_t;
2082 char* remote_address;
2083 } bt_map_client_session_info_s;
2085 typedef char* bt_map_client_message_object_t;
2090 } bt_map_client_list_folders_filter_t;
2095 int8_t subject_length;
2104 } bt_map_client_list_messages_filter_t;
2107 bt_map_client_message_object_t message_object;
2112 char *sender_address;
2115 char *recipient_address;
2120 int64_t attachment_size;
2125 } bt_map_client_message_item_t;
2131 } bt_map_client_push_message_args_t;
2138 char *sender_address;
2141 char *recipient_address;
2150 } bt_map_client_message_t;
2153 char **names; // holding %size null-terminated folder names
2155 } bt_map_client_folders_s;
2158 bt_map_client_message_item_t *message_items;
2160 } bt_map_client_message_items_s;
2163 const char* target_file;
2165 } bt_get_message_callback_data;
2168 * Callback pointer type
2170 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2173 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2174 * @brief Set the callback function pointer for bluetooth event
2177 * This API will register the callback function, when any response and event are received from
2178 * bluetooth framework. @n
2179 * this registered callback function will be get called with appropriate event and data structures.
2180 * This function is a synchronous call. An application developer can call
2181 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2182 * type. This registered function will receive events of bluetooth_event_type_t type along with
2186 * @param[in] callback_ptr A pointer to the callback function
2187 * @param[in] user_data A pointer to user data
2188 * @return BLUETOOTH_ERROR_NONE - Success
2192 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2194 GMainLoop *main_loop = (GMainLoop*) user_data;
2198 // Code for each event
2200 g_main_loop_quit(main_loop);
2207 GMainLoop *main_loop = NULL;
2210 main_loop = g_main_loop_new(NULL, FALSE);
2211 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2212 if (ret >= BLUETOOTH_ERROR_NONE)
2214 // bluetooth_register_callback returned Success
2218 // bluetooth_register_callback returned failiure
2220 g_main_loop_run(main_loop);
2224 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2227 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2228 * @brief Set the callback function pointer for bluetooth le event
2231 * This API will register the callback function, when any response and event are received from
2232 * bluetooth framework. @n
2233 * this registered callback function will be get called with appropriate event and data structures.
2234 * This function is a synchronous call. An application developer can call
2235 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2236 * type. This registered function will receive events of bluetooth_event_type_t type along with
2240 * @param[in] callback_ptr A pointer to the callback function
2241 * @param[in] user_data A pointer to user data
2242 * @return BLUETOOTH_ERROR_NONE - Success
2246 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2249 * @fn int bluetooth_le_unregister_callback(void)
2250 * @brief Set the callback function pointer for bluetooth le event
2253 * This API will register the callback function, when any response and event are received from
2254 * bluetooth framework. @n
2255 * this registered callback function will be get called with appropriate event and data structures.
2256 * This function is a synchronous call. An application developer can call
2257 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2258 * type. This registered function will receive events of bluetooth_event_type_t type along with
2263 * @return BLUETOOTH_ERROR_NONE - Success
2267 int bluetooth_le_unregister_callback(void);
2270 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2271 * @brief Set the callback function pointer for bluetooth event
2274 * This API will register the callback function, when any response and event are received from
2275 * bluetooth framework. @n
2276 * this registered callback function will be get called with appropriate event and data structures.
2277 * This function is a synchronous call. An application developer can call
2278 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2279 * type. This registered function will receive events of bluetooth_event_type_t type along with
2284 * @return BLUETOOTH_ERROR_NONE - Success
2288 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2290 GMainLoop *main_loop = (GMainLoop*) user_data;
2294 // Code for each event
2296 g_main_loop_quit(main_loop);
2303 GMainLoop *main_loop = NULL;
2306 main_loop = g_main_loop_new(NULL, FALSE);
2307 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2308 if (ret >= BLUETOOTH_ERROR_NONE)
2310 // bluetooth_register_callback returned Success
2314 // bluetooth_register_callback returned failiure
2316 ret = bluetooth_deregister_callback(void);
2317 g_main_loop_run(main_loop);
2321 int bluetooth_unregister_callback(void);
2324 * @fn int bluetooth_enable_adapter(void)
2325 * @brief Enable the Bluetooth H/W
2328 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2329 * send request to bluetooth chip for activation.
2330 * This function is typically called at startup or when Bluetooth services are required. This
2331 * function must be called before calling any other API of Bluetooth operations.
2333 * Before performing any operations like Device discover, service search etc.., the adapter must be
2336 * This function is a asynchronous call.
2337 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2338 * through registered callback function with appropriate result code
2339 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2340 * BLUETOOTH_ERROR_NONE - Success \n
2342 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2343 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2345 * @return BLUETOOTH_ERROR_NONE - Success\n
2346 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2347 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2348 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2349 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2351 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2353 void bt_event_callback(int event, bluetooth_event_param_t *param)
2357 case BLUETOOTH_EVENT_ENABLED:
2358 if (param->result == BLUETOOTH_ERROR_NONE)
2360 // Successfully Enabled
2373 ret = bluetooth_enable_adapter();
2377 int bluetooth_enable_adapter(void);
2380 * @fn int bluetooth_disable_adapter(void)
2381 * @brief Disable the Bluetooth H/W
2384 * This function disables Bluetooth protocol stack and hardware. This function is called when
2385 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2387 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2388 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2389 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2391 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2394 * This function is a asynchronous call.
2395 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2396 * through registered callback function.
2399 * @return BLUETOOTH_ERROR_NONE - Success\n
2400 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2401 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2402 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2404 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2406 void bt_event_callback(int event, bluetooth_event_param_t *param)
2410 case BLUETOOTH_EVENT_DISABLED:
2411 if (param->result == BLUETOOTH_ERROR_NONE)
2413 // Successfully disabled
2426 ret = bluetooth_disable_adapter();
2429 int bluetooth_disable_adapter(void);
2430 int bluetooth_read_battery_data(bt_battery_data *latest);
2431 int bluetooth_set_battery_monitor_state(bool state);
2432 int bluetooth_get_battery_monitor_state(void);
2433 int bluetooth_recover_adapter(void);
2434 int bluetooth_check_adapter_le(void);
2435 int bluetooth_enable_adapter_le(void);
2437 int bluetooth_disable_adapter_le(void);
2438 int bluetooth_get_uuid_name(const char *uuid, char **name);
2441 * @fn int bluetooth_reset_adapter(void)
2442 * @brief Reset the Bluetooth H/W and values
2445 * This function resets Bluetooth protocol stack and hardware. This function is called when
2446 * an user want to initialize Bluetooth environment.
2448 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2451 * This function is a synchronous call.
2453 * @return BLUETOOTH_ERROR_NONE - Success\n
2454 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2456 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2461 ret = bluetooth_reset_adapter();
2464 int bluetooth_reset_adapter(void);
2467 * @fn int bluetooth_is_supported(void)
2468 * @brief Check if the bluetooth is supported or not by the current target
2470 * This API checks whether the bluetooth is supported or not.
2471 * This API only run by root permission.
2473 * This function is a synchronous call.
2475 * @return 0 - if bluetooth is not supported\n
2476 * 1 - if bluetooth is supported\n
2477 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2482 ret = bluetooth_is_supported();
2485 int bluetooth_is_supported(void);
2489 * @fn int bluetooth_check_adapter(void)
2490 * @brief Check the current status of the Bluetooth adapter
2493 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2494 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2495 * bluetooth adapter.
2496 * This API get the adapter internal data structure and check current adapter status.
2498 * This function is a synchronous call.
2501 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2502 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2504 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2508 ret = bluetooth_check_adapter();
2511 int bluetooth_check_adapter(void);
2514 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2515 * @brief Get the local adapter bluetooth address
2518 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2519 * the adapter should be enabled.
2520 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2521 * contain Bluetooth address.
2522 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2523 * friendly name for each device.
2524 * There is no event callback for this API.
2526 * This function is a synchronous call.
2529 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2530 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2531 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2532 * @param[out] local_address a device address of local bluetooth adapter
2537 bluetooth_device_address_t local_address={0,};
2540 ret = bluetooth_get_local_address(&local_address);
2543 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2546 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2547 * @brief Get the hci version
2550 * This function is used to get the bluetooth hci version
2551 * Before calling this API make sure that the adapter is enabled.
2553 * This function is a synchronous call.
2556 * @return BLUETOOTH_ERROR_NONE - Success \n
2557 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2558 * @param[out] timeout remain visibility timeout value
2561 bluetooth_version_t *version;
2563 ret = bluetooth_get_local_version (&version);
2566 int bluetooth_get_local_version(bluetooth_version_t *version);
2569 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2570 * @brief Get the local device name
2573 * This function is used, get the local device name. Since its difficult to remember the Adapter
2574 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2575 * friendly name is retrived by the remote device and displaying.
2576 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2578 * This function is a synchronous call.
2581 * @return BLUETOOTH_ERROR_NONE - Success \n
2582 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2583 * @param[out] local_name a local device name
2587 bluetooth_device_name_t local_name={0,}
2589 ret = bluetooth_get_local_name (&local_name);
2592 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2595 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2596 * @brief Set the local device name
2599 * This function is used to set the local device name. This is a human friendly name whose
2600 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2602 * This function is a synchronous call.
2604 * @param[in] local_name bluetooth device name to set local device
2606 * @return BLUETOOTH_ERROR_NONE - Success \n
2607 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2608 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2609 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2610 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2611 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2616 bluetooth_device_name_t local_name={0,}
2618 ret = bluetooth_set_local_name (&local_name);
2621 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2625 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2626 * @brief Check if the uuid is used or not
2628 * This function is used to check if the uuid is used or not.
2630 * This function is a synchronous call.
2632 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2633 * @param[out] used if the uuid is used or not
2635 * @return BLUETOOTH_ERROR_NONE - Success \n
2636 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2637 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2638 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2643 gboolean used = FALSE;
2644 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2645 ret = bluetooth_is_service_used(uuid, &used);
2648 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2651 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2652 * @brief Check if the device is connected to the specific service
2654 * This function is used to check if if the device is connected to the specific service.
2656 * This function is a synchronous call.
2658 * @param[in] local_address a device address of remote bluetooth device
2659 * @param[in] type the service type
2660 * @param[out] is_connected if the device is connected or not
2662 * @return BLUETOOTH_ERROR_NONE - Success \n
2663 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2664 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2665 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2670 gboolean is_connected = FALSE;
2671 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2672 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2675 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2676 bluetooth_service_type_t type,
2677 gboolean *is_connected);
2680 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2681 * @brief Gets device's connected link type
2683 * This function is used to get device's connected link type
2685 * This function is a synchronous call.
2687 * @param[in] device_address a device address of remote bluetooth device
2688 * @param[out] connected_link a device's connected link type
2690 * @return BLUETOOTH_ERROR_NONE - Success \n
2691 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2692 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2693 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2698 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2699 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2700 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2703 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2704 bluetooth_connected_link_t *connected_link);
2707 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2708 * @brief Sets a profile trusted for a device
2710 * This function is used to Set a profile as trusted for a device
2712 * This function is a synchronous call.
2714 * @param[in] device_address a device address of remote bluetooth device
2715 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2716 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2718 * @return BLUETOOTH_ERROR_NONE - Success \n
2719 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2720 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2721 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2725 int bluetooth_set_profile_trusted(
2726 const bluetooth_device_address_t *device_address,
2727 int profile, int trust);
2730 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2731 * @brief Gets a profile is trusted for a device
2733 * This function is used to Get a profile is trusted or not for a device
2735 * This function is a synchronous call.
2737 * @param[in] device_address a device address of remote bluetooth device
2738 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2739 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2741 * @return BLUETOOTH_ERROR_NONE - Success \n
2742 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2743 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2744 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2748 int bluetooth_get_profile_trusted(
2749 const bluetooth_device_address_t *device_address,
2750 int profile, int *trust);
2753 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2754 * @brief Get the visibility mode
2757 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2758 * visibity mode, the property of the device is determined whether it can be discoverable, non
2759 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2761 * This function is a synchronous call.
2764 * @return BLUETOOTH_ERROR_NONE - Success \n
2765 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2766 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2767 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2768 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2769 * @param[out] discoverable_mode current bluetooth discoverable mode
2771 * @see bluetooth_set_discoverable_mode
2773 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2775 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2778 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2781 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2783 * @brief Set the visibility mode
2786 * This function is used to set the discoverable mode (Visibility option).
2788 * Many times user may want to keep his device discoverable so that when peer device is performing
2789 * device search, he/she can find user's device. Application programmer can keep the mode as
2790 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2791 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2792 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2793 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2795 * This function is a synchronous call.
2797 * @return BLUETOOTH_ERROR_NONE - Success \n
2798 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2800 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2801 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2803 * @see bluetooth_get_discoverable_mode
2807 bluetooth_discoverable_mode_t mode;
2809 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2810 ret = bluetooth_set_discoverable_mode (mode, 180);
2814 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2819 * @fn int bluetooth_get_timeout_value(int *timeout)
2820 * @brief Get the visibility timeout value
2823 * This function is used to get the visibility timeout
2824 * Before calling this API make sure that the adapter is enabled.
2826 * This function is a synchronous call.
2829 * @return BLUETOOTH_ERROR_NONE - Success \n
2830 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2831 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2832 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2833 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2834 * @param[out] timeout remain visibility timeout value
2836 * @see bluetooth_set_discoverable_mode
2840 ret = bluetooth_get_timeout_value (&timeout);
2843 int bluetooth_get_timeout_value(int *timeout);
2847 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2848 * unsigned int classOfDeviceMask)
2849 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2851 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2852 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2853 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2854 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2855 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2856 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2857 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2858 * please see bluetooth_device_info_t for more details.
2861 * This API provides searching options like max responses, discovery duration in seconds and class
2862 * of device mask to filter device search. some times there may be too many bluetooth devices in
2863 * vicinity of your device.in such scenario, application can request to reduce number of responces
2864 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2865 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2866 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2867 * application defined time. please note that discovery_duration should be mentioned in seconds.
2868 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2871 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2872 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2873 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2875 * This function is a asynchronous call.
2876 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2877 * through registered callback function.
2879 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2880 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2882 * The completion or cancellation of the discovery is indicated by an
2883 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2885 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2888 * @return BLUETOOTH_ERROR_NONE - Success \n
2889 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2890 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2891 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2892 agent is not running \n
2894 * @param[in] max_response define the maximum response of the number of founded devices
2896 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2897 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2898 (refer to class of device)
2900 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2903 void bt_event_callback(int event, bluetooth_event_param_t *param)
2907 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2909 bluetooth_device_info_t *device_info = NULL;
2910 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2912 device_info = (bluetooth_device_info_t *)param->param_data;
2913 memcpy(&searched_device, &device_info->device_address,
2914 sizeof(bluetooth_device_address_t));
2915 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2916 device_info->device_address.addr[0],
2917 device_info->device_address.addr[1],
2918 device_info->device_address.addr[2],
2919 device_info->device_address.addr[3],
2920 device_info->device_address.addr[4],
2921 device_info->device_address.addr[5]);
2924 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2926 bluetooth_device_info_t *device_info = NULL;
2927 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2929 device_info = (bluetooth_device_info_t *)param->param_data;
2930 memcpy(&searched_device, &device_info->device_address,
2931 sizeof(bluetooth_device_address_t));
2932 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2933 device_info->device_name.name,
2934 device_info->device_address.addr[0],
2935 device_info->device_address.addr[1],
2936 device_info->device_address.addr[2],
2937 device_info->device_address.addr[3],
2938 device_info->device_address.addr[4],
2939 device_info->device_address.addr[5]);
2943 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2944 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2949 unsigned short max_response;
2950 unsigned short discovery_duration;
2951 unsigned classOfDeviceMask;
2955 discovery_duration =0;
2956 classOfDeviceMask =0;
2958 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2963 int bluetooth_start_discovery(unsigned short max_response,
2964 unsigned short discovery_duration,
2965 unsigned int classOfDeviceMask);
2968 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2969 * unsigned short max_response,
2970 * unsigned short discovery_duration,
2971 * unsigned int classOfDeviceMask)
2972 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2974 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2975 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2976 * Please see bluetooth_start_discovery() for other parameters description.
2978 * This function is a asynchronous call.
2979 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2980 * through registered callback function.
2982 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2983 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2985 * The completion or cancellation of the discovery is indicated by an
2986 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2988 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2991 * @return BLUETOOTH_ERROR_NONE - Success \n
2992 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2993 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2994 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2995 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2996 agent is not running \n
2998 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2999 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
3000 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
3001 * @param[in] max_response define the maximum response of the number of founded devices
3003 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3004 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3005 (refer to class of device)
3007 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3010 unsigned short type;
3011 unsigned short max_response;
3012 unsigned short discovery_duration;
3013 unsigned classOfDeviceMask;
3018 discovery_duration =0;
3019 classOfDeviceMask =0;
3021 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3026 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3027 unsigned short max_response,
3028 unsigned short discovery_duration,
3029 unsigned int classOfDeviceMask);
3032 * @fn int bluetooth_cancel_discovery (void)
3033 * @brief Cancel the on-going device discovery operation
3036 * This function stops the on-going device discovery operation. This API has to be called after the
3037 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3038 * the bluetooth_start_discovery API
3040 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3041 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3042 * cancel the discover request once the user received the device to which he wish to connect.
3044 * This function is a asynchronous call.
3045 * If the call is success to cancel discovey then the application will receive
3046 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3047 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3048 * BLUETOOTH_ERROR_NONE
3051 * @return BLUETOOTH_ERROR_NONE - Success \n
3052 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3053 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3054 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3055 other application \n
3056 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3058 * @see bluetooth_start_discovery
3060 void bt_event_callback(int event, bluetooth_event_param_t *param)
3064 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3065 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3074 ret = bluetooth_cancel_discovery();
3077 int bluetooth_cancel_discovery(void);
3080 * @fn int bluetooth_start_le_discovery(void)
3081 * @brief Start the generic device discovery which finds the LE devices.
3083 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3084 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3085 * It try to find LE devices. Bluetooth device address and name are
3086 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3087 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3088 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3089 * please see bluetooth_device_info_t for more details.
3091 * This function is a asynchronous call.
3092 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3093 * through registered callback function.
3095 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3098 * The completion or cancellation of the discovery is indicated by an
3099 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3101 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3104 * @return BLUETOOTH_ERROR_NONE - Success \n
3105 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3106 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3107 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3108 agent is not running \n
3111 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3114 void bt_event_callback(int event, bluetooth_event_param_t *param)
3118 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3120 bluetooth_device_info_t *device_info = NULL;
3121 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3123 device_info = (bluetooth_device_info_t *)param->param_data;
3124 memcpy(&searched_device, &device_info->device_address,
3125 sizeof(bluetooth_device_address_t));
3126 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3127 device_info->device_address.addr[0],
3128 device_info->device_address.addr[1],
3129 device_info->device_address.addr[2],
3130 device_info->device_address.addr[3],
3131 device_info->device_address.addr[4],
3132 device_info->device_address.addr[5]);
3136 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3137 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3143 ret = bluetooth_start_discovery();
3148 int bluetooth_start_le_discovery(void);
3151 * @fn int bluetooth_stop_le_discovery (void)
3152 * @brief Cancel the on-going device LE discovery operation
3155 * This function stops the on-going device discovery operation. This API has to be called after the
3156 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3157 * the bluetooth_start_le_discovery API
3160 * This function is a asynchronous call.
3161 * If the call is success to cancel discovey then the application will receive
3162 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3163 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3164 * BLUETOOTH_ERROR_NONE
3167 * @return BLUETOOTH_ERROR_NONE - Success \n
3168 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3169 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3170 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3171 other application \n
3172 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3174 * @see bluetooth_start_discovery
3176 void bt_event_callback(int event, bluetooth_event_param_t *param)
3180 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3181 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3190 ret = bluetooth_stop_le_discovery();
3193 int bluetooth_stop_le_discovery(void);
3196 * @fn int bluetooth_is_discovering(void)
3197 * @brief Check for the device discovery is in-progress or not.
3199 * This API is used to check the current status of the Discovery operation.If discovery is in\
3200 * progress normally other operations are not allowed.
3201 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3202 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3203 * event before performing other operations. This API is used to get for the current discovery
3204 * operation status and using bluetooth_cancel_discovery()
3205 * we can cancell the ongoing discovery process.
3206 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3209 * This function checks whether the device discovery is started or not.
3211 * This function is a synchronous call.
3214 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3215 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3216 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3219 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3223 ret = bluetooth_is_discovering ();
3226 int bluetooth_is_discovering(void);
3229 * @fn int bluetooth_is_le_discovering(void)
3230 * @brief Check for the device LE discovery is in-progress or not.
3232 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3233 * progress normally other operations are not allowed.
3234 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3235 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3236 * event before performing other operations. This API is used to get for the current discovery
3237 * operation status and using bluetooth_stop_le_discovery()
3238 * we can cancell the ongoing LE discovery process.
3239 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3242 * This function checks whether the device LE discovery is started or not.
3244 * This function is a synchronous call.
3247 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3248 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3249 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3252 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3256 ret = bluetooth_is_le_discovering ();
3259 int bluetooth_is_le_discovering(void);
3262 * @fn int bluetooth_is_le_scanning(void)
3263 * @brief Check for the device LE scan is in-progress or not.
3265 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3266 * progress normally other operations are not allowed.
3268 * This function checks whether the device LE Scan is started or not.
3270 * This function is a synchronous call.
3272 * @return TRUE - LE Scan in progress \n
3273 * FALSE - LE Scan is not in progress \n
3278 gboolean is_le_scanning = 0;
3279 is_le_scanning = bluetooth_is_le_scanning ();
3282 gboolean bluetooth_is_le_scanning(void);
3284 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3287 * @fn int bluetooth_force_hcidump(int timeout)
3288 * @brief Enable /disable force-hcidump
3290 * This function control force-hcidump.
3292 * This function is a synchronous call.
3294 * @return BLUETOOTH_ERROR_NONE - Success \n
3295 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3296 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3298 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3303 int bluetooth_force_hcidump(int timeout);
3306 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3307 * @brief Register scan filter.
3309 * This function registers the scan filter.
3311 * This function is a synchronous call.
3313 * @return BLUETOOTH_ERROR_NONE - Success \n
3315 * @param[in] filter scan filter to register
3319 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3322 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3323 int link_type, bt_rssi_threshold_t rssi_threshold)
3324 * @brief Enable RSSI monitoring
3326 * This function enables RSSI monitoring and sets threshold for a connection
3328 * @return BLUETOOTH_ERROR_NONE - Success \n
3331 * @see bluetooth_get_rssi_strength
3333 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3334 int link_type, bt_rssi_threshold_t *rssi_threshold);
3337 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3338 * @brief Gets Raw RSSI signal Strength
3340 * This function gives the Raw RSSI signal strength for a connection.
3342 * @return BLUETOOTH_ERROR_NONE - Success \n
3345 * @see bluetooth_enable_rssi
3347 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3349 int bluetooth_set_connectable(gboolean is_connectable);
3351 int bluetooth_is_connectable(gboolean *is_connectable);
3353 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3356 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3357 * @brief Initiate a bonding process
3360 * This function initiates a bonding procedure with a peer device. The bonding procedure
3361 * enables authentication and optionally encryption on the Bluetooth link.
3363 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3364 * inititate the bonding request to the devices already in the paired list.
3366 * Usually we call this API after the device discovery.
3367 * This function is a asynchronous call.
3369 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3370 * mentioed result code
3371 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3372 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3373 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3374 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3375 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3377 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3378 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3381 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3384 * @return BLUETOOTH_ERROR_NONE - Success \n
3385 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3386 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3387 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3388 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3390 * @param[in] device_address This indicates an address of the device with which the pairing
3391 * should be initiated
3393 * @see bluetooth_cancel_bonding
3395 void bt_event_callback(int event, bluetooth_event_param_t *param)
3399 case BLUETOOTH_EVENT_BONDING_FINISHED:
3401 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3402 if (param->result >= BLUETOOTH_ERROR_NONE)
3404 bluetooth_device_info_t *device_info = NULL;
3405 device_info = (bluetooth_device_info_t *)param->param_data;
3406 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3407 mjr[%#x] min[%#x] srv[%#x]",
3408 device_info->device_name.name,
3409 device_info->device_address.addr[0],
3410 device_info->device_address.addr[1],
3411 device_info->device_address.addr[2],
3412 device_info->device_address.addr[3],
3413 device_info->device_address.addr[4],
3414 device_info->device_address.addr[5],
3415 device_info->device_class.major_class,
3416 device_info->device_class.minor_class,
3417 device_info->device_class.service_class);
3431 bluetooth_device_address_t device_address={{0}};
3433 ret = bluetooth_bond_device(&device_address);
3437 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3440 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3441 * bluetooth_conn_type_t conn_type)
3442 * @brief Initiate a bonding process
3445 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3446 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3448 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3449 * inititate the bonding request to the devices already in the paired list.
3451 * Usually we call this API after the device discovery.
3452 * This function is a asynchronous call.
3454 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3455 * mentioed result code
3456 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3457 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3458 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3459 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3460 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3462 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3463 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3466 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3469 * @return BLUETOOTH_ERROR_NONE - Success \n
3470 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3471 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3472 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3473 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3475 * @param[in] device_address This indicates an address of the device with which pairing
3476 * should be initiated
3477 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3480 * @see bluetooth_cancel_bonding
3482 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3483 bluetooth_conn_type_t conn_type);
3486 * @fn int bluetooth_cancel_bonding(void)
3487 * @brief Cancel the on-going bonding process
3489 * This API is called to cancel the on-going bonding procedure. It should be called before the
3490 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3491 * This API is useful when the remote device is not responding to the bond request or we wish to
3492 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3494 * This function is a synchronous call.
3496 * @return BLUETOOTH_ERROR_NONE - Success \n
3497 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3498 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3501 * @see bluetooth_bond_device
3507 ret = bluetooth_cancel_bonding();
3510 int bluetooth_cancel_bonding(void);
3513 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3514 * @brief Remove bonding
3517 * To communicate with remote device over bluetooth link, user should bond with peer device.
3518 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3519 * API is used to remove peer device from the list. Please note that after removing the device
3520 * from bonded device list, you cannot communication with peer device until bonding happens again.
3522 * User can call this function by passing bluetooth device address of any bonded device. Please note
3523 * that after successful return of this function, any bluetooth application running on your device
3524 * will not be able to communicate with unbonded device until bond operation happens again using
3525 * bluetooth_bond_device()
3528 * This function is a asynchronous call. The request to remove the specified device from the bonded
3529 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3530 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3531 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3535 * @return BLUETOOTH_ERROR_NONE - Success \n
3536 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3537 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3538 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3539 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3540 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3541 * agent is not running \n
3542 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3545 * @param[in] device_address This indicates an address of the device to remove bonding
3549 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3552 void bt_event_callback(int event, bluetooth_event_param_t *param)
3555 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3556 bluetooth_device_address_t *dev_addr = NULL;
3558 if (param->result == BLUETOOTH_ERROR_NONE) {
3559 dev_addr = (bluetooth_device_address_t *)param->param_data;
3561 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3562 dev_addr->addr[0], dev_addr->addr[1]
3563 dev_addr->addr[2], dev_addr->addr[3]
3564 dev_addr->addr[4], dev_addr->addr[5]
3575 bluetooth_device_address_t *device_address;
3577 // copy valid device address in device_address
3579 ret = bluetooth_unbond_device(device_address);
3582 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3585 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3586 * @brief Get bonded(paired) device list
3589 * This API gets all bonded device list.
3590 * The devices in the bonded device list further can be used to perform the authorization by calling
3591 * bluetooth_authorize_device API.
3593 * This function is a synchronous call.
3594 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3595 * there is no valid information in the dev_list.
3596 * The len field in the dev_list represents the number of bonded devices. The data structure for
3597 * bonded device information is bluetooth_device_info_t.
3600 * @return BLUETOOTH_ERROR_NONE - Success \n
3601 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3603 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3605 void bt_get_bonded_devices(void)
3609 GPtrArray *devinfo = NULL;
3610 bluetooth_device_info_t *ptr;
3612 // allocate the g_pointer_array
3613 devinfo = g_ptr_array_new();
3615 ret = bluetooth_get_bonded_device_list(&devinfo);
3616 if (ret != BLUETOOTH_ERROR_NONE)
3618 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3622 printf("g pointer arrary count : [%d]", devinfo->len);
3623 for (i=0; i<devinfo->len; i++)
3625 ptr = g_ptr_array_index(devinfo, i);
3628 printf("Name [%s]\n", ptr->device_name.name);
3629 printf("Major Class [%d]\n", ptr->device_class.major_class);
3630 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3631 printf("Service Class [%d]\n", ptr->device_class.service_class);
3632 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3633 ptr->device_address.addr[0],
3634 ptr->device_address.addr[1], ptr->device_address.addr[2],
3635 ptr->device_address.addr[3],
3636 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3643 // free g_pointer_array
3644 g_ptr_array_free(devinfo, TRUE);
3649 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3651 int bluetooth_get_profile_connected_device_list(
3652 const char *profile_uuid, GPtrArray **addr_list);
3655 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3656 * bluetooth_device_info_t *dev_info)
3657 * @brief Get a bonded(paired) device
3660 * This API gets a bonded device.
3662 * This function is a synchronous call.
3663 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3664 * there is no valid information in the dev_info.
3665 * The data structure for bonded device information is bluetooth_device_info_t.
3668 * @return BLUETOOTH_ERROR_NONE - Success \n
3669 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3671 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3673 void bt_get_bonded_device(void)
3677 bluetooth_device_info_t devinfo = {0};
3678 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3680 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3681 if (ret != BLUETOOTH_ERROR_NONE)
3683 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3687 printf("Name [%s]\n", devinfo.device_name.name);
3688 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3689 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3690 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3691 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3692 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3693 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3694 devinfo.device_address.addr[5]);
3703 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3704 bluetooth_device_info_t *dev_info);
3707 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3708 * gboolean *is_alias_set)
3709 * @brief Get is_alias_set property of device
3711 * This API gets is_alias_set property of a bonded device.
3713 * This function is a synchronous call.
3714 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3715 * If not,there is no valid information in the is_alias_set.
3717 * @return BLUETOOTH_ERROR_NONE - Success \n
3718 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3723 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3725 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3728 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3729 gboolean *is_alias_set);
3732 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3733 * @brief set alias for bonded device
3736 * This function set alias for bonded device.
3738 * This function is a synchronous call.
3741 * @return BLUETOOTH_ERROR_NONE - Success \n
3742 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3743 * @param[in] device_address This indicates an address of the remote device
3744 * @param[in] alias This indicates an alias to set
3749 ret = bluetooth_set_alias(&remote_address);
3752 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3756 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3757 * @brief Get remote deivice
3760 * This function gets specific remote device.
3762 * This function is a asynchronous call.
3763 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3766 * @return BLUETOOTH_ERROR_NONE - Success \n
3767 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3768 * @param[in] device_address This indicates an address of the remote device
3773 ret = bluetooth_get_remote_device(&remote_address);
3776 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3779 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3780 * gboolean authorized)
3781 * @brief Authorize/Unauthorize a bonded device
3784 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3785 * with/without user confirmation.
3787 * If we select a paired device and make it authorized by calling this API with the authorized
3788 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3789 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3790 * then it will ask for the user conformation before the connection.
3792 * This API supposed to be called on the paired devices. Which means we have to use this API only
3793 * after successful pairing.
3795 * This function is a asynchronous call.
3796 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3798 * @return BLUETOOTH_ERROR_NONE - Success \n
3799 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3800 * @param[in] device_address This indicates an address of the device to authorize \n
3801 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3803 * @see bluetooth_get_bonded_device_list
3805 void bt_event_callback(int event, bluetooth_event_param_t *param)
3809 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3811 if (param->result == BLUETOOTH_ERROR_NONE)
3815 //device authorization failed failure
3823 bluetooth_device_address_t device_address={{0}};
3824 gboolean authorized;
3828 ret = bluetooth_authorize_device(&device_address,authorized);
3831 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3832 gboolean authorized);
3834 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3835 const bluetooth_device_pin_code_t *pin_code);
3837 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3840 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3842 * @brief Receives Legacy Passkey\pin with following authentication response types
3844 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3845 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3848 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3851 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3853 * @brief This API sends user confirmation reply to the local adapter.
3855 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3858 int bluetooth_passkey_confirmation_reply(gboolean reply);
3861 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3862 * @brief Get all services supported by remote device
3865 * This API call initiates the search for the services supported by the specified device. Normally
3866 * the service search will take a couple of seconds to get it completed. Before calling this API
3867 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3868 * perform the service search. We can get the device address by doing a device discovery operation.
3871 * This function is a asynchronous call.
3872 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3874 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3875 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3876 * event is generated with appropriate result code.
3878 * @return BLUETOOTH_ERROR_NONE - Success \n
3879 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3880 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3881 * @param[in] device_address This indicates an address of the device
3882 * whose services need to be found
3884 * @see bluetooth_cancel_service_search
3886 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3889 * @fn int bluetooth_cancel_service_search(void)
3890 * @brief Cancel the ongoing service search operation
3893 * This function cancel the ongoing service search operation. This API is usually calling after the
3894 * bluetooth_search_service API.
3895 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3896 * if the user wish to cancel the Ongoing service search operation.
3898 * This API should be called just after the bluetooth_search_service API and before the
3899 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3901 * This function is a synchronous call.
3903 * @return BLUETOOTH_ERROR_NONE - Success \n
3904 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3905 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3906 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3909 * @see bluetooth_search_service
3914 ret = bluetooth_cancel_service_search();
3917 int bluetooth_cancel_service_search(void);
3920 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3921 * @brief Register rfcomm socket with a specific uuid
3924 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3925 * descriptor of the server.
3926 * This is the first API which is called to create the server. Once we created the server socket,
3927 * we will listen on that return socket.
3928 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3931 * @return socket FD on Success \n
3932 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3933 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3934 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3935 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3936 * @param[in] UUID (128 bits)
3939 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3943 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3944 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3948 int bluetooth_rfcomm_create_socket(const char *uuid);
3951 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3952 * @brief Register rfcomm socket with a specific uuid
3955 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3956 * descriptor of the server.
3957 * This is the first API which is called to create the server. Once we created the server socket,
3958 * we will listen on that return socket.
3959 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3962 * @return socket FD on Success \n
3963 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3964 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3965 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3966 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3967 * @param[in] UUID (128 bits)
3968 * @param[in] bus_name (const char)
3969 * @param[in] path (const char)
3972 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3976 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3977 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3981 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3984 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3985 * @brief De-register the rfcomm socket
3988 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3989 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3990 * descriptor else no event will come. We will call this API only after the
3991 * bluetooth_rfcomm_listen_and_accept.
3992 * This is a synchronous call.
3994 * @return BLUETOOTH_ERROR_NONE - Success \n
3995 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3996 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3997 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3998 * @param[in] int socket_fd
4001 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
4004 void bt_event_callback(int event, bluetooth_event_param_t *param)
4008 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4010 bluetooth_rfcomm_connection_t *discon_ind =
4011 (bluetooth_rfcomm_connection_t *)param->param_data;
4013 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4021 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4022 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4024 ret = bluetooth_rfcomm_remove_socket(fd);
4027 int bluetooth_rfcomm_remove_socket(int socket_fd);
4030 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4031 * @brief De-register the rfcomm socket
4034 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4035 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4036 * descriptor else no event will come. We will call this API only after the
4037 * bluetooth_rfcomm_listen_and_accept_ex.
4038 * This is a synchronous call.
4040 * @return BLUETOOTH_ERROR_NONE - Success \n
4041 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4042 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4043 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4044 * @param[in] UUID (128 bits)
4047 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4050 void bt_event_callback(int event, bluetooth_event_param_t *param)
4054 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4056 bluetooth_rfcomm_connection_t *discon_ind =
4057 (bluetooth_rfcomm_connection_t *)param->param_data;
4059 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4067 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4068 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4070 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4073 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4076 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4077 * @brief Disconnect rfcomm connection
4080 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4081 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4084 * @return BLUETOOTH_ERROR_NONE - Success \n
4085 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4086 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4087 * @param[in] int socket_fd the sending socket fd
4093 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4095 printf("Disconnection failed");
4097 printf("Disconnection Success");
4101 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4104 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4105 * @brief Rfcomm socket listen
4108 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4109 * after the bluetooth_rfcomm_create_socket API.
4110 * This API listen for the incomming connection and once it receives a connection, it will give
4111 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4112 * event to the application. This is an Asynchronous API call.
4115 * @return BLUETOOTH_ERROR_NONE - Success \n
4116 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4117 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4119 * @param[in] int socket_fd
4120 * @param[in] max pending connection.
4123 * @see bluetooth_rfcomm_create_socket
4126 void bt_event_callback(int event, bluetooth_event_param_t* param)
4130 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4132 bluetooth_rfcomm_connection_t *conn_ind =
4133 (bluetooth_rfcomm_connection_t *)param->param_data;
4135 printf("\nConnected from FD %d", conn_ind->socket_fd);
4143 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4144 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4148 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4151 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4152 * @brief Rfcomm socket listen
4155 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4156 * after the bluetooth_rfcomm_create_socket API.
4157 * This API listen for the incomming connection and once it receives a connection, it will give
4158 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4159 * event to the application. This is an Asynchronous API call.
4162 * @return BLUETOOTH_ERROR_NONE - Success \n
4163 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4164 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4166 * @param[in] int socket_fd
4167 * @param[in] max pending connection.
4172 * @see bluetooth_rfcomm_create_socket_ex
4175 void bt_event_callback(int event, bluetooth_event_param_t* param)
4179 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4181 bluetooth_rfcomm_connection_t *conn_ind =
4182 (bluetooth_rfcomm_connection_t *)param->param_data;
4184 printf("\nConnected from FD %d", conn_ind->socket_fd);
4192 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4193 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4198 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4201 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4202 * @brief Rfcomm socket listen
4205 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4206 * after the bluetooth_rfcomm_create_socket API.
4207 * This API listen for the incomming connection and once it receives a connection, it will give
4208 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4209 * event to the application. This is an Asynchronous API call.
4212 * @return BLUETOOTH_ERROR_NONE - Success \n
4213 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4214 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4216 * @param[in] int socket_fd
4217 * @param[in] max pending connection.
4220 * @see bluetooth_rfcomm_create_socket
4223 void bt_event_callback(int event, bluetooth_event_param_t* param)
4227 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4229 char *name = (char *)param->param_data;
4231 printf("\nConnected from %s", name);
4233 bluetooth_rfcomm_accept_connection();
4241 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4242 ret = bluetooth_rfcomm_listen(fd, 1);
4246 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4249 * @fn int bluetooth_rfcomm_accept_connection()
4250 * @brief Accepts the authorization request indicated by the event
4251 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4253 * This function is a synchronous call.
4255 * @return BLUETOOTH_ERROR_NONE - Success \n
4256 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4258 * @param[in] the socket fd of the server
4259 * @param[out] the socket fd of the client
4263 * @see bluetooth_rfcomm_reject_connection
4265 int bluetooth_rfcomm_accept_connection(int server_fd);
4268 * @fn int bluetooth_rfcomm_reject_connection()
4269 * @brief Rejects the authorization request indicated by the event
4270 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4272 * This function is a synchronous call.
4274 * @return BLUETOOTH_ERROR_NONE - Success \n
4275 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4277 * @param[in] the socket fd of the server
4281 * @see bluetooth_rfcomm_accept_connection
4283 int bluetooth_rfcomm_reject_connection(int server_fd);
4286 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4287 * @brief Informs whether rfcomm server uuid is available or not.
4289 * This function is a synchronous call.
4291 * @return TRUE - RFCOMM uuid is available \n
4292 * FALSE - RFCOMM uuid is not available \n
4294 * @param[in] uuid UUID string
4300 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4303 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4304 * const char *remote_uuid)
4305 * @brief Connect to the remote device rfcomm *
4307 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4308 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4309 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4310 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4311 * initiating a connection.
4313 * @return BLUETOOTH_ERROR_NONE - Success \n
4314 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4315 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4316 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4317 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4318 * @param[in] bluetooth_device_address_t remote bt_address
4319 * @param[in] char remote uuid
4321 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4325 void bt_event_callback(int event, bluetooth_event_param_t *param)
4329 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4331 if (param->result >= BLUETOOTH_ERROR_NONE)
4333 bt_sdp_info_t *bt_sdp_info=param->param_data;
4335 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4336 bt_sdp_info->device_addr.addr[0],
4337 bt_sdp_info->device_addr.addr[1],
4338 bt_sdp_info->device_addr.addr[2],
4339 bt_sdp_info->device_addr.addr[3],
4340 bt_sdp_info->device_addr.addr[4],
4341 bt_sdp_info->device_addr.addr[5]);
4343 printf("Supported service list:\n");
4344 for(i=0; i<bt_sdp_info->service_index; i++)
4346 bt_sdp_info->service_list_array[i]);
4349 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4350 //rfcomm_test_uuid);
4354 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4356 bluetooth_rfcomm_connection_t *conn_ind =
4357 (bluetooth_rfcomm_connection_t *)param->param_data;
4359 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4360 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4361 "SERVER" : "CLIENT");
4366 bluetooth_device_address_t remote_address = {{0},};
4367 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4368 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4369 ret = bluetooth_search_service(&remote_address);
4371 printf("Seach failed, Reason = %d", ret);
4373 printf("Search Success, Ret = %d", ret);
4375 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4377 printf("Connection failed, Reason = %d", ret);
4379 printf("Connection Success, Ret = %d", ret);
4383 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4384 const char *remote_uuid);
4387 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4388 * @brief Disconnect rfcomm connection
4391 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4392 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4395 * @return BLUETOOTH_ERROR_NONE - Success \n
4396 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4397 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4398 * @param[in] char remote bt_address
4401 * @see bluetooth_rfcomm_connect
4405 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4407 printf("Disconnection failed");
4409 printf("Disconnection Success");
4414 int bluetooth_rfcomm_disconnect(int socket_fd);
4417 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4418 * @brief Write to rfcomm connection
4421 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4422 * API is used to send the data for server and the client.
4424 * @return BLUETOOTH_ERROR_NONE - Success \n
4425 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4426 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4428 * @param[in] const char *buff Data buffer to send
4429 * @param[in] int length Length of the data
4432 * @see bluetooth_rfcomm_connect
4435 char *buff = "Test data 123456789"
4436 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4438 printf("Send failed");
4440 printf("Send success");
4444 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4447 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4448 * @brief Informs whether rfcomm client is connected.
4450 * This function is a synchronous call.
4452 * @return TRUE - RFCOMM client is connected \n
4453 * FALSE - RFCOMM client is not connected \n
4459 gboolean bluetooth_rfcomm_is_client_connected(void);
4460 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4461 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4464 * @fn int bluetooth_network_activate_server(void)
4465 * @brief Activate the NAP (Network Access Point) service
4467 * This function is a asynchronous call.
4468 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4470 * @return BLUETOOTH_ERROR_NONE - Success \n
4471 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4472 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4473 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4476 * @see bluetooth_network_deactivate_server
4479 int bluetooth_network_activate_server(void);
4482 * @fn int bluetooth_network_deactivate_server(void)
4483 * @brief Deactivate the NAP (Network Access Point) service
4485 * This function is a asynchronous call.
4486 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4488 * @return BLUETOOTH_ERROR_NONE - Success \n
4489 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4490 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4491 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4494 * @see bluetooth_network_activate_server
4497 int bluetooth_network_deactivate_server(void);
4500 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4501 * bluetooth_network_role_t role,
4503 * @brief Connect the network server in the peer
4505 * This function is a asynchronous call.
4506 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4508 * @return BLUETOOTH_ERROR_NONE - Success \n
4509 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4510 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4511 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4514 * @param[in] device_address This indicates an address of the device with which the pairing
4515 * should be initiated
4516 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4517 * need to use the third parameter.
4518 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4519 * connect. UUID string
4521 * @see bluetooth_network_disconnect
4523 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4524 bluetooth_network_role_t role, char *custom_uuid);
4527 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4528 * bluetooth_network_role_t role,
4529 * char *custom_uuid)
4530 * @brief Connect the network server in the peer
4532 * This function is a asynchronous call.
4533 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4535 * @return BLUETOOTH_ERROR_NONE - Success \n
4536 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4537 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4538 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4541 * @param[in] device_address This indicates an address of the device with which the pairing
4542 * should be initiated
4544 * @see bluetooth_network_connect
4546 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4549 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4550 * @brief Disconnect the device from the network
4552 * This function is an asynchronous call.
4553 * The network server disconnect request is responded by
4554 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4556 * @return BLUETOOTH_ERROR_NONE - Success \n
4557 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4558 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4559 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4562 * @param[in] device_address This indicates an address of the connected client device
4564 * @see bluetooth_network_activate_server
4566 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4571 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4572 * bt_hdp_role_type_t role,
4573 * bt_hdp_qos_type_t channel_type,
4574 * char **app_handle)
4575 * @brief Activate the HDP service for a particular data type
4577 * This function is a synchronous call.
4579 * @return BLUETOOTH_ERROR_NONE - Success \n
4580 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4581 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4582 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4585 * @param[in] data_type The data type against corresponding service
4586 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4587 * @param[in] channel_type The QOS type for the channel.
4588 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4589 * For role = HDP_ROLE_SINK, the channel_type
4590 * should be HDP_QOS_ANY.
4591 * @param[out] app_handle The application handler against corresponding service
4593 * @see bluetooth_hdp_deactivate
4595 int bluetooth_hdp_activate(unsigned short data_type,
4596 bt_hdp_role_type_t role,
4597 bt_hdp_qos_type_t channel_type,
4600 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4601 * @brief Deactivate the HDP service for a particular service using the handler
4603 * This function is a synchronous call.
4605 * @return BLUETOOTH_ERROR_NONE - Success \n
4606 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4607 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4608 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4611 * @param[in] app_handle The application handler against corresponding service
4613 * @see bluetooth_hdp_deactivate
4615 int bluetooth_hdp_deactivate(const char *app_handle);
4618 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4619 * const char *buffer, unsigned int size)
4620 * @brief Send data to the remote HDP device
4622 * This function is a synchronous call.
4624 * @return BLUETOOTH_ERROR_NONE - Success \n
4625 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4626 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4627 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4628 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4631 * @param[in] channel_id The channel id for the connection.
4632 * @param[in] buffer The pdu buffer.
4633 * @param[in] size Size of the buffer.
4635 * @see bluetooth_hdp_connect
4637 int bluetooth_hdp_send_data(unsigned int channel_id,
4638 const char *buffer, unsigned int size);
4640 * @fn int bluetooth_hdp_connect(const char *app_handle,
4641 * bt_hdp_qos_type_t channel_type,
4642 * const bluetooth_device_address_t *device_address)
4643 * @brief Connect to the remote device(Mainly used by source)
4645 * This function is a asynchronous call.
4646 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4648 * @return BLUETOOTH_ERROR_NONE - Success \n
4649 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4650 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4651 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4652 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4655 * @param[in] app_handle The application handler against corresponding service
4656 * @param[in] channel_type The QOS type for the channel.
4657 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4658 * @param[in] device_address The remote device Bd address.
4661 * @see bluetooth_hdp_disconnect
4663 int bluetooth_hdp_connect(const char *app_handle,
4664 bt_hdp_qos_type_t channel_type,
4665 const bluetooth_device_address_t *device_address);
4667 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4668 * const bluetooth_device_address_t *device_address)
4669 * @brief Disconnect from the remote device(Mainly used by source)
4671 * This function is a asynchronous call.
4672 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4674 * @return BLUETOOTH_ERROR_NONE - Success \n
4675 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4676 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4677 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4678 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4681 * @param[in] channel_id The channel id for the connection.
4682 * @param[in] device_address The remote device Bd address.
4685 * @see bluetooth_hdp_connect
4687 int bluetooth_hdp_disconnect(unsigned int channel_id,
4688 const bluetooth_device_address_t *device_address);
4692 * @fn int bluetooth_opc_init(void)
4693 * @brief Initialize OPP client.
4695 * This function is a synchronous call.
4696 * No event corresponding to this api
4698 * @return BLUETOOTH_ERROR_NONE - Success \n
4699 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4700 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4701 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4702 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4707 * @see bluetooth_opc_deinit
4709 int bluetooth_opc_init(void);
4712 * @fn int bluetooth_opc_deinit(void)
4713 * @brief Deinitialize OPP client.
4715 * This function is a synchronous call.
4716 * No event corresponding to this api
4718 * @return BLUETOOTH_ERROR_NONE - Success \n
4719 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4720 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4725 * @see bluetooth_opc_init
4728 int bluetooth_opc_deinit(void);
4731 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4732 char **file_name_array)
4733 * @brief Send multiple files to a remote device.
4735 * This function is a asynchronous call.
4736 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4738 * @return BLUETOOTH_ERROR_NONE - Success \n
4739 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4740 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4741 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4742 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4743 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4744 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4747 * @param[in] device_address The remote device Bd address.
4748 * @param[in] file_name_array Array of filepaths to be sent.
4751 * @see bluetooth_opc_cancel_push
4754 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4755 char **file_name_array);
4758 * @fn int bluetooth_opc_cancel_push(void)
4759 * @brief Cancels the ongoing file push.
4761 * This function is a asynchronous call.
4762 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4763 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4765 * @return BLUETOOTH_ERROR_NONE - Success \n
4766 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4767 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4772 * @see bluetooth_opc_push_files
4775 int bluetooth_opc_cancel_push(void);
4778 * @fn gboolean bluetooth_opc_session_is_exist(void)
4779 * @brief Informs whether opc session exists or not.
4781 * This function is a synchronous call.
4783 * @return TRUE - OPC session exists \n
4784 * FALSE - OPC session does not exist \n
4792 gboolean bluetooth_opc_session_is_exist(void);
4795 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4796 * @brief Informs whether opc session exists or not.
4798 * This function is a synchronous call.
4800 * @return BLUETOOTH_ERROR_NONE - Success \n
4801 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4802 * BLUETOOTH_ERROR_INTERNAL \n
4805 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4810 int bluetooth_opc_is_sending(gboolean *is_sending);
4813 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4814 int transfer_id, unsigned char *progress)
4815 * @brief Gets the percentage progress for ongoing transfers.
4817 * This function is a synchronous call.
4819 * @return BLUETOOTH_ERROR_NONE - Success \n
4820 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4821 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4824 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4825 * @param[in] transfer_id Transfer ID
4826 * @param[out] progress Percentage Progress
4830 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4831 int transfer_id, unsigned char *progress);
4834 * @fn int bluetooth_obex_server_init(const char *dst_path)
4835 * @brief Initialize OPP and FTP server.
4837 * This function is a synchronous call.
4838 * No event corresponding to this api
4840 * @return BLUETOOTH_ERROR_NONE - Success \n
4841 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4842 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4843 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4844 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4847 * @param[in] dst_path OPS destination file path.
4849 * @see bluetooth_obex_server_deinit
4851 int bluetooth_obex_server_init(const char *dst_path);
4855 * @fn int bluetooth_obex_server_deinit(void)
4856 * @brief Deinitialize OPP and FTP server.
4858 * This function is a synchronous call.
4859 * No event corresponding to this api
4861 * @return BLUETOOTH_ERROR_NONE - Success \n
4862 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4863 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4868 * @see bluetooth_obex_server_init
4870 int bluetooth_obex_server_deinit(void);
4874 * @fn gboolean bluetooth_obex_server_is_activated(void)
4875 * @brief Informs whether obex server is activated or not.
4877 * This function is a synchronous call.
4879 * @return TRUE - OBEX server is activated \n
4880 * FALSE - OBEX server is not activated \n
4887 gboolean bluetooth_obex_server_is_activated(void);
4891 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4892 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4894 * This function is a synchronous call.
4895 * No event corresponding to this api
4897 * @return BLUETOOTH_ERROR_NONE - Success \n
4898 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4899 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4900 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4901 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4905 * @param[in] dst_path OPS destination file path.
4907 * @see bluetooth_obex_server_deinit_without_agent
4909 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4913 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4914 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4916 * This function is a synchronous call.
4917 * No event corresponding to this api
4919 * @return BLUETOOTH_ERROR_NONE - Success \n
4920 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4921 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4926 * @see bluetooth_obex_server_init_without_agent
4928 int bluetooth_obex_server_deinit_without_agent(void);
4932 * @fn int bluetooth_obex_server_accept_connection(void)
4933 * @brief Accepts the authorization request indicated by the event
4934 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4936 * This function is a synchronous call.
4938 * @return BLUETOOTH_ERROR_NONE - Success \n
4939 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4940 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4944 * @see bluetooth_obex_server_reject_authorize
4946 int bluetooth_obex_server_accept_connection(void);
4950 * @fn int bluetooth_obex_server_reject_connection(void)
4951 * @brief Rejects the authorization request indicated by the event
4952 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4954 * This function is a synchronous call.
4956 * @return BLUETOOTH_ERROR_NONE - Success \n
4957 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4958 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4962 * @see bluetooth_obex_server_reject_authorize
4964 int bluetooth_obex_server_reject_connection(void);
4968 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4969 * @brief Accepts the authorization request indicated by the event
4970 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4972 * This function is a asynchronous call.
4973 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4975 * @return BLUETOOTH_ERROR_NONE - Success \n
4976 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4977 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4978 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4981 * @param[in] filename Authorized filename.
4984 * @see bluetooth_obex_server_reject_authorize
4987 int bluetooth_obex_server_accept_authorize(const char *filename);
4990 * @fn int bluetooth_obex_server_reject_authorize(void)
4991 * @brief Reject the authorization request indicated by the event
4992 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4994 * This function is a asynchronous call.
4995 * No event for this api..
4997 * @return BLUETOOTH_ERROR_NONE - Success \n
4998 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4999 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5004 * @see bluetooth_obex_server_accept_authorize
5007 int bluetooth_obex_server_reject_authorize(void);
5010 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5011 * @brief Set the OPS destination file path..
5013 * This function is a asynchronous call.
5014 * No event for this api..
5016 * @return BLUETOOTH_ERROR_NONE - Success \n
5017 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5018 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5019 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5022 * @param[in] dst_path OPS destination file path.
5028 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5031 * @fn int bluetooth_obex_server_set_root(const char *root)
5032 * @brief Set the FTS root folder..
5034 * This function is a asynchronous call.
5035 * No event for this api..
5037 * @return BLUETOOTH_ERROR_NONE - Success \n
5038 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5039 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5040 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5041 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5042 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5045 * @param[in] root FTS root folder.
5051 int bluetooth_obex_server_set_root(const char *root);
5054 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5055 * @brief Cancel the transfer on server
5057 * This function is an asynchronous call.
5058 * If the function call that cancels transfer is successful, the application would receive
5059 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5060 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5061 * the error code will be BLUETOOTH_ERROR_NONE
5063 * @return BLUETOOTH_ERROR_NONE - Success \n
5064 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5065 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5066 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5067 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5070 * @param[in] transfer_id transfer ID
5075 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5079 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5080 * @brief Cancel the transfer on server
5082 * This function is an asynchronous call.
5083 * If the function call that cancels transfer is successful, the application would receive
5084 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5085 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5086 * the error code will be BLUETOOTH_ERROR_NONE
5088 * @return BLUETOOTH_ERROR_NONE - Success \n
5089 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5090 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5091 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5092 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5099 int bluetooth_obex_server_cancel_all_transfers(void);
5103 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5104 * @brief Informs whether obex server is receiving or not.
5106 * This function is a synchronous call.
5108 * @return BLUETOOTH_ERROR_NONE - Success \n
5109 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5110 * BLUETOOTH_ERROR_INTERNAL \n
5113 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5118 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5122 * @fn int bluetooth_map_client_init(void)
5123 * @brief Initialize MAP client.
5125 * This function is a synchronous call.
5126 * No event corresponding to this api
5128 * @return BLUETOOTH_ERROR_NONE - Success \n
5129 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5130 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5131 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5132 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5137 * @see bluetooth_map_client_deinit
5139 int bluetooth_map_client_init(void);
5141 int bluetooth_map_client_deinit(void);
5143 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5145 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5147 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5149 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5150 bt_map_client_list_folders_filter_t *filter);
5153 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5154 * @brief Return all available fields that can be used in Fields filter.
5156 * This function is a asynchronous call.
5158 * @return BLUETOOTH_ERROR_NONE - Success \n
5159 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5160 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5163 * @param[in] session Information about session.
5166 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5168 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5170 bt_map_client_list_messages_filter_t *filter);
5172 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5174 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5175 const char *source_file,
5177 bt_map_client_push_message_args_t *args);
5179 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5180 const bt_map_client_message_object_t message_object,
5181 const char *target_file,
5186 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5187 * @brief Read the local Hash and Randmizer.
5189 * This function is a synchronous call.
5191 * @return BLUETOOTH_ERROR_NONE - Success \n
5192 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5196 * @param[out] local_oob_data - Pointer to the local OOB data
5202 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5206 * @fn int bluetooth_oob_add_remote_data(
5207 * const bluetooth_device_address_t *remote_device_address,
5208 * bluetooth_bdaddr_type_e address_type,
5209 * bt_oob_data_t *oob_data)
5210 * @brief Add/updated the remote device Hash and Randmizer.
5212 * This function is a synchronous call.
5213 * No event for this api..
5215 * @return BLUETOOTH_ERROR_NONE - Success \n
5216 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5219 * @param[in] remote_device_address - Remote device address
5220 * address_type - bdaddr type
5221 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5227 int bluetooth_oob_add_remote_data(
5228 const bluetooth_device_address_t *remote_device_address,
5229 bluetooth_bdaddr_type_e address_type,
5230 bt_oob_data_t *remote_oob_data);
5234 * @fn int bluetooth_oob_remove_remote_data(
5235 * const bluetooth_device_address_t *remote_device_address)
5236 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5238 * This function is a synchronous call.
5239 * No event for this api..
5241 * @return BLUETOOTH_ERROR_NONE - Success \n
5242 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5245 * @param[in] remote_device_address - Remote device address
5251 int bluetooth_oob_remove_remote_data(
5252 const bluetooth_device_address_t *remote_device_address);
5256 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5257 * @brief Read the local Hash and Randmizer.
5259 * This function is a synchronous call.
5261 * @return BLUETOOTH_ERROR_NONE - Success \n
5262 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5266 * @param[out] local_oob_data - Pointer to the local OOB data
5271 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5274 * @fn int bluetooth_le_oob_add_remote_data(
5275 * const bluetooth_device_address_t *remote_device_address,
5276 * bluetooth_bdaddr_type_e address_type,
5277 * bt_oob_data_t *oob_data)
5278 * @brief Add/updated the remote device Hash and Randmizer.
5280 * This function is a synchronous call.
5281 * No event for this api..
5283 * @return BLUETOOTH_ERROR_NONE - Success \n
5284 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5287 * @param[in] remote_device_address - Remote device address
5288 * address_type - bdaddr type
5289 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5294 int bluetooth_le_oob_add_remote_data(
5295 const bluetooth_device_address_t *remote_device_address,
5296 bluetooth_bdaddr_type_e address_type,
5297 bt_oob_data_t *remote_oob_data);
5300 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5301 * bt_gatt_handle_info_t *prim_svc);
5303 * @brief Gets the GATT based primary services handle supported by remote device
5305 * This function is a synchronous call.
5306 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5308 * @return BLUETOOTH_ERROR_NONE - Success \n
5309 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5310 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5311 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5314 * @param[in] address - Remote device address
5315 * @param[out] prim_svc - Structure containing remote service count and handle list.
5318 * @see bluetooth_gatt_free_primary_services()
5320 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5321 bt_gatt_handle_info_t *prim_svc);
5324 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5326 * @brief Discovers the characteristics of GATT based service of remote device
5328 * This function is an asynchronous call.
5329 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5331 * @return BLUETOOTH_ERROR_NONE - Success \n
5332 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5333 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5334 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5337 * @param[in] service_handle - Handle for remote service.
5342 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5344 int bluetooth_gatt_set_service_change_watcher(
5345 const bluetooth_device_address_t *address, gboolean enable);
5348 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5349 * bt_gatt_service_property_t *service);
5351 * @brief Gets the properties of GATT based service of remote device
5353 * This function is a synchronous call.
5354 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5356 * @return BLUETOOTH_ERROR_NONE - Success \n
5357 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5358 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5359 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5362 * @param[in] service_handle - Handle for remote service.
5363 * @param[out] service - Structure containing remote service property.
5366 * @see bluetooth_gatt_free_service_property()
5368 int bluetooth_gatt_get_service_property(const char *service_handle,
5369 bt_gatt_service_property_t *service);
5372 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5374 * @brief Register to GATT based service to receive value change notification/indication.
5376 * This function is a synchronous call.
5377 * No event for this api.
5379 * @return BLUETOOTH_ERROR_NONE - Success \n
5380 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5381 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5382 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5385 * @param[in] service_handle - Handle for remote service.
5386 * @param[in] service_name - Friednly name of service uuid.
5391 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5394 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5396 * @brief Unregister GATT based service to receive value change notification/indication.
5398 * This function is a synchronous call.
5399 * No event for this api.
5401 * @return BLUETOOTH_ERROR_NONE - Success \n
5402 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5403 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5404 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5407 * @param[in] service_handle - Handle for remote service.
5412 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5415 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5416 * bt_gatt_char_property_t *characteristic);
5418 * @brief Provides characteristic value along with properties.
5420 * This function is a synchronous call.
5421 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5423 * @return BLUETOOTH_ERROR_NONE - Success \n
5424 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5425 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5426 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5429 * @param[in] char_handle - Handle for Characteristic property.
5430 * @param[out] characteristic - Structure containing remote characteristic property.
5433 * @see bluetooth_gatt_free_char_property()
5435 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5436 bt_gatt_char_property_t *characteristic);
5439 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5440 * bt_gatt_char_property_t *characteristic);
5442 * @brief Provides characteristic descriptor value along with its UUID.
5444 * This function is a synchronous call.
5445 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5447 * @return BLUETOOTH_ERROR_NONE - Success \n
5448 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5449 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5450 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5453 * @param[in] desc_handle - Handle for Characteristic descriptor.
5454 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5457 * @see bluetooth_gatt_free_desc_property()
5459 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5460 bt_gatt_char_descriptor_property_t *descriptor);
5464 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5465 * const guint8 *value, int length)
5467 * @brief Set characteristic value.
5469 * This function is a synchronous call.
5471 * @return BLUETOOTH_ERROR_NONE - Success \n
5472 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5473 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5474 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5477 * @param[in] char_handle - Handle for Characteristic property.
5478 * @param[in] value - New value to set for characteristic property.
5479 * @param[in] length - Length of the value to be set.
5484 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5485 const guint8 *value, int length);
5488 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5489 * const guint8 *value, int length, guint8 write_type)
5491 * @brief Set characteristic value by write type.
5493 * This function is a synchronous call if write type is "write without resonse"
5494 * and it is an asynchronous call if write type is "write with response"
5496 * @return BLUETOOTH_ERROR_NONE - Success \n
5497 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5498 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5499 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5502 * @param[in] char_handle - Handle for Characteristic property.
5503 * @param[in] value - New value to set for characteristic property.
5504 * @param[in] length - Length of the value to be set.
5505 * @param[in] write_type - Type of write.
5510 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5511 const guint8 *value, int length,
5512 guint8 write_type, gpointer app_data);
5516 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5517 * const guint8 *value, int length)
5519 * @brief Set characteristic value request.
5521 * This function is an asynchronous call.
5523 * @return BLUETOOTH_ERROR_NONE - Success \n
5524 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5525 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5526 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5529 * @param[in] char_handle - Handle for Characteristic property.
5530 * @param[in] value - New value to set for characteristic property.
5531 * @param[in] length - Length of the value to be set.
5536 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5537 const guint8 *value, int length);
5540 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5542 * @brief Read characteristic value.
5544 * This function is a asynchronous call.
5546 * @return BLUETOOTH_ERROR_NONE - Success \n
5547 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5548 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5549 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5552 * @param[in] char_handle - Handle for Characteristic property.
5557 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5560 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5561 * const char *service_uuid,
5562 * bt_gatt_service_property_t *service)
5564 * @brief Gets the service property from a device based on a particular uuid
5566 * This function is a synchronous call.
5568 * @return BLUETOOTH_ERROR_NONE - Success \n
5569 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5570 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5571 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5574 * @param[in] address - BD address of the remote device
5575 * @param[in] service_uuid - uuid of the service.
5576 * @param[out] service - Structure containing the service property.
5581 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5582 const char *service_uuid,
5583 bt_gatt_service_property_t *service);
5586 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5587 * const char *char_uuid)
5589 * @brief Gets the characteristic property from a service based on a particular char uuid
5591 * This function is an asynchronous call.
5592 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5594 * @return BLUETOOTH_ERROR_NONE - Success \n
5595 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5596 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5597 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5600 * @param[in] service_handle - Service handle.
5601 * @param[in] uuid - Characteristic uuid.
5606 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5607 const char *char_uuid);
5610 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5612 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5614 * This function is a synchronous call.
5615 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5617 * @return BLUETOOTH_ERROR_NONE - Success \n
5618 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5621 * @param[in] prim_svc - GATT handle info structure
5624 * @see bluetooth_gatt_get_primary_services()
5626 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5629 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5631 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5633 * This function is a synchronous call.
5634 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5636 * @return BLUETOOTH_ERROR_NONE - Success \n
5637 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5640 * @param[in] svc_pty - GATT service property structure.
5643 * @see bluetooth_gatt_get_service_property()
5645 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5648 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5650 * @brief Provides characteristic value along with properties.
5652 * This function is a synchronous call.
5653 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5655 * @return BLUETOOTH_ERROR_NONE - Success \n
5656 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5659 * @param[in] char_pty - GATT characteristics property structure.
5662 * @see bluetooth_gatt_get_characteristics_property()
5664 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5667 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5669 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5671 * This function is a synchronous call.
5672 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5674 * @return BLUETOOTH_ERROR_NONE - Success \n
5675 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5678 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5681 * @see bluetooth_gatt_get_char_descriptor_property()
5683 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5685 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5686 gboolean auto_connect, int client_id);
5688 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5691 int bluetooth_get_gatt_data_batching_available_packets(
5692 int *available_packets);
5694 int bluetooth_enable_gatt_data_batching(
5695 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5697 int bluetooth_disable_gatt_data_batching(
5698 const bluetooth_device_address_t *device_address);
5701 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5703 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5705 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5707 * @return BLUETOOTH_ERROR_NONE - Success \n
5708 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5711 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5715 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5718 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5720 * @brief Read characteristic descriptor value.
5722 * This function is a asynchronous call.
5724 * @return BLUETOOTH_ERROR_NONE - Success \n
5725 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5726 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5727 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5730 * @param[in] desc_handle - Handle for Characteristic descriptor
5735 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5738 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5739 * const guint8 *value, int length);
5741 * @brief Set characteristic descriptor value.
5743 * This function is a asynchronous call.
5745 * @return BLUETOOTH_ERROR_NONE - Success \n
5746 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5747 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5748 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5751 * @param[in] desc_handle - Handle for Characteristic descriptor
5752 * @param[in] value - New value to set for characteristic descriptor
5753 * @param[in] length - Length of the value to be set.
5758 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5759 const guint8 *value, int length, gpointer app_data);
5761 /* @fn int bluetooth_gatt_init(void)
5763 * @brief Initializes the gatt service.
5765 * This function is a synchronous call.
5766 * @return BLUETOOTH_ERROR_NONE - Success \n
5767 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5768 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5769 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5772 * @remark Adapter should be enabled
5773 * @see bluetooth_gatt_deinit()
5775 int bluetooth_gatt_init(void);
5777 /* @fn int bluetooth_gatt_init(void)
5779 * @brief DeInitializes the gatt service.
5781 * This function is a synchronous call.
5782 * @return BLUETOOTH_ERROR_NONE - Success \n
5783 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5784 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5785 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5788 * @remark Adapter should be enabled
5789 * @see bluetooth_gatt_init()
5791 int bluetooth_gatt_deinit(void);
5793 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5794 unsigned char **svc_path)
5796 * @brief Exports a new gatt service to the service interface.
5798 * This function is a synchronous call.
5800 * @return BLUETOOTH_ERROR_NONE - Success \n
5801 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5802 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5803 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5806 * @param[in] svc_uuid Gatt service uuid.
5807 * @param[out] svc_path service object path of the exported service.
5808 * @remark Adapter should be enabled
5809 * @see bluetooth_gatt_init()
5811 int bluetooth_gatt_add_service(const char *svc_uuid,
5814 /* @fn int bluetooth_gatt_add_new_characteristic(
5815 const char *svc_path, const char *char_uuid,
5816 bt_gatt_permission_t permissions,
5817 bt_gatt_characteristic_property_t properties,
5818 int flags_length, char **char_path);;
5820 * @brief Exports a new gatt characteristic to the characteristic interface.
5822 * This function is a synchronous call.
5823 * @return BLUETOOTH_ERROR_NONE - Success \n
5824 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5825 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5826 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5828 * @param[in] svc_path service object path of the exported service.
5829 * @param[in] char_uuid Gatt service uuid.
5830 * @param[in] properties GATT characteristic properties.
5831 * @param[out] char_path characteristic object path of the exported characteristic.
5833 * @remark Adapter should be enabled
5834 * @see bluetooth_gatt_add_service()
5836 int bluetooth_gatt_add_new_characteristic(
5837 const char *svc_path, const char *char_uuid,
5838 bt_gatt_permission_t permissions,
5839 bt_gatt_characteristic_property_t properties,
5842 /* @fn bluetooth_gatt_set_characteristic_value(
5843 const char *characteristic, const char *char_value,
5846 * @brief adds gatt charactertisic value to the given charactertistic path.
5848 * This function is a synchronous call.
5849 * @return BLUETOOTH_ERROR_NONE - Success \n
5850 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5851 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5852 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5854 * @param[in] char_value Value of the GATT characteristic to be added.
5855 * @param[in] value_length length of the chantacteristic value..
5856 * @param[out] characteristic characteristic object path..
5858 * @remark Adapter should be enabled
5859 * @see bluetooth_gatt_add_service()
5861 int bluetooth_gatt_set_characteristic_value(
5862 const char *characteristic, const char *char_value,
5865 /* @fn int bluetooth_gatt_add_descriptor(
5866 const char *char_path, const char *desc_uuid,
5867 bt_gatt_permission_t permissions,
5870 * @brief Exports a new gatt descriptor to the descriptor interface.
5872 * This function is a synchronous call.
5874 * @return BLUETOOTH_ERROR_NONE - Success \n
5875 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5876 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5877 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5880 * @param[in] desc_uuid Gatt descriptor uuid.
5881 * @param[in] desc_value GATT descriptor value.
5882 * @param[in] value_length Length of GATT descriptor value.
5883 * @param[in] permissions descriptor permissions.
5884 * @param[in] properties GATT descriptor properties.
5885 * @param[in] char_path characteristics object path of the exported character.
5887 * @remark Adapter should be enabled
5888 * @see bluetooth_gatt_add_service()
5889 * @see bluetooth_gatt_add_characteristics()
5891 int bluetooth_gatt_add_descriptor(
5892 const char *char_path, const char *desc_uuid,
5893 bt_gatt_permission_t permissions,
5896 /* @fn int bluetooth_gatt_set_descriptor_value(
5897 const char *desc_path, const char *desc_value,
5900 * @brief Adds value to the given descriptor handle.
5902 * This function is a synchronous call.
5904 * @return BLUETOOTH_ERROR_NONE - Success \n
5905 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5906 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5907 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5910 * @param[in] desc_value GATT descriptor value.
5911 * @param[in] value_length Length of GATT descriptor value.
5912 * @param[in] desc_path descriptor path to which the value needs to be added.
5914 * @remark Adapter should be enabled
5915 * @see bluetooth_gatt_add_service()
5916 * @see bluetooth_gatt_add_characteristics()
5918 int bluetooth_gatt_set_descriptor_value(
5919 const char *desc_path, const char *desc_value,
5922 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5924 * @brief Reads the Service registered on manager interface.
5926 * This function is a synchronous call.
5928 * @return BLUETOOTH_ERROR_NONE - Success \n
5929 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5930 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5931 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5934 * @param[in] svc_uuid Gatt Service uuid.
5936 * @remark Adapter should be enabled and service should be registered.
5937 * @see bluetooth_gatt_register_service()
5939 int bluetooth_gatt_get_service(const char *svc_uuid);
5941 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5943 * @brief Registers the given service path with the library.
5945 * This function is a synchronous call.
5947 * @return BLUETOOTH_ERROR_NONE - Success \n
5948 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5949 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5950 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5953 * @param[in] svc_path service object path of the exported service.
5955 * @remark Adapter should be enabled
5956 * @see bluetooth_gatt_add_service()
5957 * @see bluetooth_gatt_add_characteristics()
5958 * @see bluetooth_gatt_add_descriptor()
5959 * @see bluetooth_gatt_register_application()
5961 int bluetooth_gatt_register_service(const char *svc_path);
5963 /* @fn int bluetooth_gatt_register_application(void)
5965 * @brief Registers the application with the bluez gatt server.
5967 * This function is a synchronous call.
5969 * @return BLUETOOTH_ERROR_NONE - Success \n
5970 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5971 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5972 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5976 * @remark Adapter should be enabled
5977 * @see bluetooth_gatt_init()
5978 * @see bluetooth_gatt_add_service()
5979 * @see bluetooth_gatt_add_characteristics()
5980 * @see bluetooth_gatt_add_descriptor()
5981 * @see bluetooth_gatt_register_service()
5983 int bluetooth_gatt_register_application(void);
5985 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5987 * @brief Removes(unregister) service from the bluez gatt server db.
5989 * This function is a synchronous call.
5991 * @return BLUETOOTH_ERROR_NONE - Success \n
5992 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5993 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5994 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5997 * @param[in] svc_path service object path of the exported service.
5999 * @remark Adapter should be enabled
6000 * @see bluetooth_gatt_add_service()
6001 * @see bluetooth_gatt_add_characteristics()
6002 * @see bluetooth_gatt_add_descriptor()
6003 * @see bluetooth_gatt_register_service()
6005 int bluetooth_gatt_unregister_service(const char *svc_path);
6007 /* @fn int bluetooth_gatt_unregister_application(void)
6009 * @brief Removes(unregister) the application with the bluez gatt server,
6010 * and deletes all the service registered.
6012 * This function is a synchronous call.
6014 * @return BLUETOOTH_ERROR_NONE - Success \n
6015 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6016 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6017 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6021 * @remark Adapter should be enabled
6022 * @see bluetooth_gatt_init()
6023 * @see bluetooth_gatt_add_service()
6024 * @see bluetooth_gatt_add_characteristics()
6025 * @see bluetooth_gatt_add_descriptor()
6026 * @see bluetooth_gatt_register_service()
6027 * @see bluetooth_gatt_unregister_service()
6029 int bluetooth_gatt_unregister_application(void);
6031 /* @fn int bluetooth_gatt_send_response(int request_id,
6032 * int offset, char *value, int value_length)
6034 * @brief Updates the attribute value in local attribute list.
6036 * This function is a synchronous call.
6038 * @return BLUETOOTH_ERROR_NONE - Success \n
6039 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6040 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6041 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6044 * @param[in] request_id The identification of a read request
6045 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6046 * @param[in] resp_state The identification of response state
6047 * @param[in] offset The offset from where a value is read
6048 * @param[in] value The value to be sent. It will be sent from @a offset.
6049 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6050 * @param[in] value_length Value Length.
6052 * @remark Adapter should be enabled
6053 * @see bluetooth_gatt_add_service()
6054 * @see bluetooth_gatt_add_characteristics()
6055 * @see bluetooth_gatt_add_descriptor()
6056 * @see bluetooth_gatt_register_service()
6058 int bluetooth_gatt_send_response(int request_id, guint req_type,
6059 int resp_state, int offset, char *value, int value_length);
6061 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6063 * @brief Sets the notification property for a characteristic.
6065 * This function is a synchronous call.
6067 * @return BLUETOOTH_ERROR_NONE - Success \n
6068 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6069 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6070 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6073 * @param[in] char_path characteristic object path.
6074 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6076 * @remark Adapter should be enabled
6077 * @see bluetooth_gatt_update_characteristic()
6079 int bluetooth_gatt_server_set_notification(const char *char_path,
6080 bluetooth_device_address_t *unicast_address);
6082 /* @fn int bluetooth_gatt_delete_services(void)
6084 * @brief deletes (unregisters) all services from the gatt server database..
6086 * This function is a synchronous call.
6088 * @return BLUETOOTH_ERROR_NONE - Success \n
6089 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6090 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6091 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6095 * @remark Adapter should be enabled
6096 * @see bluetooth_gatt_add_service()
6097 * @see bluetooth_gatt_add_characteristics()
6098 * @see bluetooth_gatt_add_descriptor()
6099 * @see bluetooth_gatt_register_service()
6100 * @see bluetooth_gatt_unregister_service()
6102 int bluetooth_gatt_delete_services(void);
6104 /* @fn int bluetooth_gatt_update_characteristic(void)
6106 * @brief updates the given characteristic with a new value
6108 * This function is a synchronous call.
6110 * @return BLUETOOTH_ERROR_NONE - Success \n
6111 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6112 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6113 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6117 * @remark Adapter should be enabled
6118 * @see bluetooth_gatt_add_service()
6119 * @see bluetooth_gatt_add_characteristics()
6120 * @see bluetooth_gatt_add_descriptor()
6121 * @see bluetooth_gatt_register_service()
6122 * @see bluetooth_gatt_unregister_service()
6124 int bluetooth_gatt_update_characteristic(const char *char_path,
6125 const char* char_value, int value_length);
6128 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6130 * @brief Set advertising status.
6132 * This function is used to enable or disable LE advertising.
6133 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6135 * This function is a synchronous call.
6137 * @return BLUETOOTH_ERROR_NONE - Success \n
6138 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6139 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6142 * @param[in] enable - The status of advertising
6145 * @see bluetooth_set_advertising_data
6147 int bluetooth_set_advertising(int handle, gboolean enable);
6150 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6152 * @brief Set advertising status along with interval value.
6154 * This function is used to enable or disable LE advertising.
6155 * Interval_min and Interval_max is used to set the best advertising interval.
6156 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6158 * This function is a synchronous call.
6160 * @return BLUETOOTH_ERROR_NONE - Success \n
6161 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6162 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6165 * @param[in] enable - The status of advertising
6166 * @param[in] interval_min - Minimum interval of advertising (msec)
6167 * @param[in] interval_max - Maximum interval of advertising (msec)
6168 * @param[in] filter_policy - Advertising filter policy
6171 * @see bluetooth_set_advertising_data
6173 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6174 bluetooth_advertising_params_t *params);
6177 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6178 * @brief Get the advertising data
6180 * This function is used to get advertising data.
6181 * Before calling this API, the adapter should be enabled.
6183 * This function is a synchronous call.
6185 * @return BLUETOOTH_ERROR_NONE - Success \n
6186 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6187 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6188 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6190 * @param[out] value - Advertising data structure.
6191 * @param[out] length - The length of Advertising data.
6195 bluetooth_advertising_data_t *value = { {0} };
6198 ret = bluetooth_get_advertising_data(&value, &length);
6201 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6204 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6206 * @brief Set advertising data with value
6208 * This function is used to set advertising data and Maximum size of advertising data
6209 * is 28 byte (Except Flag)
6211 * This function is a synchronous call.
6213 * @return BLUETOOTH_ERROR_NONE - Success \n
6214 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6215 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6218 * @param[in] value - Advertising data structure.
6222 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6225 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6227 * @brief Check the privilege for advertising parameter setting
6229 * This function is a synchronous call.
6231 * @return BLUETOOTH_ERROR_NONE - Success \n
6232 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6238 int bluetooth_check_privilege_advertising_parameter(void);
6241 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6242 * @brief Get the LE scan response data
6244 * This function is used to get scan response data.
6245 * Before calling this API, the adapter should be enabled.
6247 * This function is a synchronous call.
6249 * @return BLUETOOTH_ERROR_NONE - Success \n
6250 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6251 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6252 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6254 * @param[out] value - Scan response data structure.
6255 * @param[out] length - The length of Scan response data.
6259 bluetooth_scan_resp_data_t *value = { {0} };
6262 ret = bluetooth_get_scan_response_data(&value, &length);
6265 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6268 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6270 * @brief Set scan response data with value
6272 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6274 * This function is a synchronous call.
6276 * @return BLUETOOTH_ERROR_NONE - Success \n
6277 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6278 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6281 * @param[in] value - LE Scan response data structure.
6285 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6288 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6290 * @brief Set scan interval and window
6292 * This function is used to set LE scan interval and window size
6294 * This function is a synchronous call.
6296 * @return BLUETOOTH_ERROR_NONE - Success \n
6297 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6298 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6301 * @param[in] interval - Interval of LE scan (msec)
6302 * @param[in] window - Window size of LE scan (msec)
6306 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6309 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6311 * @brief Set scan type
6313 * This function is used to set LE scan type
6315 * This function is a synchronous call.
6317 * @return BLUETOOTH_ERROR_NONE - Success \n
6318 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6319 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6322 * @param[in] scan_type - LE scan type
6326 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6329 * @fn int bluetooth_is_advertising(void)
6330 * @brief Check for the advertising is in-progress or not.
6332 * This API is used to check the current status of the advertising procedure.
6333 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6336 * This function checks whether the advertising is started or not.
6338 * This function is a synchronous call.
6340 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6342 * @return BLUETOOTH_ERROR_NONE - Success \n
6343 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6346 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6350 gboolean is_advertising = 0;
6352 ret = bluetooth_is_advertising(&is_advertising);
6355 int bluetooth_is_advertising(gboolean *is_advertising);
6358 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6359 * @brief Add LE device to white list
6361 * This API is used to add LE device to white list
6362 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6366 * This function is a synchronous call.
6368 * @param[in] address The address of remote device
6370 * @return BLUETOOTH_ERROR_NONE - Success \n
6371 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6374 * @see bluetooth_set_custom_advertising
6376 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6379 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6380 * @brief Remove LE device from white list
6382 * This API is used to remove LE device from white list
6383 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6387 * This function is a synchronous call.
6389 * @param[in] address The address of remote device
6391 * @return BLUETOOTH_ERROR_NONE - Success \n
6392 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6395 * @see bluetooth_set_custom_advertising
6397 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6400 * @fn int bluetooth_clear_white_list(void)
6401 * @brief Clear white list
6403 * This API is used to clear white list
6404 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6408 * This function is a synchronous call.
6410 * @param[in] address The address of remote device
6412 * @return BLUETOOTH_ERROR_NONE - Success \n
6413 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6416 * @see bluetooth_set_custom_advertising
6418 int bluetooth_clear_white_list(void);
6421 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6422 * const bluetooth_le_connection_param_t *parameters)
6423 * @brief update connection paramter of LE connection.
6425 * This function is a synchronous call.
6427 * @return BLUETOOTH_ERROR_NONE - Success \n
6428 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6431 * @param[in] address - remote device address value.
6432 * @param[in] parameters - new connection parameters.
6435 * @see bluetooth_bond_device
6437 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6438 const bluetooth_le_connection_param_t *parameters);
6441 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6443 * @brief Enable/Disable LE Privacy feature.
6445 * This function is used to enable or disable LE Privacy feature.
6446 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6448 * This function is a synchronous call.
6450 * @return BLUETOOTH_ERROR_NONE - Success \n
6451 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6452 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6455 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6459 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6462 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6464 * @brief Enable/Disable LE static random address.
6466 * This function is used to enable or disable LE static random address.
6468 * This function is a synchronous call.
6470 * @return BLUETOOTH_ERROR_NONE - Success \n
6471 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6472 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6475 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6479 int bluetooth_set_le_static_random_address(gboolean enable);
6482 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6483 * bluetooth_le_connection_mode_t mode)
6484 * @brief update connection paramter of LE connection.
6486 * This function is a synchronous call.
6488 * @return BLUETOOTH_ERROR_NONE - Success \n
6489 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6490 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6493 * @param[in] address - remote device address value.
6494 * @param[in] mode - new connection mode.
6498 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6499 bluetooth_le_connection_mode_t mode);
6502 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6503 * @brief Request for new ATT MTU value.
6505 * This function is a asynchronous call.
6507 * @return BLUETOOTH_ERROR_NONE - Success \n
6508 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6509 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6512 * @param[in] address - remote device address value.
6513 * @param[in] mtu - MTU value to be set.
6517 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6520 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6521 * unsigned int *mtu)
6522 * @brief Gets the xisting MTU value set for a connection.
6524 * This function is a synchronous call.
6526 * @return BLUETOOTH_ERROR_NONE - Success \n
6527 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6528 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6531 * @param[in] address - remote device address value.
6532 * @param[out] mtu - MTU value set for the connection.
6536 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6540 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6541 * bluetooth_device_address_t *id_address)
6542 * @brief Gets the Identity address of remote device.
6544 * This function is a synchronous call.
6546 * @return BLUETOOTH_ERROR_NONE - Success \n
6547 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6548 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6551 * @param[in] device_rpa - remote Resolvable private address.
6552 * @param[out] id_address - remote Identity device address value.
6556 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6557 bluetooth_device_address_t *id_address);
6560 * @fn int bluetooth_le_read_maximum_data_length()
6561 * @brief reads the maximum LE data length supported in the controller.
6563 * This function is a synchronous call.
6565 * @return BLUETOOTH_ERROR_NONE - Success \n
6566 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6572 int bluetooth_le_read_maximum_data_length(
6573 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6575 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6576 * @brief writes the host suggested values for the controllers max transmitted no of payload
6577 * octects to be used for new connections.
6579 * This function is a synchronous call.
6581 * @return BLUETOOTH_ERROR_NONE - Success \n
6582 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6588 int bluetooth_le_write_host_suggested_default_data_length(
6589 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6591 int bluetooth_le_read_suggested_default_data_length(
6592 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6594 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6595 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6597 int bluetooth_pbap_init(void);
6598 int bluetooth_pbap_deinit(void);
6599 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6600 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6601 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6602 bt_pbap_folder_t *folder);
6603 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6604 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6605 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6606 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6607 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6608 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6609 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6610 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6613 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6615 * @brief Set manufacturer data with value
6617 * This function is used to set manufacturer data.
6619 * This function is a synchronous call.
6621 * @return BLUETOOTH_ERROR_NONE - Success \n
6622 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6623 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6626 * @param[in] value - Manufacturer data structure.
6630 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6632 int bluetooth_set_passkey_notification(gboolean enable);
6635 * @fn int bluetooth_dpm_is_mode_allowed(void);
6637 * @brief Checks Restriction for BT mode(BT allowed or not)
6639 * This function is a synchronous call.
6641 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6642 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6643 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6650 int bluetooth_dpm_is_mode_allowed(void);
6653 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6655 * @brief Sets Restriction for BT mode(BT allowed or not)
6657 * This function is a synchronous call.
6659 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6660 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6661 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6664 * @param[in] value - BT Allow value.
6665 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6666 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6667 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6668 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6672 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6675 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6677 * @brief Reads the Restriction for BT mode(BT allowed or not)
6679 * This function is a synchronous call.
6681 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6682 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6683 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6687 * @param[out] value - BT Allow value.
6688 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6689 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6690 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6691 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6695 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6698 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6700 * @brief Sets the Restriction for device.
6702 * This function is a synchronous call.
6704 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6705 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6706 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6709 * @param[in] value - State value.
6710 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6711 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6715 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6718 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6720 * @brief Reads the Restriction for device.
6722 * This function is a synchronous call.
6724 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6725 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6726 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6730 * @param[out] value - State value.
6731 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6732 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6736 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6739 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6741 * @brief Sets the Restriction for uuid.
6743 * This function is a synchronous call.
6745 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6746 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6747 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6750 * @param[in] value - State value.
6751 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6752 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6756 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6759 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6761 * @brief Reads the Restriction for uuid.
6763 * This function is a synchronous call.
6765 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6766 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6767 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6771 * @param[out] value - State value.
6772 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6773 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6777 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6780 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6782 * @brief Adds the device to blacklist.
6784 * This function is a synchronous call.
6786 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6787 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6788 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6791 * @param[in] device_address - Device address
6795 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6798 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6800 * @brief Adds the device to whitelist.
6802 * This function is a synchronous call.
6804 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6805 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6806 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6809 * @param[in] device_address - Device address
6813 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6816 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6818 * @brief Adds the Service UUIDS to blacklist.
6820 * This function is a synchronous call.
6822 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6823 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6824 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6827 * @param[in] service_uuids - profile or custom service uuids
6831 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6834 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6836 * @brief Adds the Service UUIDS to whitelist.
6838 * This function is a synchronous call.
6840 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6841 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6842 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6845 * @param[in] service_uuids - profile or custom service uuids
6849 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6852 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6854 * @brief Clears the devices from blacklist.
6856 * This function is a synchronous call.
6858 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6859 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6860 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6867 int bluetooth_dpm_clear_devices_from_blacklist(void);
6870 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6872 * @brief Clears the devices from whitelist.
6874 * This function is a synchronous call.
6876 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6877 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6878 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6885 int bluetooth_dpm_clear_devices_from_whitelist(void);
6888 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6890 * @brief Clears the uuids from blacklist.
6892 * This function is a synchronous call.
6894 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6895 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6896 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6903 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6906 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6908 * @brief Clears the uuids from whitelist.
6910 * This function is a synchronous call.
6912 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6913 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6914 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6921 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6924 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6926 * @brief reads the devices from blacklist.
6928 * This function is a synchronous call.
6930 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6931 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6932 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6935 * @param[out] device_list - list of devices
6939 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6942 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6944 * @brief reads the devices from whitelist.
6946 * This function is a synchronous call.
6948 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6949 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6950 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6953 * @param[out] device_list - list of devices
6957 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6960 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6962 * @brief reads the uuids from blacklist.
6964 * This function is a synchronous call.
6966 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6967 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6968 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6971 * @param[in] uuid_list - list of uuids
6975 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6978 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6980 * @brief reads the uuids from whitelist.
6982 * This function is a synchronous call.
6984 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6985 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6986 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6989 * @param[in] uuid_list - list of uuids
6993 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6996 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6998 * @brief Removes the device from whitelist.
7000 * This function is a synchronous call.
7002 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7003 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7004 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7007 * @param[in] device_address - Device address
7011 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
7014 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7016 * @brief Removes the device from blacklist.
7018 * This function is a synchronous call.
7020 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7021 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7022 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7025 * @param[in] device_address - Device address
7029 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7032 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7034 * @brief Removes the Service UUIDS from whitelist.
7036 * This function is a synchronous call.
7038 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7039 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7040 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7043 * @param[in] service_uuids - profile or custom service uuids
7047 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7050 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7052 * @brief Removes the Service UUIDS from blacklist.
7054 * This function is a synchronous call.
7056 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7057 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7058 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7061 * @param[in] service_uuids - profile or custom service uuids
7065 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7068 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7070 * @brief Sets the Restriction for outgoing call.
7072 * This function is a synchronous call.
7074 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7075 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7076 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7079 * @param[in] value - State value.
7080 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7081 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7085 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7088 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7090 * @brief Reads the Restriction for outgoing call.
7092 * This function is a synchronous call.
7094 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7095 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7096 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7100 * @param[out] value - State value.
7101 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7102 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7106 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7109 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7111 * @brief Sets the Restriction for Pairing.
7113 * This function is a synchronous call.
7115 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7116 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7117 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7120 * @param[in] value - State value.
7121 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7122 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7126 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7129 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7131 * @brief Reads the Restriction for Pairing
7133 * This function is a synchronous call.
7135 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7136 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7137 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7141 * @param[out] value - State value.
7142 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7143 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7147 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7150 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7152 * @brief Sets the Restriction for using Profiles.
7154 * This function is a synchronous call.
7156 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7157 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7158 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7161 * @param[in]profile - Profile.
7162 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7163 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7164 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7165 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7166 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7167 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7168 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7169 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7170 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7171 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7172 * BLUETOOTH_DPM_PROFILE_NONE
7173 * @param[in] value - State value.
7174 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7175 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7179 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7182 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7184 * @brief Reads the Restriction for using Profiles.
7186 * This function is a synchronous call.
7188 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7189 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7190 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7193 * @param[in]profile - Profile.
7194 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7195 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7196 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7197 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7198 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7199 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7200 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7201 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7202 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7203 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7204 * BLUETOOTH_DPM_PROFILE_NONE
7205 * @param[out] value - State value.
7206 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7207 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7211 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7214 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7216 * @brief Sets the Restriction for Desktop Connectivity.
7218 * This function is a synchronous call.
7220 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7221 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7222 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7225 * @param[in] value - State value.
7226 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7227 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7231 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7234 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7236 * @brief Reads the Restriction for Desktop Connectivity.
7238 * This function is a synchronous call.
7240 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7241 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7242 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7246 * @param[out] value - State value.
7247 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7248 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7252 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7255 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7257 * @brief Sets the Restriction for Discoverable state.
7259 * This function is a synchronous call.
7261 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7262 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7263 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7266 * @param[in] value - State value.
7267 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7268 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7272 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7275 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7277 * @brief Reads the Restriction for Discoverable state.
7279 * This function is a synchronous call.
7281 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7282 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7283 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7287 * @param[out] value - State value.
7288 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7289 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7293 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7296 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7298 * @brief Sets the Restriction for linited discoverable state..
7300 * This function is a synchronous call.
7302 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7303 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7304 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7307 * @param[in] value - State value.
7308 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7309 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7313 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7316 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7318 * @brief Reads the Restriction for limited discoverable state.
7320 * This function is a synchronous call.
7322 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7323 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7324 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7328 * @param[out] value - State value.
7329 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7330 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7334 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7336 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7338 * @brief Sets the Restriction for Data trasnfer.
7340 * This function is a synchronous call.
7342 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7343 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7344 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7347 * @param[in] value - State value.
7348 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7349 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7353 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7357 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7359 * @brief Reads the Restriction for Data trasnfer.
7361 * This function is a synchronous call.
7363 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7364 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7365 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7369 * @param[out] value - State value.
7370 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7371 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7375 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7378 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7379 * bluetooth_pxp_poperty_t property, int value);
7381 * @brief Sets the Proximity alert level/properties for monitor role.
7383 * This function is a synchronous call.
7385 * @return BLUETOOTH_ERROR_NONE - Success \n
7386 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7387 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7388 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7391 * @param[in] device_address remote device address
7392 * @param[in] property proximity profile property
7393 * @param[in] value alert level/property value to be set
7398 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7399 bluetooth_pxp_poperty_t property, int value);
7402 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7403 * bluetooth_pxp_poperty_t property, int *value);
7405 * @brief Reads the Proximity alert level/properties for monitor role.
7407 * This function is a synchronous call.
7409 * @return BLUETOOTH_ERROR_NONE - Success \n
7410 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7411 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7412 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7415 * @param[in] device_address remote device address
7416 * @param[in] property proximity profile property
7417 * @param[out] value alert level/property value
7421 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7422 bluetooth_pxp_poperty_t property, int *value);
7425 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7426 * int *services_supported);
7428 * @brief Reads the Proximity Monitor profile supported properties/services.
7430 * This function is a synchronous call.
7432 * @return BLUETOOTH_ERROR_NONE - Success \n
7433 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7434 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7435 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7438 * @param[in] device_address remote device address
7439 * @param[out] services_supported proximity profile property/service
7443 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7444 int *services_supported);
7447 * @fn int bluetooth_proximity_reporter_register();
7449 * @brief Register all proximity related services in BlueZ.
7451 * This function is a synchronous call.
7453 * @return BLUETOOTH_ERROR_NONE - Success \n
7454 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7460 int bluetooth_proximity_reporter_register(void);
7463 * @fn int bluetooth_proximity_reporter_unregister();
7465 * @brief Unregister all proximity related services in BlueZ.
7467 * This function is a synchronous call.
7469 * @return BLUETOOTH_ERROR_NONE - Success \n
7470 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7476 int bluetooth_proximity_reporter_unregister(void);
7479 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7480 * bluetooth_pxp_poperty_t property, int *value);
7482 * @brief Reads the Proximity alert level/properties for reporter role.
7484 * This function is a synchronous call.
7486 * @return BLUETOOTH_ERROR_NONE - Success \n
7487 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7488 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7489 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7492 * @param[in] device_address remote device address
7493 * @param[in] property proximity profile property
7494 * @param[out] value alert level/property value
7498 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7499 bluetooth_pxp_poperty_t property, int *value);
7502 * @fn int bluetooth_tds_provider_register(void);
7504 * @brief Register Transport Discovery Provider role.
7506 * This function is a synchronous call.
7508 * @return BLUETOOTH_ERROR_NONE - Success \n
7509 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7510 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7511 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7519 int bluetooth_tds_provider_register(void);
7522 * @fn int bluetooth_tds_provider_unregister(void);
7524 * @brief Unregister Transport Discovery Provider role.
7526 * This function is a synchronous call.
7528 * @return BLUETOOTH_ERROR_NONE - Success \n
7529 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7530 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7531 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7539 int bluetooth_tds_provider_unregister(void);
7542 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7544 * @brief Create Transport Discovery Provider for a transport.
7546 * This function is a synchronous call.
7548 * @return BLUETOOTH_ERROR_NONE - Success \n
7549 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7550 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7551 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7554 * @param[in] Transport (BT, CUSTOM etc.)
7555 * @param[in] Unique handle for TDS provider.
7560 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7563 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7565 * @brief Remove previously created Transport Discovery Provider.
7567 * This function is a synchronous call.
7569 * @return BLUETOOTH_ERROR_NONE - Success \n
7570 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7573 * @param[in] Unique handle for previously created provider.
7578 int bluetooth_tds_provider_destroy(unsigned int handle);
7581 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7583 * @brief Set transport block for in advertisement and gatt db.
7585 * This function is a synchronous call.
7587 * @return BLUETOOTH_ERROR_NONE - Success \n
7588 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7589 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7590 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7593 * @param[in] Provider specific manufacturer data.
7594 * @param[in] Provider specific manufacturer data length.
7599 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7602 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7603 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7605 * @brief Set transport block for in advertisement and gatt db.
7607 * This function is a synchronous call.
7609 * @return BLUETOOTH_ERROR_NONE - Success \n
7610 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7611 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7612 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7615 * @param[in] Unique handle for TDS provider.
7616 * @param[in] Transport state (On/Off/Not Available).
7617 * @param[in] Transport specific data block.
7618 * @param[in] Transport specific data block length.
7623 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7624 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7627 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7628 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7630 * @brief Send response to TDS activation request from remoted device.
7632 * This function is a synchronous call.
7634 * @return BLUETOOTH_ERROR_NONE - Success \n
7635 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7636 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7637 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7640 * @param[in] Remote device BT address.
7641 * @param[in] Unique handle for TDS provider.
7642 * @param[in] Response for TDS activation request.
7643 * @param[in] Transport specific data block to be sent in activation response.
7644 * @param[in] Data block length.
7649 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7650 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7653 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7655 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7657 * This function is an asynchronous call.
7659 * @return BLUETOOTH_ERROR_NONE - Success \n
7660 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7661 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7662 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7663 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7666 * @param[in] device_address remote device address
7667 * @param[in] handle attribute handle
7669 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7670 * when TDS data is received from Remote provider
7672 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7673 const char *handle);
7676 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7678 * @brief Enables CCCD on Remote Provider.
7680 * This function is an asynchronous call.
7682 * @return BLUETOOTH_ERROR_NONE - Success \n
7683 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7684 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7685 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7686 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7689 * @param[in] device_address remote device address
7690 * @param[in] handle attribute handle
7692 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7693 * when Indication is enabled on Remote provider
7695 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7696 const char *handle);
7699 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7700 * unsigned char *buf, int length);
7701 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7703 * This function is an asynchronous call.
7705 * @return BLUETOOTH_ERROR_NONE - Success \n
7706 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7707 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7708 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7709 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7712 * @param[in] device_address remote device address
7713 * @param[in] handle attribute handle
7714 * @param[in] buf Control point activation param
7715 * @param[in] param length
7717 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7718 * is received from remote Provider
7720 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7721 unsigned char *buf, int length);
7724 * @fn int bluetooth_otp_server_init(const char *directory);
7726 * @brief Starts OTP server.
7728 * This function is a synchronous call.
7738 int bluetooth_otp_server_init(const char *directory);
7741 * @fn int bluetooth_otp_server_deinit();
7743 * @brief Stops OTP server.
7745 * This function is a synchronous call.
7755 int bluetooth_otp_server_deinit();
7758 * @fn int bluetooth_otp_enable_notification(const char *handle);
7760 * @brief Enable notification for remote OACP & OLCP characteristics.
7762 * This function is a synchronous call.
7772 int bluetooth_otp_enable_notification(const char *handle);
7775 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7776 * unsigned char *buf, int length);
7778 * @brief Write value on remote characteristics.
7780 * This function is a synchronous call.
7790 int bluetooth_otp_write_characteristics_value(const char *handle,
7791 unsigned char *buf, int length);
7794 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7796 * @brief Read value for remote characteristics.
7798 * This function is a synchronous call.
7808 int bluetooth_otp_read_characteristic_value(const char *handle);
7811 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7813 * @brief Read value for remote characteristics.
7815 * This function is a synchronous call.
7825 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7828 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7830 * @brief Read value for remote characteristics.
7832 * This function is a synchronous call.
7842 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7845 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7846 * @brief Check if Adapter supports LE 2M PHY feature or not.
7848 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7849 * in BT 5.0 specification.
7851 * This function is a synchronous call.
7853 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7854 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7855 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7856 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7857 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7861 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7864 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7865 * @brief Check if Adapter supports LE 2M CODED feature or not.
7867 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7868 * in BT 5.0 specification.
7870 * This function is a synchronous call.
7872 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7873 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7874 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7875 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7876 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
7880 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
7888 #endif /* __cplusplus */
7889 #endif /* _BLUETOOTH_API_H_*/