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 L2cap LE Socket Connected event role
82 #define L2CAP_LE_ROLE_SERVER 1
83 #define L2CAP_LE_ROLE_CLIENT 2
86 * This is maximum length for search value string for PBAP Phonebook Search
88 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
91 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
94 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
95 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
98 * < This defines the maximum size of OTP server directory name
100 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
102 #define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH 500 /**< OTP Characteristics Value Max length */
105 * This is Bluetooth error code
107 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
109 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
110 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
112 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
113 /**< Callback error */
114 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
115 /**< invalid paramerror */
116 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
117 /**< invalid data error */
118 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
119 /**< Memory allocation error */
120 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
121 /**< out of memory error */
122 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
123 /**< timeout error */
124 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
125 /**< No resource error */
126 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
127 /**< internal error */
128 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
129 /**< Not supported error */
130 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
131 /**< Operation is failed because
132 of not enabled BT Adapter */
133 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
134 /**< Enabling is failed because of
135 already enabled BT Adapter */
136 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
137 /**< Operation is failed because of
138 other on going operation */
139 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
140 /**< access denied error */
141 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
142 /**< max client error */
143 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
144 /**< not found error */
145 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
146 /**< service search fail */
147 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
148 /**< pairing failed error */
149 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
150 /**< Not paired error */
151 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
152 /**< no service error */
153 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
154 /**< no connection error */
155 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
156 /**< alread connected error */
157 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
158 /**< connection busy error */
159 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
160 /**< connection error */
161 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
162 /**< max connection error*/
163 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
164 /**< Not in operation */
165 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
166 /**< Cancelled by user */
167 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
168 /**< Service record registration failed */
169 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
170 /**< Operation in progress */
171 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
172 /**< authentication failed error when paring*/
173 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
174 /**< Remote host is down */
175 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
176 /**< End of device list */
178 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
179 /**< Obex agent already exists */
180 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
181 /**< Obex agent does not exist */
183 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
184 /**< Already initialized */
186 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
187 /**< Permission deined */
189 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
190 /**< Nap already done */
192 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
193 /**< Not initialized */
195 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
196 /**< Authentication rejected */
198 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
199 /**< Device Policy Restricted */
201 #define BLUETOOTH_ERROR_NO_DATA ((int)BLUETOOTH_ERROR_BASE - 0x29)
204 #define BLUETOOTH_ERROR_AUTHORIZATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x2a)
205 /**< Authorization rejected */
208 * Error codes for ATT Error response *
210 #define BLUETOOTH_ATT_ERROR_INTERNAL -1
211 #define BLUETOOTH_ATT_ERROR_NONE 0x00
212 #define BLUETOOTH_ATT_ERROR_INVALID_HANDLE 0x01
213 #define BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED 0x02
214 #define BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED 0x03
215 #define BLUETOOTH_ATT_ERROR_INVALID_PDU 0x04
216 #define BLUETOOTH_ATT_ERROR_AUTHENTICATION 0x05
217 #define BLUETOOTH_ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06
218 #define BLUETOOTH_ATT_ERROR_INVALID_OFFSET 0x07
219 #define BLUETOOTH_ATT_ERROR_AUTHORIZATION 0x08
220 #define BLUETOOTH_ATT_ERROR_PREPARE_QUEUE_FULL 0x09
221 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0A
222 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0B
223 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0C
224 #define BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN 0x0D
225 #define BLUETOOTH_ATT_ERROR_UNLIKELY 0x0E
226 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0F
227 #define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10
228 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
229 /* Common profile error codes */
230 #define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED 0xFC
231 #define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED 0xFD
232 #define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS 0xFE
233 #define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE 0xFF
236 * Bluetooth ATT error codes specific to OTP
238 #define BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED 0x80
239 #define BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED 0x81
240 #define BLUETOOTH_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
241 #define BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS 0x83
244 * Bluetooth OTP error codes
245 * TODO: Check error code conflict
247 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
248 #define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
251 * Device disconnection reasons; received from stack
253 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
254 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
255 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
256 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
257 #define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e
258 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
259 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
260 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
261 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
262 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
263 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
264 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
265 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
266 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
267 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
268 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
271 * Device disconnect reason
274 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
275 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
276 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
277 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
278 } bluetooth_device_disconnect_reason_t;
281 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
284 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
285 } bluetooth_device_address_t;
288 * This is Bluetooth device address type
291 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
292 BLUETOOTH_DEVICE_RANDOM_ADDRESS
293 } bluetooth_device_address_type_t;
296 * This is BD Address type defined in kernel BT header
299 BLUETOOTH_BDADDR_BREDR = 0x00,
300 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
301 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
302 } bluetooth_bdaddr_type_e;
305 * This is Bluetooth version
308 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
309 } bluetooth_version_t;
312 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
315 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
316 } bluetooth_device_name_t;
319 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
322 int data_len; /**< manafacturer specific data length */
323 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
324 } bluetooth_manufacturer_data_t;
327 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
328 } bluetooth_device_pin_code_t;
331 * This is data for battery usage monitoring
335 time_t session_start_time;
336 time_t session_end_time;
340 uint32_t session_connected_time;
341 uint32_t session_scan_time;
351 } bt_battery_app_data;
357 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
358 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
359 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
360 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
361 } bluetooth_adapter_state_t;
367 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
368 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
369 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
370 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
371 } bluetooth_adapter_le_state_t;
377 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
378 /*Changed the order to make it compatable with old method */
379 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
380 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
381 /**< Discoverable mode with time limit
382 After specific timeout, it is changed
383 to non discoverable mode */
384 } bluetooth_discoverable_mode_t;
387 * Network connect mode
390 BLUETOOTH_NETWORK_PANU_ROLE,
392 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
393 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
394 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
395 } bluetooth_network_role_t;
399 * Service type matched to bt_profile_type_t of bt-service-common.h
402 BLUETOOTH_RFCOMM_SERVICE = 0x01,
403 BLUETOOTH_A2DP_SERVICE = 0x02,
404 BLUETOOTH_HSP_SERVICE = 0x04,
405 BLUETOOTH_HID_SERVICE = 0x08,
406 BLUETOOTH_NAP_SERVICE = 0x10,
407 BLUETOOTH_HFG_SERVICE = 0x20,
408 BLUETOOTH_GATT_SERVICE = 0x40,
409 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
410 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
411 BLUETOOTH_PBAP_SERVICE = 0x200,
412 } bluetooth_service_type_t;
418 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
419 /* represents that connection
420 * type can both BR/EDR and LE */
421 BLUETOOTH_DEV_CONN_BREDR = 0x00,
422 BLUETOOTH_DEV_CONN_LE = 0x01,
423 } bluetooth_conn_type_t;
429 BLUETOOTH_CODEC_ID_CVSD = 0x01,
430 BLUETOOTH_CODEC_ID_MSBC = 0x02,
431 } bluetooth_codec_type_t;
437 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
438 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
439 } bluetooth_hf_audio_connected_type_t;
445 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
446 } bluetooth_advertising_data_t;
452 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
453 } bluetooth_scan_resp_data_t;
456 * Advertising filter policy
459 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
460 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
461 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
462 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
463 } bluetooth_advertising_filter_policy_t;
469 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
470 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
471 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
472 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
473 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
474 } bluetooth_advertising_type_t;
477 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
478 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
479 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_RESYNC = 0x03,
480 } bluetooth_gatt_service_change_type_t;
483 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
484 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
485 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
486 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
487 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
488 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
489 } bt_gatt_permission_t;
492 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
493 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
494 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
495 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
496 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
497 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
498 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
499 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
500 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
501 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
502 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
503 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
504 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
505 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
506 } bt_gatt_characteristic_property_t;
509 * Remote device request types for attributes
512 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
513 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
514 } bluetooth_gatt_att_request_tyep_t;
517 * Proximity Property Type
520 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
521 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
522 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
523 } bluetooth_pxp_poperty_t;
529 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
530 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
531 BLUETOOTH_TDS_TRANSPORT_WIFI_NAN, /* Wi-Fi Alliance Neighbor Awareness Networking */
532 BLUETOOTH_TDS_TRANSPORT_WIFI_SVC_ADV, /* Wi-Fi Alliance Service Advertisement */
534 BLUETOOTH_TDS_TRANSPORT_INVALID
535 } bluetooth_tds_transport_t;
538 * TDS transport state
541 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
542 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
543 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
544 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
545 } bluetooth_tds_transport_state_t;
552 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
553 } bluetooth_tds_data_t;
556 * TDS activation request
559 bluetooth_device_address_t rem_addr;
560 bluetooth_tds_transport_t transport;
561 bluetooth_tds_data_t tds_data;
562 } bluetooth_tds_activation_req_t;
565 * TDS Control Point data
568 int length; /**< Control point data length */
569 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
570 } bluetooth_control_point_data_t;
573 * TDS Indication Response data
576 bluetooth_device_address_t rem_addr; /**< Device address */
577 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
578 } bluetooth_tds_indication_res_t;
581 * Structure to hold the TDS Complete data information which is read from remote TDS provider
584 bluetooth_device_address_t device_address; /**< Device address */
585 int data_length; /**< Data length */
586 char *data; /**< Complete Transport Specific data */
587 } bluetooth_tds_transport_data_info_t;
590 * OTP Characteristics Value
593 int length; /**< Characteristics value length */
594 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
595 } bluetooth_otp_charc_data_t;
598 * Structure to hold the OTP response data from remote OTP server
601 char *handle; /**< Handle */
602 int data_length; /**< Data length */
603 char *data; /**< Read data */
604 } bluetooth_otp_resp_info_t;
607 * Structure to hold the OTC Channel Info
610 gboolean connected; /**< Connection Status */
612 char *address; /**< Remote address */
613 } bluetooth_otc_info_t;
616 * Advertising parameters
621 guint8 filter_policy;
624 } bluetooth_advertising_params_t;
630 int type; /**< passive 0, active 1 */
631 float interval; /**< LE scan interval */
632 float window; /**< LE scan window */
633 } bluetooth_le_scan_params_t;
639 BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
640 BLUETOOTH_LE_ACTIVE_SCAN
641 } bluetooth_le_scan_type_t;
651 } bluetooth_le_connection_param_t;
654 LE Read Maximum Data Length
657 guint16 max_tx_octets;
659 guint16 max_rx_octets;
661 } bluetooth_le_read_maximum_data_length_t;
664 LE Read Host suggested default Data Length
667 guint16 def_tx_octets;
669 } bluetooth_le_read_host_suggested_data_length_t;
672 * Samsung XSAT Vendor dependent command
677 } bluetooth_vendor_dep_at_cmd_t;
683 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
684 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
685 } bluetooth_opp_transfer_type_t;
690 } bluetooth_hf_ciev_device_event_t;
692 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
693 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
694 /**< Base ID for GAP Event */
695 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
696 /**< Base ID for SDP events */
697 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
698 /**< Base ID for RFCOMM events */
699 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
700 /**< Base ID for NETWORK events */
701 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
702 /**< Base ID for HDP events */
703 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
704 /**< Base ID for OPC events */
705 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
706 /**< Base ID for Obex Server events */
707 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
708 /**< Base ID for GATT events */
710 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
711 /**< Base ID for Audio events */
712 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
713 /**< Base ID for HID events */
714 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
715 /**< Base ID for Advertising events */
716 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
717 /**< Base ID for PBAP Client events */
718 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
719 /**< Base ID for AVRCP events */
720 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
721 /**< Base ID for IPSP events */
722 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
723 /**< Base ID for MAP events */
724 #define BLUETOOTH_EVENT_MESH_BASE ((int)(BLUETOOTH_EVENT_MAP_BASE + 0x0020))
725 /**< Base ID for MAP events */
726 #define BLUETOOTH_EVENT_L2CAP_LE_BASE ((int)(BLUETOOTH_EVENT_MESH_BASE + 0x0040))
727 /**< Base ID for L2CAP_LE events */
730 * Bluetooth event type
733 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
735 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
736 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
737 BLUETOOTH_EVENT_DISABLED_BATTERY_DATA, /**< Bluetooth event adapter disabled battery data*/
738 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
739 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
740 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
741 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
742 /**< Bluetooth event Discoverable timeout requested*/
743 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
744 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
745 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
746 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
747 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
748 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
749 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
750 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
751 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
752 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
753 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
754 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
755 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
756 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
757 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
758 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
759 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
760 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
761 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
762 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
763 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
765 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
766 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
767 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
768 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
769 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
771 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
772 /**< Bluetooth event serice search base id */
773 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
774 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
775 /**< RFCOMM data receive event */
776 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
777 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
779 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
781 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
782 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
784 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
786 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
787 /**< Bluetooth Network event */
788 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
789 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
790 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
791 /**< Network disconnected evnet in server */
793 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
794 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
796 BLUETOOTH_EVENT_HDP_CONNECTED
797 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
798 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
799 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
801 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
802 /* OPC Connected event */
803 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
804 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
805 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
806 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
808 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
809 BLUETOOTH_EVENT_MAP_DISCONNECTED,
811 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
812 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
813 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
814 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
815 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
817 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
818 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
819 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
820 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
821 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
822 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
823 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
824 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
825 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
826 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
827 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
828 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
829 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
831 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
832 /* Obex server authorize event*/
833 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
834 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
835 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
836 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
837 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
838 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
840 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
841 /**<Discovered GATT service characteristics event*/
842 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
843 /**<Remote GATT charateristic value changed event*/
844 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
845 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
846 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
847 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
848 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
849 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
850 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
851 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
852 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
853 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
854 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
855 BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
856 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
857 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
858 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
859 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
860 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
861 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
862 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
863 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
864 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
865 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
866 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
867 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
868 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
869 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
870 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
871 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
872 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
873 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
874 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
875 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
876 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
877 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
878 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
879 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
880 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
881 BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
882 BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
883 BLUETOOTH_EVENT_HF_CONNECTED,
884 BLUETOOTH_EVENT_HF_DISCONNECTED,
885 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
886 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
887 BLUETOOTH_EVENT_HF_RING_INDICATOR,
888 BLUETOOTH_EVENT_HF_CALL_WAITING,
889 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
890 BLUETOOTH_EVENT_HF_CALL_STARTED,
891 BLUETOOTH_EVENT_HF_CALL_ENDED,
892 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
893 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
894 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
895 BLUETOOTH_EVENT_HF_CALL_STATUS,
896 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
897 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
898 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
899 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
900 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
901 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
902 BLUETOOTH_EVENT_HF_CALL_IDLE,
903 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
904 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
905 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
906 BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
908 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
909 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
910 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
911 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
912 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
914 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
915 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
916 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
917 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
918 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
919 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
920 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
921 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
923 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
924 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
925 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
926 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
927 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
928 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
929 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
931 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
932 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
933 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
934 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
935 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
936 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
937 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
938 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
939 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
941 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
942 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
943 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
944 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
945 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
946 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
947 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
948 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
949 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
950 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
951 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
953 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
954 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
955 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
956 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
957 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
958 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
959 BLUETOOTH_EVENT_MESH_SCAN_STARTED = BLUETOOTH_EVENT_MESH_BASE,
960 BLUETOOTH_EVENT_MESH_SCAN_FINISHED,
961 BLUETOOTH_EVENT_MESH_SCAN_RESULT,
962 BLUETOOTH_EVENT_MESH_AUTHENTICATION_REQUEST,
963 BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED,
964 BLUETOOTH_EVENT_MESH_NODE_BROWSED,
965 BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES,
966 BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
967 BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED,
968 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
969 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST,
970 BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
971 BLUETOOTH_EVENT_MESH_MODEL_MSG_RECEIVED,
972 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST,
973 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED,
974 BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED,
975 BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
976 BLUETOOTH_EVENT_MESH_JOIN_COMPLETED,
977 BLUETOOTH_EVENT_L2CAP_LE_DATA_RECEIVED = BLUETOOTH_EVENT_L2CAP_LE_BASE,
978 /**< L2CAP_LE data receive event */
979 BLUETOOTH_EVENT_L2CAP_LE_CONNECTED, /**< L2CAP_LE server/client connect */
980 BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED, /**< L2CAP_LE server/client disconnect */
981 BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE,
982 BLUETOOTH_EVENT_L2CAP_LE_SERVER_REMOVED
983 } bluetooth_event_type_t;
986 * This bt_service_uuid_list_t enum indicates service uuid list .
987 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
991 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
992 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
993 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
994 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
995 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
996 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
997 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
998 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
999 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
1000 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
1001 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
1002 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
1003 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
1005 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
1006 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
1007 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
1008 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
1009 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
1010 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
1011 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
1012 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
1013 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
1014 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
1015 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
1016 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
1017 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
1018 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
1020 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
1021 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
1022 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
1023 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
1024 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
1025 /**<DIRECT PRINTING*/
1026 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
1027 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
1028 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
1029 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
1030 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
1031 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
1032 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
1033 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
1034 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
1035 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
1036 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
1037 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
1038 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
1039 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
1040 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
1041 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
1042 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
1043 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
1044 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
1045 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
1046 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
1047 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
1048 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
1049 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
1050 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
1051 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
1052 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
1053 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
1054 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
1055 } bluetooth_service_uuid_list_t;
1058 * Service class part of class of device returned from device discovery
1061 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1062 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1063 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1064 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1065 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1066 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1067 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1068 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1069 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1070 } bluetooth_device_service_class_t;
1074 * Major device mask (For device discovery)
1077 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1078 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1079 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1080 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1081 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1082 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1083 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1084 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1085 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1086 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1087 } bluetooth_device_major_mask_t;
1091 * Major device class (part of Class of Device)
1094 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1095 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1096 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1097 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1098 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1099 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1100 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1101 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1102 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1103 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1104 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1105 } bluetooth_device_major_class_t;
1108 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1110 /* About Computer Major class */
1111 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1113 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1114 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1115 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1116 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1117 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1119 /* About Phone Major class */
1120 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1121 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1122 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1123 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1124 /**< voice gateway minor class */
1125 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1127 /* About LAN/Network Access Point Major class */
1128 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1129 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1130 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1131 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1132 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1133 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1134 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1135 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1137 /* About Audio/Video Major class */
1138 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1139 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1141 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1142 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1143 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1144 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1145 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1146 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1147 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1149 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1150 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1151 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1153 /**< Video Display and Loud
1154 Speaker minor class */
1155 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1158 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1160 /* About Peripheral Major class */
1161 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1162 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1163 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1164 /**< Combo Keyboard or pointing
1165 device minorclass */
1167 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1168 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1169 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1170 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1171 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1172 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1173 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1174 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1175 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1177 /* About Imaging Major class */
1178 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1179 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1180 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1181 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1183 /* About Wearable Major class */
1184 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1185 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1186 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1187 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1188 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1190 /* About Toy Major class */
1191 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1192 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1193 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1194 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1195 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1197 /* About Health Major class */
1198 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1199 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1200 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1201 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1202 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1203 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1204 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1205 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1206 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1207 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1208 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1209 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1210 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1211 } bluetooth_device_minor_class_t;
1214 * structure to hold the device information
1217 bluetooth_device_major_class_t major_class; /**< major device class */
1218 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1219 bluetooth_device_service_class_t service_class;
1220 /**< service device class */
1221 } bluetooth_device_class_t;
1224 * Discovery Role types
1227 DISCOVERY_ROLE_BREDR = 0x1,
1229 DISCOVERY_ROLE_LE_BREDR
1230 } bt_discovery_role_type_t;
1233 * Connected state types
1236 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1237 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1238 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1239 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1240 } bluetooth_connected_link_t;
1246 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1247 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1248 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1249 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1250 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1251 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1252 BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80, /**< rssi high threshold */
1253 } bluetooth_le_scan_filter_feature_t;
1256 * LE connection mode
1259 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1260 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1261 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1262 } bluetooth_le_connection_mode_t;
1265 * structure to hold the device information
1268 bluetooth_device_address_t device_address; /**< device address */
1269 bluetooth_device_name_t device_name; /**< device name */
1270 bluetooth_device_class_t device_class; /**< device class */
1271 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1272 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1274 int rssi; /**< received strength signal*/
1275 gboolean paired; /**< paired flag */
1276 bluetooth_connected_link_t connected; /**< connected link type */
1277 gboolean trust; /**< trust flag */
1278 gboolean is_alias_set; /** is device alias set flag**/
1279 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1280 } bluetooth_device_info_t;
1283 * structure to hold the LE device information
1286 int data_len; /**< manafacturer specific data length */
1287 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1288 } bluetooth_le_advertising_data_t;
1291 bluetooth_device_address_t device_address; /**< device address */
1292 int addr_type; /**< address type*/
1293 int rssi; /**< received strength signal*/
1294 bluetooth_le_advertising_data_t adv_ind_data;
1295 bluetooth_le_advertising_data_t scan_resp_data;
1296 } bluetooth_le_device_info_t;
1300 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1301 bluetooth_device_address_t device_address; /**< device address */
1302 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1303 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1304 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1305 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1306 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1307 bluetooth_le_advertising_data_t service_data; /**< service data */
1308 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1309 int manufacturer_id; /**< manufacturer ID */
1310 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1311 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1312 int rssi_high_threshold; /**< rssi high threshold */
1313 } bluetooth_le_scan_filter_t;
1316 bluetooth_device_address_t device_address; /**< device address */
1317 unsigned int mtu; /** < MTU set for the ATT connection */
1318 unsigned int status; /** < status of the MTU exchange */
1319 } bluetooth_le_att_mtu_info_t;
1322 * structure to hold the paired device information
1325 bluetooth_device_address_t device_address; /**< paired device address */
1326 bluetooth_device_name_t device_name; /**< device name */
1327 bluetooth_device_class_t device_class; /**< device class */
1328 } bluetooth_paired_device_info_t;
1331 * structure to hold the paired device information
1334 bluetooth_device_address_t device_address;
1335 /**< device address */
1336 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1337 /**< network interface name */
1338 } bluetooth_network_device_info_t;
1341 * Authentication event types
1345 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1346 BLUETOOTH_AUTH_PIN_REQUEST,
1347 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1348 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1349 } bluetooth_auth_type_t;
1352 * structure to hold the pincode/pass-key req informations
1355 bluetooth_device_address_t device_address; /**< remote device address */
1356 bluetooth_device_name_t device_name; /**< device name */
1357 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1358 bool incoming; /**< stores if bonding request is incoming */
1359 } bluetooth_authentication_request_info_t;
1362 * Stucture to hold discovery option
1365 unsigned short max_response; /**< the number of maximum response */
1366 unsigned short discovery_duration;
1367 /**< duration of discovery (seconds) */
1368 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1369 classOfDevice variable */
1370 } bluetooth_discovery_option_t;
1373 * Stucture to hold event information
1376 int event; /**< event type */
1377 int result; /**< Success or error value */
1379 /**<parameter data pointer */
1381 } bluetooth_event_param_t;
1384 bluetooth_device_address_t device_addr;
1385 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1386 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1387 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1392 bluetooth_device_address_t device_addr;
1393 unsigned char addr_type;
1396 } bt_connection_info_t;
1399 * Stucture to rfcomm receive data
1404 /**< the socket fd */
1405 int buffer_size;/**< the length of the receive buffer */
1407 /**< the receive data buffer */
1408 } bluetooth_rfcomm_received_data_t;
1414 HTYPE_TRANS_HANDSHAKE,
1415 HTYPE_TRANS_HID_CONTROL,
1416 HTYPE_TRANS_GET_REPORT,
1417 HTYPE_TRANS_SET_REPORT,
1418 HTYPE_TRANS_GET_PROTOCOL,
1419 HTYPE_TRANS_SET_PROTOCOL,
1421 HTYPE_TRANS_UNKNOWN,
1422 HTYPE_TRANS_GET_IDLE = 0xF0,
1423 HTYPE_TRANS_SET_IDLE = 0xF1,
1424 } bt_hid_header_type_t;
1430 PTYPE_DATA_RTYPE_INPUT,
1431 PTYPE_DATA_RTYPE_OUTPUT
1432 } bt_hid_param_type_t;
1435 * Stucture to hid receive data
1438 const char *address;
1439 bt_hid_header_type_t type;
1440 /**< Header type containing */
1441 bt_hid_param_type_t param;
1442 /**< Param type in header like INPUT Report or OutPut Report */
1443 int buffer_size;/**< the length of the receive buffer */
1445 /**< the receive data buffer */
1446 } bluetooth_hid_received_data_t;
1449 * Stucture to rfcomm connection
1453 int socket_fd; /**< the socket fd */
1454 int server_id; /* Server id */
1455 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1456 bluetooth_device_address_t device_addr;
1457 /**< device address */
1458 char uuid[BLUETOOTH_UUID_STRING_MAX];
1459 } bluetooth_rfcomm_connection_t;
1462 * Stucture to rfcomm disconnection
1466 /**< the socket fd */
1467 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1468 bluetooth_device_address_t device_addr;
1469 /**< device address */
1470 char uuid[BLUETOOTH_UUID_STRING_MAX];
1471 } bluetooth_rfcomm_disconnection_t;
1475 /**< the socket fd */
1476 bluetooth_device_address_t device_addr;
1477 /**< device address */
1478 } bluetooth_rfcomm_connection_request_t;
1481 * Stucture to l2cap_le connection
1484 int socket_fd; /**< the socket fd */
1485 int server_id; /* Server id */
1486 int device_role; /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1487 bluetooth_device_address_t device_addr; /**< device address */
1489 } bluetooth_l2cap_le_connection_t;
1498 } bt_hdp_qos_type_t;
1504 HDP_ROLE_SOURCE = 0x0,
1506 } bt_hdp_role_type_t;
1510 * Stucture to HDP connected
1513 const char *app_handle; /**< the application handle */
1514 unsigned int channel_id; /**< the channel id */
1515 bt_hdp_qos_type_t type; /**< the QOS type */
1516 bluetooth_device_address_t device_address; /**< the remote address */
1517 } bt_hdp_connected_t;
1520 * Stucture to HDP disconnected
1523 unsigned int channel_id; /**< the channel id */
1524 bluetooth_device_address_t device_address; /**< the remote address */
1525 } bt_hdp_disconnected_t;
1528 * Stucture to HDP data indication
1531 unsigned int channel_id; /**< the channel id */
1532 const char *buffer; /**< the RX data buffer */
1533 unsigned int size; /**< the RX data size */
1534 } bt_hdp_data_ind_t;
1537 * Stucture to OPP client transfer information
1544 } bt_opc_transfer_info_t;
1546 /* TODO: MAP client structures, see above */
1548 * Stucture to Map filter fields
1553 } bt_map_list_filter_fields_info_t;
1555 /* Obex Server transfer type */
1556 #define TRANSFER_PUT "PUT"
1557 #define TRANSFER_GET "GET"
1559 * Stucture to OPP/FTP Server authorize information
1566 } bt_obex_server_authorize_into_t;
1574 } bt_obex_server_type_t;
1577 * Stucture to OPP/FTP server transfer information
1585 unsigned long file_size;
1587 bt_obex_server_type_t server_type;
1589 unsigned char *contact_auth_info;
1590 } bt_obex_server_transfer_info_t;
1593 * Stucture to OPP/FTP server connection/disconnection information
1599 } bt_obex_server_connection_info_t;
1603 * Stucture to OOB data
1607 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1608 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1609 unsigned int hash_len;
1610 unsigned int randomizer_len;
1612 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1613 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1614 unsigned int hash256_len;
1615 unsigned int randomizer256_len;
1617 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1618 unsigned int eir_len;
1622 * Structure to GATT attribute handle data
1628 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1629 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1630 } bt_gatt_handle_info_t;
1633 * Structure to a most basic GATT attribute handle data
1637 unsigned char uuid[16];
1638 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1639 } bt_gatt_handle_property_t;
1642 * Structure to GATT Remote service data
1649 bt_gatt_handle_info_t include_handles;
1650 bt_gatt_handle_info_t char_handle;
1651 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1652 } bt_gatt_service_property_t;
1655 * Structure to GATT Remote characteristic data
1659 char *service_handle;
1660 bt_gatt_handle_info_t handle_info;
1661 } bt_gatt_discovered_char_t;
1664 * Structure to format of GATT Characteristic Value
1668 unsigned char format;
1669 unsigned char exponent;
1670 unsigned short unit;
1671 unsigned char name_space;
1672 unsigned short description;
1673 } bt_gatt_char_format_t;
1676 * Structure to GATT Characteristic property
1684 bt_gatt_char_format_t format;
1686 unsigned int val_len;
1687 unsigned int permission;
1688 char *representation;
1689 bt_gatt_handle_info_t char_desc_handle;
1690 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1691 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1692 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1693 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1694 } bt_gatt_char_property_t;
1697 * Structure to GATT Characteristic descriptor property
1704 unsigned int val_len;
1705 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1706 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1707 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1708 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1709 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1710 } bt_gatt_char_descriptor_property_t;
1713 * Structure to GATT Characteristic value
1720 } bt_gatt_char_value_t;
1723 unsigned char UUID[16];
1727 } bt_gatt_notify_req_t ;
1730 * Structure to GATT Read Request
1734 char *service_handle;
1738 } bt_gatt_read_req_t;
1741 * Structure to GATT Value change
1745 char *service_handle;
1748 gboolean response_needed;
1752 } bt_gatt_value_change_t;
1755 bluetooth_device_address_t device_addr;
1757 bluetooth_gatt_service_change_type_t change_type;
1760 } bt_gatt_service_change_t;
1763 * Structure to GATT characteristc Notification change
1767 char *service_handle;
1768 gboolean att_notify;
1769 } bt_gatt_char_notify_change_t;
1772 * Structure to Indication confirmation
1776 char *service_handle;
1779 } bt_gatt_indicate_confirm_t;
1782 * Structure for GATT response data
1789 } bt_gatt_resp_data_t;
1792 * Structure to RSSI Signal Strength Alert
1803 * Structure to RSSI Signal Strength
1813 * Structure for RSSI Enabled or Disabled
1819 gboolean rssi_enabled;
1820 } bt_rssi_enabled_t;
1823 * Structure for RSSI Threshold
1828 int in_range_threshold;
1830 } bt_rssi_threshold_t;
1834 * Structure for Suppoted Profiles and Trusted Profiles
1841 } bt_supported_profile_trusted_t;
1844 * Structure for PBAP Folder Parameters
1847 unsigned char addressbook;
1848 unsigned char folder_type;
1852 * Structure for PBAP Pull application Parameters
1855 unsigned char format;
1856 unsigned char order;
1857 unsigned short offset;
1858 unsigned short maxlist;
1859 long long unsigned fields;
1860 } bt_pbap_pull_parameters_t;
1863 * Structure for PBAP List application Parameters
1866 unsigned char order;
1867 unsigned short offset;
1868 unsigned short maxlist;
1869 } bt_pbap_list_parameters_t;
1872 * Structure for PBAP Pull vCard application Parameters
1875 unsigned char format;
1876 long long unsigned fields;
1878 } bt_pbap_pull_vcard_parameters_t;
1881 * Structure for PBAP Search application Parameters
1884 unsigned char order;
1885 unsigned short offset;
1886 unsigned short maxlist;
1887 unsigned char search_attribute;
1888 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1889 } bt_pbap_search_parameters_t;
1892 * Structure for PBAP Connection Status
1895 bluetooth_device_address_t btaddr;
1897 } bt_pbap_connected_t;
1900 * Structure for PBAP Phonebook Size
1903 bluetooth_device_address_t btaddr;
1905 } bt_pbap_phonebook_size_t;
1908 * Structure for PBAP Phonebook Pull
1911 bluetooth_device_address_t btaddr;
1914 } bt_pbap_phonebook_pull_t;
1917 * Structure for PBAP vCard List
1920 bluetooth_device_address_t btaddr;
1924 } bt_pbap_vcard_list_t;
1927 * Structure for PBAP vCard Pull
1930 bluetooth_device_address_t btaddr;
1933 } bt_pbap_vcard_pull_t;
1936 * Structure for PBAP Phonebook search List
1939 bluetooth_device_address_t btaddr;
1943 } bt_pbap_phonebook_search_list_t;
1946 * Stucture to HF Call status information
1950 char *number; /*Phone Number */
1951 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1952 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1953 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1954 int idx; /*Call index/ID */
1955 } bt_hf_call_status_info_t;
1960 } bt_hf_call_list_s;
1966 TRUSTED_PROFILE_PBAP = 1,
1967 TRUSTED_PROFILE_MAP,
1968 TRUSTED_PROFILE_SAP,
1969 TRUSTED_PROFILE_HFP_HF,
1970 TRUSTED_PROFILE_A2DP,
1971 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1972 } bluetooth_trusted_profile_t;
1975 * Structure for LE data length change params
1978 bluetooth_device_address_t device_address;
1979 guint16 max_tx_octets;
1980 guint16 max_tx_time;
1981 guint16 max_rx_octets;
1982 guint16 max_rx_time;
1983 } bt_le_data_length_params_t;
1986 * Structure for proximity property change params
1989 bluetooth_device_address_t device_address;
1993 } bt_pxp_property_changed_params_t;
1996 * @brief DPM BT allowance state
2000 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
2001 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
2002 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
2003 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
2007 * @brief DPM API result
2011 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
2012 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
2013 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
2014 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
2015 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
2016 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
2020 * @brief DPM Policy status
2024 BLUETOOTH_DPM_STATUS_ERROR = -1,
2026 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
2027 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
2029 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
2030 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
2032 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2033 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2037 /* policy-group : BLUETOOTH */
2038 BLUETOOTH_DPM_POLICY_ALLOW,
2039 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2040 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2041 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
2042 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
2043 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
2044 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
2045 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2046 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2047 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2048 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2049 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2050 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2051 BLUETOOTH_DPM_POLICY_END,
2052 } bt_dpm_policy_cmd_t;
2055 struct bt_dpm_policy {
2061 typedef struct bt_dpm_policy bt_dpm_policy_t;
2064 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2065 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2066 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2067 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2068 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2069 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2070 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2071 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2072 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2073 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2074 BLUETOOTH_DPM_PROFILE_NONE,
2077 struct bt_dpm_profile_val {
2078 int value; /* tells whether the profile is enabled or disabled */
2080 typedef struct dpm_profile_val dpm_profile_state_t;
2083 * Structure to DPM device list
2087 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2088 } bt_dpm_device_list_t;
2091 * Structure to DPM uuid list
2095 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2096 } bt_dpm_uuids_list_t;
2099 * Structure for IPSP Interface Info
2102 bluetooth_device_address_t btaddr;
2104 } bt_ipsp_connection_info_t;
2108 char* remote_address;
2109 } bt_map_client_session_info_s;
2111 typedef char* bt_map_client_message_object_t;
2116 } bt_map_client_list_folders_filter_t;
2121 int8_t subject_length;
2130 } bt_map_client_list_messages_filter_t;
2133 bt_map_client_message_object_t message_object;
2138 char *sender_address;
2141 char *recipient_address;
2146 int64_t attachment_size;
2151 } bt_map_client_message_item_t;
2157 } bt_map_client_push_message_args_t;
2164 char *sender_address;
2167 char *recipient_address;
2176 } bt_map_client_message_t;
2179 char **names; // holding %size null-terminated folder names
2181 } bt_map_client_folders_s;
2184 bt_map_client_message_item_t *message_items;
2186 } bt_map_client_message_items_s;
2189 const char* target_file;
2191 } bt_get_message_callback_data;
2194 * Callback pointer type
2196 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2199 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2200 * @brief Set the callback function pointer for bluetooth event
2203 * This API will register the callback function, when any response and event are received from
2204 * bluetooth framework. @n
2205 * this registered callback function will be get called with appropriate event and data structures.
2206 * This function is a synchronous call. An application developer can call
2207 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2208 * type. This registered function will receive events of bluetooth_event_type_t type along with
2212 * @param[in] callback_ptr A pointer to the callback function
2213 * @param[in] user_data A pointer to user data
2214 * @return BLUETOOTH_ERROR_NONE - Success
2218 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2220 GMainLoop *main_loop = (GMainLoop*) user_data;
2224 // Code for each event
2226 g_main_loop_quit(main_loop);
2233 GMainLoop *main_loop = NULL;
2236 main_loop = g_main_loop_new(NULL, FALSE);
2237 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2238 if (ret >= BLUETOOTH_ERROR_NONE)
2240 // bluetooth_register_callback returned Success
2244 // bluetooth_register_callback returned failiure
2246 g_main_loop_run(main_loop);
2250 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2253 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2254 * @brief Set the callback function pointer for bluetooth le event
2257 * This API will register the callback function, when any response and event are received from
2258 * bluetooth framework. @n
2259 * this registered callback function will be get called with appropriate event and data structures.
2260 * This function is a synchronous call. An application developer can call
2261 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2262 * type. This registered function will receive events of bluetooth_event_type_t type along with
2266 * @param[in] callback_ptr A pointer to the callback function
2267 * @param[in] user_data A pointer to user data
2268 * @return BLUETOOTH_ERROR_NONE - Success
2272 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2275 * @fn int bluetooth_le_unregister_callback(void)
2276 * @brief Set the callback function pointer for bluetooth le event
2279 * This API will register the callback function, when any response and event are received from
2280 * bluetooth framework. @n
2281 * this registered callback function will be get called with appropriate event and data structures.
2282 * This function is a synchronous call. An application developer can call
2283 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2284 * type. This registered function will receive events of bluetooth_event_type_t type along with
2289 * @return BLUETOOTH_ERROR_NONE - Success
2293 int bluetooth_le_unregister_callback(void);
2296 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2297 * @brief Set the callback function pointer for bluetooth event
2300 * This API will register the callback function, when any response and event are received from
2301 * bluetooth framework. @n
2302 * this registered callback function will be get called with appropriate event and data structures.
2303 * This function is a synchronous call. An application developer can call
2304 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2305 * type. This registered function will receive events of bluetooth_event_type_t type along with
2310 * @return BLUETOOTH_ERROR_NONE - Success
2314 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2316 GMainLoop *main_loop = (GMainLoop*) user_data;
2320 // Code for each event
2322 g_main_loop_quit(main_loop);
2329 GMainLoop *main_loop = NULL;
2332 main_loop = g_main_loop_new(NULL, FALSE);
2333 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2334 if (ret >= BLUETOOTH_ERROR_NONE)
2336 // bluetooth_register_callback returned Success
2340 // bluetooth_register_callback returned failiure
2342 ret = bluetooth_deregister_callback(void);
2343 g_main_loop_run(main_loop);
2347 int bluetooth_unregister_callback(void);
2350 * @fn int bluetooth_enable_adapter(void)
2351 * @brief Enable the Bluetooth H/W
2354 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2355 * send request to bluetooth chip for activation.
2356 * This function is typically called at startup or when Bluetooth services are required. This
2357 * function must be called before calling any other API of Bluetooth operations.
2359 * Before performing any operations like Device discover, service search etc.., the adapter must be
2362 * This function is a asynchronous call.
2363 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2364 * through registered callback function with appropriate result code
2365 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2366 * BLUETOOTH_ERROR_NONE - Success \n
2368 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2369 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2371 * @return BLUETOOTH_ERROR_NONE - Success\n
2372 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2373 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2374 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2375 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2377 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2379 void bt_event_callback(int event, bluetooth_event_param_t *param)
2383 case BLUETOOTH_EVENT_ENABLED:
2384 if (param->result == BLUETOOTH_ERROR_NONE)
2386 // Successfully Enabled
2399 ret = bluetooth_enable_adapter();
2403 int bluetooth_enable_adapter(void);
2406 * @fn int bluetooth_disable_adapter(void)
2407 * @brief Disable the Bluetooth H/W
2410 * This function disables Bluetooth protocol stack and hardware. This function is called when
2411 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2413 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2414 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2415 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2417 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2420 * This function is a asynchronous call.
2421 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2422 * through registered callback function.
2425 * @return BLUETOOTH_ERROR_NONE - Success\n
2426 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2427 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2428 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2430 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2432 void bt_event_callback(int event, bluetooth_event_param_t *param)
2436 case BLUETOOTH_EVENT_DISABLED:
2437 if (param->result == BLUETOOTH_ERROR_NONE)
2439 // Successfully disabled
2452 ret = bluetooth_disable_adapter();
2455 int bluetooth_disable_adapter(void);
2456 int bluetooth_read_battery_data(bt_battery_data *latest);
2457 int bluetooth_set_battery_monitor_state(bool state);
2458 int bluetooth_get_battery_monitor_state(void);
2459 int bluetooth_recover_adapter(void);
2460 int bluetooth_check_adapter_le(void);
2461 int bluetooth_enable_adapter_le(void);
2463 int bluetooth_disable_adapter_le(void);
2464 int bluetooth_get_uuid_name(const char *uuid, char **name);
2467 * @fn int bluetooth_reset_adapter(void)
2468 * @brief Reset the Bluetooth H/W and values
2471 * This function resets Bluetooth protocol stack and hardware. This function is called when
2472 * an user want to initialize Bluetooth environment.
2474 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2477 * This function is a synchronous call.
2479 * @return BLUETOOTH_ERROR_NONE - Success\n
2480 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2482 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2487 ret = bluetooth_reset_adapter();
2490 int bluetooth_reset_adapter(void);
2493 * @fn int bluetooth_is_supported(void)
2494 * @brief Check if the bluetooth is supported or not by the current target
2496 * This API checks whether the bluetooth is supported or not.
2497 * This API only run by root permission.
2499 * This function is a synchronous call.
2501 * @return 0 - if bluetooth is not supported\n
2502 * 1 - if bluetooth is supported\n
2503 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2508 ret = bluetooth_is_supported();
2511 int bluetooth_is_supported(void);
2515 * @fn int bluetooth_check_adapter(void)
2516 * @brief Check the current status of the Bluetooth adapter
2519 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2520 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2521 * bluetooth adapter.
2522 * This API get the adapter internal data structure and check current adapter status.
2524 * This function is a synchronous call.
2527 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2528 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2530 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2534 ret = bluetooth_check_adapter();
2537 int bluetooth_check_adapter(void);
2540 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2541 * @brief Get the local adapter bluetooth address
2544 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2545 * the adapter should be enabled.
2546 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2547 * contain Bluetooth address.
2548 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2549 * friendly name for each device.
2550 * There is no event callback for this API.
2552 * This function is a synchronous call.
2555 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2556 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2557 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2558 * @param[out] local_address a device address of local bluetooth adapter
2563 bluetooth_device_address_t local_address={0,};
2566 ret = bluetooth_get_local_address(&local_address);
2569 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2572 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2573 * @brief Get the hci version
2576 * This function is used to get the bluetooth hci version
2577 * Before calling this API make sure that the adapter is enabled.
2579 * This function is a synchronous call.
2582 * @return BLUETOOTH_ERROR_NONE - Success \n
2583 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2584 * @param[out] timeout remain visibility timeout value
2587 bluetooth_version_t *version;
2589 ret = bluetooth_get_local_version (&version);
2592 int bluetooth_get_local_version(bluetooth_version_t *version);
2595 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2596 * @brief Get the local device name
2599 * This function is used, get the local device name. Since its difficult to remember the Adapter
2600 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2601 * friendly name is retrived by the remote device and displaying.
2602 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2604 * This function is a synchronous call.
2607 * @return BLUETOOTH_ERROR_NONE - Success \n
2608 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2609 * @param[out] local_name a local device name
2613 bluetooth_device_name_t local_name={0,}
2615 ret = bluetooth_get_local_name (&local_name);
2618 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2621 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2622 * @brief Set the local device name
2625 * This function is used to set the local device name. This is a human friendly name whose
2626 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2628 * This function is a synchronous call.
2630 * @param[in] local_name bluetooth device name to set local device
2632 * @return BLUETOOTH_ERROR_NONE - Success \n
2633 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2634 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2635 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2636 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2637 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2642 bluetooth_device_name_t local_name={0,}
2644 ret = bluetooth_set_local_name (&local_name);
2647 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2651 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2652 * @brief Check if the uuid is used or not
2654 * This function is used to check if the uuid is used or not.
2656 * This function is a synchronous call.
2658 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2659 * @param[out] used if the uuid is used or not
2661 * @return BLUETOOTH_ERROR_NONE - Success \n
2662 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2663 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2664 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2669 gboolean used = FALSE;
2670 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2671 ret = bluetooth_is_service_used(uuid, &used);
2674 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2677 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2678 * @brief Check if the device is connected to the specific service
2680 * This function is used to check if if the device is connected to the specific service.
2682 * This function is a synchronous call.
2684 * @param[in] local_address a device address of remote bluetooth device
2685 * @param[in] type the service type
2686 * @param[out] is_connected if the device is connected or not
2688 * @return BLUETOOTH_ERROR_NONE - Success \n
2689 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2690 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2691 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2696 gboolean is_connected = FALSE;
2697 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2698 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2701 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2702 bluetooth_service_type_t type,
2703 gboolean *is_connected);
2706 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2707 * @brief Gets device's connected link type
2709 * This function is used to get device's connected link type
2711 * This function is a synchronous call.
2713 * @param[in] device_address a device address of remote bluetooth device
2714 * @param[out] connected_link a device's connected link type
2716 * @return BLUETOOTH_ERROR_NONE - Success \n
2717 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2718 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2719 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2724 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2725 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2726 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2729 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2730 bluetooth_connected_link_t *connected_link);
2733 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2734 * @brief Sets a profile trusted for a device
2736 * This function is used to Set a profile as trusted for a device
2738 * This function is a synchronous call.
2740 * @param[in] device_address a device address of remote bluetooth device
2741 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2742 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2744 * @return BLUETOOTH_ERROR_NONE - Success \n
2745 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2746 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2747 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2751 int bluetooth_set_profile_trusted(
2752 const bluetooth_device_address_t *device_address,
2753 int profile, int trust);
2756 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2757 * @brief Gets a profile is trusted for a device
2759 * This function is used to Get a profile is trusted or not for a device
2761 * This function is a synchronous call.
2763 * @param[in] device_address a device address of remote bluetooth device
2764 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2765 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2767 * @return BLUETOOTH_ERROR_NONE - Success \n
2768 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2769 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2770 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2774 int bluetooth_get_profile_trusted(
2775 const bluetooth_device_address_t *device_address,
2776 int profile, int *trust);
2779 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2780 * @brief Get the visibility mode
2783 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2784 * visibity mode, the property of the device is determined whether it can be discoverable, non
2785 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2787 * This function is a synchronous call.
2790 * @return BLUETOOTH_ERROR_NONE - Success \n
2791 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2792 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2793 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2794 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2795 * @param[out] discoverable_mode current bluetooth discoverable mode
2797 * @see bluetooth_set_discoverable_mode
2799 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2801 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2804 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2807 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2809 * @brief Set the visibility mode
2812 * This function is used to set the discoverable mode (Visibility option).
2814 * Many times user may want to keep his device discoverable so that when peer device is performing
2815 * device search, he/she can find user's device. Application programmer can keep the mode as
2816 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2817 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2818 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2819 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2821 * This function is a synchronous call.
2823 * @return BLUETOOTH_ERROR_NONE - Success \n
2824 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2826 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2827 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2829 * @see bluetooth_get_discoverable_mode
2833 bluetooth_discoverable_mode_t mode;
2835 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2836 ret = bluetooth_set_discoverable_mode (mode, 180);
2840 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2845 * @fn int bluetooth_get_timeout_value(int *timeout)
2846 * @brief Get the visibility timeout value
2849 * This function is used to get the visibility timeout
2850 * Before calling this API make sure that the adapter is enabled.
2852 * This function is a synchronous call.
2855 * @return BLUETOOTH_ERROR_NONE - Success \n
2856 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2857 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2858 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2859 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2860 * @param[out] timeout remain visibility timeout value
2862 * @see bluetooth_set_discoverable_mode
2866 ret = bluetooth_get_timeout_value (&timeout);
2869 int bluetooth_get_timeout_value(int *timeout);
2873 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2874 * unsigned int classOfDeviceMask)
2875 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2877 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2878 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2879 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2880 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2881 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2882 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2883 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2884 * please see bluetooth_device_info_t for more details.
2887 * This API provides searching options like max responses, discovery duration in seconds and class
2888 * of device mask to filter device search. some times there may be too many bluetooth devices in
2889 * vicinity of your device.in such scenario, application can request to reduce number of responces
2890 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2891 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2892 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2893 * application defined time. please note that discovery_duration should be mentioned in seconds.
2894 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2897 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2898 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2899 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2901 * This function is a asynchronous call.
2902 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2903 * through registered callback function.
2905 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2906 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2908 * The completion or cancellation of the discovery is indicated by an
2909 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2911 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2914 * @return BLUETOOTH_ERROR_NONE - Success \n
2915 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2916 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2917 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2918 agent is not running \n
2920 * @param[in] max_response define the maximum response of the number of founded devices
2922 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2923 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2924 (refer to class of device)
2926 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2929 void bt_event_callback(int event, bluetooth_event_param_t *param)
2933 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2935 bluetooth_device_info_t *device_info = NULL;
2936 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2938 device_info = (bluetooth_device_info_t *)param->param_data;
2939 memcpy(&searched_device, &device_info->device_address,
2940 sizeof(bluetooth_device_address_t));
2941 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2942 device_info->device_address.addr[0],
2943 device_info->device_address.addr[1],
2944 device_info->device_address.addr[2],
2945 device_info->device_address.addr[3],
2946 device_info->device_address.addr[4],
2947 device_info->device_address.addr[5]);
2950 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2952 bluetooth_device_info_t *device_info = NULL;
2953 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2955 device_info = (bluetooth_device_info_t *)param->param_data;
2956 memcpy(&searched_device, &device_info->device_address,
2957 sizeof(bluetooth_device_address_t));
2958 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2959 device_info->device_name.name,
2960 device_info->device_address.addr[0],
2961 device_info->device_address.addr[1],
2962 device_info->device_address.addr[2],
2963 device_info->device_address.addr[3],
2964 device_info->device_address.addr[4],
2965 device_info->device_address.addr[5]);
2969 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2970 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2975 unsigned short max_response;
2976 unsigned short discovery_duration;
2977 unsigned classOfDeviceMask;
2981 discovery_duration =0;
2982 classOfDeviceMask =0;
2984 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2989 int bluetooth_start_discovery(unsigned short max_response,
2990 unsigned short discovery_duration,
2991 unsigned int classOfDeviceMask);
2994 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2995 * unsigned short max_response,
2996 * unsigned short discovery_duration,
2997 * unsigned int classOfDeviceMask)
2998 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
3000 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
3001 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
3002 * Please see bluetooth_start_discovery() for other parameters description.
3004 * This function is a asynchronous call.
3005 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
3006 * through registered callback function.
3008 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
3009 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
3011 * The completion or cancellation of the discovery is indicated by an
3012 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
3014 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
3017 * @return BLUETOOTH_ERROR_NONE - Success \n
3018 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3019 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3020 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
3021 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3022 agent is not running \n
3024 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
3025 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
3026 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
3027 * @param[in] max_response define the maximum response of the number of founded devices
3029 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3030 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3031 (refer to class of device)
3033 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3036 unsigned short type;
3037 unsigned short max_response;
3038 unsigned short discovery_duration;
3039 unsigned classOfDeviceMask;
3044 discovery_duration =0;
3045 classOfDeviceMask =0;
3047 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3052 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3053 unsigned short max_response,
3054 unsigned short discovery_duration,
3055 unsigned int classOfDeviceMask);
3058 * @fn int bluetooth_cancel_discovery (void)
3059 * @brief Cancel the on-going device discovery operation
3062 * This function stops the on-going device discovery operation. This API has to be called after the
3063 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3064 * the bluetooth_start_discovery API
3066 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3067 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3068 * cancel the discover request once the user received the device to which he wish to connect.
3070 * This function is a asynchronous call.
3071 * If the call is success to cancel discovey then the application will receive
3072 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3073 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3074 * BLUETOOTH_ERROR_NONE
3077 * @return BLUETOOTH_ERROR_NONE - Success \n
3078 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3079 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3080 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3081 other application \n
3082 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3084 * @see bluetooth_start_discovery
3086 void bt_event_callback(int event, bluetooth_event_param_t *param)
3090 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3091 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3100 ret = bluetooth_cancel_discovery();
3103 int bluetooth_cancel_discovery(void);
3106 * @fn int bluetooth_start_le_discovery(void)
3107 * @brief Start the generic device discovery which finds the LE devices.
3109 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3110 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3111 * It try to find LE devices. Bluetooth device address and name are
3112 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3113 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3114 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3115 * please see bluetooth_device_info_t for more details.
3117 * This function is a asynchronous call.
3118 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3119 * through registered callback function.
3121 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3124 * The completion or cancellation of the discovery is indicated by an
3125 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3127 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3130 * @return BLUETOOTH_ERROR_NONE - Success \n
3131 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3132 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3133 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3134 agent is not running \n
3137 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3140 void bt_event_callback(int event, bluetooth_event_param_t *param)
3144 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3146 bluetooth_device_info_t *device_info = NULL;
3147 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3149 device_info = (bluetooth_device_info_t *)param->param_data;
3150 memcpy(&searched_device, &device_info->device_address,
3151 sizeof(bluetooth_device_address_t));
3152 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3153 device_info->device_address.addr[0],
3154 device_info->device_address.addr[1],
3155 device_info->device_address.addr[2],
3156 device_info->device_address.addr[3],
3157 device_info->device_address.addr[4],
3158 device_info->device_address.addr[5]);
3162 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3163 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3169 ret = bluetooth_start_discovery();
3174 int bluetooth_start_le_discovery(void);
3177 * @fn int bluetooth_stop_le_discovery (void)
3178 * @brief Cancel the on-going device LE discovery operation
3181 * This function stops the on-going device discovery operation. This API has to be called after the
3182 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3183 * the bluetooth_start_le_discovery API
3186 * This function is a asynchronous call.
3187 * If the call is success to cancel discovey then the application will receive
3188 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3189 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3190 * BLUETOOTH_ERROR_NONE
3193 * @return BLUETOOTH_ERROR_NONE - Success \n
3194 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3195 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3196 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3197 other application \n
3198 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3200 * @see bluetooth_start_discovery
3202 void bt_event_callback(int event, bluetooth_event_param_t *param)
3206 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3207 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3216 ret = bluetooth_stop_le_discovery();
3219 int bluetooth_stop_le_discovery(void);
3222 * @fn int bluetooth_is_discovering(void)
3223 * @brief Check for the device discovery is in-progress or not.
3225 * This API is used to check the current status of the Discovery operation.If discovery is in\
3226 * progress normally other operations are not allowed.
3227 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3228 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3229 * event before performing other operations. This API is used to get for the current discovery
3230 * operation status and using bluetooth_cancel_discovery()
3231 * we can cancell the ongoing discovery process.
3232 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3235 * This function checks whether the device discovery is started or not.
3237 * This function is a synchronous call.
3240 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3241 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3242 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3245 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3249 ret = bluetooth_is_discovering ();
3252 int bluetooth_is_discovering(void);
3255 * @fn int bluetooth_is_le_discovering(void)
3256 * @brief Check for the device LE discovery is in-progress or not.
3258 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3259 * progress normally other operations are not allowed.
3260 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3261 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3262 * event before performing other operations. This API is used to get for the current discovery
3263 * operation status and using bluetooth_stop_le_discovery()
3264 * we can cancell the ongoing LE discovery process.
3265 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3268 * This function checks whether the device LE discovery is started or not.
3270 * This function is a synchronous call.
3273 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3274 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3275 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3278 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3282 ret = bluetooth_is_le_discovering ();
3285 int bluetooth_is_le_discovering(void);
3288 * @fn int bluetooth_is_le_scanning(void)
3289 * @brief Check for the device LE scan is in-progress or not.
3291 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3292 * progress normally other operations are not allowed.
3294 * This function checks whether the device LE Scan is started or not.
3296 * This function is a synchronous call.
3298 * @return TRUE - LE Scan in progress \n
3299 * FALSE - LE Scan is not in progress \n
3304 gboolean is_le_scanning = 0;
3305 is_le_scanning = bluetooth_is_le_scanning ();
3308 gboolean bluetooth_is_le_scanning(void);
3310 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3313 * @fn int bluetooth_force_hcidump(int timeout)
3314 * @brief Enable /disable force-hcidump
3316 * This function control force-hcidump.
3318 * This function is a synchronous call.
3320 * @return BLUETOOTH_ERROR_NONE - Success \n
3321 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3322 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3324 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3329 int bluetooth_force_hcidump(int timeout);
3332 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3333 * @brief Register scan filter.
3335 * This function registers the scan filter.
3337 * This function is a synchronous call.
3339 * @return BLUETOOTH_ERROR_NONE - Success \n
3341 * @param[in] filter scan filter to register
3345 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3348 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3349 int link_type, bt_rssi_threshold_t rssi_threshold)
3350 * @brief Enable RSSI monitoring
3352 * This function enables RSSI monitoring and sets threshold for a connection
3354 * @return BLUETOOTH_ERROR_NONE - Success \n
3357 * @see bluetooth_get_rssi_strength
3359 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3360 int link_type, bt_rssi_threshold_t *rssi_threshold);
3363 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3364 * @brief Gets Raw RSSI signal Strength
3366 * This function gives the Raw RSSI signal strength for a connection.
3368 * @return BLUETOOTH_ERROR_NONE - Success \n
3371 * @see bluetooth_enable_rssi
3373 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3375 int bluetooth_set_connectable(gboolean is_connectable);
3377 int bluetooth_is_connectable(gboolean *is_connectable);
3379 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3382 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3383 * @brief Initiate a bonding process
3386 * This function initiates a bonding procedure with a peer device. The bonding procedure
3387 * enables authentication and optionally encryption on the Bluetooth link.
3389 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3390 * inititate the bonding request to the devices already in the paired list.
3392 * Usually we call this API after the device discovery.
3393 * This function is a asynchronous call.
3395 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3396 * mentioed result code
3397 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3398 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3399 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3400 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3401 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3403 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3404 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3407 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3410 * @return BLUETOOTH_ERROR_NONE - Success \n
3411 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3412 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3413 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3414 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3416 * @param[in] device_address This indicates an address of the device with which the pairing
3417 * should be initiated
3419 * @see bluetooth_cancel_bonding
3421 void bt_event_callback(int event, bluetooth_event_param_t *param)
3425 case BLUETOOTH_EVENT_BONDING_FINISHED:
3427 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3428 if (param->result >= BLUETOOTH_ERROR_NONE)
3430 bluetooth_device_info_t *device_info = NULL;
3431 device_info = (bluetooth_device_info_t *)param->param_data;
3432 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3433 mjr[%#x] min[%#x] srv[%#x]",
3434 device_info->device_name.name,
3435 device_info->device_address.addr[0],
3436 device_info->device_address.addr[1],
3437 device_info->device_address.addr[2],
3438 device_info->device_address.addr[3],
3439 device_info->device_address.addr[4],
3440 device_info->device_address.addr[5],
3441 device_info->device_class.major_class,
3442 device_info->device_class.minor_class,
3443 device_info->device_class.service_class);
3457 bluetooth_device_address_t device_address={{0}};
3459 ret = bluetooth_bond_device(&device_address);
3463 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3466 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3467 * bluetooth_conn_type_t conn_type)
3468 * @brief Initiate a bonding process
3471 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3472 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3474 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3475 * inititate the bonding request to the devices already in the paired list.
3477 * Usually we call this API after the device discovery.
3478 * This function is a asynchronous call.
3480 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3481 * mentioed result code
3482 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3483 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3484 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3485 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3486 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3488 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3489 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3492 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3495 * @return BLUETOOTH_ERROR_NONE - Success \n
3496 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3497 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3498 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3499 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3501 * @param[in] device_address This indicates an address of the device with which pairing
3502 * should be initiated
3503 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3506 * @see bluetooth_cancel_bonding
3508 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3509 bluetooth_conn_type_t conn_type);
3512 * @fn int bluetooth_cancel_bonding(void)
3513 * @brief Cancel the on-going bonding process
3515 * This API is called to cancel the on-going bonding procedure. It should be called before the
3516 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3517 * This API is useful when the remote device is not responding to the bond request or we wish to
3518 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3520 * This function is a synchronous call.
3522 * @return BLUETOOTH_ERROR_NONE - Success \n
3523 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3524 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3527 * @see bluetooth_bond_device
3533 ret = bluetooth_cancel_bonding();
3536 int bluetooth_cancel_bonding(void);
3539 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3540 * @brief Remove bonding
3543 * To communicate with remote device over bluetooth link, user should bond with peer device.
3544 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3545 * API is used to remove peer device from the list. Please note that after removing the device
3546 * from bonded device list, you cannot communication with peer device until bonding happens again.
3548 * User can call this function by passing bluetooth device address of any bonded device. Please note
3549 * that after successful return of this function, any bluetooth application running on your device
3550 * will not be able to communicate with unbonded device until bond operation happens again using
3551 * bluetooth_bond_device()
3554 * This function is a asynchronous call. The request to remove the specified device from the bonded
3555 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3556 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3557 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3561 * @return BLUETOOTH_ERROR_NONE - Success \n
3562 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3563 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3564 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3565 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3566 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3567 * agent is not running \n
3568 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3571 * @param[in] device_address This indicates an address of the device to remove bonding
3575 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3578 void bt_event_callback(int event, bluetooth_event_param_t *param)
3581 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3582 bluetooth_device_address_t *dev_addr = NULL;
3584 if (param->result == BLUETOOTH_ERROR_NONE) {
3585 dev_addr = (bluetooth_device_address_t *)param->param_data;
3587 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3588 dev_addr->addr[0], dev_addr->addr[1]
3589 dev_addr->addr[2], dev_addr->addr[3]
3590 dev_addr->addr[4], dev_addr->addr[5]
3601 bluetooth_device_address_t *device_address;
3603 // copy valid device address in device_address
3605 ret = bluetooth_unbond_device(device_address);
3608 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3611 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3612 * @brief Get bonded(paired) device list
3615 * This API gets all bonded device list.
3616 * The devices in the bonded device list further can be used to perform the authorization by calling
3617 * bluetooth_authorize_device API.
3619 * This function is a synchronous call.
3620 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3621 * there is no valid information in the dev_list.
3622 * The len field in the dev_list represents the number of bonded devices. The data structure for
3623 * bonded device information is bluetooth_device_info_t.
3626 * @return BLUETOOTH_ERROR_NONE - Success \n
3627 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3629 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3631 void bt_get_bonded_devices(void)
3635 GPtrArray *devinfo = NULL;
3636 bluetooth_device_info_t *ptr;
3638 // allocate the g_pointer_array
3639 devinfo = g_ptr_array_new();
3641 ret = bluetooth_get_bonded_device_list(&devinfo);
3642 if (ret != BLUETOOTH_ERROR_NONE)
3644 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3648 printf("g pointer arrary count : [%d]", devinfo->len);
3649 for (i=0; i<devinfo->len; i++)
3651 ptr = g_ptr_array_index(devinfo, i);
3654 printf("Name [%s]\n", ptr->device_name.name);
3655 printf("Major Class [%d]\n", ptr->device_class.major_class);
3656 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3657 printf("Service Class [%d]\n", ptr->device_class.service_class);
3658 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3659 ptr->device_address.addr[0],
3660 ptr->device_address.addr[1], ptr->device_address.addr[2],
3661 ptr->device_address.addr[3],
3662 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3669 // free g_pointer_array
3670 g_ptr_array_free(devinfo, TRUE);
3675 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3677 int bluetooth_get_profile_connected_device_list(
3678 const char *profile_uuid, GPtrArray **addr_list);
3681 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3682 * bluetooth_device_info_t *dev_info)
3683 * @brief Get a bonded(paired) device
3686 * This API gets a bonded device.
3688 * This function is a synchronous call.
3689 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3690 * there is no valid information in the dev_info.
3691 * The data structure for bonded device information is bluetooth_device_info_t.
3694 * @return BLUETOOTH_ERROR_NONE - Success \n
3695 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3697 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3699 void bt_get_bonded_device(void)
3703 bluetooth_device_info_t devinfo = {0};
3704 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3706 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3707 if (ret != BLUETOOTH_ERROR_NONE)
3709 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3713 printf("Name [%s]\n", devinfo.device_name.name);
3714 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3715 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3716 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3717 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3718 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3719 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3720 devinfo.device_address.addr[5]);
3729 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3730 bluetooth_device_info_t *dev_info);
3733 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3734 * gboolean *is_alias_set)
3735 * @brief Get is_alias_set property of device
3737 * This API gets is_alias_set property of a bonded device.
3739 * This function is a synchronous call.
3740 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3741 * If not,there is no valid information in the is_alias_set.
3743 * @return BLUETOOTH_ERROR_NONE - Success \n
3744 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3749 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3751 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3754 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3755 gboolean *is_alias_set);
3758 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3759 * @brief set alias for bonded device
3762 * This function set alias for bonded device.
3764 * This function is a synchronous call.
3767 * @return BLUETOOTH_ERROR_NONE - Success \n
3768 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3769 * @param[in] device_address This indicates an address of the remote device
3770 * @param[in] alias This indicates an alias to set
3775 ret = bluetooth_set_alias(&remote_address);
3778 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3782 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3783 * @brief Get remote deivice
3786 * This function gets specific remote device.
3788 * This function is a asynchronous call.
3789 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3792 * @return BLUETOOTH_ERROR_NONE - Success \n
3793 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3794 * @param[in] device_address This indicates an address of the remote device
3799 ret = bluetooth_get_remote_device(&remote_address);
3802 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3805 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3806 * gboolean authorized)
3807 * @brief Authorize/Unauthorize a bonded device
3810 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3811 * with/without user confirmation.
3813 * If we select a paired device and make it authorized by calling this API with the authorized
3814 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3815 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3816 * then it will ask for the user conformation before the connection.
3818 * This API supposed to be called on the paired devices. Which means we have to use this API only
3819 * after successful pairing.
3821 * This function is a asynchronous call.
3822 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3824 * @return BLUETOOTH_ERROR_NONE - Success \n
3825 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3826 * @param[in] device_address This indicates an address of the device to authorize \n
3827 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3829 * @see bluetooth_get_bonded_device_list
3831 void bt_event_callback(int event, bluetooth_event_param_t *param)
3835 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3837 if (param->result == BLUETOOTH_ERROR_NONE)
3841 //device authorization failed failure
3849 bluetooth_device_address_t device_address={{0}};
3850 gboolean authorized;
3854 ret = bluetooth_authorize_device(&device_address,authorized);
3857 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3858 gboolean authorized);
3860 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3861 const bluetooth_device_pin_code_t *pin_code);
3863 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3866 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3868 * @brief Receives Legacy Passkey\pin with following authentication response types
3870 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3871 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3874 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3877 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3879 * @brief This API sends user confirmation reply to the local adapter.
3881 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3884 int bluetooth_passkey_confirmation_reply(gboolean reply);
3887 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3888 * @brief Get all services supported by remote device
3891 * This API call initiates the search for the services supported by the specified device. Normally
3892 * the service search will take a couple of seconds to get it completed. Before calling this API
3893 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3894 * perform the service search. We can get the device address by doing a device discovery operation.
3897 * This function is a asynchronous call.
3898 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3900 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3901 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3902 * event is generated with appropriate result code.
3904 * @return BLUETOOTH_ERROR_NONE - Success \n
3905 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3906 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3907 * @param[in] device_address This indicates an address of the device
3908 * whose services need to be found
3910 * @see bluetooth_cancel_service_search
3912 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3915 * @fn int bluetooth_cancel_service_search(void)
3916 * @brief Cancel the ongoing service search operation
3919 * This function cancel the ongoing service search operation. This API is usually calling after the
3920 * bluetooth_search_service API.
3921 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3922 * if the user wish to cancel the Ongoing service search operation.
3924 * This API should be called just after the bluetooth_search_service API and before the
3925 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3927 * This function is a synchronous call.
3929 * @return BLUETOOTH_ERROR_NONE - Success \n
3930 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3931 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3932 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3935 * @see bluetooth_search_service
3940 ret = bluetooth_cancel_service_search();
3943 int bluetooth_cancel_service_search(void);
3946 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3947 * @brief Register rfcomm socket with a specific uuid
3950 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3951 * descriptor of the server.
3952 * This is the first API which is called to create the server. Once we created the server socket,
3953 * we will listen on that return socket.
3954 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3957 * @return socket FD on Success \n
3958 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3959 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3960 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3961 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3962 * @param[in] UUID (128 bits)
3965 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3969 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3970 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3974 int bluetooth_rfcomm_create_socket(const char *uuid);
3977 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3978 * @brief Register rfcomm socket with a specific uuid
3981 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3982 * descriptor of the server.
3983 * This is the first API which is called to create the server. Once we created the server socket,
3984 * we will listen on that return socket.
3985 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3988 * @return socket FD on Success \n
3989 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3990 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3991 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3992 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3993 * @param[in] UUID (128 bits)
3994 * @param[in] bus_name (const char)
3995 * @param[in] path (const char)
3998 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
4002 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4003 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
4007 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
4010 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
4011 * @brief De-register the rfcomm socket
4014 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
4015 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4016 * descriptor else no event will come. We will call this API only after the
4017 * bluetooth_rfcomm_listen_and_accept.
4018 * This is a synchronous call.
4020 * @return BLUETOOTH_ERROR_NONE - Success \n
4021 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4022 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4023 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4024 * @param[in] int socket_fd
4027 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
4030 void bt_event_callback(int event, bluetooth_event_param_t *param)
4034 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4036 bluetooth_rfcomm_connection_t *discon_ind =
4037 (bluetooth_rfcomm_connection_t *)param->param_data;
4039 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4047 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4048 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4050 ret = bluetooth_rfcomm_remove_socket(fd);
4053 int bluetooth_rfcomm_remove_socket(int socket_fd);
4056 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4057 * @brief De-register the rfcomm socket
4060 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4061 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4062 * descriptor else no event will come. We will call this API only after the
4063 * bluetooth_rfcomm_listen_and_accept_ex.
4064 * This is a synchronous call.
4066 * @return BLUETOOTH_ERROR_NONE - Success \n
4067 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4068 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4069 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4070 * @param[in] UUID (128 bits)
4073 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4076 void bt_event_callback(int event, bluetooth_event_param_t *param)
4080 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4082 bluetooth_rfcomm_connection_t *discon_ind =
4083 (bluetooth_rfcomm_connection_t *)param->param_data;
4085 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4093 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4094 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4096 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4099 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4102 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4103 * @brief Disconnect rfcomm connection
4106 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4107 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4110 * @return BLUETOOTH_ERROR_NONE - Success \n
4111 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4112 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4113 * @param[in] int socket_fd the sending socket fd
4119 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4121 printf("Disconnection failed");
4123 printf("Disconnection Success");
4127 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4130 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4131 * @brief Rfcomm socket listen
4134 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4135 * after the bluetooth_rfcomm_create_socket API.
4136 * This API listen for the incomming connection and once it receives a connection, it will give
4137 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4138 * event to the application. This is an Asynchronous API call.
4141 * @return BLUETOOTH_ERROR_NONE - Success \n
4142 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4143 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4145 * @param[in] int socket_fd
4146 * @param[in] max pending connection.
4149 * @see bluetooth_rfcomm_create_socket
4152 void bt_event_callback(int event, bluetooth_event_param_t* param)
4156 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4158 bluetooth_rfcomm_connection_t *conn_ind =
4159 (bluetooth_rfcomm_connection_t *)param->param_data;
4161 printf("\nConnected from FD %d", conn_ind->socket_fd);
4169 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4170 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4174 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4177 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4178 * @brief Rfcomm socket listen
4181 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4182 * after the bluetooth_rfcomm_create_socket API.
4183 * This API listen for the incomming connection and once it receives a connection, it will give
4184 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4185 * event to the application. This is an Asynchronous API call.
4188 * @return BLUETOOTH_ERROR_NONE - Success \n
4189 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4190 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4192 * @param[in] int socket_fd
4193 * @param[in] max pending connection.
4198 * @see bluetooth_rfcomm_create_socket_ex
4201 void bt_event_callback(int event, bluetooth_event_param_t* param)
4205 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4207 bluetooth_rfcomm_connection_t *conn_ind =
4208 (bluetooth_rfcomm_connection_t *)param->param_data;
4210 printf("\nConnected from FD %d", conn_ind->socket_fd);
4218 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4219 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4224 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4227 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4228 * @brief Rfcomm socket listen
4231 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4232 * after the bluetooth_rfcomm_create_socket API.
4233 * This API listen for the incomming connection and once it receives a connection, it will give
4234 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4235 * event to the application. This is an Asynchronous API call.
4238 * @return BLUETOOTH_ERROR_NONE - Success \n
4239 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4240 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4242 * @param[in] int socket_fd
4243 * @param[in] max pending connection.
4246 * @see bluetooth_rfcomm_create_socket
4249 void bt_event_callback(int event, bluetooth_event_param_t* param)
4253 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4255 char *name = (char *)param->param_data;
4257 printf("\nConnected from %s", name);
4259 bluetooth_rfcomm_accept_connection();
4267 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4268 ret = bluetooth_rfcomm_listen(fd, 1);
4272 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4275 * @fn int bluetooth_rfcomm_accept_connection()
4276 * @brief Accepts the authorization request indicated by the event
4277 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4279 * This function is a synchronous call.
4281 * @return BLUETOOTH_ERROR_NONE - Success \n
4282 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4284 * @param[in] the socket fd of the server
4285 * @param[out] the socket fd of the client
4289 * @see bluetooth_rfcomm_reject_connection
4291 int bluetooth_rfcomm_accept_connection(int server_fd);
4294 * @fn int bluetooth_rfcomm_reject_connection()
4295 * @brief Rejects the authorization request indicated by the event
4296 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4298 * This function is a synchronous call.
4300 * @return BLUETOOTH_ERROR_NONE - Success \n
4301 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4303 * @param[in] the socket fd of the server
4307 * @see bluetooth_rfcomm_accept_connection
4309 int bluetooth_rfcomm_reject_connection(int server_fd);
4312 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4313 * @brief Informs whether rfcomm server uuid is available or not.
4315 * This function is a synchronous call.
4317 * @return TRUE - RFCOMM uuid is available \n
4318 * FALSE - RFCOMM uuid is not available \n
4320 * @param[in] uuid UUID string
4326 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4329 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4330 * const char *remote_uuid)
4331 * @brief Connect to the remote device rfcomm *
4333 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4334 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4335 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4336 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4337 * initiating a connection.
4339 * @return BLUETOOTH_ERROR_NONE - Success \n
4340 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4341 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4342 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4343 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4344 * @param[in] bluetooth_device_address_t remote bt_address
4345 * @param[in] char remote uuid
4347 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4351 void bt_event_callback(int event, bluetooth_event_param_t *param)
4355 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4357 if (param->result >= BLUETOOTH_ERROR_NONE)
4359 bt_sdp_info_t *bt_sdp_info=param->param_data;
4361 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4362 bt_sdp_info->device_addr.addr[0],
4363 bt_sdp_info->device_addr.addr[1],
4364 bt_sdp_info->device_addr.addr[2],
4365 bt_sdp_info->device_addr.addr[3],
4366 bt_sdp_info->device_addr.addr[4],
4367 bt_sdp_info->device_addr.addr[5]);
4369 printf("Supported service list:\n");
4370 for(i=0; i<bt_sdp_info->service_index; i++)
4372 bt_sdp_info->service_list_array[i]);
4375 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4376 //rfcomm_test_uuid);
4380 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4382 bluetooth_rfcomm_connection_t *conn_ind =
4383 (bluetooth_rfcomm_connection_t *)param->param_data;
4385 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4386 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4387 "SERVER" : "CLIENT");
4392 bluetooth_device_address_t remote_address = {{0},};
4393 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4394 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4395 ret = bluetooth_search_service(&remote_address);
4397 printf("Seach failed, Reason = %d", ret);
4399 printf("Search Success, Ret = %d", ret);
4401 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4403 printf("Connection failed, Reason = %d", ret);
4405 printf("Connection Success, Ret = %d", ret);
4409 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4410 const char *remote_uuid);
4413 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4414 * @brief Disconnect rfcomm connection
4417 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4418 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4421 * @return BLUETOOTH_ERROR_NONE - Success \n
4422 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4423 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4424 * @param[in] char remote bt_address
4427 * @see bluetooth_rfcomm_connect
4431 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4433 printf("Disconnection failed");
4435 printf("Disconnection Success");
4440 int bluetooth_rfcomm_disconnect(int socket_fd);
4443 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4444 * @brief Write to rfcomm connection
4447 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4448 * API is used to send the data for server and the client.
4450 * @return BLUETOOTH_ERROR_NONE - Success \n
4451 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4452 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4454 * @param[in] const char *buff Data buffer to send
4455 * @param[in] int length Length of the data
4458 * @see bluetooth_rfcomm_connect
4461 char *buff = "Test data 123456789"
4462 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4464 printf("Send failed");
4466 printf("Send success");
4470 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4473 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4474 * @brief Informs whether rfcomm client is connected.
4476 * This function is a synchronous call.
4478 * @return TRUE - RFCOMM client is connected \n
4479 * FALSE - RFCOMM client is not connected \n
4485 gboolean bluetooth_rfcomm_is_client_connected(void);
4486 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4487 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4490 * @fn int bluetooth_network_activate_server(void)
4491 * @brief Activate the NAP (Network Access Point) service
4493 * This function is a asynchronous call.
4494 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4496 * @return BLUETOOTH_ERROR_NONE - Success \n
4497 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4498 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4499 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4502 * @see bluetooth_network_deactivate_server
4505 int bluetooth_network_activate_server(void);
4508 * @fn int bluetooth_network_deactivate_server(void)
4509 * @brief Deactivate the NAP (Network Access Point) service
4511 * This function is a asynchronous call.
4512 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4514 * @return BLUETOOTH_ERROR_NONE - Success \n
4515 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4516 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4517 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4520 * @see bluetooth_network_activate_server
4523 int bluetooth_network_deactivate_server(void);
4526 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4527 * bluetooth_network_role_t role,
4529 * @brief Connect the network server in the peer
4531 * This function is a asynchronous call.
4532 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4534 * @return BLUETOOTH_ERROR_NONE - Success \n
4535 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4536 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4537 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4540 * @param[in] device_address This indicates an address of the device with which the pairing
4541 * should be initiated
4542 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4543 * need to use the third parameter.
4544 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4545 * connect. UUID string
4547 * @see bluetooth_network_disconnect
4549 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4550 bluetooth_network_role_t role, char *custom_uuid);
4553 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4554 * bluetooth_network_role_t role,
4555 * char *custom_uuid)
4556 * @brief Connect the network server in the peer
4558 * This function is a asynchronous call.
4559 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4561 * @return BLUETOOTH_ERROR_NONE - Success \n
4562 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4563 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4564 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4567 * @param[in] device_address This indicates an address of the device with which the pairing
4568 * should be initiated
4570 * @see bluetooth_network_connect
4572 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4575 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4576 * @brief Disconnect the device from the network
4578 * This function is an asynchronous call.
4579 * The network server disconnect request is responded by
4580 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4582 * @return BLUETOOTH_ERROR_NONE - Success \n
4583 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4584 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4585 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4588 * @param[in] device_address This indicates an address of the connected client device
4590 * @see bluetooth_network_activate_server
4592 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4597 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4598 * bt_hdp_role_type_t role,
4599 * bt_hdp_qos_type_t channel_type,
4600 * char **app_handle)
4601 * @brief Activate the HDP service for a particular data type
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] data_type The data type against corresponding service
4612 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4613 * @param[in] channel_type The QOS type for the channel.
4614 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4615 * For role = HDP_ROLE_SINK, the channel_type
4616 * should be HDP_QOS_ANY.
4617 * @param[out] app_handle The application handler against corresponding service
4619 * @see bluetooth_hdp_deactivate
4621 int bluetooth_hdp_activate(unsigned short data_type,
4622 bt_hdp_role_type_t role,
4623 bt_hdp_qos_type_t channel_type,
4626 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4627 * @brief Deactivate the HDP service for a particular service using the handler
4629 * This function is a synchronous call.
4631 * @return BLUETOOTH_ERROR_NONE - Success \n
4632 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4633 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4634 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4637 * @param[in] app_handle The application handler against corresponding service
4639 * @see bluetooth_hdp_deactivate
4641 int bluetooth_hdp_deactivate(const char *app_handle);
4644 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4645 * const char *buffer, unsigned int size)
4646 * @brief Send data to the remote HDP device
4648 * This function is a synchronous call.
4650 * @return BLUETOOTH_ERROR_NONE - Success \n
4651 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4652 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4653 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4654 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4657 * @param[in] channel_id The channel id for the connection.
4658 * @param[in] buffer The pdu buffer.
4659 * @param[in] size Size of the buffer.
4661 * @see bluetooth_hdp_connect
4663 int bluetooth_hdp_send_data(unsigned int channel_id,
4664 const char *buffer, unsigned int size);
4666 * @fn int bluetooth_hdp_connect(const char *app_handle,
4667 * bt_hdp_qos_type_t channel_type,
4668 * const bluetooth_device_address_t *device_address)
4669 * @brief Connect to the remote device(Mainly used by source)
4671 * This function is a asynchronous call.
4672 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED 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] app_handle The application handler against corresponding service
4682 * @param[in] channel_type The QOS type for the channel.
4683 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4684 * @param[in] device_address The remote device Bd address.
4687 * @see bluetooth_hdp_disconnect
4689 int bluetooth_hdp_connect(const char *app_handle,
4690 bt_hdp_qos_type_t channel_type,
4691 const bluetooth_device_address_t *device_address);
4693 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4694 * const bluetooth_device_address_t *device_address)
4695 * @brief Disconnect from the remote device(Mainly used by source)
4697 * This function is a asynchronous call.
4698 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4700 * @return BLUETOOTH_ERROR_NONE - Success \n
4701 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4702 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4703 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4704 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4707 * @param[in] channel_id The channel id for the connection.
4708 * @param[in] device_address The remote device Bd address.
4711 * @see bluetooth_hdp_connect
4713 int bluetooth_hdp_disconnect(unsigned int channel_id,
4714 const bluetooth_device_address_t *device_address);
4718 * @fn int bluetooth_opc_init(void)
4719 * @brief Initialize OPP client.
4721 * This function is a synchronous call.
4722 * No event corresponding to this api
4724 * @return BLUETOOTH_ERROR_NONE - Success \n
4725 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4726 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4727 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4728 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4733 * @see bluetooth_opc_deinit
4735 int bluetooth_opc_init(void);
4738 * @fn int bluetooth_opc_deinit(void)
4739 * @brief Deinitialize OPP client.
4741 * This function is a synchronous call.
4742 * No event corresponding to this api
4744 * @return BLUETOOTH_ERROR_NONE - Success \n
4745 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4746 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4751 * @see bluetooth_opc_init
4754 int bluetooth_opc_deinit(void);
4757 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4758 char **file_name_array)
4759 * @brief Send multiple files to a remote device.
4761 * This function is a asynchronous call.
4762 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4764 * @return BLUETOOTH_ERROR_NONE - Success \n
4765 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4766 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4767 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4768 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4769 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4770 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4773 * @param[in] device_address The remote device Bd address.
4774 * @param[in] file_name_array Array of filepaths to be sent.
4777 * @see bluetooth_opc_cancel_push
4780 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4781 char **file_name_array);
4784 * @fn int bluetooth_opc_cancel_push(void)
4785 * @brief Cancels the ongoing file push.
4787 * This function is a asynchronous call.
4788 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4789 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4791 * @return BLUETOOTH_ERROR_NONE - Success \n
4792 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4793 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4798 * @see bluetooth_opc_push_files
4801 int bluetooth_opc_cancel_push(void);
4804 * @fn gboolean bluetooth_opc_session_is_exist(void)
4805 * @brief Informs whether opc session exists or not.
4807 * This function is a synchronous call.
4809 * @return TRUE - OPC session exists \n
4810 * FALSE - OPC session does not exist \n
4818 gboolean bluetooth_opc_session_is_exist(void);
4821 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4822 * @brief Informs whether opc session exists or not.
4824 * This function is a synchronous call.
4826 * @return BLUETOOTH_ERROR_NONE - Success \n
4827 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4828 * BLUETOOTH_ERROR_INTERNAL \n
4831 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4836 int bluetooth_opc_is_sending(gboolean *is_sending);
4839 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4840 int transfer_id, unsigned char *progress)
4841 * @brief Gets the percentage progress for ongoing transfers.
4843 * This function is a synchronous call.
4845 * @return BLUETOOTH_ERROR_NONE - Success \n
4846 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4847 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4850 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4851 * @param[in] transfer_id Transfer ID
4852 * @param[out] progress Percentage Progress
4856 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4857 int transfer_id, unsigned char *progress);
4860 * @fn int bluetooth_obex_server_init(const char *dst_path)
4861 * @brief Initialize OPP and FTP server.
4863 * This function is a synchronous call.
4864 * No event corresponding to this api
4866 * @return BLUETOOTH_ERROR_NONE - Success \n
4867 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4868 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4869 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4870 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4873 * @param[in] dst_path OPS destination file path.
4875 * @see bluetooth_obex_server_deinit
4877 int bluetooth_obex_server_init(const char *dst_path);
4881 * @fn int bluetooth_obex_server_deinit(void)
4882 * @brief Deinitialize OPP and FTP server.
4884 * This function is a synchronous call.
4885 * No event corresponding to this api
4887 * @return BLUETOOTH_ERROR_NONE - Success \n
4888 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4889 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4894 * @see bluetooth_obex_server_init
4896 int bluetooth_obex_server_deinit(void);
4900 * @fn gboolean bluetooth_obex_server_is_activated(void)
4901 * @brief Informs whether obex server is activated or not.
4903 * This function is a synchronous call.
4905 * @return TRUE - OBEX server is activated \n
4906 * FALSE - OBEX server is not activated \n
4913 gboolean bluetooth_obex_server_is_activated(void);
4917 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4918 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4920 * This function is a synchronous call.
4921 * No event corresponding to this api
4923 * @return BLUETOOTH_ERROR_NONE - Success \n
4924 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4925 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4926 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4927 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4931 * @param[in] dst_path OPS destination file path.
4933 * @see bluetooth_obex_server_deinit_without_agent
4935 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4939 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4940 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4942 * This function is a synchronous call.
4943 * No event corresponding to this api
4945 * @return BLUETOOTH_ERROR_NONE - Success \n
4946 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4947 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4952 * @see bluetooth_obex_server_init_without_agent
4954 int bluetooth_obex_server_deinit_without_agent(void);
4958 * @fn int bluetooth_obex_server_accept_connection(void)
4959 * @brief Accepts the authorization request indicated by the event
4960 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4962 * This function is a synchronous call.
4964 * @return BLUETOOTH_ERROR_NONE - Success \n
4965 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4966 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4970 * @see bluetooth_obex_server_reject_authorize
4972 int bluetooth_obex_server_accept_connection(void);
4976 * @fn int bluetooth_obex_server_reject_connection(void)
4977 * @brief Rejects the authorization request indicated by the event
4978 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4980 * This function is a synchronous call.
4982 * @return BLUETOOTH_ERROR_NONE - Success \n
4983 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4984 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4988 * @see bluetooth_obex_server_reject_authorize
4990 int bluetooth_obex_server_reject_connection(void);
4994 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4995 * @brief Accepts the authorization request indicated by the event
4996 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4998 * This function is a asynchronous call.
4999 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
5001 * @return BLUETOOTH_ERROR_NONE - Success \n
5002 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5003 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5004 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5007 * @param[in] filename Authorized filename.
5010 * @see bluetooth_obex_server_reject_authorize
5013 int bluetooth_obex_server_accept_authorize(const char *filename);
5016 * @fn int bluetooth_obex_server_reject_authorize(void)
5017 * @brief Reject the authorization request indicated by the event
5018 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5020 * This function is a asynchronous call.
5021 * No event for this api..
5023 * @return BLUETOOTH_ERROR_NONE - Success \n
5024 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5025 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5030 * @see bluetooth_obex_server_accept_authorize
5033 int bluetooth_obex_server_reject_authorize(void);
5036 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5037 * @brief Set the OPS destination file path..
5039 * This function is a asynchronous call.
5040 * No event for this api..
5042 * @return BLUETOOTH_ERROR_NONE - Success \n
5043 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5044 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5045 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5048 * @param[in] dst_path OPS destination file path.
5054 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5057 * @fn int bluetooth_obex_server_set_root(const char *root)
5058 * @brief Set the FTS root folder..
5060 * This function is a asynchronous call.
5061 * No event for this api..
5063 * @return BLUETOOTH_ERROR_NONE - Success \n
5064 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5065 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5066 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5067 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5068 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5071 * @param[in] root FTS root folder.
5077 int bluetooth_obex_server_set_root(const char *root);
5080 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5081 * @brief Cancel the transfer on server
5083 * This function is an asynchronous call.
5084 * If the function call that cancels transfer is successful, the application would receive
5085 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5086 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5087 * the error code will be BLUETOOTH_ERROR_NONE
5089 * @return BLUETOOTH_ERROR_NONE - Success \n
5090 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5091 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5092 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5093 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5096 * @param[in] transfer_id transfer ID
5101 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5105 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5106 * @brief Cancel the transfer on server
5108 * This function is an asynchronous call.
5109 * If the function call that cancels transfer is successful, the application would receive
5110 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5111 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5112 * the error code will be BLUETOOTH_ERROR_NONE
5114 * @return BLUETOOTH_ERROR_NONE - Success \n
5115 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5116 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5117 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5118 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5125 int bluetooth_obex_server_cancel_all_transfers(void);
5129 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5130 * @brief Informs whether obex server is receiving or not.
5132 * This function is a synchronous call.
5134 * @return BLUETOOTH_ERROR_NONE - Success \n
5135 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5136 * BLUETOOTH_ERROR_INTERNAL \n
5139 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5144 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5148 * @fn int bluetooth_map_client_init(void)
5149 * @brief Initialize MAP client.
5151 * This function is a synchronous call.
5152 * No event corresponding to this api
5154 * @return BLUETOOTH_ERROR_NONE - Success \n
5155 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5156 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5157 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5158 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5163 * @see bluetooth_map_client_deinit
5165 int bluetooth_map_client_init(void);
5167 int bluetooth_map_client_deinit(void);
5169 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5171 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5173 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5175 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5176 bt_map_client_list_folders_filter_t *filter);
5179 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5180 * @brief Return all available fields that can be used in Fields filter.
5182 * This function is a asynchronous call.
5184 * @return BLUETOOTH_ERROR_NONE - Success \n
5185 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5186 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5189 * @param[in] session Information about session.
5192 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5194 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5196 bt_map_client_list_messages_filter_t *filter);
5198 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5200 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5201 const char *source_file,
5203 bt_map_client_push_message_args_t *args);
5205 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5206 const bt_map_client_message_object_t message_object,
5207 const char *target_file,
5212 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5213 * @brief Read the local Hash and Randmizer.
5215 * This function is a synchronous call.
5217 * @return BLUETOOTH_ERROR_NONE - Success \n
5218 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5222 * @param[out] local_oob_data - Pointer to the local OOB data
5228 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5232 * @fn int bluetooth_oob_add_remote_data(
5233 * const bluetooth_device_address_t *remote_device_address,
5234 * bluetooth_bdaddr_type_e address_type,
5235 * bt_oob_data_t *oob_data)
5236 * @brief Add/updated the remote device Hash and Randmizer.
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
5246 * address_type - bdaddr type
5247 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5253 int bluetooth_oob_add_remote_data(
5254 const bluetooth_device_address_t *remote_device_address,
5255 bluetooth_bdaddr_type_e address_type,
5256 bt_oob_data_t *remote_oob_data);
5260 * @fn int bluetooth_oob_remove_remote_data(
5261 * const bluetooth_device_address_t *remote_device_address)
5262 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5264 * This function is a synchronous call.
5265 * No event for this api..
5267 * @return BLUETOOTH_ERROR_NONE - Success \n
5268 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5271 * @param[in] remote_device_address - Remote device address
5277 int bluetooth_oob_remove_remote_data(
5278 const bluetooth_device_address_t *remote_device_address);
5282 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5283 * @brief Read the local Hash and Randmizer.
5285 * This function is a synchronous call.
5287 * @return BLUETOOTH_ERROR_NONE - Success \n
5288 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5292 * @param[out] local_oob_data - Pointer to the local OOB data
5297 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5300 * @fn int bluetooth_le_oob_add_remote_data(
5301 * const bluetooth_device_address_t *remote_device_address,
5302 * bluetooth_bdaddr_type_e address_type,
5303 * bt_oob_data_t *oob_data)
5304 * @brief Add/updated the remote device Hash and Randmizer.
5306 * This function is a synchronous call.
5307 * No event for this api..
5309 * @return BLUETOOTH_ERROR_NONE - Success \n
5310 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5313 * @param[in] remote_device_address - Remote device address
5314 * address_type - bdaddr type
5315 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5320 int bluetooth_le_oob_add_remote_data(
5321 const bluetooth_device_address_t *remote_device_address,
5322 bluetooth_bdaddr_type_e address_type,
5323 bt_oob_data_t *remote_oob_data);
5326 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5327 * bt_gatt_handle_info_t *prim_svc);
5329 * @brief Gets the GATT based primary services handle supported by remote device
5331 * This function is a synchronous call.
5332 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5334 * @return BLUETOOTH_ERROR_NONE - Success \n
5335 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5336 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5337 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5340 * @param[in] address - Remote device address
5341 * @param[out] prim_svc - Structure containing remote service count and handle list.
5344 * @see bluetooth_gatt_free_primary_services()
5346 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5347 bt_gatt_handle_info_t *prim_svc);
5350 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5352 * @brief Discovers the characteristics of GATT based service of remote device
5354 * This function is an asynchronous call.
5355 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5357 * @return BLUETOOTH_ERROR_NONE - Success \n
5358 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5359 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5360 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5363 * @param[in] service_handle - Handle for remote service.
5368 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5370 int bluetooth_gatt_set_service_change_watcher(
5371 const bluetooth_device_address_t *address, gboolean enable);
5374 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5375 * bt_gatt_service_property_t *service);
5377 * @brief Gets the properties of GATT based service of remote device
5379 * This function is a synchronous call.
5380 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5382 * @return BLUETOOTH_ERROR_NONE - Success \n
5383 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5384 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5385 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5388 * @param[in] service_handle - Handle for remote service.
5389 * @param[out] service - Structure containing remote service property.
5392 * @see bluetooth_gatt_free_service_property()
5394 int bluetooth_gatt_get_service_property(const char *service_handle,
5395 bt_gatt_service_property_t *service);
5398 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5400 * @brief Register to GATT based service to receive value change notification/indication.
5402 * This function is a synchronous call.
5403 * No event for this api.
5405 * @return BLUETOOTH_ERROR_NONE - Success \n
5406 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5407 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5408 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5411 * @param[in] service_handle - Handle for remote service.
5412 * @param[in] service_name - Friednly name of service uuid.
5417 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5420 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5422 * @brief Unregister GATT based service to receive value change notification/indication.
5424 * This function is a synchronous call.
5425 * No event for this api.
5427 * @return BLUETOOTH_ERROR_NONE - Success \n
5428 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5429 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5430 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5433 * @param[in] service_handle - Handle for remote service.
5438 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5441 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5442 * bt_gatt_char_property_t *characteristic);
5444 * @brief Provides characteristic value along with properties.
5446 * This function is a synchronous call.
5447 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5449 * @return BLUETOOTH_ERROR_NONE - Success \n
5450 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5451 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5452 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5455 * @param[in] char_handle - Handle for Characteristic property.
5456 * @param[out] characteristic - Structure containing remote characteristic property.
5459 * @see bluetooth_gatt_free_char_property()
5461 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5462 bt_gatt_char_property_t *characteristic);
5465 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5466 * bt_gatt_char_property_t *characteristic);
5468 * @brief Provides characteristic descriptor value along with its UUID.
5470 * This function is a synchronous call.
5471 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5473 * @return BLUETOOTH_ERROR_NONE - Success \n
5474 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5475 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5476 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5479 * @param[in] desc_handle - Handle for Characteristic descriptor.
5480 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5483 * @see bluetooth_gatt_free_desc_property()
5485 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5486 bt_gatt_char_descriptor_property_t *descriptor);
5490 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5491 * const guint8 *value, int length)
5493 * @brief Set characteristic value.
5495 * This function is a synchronous call.
5497 * @return BLUETOOTH_ERROR_NONE - Success \n
5498 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5499 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5500 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5503 * @param[in] char_handle - Handle for Characteristic property.
5504 * @param[in] value - New value to set for characteristic property.
5505 * @param[in] length - Length of the value to be set.
5510 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5511 const guint8 *value, int length);
5514 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5515 * const guint8 *value, int length, guint8 write_type)
5517 * @brief Set characteristic value by write type.
5519 * This function is a synchronous call if write type is "write without resonse"
5520 * and it is an asynchronous call if write type is "write with response"
5522 * @return BLUETOOTH_ERROR_NONE - Success \n
5523 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5524 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5525 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5528 * @param[in] char_handle - Handle for Characteristic property.
5529 * @param[in] value - New value to set for characteristic property.
5530 * @param[in] length - Length of the value to be set.
5531 * @param[in] write_type - Type of write.
5536 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5537 const guint8 *value, int length,
5538 guint8 write_type, gpointer app_data);
5542 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5543 * const guint8 *value, int length)
5545 * @brief Set characteristic value request.
5547 * This function is an asynchronous call.
5549 * @return BLUETOOTH_ERROR_NONE - Success \n
5550 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5551 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5552 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5555 * @param[in] char_handle - Handle for Characteristic property.
5556 * @param[in] value - New value to set for characteristic property.
5557 * @param[in] length - Length of the value to be set.
5562 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5563 const guint8 *value, int length);
5566 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5568 * @brief Read characteristic value.
5570 * This function is a asynchronous call.
5572 * @return BLUETOOTH_ERROR_NONE - Success \n
5573 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5574 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5575 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5578 * @param[in] char_handle - Handle for Characteristic property.
5583 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5586 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5587 * const char *service_uuid,
5588 * bt_gatt_service_property_t *service)
5590 * @brief Gets the service property from a device based on a particular uuid
5592 * This function is a synchronous call.
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] address - BD address of the remote device
5601 * @param[in] service_uuid - uuid of the service.
5602 * @param[out] service - Structure containing the service property.
5607 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5608 const char *service_uuid,
5609 bt_gatt_service_property_t *service);
5612 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5613 * const char *char_uuid)
5615 * @brief Gets the characteristic property from a service based on a particular char uuid
5617 * This function is an asynchronous call.
5618 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5620 * @return BLUETOOTH_ERROR_NONE - Success \n
5621 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5622 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5623 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5626 * @param[in] service_handle - Service handle.
5627 * @param[in] uuid - Characteristic uuid.
5632 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5633 const char *char_uuid);
5636 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5638 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5640 * This function is a synchronous call.
5641 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5643 * @return BLUETOOTH_ERROR_NONE - Success \n
5644 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5647 * @param[in] prim_svc - GATT handle info structure
5650 * @see bluetooth_gatt_get_primary_services()
5652 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5655 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5657 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5659 * This function is a synchronous call.
5660 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5662 * @return BLUETOOTH_ERROR_NONE - Success \n
5663 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5666 * @param[in] svc_pty - GATT service property structure.
5669 * @see bluetooth_gatt_get_service_property()
5671 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5674 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5676 * @brief Provides characteristic value along with properties.
5678 * This function is a synchronous call.
5679 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5681 * @return BLUETOOTH_ERROR_NONE - Success \n
5682 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5685 * @param[in] char_pty - GATT characteristics property structure.
5688 * @see bluetooth_gatt_get_characteristics_property()
5690 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5693 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5695 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5697 * This function is a synchronous call.
5698 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5700 * @return BLUETOOTH_ERROR_NONE - Success \n
5701 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5704 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5707 * @see bluetooth_gatt_get_char_descriptor_property()
5709 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5711 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5712 gboolean auto_connect, int client_id);
5714 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5717 int bluetooth_get_gatt_data_batching_available_packets(
5718 int *available_packets);
5720 int bluetooth_enable_gatt_data_batching(
5721 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5723 int bluetooth_disable_gatt_data_batching(
5724 const bluetooth_device_address_t *device_address);
5727 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5729 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5731 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5733 * @return BLUETOOTH_ERROR_NONE - Success \n
5734 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5737 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5741 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5744 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5746 * @brief Read characteristic descriptor value.
5748 * This function is a asynchronous call.
5750 * @return BLUETOOTH_ERROR_NONE - Success \n
5751 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5752 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5753 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5756 * @param[in] desc_handle - Handle for Characteristic descriptor
5761 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5764 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5765 * const guint8 *value, int length);
5767 * @brief Set characteristic descriptor value.
5769 * This function is a asynchronous call.
5771 * @return BLUETOOTH_ERROR_NONE - Success \n
5772 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5773 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5774 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5777 * @param[in] desc_handle - Handle for Characteristic descriptor
5778 * @param[in] value - New value to set for characteristic descriptor
5779 * @param[in] length - Length of the value to be set.
5784 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5785 const guint8 *value, int length, gpointer app_data);
5787 /* @fn int bluetooth_gatt_init(void)
5789 * @brief Initializes the gatt service.
5791 * This function is a synchronous call.
5792 * @return BLUETOOTH_ERROR_NONE - Success \n
5793 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5794 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5795 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5798 * @remark Adapter should be enabled
5799 * @see bluetooth_gatt_deinit()
5801 int bluetooth_gatt_init(void);
5803 /* @fn int bluetooth_gatt_init(void)
5805 * @brief DeInitializes the gatt service.
5807 * This function is a synchronous call.
5808 * @return BLUETOOTH_ERROR_NONE - Success \n
5809 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5810 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5811 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5814 * @remark Adapter should be enabled
5815 * @see bluetooth_gatt_init()
5817 int bluetooth_gatt_deinit(void);
5819 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5820 unsigned char **svc_path)
5822 * @brief Exports a new gatt service to the service interface.
5824 * This function is a synchronous call.
5826 * @return BLUETOOTH_ERROR_NONE - Success \n
5827 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5828 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5829 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5832 * @param[in] svc_uuid Gatt service uuid.
5833 * @param[out] svc_path service object path of the exported service.
5834 * @remark Adapter should be enabled
5835 * @see bluetooth_gatt_init()
5837 int bluetooth_gatt_add_service(const char *svc_uuid,
5840 /* @fn int bluetooth_gatt_add_new_characteristic(
5841 const char *svc_path, const char *char_uuid,
5842 bt_gatt_permission_t permissions,
5843 bt_gatt_characteristic_property_t properties,
5844 int flags_length, char **char_path);;
5846 * @brief Exports a new gatt characteristic to the characteristic interface.
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] svc_path service object path of the exported service.
5855 * @param[in] char_uuid Gatt service uuid.
5856 * @param[in] properties GATT characteristic properties.
5857 * @param[out] char_path characteristic object path of the exported characteristic.
5859 * @remark Adapter should be enabled
5860 * @see bluetooth_gatt_add_service()
5862 int bluetooth_gatt_add_new_characteristic(
5863 const char *svc_path, const char *char_uuid,
5864 bt_gatt_permission_t permissions,
5865 bt_gatt_characteristic_property_t properties,
5868 /* @fn bluetooth_gatt_set_characteristic_value(
5869 const char *characteristic, const char *char_value,
5872 * @brief adds gatt charactertisic value to the given charactertistic path.
5874 * This function is a synchronous call.
5875 * @return BLUETOOTH_ERROR_NONE - Success \n
5876 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5877 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5878 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5880 * @param[in] char_value Value of the GATT characteristic to be added.
5881 * @param[in] value_length length of the chantacteristic value..
5882 * @param[out] characteristic characteristic object path..
5884 * @remark Adapter should be enabled
5885 * @see bluetooth_gatt_add_service()
5887 int bluetooth_gatt_set_characteristic_value(
5888 const char *characteristic, const char *char_value,
5891 /* @fn int bluetooth_gatt_add_descriptor(
5892 const char *char_path, const char *desc_uuid,
5893 bt_gatt_permission_t permissions,
5896 * @brief Exports a new gatt descriptor to the descriptor interface.
5898 * This function is a synchronous call.
5900 * @return BLUETOOTH_ERROR_NONE - Success \n
5901 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5902 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5903 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5906 * @param[in] desc_uuid Gatt descriptor uuid.
5907 * @param[in] desc_value GATT descriptor value.
5908 * @param[in] value_length Length of GATT descriptor value.
5909 * @param[in] permissions descriptor permissions.
5910 * @param[in] properties GATT descriptor properties.
5911 * @param[in] char_path characteristics object path of the exported character.
5913 * @remark Adapter should be enabled
5914 * @see bluetooth_gatt_add_service()
5915 * @see bluetooth_gatt_add_characteristics()
5917 int bluetooth_gatt_add_descriptor(
5918 const char *char_path, const char *desc_uuid,
5919 bt_gatt_permission_t permissions,
5922 /* @fn int bluetooth_gatt_set_descriptor_value(
5923 const char *desc_path, const char *desc_value,
5926 * @brief Adds value to the given descriptor handle.
5928 * This function is a synchronous call.
5930 * @return BLUETOOTH_ERROR_NONE - Success \n
5931 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5932 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5933 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5936 * @param[in] desc_value GATT descriptor value.
5937 * @param[in] value_length Length of GATT descriptor value.
5938 * @param[in] desc_path descriptor path to which the value needs to be added.
5940 * @remark Adapter should be enabled
5941 * @see bluetooth_gatt_add_service()
5942 * @see bluetooth_gatt_add_characteristics()
5944 int bluetooth_gatt_set_descriptor_value(
5945 const char *desc_path, const char *desc_value,
5948 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5950 * @brief Reads the Service registered on manager interface.
5952 * This function is a synchronous call.
5954 * @return BLUETOOTH_ERROR_NONE - Success \n
5955 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5956 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5957 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5960 * @param[in] svc_uuid Gatt Service uuid.
5962 * @remark Adapter should be enabled and service should be registered.
5963 * @see bluetooth_gatt_register_service()
5965 int bluetooth_gatt_get_service(const char *svc_uuid);
5967 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5969 * @brief Registers the given service path with the library.
5971 * This function is a synchronous call.
5973 * @return BLUETOOTH_ERROR_NONE - Success \n
5974 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5975 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5976 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5979 * @param[in] svc_path service object path of the exported service.
5981 * @remark Adapter should be enabled
5982 * @see bluetooth_gatt_add_service()
5983 * @see bluetooth_gatt_add_characteristics()
5984 * @see bluetooth_gatt_add_descriptor()
5985 * @see bluetooth_gatt_register_application()
5987 int bluetooth_gatt_register_service(const char *svc_path);
5989 /* @fn int bluetooth_gatt_register_application(void)
5991 * @brief Registers the application with the bluez gatt server.
5993 * This function is a synchronous call.
5995 * @return BLUETOOTH_ERROR_NONE - Success \n
5996 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5997 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5998 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6002 * @remark Adapter should be enabled
6003 * @see bluetooth_gatt_init()
6004 * @see bluetooth_gatt_add_service()
6005 * @see bluetooth_gatt_add_characteristics()
6006 * @see bluetooth_gatt_add_descriptor()
6007 * @see bluetooth_gatt_register_service()
6009 int bluetooth_gatt_register_application(void);
6011 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
6013 * @brief Removes(unregister) service from the bluez gatt server db.
6015 * This function is a synchronous call.
6017 * @return BLUETOOTH_ERROR_NONE - Success \n
6018 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6019 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6020 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6023 * @param[in] svc_path service object path of the exported service.
6025 * @remark Adapter should be enabled
6026 * @see bluetooth_gatt_add_service()
6027 * @see bluetooth_gatt_add_characteristics()
6028 * @see bluetooth_gatt_add_descriptor()
6029 * @see bluetooth_gatt_register_service()
6031 int bluetooth_gatt_unregister_service(const char *svc_path);
6033 /* @fn int bluetooth_gatt_unregister_application(void)
6035 * @brief Removes(unregister) the application with the bluez gatt server,
6036 * and deletes all the service registered.
6038 * This function is a synchronous call.
6040 * @return BLUETOOTH_ERROR_NONE - Success \n
6041 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6042 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6043 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6047 * @remark Adapter should be enabled
6048 * @see bluetooth_gatt_init()
6049 * @see bluetooth_gatt_add_service()
6050 * @see bluetooth_gatt_add_characteristics()
6051 * @see bluetooth_gatt_add_descriptor()
6052 * @see bluetooth_gatt_register_service()
6053 * @see bluetooth_gatt_unregister_service()
6055 int bluetooth_gatt_unregister_application(void);
6057 /* @fn int bluetooth_gatt_send_response(int request_id,
6058 * int offset, char *value, int value_length)
6060 * @brief Updates the attribute value in local attribute list.
6062 * This function is a synchronous call.
6064 * @return BLUETOOTH_ERROR_NONE - Success \n
6065 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6066 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6067 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6070 * @param[in] request_id The identification of a read request
6071 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6072 * @param[in] resp_state The identification of response state
6073 * @param[in] offset The offset from where a value is read
6074 * @param[in] value The value to be sent. It will be sent from @a offset.
6075 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6076 * @param[in] value_length Value Length.
6078 * @remark Adapter should be enabled
6079 * @see bluetooth_gatt_add_service()
6080 * @see bluetooth_gatt_add_characteristics()
6081 * @see bluetooth_gatt_add_descriptor()
6082 * @see bluetooth_gatt_register_service()
6084 int bluetooth_gatt_send_response(int request_id, guint req_type,
6085 int resp_state, int offset, char *value, int value_length);
6087 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6089 * @brief Sets the notification property for a characteristic.
6091 * This function is a synchronous call.
6093 * @return BLUETOOTH_ERROR_NONE - Success \n
6094 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6095 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6096 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6099 * @param[in] char_path characteristic object path.
6100 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6102 * @remark Adapter should be enabled
6103 * @see bluetooth_gatt_update_characteristic()
6105 int bluetooth_gatt_server_set_notification(const char *char_path,
6106 bluetooth_device_address_t *unicast_address);
6108 /* @fn int bluetooth_gatt_delete_services(void)
6110 * @brief deletes (unregisters) all services from the gatt server database..
6112 * This function is a synchronous call.
6114 * @return BLUETOOTH_ERROR_NONE - Success \n
6115 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6116 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6117 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6121 * @remark Adapter should be enabled
6122 * @see bluetooth_gatt_add_service()
6123 * @see bluetooth_gatt_add_characteristics()
6124 * @see bluetooth_gatt_add_descriptor()
6125 * @see bluetooth_gatt_register_service()
6126 * @see bluetooth_gatt_unregister_service()
6128 int bluetooth_gatt_delete_services(void);
6130 /* @fn int bluetooth_gatt_update_characteristic(void)
6132 * @brief updates the given characteristic with a new value
6134 * This function is a synchronous call.
6136 * @return BLUETOOTH_ERROR_NONE - Success \n
6137 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6138 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6139 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6143 * @remark Adapter should be enabled
6144 * @see bluetooth_gatt_add_service()
6145 * @see bluetooth_gatt_add_characteristics()
6146 * @see bluetooth_gatt_add_descriptor()
6147 * @see bluetooth_gatt_register_service()
6148 * @see bluetooth_gatt_unregister_service()
6150 int bluetooth_gatt_update_characteristic(const char *char_path,
6151 const char* char_value, int value_length);
6154 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6156 * @brief Set advertising status.
6158 * This function is used to enable or disable LE advertising.
6159 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6161 * This function is a synchronous call.
6163 * @return BLUETOOTH_ERROR_NONE - Success \n
6164 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6165 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6168 * @param[in] enable - The status of advertising
6171 * @see bluetooth_set_advertising_data
6173 int bluetooth_set_advertising(int handle, gboolean enable);
6176 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6178 * @brief Set advertising status along with interval value.
6180 * This function is used to enable or disable LE advertising.
6181 * Interval_min and Interval_max is used to set the best advertising interval.
6182 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6184 * This function is a synchronous call.
6186 * @return BLUETOOTH_ERROR_NONE - Success \n
6187 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6188 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6191 * @param[in] enable - The status of advertising
6192 * @param[in] interval_min - Minimum interval of advertising (msec)
6193 * @param[in] interval_max - Maximum interval of advertising (msec)
6194 * @param[in] filter_policy - Advertising filter policy
6197 * @see bluetooth_set_advertising_data
6199 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6200 bluetooth_advertising_params_t *params);
6203 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6204 * @brief Get the advertising data
6206 * This function is used to get advertising data.
6207 * Before calling this API, the adapter should be enabled.
6209 * This function is a synchronous call.
6211 * @return BLUETOOTH_ERROR_NONE - Success \n
6212 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6213 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6214 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6216 * @param[out] value - Advertising data structure.
6217 * @param[out] length - The length of Advertising data.
6221 bluetooth_advertising_data_t *value = { {0} };
6224 ret = bluetooth_get_advertising_data(&value, &length);
6227 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6230 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6232 * @brief Set advertising data with value
6234 * This function is used to set advertising data and Maximum size of advertising data
6235 * is 28 byte (Except Flag)
6237 * This function is a synchronous call.
6239 * @return BLUETOOTH_ERROR_NONE - Success \n
6240 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6241 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6244 * @param[in] value - Advertising data structure.
6248 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6251 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6253 * @brief Check the privilege for advertising parameter setting
6255 * This function is a synchronous call.
6257 * @return BLUETOOTH_ERROR_NONE - Success \n
6258 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6264 int bluetooth_check_privilege_advertising_parameter(void);
6267 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6268 * @brief Get the LE scan response data
6270 * This function is used to get scan response data.
6271 * Before calling this API, the adapter should be enabled.
6273 * This function is a synchronous call.
6275 * @return BLUETOOTH_ERROR_NONE - Success \n
6276 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6277 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6278 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6280 * @param[out] value - Scan response data structure.
6281 * @param[out] length - The length of Scan response data.
6285 bluetooth_scan_resp_data_t *value = { {0} };
6288 ret = bluetooth_get_scan_response_data(&value, &length);
6291 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6294 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6296 * @brief Set scan response data with value
6298 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6300 * This function is a synchronous call.
6302 * @return BLUETOOTH_ERROR_NONE - Success \n
6303 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6304 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6307 * @param[in] value - LE Scan response data structure.
6311 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6314 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6316 * @brief Set scan interval and window
6318 * This function is used to set LE scan interval and window size
6320 * This function is a synchronous call.
6322 * @return BLUETOOTH_ERROR_NONE - Success \n
6323 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6324 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6327 * @param[in] interval - Interval of LE scan (msec)
6328 * @param[in] window - Window size of LE scan (msec)
6332 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6335 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6337 * @brief Set scan type
6339 * This function is used to set LE scan type
6341 * This function is a synchronous call.
6343 * @return BLUETOOTH_ERROR_NONE - Success \n
6344 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6345 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6348 * @param[in] scan_type - LE scan type
6352 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6355 * @fn int bluetooth_is_advertising(void)
6356 * @brief Check for the advertising is in-progress or not.
6358 * This API is used to check the current status of the advertising procedure.
6359 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6362 * This function checks whether the advertising is started or not.
6364 * This function is a synchronous call.
6366 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6368 * @return BLUETOOTH_ERROR_NONE - Success \n
6369 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6372 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6376 gboolean is_advertising = 0;
6378 ret = bluetooth_is_advertising(&is_advertising);
6381 int bluetooth_is_advertising(gboolean *is_advertising);
6384 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6385 * @brief Add LE device to white list
6387 * This API is used to add LE device to white list
6388 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6392 * This function is a synchronous call.
6394 * @param[in] address The address of remote device
6396 * @return BLUETOOTH_ERROR_NONE - Success \n
6397 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6400 * @see bluetooth_set_custom_advertising
6402 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6405 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6406 * @brief Remove LE device from white list
6408 * This API is used to remove LE device from white list
6409 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6413 * This function is a synchronous call.
6415 * @param[in] address The address of remote device
6417 * @return BLUETOOTH_ERROR_NONE - Success \n
6418 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6421 * @see bluetooth_set_custom_advertising
6423 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6426 * @fn int bluetooth_clear_white_list(void)
6427 * @brief Clear white list
6429 * This API is used to clear white list
6430 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6434 * This function is a synchronous call.
6436 * @param[in] address The address of remote device
6438 * @return BLUETOOTH_ERROR_NONE - Success \n
6439 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6442 * @see bluetooth_set_custom_advertising
6444 int bluetooth_clear_white_list(void);
6447 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6448 * const bluetooth_le_connection_param_t *parameters)
6449 * @brief update connection paramter of LE connection.
6451 * This function is a synchronous call.
6453 * @return BLUETOOTH_ERROR_NONE - Success \n
6454 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6457 * @param[in] address - remote device address value.
6458 * @param[in] parameters - new connection parameters.
6461 * @see bluetooth_bond_device
6463 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6464 const bluetooth_le_connection_param_t *parameters);
6467 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6469 * @brief Enable/Disable LE Privacy feature.
6471 * This function is used to enable or disable LE Privacy feature.
6472 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6474 * This function is a synchronous call.
6476 * @return BLUETOOTH_ERROR_NONE - Success \n
6477 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6478 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6481 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6485 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6488 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6490 * @brief Enable/Disable LE static random address.
6492 * This function is used to enable or disable LE static random address.
6494 * This function is a synchronous call.
6496 * @return BLUETOOTH_ERROR_NONE - Success \n
6497 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6498 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6501 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6505 int bluetooth_set_le_static_random_address(gboolean enable);
6508 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6509 * bluetooth_le_connection_mode_t mode)
6510 * @brief update connection paramter of LE connection.
6512 * This function is a synchronous call.
6514 * @return BLUETOOTH_ERROR_NONE - Success \n
6515 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6516 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6519 * @param[in] address - remote device address value.
6520 * @param[in] mode - new connection mode.
6524 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6525 bluetooth_le_connection_mode_t mode);
6528 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6529 * @brief Request for new ATT MTU value.
6531 * This function is a asynchronous call.
6533 * @return BLUETOOTH_ERROR_NONE - Success \n
6534 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6535 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6538 * @param[in] address - remote device address value.
6539 * @param[in] mtu - MTU value to be set.
6543 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6546 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6547 * unsigned int *mtu)
6548 * @brief Gets the xisting MTU value set for a connection.
6550 * This function is a synchronous call.
6552 * @return BLUETOOTH_ERROR_NONE - Success \n
6553 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6554 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6557 * @param[in] address - remote device address value.
6558 * @param[out] mtu - MTU value set for the connection.
6562 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6566 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6567 * bluetooth_device_address_t *id_address)
6568 * @brief Gets the Identity address of remote device.
6570 * This function is a synchronous call.
6572 * @return BLUETOOTH_ERROR_NONE - Success \n
6573 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6574 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6577 * @param[in] device_rpa - remote Resolvable private address.
6578 * @param[out] id_address - remote Identity device address value.
6582 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6583 bluetooth_device_address_t *id_address);
6586 * @fn int bluetooth_le_read_maximum_data_length()
6587 * @brief reads the maximum LE data length supported in the controller.
6589 * This function is a synchronous call.
6591 * @return BLUETOOTH_ERROR_NONE - Success \n
6592 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6598 int bluetooth_le_read_maximum_data_length(
6599 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6601 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6602 * @brief writes the host suggested values for the controllers max transmitted no of payload
6603 * octects to be used for new connections.
6605 * This function is a synchronous call.
6607 * @return BLUETOOTH_ERROR_NONE - Success \n
6608 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6614 int bluetooth_le_write_host_suggested_default_data_length(
6615 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6617 int bluetooth_le_read_suggested_default_data_length(
6618 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6620 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6621 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6623 int bluetooth_pbap_init(void);
6624 int bluetooth_pbap_deinit(void);
6625 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6626 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6627 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6628 bt_pbap_folder_t *folder);
6629 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6630 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6631 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6632 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6633 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6634 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6635 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6636 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6639 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6641 * @brief Set manufacturer data with value
6643 * This function is used to set manufacturer data.
6645 * This function is a synchronous call.
6647 * @return BLUETOOTH_ERROR_NONE - Success \n
6648 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6649 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6652 * @param[in] value - Manufacturer data structure.
6656 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6658 int bluetooth_set_passkey_notification(gboolean enable);
6661 * @fn int bluetooth_dpm_is_mode_allowed(void);
6663 * @brief Checks Restriction for BT mode(BT allowed or not)
6665 * This function is a synchronous call.
6667 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6668 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6669 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6676 int bluetooth_dpm_is_mode_allowed(void);
6679 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6681 * @brief Sets Restriction for BT mode(BT allowed or not)
6683 * This function is a synchronous call.
6685 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6686 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6687 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6690 * @param[in] value - BT Allow value.
6691 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6692 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6693 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6694 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6698 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6701 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6703 * @brief Reads the Restriction for BT mode(BT allowed or not)
6705 * This function is a synchronous call.
6707 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6708 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6709 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6713 * @param[out] value - BT Allow value.
6714 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6715 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6716 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6717 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6721 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6724 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6726 * @brief Sets the Restriction for device.
6728 * This function is a synchronous call.
6730 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6731 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6732 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6735 * @param[in] value - State value.
6736 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6737 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6741 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6744 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6746 * @brief Reads the Restriction for device.
6748 * This function is a synchronous call.
6750 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6751 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6752 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6756 * @param[out] value - State value.
6757 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6758 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6762 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6765 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6767 * @brief Sets the Restriction for uuid.
6769 * This function is a synchronous call.
6771 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6772 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6773 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6776 * @param[in] value - State value.
6777 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6778 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6782 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6785 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6787 * @brief Reads the Restriction for uuid.
6789 * This function is a synchronous call.
6791 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6792 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6793 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6797 * @param[out] value - State value.
6798 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6799 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6803 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6806 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6808 * @brief Adds the device to blacklist.
6810 * This function is a synchronous call.
6812 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6813 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6814 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6817 * @param[in] device_address - Device address
6821 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6824 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6826 * @brief Adds the device to whitelist.
6828 * This function is a synchronous call.
6830 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6831 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6832 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6835 * @param[in] device_address - Device address
6839 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6842 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6844 * @brief Adds the Service UUIDS to blacklist.
6846 * This function is a synchronous call.
6848 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6849 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6850 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6853 * @param[in] service_uuids - profile or custom service uuids
6857 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6860 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6862 * @brief Adds the Service UUIDS to whitelist.
6864 * This function is a synchronous call.
6866 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6867 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6868 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6871 * @param[in] service_uuids - profile or custom service uuids
6875 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6878 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6880 * @brief Clears the devices from blacklist.
6882 * This function is a synchronous call.
6884 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6885 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6886 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6893 int bluetooth_dpm_clear_devices_from_blacklist(void);
6896 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6898 * @brief Clears the devices from whitelist.
6900 * This function is a synchronous call.
6902 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6903 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6904 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6911 int bluetooth_dpm_clear_devices_from_whitelist(void);
6914 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6916 * @brief Clears the uuids from blacklist.
6918 * This function is a synchronous call.
6920 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6921 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6922 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6929 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6932 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6934 * @brief Clears the uuids from whitelist.
6936 * This function is a synchronous call.
6938 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6939 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6940 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6947 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6950 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6952 * @brief reads the devices from blacklist.
6954 * This function is a synchronous call.
6956 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6957 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6958 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6961 * @param[out] device_list - list of devices
6965 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6968 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6970 * @brief reads the devices from whitelist.
6972 * This function is a synchronous call.
6974 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6975 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6976 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6979 * @param[out] device_list - list of devices
6983 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6986 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6988 * @brief reads the uuids from blacklist.
6990 * This function is a synchronous call.
6992 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6993 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6994 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6997 * @param[in] uuid_list - list of uuids
7001 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
7004 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
7006 * @brief reads the uuids from whitelist.
7008 * This function is a synchronous call.
7010 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7011 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7012 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7015 * @param[in] uuid_list - list of uuids
7019 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
7022 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
7024 * @brief Removes the device from whitelist.
7026 * This function is a synchronous call.
7028 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7029 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7030 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7033 * @param[in] device_address - Device address
7037 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
7040 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7042 * @brief Removes the device from blacklist.
7044 * This function is a synchronous call.
7046 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7047 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7048 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7051 * @param[in] device_address - Device address
7055 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7058 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7060 * @brief Removes the Service UUIDS from whitelist.
7062 * This function is a synchronous call.
7064 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7065 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7066 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7069 * @param[in] service_uuids - profile or custom service uuids
7073 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7076 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7078 * @brief Removes the Service UUIDS from blacklist.
7080 * This function is a synchronous call.
7082 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7083 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7084 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7087 * @param[in] service_uuids - profile or custom service uuids
7091 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7094 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7096 * @brief Sets the Restriction for outgoing call.
7098 * This function is a synchronous call.
7100 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7101 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7102 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7105 * @param[in] value - State value.
7106 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7107 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7111 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7114 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7116 * @brief Reads the Restriction for outgoing call.
7118 * This function is a synchronous call.
7120 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7121 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7122 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7126 * @param[out] value - State value.
7127 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7128 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7132 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7135 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7137 * @brief Sets the Restriction for Pairing.
7139 * This function is a synchronous call.
7141 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7142 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7143 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7146 * @param[in] value - State value.
7147 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7148 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7152 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7155 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7157 * @brief Reads the Restriction for Pairing
7159 * This function is a synchronous call.
7161 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7162 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7163 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7167 * @param[out] value - State value.
7168 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7169 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7173 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7176 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7178 * @brief Sets the Restriction for using Profiles.
7180 * This function is a synchronous call.
7182 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7183 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7184 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7187 * @param[in]profile - Profile.
7188 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7189 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7190 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7191 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7192 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7193 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7194 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7195 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7196 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7197 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7198 * BLUETOOTH_DPM_PROFILE_NONE
7199 * @param[in] value - State value.
7200 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7201 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7205 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7208 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7210 * @brief Reads the Restriction for using Profiles.
7212 * This function is a synchronous call.
7214 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7215 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7216 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7219 * @param[in]profile - Profile.
7220 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7221 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7222 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7223 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7224 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7225 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7226 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7227 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7228 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7229 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7230 * BLUETOOTH_DPM_PROFILE_NONE
7231 * @param[out] value - State value.
7232 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7233 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7237 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7240 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7242 * @brief Sets the Restriction for Desktop Connectivity.
7244 * This function is a synchronous call.
7246 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7247 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7248 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7251 * @param[in] value - State value.
7252 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7253 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7257 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7260 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7262 * @brief Reads the Restriction for Desktop Connectivity.
7264 * This function is a synchronous call.
7266 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7267 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7268 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7272 * @param[out] value - State value.
7273 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7274 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7278 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7281 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7283 * @brief Sets the Restriction for Discoverable state.
7285 * This function is a synchronous call.
7287 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7288 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7289 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7292 * @param[in] value - State value.
7293 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7294 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7298 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7301 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7303 * @brief Reads the Restriction for Discoverable state.
7305 * This function is a synchronous call.
7307 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7308 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7309 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7313 * @param[out] value - State value.
7314 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7315 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7319 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7322 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7324 * @brief Sets the Restriction for linited discoverable state..
7326 * This function is a synchronous call.
7328 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7329 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7330 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7333 * @param[in] value - State value.
7334 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7335 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7339 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7342 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7344 * @brief Reads the Restriction for limited discoverable state.
7346 * This function is a synchronous call.
7348 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7349 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7350 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7354 * @param[out] value - State value.
7355 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7356 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7360 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7362 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7364 * @brief Sets the Restriction for Data trasnfer.
7366 * This function is a synchronous call.
7368 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7369 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7370 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7373 * @param[in] value - State value.
7374 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7375 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7379 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7383 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7385 * @brief Reads the Restriction for Data trasnfer.
7387 * This function is a synchronous call.
7389 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7390 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7391 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7395 * @param[out] value - State value.
7396 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7397 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7401 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7404 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7405 * bluetooth_pxp_poperty_t property, int value);
7407 * @brief Sets the Proximity alert level/properties for monitor role.
7409 * This function is a synchronous call.
7411 * @return BLUETOOTH_ERROR_NONE - Success \n
7412 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7413 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7414 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7417 * @param[in] device_address remote device address
7418 * @param[in] property proximity profile property
7419 * @param[in] value alert level/property value to be set
7424 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7425 bluetooth_pxp_poperty_t property, int value);
7428 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7429 * bluetooth_pxp_poperty_t property, int *value);
7431 * @brief Reads the Proximity alert level/properties for monitor role.
7433 * This function is a synchronous call.
7435 * @return BLUETOOTH_ERROR_NONE - Success \n
7436 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7437 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7438 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7441 * @param[in] device_address remote device address
7442 * @param[in] property proximity profile property
7443 * @param[out] value alert level/property value
7447 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7448 bluetooth_pxp_poperty_t property, int *value);
7451 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7452 * int *services_supported);
7454 * @brief Reads the Proximity Monitor profile supported properties/services.
7456 * This function is a synchronous call.
7458 * @return BLUETOOTH_ERROR_NONE - Success \n
7459 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7460 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7461 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7464 * @param[in] device_address remote device address
7465 * @param[out] services_supported proximity profile property/service
7469 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7470 int *services_supported);
7473 * @fn int bluetooth_proximity_reporter_register();
7475 * @brief Register all proximity related services in BlueZ.
7477 * This function is a synchronous call.
7479 * @return BLUETOOTH_ERROR_NONE - Success \n
7480 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7486 int bluetooth_proximity_reporter_register(void);
7489 * @fn int bluetooth_proximity_reporter_unregister();
7491 * @brief Unregister all proximity related services in BlueZ.
7493 * This function is a synchronous call.
7495 * @return BLUETOOTH_ERROR_NONE - Success \n
7496 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7502 int bluetooth_proximity_reporter_unregister(void);
7505 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7506 * bluetooth_pxp_poperty_t property, int *value);
7508 * @brief Reads the Proximity alert level/properties for reporter role.
7510 * This function is a synchronous call.
7512 * @return BLUETOOTH_ERROR_NONE - Success \n
7513 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7514 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7515 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7518 * @param[in] device_address remote device address
7519 * @param[in] property proximity profile property
7520 * @param[out] value alert level/property value
7524 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7525 bluetooth_pxp_poperty_t property, int *value);
7528 * @fn int bluetooth_tds_provider_register(void);
7530 * @brief Register Transport Discovery Provider role.
7532 * This function is a synchronous call.
7534 * @return BLUETOOTH_ERROR_NONE - Success \n
7535 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7536 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7537 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7545 int bluetooth_tds_provider_register(void);
7548 * @fn int bluetooth_tds_provider_unregister(void);
7550 * @brief Unregister Transport Discovery Provider role.
7552 * This function is a synchronous call.
7554 * @return BLUETOOTH_ERROR_NONE - Success \n
7555 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7556 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7557 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7565 int bluetooth_tds_provider_unregister(void);
7568 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7570 * @brief Create Transport Discovery Provider for a transport.
7572 * This function is a synchronous call.
7574 * @return BLUETOOTH_ERROR_NONE - Success \n
7575 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7576 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7577 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7580 * @param[in] Transport (BT, CUSTOM etc.)
7581 * @param[in] Unique handle for TDS provider.
7586 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7589 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7591 * @brief Remove previously created Transport Discovery Provider.
7593 * This function is a synchronous call.
7595 * @return BLUETOOTH_ERROR_NONE - Success \n
7596 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7599 * @param[in] Unique handle for previously created provider.
7604 int bluetooth_tds_provider_destroy(unsigned int handle);
7607 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7609 * @brief Set transport block for in advertisement and gatt db.
7611 * This function is a synchronous call.
7613 * @return BLUETOOTH_ERROR_NONE - Success \n
7614 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7615 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7616 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7619 * @param[in] Provider specific manufacturer data.
7620 * @param[in] Provider specific manufacturer data length.
7625 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7628 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7629 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7631 * @brief Set transport block for in advertisement and gatt db.
7633 * This function is a synchronous call.
7635 * @return BLUETOOTH_ERROR_NONE - Success \n
7636 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7637 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7638 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7641 * @param[in] Unique handle for TDS provider.
7642 * @param[in] Transport state (On/Off/Not Available).
7643 * @param[in] Transport specific data block.
7644 * @param[in] Transport specific data block length.
7649 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7650 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7653 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7654 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7656 * @brief Send response to TDS activation request from remoted device.
7658 * This function is a synchronous call.
7660 * @return BLUETOOTH_ERROR_NONE - Success \n
7661 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7662 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7663 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7666 * @param[in] Remote device BT address.
7667 * @param[in] Unique handle for TDS provider.
7668 * @param[in] Response for TDS activation request.
7669 * @param[in] Transport specific data block to be sent in activation response.
7670 * @param[in] Data block length.
7675 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7676 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7679 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7681 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7683 * This function is an asynchronous call.
7685 * @return BLUETOOTH_ERROR_NONE - Success \n
7686 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7687 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7688 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7689 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7692 * @param[in] device_address remote device address
7693 * @param[in] handle attribute handle
7695 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7696 * when TDS data is received from Remote provider
7698 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7699 const char *handle);
7702 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7704 * @brief Enables CCCD on Remote Provider.
7706 * This function is an asynchronous call.
7708 * @return BLUETOOTH_ERROR_NONE - Success \n
7709 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7710 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7711 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7712 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7715 * @param[in] device_address remote device address
7716 * @param[in] handle attribute handle
7718 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7719 * when Indication is enabled on Remote provider
7721 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7722 const char *handle);
7725 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7726 * unsigned char *buf, int length);
7727 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7729 * This function is an asynchronous call.
7731 * @return BLUETOOTH_ERROR_NONE - Success \n
7732 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7733 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7734 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7735 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7738 * @param[in] device_address remote device address
7739 * @param[in] handle attribute handle
7740 * @param[in] buf Control point activation param
7741 * @param[in] param length
7743 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7744 * is received from remote Provider
7746 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7747 unsigned char *buf, int length);
7750 * @fn int bluetooth_otp_server_init(const char *directory);
7752 * @brief Starts OTP server.
7754 * This function is a synchronous call.
7764 int bluetooth_otp_server_init(const char *directory);
7767 * @fn int bluetooth_otp_server_deinit();
7769 * @brief Stops OTP server.
7771 * This function is a synchronous call.
7781 int bluetooth_otp_server_deinit();
7784 * @fn int bluetooth_otp_enable_notification(const char *handle);
7786 * @brief Enable notification for remote OACP & OLCP characteristics.
7788 * This function is a synchronous call.
7798 int bluetooth_otp_enable_notification(const char *handle);
7801 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7802 * unsigned char *buf, int length);
7804 * @brief Write value on remote characteristics.
7806 * This function is a synchronous call.
7816 int bluetooth_otp_write_characteristics_value(const char *handle,
7817 unsigned char *buf, int length);
7820 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7822 * @brief Read value for remote characteristics.
7824 * This function is a synchronous call.
7834 int bluetooth_otp_read_characteristic_value(const char *handle);
7837 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7839 * @brief Read value for remote characteristics.
7841 * This function is a synchronous call.
7851 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7854 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7856 * @brief Read value for remote characteristics.
7858 * This function is a synchronous call.
7868 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7871 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7872 * @brief Check if Adapter supports LE 2M PHY feature or not.
7874 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7875 * in BT 5.0 specification.
7877 * This function is a synchronous call.
7879 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7880 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7881 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7882 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7883 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7887 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7890 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7891 * @brief Check if Adapter supports LE 2M CODED feature or not.
7893 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7894 * in BT 5.0 specification.
7896 * This function is a synchronous call.
7898 * @return BLUETOOTH_ERROR_NONE - Succeess \n
7899 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7900 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7901 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7902 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
7906 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
7914 #endif /* __cplusplus */
7915 #endif /* _BLUETOOTH_API_H_*/