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_EXTENDED_ADVERTISING_DATA_LENGTH_MAX 255 /**< This specifies maximum AD data length */
49 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
50 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
51 #define BLUETOOTH_APPEARANCE_LENGTH 2 /**< This specifies bluetooth device appearance characteristic length */
52 #define BLUETOOTH_IRK_LENGTH 16 /**< This specifies bluetooth device IRK length */
54 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
55 a device can support */
57 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
59 #define BLUETOOTH_UUID_STRING_MAX 50
60 #define BLUETOOTH_PATH_STRING 50
62 #define BLUETOOTH_OOB_DATA_LENGTH 16
64 #define BLUETOOTH_LE_OOB_DATA_LENGTH 100
66 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
68 #define BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX 610 /**< GATT ATT value max len */
71 * This is Bluetooth Connected event role
73 #define RFCOMM_ROLE_SERVER 1
74 #define RFCOMM_ROLE_CLIENT 2
77 * This is RFCOMM default Channel Value
79 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
80 #define RFCOMM_ROBOT_PROFILE_CHANNEL 22
83 * This is L2cap LE Socket Connected event role
85 #define L2CAP_LE_ROLE_SERVER 1
86 #define L2CAP_LE_ROLE_CLIENT 2
89 * This is maximum length for search value string for PBAP Phonebook Search
91 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
94 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
97 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
98 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
101 * < This defines the maximum size of OTP server directory name
103 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
105 #define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH 500 /**< OTP Characteristics Value Max length */
108 * This is Bluetooth error code
110 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
112 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
113 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
115 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
116 /**< Callback error */
117 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
118 /**< invalid paramerror */
119 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
120 /**< invalid data error */
121 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
122 /**< Memory allocation error */
123 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
124 /**< out of memory error */
125 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
126 /**< timeout error */
127 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
128 /**< No resource error */
129 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
130 /**< internal error */
131 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
132 /**< Not supported error */
133 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
134 /**< Operation is failed because
135 of not enabled BT Adapter */
136 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
137 /**< Enabling is failed because of
138 already enabled BT Adapter */
139 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
140 /**< Operation is failed because of
141 other on going operation */
142 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
143 /**< access denied error */
144 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
145 /**< max client error */
146 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
147 /**< not found error */
148 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
149 /**< service search fail */
150 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
151 /**< pairing failed error */
152 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
153 /**< Not paired error */
154 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
155 /**< no service error */
156 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
157 /**< no connection error */
158 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
159 /**< alread connected error */
160 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
161 /**< connection busy error */
162 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
163 /**< connection error */
164 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
165 /**< max connection error*/
166 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
167 /**< Not in operation */
168 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
169 /**< Cancelled by user */
170 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
171 /**< Service record registration failed */
172 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
173 /**< Operation in progress */
174 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
175 /**< authentication failed error when paring*/
176 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
177 /**< Remote host is down */
178 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
179 /**< End of device list */
181 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
182 /**< Obex agent already exists */
183 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
184 /**< Obex agent does not exist */
186 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
187 /**< Already initialized */
189 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
190 /**< Permission deined */
192 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
193 /**< Nap already done */
195 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
196 /**< Not initialized */
198 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
199 /**< Authentication rejected */
201 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
202 /**< Device Policy Restricted */
204 #define BLUETOOTH_ERROR_NO_DATA ((int)BLUETOOTH_ERROR_BASE - 0x29)
207 #define BLUETOOTH_ERROR_AUTHORIZATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x2a)
208 /**< Authorization rejected */
211 * Error codes for ATT Error response *
213 #define BLUETOOTH_ATT_ERROR_INTERNAL -1
214 #define BLUETOOTH_ATT_ERROR_NONE 0x00
215 #define BLUETOOTH_ATT_ERROR_INVALID_HANDLE 0x01
216 #define BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED 0x02
217 #define BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED 0x03
218 #define BLUETOOTH_ATT_ERROR_INVALID_PDU 0x04
219 #define BLUETOOTH_ATT_ERROR_AUTHENTICATION 0x05
220 #define BLUETOOTH_ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06
221 #define BLUETOOTH_ATT_ERROR_INVALID_OFFSET 0x07
222 #define BLUETOOTH_ATT_ERROR_AUTHORIZATION 0x08
223 #define BLUETOOTH_ATT_ERROR_PREPARE_QUEUE_FULL 0x09
224 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0A
225 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0B
226 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0C
227 #define BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN 0x0D
228 #define BLUETOOTH_ATT_ERROR_UNLIKELY 0x0E
229 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0F
230 #define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10
231 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
232 /* Common profile error codes */
233 #define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED 0xFC
234 #define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED 0xFD
235 #define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS 0xFE
236 #define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE 0xFF
239 * Bluetooth ATT error codes specific to OTP
241 #define BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED 0x80
242 #define BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED 0x81
243 #define BLUETOOTH_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
244 #define BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS 0x83
247 * Bluetooth OTP error codes
248 * TODO: Check error code conflict
250 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
251 #define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
254 * Device disconnection reasons; received from stack
256 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
257 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
258 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
259 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
260 #define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e
261 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
262 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
263 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
264 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
265 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
266 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
267 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
268 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
269 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
270 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
271 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
274 * Device disconnect reason
277 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
278 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
279 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
280 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
281 } bluetooth_device_disconnect_reason_t;
284 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
287 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
288 } bluetooth_device_address_t;
291 * This is Bluetooth device address type
294 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
295 BLUETOOTH_DEVICE_RANDOM_ADDRESS
296 } bluetooth_device_address_type_t;
299 * This is BD Address type defined in kernel BT header
302 BLUETOOTH_BDADDR_BREDR = 0x00,
303 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
304 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
305 } bluetooth_bdaddr_type_e;
308 * This is Bluetooth version
311 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
312 } bluetooth_version_t;
315 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
318 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
319 } bluetooth_device_name_t;
323 unsigned char irk[BLUETOOTH_IRK_LENGTH];
327 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
330 int data_len; /**< manafacturer specific data length */
331 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
332 } bluetooth_manufacturer_data_t;
335 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
336 } bluetooth_device_pin_code_t;
339 * This is data for battery usage monitoring
343 time_t session_start_time;
344 time_t session_end_time;
348 uint32_t session_connected_time;
349 uint32_t session_scan_time;
359 } bt_battery_app_data;
365 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
366 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
367 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
368 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
369 } bluetooth_adapter_state_t;
375 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
376 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
377 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
378 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
379 } bluetooth_adapter_le_state_t;
385 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
386 /*Changed the order to make it compatable with old method */
387 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
388 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
389 /**< Discoverable mode with time limit
390 After specific timeout, it is changed
391 to non discoverable mode */
392 } bluetooth_discoverable_mode_t;
395 * Network connect mode
398 BLUETOOTH_NETWORK_PANU_ROLE,
400 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
401 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
402 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
403 } bluetooth_network_role_t;
407 * Service type matched to bt_profile_type_t of bt-service-common.h
410 BLUETOOTH_RFCOMM_SERVICE = 0x01,
411 BLUETOOTH_A2DP_SERVICE = 0x02,
412 BLUETOOTH_HSP_SERVICE = 0x04,
413 BLUETOOTH_HID_SERVICE = 0x08,
414 BLUETOOTH_NAP_SERVICE = 0x10,
415 BLUETOOTH_HFG_SERVICE = 0x20,
416 BLUETOOTH_GATT_SERVICE = 0x40,
417 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
418 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
419 BLUETOOTH_PBAP_SERVICE = 0x200,
420 } bluetooth_service_type_t;
426 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
427 /* represents that connection
428 * type can both BR/EDR and LE */
429 BLUETOOTH_DEV_CONN_BREDR = 0x00,
430 BLUETOOTH_DEV_CONN_LE = 0x01,
431 } bluetooth_conn_type_t;
437 BLUETOOTH_CODEC_ID_CVSD = 0x01,
438 BLUETOOTH_CODEC_ID_MSBC = 0x02,
439 } bluetooth_codec_type_t;
445 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
446 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
447 } bluetooth_hf_audio_connected_type_t;
453 /* TODO : Change to BLUETOOTH_EXTENDED_ADVERTISING_DATA_LENGTH_MAX
454 * once LE EXTENDED feature is supported */
455 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
456 } bluetooth_advertising_data_t;
462 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
463 } bluetooth_scan_resp_data_t;
466 * Advertising filter policy
469 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
470 BLUETOOTH_ALLOW_CONN_ALL_SCAN_ALLOW_LIST = 0x01,
471 BLUETOOTH_ALLOW_SCAN_ALL_CONN_ALLOW_LIST = 0x02,
472 BLUETOOTH_ALLOW_SCAN_CONN_ALLOW_LIST = 0x03,
473 } bluetooth_advertising_filter_policy_t;
479 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
480 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
481 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
482 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
483 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
484 } bluetooth_advertising_type_t;
487 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
488 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
489 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_RESYNC = 0x03,
490 } bluetooth_gatt_service_change_type_t;
493 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
494 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
495 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
496 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
497 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
498 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
499 } bt_gatt_permission_t;
502 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
503 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
504 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
505 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
506 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
507 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
508 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
509 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
510 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
511 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
512 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
513 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
514 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
515 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
516 } bt_gatt_characteristic_property_t;
519 * Remote device request types for attributes
522 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
523 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
524 } bluetooth_gatt_att_request_tyep_t;
527 * Proximity Property Type
530 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
531 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
532 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
533 } bluetooth_pxp_poperty_t;
539 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
540 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
541 BLUETOOTH_TDS_TRANSPORT_WIFI_NAN, /* Wi-Fi Alliance Neighbor Awareness Networking */
542 BLUETOOTH_TDS_TRANSPORT_WIFI_SVC_ADV, /* Wi-Fi Alliance Service Advertisement */
544 BLUETOOTH_TDS_TRANSPORT_INVALID
545 } bluetooth_tds_transport_t;
548 * TDS transport state
551 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
552 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
553 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
554 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
555 } bluetooth_tds_transport_state_t;
562 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
563 } bluetooth_tds_data_t;
566 * TDS activation request
569 bluetooth_device_address_t rem_addr;
570 bluetooth_tds_transport_t transport;
571 bluetooth_tds_data_t tds_data;
572 } bluetooth_tds_activation_req_t;
575 * TDS Control Point data
578 int length; /**< Control point data length */
579 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
580 } bluetooth_control_point_data_t;
583 * TDS Indication Response data
586 bluetooth_device_address_t rem_addr; /**< Device address */
587 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
588 } bluetooth_tds_indication_res_t;
591 * Structure to hold the TDS Complete data information which is read from remote TDS provider
594 bluetooth_device_address_t device_address; /**< Device address */
595 int data_length; /**< Data length */
596 char *data; /**< Complete Transport Specific data */
597 } bluetooth_tds_transport_data_info_t;
600 * OTP Characteristics Value
603 int length; /**< Characteristics value length */
604 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
605 } bluetooth_otp_charc_data_t;
608 * Structure to hold the OTP response data from remote OTP server
611 char *handle; /**< Handle */
612 int data_length; /**< Data length */
613 char *data; /**< Read data */
614 } bluetooth_otp_resp_info_t;
617 * Structure to hold the OTC Channel Info
620 gboolean connected; /**< Connection Status */
622 char *address; /**< Remote address */
623 } bluetooth_otc_info_t;
626 * Advertising parameters
631 guint8 filter_policy;
637 } bluetooth_advertising_params_t;
643 int type; /**< passive 0, active 1 */
644 float interval; /**< LE scan interval */
645 float window; /**< LE scan window */
646 } bluetooth_le_scan_params_t;
652 BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
653 BLUETOOTH_LE_ACTIVE_SCAN
654 } bluetooth_le_scan_type_t;
657 BLUETOOTH_LE_SCAN_ALL = 0x00,
658 BLUETOOTH_LE_SCAN_LEGACY_ONLY,
659 BLUETOOTH_LE_SCAN_EXTENDED_ONLY
660 } bluetooth_le_scan_role_t;
663 BLUETOOTH_ALL_PHY = 0x00,
664 BLUETOOTH_1M_PHY = 0x01,
665 BLUETOOTH_ONE_M_CODED_PHY = 0x03
666 } bleutooth_le_scanning_phy_t;
676 } bluetooth_le_connection_param_t;
679 LE Read Maximum Data Length
682 guint16 max_tx_octets;
684 guint16 max_rx_octets;
686 } bluetooth_le_read_maximum_data_length_t;
689 LE Read Host suggested default Data Length
692 guint16 def_tx_octets;
694 } bluetooth_le_read_host_suggested_data_length_t;
697 * Samsung XSAT Vendor dependent command
702 } bluetooth_vendor_dep_at_cmd_t;
708 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
709 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
710 } bluetooth_opp_transfer_type_t;
715 } bluetooth_hf_ciev_device_event_t;
717 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
718 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
719 /**< Base ID for GAP Event */
720 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
721 /**< Base ID for SDP events */
722 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
723 /**< Base ID for RFCOMM events */
724 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
725 /**< Base ID for NETWORK events */
726 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
727 /**< Base ID for HDP events */
728 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
729 /**< Base ID for OPC events */
730 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
731 /**< Base ID for Obex Server events */
732 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
733 /**< Base ID for GATT events */
735 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
736 /**< Base ID for Audio events */
737 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
738 /**< Base ID for HID events */
739 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
740 /**< Base ID for Advertising events */
741 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
742 /**< Base ID for PBAP Client events */
743 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
744 /**< Base ID for AVRCP events */
745 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
746 /**< Base ID for IPSP events */
747 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
748 /**< Base ID for MAP events */
749 #define BLUETOOTH_EVENT_MESH_BASE ((int)(BLUETOOTH_EVENT_MAP_BASE + 0x0020))
750 /**< Base ID for MAP events */
751 #define BLUETOOTH_EVENT_L2CAP_LE_BASE ((int)(BLUETOOTH_EVENT_MESH_BASE + 0x0040))
752 /**< Base ID for L2CAP_LE events */
755 * Bluetooth event type
758 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
760 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
761 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
762 BLUETOOTH_EVENT_DISABLED_BATTERY_DATA, /**< Bluetooth event adapter disabled battery data*/
763 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
764 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
765 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
766 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
767 /**< Bluetooth event Discoverable timeout requested*/
768 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
769 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
770 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
771 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
772 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
773 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
774 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
775 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
776 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
777 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
778 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
779 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
780 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
781 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
782 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
783 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
784 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
785 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
786 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
787 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
788 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
790 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
791 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
792 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
793 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
794 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
796 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
797 /**< Bluetooth event serice search base id */
798 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
799 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
800 /**< RFCOMM data receive event */
801 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
802 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
804 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
806 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
807 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
809 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
811 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
812 /**< Bluetooth Network event */
813 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
814 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
815 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
816 /**< Network disconnected evnet in server */
818 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
819 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
821 BLUETOOTH_EVENT_HDP_CONNECTED
822 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
823 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
824 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
826 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
827 /* OPC Connected event */
828 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
829 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
830 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
831 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
833 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
834 BLUETOOTH_EVENT_MAP_DISCONNECTED,
836 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
837 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
838 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
839 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
840 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
842 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
843 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
844 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
845 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
846 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
847 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
848 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
849 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
850 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
851 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
852 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
853 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
854 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
856 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
857 /* Obex server authorize event*/
858 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
859 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
860 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
861 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
862 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
863 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
865 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
866 /**<Discovered GATT service characteristics event*/
867 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
868 /**<Remote GATT charateristic value changed event*/
869 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
870 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
871 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
872 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
873 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
874 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
875 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
876 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
877 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
878 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
879 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
880 BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
881 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
882 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
883 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
884 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
885 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
886 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
887 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
888 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
889 BLUETOOTH_EVENT_GATT_SERVER_PHY_READ, /**<Local Gatt Server PHY Read event */
890 BLUETOOTH_EVENT_GATT_SERVER_PHY_UPDATED, /**<Local Gatt Server PHY Updated event */
891 BLUETOOTH_EVENT_GATT_CLIENT_PHY_READ, /**<Gatt Client PHY Read event */
892 BLUETOOTH_EVENT_GATT_CLIENT_PHY_UPDATED, /**<Gatt Client PHY Updated event */
893 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
894 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
895 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
896 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
897 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
898 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
899 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
900 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
901 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
902 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
903 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
904 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
905 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
906 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
907 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
908 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
909 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
910 BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
911 BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
912 BLUETOOTH_EVENT_HF_CONNECTED,
913 BLUETOOTH_EVENT_HF_DISCONNECTED,
914 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
915 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
916 BLUETOOTH_EVENT_HF_RING_INDICATOR,
917 BLUETOOTH_EVENT_HF_CALL_WAITING,
918 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
919 BLUETOOTH_EVENT_HF_CALL_STARTED,
920 BLUETOOTH_EVENT_HF_CALL_ENDED,
921 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
922 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
923 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
924 BLUETOOTH_EVENT_HF_CALL_STATUS,
925 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
926 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
927 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
928 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
929 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
930 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
931 BLUETOOTH_EVENT_HF_CALL_IDLE,
932 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
933 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
934 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
935 BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
937 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
938 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
939 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
940 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
941 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
943 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
944 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
945 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
946 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
947 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
948 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
949 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
950 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
952 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
953 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
954 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
955 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
956 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
957 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
958 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
960 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
961 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
962 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
963 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
964 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
965 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
966 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
967 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
968 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
970 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
971 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
972 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
973 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
974 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
975 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
976 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
977 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
978 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
979 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
980 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
982 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
983 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
984 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
985 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
986 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
987 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
988 BLUETOOTH_EVENT_MESH_SCAN_STARTED = BLUETOOTH_EVENT_MESH_BASE,
989 BLUETOOTH_EVENT_MESH_SCAN_FINISHED,
990 BLUETOOTH_EVENT_MESH_SCAN_RESULT,
991 BLUETOOTH_EVENT_MESH_AUTHENTICATION_REQUEST,
992 BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED,
993 BLUETOOTH_EVENT_MESH_NODE_BROWSED,
994 BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES,
995 BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
996 BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED,
997 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
998 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST,
999 BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
1000 BLUETOOTH_EVENT_MESH_MODEL_MSG_RECEIVED,
1001 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST,
1002 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED,
1003 BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED,
1004 BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
1005 BLUETOOTH_EVENT_MESH_JOIN_COMPLETED,
1006 BLUETOOTH_EVENT_L2CAP_LE_DATA_RECEIVED = BLUETOOTH_EVENT_L2CAP_LE_BASE,
1007 /**< L2CAP_LE data receive event */
1008 BLUETOOTH_EVENT_L2CAP_LE_CONNECTED, /**< L2CAP_LE server/client connect */
1009 BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED, /**< L2CAP_LE server/client disconnect */
1010 BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE,
1011 BLUETOOTH_EVENT_L2CAP_LE_SERVER_REMOVED
1012 } bluetooth_event_type_t;
1015 * This bt_service_uuid_list_t enum indicates service uuid list .
1016 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
1020 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
1021 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
1022 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
1023 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
1024 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
1025 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
1026 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
1027 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
1028 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
1029 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
1030 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
1031 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
1032 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
1034 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
1035 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
1036 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
1037 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
1038 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
1039 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
1040 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
1041 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
1042 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
1043 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
1044 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
1045 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
1046 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
1047 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
1049 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
1050 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
1051 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
1052 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
1053 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
1054 /**<DIRECT PRINTING*/
1055 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
1056 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
1057 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
1058 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
1059 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
1060 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
1061 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
1062 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
1063 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
1064 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
1065 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
1066 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
1067 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
1068 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
1069 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
1070 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
1071 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
1072 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
1073 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
1074 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
1075 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
1076 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
1077 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
1078 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
1079 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
1080 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
1081 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
1082 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
1083 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
1084 } bluetooth_service_uuid_list_t;
1087 * Service class part of class of device returned from device discovery
1090 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1091 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1092 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1093 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1094 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1095 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1096 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1097 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1098 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1099 } bluetooth_device_service_class_t;
1103 * Major device mask (For device discovery)
1106 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1107 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1108 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1109 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1110 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1111 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1112 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1113 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1114 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1115 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1116 } bluetooth_device_major_mask_t;
1120 * Major device class (part of Class of Device)
1123 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1124 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1125 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1126 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1127 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1128 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1129 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1130 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1131 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1132 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1133 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1134 } bluetooth_device_major_class_t;
1137 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1139 /* About Computer Major class */
1140 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1142 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1143 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1144 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1145 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1146 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1148 /* About Phone Major class */
1149 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1150 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1151 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1153 /**< voice gateway minor class */
1154 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1156 /* About LAN/Network Access Point Major class */
1157 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1158 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1159 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1160 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1161 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1162 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1163 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1164 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1166 /* About Audio/Video Major class */
1167 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1168 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1170 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1171 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1172 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1173 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1174 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1175 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1176 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1177 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1178 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1179 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1180 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1181 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1182 /**< Video Display and Loud
1183 Speaker minor class */
1184 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1187 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1189 /* About Peripheral Major class */
1190 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1191 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1192 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1193 /**< Combo Keyboard or pointing
1194 device minorclass */
1196 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1197 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1198 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1199 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1200 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1201 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1202 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1203 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1204 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1206 /* About Imaging Major class */
1207 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1208 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1209 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1210 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1212 /* About Wearable Major class */
1213 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1214 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1215 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1216 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1217 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1219 /* About Toy Major class */
1220 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1221 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1222 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1223 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1224 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1226 /* About Health Major class */
1227 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1228 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1229 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1230 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1231 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1232 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1233 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1234 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1235 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1236 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1237 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1238 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1239 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1240 } bluetooth_device_minor_class_t;
1243 * structure to hold the device information
1246 bluetooth_device_major_class_t major_class; /**< major device class */
1247 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1248 bluetooth_device_service_class_t service_class;
1249 /**< service device class */
1250 } bluetooth_device_class_t;
1253 * Discovery Role types
1256 DISCOVERY_ROLE_BREDR = 0x1,
1258 DISCOVERY_ROLE_LE_BREDR
1259 } bt_discovery_role_type_t;
1262 * Connected state types
1265 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1266 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1267 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1268 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1269 } bluetooth_connected_link_t;
1275 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1276 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1277 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1278 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1279 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1280 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1281 BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80, /**< rssi high threshold */
1282 } bluetooth_le_scan_filter_feature_t;
1285 * LE connection mode
1288 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1289 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1290 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1291 } bluetooth_le_connection_mode_t;
1294 * structure to hold the device information
1297 bluetooth_device_address_t device_address; /**< device address */
1298 bluetooth_device_name_t device_name; /**< device name */
1299 bluetooth_device_class_t device_class; /**< device class */
1300 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1301 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1303 int rssi; /**< received strength signal*/
1304 gboolean paired; /**< paired flag */
1305 bluetooth_connected_link_t connected; /**< connected link type */
1306 gboolean trust; /**< trust flag */
1307 gboolean is_alias_set; /** is device alias set flag**/
1308 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1309 } bluetooth_device_info_t;
1312 * structure to hold the LE device information
1315 int data_len; /**< manafacturer specific data length */
1316 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1317 } bluetooth_le_advertising_data_t;
1320 guint8 data[BLUETOOTH_EXTENDED_ADVERTISING_DATA_LENGTH_MAX];
1321 } bluetooth_extended_advertising_data_t;
1324 gboolean use_reserved_slot;
1326 } bluetooth_le_slot_and_adv_type_t;
1329 int data_len; /**< manafacturer specific data length */
1330 bluetooth_extended_advertising_data_t data; /**< manafacturer specific data */
1331 } bluetooth_le_extended_advertising_data_t;
1334 bluetooth_device_address_t device_address; /**< device address */
1335 int addr_type; /**< address type*/
1336 int rssi; /**< received strength signal*/
1340 int advertising_sid;
1342 int periodic_adv_int;
1344 /* TODO : Replace bluetooth_le_advertising_data_t adv_ind_data with
1345 * bluetooth_le_extended_advertising_data_t once
1346 * LE_EXTENDED feature is supported */
1347 bluetooth_le_advertising_data_t adv_ind_data;
1348 bluetooth_le_advertising_data_t scan_resp_data;
1349 } bluetooth_le_device_info_t;
1353 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1354 bluetooth_device_address_t device_address; /**< device address */
1355 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1356 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1357 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1358 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1359 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1360 bluetooth_le_advertising_data_t service_data; /**< service data */
1361 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1362 int manufacturer_id; /**< manufacturer ID */
1363 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1364 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1365 int rssi_high_threshold; /**< rssi high threshold */
1366 } bluetooth_le_scan_filter_t;
1369 bluetooth_device_address_t device_address; /**< device address */
1370 unsigned int mtu; /** < MTU set for the ATT connection */
1371 unsigned int status; /** < status of the MTU exchange */
1372 } bluetooth_le_att_mtu_info_t;
1375 bluetooth_device_address_t device_address; /**< device address */
1376 int tx_phy; /** < tx_phy set for the gatt connection */
1377 int rx_phy; /** < rx_phy set for the gatt connection */
1378 int status; /** < status of the PHY */
1379 } bluetooth_le_phy_info_t;
1382 * structure to hold the paired device information
1385 bluetooth_device_address_t device_address; /**< paired device address */
1386 bluetooth_device_name_t device_name; /**< device name */
1387 bluetooth_device_class_t device_class; /**< device class */
1388 } bluetooth_paired_device_info_t;
1391 * structure to hold the paired device information
1394 bluetooth_device_address_t device_address;
1395 /**< device address */
1396 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1397 /**< network interface name */
1398 } bluetooth_network_device_info_t;
1401 * Authentication event types
1405 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1406 BLUETOOTH_AUTH_PIN_REQUEST,
1407 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1408 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1409 } bluetooth_auth_type_t;
1412 * structure to hold the pincode/pass-key req informations
1415 bluetooth_device_address_t device_address; /**< remote device address */
1416 bluetooth_device_name_t device_name; /**< device name */
1417 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1418 bool incoming; /**< stores if bonding request is incoming */
1419 } bluetooth_authentication_request_info_t;
1422 * Stucture to hold discovery option
1425 unsigned short max_response; /**< the number of maximum response */
1426 unsigned short discovery_duration;
1427 /**< duration of discovery (seconds) */
1428 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1429 classOfDevice variable */
1430 } bluetooth_discovery_option_t;
1433 * Stucture to hold event information
1436 int event; /**< event type */
1437 int result; /**< Success or error value */
1439 /**<parameter data pointer */
1441 } bluetooth_event_param_t;
1444 bluetooth_device_address_t device_addr;
1445 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1446 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1447 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1452 bluetooth_device_address_t device_addr;
1453 unsigned char addr_type;
1456 } bt_connection_info_t;
1459 * Stucture to rfcomm receive data
1464 /**< the socket fd */
1465 int buffer_size;/**< the length of the receive buffer */
1467 /**< the receive data buffer */
1468 } bluetooth_rfcomm_received_data_t;
1471 * Stucture to l2cap_le receive data
1474 int socket_fd; /**< the socket fd */
1475 int buffer_size; /**< the length of the receive buffer */
1476 char *buffer; /**< the receive data buffer */
1477 } bluetooth_l2cap_le_received_data_t;
1483 HTYPE_TRANS_HANDSHAKE,
1484 HTYPE_TRANS_HID_CONTROL,
1485 HTYPE_TRANS_GET_REPORT,
1486 HTYPE_TRANS_SET_REPORT,
1487 HTYPE_TRANS_GET_PROTOCOL,
1488 HTYPE_TRANS_SET_PROTOCOL,
1490 HTYPE_TRANS_UNKNOWN,
1491 HTYPE_TRANS_GET_IDLE = 0xF0,
1492 HTYPE_TRANS_SET_IDLE = 0xF1,
1493 } bt_hid_header_type_t;
1499 PTYPE_DATA_RTYPE_INPUT,
1500 PTYPE_DATA_RTYPE_OUTPUT
1501 } bt_hid_param_type_t;
1504 * Stucture to hid receive data
1507 const char *address;
1508 bt_hid_header_type_t type;
1509 /**< Header type containing */
1510 bt_hid_param_type_t param;
1511 /**< Param type in header like INPUT Report or OutPut Report */
1512 int buffer_size;/**< the length of the receive buffer */
1514 /**< the receive data buffer */
1515 } bluetooth_hid_received_data_t;
1518 * Stucture to rfcomm connection
1522 int socket_fd; /**< the socket fd */
1523 int server_id; /* Server id */
1524 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1525 bluetooth_device_address_t device_addr;
1526 /**< device address */
1527 char uuid[BLUETOOTH_UUID_STRING_MAX];
1528 } bluetooth_rfcomm_connection_t;
1531 * Stucture to rfcomm disconnection
1535 /**< the socket fd */
1536 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1537 bluetooth_device_address_t device_addr;
1538 /**< device address */
1539 char uuid[BLUETOOTH_UUID_STRING_MAX];
1540 } bluetooth_rfcomm_disconnection_t;
1544 /**< the socket fd */
1545 bluetooth_device_address_t device_addr;
1546 /**< device address */
1547 } bluetooth_rfcomm_connection_request_t;
1550 * Stucture to l2cap_le connection
1553 int socket_fd; /**< the socket fd */
1554 int server_id; /* Server id */
1555 int device_role; /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1556 bluetooth_device_address_t device_addr; /**< device address */
1558 } bluetooth_l2cap_le_connection_t;
1561 * Stucture to l2cap_le disconnection
1564 int socket_fd; /**< the socket fd */
1566 /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1567 bluetooth_device_address_t device_addr; /**< device address */
1569 } bluetooth_l2cap_le_disconnection_t;
1572 * Stucture to l2cap_le connection request
1575 int socket_fd; /**< the socket fd */
1576 bluetooth_device_address_t device_addr; /**< device address */
1577 } bluetooth_l2cap_le_connection_request_t;
1586 } bt_hdp_qos_type_t;
1592 HDP_ROLE_SOURCE = 0x0,
1594 } bt_hdp_role_type_t;
1598 * Stucture to HDP connected
1601 const char *app_handle; /**< the application handle */
1602 unsigned int channel_id; /**< the channel id */
1603 bt_hdp_qos_type_t type; /**< the QOS type */
1604 bluetooth_device_address_t device_address; /**< the remote address */
1605 } bt_hdp_connected_t;
1608 * Stucture to HDP disconnected
1611 unsigned int channel_id; /**< the channel id */
1612 bluetooth_device_address_t device_address; /**< the remote address */
1613 } bt_hdp_disconnected_t;
1616 * Stucture to HDP data indication
1619 unsigned int channel_id; /**< the channel id */
1620 const char *buffer; /**< the RX data buffer */
1621 unsigned int size; /**< the RX data size */
1622 } bt_hdp_data_ind_t;
1625 * Stucture to OPP client transfer information
1632 } bt_opc_transfer_info_t;
1634 /* TODO: MAP client structures, see above */
1636 * Stucture to Map filter fields
1641 } bt_map_list_filter_fields_info_t;
1643 /* Obex Server transfer type */
1644 #define TRANSFER_PUT "PUT"
1645 #define TRANSFER_GET "GET"
1647 * Stucture to OPP/FTP Server authorize information
1654 } bt_obex_server_authorize_into_t;
1662 } bt_obex_server_type_t;
1665 * Stucture to OPP/FTP server transfer information
1673 unsigned long file_size;
1675 bt_obex_server_type_t server_type;
1677 unsigned char *contact_auth_info;
1678 } bt_obex_server_transfer_info_t;
1681 * Stucture to OPP/FTP server connection/disconnection information
1687 } bt_obex_server_connection_info_t;
1691 * Stucture to OOB data
1695 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1696 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1697 unsigned int hash_len;
1698 unsigned int randomizer_len;
1700 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1701 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1702 unsigned int hash256_len;
1703 unsigned int randomizer256_len;
1705 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1706 unsigned int eir_len;
1710 * Structure to GATT attribute handle data
1716 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1717 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1718 } bt_gatt_handle_info_t;
1721 * Structure to a most basic GATT attribute handle data
1725 unsigned char uuid[16];
1726 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1727 } bt_gatt_handle_property_t;
1730 * Structure to GATT Remote service data
1737 bt_gatt_handle_info_t include_handles;
1738 bt_gatt_handle_info_t char_handle;
1739 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1740 } bt_gatt_service_property_t;
1743 * Structure to GATT Remote characteristic data
1747 char *service_handle;
1748 bt_gatt_handle_info_t handle_info;
1749 } bt_gatt_discovered_char_t;
1752 * Structure to format of GATT Characteristic Value
1756 unsigned char format;
1757 unsigned char exponent;
1758 unsigned short unit;
1759 unsigned char name_space;
1760 unsigned short description;
1761 } bt_gatt_char_format_t;
1764 * Structure to GATT Characteristic property
1772 bt_gatt_char_format_t format;
1774 unsigned int val_len;
1775 unsigned int permission;
1776 char *representation;
1777 bt_gatt_handle_info_t char_desc_handle;
1778 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1779 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1780 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1781 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1782 } bt_gatt_char_property_t;
1785 * Structure to GATT Characteristic descriptor property
1792 unsigned int val_len;
1793 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1794 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1795 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1796 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1797 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1798 } bt_gatt_char_descriptor_property_t;
1801 * Structure to GATT Characteristic value
1808 } bt_gatt_char_value_t;
1811 unsigned char UUID[16];
1815 } bt_gatt_notify_req_t ;
1818 * Structure to GATT Read Request
1822 char *service_handle;
1826 } bt_gatt_read_req_t;
1829 * Structure to GATT Value change
1833 char *service_handle;
1836 gboolean response_needed;
1840 } bt_gatt_value_change_t;
1843 bluetooth_device_address_t device_addr;
1845 bluetooth_gatt_service_change_type_t change_type;
1848 } bt_gatt_service_change_t;
1851 * Structure to GATT characteristc Notification change
1855 char *service_handle;
1856 gboolean att_notify;
1857 } bt_gatt_char_notify_change_t;
1860 * Structure to Indication confirmation
1864 char *service_handle;
1867 } bt_gatt_indicate_confirm_t;
1870 * Structure for GATT response data
1877 } bt_gatt_resp_data_t;
1880 * Structure to RSSI Signal Strength Alert
1891 * Structure to RSSI Signal Strength
1901 * Structure for RSSI Enabled or Disabled
1907 gboolean rssi_enabled;
1908 } bt_rssi_enabled_t;
1911 * Structure for RSSI Threshold
1916 int in_range_threshold;
1918 } bt_rssi_threshold_t;
1922 * Structure for Suppoted Profiles and Trusted Profiles
1929 } bt_supported_profile_trusted_t;
1932 * Structure for PBAP Folder Parameters
1935 unsigned char addressbook;
1936 unsigned char folder_type;
1940 * Structure for PBAP Pull application Parameters
1943 unsigned char format;
1944 unsigned char order;
1945 unsigned short offset;
1946 unsigned short maxlist;
1947 long long unsigned fields;
1948 } bt_pbap_pull_parameters_t;
1951 * Structure for PBAP List application Parameters
1954 unsigned char order;
1955 unsigned short offset;
1956 unsigned short maxlist;
1957 } bt_pbap_list_parameters_t;
1960 * Structure for PBAP Pull vCard application Parameters
1963 unsigned char format;
1964 long long unsigned fields;
1966 } bt_pbap_pull_vcard_parameters_t;
1969 * Structure for PBAP Search application Parameters
1972 unsigned char order;
1973 unsigned short offset;
1974 unsigned short maxlist;
1975 unsigned char search_attribute;
1976 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1977 } bt_pbap_search_parameters_t;
1980 * Structure for PBAP Connection Status
1983 bluetooth_device_address_t btaddr;
1985 } bt_pbap_connected_t;
1988 * Structure for PBAP Phonebook Size
1991 bluetooth_device_address_t btaddr;
1993 } bt_pbap_phonebook_size_t;
1996 * Structure for PBAP Phonebook Pull
1999 bluetooth_device_address_t btaddr;
2002 } bt_pbap_phonebook_pull_t;
2005 * Structure for PBAP vCard List
2008 bluetooth_device_address_t btaddr;
2012 } bt_pbap_vcard_list_t;
2015 * Structure for PBAP vCard Pull
2018 bluetooth_device_address_t btaddr;
2021 } bt_pbap_vcard_pull_t;
2024 * Structure for PBAP Phonebook search List
2027 bluetooth_device_address_t btaddr;
2031 } bt_pbap_phonebook_search_list_t;
2034 * Stucture to HF Call status information
2038 char *number; /*Phone Number */
2039 int direction; /*Direction :Incoming(1), Outgoing(0)*/
2040 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
2041 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
2042 int idx; /*Call index/ID */
2043 } bt_hf_call_status_info_t;
2048 } bt_hf_call_list_s;
2054 TRUSTED_PROFILE_PBAP = 1,
2055 TRUSTED_PROFILE_MAP,
2056 TRUSTED_PROFILE_SAP,
2057 TRUSTED_PROFILE_HFP_HF,
2058 TRUSTED_PROFILE_A2DP,
2059 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
2060 } bluetooth_trusted_profile_t;
2063 * Structure for LE data length change params
2066 bluetooth_device_address_t device_address;
2067 guint16 max_tx_octets;
2068 guint16 max_tx_time;
2069 guint16 max_rx_octets;
2070 guint16 max_rx_time;
2071 } bt_le_data_length_params_t;
2074 * Structure for proximity property change params
2077 bluetooth_device_address_t device_address;
2081 } bt_pxp_property_changed_params_t;
2084 * @brief DPM BT allowance state
2088 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
2089 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
2090 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
2091 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
2095 * @brief DPM API result
2099 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
2100 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
2101 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
2102 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
2103 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
2104 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
2108 * @brief DPM Policy status
2112 BLUETOOTH_DPM_STATUS_ERROR = -1,
2114 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
2115 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
2117 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
2118 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
2120 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2121 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2125 /* policy-group : BLUETOOTH */
2126 BLUETOOTH_DPM_POLICY_ALLOW,
2127 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2128 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2129 BLUETOOTH_DPM_POLICY_DEVICES_ALLOWLIST,
2130 BLUETOOTH_DPM_POLICY_DEVICES_BLOCKLIST,
2131 BLUETOOTH_DPM_POLICY_UUIDS_ALLOWLIST,
2132 BLUETOOTH_DPM_POLICY_UUIDS_BLOCKLIST,
2133 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2134 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2135 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2136 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2137 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2138 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2139 BLUETOOTH_DPM_POLICY_END,
2140 } bt_dpm_policy_cmd_t;
2143 struct bt_dpm_policy {
2149 typedef struct bt_dpm_policy bt_dpm_policy_t;
2152 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2153 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2154 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2155 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2156 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2157 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2158 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2159 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2160 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2161 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2162 BLUETOOTH_DPM_PROFILE_NONE,
2165 struct bt_dpm_profile_val {
2166 int value; /* tells whether the profile is enabled or disabled */
2168 typedef struct dpm_profile_val dpm_profile_state_t;
2171 * Structure to DPM device list
2175 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2176 } bt_dpm_device_list_t;
2179 * Structure to DPM uuid list
2183 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2184 } bt_dpm_uuids_list_t;
2187 * Structure for IPSP Interface Info
2190 bluetooth_device_address_t btaddr;
2192 } bt_ipsp_connection_info_t;
2196 char* remote_address;
2197 } bt_map_client_session_info_s;
2199 typedef char* bt_map_client_message_object_t;
2204 } bt_map_client_list_folders_filter_t;
2209 int8_t subject_length;
2218 } bt_map_client_list_messages_filter_t;
2221 bt_map_client_message_object_t message_object;
2226 char *sender_address;
2229 char *recipient_address;
2234 int64_t attachment_size;
2239 } bt_map_client_message_item_t;
2245 } bt_map_client_push_message_args_t;
2252 char *sender_address;
2255 char *recipient_address;
2264 } bt_map_client_message_t;
2267 char **names; // holding %size null-terminated folder names
2269 } bt_map_client_folders_s;
2272 bt_map_client_message_item_t *message_items;
2274 } bt_map_client_message_items_s;
2277 const char* target_file;
2279 } bt_get_message_callback_data;
2282 * Callback pointer type
2284 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2287 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2288 * @brief Set the callback function pointer for bluetooth event
2291 * This API will register the callback function, when any response and event are received from
2292 * bluetooth framework. @n
2293 * this registered callback function will be get called with appropriate event and data structures.
2294 * This function is a synchronous call. An application developer can call
2295 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2296 * type. This registered function will receive events of bluetooth_event_type_t type along with
2300 * @param[in] callback_ptr A pointer to the callback function
2301 * @param[in] user_data A pointer to user data
2302 * @return BLUETOOTH_ERROR_NONE - Success
2306 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2308 GMainLoop *main_loop = (GMainLoop*) user_data;
2312 // Code for each event
2314 g_main_loop_quit(main_loop);
2321 GMainLoop *main_loop = NULL;
2324 main_loop = g_main_loop_new(NULL, FALSE);
2325 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2326 if (ret >= BLUETOOTH_ERROR_NONE)
2328 // bluetooth_register_callback returned Success
2332 // bluetooth_register_callback returned failiure
2334 g_main_loop_run(main_loop);
2338 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2341 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2342 * @brief Set the callback function pointer for bluetooth le event
2345 * This API will register the callback function, when any response and event are received from
2346 * bluetooth framework. @n
2347 * this registered callback function will be get called with appropriate event and data structures.
2348 * This function is a synchronous call. An application developer can call
2349 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2350 * type. This registered function will receive events of bluetooth_event_type_t type along with
2354 * @param[in] callback_ptr A pointer to the callback function
2355 * @param[in] user_data A pointer to user data
2356 * @return BLUETOOTH_ERROR_NONE - Success
2360 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2363 * @fn int bluetooth_le_unregister_callback(void)
2364 * @brief Set the callback function pointer for bluetooth le event
2367 * This API will register the callback function, when any response and event are received from
2368 * bluetooth framework. @n
2369 * this registered callback function will be get called with appropriate event and data structures.
2370 * This function is a synchronous call. An application developer can call
2371 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2372 * type. This registered function will receive events of bluetooth_event_type_t type along with
2377 * @return BLUETOOTH_ERROR_NONE - Success
2381 int bluetooth_le_unregister_callback(void);
2384 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2385 * @brief Set the callback function pointer for bluetooth event
2388 * This API will register the callback function, when any response and event are received from
2389 * bluetooth framework. @n
2390 * this registered callback function will be get called with appropriate event and data structures.
2391 * This function is a synchronous call. An application developer can call
2392 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2393 * type. This registered function will receive events of bluetooth_event_type_t type along with
2398 * @return BLUETOOTH_ERROR_NONE - Success
2402 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2404 GMainLoop *main_loop = (GMainLoop*) user_data;
2408 // Code for each event
2410 g_main_loop_quit(main_loop);
2417 GMainLoop *main_loop = NULL;
2420 main_loop = g_main_loop_new(NULL, FALSE);
2421 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2422 if (ret >= BLUETOOTH_ERROR_NONE)
2424 // bluetooth_register_callback returned Success
2428 // bluetooth_register_callback returned failiure
2430 ret = bluetooth_deregister_callback(void);
2431 g_main_loop_run(main_loop);
2435 int bluetooth_unregister_callback(void);
2438 * @fn int bluetooth_enable_adapter(void)
2439 * @brief Enable the Bluetooth H/W
2442 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2443 * send request to bluetooth chip for activation.
2444 * This function is typically called at startup or when Bluetooth services are required. This
2445 * function must be called before calling any other API of Bluetooth operations.
2447 * Before performing any operations like Device discover, service search etc.., the adapter must be
2450 * This function is a asynchronous call.
2451 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2452 * through registered callback function with appropriate result code
2453 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2454 * BLUETOOTH_ERROR_NONE - Success \n
2456 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2457 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2459 * @return BLUETOOTH_ERROR_NONE - Success\n
2460 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2461 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2462 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2463 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2465 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2467 void bt_event_callback(int event, bluetooth_event_param_t *param)
2471 case BLUETOOTH_EVENT_ENABLED:
2472 if (param->result == BLUETOOTH_ERROR_NONE)
2474 // Successfully Enabled
2487 ret = bluetooth_enable_adapter();
2491 int bluetooth_enable_adapter(void);
2494 * @fn int bluetooth_disable_adapter(void)
2495 * @brief Disable the Bluetooth H/W
2498 * This function disables Bluetooth protocol stack and hardware. This function is called when
2499 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2501 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2502 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2503 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2505 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2508 * This function is a asynchronous call.
2509 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2510 * through registered callback function.
2513 * @return BLUETOOTH_ERROR_NONE - Success\n
2514 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2515 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2516 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2518 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2520 void bt_event_callback(int event, bluetooth_event_param_t *param)
2524 case BLUETOOTH_EVENT_DISABLED:
2525 if (param->result == BLUETOOTH_ERROR_NONE)
2527 // Successfully disabled
2540 ret = bluetooth_disable_adapter();
2543 int bluetooth_disable_adapter(void);
2544 int bluetooth_read_battery_data(bt_battery_data *latest);
2545 int bluetooth_set_battery_monitor_state(bool state);
2546 int bluetooth_get_battery_monitor_state(void);
2547 int bluetooth_recover_adapter(void);
2548 int bluetooth_check_adapter_le(void);
2549 int bluetooth_enable_adapter_le(void);
2551 int bluetooth_disable_adapter_le(void);
2552 int bluetooth_get_uuid_name(const char *uuid, char **name);
2555 * @fn int bluetooth_reset_adapter(void)
2556 * @brief Reset the Bluetooth H/W and values
2559 * This function resets Bluetooth protocol stack and hardware. This function is called when
2560 * an user want to initialize Bluetooth environment.
2562 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2565 * This function is a synchronous call.
2567 * @return BLUETOOTH_ERROR_NONE - Success\n
2568 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2570 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2575 ret = bluetooth_reset_adapter();
2578 int bluetooth_reset_adapter(void);
2581 * @fn int bluetooth_is_supported(void)
2582 * @brief Check if the bluetooth is supported or not by the current target
2584 * This API checks whether the bluetooth is supported or not.
2585 * This API only run by root permission.
2587 * This function is a synchronous call.
2589 * @return 0 - if bluetooth is not supported\n
2590 * 1 - if bluetooth is supported\n
2591 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2596 ret = bluetooth_is_supported();
2599 int bluetooth_is_supported(void);
2603 * @fn int bluetooth_check_adapter(void)
2604 * @brief Check the current status of the Bluetooth adapter
2607 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2608 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2609 * bluetooth adapter.
2610 * This API get the adapter internal data structure and check current adapter status.
2612 * This function is a synchronous call.
2615 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2616 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2618 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2622 ret = bluetooth_check_adapter();
2625 int bluetooth_check_adapter(void);
2628 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2629 * @brief Get the local adapter bluetooth address
2632 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2633 * the adapter should be enabled.
2634 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2635 * contain Bluetooth address.
2636 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2637 * friendly name for each device.
2638 * There is no event callback for this API.
2640 * This function is a synchronous call.
2643 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2644 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2645 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2646 * @param[out] local_address a device address of local bluetooth adapter
2651 bluetooth_device_address_t local_address={0,};
2654 ret = bluetooth_get_local_address(&local_address);
2657 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2660 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2661 * @brief Get the hci version
2664 * This function is used to get the bluetooth hci version
2665 * Before calling this API make sure that the adapter is enabled.
2667 * This function is a synchronous call.
2670 * @return BLUETOOTH_ERROR_NONE - Success \n
2671 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2672 * @param[out] timeout remain visibility timeout value
2675 bluetooth_version_t *version;
2677 ret = bluetooth_get_local_version (&version);
2680 int bluetooth_get_local_version(bluetooth_version_t *version);
2683 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2684 * @brief Get the local device name
2687 * This function is used, get the local device name. Since its difficult to remember the Adapter
2688 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2689 * friendly name is retrived by the remote device and displaying.
2690 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2692 * This function is a synchronous call.
2695 * @return BLUETOOTH_ERROR_NONE - Success \n
2696 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2697 * @param[out] local_name a local device name
2701 bluetooth_device_name_t local_name={0,}
2703 ret = bluetooth_get_local_name (&local_name);
2706 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2709 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2710 * @brief Set the local device name
2713 * This function is used to set the local device name. This is a human friendly name whose
2714 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2716 * This function is a synchronous call.
2718 * @param[in] local_name bluetooth device name to set local device
2720 * @return BLUETOOTH_ERROR_NONE - Success \n
2721 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2722 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2723 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2724 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2725 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2730 bluetooth_device_name_t local_name={0,}
2732 ret = bluetooth_set_local_name (&local_name);
2735 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2739 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2740 * @brief Check if the uuid is used or not
2742 * This function is used to check if the uuid is used or not.
2744 * This function is a synchronous call.
2746 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2747 * @param[out] used if the uuid is used or not
2749 * @return BLUETOOTH_ERROR_NONE - Success \n
2750 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2751 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2752 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2757 gboolean used = FALSE;
2758 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2759 ret = bluetooth_is_service_used(uuid, &used);
2762 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2765 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2766 * @brief Check if the device is connected to the specific service
2768 * This function is used to check if if the device is connected to the specific service.
2770 * This function is a synchronous call.
2772 * @param[in] local_address a device address of remote bluetooth device
2773 * @param[in] type the service type
2774 * @param[out] is_connected if the device is connected or not
2776 * @return BLUETOOTH_ERROR_NONE - Success \n
2777 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2778 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2779 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2784 gboolean is_connected = FALSE;
2785 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2786 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2789 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2790 bluetooth_service_type_t type,
2791 gboolean *is_connected);
2794 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2795 * @brief Gets device's connected link type
2797 * This function is used to get device's connected link type
2799 * This function is a synchronous call.
2801 * @param[in] device_address a device address of remote bluetooth device
2802 * @param[out] connected_link a device's connected link type
2804 * @return BLUETOOTH_ERROR_NONE - Success \n
2805 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2806 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2807 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2812 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2813 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2814 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2817 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2818 bluetooth_connected_link_t *connected_link);
2821 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2822 * @brief Sets a profile trusted for a device
2824 * This function is used to Set a profile as trusted for a device
2826 * This function is a synchronous call.
2828 * @param[in] device_address a device address of remote bluetooth device
2829 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2830 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2832 * @return BLUETOOTH_ERROR_NONE - Success \n
2833 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2834 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2835 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2839 int bluetooth_set_profile_trusted(
2840 const bluetooth_device_address_t *device_address,
2841 int profile, int trust);
2844 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2845 * @brief Gets a profile is trusted for a device
2847 * This function is used to Get a profile is trusted or not for a device
2849 * This function is a synchronous call.
2851 * @param[in] device_address a device address of remote bluetooth device
2852 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2853 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2855 * @return BLUETOOTH_ERROR_NONE - Success \n
2856 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2857 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2858 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2862 int bluetooth_get_profile_trusted(
2863 const bluetooth_device_address_t *device_address,
2864 int profile, int *trust);
2867 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2868 * @brief Get the visibility mode
2871 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2872 * visibity mode, the property of the device is determined whether it can be discoverable, non
2873 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2875 * This function is a synchronous call.
2878 * @return BLUETOOTH_ERROR_NONE - Success \n
2879 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2880 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2881 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2882 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2883 * @param[out] discoverable_mode current bluetooth discoverable mode
2885 * @see bluetooth_set_discoverable_mode
2887 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2889 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2892 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2895 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2897 * @brief Set the visibility mode
2900 * This function is used to set the discoverable mode (Visibility option).
2902 * Many times user may want to keep his device discoverable so that when peer device is performing
2903 * device search, he/she can find user's device. Application programmer can keep the mode as
2904 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2905 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2906 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2907 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2909 * This function is a synchronous call.
2911 * @return BLUETOOTH_ERROR_NONE - Success \n
2912 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2914 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2915 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2917 * @see bluetooth_get_discoverable_mode
2921 bluetooth_discoverable_mode_t mode;
2923 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2924 ret = bluetooth_set_discoverable_mode (mode, 180);
2928 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2933 * @fn int bluetooth_get_timeout_value(int *timeout)
2934 * @brief Get the visibility timeout value
2937 * This function is used to get the visibility timeout
2938 * Before calling this API make sure that the adapter is enabled.
2940 * This function is a synchronous call.
2943 * @return BLUETOOTH_ERROR_NONE - Success \n
2944 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2945 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2946 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2947 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2948 * @param[out] timeout remain visibility timeout value
2950 * @see bluetooth_set_discoverable_mode
2954 ret = bluetooth_get_timeout_value (&timeout);
2957 int bluetooth_get_timeout_value(int *timeout);
2961 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2962 * unsigned int classOfDeviceMask)
2963 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2965 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2966 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2967 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2968 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2969 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2970 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2971 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2972 * please see bluetooth_device_info_t for more details.
2975 * This API provides searching options like max responses, discovery duration in seconds and class
2976 * of device mask to filter device search. some times there may be too many bluetooth devices in
2977 * vicinity of your device.in such scenario, application can request to reduce number of responces
2978 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2979 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2980 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2981 * application defined time. please note that discovery_duration should be mentioned in seconds.
2982 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2985 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2986 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2987 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2989 * This function is a asynchronous call.
2990 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2991 * through registered callback function.
2993 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2994 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2996 * The completion or cancellation of the discovery is indicated by an
2997 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2999 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
3002 * @return BLUETOOTH_ERROR_NONE - Success \n
3003 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3004 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3005 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3006 agent is not running \n
3008 * @param[in] max_response define the maximum response of the number of founded devices
3010 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3011 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3012 (refer to class of device)
3014 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3017 void bt_event_callback(int event, bluetooth_event_param_t *param)
3021 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
3023 bluetooth_device_info_t *device_info = NULL;
3024 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3026 device_info = (bluetooth_device_info_t *)param->param_data;
3027 memcpy(&searched_device, &device_info->device_address,
3028 sizeof(bluetooth_device_address_t));
3029 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3030 device_info->device_address.addr[0],
3031 device_info->device_address.addr[1],
3032 device_info->device_address.addr[2],
3033 device_info->device_address.addr[3],
3034 device_info->device_address.addr[4],
3035 device_info->device_address.addr[5]);
3038 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
3040 bluetooth_device_info_t *device_info = NULL;
3041 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
3043 device_info = (bluetooth_device_info_t *)param->param_data;
3044 memcpy(&searched_device, &device_info->device_address,
3045 sizeof(bluetooth_device_address_t));
3046 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3047 device_info->device_name.name,
3048 device_info->device_address.addr[0],
3049 device_info->device_address.addr[1],
3050 device_info->device_address.addr[2],
3051 device_info->device_address.addr[3],
3052 device_info->device_address.addr[4],
3053 device_info->device_address.addr[5]);
3057 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3058 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3063 unsigned short max_response;
3064 unsigned short discovery_duration;
3065 unsigned classOfDeviceMask;
3069 discovery_duration =0;
3070 classOfDeviceMask =0;
3072 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
3077 int bluetooth_start_discovery(unsigned short max_response,
3078 unsigned short discovery_duration,
3079 unsigned int classOfDeviceMask);
3082 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
3083 * unsigned short max_response,
3084 * unsigned short discovery_duration,
3085 * unsigned int classOfDeviceMask)
3086 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
3088 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
3089 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
3090 * Please see bluetooth_start_discovery() for other parameters description.
3092 * This function is a asynchronous call.
3093 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
3094 * through registered callback function.
3096 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
3097 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
3099 * The completion or cancellation of the discovery is indicated by an
3100 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
3102 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
3105 * @return BLUETOOTH_ERROR_NONE - Success \n
3106 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3107 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3108 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
3109 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3110 agent is not running \n
3112 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
3113 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
3114 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
3115 * @param[in] max_response define the maximum response of the number of founded devices
3117 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3118 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3119 (refer to class of device)
3121 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3124 unsigned short type;
3125 unsigned short max_response;
3126 unsigned short discovery_duration;
3127 unsigned classOfDeviceMask;
3132 discovery_duration =0;
3133 classOfDeviceMask =0;
3135 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3140 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3141 unsigned short max_response,
3142 unsigned short discovery_duration,
3143 unsigned int classOfDeviceMask);
3146 * @fn int bluetooth_cancel_discovery (void)
3147 * @brief Cancel the on-going device discovery operation
3150 * This function stops the on-going device discovery operation. This API has to be called after the
3151 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3152 * the bluetooth_start_discovery API
3154 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3155 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3156 * cancel the discover request once the user received the device to which he wish to connect.
3158 * This function is a asynchronous call.
3159 * If the call is success to cancel discovey then the application will receive
3160 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3161 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3162 * BLUETOOTH_ERROR_NONE
3165 * @return BLUETOOTH_ERROR_NONE - Success \n
3166 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3167 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3168 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3169 other application \n
3170 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3172 * @see bluetooth_start_discovery
3174 void bt_event_callback(int event, bluetooth_event_param_t *param)
3178 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3179 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3188 ret = bluetooth_cancel_discovery();
3191 int bluetooth_cancel_discovery(void);
3194 * @fn int bluetooth_start_le_discovery(void)
3195 * @brief Start the generic device discovery which finds the LE devices.
3197 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3198 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3199 * It try to find LE devices. Bluetooth device address and name are
3200 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3201 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3202 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3203 * please see bluetooth_device_info_t for more details.
3205 * This function is a asynchronous call.
3206 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3207 * through registered callback function.
3209 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3212 * The completion or cancellation of the discovery is indicated by an
3213 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3215 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3218 * @return BLUETOOTH_ERROR_NONE - Success \n
3219 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3220 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3221 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3222 agent is not running \n
3225 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3228 void bt_event_callback(int event, bluetooth_event_param_t *param)
3232 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3234 bluetooth_device_info_t *device_info = NULL;
3235 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3237 device_info = (bluetooth_device_info_t *)param->param_data;
3238 memcpy(&searched_device, &device_info->device_address,
3239 sizeof(bluetooth_device_address_t));
3240 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3241 device_info->device_address.addr[0],
3242 device_info->device_address.addr[1],
3243 device_info->device_address.addr[2],
3244 device_info->device_address.addr[3],
3245 device_info->device_address.addr[4],
3246 device_info->device_address.addr[5]);
3250 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3251 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3257 ret = bluetooth_start_discovery();
3262 int bluetooth_start_le_discovery(void);
3265 * @fn int bluetooth_stop_le_discovery (void)
3266 * @brief Cancel the on-going device LE discovery operation
3269 * This function stops the on-going device discovery operation. This API has to be called after the
3270 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3271 * the bluetooth_start_le_discovery API
3274 * This function is a asynchronous call.
3275 * If the call is success to cancel discovey then the application will receive
3276 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3277 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3278 * BLUETOOTH_ERROR_NONE
3281 * @return BLUETOOTH_ERROR_NONE - Success \n
3282 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3283 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3284 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3285 other application \n
3286 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3288 * @see bluetooth_start_discovery
3290 void bt_event_callback(int event, bluetooth_event_param_t *param)
3294 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3295 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3304 ret = bluetooth_stop_le_discovery();
3307 int bluetooth_stop_le_discovery(void);
3310 * @fn int bluetooth_is_discovering(void)
3311 * @brief Check for the device discovery is in-progress or not.
3313 * This API is used to check the current status of the Discovery operation.If discovery is in\
3314 * progress normally other operations are not allowed.
3315 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3316 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3317 * event before performing other operations. This API is used to get for the current discovery
3318 * operation status and using bluetooth_cancel_discovery()
3319 * we can cancell the ongoing discovery process.
3320 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3323 * This function checks whether the device discovery is started or not.
3325 * This function is a synchronous call.
3328 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3329 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3330 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3333 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3337 ret = bluetooth_is_discovering ();
3340 int bluetooth_is_discovering(void);
3343 * @fn int bluetooth_is_le_discovering(void)
3344 * @brief Check for the device LE discovery is in-progress or not.
3346 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3347 * progress normally other operations are not allowed.
3348 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3349 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3350 * event before performing other operations. This API is used to get for the current discovery
3351 * operation status and using bluetooth_stop_le_discovery()
3352 * we can cancell the ongoing LE discovery process.
3353 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3356 * This function checks whether the device LE discovery is started or not.
3358 * This function is a synchronous call.
3361 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3362 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3363 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3366 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3370 ret = bluetooth_is_le_discovering ();
3373 int bluetooth_is_le_discovering(void);
3376 * @fn int bluetooth_is_le_scanning(void)
3377 * @brief Check for the device LE scan is in-progress or not.
3379 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3380 * progress normally other operations are not allowed.
3382 * This function checks whether the device LE Scan is started or not.
3384 * This function is a synchronous call.
3386 * @return TRUE - LE Scan in progress \n
3387 * FALSE - LE Scan is not in progress \n
3392 gboolean is_le_scanning = 0;
3393 is_le_scanning = bluetooth_is_le_scanning ();
3396 gboolean bluetooth_is_le_scanning(void);
3398 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3401 * @fn int bluetooth_force_hcidump(int timeout)
3402 * @brief Enable /disable force-hcidump
3404 * This function control force-hcidump.
3406 * This function is a synchronous call.
3408 * @return BLUETOOTH_ERROR_NONE - Success \n
3409 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3410 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3412 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3417 int bluetooth_force_hcidump(int timeout);
3420 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3421 * @brief Register scan filter.
3423 * This function registers the scan filter.
3425 * This function is a synchronous call.
3427 * @return BLUETOOTH_ERROR_NONE - Success \n
3429 * @param[in] filter scan filter to register
3433 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3436 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3437 int link_type, bt_rssi_threshold_t rssi_threshold)
3438 * @brief Enable RSSI monitoring
3440 * This function enables RSSI monitoring and sets threshold for a connection
3442 * @return BLUETOOTH_ERROR_NONE - Success \n
3445 * @see bluetooth_get_rssi_strength
3447 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3448 int link_type, bt_rssi_threshold_t *rssi_threshold);
3451 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3452 * @brief Gets Raw RSSI signal Strength
3454 * This function gives the Raw RSSI signal strength for a connection.
3456 * @return BLUETOOTH_ERROR_NONE - Success \n
3459 * @see bluetooth_enable_rssi
3461 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3463 int bluetooth_set_connectable(gboolean is_connectable);
3465 int bluetooth_is_connectable(gboolean *is_connectable);
3467 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3470 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3471 * @brief Initiate a bonding process
3474 * This function initiates a bonding procedure with a peer device. The bonding procedure
3475 * enables authentication and optionally encryption on the Bluetooth link.
3477 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3478 * inititate the bonding request to the devices already in the paired list.
3480 * Usually we call this API after the device discovery.
3481 * This function is a asynchronous call.
3483 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3484 * mentioed result code
3485 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3486 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3487 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3488 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3489 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3491 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3492 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3495 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3498 * @return BLUETOOTH_ERROR_NONE - Success \n
3499 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3500 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3501 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3502 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3504 * @param[in] device_address This indicates an address of the device with which the pairing
3505 * should be initiated
3507 * @see bluetooth_cancel_bonding
3509 void bt_event_callback(int event, bluetooth_event_param_t *param)
3513 case BLUETOOTH_EVENT_BONDING_FINISHED:
3515 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3516 if (param->result >= BLUETOOTH_ERROR_NONE)
3518 bluetooth_device_info_t *device_info = NULL;
3519 device_info = (bluetooth_device_info_t *)param->param_data;
3520 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3521 mjr[%#x] min[%#x] srv[%#x]",
3522 device_info->device_name.name,
3523 device_info->device_address.addr[0],
3524 device_info->device_address.addr[1],
3525 device_info->device_address.addr[2],
3526 device_info->device_address.addr[3],
3527 device_info->device_address.addr[4],
3528 device_info->device_address.addr[5],
3529 device_info->device_class.major_class,
3530 device_info->device_class.minor_class,
3531 device_info->device_class.service_class);
3545 bluetooth_device_address_t device_address={{0}};
3547 ret = bluetooth_bond_device(&device_address);
3551 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3554 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3555 * bluetooth_conn_type_t conn_type)
3556 * @brief Initiate a bonding process
3559 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3560 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3562 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3563 * inititate the bonding request to the devices already in the paired list.
3565 * Usually we call this API after the device discovery.
3566 * This function is a asynchronous call.
3568 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3569 * mentioed result code
3570 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3571 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3572 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3573 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3574 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3576 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3577 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3580 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3583 * @return BLUETOOTH_ERROR_NONE - Success \n
3584 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3585 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3586 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3587 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3589 * @param[in] device_address This indicates an address of the device with which pairing
3590 * should be initiated
3591 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3594 * @see bluetooth_cancel_bonding
3596 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3597 bluetooth_conn_type_t conn_type);
3600 * @fn int bluetooth_cancel_bonding(void)
3601 * @brief Cancel the on-going bonding process
3603 * This API is called to cancel the on-going bonding procedure. It should be called before the
3604 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3605 * This API is useful when the remote device is not responding to the bond request or we wish to
3606 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3608 * This function is a synchronous call.
3610 * @return BLUETOOTH_ERROR_NONE - Success \n
3611 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3612 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3615 * @see bluetooth_bond_device
3621 ret = bluetooth_cancel_bonding();
3624 int bluetooth_cancel_bonding(void);
3627 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3628 * @brief Remove bonding
3631 * To communicate with remote device over bluetooth link, user should bond with peer device.
3632 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3633 * API is used to remove peer device from the list. Please note that after removing the device
3634 * from bonded device list, you cannot communication with peer device until bonding happens again.
3636 * User can call this function by passing bluetooth device address of any bonded device. Please note
3637 * that after successful return of this function, any bluetooth application running on your device
3638 * will not be able to communicate with unbonded device until bond operation happens again using
3639 * bluetooth_bond_device()
3642 * This function is a asynchronous call. The request to remove the specified device from the bonded
3643 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3644 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3645 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3649 * @return BLUETOOTH_ERROR_NONE - Success \n
3650 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3651 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3652 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3653 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3654 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3655 * agent is not running \n
3656 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3659 * @param[in] device_address This indicates an address of the device to remove bonding
3663 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3666 void bt_event_callback(int event, bluetooth_event_param_t *param)
3669 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3670 bluetooth_device_address_t *dev_addr = NULL;
3672 if (param->result == BLUETOOTH_ERROR_NONE) {
3673 dev_addr = (bluetooth_device_address_t *)param->param_data;
3675 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3676 dev_addr->addr[0], dev_addr->addr[1]
3677 dev_addr->addr[2], dev_addr->addr[3]
3678 dev_addr->addr[4], dev_addr->addr[5]
3689 bluetooth_device_address_t *device_address;
3691 // copy valid device address in device_address
3693 ret = bluetooth_unbond_device(device_address);
3696 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3699 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3700 * @brief Get bonded(paired) device list
3703 * This API gets all bonded device list.
3704 * The devices in the bonded device list further can be used to perform the authorization by calling
3705 * bluetooth_authorize_device API.
3707 * This function is a synchronous call.
3708 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3709 * there is no valid information in the dev_list.
3710 * The len field in the dev_list represents the number of bonded devices. The data structure for
3711 * bonded device information is bluetooth_device_info_t.
3714 * @return BLUETOOTH_ERROR_NONE - Success \n
3715 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3717 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3719 void bt_get_bonded_devices(void)
3723 GPtrArray *devinfo = NULL;
3724 bluetooth_device_info_t *ptr;
3726 // allocate the g_pointer_array
3727 devinfo = g_ptr_array_new();
3729 ret = bluetooth_get_bonded_device_list(&devinfo);
3730 if (ret != BLUETOOTH_ERROR_NONE)
3732 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3736 printf("g pointer arrary count : [%d]", devinfo->len);
3737 for (i=0; i<devinfo->len; i++)
3739 ptr = g_ptr_array_index(devinfo, i);
3742 printf("Name [%s]\n", ptr->device_name.name);
3743 printf("Major Class [%d]\n", ptr->device_class.major_class);
3744 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3745 printf("Service Class [%d]\n", ptr->device_class.service_class);
3746 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3747 ptr->device_address.addr[0],
3748 ptr->device_address.addr[1], ptr->device_address.addr[2],
3749 ptr->device_address.addr[3],
3750 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3757 // free g_pointer_array
3758 g_ptr_array_free(devinfo, TRUE);
3763 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3765 int bluetooth_get_profile_connected_device_list(
3766 const char *profile_uuid, GPtrArray **addr_list);
3769 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3770 * bluetooth_device_info_t *dev_info)
3771 * @brief Get a bonded(paired) device
3774 * This API gets a bonded device.
3776 * This function is a synchronous call.
3777 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3778 * there is no valid information in the dev_info.
3779 * The data structure for bonded device information is bluetooth_device_info_t.
3782 * @return BLUETOOTH_ERROR_NONE - Success \n
3783 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3785 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3787 void bt_get_bonded_device(void)
3791 bluetooth_device_info_t devinfo = {0};
3792 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3794 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3795 if (ret != BLUETOOTH_ERROR_NONE)
3797 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3801 printf("Name [%s]\n", devinfo.device_name.name);
3802 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3803 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3804 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3805 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3806 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3807 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3808 devinfo.device_address.addr[5]);
3817 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3818 bluetooth_device_info_t *dev_info);
3821 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3822 * gboolean *is_alias_set)
3823 * @brief Get is_alias_set property of device
3825 * This API gets is_alias_set property of a bonded device.
3827 * This function is a synchronous call.
3828 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3829 * If not,there is no valid information in the is_alias_set.
3831 * @return BLUETOOTH_ERROR_NONE - Success \n
3832 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3837 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3839 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3842 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3843 gboolean *is_alias_set);
3846 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3847 * @brief set alias for bonded device
3850 * This function set alias for bonded device.
3852 * This function is a synchronous call.
3855 * @return BLUETOOTH_ERROR_NONE - Success \n
3856 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3857 * @param[in] device_address This indicates an address of the remote device
3858 * @param[in] alias This indicates an alias to set
3863 ret = bluetooth_set_alias(&remote_address);
3866 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3870 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3871 * @brief Get remote deivice
3874 * This function gets specific remote device.
3876 * This function is a asynchronous call.
3877 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3880 * @return BLUETOOTH_ERROR_NONE - Success \n
3881 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3882 * @param[in] device_address This indicates an address of the remote device
3887 ret = bluetooth_get_remote_device(&remote_address);
3890 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3893 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3894 * gboolean authorized)
3895 * @brief Authorize/Unauthorize a bonded device
3898 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3899 * with/without user confirmation.
3901 * If we select a paired device and make it authorized by calling this API with the authorized
3902 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3903 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3904 * then it will ask for the user conformation before the connection.
3906 * This API supposed to be called on the paired devices. Which means we have to use this API only
3907 * after successful pairing.
3909 * This function is a asynchronous call.
3910 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3912 * @return BLUETOOTH_ERROR_NONE - Success \n
3913 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3914 * @param[in] device_address This indicates an address of the device to authorize \n
3915 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3917 * @see bluetooth_get_bonded_device_list
3919 void bt_event_callback(int event, bluetooth_event_param_t *param)
3923 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3925 if (param->result == BLUETOOTH_ERROR_NONE)
3929 //device authorization failed failure
3937 bluetooth_device_address_t device_address={{0}};
3938 gboolean authorized;
3942 ret = bluetooth_authorize_device(&device_address,authorized);
3945 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3946 gboolean authorized);
3948 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3949 const bluetooth_device_pin_code_t *pin_code);
3951 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3954 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3956 * @brief Receives Legacy Passkey\pin with following authentication response types
3958 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3959 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3962 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3965 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3967 * @brief This API sends user confirmation reply to the local adapter.
3969 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3972 int bluetooth_passkey_confirmation_reply(gboolean reply);
3975 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3976 * @brief Get all services supported by remote device
3979 * This API call initiates the search for the services supported by the specified device. Normally
3980 * the service search will take a couple of seconds to get it completed. Before calling this API
3981 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3982 * perform the service search. We can get the device address by doing a device discovery operation.
3985 * This function is a asynchronous call.
3986 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3988 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3989 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3990 * event is generated with appropriate result code.
3992 * @return BLUETOOTH_ERROR_NONE - Success \n
3993 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3994 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3995 * @param[in] device_address This indicates an address of the device
3996 * whose services need to be found
3998 * @see bluetooth_cancel_service_search
4000 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
4003 * @fn int bluetooth_cancel_service_search(void)
4004 * @brief Cancel the ongoing service search operation
4007 * This function cancel the ongoing service search operation. This API is usually calling after the
4008 * bluetooth_search_service API.
4009 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
4010 * if the user wish to cancel the Ongoing service search operation.
4012 * This API should be called just after the bluetooth_search_service API and before the
4013 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
4015 * This function is a synchronous call.
4017 * @return BLUETOOTH_ERROR_NONE - Success \n
4018 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
4019 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
4020 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
4023 * @see bluetooth_search_service
4028 ret = bluetooth_cancel_service_search();
4031 int bluetooth_cancel_service_search(void);
4034 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
4035 * @brief Register rfcomm socket with a specific uuid
4038 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4039 * descriptor of the server.
4040 * This is the first API which is called to create the server. Once we created the server socket,
4041 * we will listen on that return socket.
4042 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
4045 * @return socket FD on Success \n
4046 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4047 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4048 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4049 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4050 * @param[in] UUID (128 bits)
4053 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
4057 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4058 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4062 int bluetooth_rfcomm_create_socket(const char *uuid);
4065 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
4066 * @brief Register rfcomm socket with a specific uuid
4069 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4070 * descriptor of the server.
4071 * This is the first API which is called to create the server. Once we created the server socket,
4072 * we will listen on that return socket.
4073 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
4076 * @return socket FD on Success \n
4077 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4078 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4079 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4080 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4081 * @param[in] UUID (128 bits)
4082 * @param[in] bus_name (const char)
4083 * @param[in] path (const char)
4086 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
4090 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4091 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
4095 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
4098 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
4099 * @brief De-register the rfcomm socket
4102 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
4103 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4104 * descriptor else no event will come. We will call this API only after the
4105 * bluetooth_rfcomm_listen_and_accept.
4106 * This is a synchronous call.
4108 * @return BLUETOOTH_ERROR_NONE - Success \n
4109 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4110 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4111 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4112 * @param[in] int socket_fd
4115 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
4118 void bt_event_callback(int event, bluetooth_event_param_t *param)
4122 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4124 bluetooth_rfcomm_connection_t *discon_ind =
4125 (bluetooth_rfcomm_connection_t *)param->param_data;
4127 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4135 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4136 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4138 ret = bluetooth_rfcomm_remove_socket(fd);
4141 int bluetooth_rfcomm_remove_socket(int socket_fd);
4144 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4145 * @brief De-register the rfcomm socket
4148 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4149 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4150 * descriptor else no event will come. We will call this API only after the
4151 * bluetooth_rfcomm_listen_and_accept_ex.
4152 * This is a synchronous call.
4154 * @return BLUETOOTH_ERROR_NONE - Success \n
4155 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4156 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4157 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4158 * @param[in] UUID (128 bits)
4161 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4164 void bt_event_callback(int event, bluetooth_event_param_t *param)
4168 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4170 bluetooth_rfcomm_connection_t *discon_ind =
4171 (bluetooth_rfcomm_connection_t *)param->param_data;
4173 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4181 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4182 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4184 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4187 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4190 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4191 * @brief Disconnect rfcomm connection
4194 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4195 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4198 * @return BLUETOOTH_ERROR_NONE - Success \n
4199 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4200 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4201 * @param[in] int socket_fd the sending socket fd
4207 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4209 printf("Disconnection failed");
4211 printf("Disconnection Success");
4215 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4218 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4219 * @brief Rfcomm socket listen
4222 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4223 * after the bluetooth_rfcomm_create_socket API.
4224 * This API listen for the incomming connection and once it receives a connection, it will give
4225 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4226 * event to the application. This is an Asynchronous API call.
4229 * @return BLUETOOTH_ERROR_NONE - Success \n
4230 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4231 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4233 * @param[in] int socket_fd
4234 * @param[in] max pending connection.
4237 * @see bluetooth_rfcomm_create_socket
4240 void bt_event_callback(int event, bluetooth_event_param_t* param)
4244 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4246 bluetooth_rfcomm_connection_t *conn_ind =
4247 (bluetooth_rfcomm_connection_t *)param->param_data;
4249 printf("\nConnected from FD %d", conn_ind->socket_fd);
4257 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4258 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4262 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4265 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4266 * @brief Rfcomm socket listen
4269 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4270 * after the bluetooth_rfcomm_create_socket API.
4271 * This API listen for the incomming connection and once it receives a connection, it will give
4272 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4273 * event to the application. This is an Asynchronous API call.
4276 * @return BLUETOOTH_ERROR_NONE - Success \n
4277 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4278 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4280 * @param[in] int socket_fd
4281 * @param[in] max pending connection.
4286 * @see bluetooth_rfcomm_create_socket_ex
4289 void bt_event_callback(int event, bluetooth_event_param_t* param)
4293 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4295 bluetooth_rfcomm_connection_t *conn_ind =
4296 (bluetooth_rfcomm_connection_t *)param->param_data;
4298 printf("\nConnected from FD %d", conn_ind->socket_fd);
4306 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4307 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4312 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4315 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4316 * @brief Rfcomm socket listen
4319 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4320 * after the bluetooth_rfcomm_create_socket API.
4321 * This API listen for the incomming connection and once it receives a connection, it will give
4322 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4323 * event to the application. This is an Asynchronous API call.
4326 * @return BLUETOOTH_ERROR_NONE - Success \n
4327 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4328 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4330 * @param[in] int socket_fd
4331 * @param[in] max pending connection.
4334 * @see bluetooth_rfcomm_create_socket
4337 void bt_event_callback(int event, bluetooth_event_param_t* param)
4341 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4343 char *name = (char *)param->param_data;
4345 printf("\nConnected from %s", name);
4347 bluetooth_rfcomm_accept_connection();
4355 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4356 ret = bluetooth_rfcomm_listen(fd, 1);
4360 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4363 * @fn int bluetooth_rfcomm_accept_connection()
4364 * @brief Accepts the authorization request indicated by the event
4365 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4367 * This function is a synchronous call.
4369 * @return BLUETOOTH_ERROR_NONE - Success \n
4370 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4372 * @param[in] the socket fd of the server
4373 * @param[out] the socket fd of the client
4377 * @see bluetooth_rfcomm_reject_connection
4379 int bluetooth_rfcomm_accept_connection(int server_fd);
4382 * @fn int bluetooth_rfcomm_reject_connection()
4383 * @brief Rejects the authorization request indicated by the event
4384 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4386 * This function is a synchronous call.
4388 * @return BLUETOOTH_ERROR_NONE - Success \n
4389 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4391 * @param[in] the socket fd of the server
4395 * @see bluetooth_rfcomm_accept_connection
4397 int bluetooth_rfcomm_reject_connection(int server_fd);
4400 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4401 * @brief Informs whether rfcomm server uuid is available or not.
4403 * This function is a synchronous call.
4405 * @return TRUE - RFCOMM uuid is available \n
4406 * FALSE - RFCOMM uuid is not available \n
4408 * @param[in] uuid UUID string
4414 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4417 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4418 * const char *remote_uuid)
4419 * @brief Connect to the remote device rfcomm *
4421 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4422 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4423 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4424 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4425 * initiating a connection.
4427 * @return BLUETOOTH_ERROR_NONE - Success \n
4428 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4429 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4430 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4431 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4432 * @param[in] bluetooth_device_address_t remote bt_address
4433 * @param[in] char remote uuid
4435 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4439 void bt_event_callback(int event, bluetooth_event_param_t *param)
4443 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4445 if (param->result >= BLUETOOTH_ERROR_NONE)
4447 bt_sdp_info_t *bt_sdp_info=param->param_data;
4449 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4450 bt_sdp_info->device_addr.addr[0],
4451 bt_sdp_info->device_addr.addr[1],
4452 bt_sdp_info->device_addr.addr[2],
4453 bt_sdp_info->device_addr.addr[3],
4454 bt_sdp_info->device_addr.addr[4],
4455 bt_sdp_info->device_addr.addr[5]);
4457 printf("Supported service list:\n");
4458 for(i=0; i<bt_sdp_info->service_index; i++)
4460 bt_sdp_info->service_list_array[i]);
4463 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4464 //rfcomm_test_uuid);
4468 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4470 bluetooth_rfcomm_connection_t *conn_ind =
4471 (bluetooth_rfcomm_connection_t *)param->param_data;
4473 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4474 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4475 "SERVER" : "CLIENT");
4480 bluetooth_device_address_t remote_address = {{0},};
4481 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4482 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4483 ret = bluetooth_search_service(&remote_address);
4485 printf("Seach failed, Reason = %d", ret);
4487 printf("Search Success, Ret = %d", ret);
4489 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4491 printf("Connection failed, Reason = %d", ret);
4493 printf("Connection Success, Ret = %d", ret);
4497 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4498 const char *remote_uuid);
4501 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4502 * @brief Disconnect rfcomm connection
4505 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4506 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4509 * @return BLUETOOTH_ERROR_NONE - Success \n
4510 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4511 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4512 * @param[in] char remote bt_address
4515 * @see bluetooth_rfcomm_connect
4519 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4521 printf("Disconnection failed");
4523 printf("Disconnection Success");
4528 int bluetooth_rfcomm_disconnect(int socket_fd);
4531 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4532 * @brief Write to rfcomm connection
4535 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4536 * API is used to send the data for server and the client.
4538 * @return BLUETOOTH_ERROR_NONE - Success \n
4539 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4540 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4542 * @param[in] const char *buff Data buffer to send
4543 * @param[in] int length Length of the data
4546 * @see bluetooth_rfcomm_connect
4549 char *buff = "Test data 123456789"
4550 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4552 printf("Send failed");
4554 printf("Send success");
4558 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4561 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4562 * @brief Informs whether rfcomm client is connected.
4564 * This function is a synchronous call.
4566 * @return TRUE - RFCOMM client is connected \n
4567 * FALSE - RFCOMM client is not connected \n
4573 gboolean bluetooth_rfcomm_is_client_connected(void);
4574 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4575 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4578 * @fn int bluetooth_network_activate_server(void)
4579 * @brief Activate the NAP (Network Access Point) service
4581 * This function is a asynchronous call.
4582 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4584 * @return BLUETOOTH_ERROR_NONE - Success \n
4585 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4586 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4587 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4590 * @see bluetooth_network_deactivate_server
4593 int bluetooth_network_activate_server(void);
4596 * @fn int bluetooth_network_deactivate_server(void)
4597 * @brief Deactivate the NAP (Network Access Point) service
4599 * This function is a asynchronous call.
4600 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4602 * @return BLUETOOTH_ERROR_NONE - Success \n
4603 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4604 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4605 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4608 * @see bluetooth_network_activate_server
4611 int bluetooth_network_deactivate_server(void);
4614 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4615 * bluetooth_network_role_t role,
4617 * @brief Connect the network server in the peer
4619 * This function is a asynchronous call.
4620 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4622 * @return BLUETOOTH_ERROR_NONE - Success \n
4623 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4624 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4625 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4628 * @param[in] device_address This indicates an address of the device with which the pairing
4629 * should be initiated
4630 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4631 * need to use the third parameter.
4632 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4633 * connect. UUID string
4635 * @see bluetooth_network_disconnect
4637 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4638 bluetooth_network_role_t role, char *custom_uuid);
4641 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4642 * bluetooth_network_role_t role,
4643 * char *custom_uuid)
4644 * @brief Connect the network server in the peer
4646 * This function is a asynchronous call.
4647 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4649 * @return BLUETOOTH_ERROR_NONE - Success \n
4650 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4651 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4652 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4655 * @param[in] device_address This indicates an address of the device with which the pairing
4656 * should be initiated
4658 * @see bluetooth_network_connect
4660 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4663 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4664 * @brief Disconnect the device from the network
4666 * This function is an asynchronous call.
4667 * The network server disconnect request is responded by
4668 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4670 * @return BLUETOOTH_ERROR_NONE - Success \n
4671 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4672 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4673 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4676 * @param[in] device_address This indicates an address of the connected client device
4678 * @see bluetooth_network_activate_server
4680 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4685 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4686 * bt_hdp_role_type_t role,
4687 * bt_hdp_qos_type_t channel_type,
4688 * char **app_handle)
4689 * @brief Activate the HDP service for a particular data type
4691 * This function is a synchronous call.
4693 * @return BLUETOOTH_ERROR_NONE - Success \n
4694 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4695 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4696 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4699 * @param[in] data_type The data type against corresponding service
4700 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4701 * @param[in] channel_type The QOS type for the channel.
4702 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4703 * For role = HDP_ROLE_SINK, the channel_type
4704 * should be HDP_QOS_ANY.
4705 * @param[out] app_handle The application handler against corresponding service
4707 * @see bluetooth_hdp_deactivate
4709 int bluetooth_hdp_activate(unsigned short data_type,
4710 bt_hdp_role_type_t role,
4711 bt_hdp_qos_type_t channel_type,
4714 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4715 * @brief Deactivate the HDP service for a particular service using the handler
4717 * This function is a synchronous call.
4719 * @return BLUETOOTH_ERROR_NONE - Success \n
4720 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4721 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4722 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4725 * @param[in] app_handle The application handler against corresponding service
4727 * @see bluetooth_hdp_deactivate
4729 int bluetooth_hdp_deactivate(const char *app_handle);
4732 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4733 * const char *buffer, unsigned int size)
4734 * @brief Send data to the remote HDP device
4736 * This function is a synchronous call.
4738 * @return BLUETOOTH_ERROR_NONE - Success \n
4739 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4740 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4741 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4742 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4745 * @param[in] channel_id The channel id for the connection.
4746 * @param[in] buffer The pdu buffer.
4747 * @param[in] size Size of the buffer.
4749 * @see bluetooth_hdp_connect
4751 int bluetooth_hdp_send_data(unsigned int channel_id,
4752 const char *buffer, unsigned int size);
4754 * @fn int bluetooth_hdp_connect(const char *app_handle,
4755 * bt_hdp_qos_type_t channel_type,
4756 * const bluetooth_device_address_t *device_address)
4757 * @brief Connect to the remote device(Mainly used by source)
4759 * This function is a asynchronous call.
4760 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4762 * @return BLUETOOTH_ERROR_NONE - Success \n
4763 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4764 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4765 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4766 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4769 * @param[in] app_handle The application handler against corresponding service
4770 * @param[in] channel_type The QOS type for the channel.
4771 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4772 * @param[in] device_address The remote device Bd address.
4775 * @see bluetooth_hdp_disconnect
4777 int bluetooth_hdp_connect(const char *app_handle,
4778 bt_hdp_qos_type_t channel_type,
4779 const bluetooth_device_address_t *device_address);
4781 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4782 * const bluetooth_device_address_t *device_address)
4783 * @brief Disconnect from the remote device(Mainly used by source)
4785 * This function is a asynchronous call.
4786 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4788 * @return BLUETOOTH_ERROR_NONE - Success \n
4789 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4790 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4791 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4792 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4795 * @param[in] channel_id The channel id for the connection.
4796 * @param[in] device_address The remote device Bd address.
4799 * @see bluetooth_hdp_connect
4801 int bluetooth_hdp_disconnect(unsigned int channel_id,
4802 const bluetooth_device_address_t *device_address);
4806 * @fn int bluetooth_opc_init(void)
4807 * @brief Initialize OPP client.
4809 * This function is a synchronous call.
4810 * No event corresponding to this api
4812 * @return BLUETOOTH_ERROR_NONE - Success \n
4813 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4814 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4815 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4816 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4821 * @see bluetooth_opc_deinit
4823 int bluetooth_opc_init(void);
4826 * @fn int bluetooth_opc_deinit(void)
4827 * @brief Deinitialize OPP client.
4829 * This function is a synchronous call.
4830 * No event corresponding to this api
4832 * @return BLUETOOTH_ERROR_NONE - Success \n
4833 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4834 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4839 * @see bluetooth_opc_init
4842 int bluetooth_opc_deinit(void);
4845 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4846 char **file_name_array)
4847 * @brief Send multiple files to a remote device.
4849 * This function is a asynchronous call.
4850 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4852 * @return BLUETOOTH_ERROR_NONE - Success \n
4853 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4854 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4855 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4856 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4857 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4858 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4861 * @param[in] device_address The remote device Bd address.
4862 * @param[in] file_name_array Array of filepaths to be sent.
4865 * @see bluetooth_opc_cancel_push
4868 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4869 char **file_name_array);
4872 * @fn int bluetooth_opc_cancel_push(void)
4873 * @brief Cancels the ongoing file push.
4875 * This function is a asynchronous call.
4876 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4877 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4879 * @return BLUETOOTH_ERROR_NONE - Success \n
4880 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4881 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4886 * @see bluetooth_opc_push_files
4889 int bluetooth_opc_cancel_push(void);
4892 * @fn gboolean bluetooth_opc_session_is_exist(void)
4893 * @brief Informs whether opc session exists or not.
4895 * This function is a synchronous call.
4897 * @return TRUE - OPC session exists \n
4898 * FALSE - OPC session does not exist \n
4906 gboolean bluetooth_opc_session_is_exist(void);
4909 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4910 * @brief Informs whether opc session exists or not.
4912 * This function is a synchronous call.
4914 * @return BLUETOOTH_ERROR_NONE - Success \n
4915 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4916 * BLUETOOTH_ERROR_INTERNAL \n
4919 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4924 int bluetooth_opc_is_sending(gboolean *is_sending);
4927 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4928 int transfer_id, unsigned char *progress)
4929 * @brief Gets the percentage progress for ongoing transfers.
4931 * This function is a synchronous call.
4933 * @return BLUETOOTH_ERROR_NONE - Success \n
4934 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4935 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4938 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4939 * @param[in] transfer_id Transfer ID
4940 * @param[out] progress Percentage Progress
4944 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4945 int transfer_id, unsigned char *progress);
4948 * @fn int bluetooth_obex_server_init(const char *dst_path)
4949 * @brief Initialize OPP and FTP server.
4951 * This function is a synchronous call.
4952 * No event corresponding to this api
4954 * @return BLUETOOTH_ERROR_NONE - Success \n
4955 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4956 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4957 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4958 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4961 * @param[in] dst_path OPS destination file path.
4963 * @see bluetooth_obex_server_deinit
4965 int bluetooth_obex_server_init(const char *dst_path);
4969 * @fn int bluetooth_obex_server_deinit(void)
4970 * @brief Deinitialize OPP and FTP server.
4972 * This function is a synchronous call.
4973 * No event corresponding to this api
4975 * @return BLUETOOTH_ERROR_NONE - Success \n
4976 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4977 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4982 * @see bluetooth_obex_server_init
4984 int bluetooth_obex_server_deinit(void);
4988 * @fn gboolean bluetooth_obex_server_is_activated(void)
4989 * @brief Informs whether obex server is activated or not.
4991 * This function is a synchronous call.
4993 * @return TRUE - OBEX server is activated \n
4994 * FALSE - OBEX server is not activated \n
5001 gboolean bluetooth_obex_server_is_activated(void);
5005 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
5006 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
5008 * This function is a synchronous call.
5009 * No event corresponding to this api
5011 * @return BLUETOOTH_ERROR_NONE - Success \n
5012 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5013 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5014 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
5015 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5019 * @param[in] dst_path OPS destination file path.
5021 * @see bluetooth_obex_server_deinit_without_agent
5023 int bluetooth_obex_server_init_without_agent(const char *dst_path);
5027 * @fn int bluetooth_obex_server_deinit_without_agent(void)
5028 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
5030 * This function is a synchronous call.
5031 * No event corresponding to this api
5033 * @return BLUETOOTH_ERROR_NONE - Success \n
5034 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5035 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5040 * @see bluetooth_obex_server_init_without_agent
5042 int bluetooth_obex_server_deinit_without_agent(void);
5046 * @fn int bluetooth_obex_server_accept_connection(void)
5047 * @brief Accepts the authorization request indicated by the event
5048 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5050 * This function is a synchronous call.
5052 * @return BLUETOOTH_ERROR_NONE - Success \n
5053 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5054 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5058 * @see bluetooth_obex_server_reject_authorize
5060 int bluetooth_obex_server_accept_connection(void);
5064 * @fn int bluetooth_obex_server_reject_connection(void)
5065 * @brief Rejects the authorization request indicated by the event
5066 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5068 * This function is a synchronous call.
5070 * @return BLUETOOTH_ERROR_NONE - Success \n
5071 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5072 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5076 * @see bluetooth_obex_server_reject_authorize
5078 int bluetooth_obex_server_reject_connection(void);
5082 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
5083 * @brief Accepts the authorization request indicated by the event
5084 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5086 * This function is a asynchronous call.
5087 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
5089 * @return BLUETOOTH_ERROR_NONE - Success \n
5090 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5091 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5092 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5095 * @param[in] filename Authorized filename.
5098 * @see bluetooth_obex_server_reject_authorize
5101 int bluetooth_obex_server_accept_authorize(const char *filename);
5104 * @fn int bluetooth_obex_server_reject_authorize(void)
5105 * @brief Reject the authorization request indicated by the event
5106 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5108 * This function is a asynchronous call.
5109 * No event for this api..
5111 * @return BLUETOOTH_ERROR_NONE - Success \n
5112 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5113 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5118 * @see bluetooth_obex_server_accept_authorize
5121 int bluetooth_obex_server_reject_authorize(void);
5124 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5125 * @brief Set the OPS destination file path..
5127 * This function is a asynchronous call.
5128 * No event for this api..
5130 * @return BLUETOOTH_ERROR_NONE - Success \n
5131 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5132 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5133 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5136 * @param[in] dst_path OPS destination file path.
5142 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5145 * @fn int bluetooth_obex_server_set_root(const char *root)
5146 * @brief Set the FTS root folder..
5148 * This function is a asynchronous call.
5149 * No event for this api..
5151 * @return BLUETOOTH_ERROR_NONE - Success \n
5152 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5153 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5154 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5155 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5156 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5159 * @param[in] root FTS root folder.
5165 int bluetooth_obex_server_set_root(const char *root);
5168 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5169 * @brief Cancel the transfer on server
5171 * This function is an asynchronous call.
5172 * If the function call that cancels transfer is successful, the application would receive
5173 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5174 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5175 * the error code will be BLUETOOTH_ERROR_NONE
5177 * @return BLUETOOTH_ERROR_NONE - Success \n
5178 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5179 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5180 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5181 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5184 * @param[in] transfer_id transfer ID
5189 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5193 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5194 * @brief Cancel the transfer on server
5196 * This function is an asynchronous call.
5197 * If the function call that cancels transfer is successful, the application would receive
5198 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5199 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5200 * the error code will be BLUETOOTH_ERROR_NONE
5202 * @return BLUETOOTH_ERROR_NONE - Success \n
5203 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5204 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5205 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5206 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5213 int bluetooth_obex_server_cancel_all_transfers(void);
5217 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5218 * @brief Informs whether obex server is receiving or not.
5220 * This function is a synchronous call.
5222 * @return BLUETOOTH_ERROR_NONE - Success \n
5223 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5224 * BLUETOOTH_ERROR_INTERNAL \n
5227 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5232 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5236 * @fn int bluetooth_map_client_init(void)
5237 * @brief Initialize MAP client.
5239 * This function is a synchronous call.
5240 * No event corresponding to this api
5242 * @return BLUETOOTH_ERROR_NONE - Success \n
5243 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5244 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5245 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5246 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5251 * @see bluetooth_map_client_deinit
5253 int bluetooth_map_client_init(void);
5255 int bluetooth_map_client_deinit(void);
5257 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5259 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5261 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5263 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5264 bt_map_client_list_folders_filter_t *filter);
5267 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5268 * @brief Return all available fields that can be used in Fields filter.
5270 * This function is a asynchronous call.
5272 * @return BLUETOOTH_ERROR_NONE - Success \n
5273 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5274 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5277 * @param[in] session Information about session.
5280 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5282 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5284 bt_map_client_list_messages_filter_t *filter);
5286 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5288 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5289 const char *source_file,
5291 bt_map_client_push_message_args_t *args);
5293 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5294 const bt_map_client_message_object_t message_object,
5295 const char *target_file,
5300 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5301 * @brief Read the local Hash and Randmizer.
5303 * This function is a synchronous call.
5305 * @return BLUETOOTH_ERROR_NONE - Success \n
5306 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5310 * @param[out] local_oob_data - Pointer to the local OOB data
5316 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5320 * @fn int bluetooth_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 *oob_data)
5324 * @brief Add/updated the remote device Hash and Randmizer.
5326 * This function is a synchronous call.
5327 * No event for this api..
5329 * @return BLUETOOTH_ERROR_NONE - Success \n
5330 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5333 * @param[in] remote_device_address - Remote device address
5334 * address_type - bdaddr type
5335 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5341 int bluetooth_oob_add_remote_data(
5342 const bluetooth_device_address_t *remote_device_address,
5343 bluetooth_bdaddr_type_e address_type,
5344 bt_oob_data_t *remote_oob_data);
5348 * @fn int bluetooth_oob_remove_remote_data(
5349 * const bluetooth_device_address_t *remote_device_address)
5350 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5352 * This function is a synchronous call.
5353 * No event for this api..
5355 * @return BLUETOOTH_ERROR_NONE - Success \n
5356 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5359 * @param[in] remote_device_address - Remote device address
5365 int bluetooth_oob_remove_remote_data(
5366 const bluetooth_device_address_t *remote_device_address);
5370 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5371 * @brief Read the local Hash and Randmizer.
5373 * This function is a synchronous call.
5375 * @return BLUETOOTH_ERROR_NONE - Success \n
5376 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5380 * @param[out] local_oob_data - Pointer to the local OOB data
5385 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5388 * @fn int bluetooth_le_oob_add_remote_data(
5389 * const bluetooth_device_address_t *remote_device_address,
5390 * bluetooth_bdaddr_type_e address_type,
5391 * bt_oob_data_t *oob_data)
5392 * @brief Add/updated the remote device Hash and Randmizer.
5394 * This function is a synchronous call.
5395 * No event for this api..
5397 * @return BLUETOOTH_ERROR_NONE - Success \n
5398 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5401 * @param[in] remote_device_address - Remote device address
5402 * address_type - bdaddr type
5403 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5408 int bluetooth_le_oob_add_remote_data(
5409 const bluetooth_device_address_t *remote_device_address,
5410 bluetooth_bdaddr_type_e address_type,
5411 bt_oob_data_t *remote_oob_data);
5414 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5415 * bt_gatt_handle_info_t *prim_svc);
5417 * @brief Gets the GATT based primary services handle supported by remote device
5419 * This function is a synchronous call.
5420 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5422 * @return BLUETOOTH_ERROR_NONE - Success \n
5423 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5424 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5425 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5428 * @param[in] address - Remote device address
5429 * @param[out] prim_svc - Structure containing remote service count and handle list.
5432 * @see bluetooth_gatt_free_primary_services()
5434 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5435 bt_gatt_handle_info_t *prim_svc);
5438 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5440 * @brief Discovers the characteristics of GATT based service of remote device
5442 * This function is an asynchronous call.
5443 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5445 * @return BLUETOOTH_ERROR_NONE - Success \n
5446 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5447 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5448 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5451 * @param[in] service_handle - Handle for remote service.
5456 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5458 int bluetooth_gatt_set_service_change_watcher(
5459 const bluetooth_device_address_t *address, gboolean enable);
5462 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5463 * bt_gatt_service_property_t *service);
5465 * @brief Gets the properties of GATT based service of remote device
5467 * This function is a synchronous call.
5468 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5470 * @return BLUETOOTH_ERROR_NONE - Success \n
5471 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5472 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5473 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5476 * @param[in] service_handle - Handle for remote service.
5477 * @param[out] service - Structure containing remote service property.
5480 * @see bluetooth_gatt_free_service_property()
5482 int bluetooth_gatt_get_service_property(const char *service_handle,
5483 bt_gatt_service_property_t *service);
5486 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5488 * @brief Register to GATT based service to receive value change notification/indication.
5490 * This function is a synchronous call.
5491 * No event for this api.
5493 * @return BLUETOOTH_ERROR_NONE - Success \n
5494 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5495 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5496 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5499 * @param[in] service_handle - Handle for remote service.
5500 * @param[in] service_name - Friednly name of service uuid.
5505 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5508 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5510 * @brief Unregister GATT based service to receive value change notification/indication.
5512 * This function is a synchronous call.
5513 * No event for this api.
5515 * @return BLUETOOTH_ERROR_NONE - Success \n
5516 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5517 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5518 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5521 * @param[in] service_handle - Handle for remote service.
5526 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5529 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5530 * bt_gatt_char_property_t *characteristic);
5532 * @brief Provides characteristic value along with properties.
5534 * This function is a synchronous call.
5535 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5537 * @return BLUETOOTH_ERROR_NONE - Success \n
5538 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5539 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5540 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5543 * @param[in] char_handle - Handle for Characteristic property.
5544 * @param[out] characteristic - Structure containing remote characteristic property.
5547 * @see bluetooth_gatt_free_char_property()
5549 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5550 bt_gatt_char_property_t *characteristic);
5553 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5554 * bt_gatt_char_property_t *characteristic);
5556 * @brief Provides characteristic descriptor value along with its UUID.
5558 * This function is a synchronous call.
5559 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5561 * @return BLUETOOTH_ERROR_NONE - Success \n
5562 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5563 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5564 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5567 * @param[in] desc_handle - Handle for Characteristic descriptor.
5568 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5571 * @see bluetooth_gatt_free_desc_property()
5573 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5574 bt_gatt_char_descriptor_property_t *descriptor);
5578 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5579 * const guint8 *value, int length)
5581 * @brief Set characteristic value.
5583 * This function is a synchronous call.
5585 * @return BLUETOOTH_ERROR_NONE - Success \n
5586 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5587 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5588 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5591 * @param[in] char_handle - Handle for Characteristic property.
5592 * @param[in] value - New value to set for characteristic property.
5593 * @param[in] length - Length of the value to be set.
5598 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5599 const guint8 *value, int length);
5602 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5603 * const guint8 *value, int length, guint8 write_type)
5605 * @brief Set characteristic value by write type.
5607 * This function is a synchronous call if write type is "write without resonse"
5608 * and it is an asynchronous call if write type is "write with response"
5610 * @return BLUETOOTH_ERROR_NONE - Success \n
5611 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5612 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5613 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5616 * @param[in] char_handle - Handle for Characteristic property.
5617 * @param[in] value - New value to set for characteristic property.
5618 * @param[in] length - Length of the value to be set.
5619 * @param[in] write_type - Type of write.
5624 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5625 const guint8 *value, int length,
5626 guint8 write_type, gpointer app_data);
5630 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5631 * const guint8 *value, int length)
5633 * @brief Set characteristic value request.
5635 * This function is an asynchronous call.
5637 * @return BLUETOOTH_ERROR_NONE - Success \n
5638 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5639 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5640 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5643 * @param[in] char_handle - Handle for Characteristic property.
5644 * @param[in] value - New value to set for characteristic property.
5645 * @param[in] length - Length of the value to be set.
5650 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5651 const guint8 *value, int length);
5654 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5656 * @brief Read characteristic value.
5658 * This function is a asynchronous call.
5660 * @return BLUETOOTH_ERROR_NONE - Success \n
5661 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5662 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5663 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5666 * @param[in] char_handle - Handle for Characteristic property.
5671 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5674 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5675 * const char *service_uuid,
5676 * bt_gatt_service_property_t *service)
5678 * @brief Gets the service property from a device based on a particular uuid
5680 * This function is a synchronous call.
5682 * @return BLUETOOTH_ERROR_NONE - Success \n
5683 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5684 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5685 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5688 * @param[in] address - BD address of the remote device
5689 * @param[in] service_uuid - uuid of the service.
5690 * @param[out] service - Structure containing the service property.
5695 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5696 const char *service_uuid,
5697 bt_gatt_service_property_t *service);
5700 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5701 * const char *char_uuid)
5703 * @brief Gets the characteristic property from a service based on a particular char uuid
5705 * This function is an asynchronous call.
5706 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5708 * @return BLUETOOTH_ERROR_NONE - Success \n
5709 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5710 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5711 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5714 * @param[in] service_handle - Service handle.
5715 * @param[in] uuid - Characteristic uuid.
5720 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5721 const char *char_uuid);
5724 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5726 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5728 * This function is a synchronous call.
5729 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5731 * @return BLUETOOTH_ERROR_NONE - Success \n
5732 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5735 * @param[in] prim_svc - GATT handle info structure
5738 * @see bluetooth_gatt_get_primary_services()
5740 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5743 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5745 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5747 * This function is a synchronous call.
5748 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5750 * @return BLUETOOTH_ERROR_NONE - Success \n
5751 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5754 * @param[in] svc_pty - GATT service property structure.
5757 * @see bluetooth_gatt_get_service_property()
5759 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5762 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5764 * @brief Provides characteristic value along with properties.
5766 * This function is a synchronous call.
5767 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5769 * @return BLUETOOTH_ERROR_NONE - Success \n
5770 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5773 * @param[in] char_pty - GATT characteristics property structure.
5776 * @see bluetooth_gatt_get_characteristics_property()
5778 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5781 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5783 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5785 * This function is a synchronous call.
5786 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5788 * @return BLUETOOTH_ERROR_NONE - Success \n
5789 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5792 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5795 * @see bluetooth_gatt_get_char_descriptor_property()
5797 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5799 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5800 gboolean auto_connect, int client_id);
5802 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5805 int bluetooth_get_gatt_data_batching_available_packets(
5806 int *available_packets);
5808 int bluetooth_enable_gatt_data_batching(
5809 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5811 int bluetooth_disable_gatt_data_batching(
5812 const bluetooth_device_address_t *device_address);
5815 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5817 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5819 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5821 * @return BLUETOOTH_ERROR_NONE - Success \n
5822 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5825 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5829 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5832 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5834 * @brief Read characteristic descriptor value.
5836 * This function is a asynchronous call.
5838 * @return BLUETOOTH_ERROR_NONE - Success \n
5839 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5840 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5841 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5844 * @param[in] desc_handle - Handle for Characteristic descriptor
5849 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5852 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5853 * const guint8 *value, int length);
5855 * @brief Set characteristic descriptor value.
5857 * This function is a asynchronous call.
5859 * @return BLUETOOTH_ERROR_NONE - Success \n
5860 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5861 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5862 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5865 * @param[in] desc_handle - Handle for Characteristic descriptor
5866 * @param[in] value - New value to set for characteristic descriptor
5867 * @param[in] length - Length of the value to be set.
5872 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5873 const guint8 *value, int length, gpointer app_data);
5875 /* @fn int bluetooth_gatt_init(void)
5877 * @brief Initializes the gatt service.
5879 * This function is a synchronous call.
5880 * @return BLUETOOTH_ERROR_NONE - Success \n
5881 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5882 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5883 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5886 * @remark Adapter should be enabled
5887 * @see bluetooth_gatt_deinit()
5889 int bluetooth_gatt_init(void);
5891 /* @fn int bluetooth_gatt_init(void)
5893 * @brief DeInitializes the gatt service.
5895 * This function is a synchronous call.
5896 * @return BLUETOOTH_ERROR_NONE - Success \n
5897 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5898 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5899 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5902 * @remark Adapter should be enabled
5903 * @see bluetooth_gatt_init()
5905 int bluetooth_gatt_deinit(void);
5907 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5908 unsigned char **svc_path)
5910 * @brief Exports a new gatt service to the service interface.
5912 * This function is a synchronous call.
5914 * @return BLUETOOTH_ERROR_NONE - Success \n
5915 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5916 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5917 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5920 * @param[in] svc_uuid Gatt service uuid.
5921 * @param[out] svc_path service object path of the exported service.
5922 * @remark Adapter should be enabled
5923 * @see bluetooth_gatt_init()
5925 int bluetooth_gatt_add_service(const char *svc_uuid,
5928 /* @fn int bluetooth_gatt_add_new_characteristic(
5929 const char *svc_path, const char *char_uuid,
5930 bt_gatt_permission_t permissions,
5931 bt_gatt_characteristic_property_t properties,
5932 int flags_length, char **char_path);;
5934 * @brief Exports a new gatt characteristic to the characteristic interface.
5936 * This function is a synchronous call.
5937 * @return BLUETOOTH_ERROR_NONE - Success \n
5938 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5939 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5940 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5942 * @param[in] svc_path service object path of the exported service.
5943 * @param[in] char_uuid Gatt service uuid.
5944 * @param[in] properties GATT characteristic properties.
5945 * @param[out] char_path characteristic object path of the exported characteristic.
5947 * @remark Adapter should be enabled
5948 * @see bluetooth_gatt_add_service()
5950 int bluetooth_gatt_add_new_characteristic(
5951 const char *svc_path, const char *char_uuid,
5952 bt_gatt_permission_t permissions,
5953 bt_gatt_characteristic_property_t properties,
5956 /* @fn bluetooth_gatt_set_characteristic_value(
5957 const char *characteristic, const char *char_value,
5960 * @brief adds gatt charactertisic value to the given charactertistic path.
5962 * This function is a synchronous call.
5963 * @return BLUETOOTH_ERROR_NONE - Success \n
5964 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5965 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5966 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5968 * @param[in] char_value Value of the GATT characteristic to be added.
5969 * @param[in] value_length length of the chantacteristic value..
5970 * @param[out] characteristic characteristic object path..
5972 * @remark Adapter should be enabled
5973 * @see bluetooth_gatt_add_service()
5975 int bluetooth_gatt_set_characteristic_value(
5976 const char *characteristic, const char *char_value,
5979 /* @fn int bluetooth_gatt_add_descriptor(
5980 const char *char_path, const char *desc_uuid,
5981 bt_gatt_permission_t permissions,
5984 * @brief Exports a new gatt descriptor to the descriptor interface.
5986 * This function is a synchronous call.
5988 * @return BLUETOOTH_ERROR_NONE - Success \n
5989 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5990 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5991 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5994 * @param[in] desc_uuid Gatt descriptor uuid.
5995 * @param[in] desc_value GATT descriptor value.
5996 * @param[in] value_length Length of GATT descriptor value.
5997 * @param[in] permissions descriptor permissions.
5998 * @param[in] properties GATT descriptor properties.
5999 * @param[in] char_path characteristics object path of the exported character.
6001 * @remark Adapter should be enabled
6002 * @see bluetooth_gatt_add_service()
6003 * @see bluetooth_gatt_add_characteristics()
6005 int bluetooth_gatt_add_descriptor(
6006 const char *char_path, const char *desc_uuid,
6007 bt_gatt_permission_t permissions,
6010 /* @fn int bluetooth_gatt_set_descriptor_value(
6011 const char *desc_path, const char *desc_value,
6014 * @brief Adds value to the given descriptor handle.
6016 * This function is a synchronous call.
6018 * @return BLUETOOTH_ERROR_NONE - Success \n
6019 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6020 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6021 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6024 * @param[in] desc_value GATT descriptor value.
6025 * @param[in] value_length Length of GATT descriptor value.
6026 * @param[in] desc_path descriptor path to which the value needs to be added.
6028 * @remark Adapter should be enabled
6029 * @see bluetooth_gatt_add_service()
6030 * @see bluetooth_gatt_add_characteristics()
6032 int bluetooth_gatt_set_descriptor_value(
6033 const char *desc_path, const char *desc_value,
6036 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
6038 * @brief Reads the Service registered on manager interface.
6040 * This function is a synchronous call.
6042 * @return BLUETOOTH_ERROR_NONE - Success \n
6043 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6044 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6045 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6048 * @param[in] svc_uuid Gatt Service uuid.
6050 * @remark Adapter should be enabled and service should be registered.
6051 * @see bluetooth_gatt_register_service()
6053 int bluetooth_gatt_get_service(const char *svc_uuid);
6055 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
6057 * @brief Registers the given service path with the library.
6059 * This function is a synchronous call.
6061 * @return BLUETOOTH_ERROR_NONE - Success \n
6062 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6063 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6064 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6067 * @param[in] svc_path service object path of the exported service.
6069 * @remark Adapter should be enabled
6070 * @see bluetooth_gatt_add_service()
6071 * @see bluetooth_gatt_add_characteristics()
6072 * @see bluetooth_gatt_add_descriptor()
6073 * @see bluetooth_gatt_register_application()
6075 int bluetooth_gatt_register_service(const char *svc_path);
6077 /* @fn int bluetooth_gatt_register_application(void)
6079 * @brief Registers the application with the bluez gatt server.
6081 * This function is a synchronous call.
6083 * @return BLUETOOTH_ERROR_NONE - Success \n
6084 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6085 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6086 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6090 * @remark Adapter should be enabled
6091 * @see bluetooth_gatt_init()
6092 * @see bluetooth_gatt_add_service()
6093 * @see bluetooth_gatt_add_characteristics()
6094 * @see bluetooth_gatt_add_descriptor()
6095 * @see bluetooth_gatt_register_service()
6097 int bluetooth_gatt_register_application(void);
6099 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
6101 * @brief Removes(unregister) service from the bluez gatt server db.
6103 * This function is a synchronous call.
6105 * @return BLUETOOTH_ERROR_NONE - Success \n
6106 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6107 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6108 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6111 * @param[in] svc_path service object path of the exported service.
6113 * @remark Adapter should be enabled
6114 * @see bluetooth_gatt_add_service()
6115 * @see bluetooth_gatt_add_characteristics()
6116 * @see bluetooth_gatt_add_descriptor()
6117 * @see bluetooth_gatt_register_service()
6119 int bluetooth_gatt_unregister_service(const char *svc_path);
6121 /* @fn int bluetooth_gatt_unregister_application(void)
6123 * @brief Removes(unregister) the application with the bluez gatt server,
6124 * and deletes all the service registered.
6126 * This function is a synchronous call.
6128 * @return BLUETOOTH_ERROR_NONE - Success \n
6129 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6130 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6131 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6135 * @remark Adapter should be enabled
6136 * @see bluetooth_gatt_init()
6137 * @see bluetooth_gatt_add_service()
6138 * @see bluetooth_gatt_add_characteristics()
6139 * @see bluetooth_gatt_add_descriptor()
6140 * @see bluetooth_gatt_register_service()
6141 * @see bluetooth_gatt_unregister_service()
6143 int bluetooth_gatt_unregister_application(void);
6145 /* @fn int bluetooth_gatt_send_response(int request_id,
6146 * int offset, char *value, int value_length)
6148 * @brief Updates the attribute value in local attribute list.
6150 * This function is a synchronous call.
6152 * @return BLUETOOTH_ERROR_NONE - Success \n
6153 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6154 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6155 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6158 * @param[in] request_id The identification of a read request
6159 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6160 * @param[in] resp_state The identification of response state
6161 * @param[in] offset The offset from where a value is read
6162 * @param[in] value The value to be sent. It will be sent from @a offset.
6163 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6164 * @param[in] value_length Value Length.
6166 * @remark Adapter should be enabled
6167 * @see bluetooth_gatt_add_service()
6168 * @see bluetooth_gatt_add_characteristics()
6169 * @see bluetooth_gatt_add_descriptor()
6170 * @see bluetooth_gatt_register_service()
6172 int bluetooth_gatt_send_response(int request_id, guint req_type,
6173 int resp_state, int offset, char *value, int value_length);
6175 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6177 * @brief Sets the notification property for a characteristic.
6179 * This function is a synchronous call.
6181 * @return BLUETOOTH_ERROR_NONE - Success \n
6182 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6183 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6184 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6187 * @param[in] char_path characteristic object path.
6188 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6190 * @remark Adapter should be enabled
6191 * @see bluetooth_gatt_update_characteristic()
6193 int bluetooth_gatt_server_set_notification(const char *char_path,
6194 bluetooth_device_address_t *unicast_address);
6196 /* @fn int bluetooth_gatt_delete_services(void)
6198 * @brief deletes (unregisters) all services from the gatt server database..
6200 * This function is a synchronous call.
6202 * @return BLUETOOTH_ERROR_NONE - Success \n
6203 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6204 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6205 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6209 * @remark Adapter should be enabled
6210 * @see bluetooth_gatt_add_service()
6211 * @see bluetooth_gatt_add_characteristics()
6212 * @see bluetooth_gatt_add_descriptor()
6213 * @see bluetooth_gatt_register_service()
6214 * @see bluetooth_gatt_unregister_service()
6216 int bluetooth_gatt_delete_services(void);
6218 /* @fn int bluetooth_gatt_update_characteristic(void)
6220 * @brief updates the given characteristic with a new value
6222 * This function is a synchronous call.
6224 * @return BLUETOOTH_ERROR_NONE - Success \n
6225 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6226 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6227 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6231 * @remark Adapter should be enabled
6232 * @see bluetooth_gatt_add_service()
6233 * @see bluetooth_gatt_add_characteristics()
6234 * @see bluetooth_gatt_add_descriptor()
6235 * @see bluetooth_gatt_register_service()
6236 * @see bluetooth_gatt_unregister_service()
6238 int bluetooth_gatt_update_characteristic(const char *char_path,
6239 const char* char_value, int value_length);
6242 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6244 * @brief Set advertising status.
6246 * This function is used to enable or disable LE advertising.
6247 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6249 * This function is a synchronous call.
6251 * @return BLUETOOTH_ERROR_NONE - Success \n
6252 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6253 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6256 * @param[in] enable - The status of advertising
6259 * @see bluetooth_set_advertising_data
6261 int bluetooth_set_advertising(int handle, gboolean enable);
6264 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6266 * @brief Set advertising status along with interval value.
6268 * This function is used to enable or disable LE advertising.
6269 * Interval_min and Interval_max is used to set the best advertising interval.
6270 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6272 * This function is a synchronous call.
6274 * @return BLUETOOTH_ERROR_NONE - Success \n
6275 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6276 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6279 * @param[in] enable - The status of advertising
6280 * @param[in] interval_min - Minimum interval of advertising (msec)
6281 * @param[in] interval_max - Maximum interval of advertising (msec)
6282 * @param[in] filter_policy - Advertising filter policy
6285 * @see bluetooth_set_advertising_data
6287 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6288 bluetooth_advertising_params_t *params);
6291 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6292 * @brief Get the advertising data
6294 * This function is used to get advertising data.
6295 * Before calling this API, the adapter should be enabled.
6297 * This function is a synchronous call.
6299 * @return BLUETOOTH_ERROR_NONE - Success \n
6300 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6301 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6302 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6304 * @param[out] value - Advertising data structure.
6305 * @param[out] length - The length of Advertising data.
6309 bluetooth_advertising_data_t *value = { {0} };
6312 ret = bluetooth_get_advertising_data(&value, &length);
6315 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6318 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6320 * @brief Set advertising data with value
6322 * This function is used to set advertising data and Maximum size of advertising data
6323 * is 28 byte (Except Flag)
6325 * This function is a synchronous call.
6327 * @return BLUETOOTH_ERROR_NONE - Success \n
6328 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6329 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6332 * @param[in] value - Advertising data structure.
6336 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length, bool is_legacy);
6339 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6341 * @brief Check the privilege for advertising parameter setting
6343 * This function is a synchronous call.
6345 * @return BLUETOOTH_ERROR_NONE - Success \n
6346 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6352 int bluetooth_check_privilege_advertising_parameter(void);
6355 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6356 * @brief Get the LE scan response data
6358 * This function is used to get scan response data.
6359 * Before calling this API, the adapter should be enabled.
6361 * This function is a synchronous call.
6363 * @return BLUETOOTH_ERROR_NONE - Success \n
6364 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6365 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6366 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6368 * @param[out] value - Scan response data structure.
6369 * @param[out] length - The length of Scan response data.
6373 bluetooth_scan_resp_data_t *value = { {0} };
6376 ret = bluetooth_get_scan_response_data(&value, &length);
6379 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6382 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6384 * @brief Set scan response data with value
6386 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6388 * This function is a synchronous call.
6390 * @return BLUETOOTH_ERROR_NONE - Success \n
6391 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6392 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6395 * @param[in] value - LE Scan response data structure.
6399 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6402 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6404 * @brief Set scan interval and window
6406 * This function is used to set LE scan interval and window size
6408 * This function is a synchronous call.
6410 * @return BLUETOOTH_ERROR_NONE - Success \n
6411 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6412 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6415 * @param[in] interval - Interval of LE scan (msec)
6416 * @param[in] window - Window size of LE scan (msec)
6420 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6423 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6425 * @brief Set scan type
6427 * This function is used to set LE scan type
6429 * This function is a synchronous call.
6431 * @return BLUETOOTH_ERROR_NONE - Success \n
6432 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6433 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6436 * @param[in] scan_type - LE scan type
6440 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6443 * @fn intbluetooth_set_scan_phy(bleutooth_le_scanning_phy_t phy);
6445 * @brief Set scan phy
6447 * This function is used to set LE scan phy
6449 * This function is a synchronous call.
6451 * @return BLUETOOTH_ERROR_NONE - Success \n
6452 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6453 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6456 * @param[in] phy - LE scanning PHY
6460 int bluetooth_set_le_scan_phy(bleutooth_le_scanning_phy_t phy);
6463 * @fn intbluetooth_set_scan_phy(bluetooth_le_scan_role_t role);
6465 * @brief Set scan role
6467 * This function is used to set LE scan role
6469 * This function is a synchronous call.
6471 * @return BLUETOOTH_ERROR_NONE - Success \n
6472 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6473 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6476 * @param[in] role - LE scanning role
6480 int bluetooth_set_le_scan_role(bluetooth_le_scan_role_t role);
6483 * @fn int bluetooth_is_advertising(void)
6484 * @brief Check for the advertising is in-progress or not.
6486 * This API is used to check the current status of the advertising procedure.
6487 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6490 * This function checks whether the advertising is started or not.
6492 * This function is a synchronous call.
6494 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6496 * @return BLUETOOTH_ERROR_NONE - Success \n
6497 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6500 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6504 gboolean is_advertising = 0;
6506 ret = bluetooth_is_advertising(&is_advertising);
6509 int bluetooth_is_advertising(gboolean *is_advertising);
6512 * @fn int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6513 * @brief Add LE device to allow list
6515 * This API is used to add LE device to allow list
6516 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6520 * This function is a synchronous call.
6522 * @param[in] address The address of remote device
6524 * @return BLUETOOTH_ERROR_NONE - Success \n
6525 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6528 * @see bluetooth_set_custom_advertising
6530 int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6533 * @fn int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6534 * @brief Remove LE device from allow list
6536 * This API is used to remove LE device from allow list
6537 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6541 * This function is a synchronous call.
6543 * @param[in] address The address of remote device
6545 * @return BLUETOOTH_ERROR_NONE - Success \n
6546 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6549 * @see bluetooth_set_custom_advertising
6551 int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6554 * @fn int bluetooth_clear_allow_list(void)
6555 * @brief Clear allow list
6557 * This API is used to clear allow list
6558 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6562 * This function is a synchronous call.
6564 * @param[in] address The address of remote device
6566 * @return BLUETOOTH_ERROR_NONE - Success \n
6567 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6570 * @see bluetooth_set_custom_advertising
6572 int bluetooth_clear_allow_list(void);
6575 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6576 * const bluetooth_le_connection_param_t *parameters)
6577 * @brief update connection paramter of LE connection.
6579 * This function is a synchronous call.
6581 * @return BLUETOOTH_ERROR_NONE - Success \n
6582 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6585 * @param[in] address - remote device address value.
6586 * @param[in] parameters - new connection parameters.
6589 * @see bluetooth_bond_device
6591 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6592 const bluetooth_le_connection_param_t *parameters);
6595 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6597 * @brief Enable/Disable LE Privacy feature.
6599 * This function is used to enable or disable LE Privacy feature.
6600 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6602 * This function is a synchronous call.
6604 * @return BLUETOOTH_ERROR_NONE - Success \n
6605 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6606 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6609 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6613 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6616 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6618 * @brief Enable/Disable LE static random address.
6620 * This function is used to enable or disable LE static random address.
6622 * This function is a synchronous call.
6624 * @return BLUETOOTH_ERROR_NONE - Success \n
6625 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6626 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6629 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6633 int bluetooth_set_le_static_random_address(gboolean enable);
6636 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6637 * bluetooth_le_connection_mode_t mode)
6638 * @brief update connection paramter of LE connection.
6640 * This function is a synchronous call.
6642 * @return BLUETOOTH_ERROR_NONE - Success \n
6643 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6644 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6647 * @param[in] address - remote device address value.
6648 * @param[in] mode - new connection mode.
6652 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6653 bluetooth_le_connection_mode_t mode);
6656 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6657 * @brief Request for new ATT MTU value.
6659 * This function is a asynchronous call.
6661 * @return BLUETOOTH_ERROR_NONE - Success \n
6662 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6663 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6666 * @param[in] address - remote device address value.
6667 * @param[in] mtu - MTU value to be set.
6671 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6674 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6675 * unsigned int *mtu)
6676 * @brief Gets the xisting MTU value set for a connection.
6678 * This function is a synchronous call.
6680 * @return BLUETOOTH_ERROR_NONE - Success \n
6681 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6682 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6685 * @param[in] address - remote device address value.
6686 * @param[out] mtu - MTU value set for the connection.
6690 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6694 * @fn int bluetooth_gatt_server_read_phy(const bluetooth_device_address_t *device_address)
6695 * @brief Gets the PHY values set for a connection.
6697 * This function is a asynchronous call. The updated PHYs are notified
6698 * through callback event.
6700 * @return BLUETOOTH_ERROR_NONE - Success \n
6701 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6702 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6705 * @param[in] address - remote device address value.
6709 int bluetooth_gatt_server_read_phy(const bluetooth_device_address_t *device_address);
6712 * @fn int bluetooth_gatt_server_set_phy(const bluetooth_device_address_t *device_address,
6713 int tx_phy, int rx_phy, int phy_options)
6714 * @brief Request a change of the PHY values.
6716 * This function is a asynchronous call. The updated PHYs are notified
6717 * through callback event.
6719 * @return BLUETOOTH_ERROR_NONE - Success \n
6720 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6721 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6724 * @param[in] address - remote device address value.
6725 * @param[in] tx_phy The preferred sender PHY
6726 * @param[in] rx_phy The preferred receiver PHY
6727 * @param[in] phy_options The preferred coding to use when transmitting on LE CODED PHY
6731 int bluetooth_gatt_server_set_phy(const bluetooth_device_address_t *device_address,
6732 int tx_phy, int rx_phy, int phy_options);
6735 * @fn int bluetooth_gatt_client_read_phy(const bluetooth_device_address_t *device_address)
6736 * @brief Gets the PHY values set for a connection.
6738 * This function is a asynchronous call. The updated PHYs are notified
6739 * through callback event.
6741 * @return BLUETOOTH_ERROR_NONE - Success \n
6742 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6743 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6746 * @param[in] address - remote device address value.
6750 int bluetooth_gatt_client_read_phy(const bluetooth_device_address_t *device_address);
6753 * @fn int bluetooth_gatt_client_set_phy(const bluetooth_device_address_t *device_address,
6754 int tx_phy, int rx_phy, int phy_options)
6755 * @brief Request a change of the PHY values.
6757 * This function is a asynchronous call. The updated PHYs are notified
6758 * through callback event.
6760 * @return BLUETOOTH_ERROR_NONE - Success \n
6761 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6762 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6765 * @param[in] address - remote device address value.
6766 * @param[in] tx_phy The preferred sender PHY
6767 * @param[in] rx_phy The preferred receiver PHY
6768 * @param[in] phy_options The preferred coding to use when transmitting on LE CODED PHY
6772 int bluetooth_gatt_client_set_phy(const bluetooth_device_address_t *device_address,
6773 int tx_phy, int rx_phy, int phy_options);
6776 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6777 * bluetooth_device_address_t *id_address)
6778 * @brief Gets the Identity address of remote device.
6780 * This function is a synchronous call.
6782 * @return BLUETOOTH_ERROR_NONE - Success \n
6783 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6784 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6787 * @param[in] device_rpa - remote Resolvable private address.
6788 * @param[out] id_address - remote Identity device address value.
6792 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6793 bluetooth_device_address_t *id_address);
6796 * @fn int bluetooth_le_read_maximum_data_length()
6797 * @brief reads the maximum LE data length supported in the controller.
6799 * This function is a synchronous call.
6801 * @return BLUETOOTH_ERROR_NONE - Success \n
6802 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6808 int bluetooth_le_read_maximum_data_length(
6809 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6811 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6812 * @brief writes the host suggested values for the controllers max transmitted no of payload
6813 * octects to be used for new connections.
6815 * This function is a synchronous call.
6817 * @return BLUETOOTH_ERROR_NONE - Success \n
6818 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6824 int bluetooth_le_write_host_suggested_default_data_length(
6825 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6827 int bluetooth_le_read_suggested_default_data_length(
6828 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6830 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6831 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6833 int bluetooth_pbap_init(void);
6834 int bluetooth_pbap_deinit(void);
6835 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6836 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6837 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6838 bt_pbap_folder_t *folder);
6839 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6840 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6841 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6842 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6843 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6844 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6845 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6846 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6849 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6851 * @brief Set manufacturer data with value
6853 * This function is used to set manufacturer data.
6855 * This function is a synchronous call.
6857 * @return BLUETOOTH_ERROR_NONE - Success \n
6858 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6859 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6862 * @param[in] value - Manufacturer data structure.
6866 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6868 int bluetooth_set_passkey_notification(gboolean enable);
6871 * @fn int bluetooth_dpm_is_mode_allowed(void);
6873 * @brief Checks Restriction for BT mode(BT allowed or not)
6875 * This function is a synchronous call.
6877 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6878 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6879 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6886 int bluetooth_dpm_is_mode_allowed(void);
6889 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6891 * @brief Sets Restriction for BT mode(BT allowed or not)
6893 * This function is a synchronous call.
6895 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6896 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6897 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6900 * @param[in] value - BT Allow value.
6901 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6902 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6903 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6904 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6908 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6911 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6913 * @brief Reads the Restriction for BT mode(BT allowed or not)
6915 * This function is a synchronous call.
6917 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6918 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6919 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6923 * @param[out] value - BT Allow value.
6924 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6925 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6926 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6927 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6931 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6934 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6936 * @brief Sets the Restriction for device.
6938 * This function is a synchronous call.
6940 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6941 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6942 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6945 * @param[in] value - State value.
6946 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6947 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6951 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6954 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6956 * @brief Reads the Restriction for device.
6958 * This function is a synchronous call.
6960 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6961 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6962 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6966 * @param[out] value - State value.
6967 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6968 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6972 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6975 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6977 * @brief Sets the Restriction for uuid.
6979 * This function is a synchronous call.
6981 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6982 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6983 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6986 * @param[in] value - State value.
6987 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6988 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6992 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6995 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6997 * @brief Reads the Restriction for uuid.
6999 * This function is a synchronous call.
7001 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7002 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7003 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7007 * @param[out] value - State value.
7008 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7009 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7013 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
7016 * @fn int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
7018 * @brief Adds the device to blocklist.
7020 * This function is a synchronous call.
7022 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7023 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7024 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7027 * @param[in] device_address - Device address
7031 int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
7034 * @fn int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
7036 * @brief Adds the device to allowlist.
7038 * This function is a synchronous call.
7040 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7041 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7042 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7045 * @param[in] device_address - Device address
7049 int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
7052 * @fn int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
7054 * @brief Adds the Service UUIDS to blocklist.
7056 * This function is a synchronous call.
7058 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7059 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7060 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7063 * @param[in] service_uuids - profile or custom service uuids
7067 int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
7070 * @fn int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
7072 * @brief Adds the Service UUIDS to allowlist.
7074 * This function is a synchronous call.
7076 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7077 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7078 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7081 * @param[in] service_uuids - profile or custom service uuids
7085 int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
7088 * @fn int bluetooth_dpm_clear_devices_from_blocklist();
7090 * @brief Clears the devices from blocklist.
7092 * This function is a synchronous call.
7094 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7095 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7096 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7103 int bluetooth_dpm_clear_devices_from_blocklist(void);
7106 * @fn int bluetooth_dpm_clear_devices_from_allowlist();
7108 * @brief Clears the devices from allowlist.
7110 * This function is a synchronous call.
7112 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7113 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7114 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7121 int bluetooth_dpm_clear_devices_from_allowlist(void);
7124 * @fn int bluetooth_dpm_clear_uuids_from_blocklist();
7126 * @brief Clears the uuids from blocklist.
7128 * This function is a synchronous call.
7130 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7131 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7132 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7139 int bluetooth_dpm_clear_uuids_from_blocklist(void);
7142 * @fn int bluetooth_dpm_clear_uuids_from_allowlist();
7144 * @brief Clears the uuids from allowlist.
7146 * This function is a synchronous call.
7148 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7149 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7150 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7157 int bluetooth_dpm_clear_uuids_from_allowlist(void);
7160 * @fn int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
7162 * @brief reads the devices from blocklist.
7164 * This function is a synchronous call.
7166 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7167 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7168 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7171 * @param[out] device_list - list of devices
7175 int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
7178 * @fn int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7180 * @brief reads the devices from allowlist.
7182 * This function is a synchronous call.
7184 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7185 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7186 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7189 * @param[out] device_list - list of devices
7193 int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7196 * @fn int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7198 * @brief reads the uuids from blocklist.
7200 * This function is a synchronous call.
7202 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7203 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7204 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7207 * @param[in] uuid_list - list of uuids
7211 int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7214 * @fn int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7216 * @brief reads the uuids from allowlist.
7218 * This function is a synchronous call.
7220 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7221 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7222 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7225 * @param[in] uuid_list - list of uuids
7229 int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7232 * @fn int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7234 * @brief Removes the device from allowlist.
7236 * This function is a synchronous call.
7238 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7239 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7240 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7243 * @param[in] device_address - Device address
7247 int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7250 * @fn int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7252 * @brief Removes the device from blocklist.
7254 * This function is a synchronous call.
7256 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7257 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7258 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7261 * @param[in] device_address - Device address
7265 int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7268 * @fn int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7270 * @brief Removes the Service UUIDS from allowlist.
7272 * This function is a synchronous call.
7274 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7275 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7276 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7279 * @param[in] service_uuids - profile or custom service uuids
7283 int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7286 * @fn int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7289 * @brief Removes the Service UUIDS from blocklist.
7291 * This function is a synchronous call.
7293 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7294 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7295 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7298 * @param[in] service_uuids - profile or custom service uuids
7302 int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7305 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7307 * @brief Sets the Restriction for outgoing call.
7309 * This function is a synchronous call.
7311 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7312 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7313 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7316 * @param[in] value - State value.
7317 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7318 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7322 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7325 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7327 * @brief Reads the Restriction for outgoing call.
7329 * This function is a synchronous call.
7331 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7332 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7333 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7337 * @param[out] value - State value.
7338 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7339 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7343 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7346 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7348 * @brief Sets the Restriction for Pairing.
7350 * This function is a synchronous call.
7352 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7353 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7354 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7357 * @param[in] value - State value.
7358 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7359 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7363 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7366 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7368 * @brief Reads the Restriction for Pairing
7370 * This function is a synchronous call.
7372 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7373 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7374 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7378 * @param[out] value - State value.
7379 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7380 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7384 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7387 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7389 * @brief Sets the Restriction for using Profiles.
7391 * This function is a synchronous call.
7393 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7394 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7395 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7398 * @param[in]profile - Profile.
7399 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7400 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7401 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7402 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7403 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7404 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7405 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7406 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7407 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7408 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7409 * BLUETOOTH_DPM_PROFILE_NONE
7410 * @param[in] value - State value.
7411 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7412 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7416 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7419 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7421 * @brief Reads the Restriction for using Profiles.
7423 * This function is a synchronous call.
7425 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7426 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7427 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7430 * @param[in]profile - Profile.
7431 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7432 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7433 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7434 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7435 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7436 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7437 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7438 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7439 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7440 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7441 * BLUETOOTH_DPM_PROFILE_NONE
7442 * @param[out] value - State value.
7443 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7444 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7448 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7451 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7453 * @brief Sets the Restriction for Desktop Connectivity.
7455 * This function is a synchronous call.
7457 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7458 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7459 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7462 * @param[in] value - State value.
7463 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7464 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7468 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7471 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7473 * @brief Reads the Restriction for Desktop Connectivity.
7475 * This function is a synchronous call.
7477 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7478 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7479 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7483 * @param[out] value - State value.
7484 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7485 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7489 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7492 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7494 * @brief Sets the Restriction for Discoverable state.
7496 * This function is a synchronous call.
7498 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7499 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7500 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7503 * @param[in] value - State value.
7504 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7505 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7509 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7512 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7514 * @brief Reads the Restriction for Discoverable state.
7516 * This function is a synchronous call.
7518 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7519 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7520 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7524 * @param[out] value - State value.
7525 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7526 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7530 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7533 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7535 * @brief Sets the Restriction for linited discoverable state..
7537 * This function is a synchronous call.
7539 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7540 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7541 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7544 * @param[in] value - State value.
7545 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7546 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7550 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7553 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7555 * @brief Reads the Restriction for limited discoverable state.
7557 * This function is a synchronous call.
7559 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7560 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7561 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7565 * @param[out] value - State value.
7566 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7567 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7571 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7573 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7575 * @brief Sets the Restriction for Data trasnfer.
7577 * This function is a synchronous call.
7579 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7580 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7581 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7584 * @param[in] value - State value.
7585 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7586 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7590 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7594 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7596 * @brief Reads the Restriction for Data trasnfer.
7598 * This function is a synchronous call.
7600 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7601 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7602 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7606 * @param[out] value - State value.
7607 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7608 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7612 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7615 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7616 * bluetooth_pxp_poperty_t property, int value);
7618 * @brief Sets the Proximity alert level/properties for monitor role.
7620 * This function is a synchronous call.
7622 * @return BLUETOOTH_ERROR_NONE - Success \n
7623 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7624 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7625 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7628 * @param[in] device_address remote device address
7629 * @param[in] property proximity profile property
7630 * @param[in] value alert level/property value to be set
7635 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7636 bluetooth_pxp_poperty_t property, int value);
7639 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7640 * bluetooth_pxp_poperty_t property, int *value);
7642 * @brief Reads the Proximity alert level/properties for monitor role.
7644 * This function is a synchronous call.
7646 * @return BLUETOOTH_ERROR_NONE - Success \n
7647 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7648 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7649 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7652 * @param[in] device_address remote device address
7653 * @param[in] property proximity profile property
7654 * @param[out] value alert level/property value
7658 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7659 bluetooth_pxp_poperty_t property, int *value);
7662 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7663 * int *services_supported);
7665 * @brief Reads the Proximity Monitor profile supported properties/services.
7667 * This function is a synchronous call.
7669 * @return BLUETOOTH_ERROR_NONE - Success \n
7670 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7671 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7672 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7675 * @param[in] device_address remote device address
7676 * @param[out] services_supported proximity profile property/service
7680 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7681 int *services_supported);
7684 * @fn int bluetooth_proximity_reporter_register();
7686 * @brief Register all proximity related services in BlueZ.
7688 * This function is a synchronous call.
7690 * @return BLUETOOTH_ERROR_NONE - Success \n
7691 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7697 int bluetooth_proximity_reporter_register(void);
7700 * @fn int bluetooth_proximity_reporter_unregister();
7702 * @brief Unregister all proximity related services in BlueZ.
7704 * This function is a synchronous call.
7706 * @return BLUETOOTH_ERROR_NONE - Success \n
7707 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7713 int bluetooth_proximity_reporter_unregister(void);
7716 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7717 * bluetooth_pxp_poperty_t property, int *value);
7719 * @brief Reads the Proximity alert level/properties for reporter role.
7721 * This function is a synchronous call.
7723 * @return BLUETOOTH_ERROR_NONE - Success \n
7724 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7725 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7726 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7729 * @param[in] device_address remote device address
7730 * @param[in] property proximity profile property
7731 * @param[out] value alert level/property value
7735 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7736 bluetooth_pxp_poperty_t property, int *value);
7739 * @fn int bluetooth_tds_provider_register(void);
7741 * @brief Register Transport Discovery Provider role.
7743 * This function is a synchronous call.
7745 * @return BLUETOOTH_ERROR_NONE - Success \n
7746 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7747 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7748 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7756 int bluetooth_tds_provider_register(void);
7759 * @fn int bluetooth_tds_provider_unregister(void);
7761 * @brief Unregister Transport Discovery Provider role.
7763 * This function is a synchronous call.
7765 * @return BLUETOOTH_ERROR_NONE - Success \n
7766 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7767 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7768 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7776 int bluetooth_tds_provider_unregister(void);
7779 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7781 * @brief Create Transport Discovery Provider for a transport.
7783 * This function is a synchronous call.
7785 * @return BLUETOOTH_ERROR_NONE - Success \n
7786 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7787 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7788 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7791 * @param[in] Transport (BT, CUSTOM etc.)
7792 * @param[in] Unique handle for TDS provider.
7797 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7800 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7802 * @brief Remove previously created Transport Discovery Provider.
7804 * This function is a synchronous call.
7806 * @return BLUETOOTH_ERROR_NONE - Success \n
7807 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7810 * @param[in] Unique handle for previously created provider.
7815 int bluetooth_tds_provider_destroy(unsigned int handle);
7818 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7820 * @brief Set transport block for in advertisement and gatt db.
7822 * This function is a synchronous call.
7824 * @return BLUETOOTH_ERROR_NONE - Success \n
7825 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7826 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7827 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7830 * @param[in] Provider specific manufacturer data.
7831 * @param[in] Provider specific manufacturer data length.
7836 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7839 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7840 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7842 * @brief Set transport block for in advertisement and gatt db.
7844 * This function is a synchronous call.
7846 * @return BLUETOOTH_ERROR_NONE - Success \n
7847 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7848 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7849 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7852 * @param[in] Unique handle for TDS provider.
7853 * @param[in] Transport state (On/Off/Not Available).
7854 * @param[in] Transport specific data block.
7855 * @param[in] Transport specific data block length.
7860 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7861 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7864 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7865 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7867 * @brief Send response to TDS activation request from remoted device.
7869 * This function is a synchronous call.
7871 * @return BLUETOOTH_ERROR_NONE - Success \n
7872 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7873 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7874 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7877 * @param[in] Remote device BT address.
7878 * @param[in] Unique handle for TDS provider.
7879 * @param[in] Response for TDS activation request.
7880 * @param[in] Transport specific data block to be sent in activation response.
7881 * @param[in] Data block length.
7886 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7887 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7890 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7892 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7894 * This function is an asynchronous call.
7896 * @return BLUETOOTH_ERROR_NONE - Success \n
7897 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7898 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7899 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7900 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7903 * @param[in] device_address remote device address
7904 * @param[in] handle attribute handle
7906 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7907 * when TDS data is received from Remote provider
7909 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7910 const char *handle);
7913 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7915 * @brief Enables CCCD on Remote Provider.
7917 * This function is an asynchronous call.
7919 * @return BLUETOOTH_ERROR_NONE - Success \n
7920 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7921 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7922 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7923 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7926 * @param[in] device_address remote device address
7927 * @param[in] handle attribute handle
7929 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7930 * when Indication is enabled on Remote provider
7932 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7933 const char *handle);
7936 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7937 * unsigned char *buf, int length);
7938 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7940 * This function is an asynchronous call.
7942 * @return BLUETOOTH_ERROR_NONE - Success \n
7943 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7944 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7945 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7946 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7949 * @param[in] device_address remote device address
7950 * @param[in] handle attribute handle
7951 * @param[in] buf Control point activation param
7952 * @param[in] param length
7954 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7955 * is received from remote Provider
7957 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7958 unsigned char *buf, int length);
7961 * @fn int bluetooth_otp_server_init(const char *directory);
7963 * @brief Starts OTP server.
7965 * This function is a synchronous call.
7975 int bluetooth_otp_server_init(const char *directory);
7978 * @fn int bluetooth_otp_server_deinit();
7980 * @brief Stops OTP server.
7982 * This function is a synchronous call.
7992 int bluetooth_otp_server_deinit();
7995 * @fn int bluetooth_otp_enable_notification(const char *handle);
7997 * @brief Enable notification for remote OACP & OLCP characteristics.
7999 * This function is a synchronous call.
8009 int bluetooth_otp_enable_notification(const char *handle);
8012 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
8013 * unsigned char *buf, int length);
8015 * @brief Write value on remote characteristics.
8017 * This function is a synchronous call.
8027 int bluetooth_otp_write_characteristics_value(const char *handle,
8028 unsigned char *buf, int length);
8031 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
8033 * @brief Read value for remote characteristics.
8035 * This function is a synchronous call.
8045 int bluetooth_otp_read_characteristic_value(const char *handle);
8048 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
8050 * @brief Read value for remote characteristics.
8052 * This function is a synchronous call.
8062 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
8065 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
8067 * @brief Read value for remote characteristics.
8069 * This function is a synchronous call.
8079 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
8082 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
8083 * @brief Check if Adapter supports LE 2M PHY feature or not.
8085 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
8086 * in BT 5.0 specification.
8088 * This function is a synchronous call.
8090 * @return BLUETOOTH_ERROR_NONE - Success \n
8091 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8092 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8093 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8094 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
8098 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
8101 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
8102 * @brief Check if Adapter supports LE 2M CODED feature or not.
8104 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
8105 * in BT 5.0 specification.
8107 * This function is a synchronous call.
8109 * @return BLUETOOTH_ERROR_NONE - Success \n
8110 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8111 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8112 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8113 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
8117 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
8120 * @fn int bluetooth_is_le_extended_advertising_supported(gboolean *is_supported)
8121 * @brief Check if Adapter supports LE Extended Advertising feature or not.
8123 * This API is used to check whether LE Adapter supports LE Extended Advertising feature, which is introduced
8124 * in BT 5.0 specification.
8126 * This function is a synchronous call.
8128 * @return BLUETOOTH_ERROR_NONE - Success \n
8129 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8130 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8131 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8132 * @param[out] is_supported. This boolean variable indicates whether LE Extended Advertising is supported or not
8136 int bluetooth_is_le_extended_advertising_supported(gboolean *is_supported);
8139 * @fn int bluetooth_is_le_extended_scan_supported(gboolean *is_supported)
8140 * @brief Check if Adapter supports LE Extended Scan feature or not.
8142 * This API is used to check whether LE Adapter supports LE Extended Scan feature, which is introduced
8143 * in BT 5.0 specification.
8145 * This function is a synchronous call.
8147 * @return BLUETOOTH_ERROR_NONE - Success \n
8148 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8149 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8150 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8151 * @param[out] is_supported. This boolean variable indicates whether LE Extended Scan is supported or not
8155 int bluetooth_is_le_extended_scan_supported(gboolean *is_supported);
8158 * @fn int bluetooth_le_get_maximum_advertising_data_length(gint *data_length)
8159 * @brief gives the maximum advertising data length supported by controller.
8161 * This API is used to get the maximum advertising data length supported by controller. This feature is introduced
8162 * in BT 5.0 specification.
8164 * This function is a synchronous call.
8166 * @return BLUETOOTH_ERROR_NONE - Success \n
8167 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8168 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8169 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8170 * @param[out] data_length. This integer variable indicates the maximum advertising data length supported by the controller
8174 int bluetooth_le_get_maximum_advertising_data_length(gint *data_length);
8177 * @fn int bluetooth_get_local_irk(bluetooth_irk_t *irk)
8178 * @brief Gets the local Identity Resolving Key (IRK).
8180 * This function is a synchronous call.
8182 * @return BLUETOOTH_ERROR_NONE - Success \n
8183 * BLUETOOTH_ERROR_NOT_SUPPORT - Not supported \n
8184 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8185 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8186 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8187 * @param[out] irk. This structure variable contains the local IRK of the Bluetooth device.
8191 int bluetooth_get_local_irk(bluetooth_irk_t *irk);
8194 * @fn int bluetooth_l2cap_le_create_socket(int psm)
8195 * @brief Register l2cap_le socket with a specific PSM
8198 * This API register l2cap_le socket with the given PSM. The return value of this API is the socket
8199 * descriptor of the server.
8200 * This is the first API which is called to create the server. Once we created the server socket,
8201 * we will listen on that return socket.
8202 * So a bluetooth_l2cap_le_listen_and_accept should follow this API call. This is a synchronous call.
8205 * @return socket FD on Success \n
8206 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8207 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
8208 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
8209 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8210 * @param[in] int psm
8213 * @see bluetooth_l2cap_le_listen_and_accept, bluetooth_l2cap_le_remove_socket
8218 fd = bluetooth_l2cap_le_create_socket(test_psm);
8222 int bluetooth_l2cap_le_create_socket(int psm);
8225 * @fn int bluetooth_l2cap_le_remove_socket(int socket_fd)
8226 * @brief De-register the l2cap_le socket
8229 * This API deregister l2cap_le socket with the given socket fd. If the remote device is
8230 * already connected then we will receive the BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED with socket
8231 * descriptor else no event will come. We will call this API only after the
8232 * bluetooth_l2cap_le_listen_and_accept.
8233 * This is a synchronous call.
8235 * @return BLUETOOTH_ERROR_NONE - Success \n
8236 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8237 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
8238 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8239 * @param[in] int socket_fd
8242 * @see bluetooth_l2cap_le_create_socket, bluetooth_l2cap_le_listen_and_accept
8245 void bt_event_callback(int event, bluetooth_event_param_t *param)
8249 case BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED:
8251 bluetooth_l2cap_le_connection_t *discon_ind =
8252 (bluetooth_l2cap_le_connection_t *)param->param_data;
8254 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
8262 fd = bluetooth_l2cap_le_create_socket(test_psm);
8263 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8265 ret = bluetooth_l2cap_le_remove_socket(fd);
8268 int bluetooth_l2cap_le_remove_socket(int socket_fd);
8271 * @fn int bluetooth_l2cap_le_server_disconnect(int socket_fd)
8272 * @brief Disconnect l2cap_le connection
8275 * Disconnect a specific(device node fd) l2cap_le connection. This is a Synchronous call and there
8276 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8279 * @return BLUETOOTH_ERROR_NONE - Success \n
8280 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8281 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8282 * @param[in] int socket_fd
8288 ret = bluetooth_l2cap_le_server_disconnect(g_ret_fd);
8290 printf("Disconnection failed");
8292 printf("Disconnection Success");
8296 int bluetooth_l2cap_le_server_disconnect(int socket_fd);
8299 * @fn int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection)
8300 * @brief L2CAP_LE socket listen
8303 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8304 * after the bluetooth_l2cap_le_create_socket API.
8305 * This API listen for the incoming connection and once it receives a connection, it will give
8306 * BLUETOOTH_EVENT_L2CAP_LE_CONNECTED
8307 * event to the application. This is an Asynchronous API call.
8310 * @return BLUETOOTH_ERROR_NONE - Success \n
8311 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8312 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8314 * @param[in] int socket_fd
8315 * @param[in] max pending connection.
8318 * @see bluetooth_l2cap_le_create_socket
8321 void bt_event_callback(int event, bluetooth_event_param_t* param)
8325 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8327 bluetooth_l2cap_le_connection_t *conn_ind =
8328 (bluetooth_l2cap_le_connection_t *)param->param_data;
8330 printf("\nConnected from FD %d", conn_ind->socket_fd);
8338 fd = bluetooth_l2cap_le_create_socket(test_psm);
8339 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8343 int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection);
8346 * @fn int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection)
8347 * @brief L2cap_le socket listen
8350 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8351 * after the bluetooth_l2cap_le_create_socket API.
8352 * This API listen for the incoming connection and once it receives a connection, it will give
8353 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE
8354 * event to the application. This is an Asynchronous API call.
8357 * @return BLUETOOTH_ERROR_NONE - Success \n
8358 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8359 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8361 * @param[in] int socket_fd
8362 * @param[in] max pending connection.
8365 * @see bluetooth_l2cap_le_create_socket
8368 void bt_event_callback(int event, bluetooth_event_param_t* param)
8372 case BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE:
8374 char *name = (char *)param->param_data;
8376 printf("\nConnected from %s", name);
8378 bluetooth_l2cap_le_accept_connection();
8386 fd = bluetooth_l2cap_le_create_socket(test_psm);
8387 ret = bluetooth_l2cap_le_listen(fd, 1);
8391 int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection);
8394 * @fn int bluetooth_l2cap_le_accept_connection()
8395 * @brief Accepts the authorization request indicated by the event
8396 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8398 * This function is a synchronous call.
8400 * @return BLUETOOTH_ERROR_NONE - Success \n
8401 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8403 * @param[in] the socket fd of the server
8404 * @param[out] the socket fd of the client
8408 * @see bluetooth_l2cap_le_reject_connection
8410 int bluetooth_l2cap_le_accept_connection(int server_fd);
8413 * @fn int bluetooth_l2cap_le_reject_connection()
8414 * @brief Rejects the authorization request indicated by the event
8415 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8417 * This function is a synchronous call.
8419 * @return BLUETOOTH_ERROR_NONE - Success \n
8420 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8422 * @param[in] the socket fd of the server
8426 * @see bluetooth_l2cap_le_accept_connection
8428 int bluetooth_l2cap_le_reject_connection(int server_fd);
8431 * @fn gboolean bluetooth_l2cap_le_is_server_psm_available(int psm)
8432 * @brief Informs whether l2cap_le server psm is available or not.
8434 * This function is a synchronous call.
8436 * @return TRUE - L2CAP_LE PSM is available \n
8437 * FALSE - L2CAP_LE PSM is not available \n
8439 * @param[in] psm (int)
8445 gboolean bluetooth_l2cap_le_is_server_psm_available(int psm);
8448 * @fn int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8450 * @brief Connect to the remote device l2cap_le *
8452 * Connect to a specific l2cap_le socket on a remote device psm. This is a Async call. Once
8453 * the connection is successful callback BLUETOOTH_EVENT_L2CAP_LE_CONNECTED events is generated,
8454 * which contains the socket_fd, device role (L2CAP_LE_ROLE_SERVER/L2CAP_LE_ROLE_CLIENT), device addess
8455 * etc. The socket_fd can be further used to send the data. It better to do a ble scanning before
8456 * initiating a connection.
8458 * @return BLUETOOTH_ERROR_NONE - Success \n
8459 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8460 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8461 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
8462 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
8463 * @param[in] bluetooth_device_address_t remote bt_address
8464 * @param[in] int psm
8466 * @see bluetooth_l2cap_le_disconnect, bluetooth_l2cap_le_write
8470 void bt_event_callback(int event, bluetooth_event_param_t *param)
8474 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8476 bluetooth_l2cap_le_connection_t *conn_ind =
8477 (bluetooth_l2cap_le_connection_t *)param->param_data;
8479 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
8480 (conn_ind->device_role == L2CAP_LE_ROLE_SERVER) ?
8481 "SERVER" : "CLIENT");
8486 bluetooth_device_address_t remote_address = {{0},};
8487 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
8488 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
8490 ret = bluetooth_l2cap_le_connect(&remote_address, test_psm);
8492 printf("Connection failed, Reason = %d", ret);
8494 printf("Connection Success, Ret = %d", ret);
8498 int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8502 * @fn int bluetooth_l2cap_le_disconnect(int socket_fd)
8503 * @brief Disconnect l2cap_le connection
8506 * Disconnect a specific(device node fd) L2CAP_LE connection. This is a Synchronous call and there
8507 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8510 * @return BLUETOOTH_ERROR_NONE - Success \n
8511 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8512 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8513 * @param[in] int remote socket_fd
8516 * @see bluetooth_l2cap_le_connect
8520 ret = bluetooth_l2cap_le_disconnect(g_ret_fd);
8522 printf("Disconnection failed");
8524 printf("Disconnection Success");
8529 int bluetooth_l2cap_le_disconnect(int socket_fd);
8532 * @fn int bluetooth_l2cap_le_write (int fd, const char *buf, int length)
8533 * @brief Write to l2cap_le connection
8536 * This API is used to send the data over the l2cap_le connection. This is a
8537 * synchronous API. The same API is used to send the data for server and the client.
8539 * @return BLUETOOTH_ERROR_NONE - Success \n
8540 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8541 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
8543 * @param[in] const char *buff Data buffer to send
8544 * @param[in] int length Length of the data
8547 * @see bluetooth_l2cap_le_connect
8550 char *buff = "Test data 123456789"
8551 ret = bluetooth_l2cap_le_write(g_ret_fd, buff, 15);
8553 printf("Send failed");
8555 printf("Send success");
8559 int bluetooth_l2cap_le_write(int fd, const char *buf, int length);
8562 * @fn gboolean bluetooth_l2cap_le_client_is_connected(
8563 * const bluetooth_device_address_t *device_address, gboolean *connected)
8564 * @brief Informs whether l2cap_le client is connected.
8566 * This function is a synchronous call.
8568 * @return TRUE - L2CAP_LE client is connected \n
8569 * FALSE - L2CAP_LE client is not connected \n
8575 int bluetooth_l2cap_le_client_is_connected(
8576 const bluetooth_device_address_t *device_address, gboolean *connected);
8579 * @fn gboolean bluetooth_l2cap_le_server_is_connected(
8580 * const bluetooth_device_address_t *device_address, gboolean *connected)
8581 * @brief Informs whether l2cap_le server is connected.
8583 * This function is a synchronous call.
8585 * @return TRUE - L2CAP_LE server is connected \n
8586 * FALSE - L2CAP_LE server is not connected \n
8592 int bluetooth_l2cap_le_server_is_connected(
8593 const bluetooth_device_address_t *device_address, gboolean *connected);
8596 * @fn gboolean bluetooth_l2cap_le_get_psm(int server_fd, int *psm)
8597 * @brief gives the psm of the specific l2cap_le socket connection.
8599 * This function is a synchronous call.
8601 * @return BLUETOOTH_ERROR_NONE - Success \n
8602 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8603 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8605 * @param[in] the socket fd of the server
8606 * @param[out] int *psm
8612 int bluetooth_l2cap_le_get_psm(int id, int *psm);
8615 * @fn gboolean bluetooth_l2cap_le_get_max_buffer_size(int *size)
8616 * @brief gives the maximum size of buffer.
8618 * This function is a synchronous call.
8620 * @return BLUETOOTH_ERROR_NONE - Success \n
8621 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8622 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8624 * @param[out] int *size
8630 int bluetooth_l2cap_le_get_max_buffer_size(int *size);
8638 #endif /* __cplusplus */
8639 #endif /* _BLUETOOTH_API_H_*/