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 */
53 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
54 a device can support */
56 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
58 #define BLUETOOTH_UUID_STRING_MAX 50
59 #define BLUETOOTH_PATH_STRING 50
61 #define BLUETOOTH_OOB_DATA_LENGTH 16
63 #define BLUETOOTH_LE_OOB_DATA_LENGTH 100
65 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
67 #define BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX 610 /**< GATT ATT value max len */
70 * This is Bluetooth Connected event role
72 #define RFCOMM_ROLE_SERVER 1
73 #define RFCOMM_ROLE_CLIENT 2
76 * This is RFCOMM default Channel Value
78 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
79 #define RFCOMM_ROBOT_PROFILE_CHANNEL 22
82 * This is L2cap LE Socket Connected event role
84 #define L2CAP_LE_ROLE_SERVER 1
85 #define L2CAP_LE_ROLE_CLIENT 2
88 * This is maximum length for search value string for PBAP Phonebook Search
90 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
93 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
96 #define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
97 #define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
100 * < This defines the maximum size of OTP server directory name
102 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
104 #define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH 500 /**< OTP Characteristics Value Max length */
107 * This is Bluetooth error code
109 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
111 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
112 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
114 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
115 /**< Callback error */
116 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
117 /**< invalid paramerror */
118 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
119 /**< invalid data error */
120 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
121 /**< Memory allocation error */
122 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
123 /**< out of memory error */
124 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
125 /**< timeout error */
126 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
127 /**< No resource error */
128 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
129 /**< internal error */
130 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
131 /**< Not supported error */
132 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
133 /**< Operation is failed because
134 of not enabled BT Adapter */
135 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
136 /**< Enabling is failed because of
137 already enabled BT Adapter */
138 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
139 /**< Operation is failed because of
140 other on going operation */
141 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
142 /**< access denied error */
143 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
144 /**< max client error */
145 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
146 /**< not found error */
147 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
148 /**< service search fail */
149 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
150 /**< pairing failed error */
151 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
152 /**< Not paired error */
153 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
154 /**< no service error */
155 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
156 /**< no connection error */
157 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
158 /**< alread connected error */
159 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
160 /**< connection busy error */
161 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
162 /**< connection error */
163 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
164 /**< max connection error*/
165 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
166 /**< Not in operation */
167 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
168 /**< Cancelled by user */
169 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
170 /**< Service record registration failed */
171 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
172 /**< Operation in progress */
173 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
174 /**< authentication failed error when paring*/
175 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
176 /**< Remote host is down */
177 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
178 /**< End of device list */
180 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
181 /**< Obex agent already exists */
182 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
183 /**< Obex agent does not exist */
185 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
186 /**< Already initialized */
188 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
189 /**< Permission deined */
191 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
192 /**< Nap already done */
194 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
195 /**< Not initialized */
197 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
198 /**< Authentication rejected */
200 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
201 /**< Device Policy Restricted */
203 #define BLUETOOTH_ERROR_NO_DATA ((int)BLUETOOTH_ERROR_BASE - 0x29)
206 #define BLUETOOTH_ERROR_AUTHORIZATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x2a)
207 /**< Authorization rejected */
210 * Error codes for ATT Error response *
212 #define BLUETOOTH_ATT_ERROR_INTERNAL -1
213 #define BLUETOOTH_ATT_ERROR_NONE 0x00
214 #define BLUETOOTH_ATT_ERROR_INVALID_HANDLE 0x01
215 #define BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED 0x02
216 #define BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED 0x03
217 #define BLUETOOTH_ATT_ERROR_INVALID_PDU 0x04
218 #define BLUETOOTH_ATT_ERROR_AUTHENTICATION 0x05
219 #define BLUETOOTH_ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06
220 #define BLUETOOTH_ATT_ERROR_INVALID_OFFSET 0x07
221 #define BLUETOOTH_ATT_ERROR_AUTHORIZATION 0x08
222 #define BLUETOOTH_ATT_ERROR_PREPARE_QUEUE_FULL 0x09
223 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0A
224 #define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0B
225 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0C
226 #define BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN 0x0D
227 #define BLUETOOTH_ATT_ERROR_UNLIKELY 0x0E
228 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0F
229 #define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10
230 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
231 /* Common profile error codes */
232 #define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED 0xFC
233 #define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED 0xFD
234 #define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS 0xFE
235 #define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE 0xFF
238 * Bluetooth ATT error codes specific to OTP
240 #define BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED 0x80
241 #define BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED 0x81
242 #define BLUETOOTH_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
243 #define BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS 0x83
246 * Bluetooth OTP error codes
247 * TODO: Check error code conflict
249 #define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
250 #define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
253 * Device disconnection reasons; received from stack
255 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
256 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
257 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
258 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
259 #define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e
260 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
261 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
262 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
263 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
264 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
265 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
266 #define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
267 #define BLUETOOTH_ERROR_INSTANT_PASSED 0x28
268 #define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f
269 #define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
270 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
273 * Device disconnect reason
276 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
277 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
278 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
279 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
280 } bluetooth_device_disconnect_reason_t;
283 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
286 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
287 } bluetooth_device_address_t;
290 * This is Bluetooth device address type
293 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
294 BLUETOOTH_DEVICE_RANDOM_ADDRESS
295 } bluetooth_device_address_type_t;
298 * This is BD Address type defined in kernel BT header
301 BLUETOOTH_BDADDR_BREDR = 0x00,
302 BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
303 BLUETOOTH_BDADDR_LE_RANDOM = 0x02
304 } bluetooth_bdaddr_type_e;
307 * This is Bluetooth version
310 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
311 } bluetooth_version_t;
314 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
317 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
318 } bluetooth_device_name_t;
321 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
324 int data_len; /**< manafacturer specific data length */
325 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
326 } bluetooth_manufacturer_data_t;
329 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
330 } bluetooth_device_pin_code_t;
333 * This is data for battery usage monitoring
337 time_t session_start_time;
338 time_t session_end_time;
342 uint32_t session_connected_time;
343 uint32_t session_scan_time;
353 } bt_battery_app_data;
359 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
360 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
361 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
362 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
363 } bluetooth_adapter_state_t;
369 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
370 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
371 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
372 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
373 } bluetooth_adapter_le_state_t;
379 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
380 /*Changed the order to make it compatable with old method */
381 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
382 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
383 /**< Discoverable mode with time limit
384 After specific timeout, it is changed
385 to non discoverable mode */
386 } bluetooth_discoverable_mode_t;
389 * Network connect mode
392 BLUETOOTH_NETWORK_PANU_ROLE,
394 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
395 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
396 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
397 } bluetooth_network_role_t;
401 * Service type matched to bt_profile_type_t of bt-service-common.h
404 BLUETOOTH_RFCOMM_SERVICE = 0x01,
405 BLUETOOTH_A2DP_SERVICE = 0x02,
406 BLUETOOTH_HSP_SERVICE = 0x04,
407 BLUETOOTH_HID_SERVICE = 0x08,
408 BLUETOOTH_NAP_SERVICE = 0x10,
409 BLUETOOTH_HFG_SERVICE = 0x20,
410 BLUETOOTH_GATT_SERVICE = 0x40,
411 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
412 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
413 BLUETOOTH_PBAP_SERVICE = 0x200,
414 } bluetooth_service_type_t;
420 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
421 /* represents that connection
422 * type can both BR/EDR and LE */
423 BLUETOOTH_DEV_CONN_BREDR = 0x00,
424 BLUETOOTH_DEV_CONN_LE = 0x01,
425 } bluetooth_conn_type_t;
431 BLUETOOTH_CODEC_ID_CVSD = 0x01,
432 BLUETOOTH_CODEC_ID_MSBC = 0x02,
433 } bluetooth_codec_type_t;
439 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
440 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
441 } bluetooth_hf_audio_connected_type_t;
447 /* TODO : Change to BLUETOOTH_EXTENDED_ADVERTISING_DATA_LENGTH_MAX
448 * once LE EXTENDED feature is supported */
449 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
450 } bluetooth_advertising_data_t;
456 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
457 } bluetooth_scan_resp_data_t;
460 * Advertising filter policy
463 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
464 BLUETOOTH_ALLOW_CONN_ALL_SCAN_ALLOW_LIST = 0x01,
465 BLUETOOTH_ALLOW_SCAN_ALL_CONN_ALLOW_LIST = 0x02,
466 BLUETOOTH_ALLOW_SCAN_CONN_ALLOW_LIST = 0x03,
467 } bluetooth_advertising_filter_policy_t;
473 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
474 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
475 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
476 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
477 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
478 } bluetooth_advertising_type_t;
481 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
482 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
483 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_RESYNC = 0x03,
484 } bluetooth_gatt_service_change_type_t;
487 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
488 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
489 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
490 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
491 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
492 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
493 } bt_gatt_permission_t;
496 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
497 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
498 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
499 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
500 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
501 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
502 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
503 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
504 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
505 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
506 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
507 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
508 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
509 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
510 } bt_gatt_characteristic_property_t;
513 * Remote device request types for attributes
516 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
517 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
518 } bluetooth_gatt_att_request_tyep_t;
521 * Proximity Property Type
524 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
525 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
526 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
527 } bluetooth_pxp_poperty_t;
533 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
534 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
535 BLUETOOTH_TDS_TRANSPORT_WIFI_NAN, /* Wi-Fi Alliance Neighbor Awareness Networking */
536 BLUETOOTH_TDS_TRANSPORT_WIFI_SVC_ADV, /* Wi-Fi Alliance Service Advertisement */
538 BLUETOOTH_TDS_TRANSPORT_INVALID
539 } bluetooth_tds_transport_t;
542 * TDS transport state
545 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
546 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
547 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
548 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
549 } bluetooth_tds_transport_state_t;
556 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
557 } bluetooth_tds_data_t;
560 * TDS activation request
563 bluetooth_device_address_t rem_addr;
564 bluetooth_tds_transport_t transport;
565 bluetooth_tds_data_t tds_data;
566 } bluetooth_tds_activation_req_t;
569 * TDS Control Point data
572 int length; /**< Control point data length */
573 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
574 } bluetooth_control_point_data_t;
577 * TDS Indication Response data
580 bluetooth_device_address_t rem_addr; /**< Device address */
581 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
582 } bluetooth_tds_indication_res_t;
585 * Structure to hold the TDS Complete data information which is read from remote TDS provider
588 bluetooth_device_address_t device_address; /**< Device address */
589 int data_length; /**< Data length */
590 char *data; /**< Complete Transport Specific data */
591 } bluetooth_tds_transport_data_info_t;
594 * OTP Characteristics Value
597 int length; /**< Characteristics value length */
598 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
599 } bluetooth_otp_charc_data_t;
602 * Structure to hold the OTP response data from remote OTP server
605 char *handle; /**< Handle */
606 int data_length; /**< Data length */
607 char *data; /**< Read data */
608 } bluetooth_otp_resp_info_t;
611 * Structure to hold the OTC Channel Info
614 gboolean connected; /**< Connection Status */
616 char *address; /**< Remote address */
617 } bluetooth_otc_info_t;
620 * Advertising parameters
625 guint8 filter_policy;
631 } bluetooth_advertising_params_t;
637 int type; /**< passive 0, active 1 */
638 float interval; /**< LE scan interval */
639 float window; /**< LE scan window */
640 } bluetooth_le_scan_params_t;
646 BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
647 BLUETOOTH_LE_ACTIVE_SCAN
648 } bluetooth_le_scan_type_t;
651 BLUETOOTH_LE_SCAN_ALL = 0x00,
652 BLUETOOTH_LE_SCAN_LEGACY_ONLY,
653 BLUETOOTH_LE_SCAN_EXTENDED_ONLY
654 } bluetooth_le_scan_role_t;
657 BLUETOOTH_ALL_PHY = 0x00,
658 BLUETOOTH_1M_PHY = 0x01,
659 BLUETOOTH_ONE_M_CODED_PHY = 0x03
660 } bleutooth_le_scanning_phy_t;
670 } bluetooth_le_connection_param_t;
673 LE Read Maximum Data Length
676 guint16 max_tx_octets;
678 guint16 max_rx_octets;
680 } bluetooth_le_read_maximum_data_length_t;
683 LE Read Host suggested default Data Length
686 guint16 def_tx_octets;
688 } bluetooth_le_read_host_suggested_data_length_t;
691 * Samsung XSAT Vendor dependent command
696 } bluetooth_vendor_dep_at_cmd_t;
702 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
703 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
704 } bluetooth_opp_transfer_type_t;
709 } bluetooth_hf_ciev_device_event_t;
711 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
712 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
713 /**< Base ID for GAP Event */
714 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
715 /**< Base ID for SDP events */
716 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
717 /**< Base ID for RFCOMM events */
718 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
719 /**< Base ID for NETWORK events */
720 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
721 /**< Base ID for HDP events */
722 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
723 /**< Base ID for OPC events */
724 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
725 /**< Base ID for Obex Server events */
726 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
727 /**< Base ID for GATT events */
729 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
730 /**< Base ID for Audio events */
731 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
732 /**< Base ID for HID events */
733 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
734 /**< Base ID for Advertising events */
735 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
736 /**< Base ID for PBAP Client events */
737 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
738 /**< Base ID for AVRCP events */
739 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
740 /**< Base ID for IPSP events */
741 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
742 /**< Base ID for MAP events */
743 #define BLUETOOTH_EVENT_MESH_BASE ((int)(BLUETOOTH_EVENT_MAP_BASE + 0x0020))
744 /**< Base ID for MAP events */
745 #define BLUETOOTH_EVENT_L2CAP_LE_BASE ((int)(BLUETOOTH_EVENT_MESH_BASE + 0x0040))
746 /**< Base ID for L2CAP_LE events */
749 * Bluetooth event type
752 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
754 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
755 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
756 BLUETOOTH_EVENT_DISABLED_BATTERY_DATA, /**< Bluetooth event adapter disabled battery data*/
757 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
758 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
759 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
760 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
761 /**< Bluetooth event Discoverable timeout requested*/
762 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
763 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
764 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
765 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
766 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
767 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
768 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
769 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
770 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
771 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
772 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
773 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
774 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
775 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
776 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
777 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
778 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
779 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
780 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
781 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
782 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
784 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
785 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
786 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
787 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
788 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
790 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
791 /**< Bluetooth event serice search base id */
792 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
793 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
794 /**< RFCOMM data receive event */
795 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
796 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
798 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
800 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
801 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
803 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
805 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
806 /**< Bluetooth Network event */
807 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
808 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
809 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
810 /**< Network disconnected evnet in server */
812 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
813 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
815 BLUETOOTH_EVENT_HDP_CONNECTED
816 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
817 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
818 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
820 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
821 /* OPC Connected event */
822 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
823 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
824 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
825 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
827 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
828 BLUETOOTH_EVENT_MAP_DISCONNECTED,
830 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
831 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
832 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
833 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
834 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
836 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
837 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
838 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
839 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
840 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
841 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
842 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
843 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
844 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
845 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
846 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
847 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
848 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
850 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
851 /* Obex server authorize event*/
852 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
853 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
854 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
855 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
856 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
857 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
859 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
860 /**<Discovered GATT service characteristics event*/
861 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
862 /**<Remote GATT charateristic value changed event*/
863 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
864 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
865 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
866 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
867 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
868 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
869 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
870 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
871 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
872 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
873 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
874 BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
875 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
876 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
877 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
878 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
879 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
880 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
881 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
882 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
883 BLUETOOTH_EVENT_GATT_SERVER_PHY_READ, /**<Local Gatt Server PHY Read event */
884 BLUETOOTH_EVENT_GATT_SERVER_PHY_UPDATED, /**<Local Gatt Server PHY Updated event */
885 BLUETOOTH_EVENT_GATT_CLIENT_PHY_READ, /**<Gatt Client PHY Read event */
886 BLUETOOTH_EVENT_GATT_CLIENT_PHY_UPDATED, /**<Gatt Client PHY Updated event */
887 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
888 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
889 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
890 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
891 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
892 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
893 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
894 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
895 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
896 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
897 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
898 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
899 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
900 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
901 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
902 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
903 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
904 BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
905 BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
906 BLUETOOTH_EVENT_HF_CONNECTED,
907 BLUETOOTH_EVENT_HF_DISCONNECTED,
908 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
909 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
910 BLUETOOTH_EVENT_HF_RING_INDICATOR,
911 BLUETOOTH_EVENT_HF_CALL_WAITING,
912 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
913 BLUETOOTH_EVENT_HF_CALL_STARTED,
914 BLUETOOTH_EVENT_HF_CALL_ENDED,
915 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
916 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
917 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
918 BLUETOOTH_EVENT_HF_CALL_STATUS,
919 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
920 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
921 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
922 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
923 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
924 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
925 BLUETOOTH_EVENT_HF_CALL_IDLE,
926 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
927 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
928 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
929 BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
931 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
932 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
933 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
934 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
935 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
937 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
938 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
939 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
940 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
941 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
942 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
943 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
944 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
946 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
947 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
948 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
949 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
950 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
951 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
952 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
954 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
955 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
956 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
957 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
958 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
959 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
960 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
961 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
962 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
964 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
965 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
966 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
967 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
968 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
969 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
970 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
971 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
972 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
973 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
974 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
976 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
977 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
978 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
979 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
980 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
981 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
982 BLUETOOTH_EVENT_MESH_SCAN_STARTED = BLUETOOTH_EVENT_MESH_BASE,
983 BLUETOOTH_EVENT_MESH_SCAN_FINISHED,
984 BLUETOOTH_EVENT_MESH_SCAN_RESULT,
985 BLUETOOTH_EVENT_MESH_AUTHENTICATION_REQUEST,
986 BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED,
987 BLUETOOTH_EVENT_MESH_NODE_BROWSED,
988 BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES,
989 BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
990 BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED,
991 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
992 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST,
993 BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
994 BLUETOOTH_EVENT_MESH_MODEL_MSG_RECEIVED,
995 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST,
996 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED,
997 BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED,
998 BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
999 BLUETOOTH_EVENT_MESH_JOIN_COMPLETED,
1000 BLUETOOTH_EVENT_L2CAP_LE_DATA_RECEIVED = BLUETOOTH_EVENT_L2CAP_LE_BASE,
1001 /**< L2CAP_LE data receive event */
1002 BLUETOOTH_EVENT_L2CAP_LE_CONNECTED, /**< L2CAP_LE server/client connect */
1003 BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED, /**< L2CAP_LE server/client disconnect */
1004 BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE,
1005 BLUETOOTH_EVENT_L2CAP_LE_SERVER_REMOVED
1006 } bluetooth_event_type_t;
1009 * This bt_service_uuid_list_t enum indicates service uuid list .
1010 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
1014 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
1015 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
1016 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
1017 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
1018 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
1019 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
1020 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
1021 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
1022 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
1023 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
1024 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
1025 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
1026 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
1028 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
1029 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
1030 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
1031 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
1032 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
1033 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
1034 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
1035 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
1036 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
1037 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
1038 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
1039 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
1040 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
1041 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
1043 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
1044 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
1045 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
1046 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
1047 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
1048 /**<DIRECT PRINTING*/
1049 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
1050 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
1051 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
1052 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
1053 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
1054 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
1055 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
1056 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
1057 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
1058 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
1059 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
1060 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
1061 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
1062 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
1063 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
1064 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
1065 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
1066 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
1067 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
1068 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
1069 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
1070 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
1071 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
1072 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
1073 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
1074 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
1075 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
1076 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
1077 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
1078 } bluetooth_service_uuid_list_t;
1081 * Service class part of class of device returned from device discovery
1084 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1085 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1086 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1087 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1088 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1089 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1090 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1091 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1092 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1093 } bluetooth_device_service_class_t;
1097 * Major device mask (For device discovery)
1100 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1101 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1102 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1103 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1104 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1105 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1106 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1107 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1108 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1109 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1110 } bluetooth_device_major_mask_t;
1114 * Major device class (part of Class of Device)
1117 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1118 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1119 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1120 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1121 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1122 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1123 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1124 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1125 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1126 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1127 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1128 } bluetooth_device_major_class_t;
1131 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1133 /* About Computer Major class */
1134 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1136 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1137 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1138 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1139 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1140 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1142 /* About Phone Major class */
1143 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1144 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1145 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1146 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1147 /**< voice gateway minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1150 /* About LAN/Network Access Point Major class */
1151 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1153 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1154 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1155 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1156 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1157 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1158 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1160 /* About Audio/Video Major class */
1161 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1162 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1164 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1165 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1166 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1167 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1168 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1169 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1170 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1171 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1172 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1173 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1174 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1175 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1176 /**< Video Display and Loud
1177 Speaker minor class */
1178 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1181 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1183 /* About Peripheral Major class */
1184 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1185 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1186 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1187 /**< Combo Keyboard or pointing
1188 device minorclass */
1190 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1191 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1192 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1193 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1194 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1195 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1196 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1197 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1198 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1200 /* About Imaging Major class */
1201 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1202 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1203 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1204 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1206 /* About Wearable Major class */
1207 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1208 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1209 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1210 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1211 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1213 /* About Toy Major class */
1214 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1215 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1216 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1217 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1218 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1220 /* About Health Major class */
1221 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1222 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1223 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1224 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1225 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1226 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1227 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1228 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1229 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1230 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1231 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1232 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1233 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1234 } bluetooth_device_minor_class_t;
1237 * structure to hold the device information
1240 bluetooth_device_major_class_t major_class; /**< major device class */
1241 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1242 bluetooth_device_service_class_t service_class;
1243 /**< service device class */
1244 } bluetooth_device_class_t;
1247 * Discovery Role types
1250 DISCOVERY_ROLE_BREDR = 0x1,
1252 DISCOVERY_ROLE_LE_BREDR
1253 } bt_discovery_role_type_t;
1256 * Connected state types
1259 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1260 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1261 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1262 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1263 } bluetooth_connected_link_t;
1269 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1270 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1271 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1272 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1273 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1274 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1275 BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80, /**< rssi high threshold */
1276 } bluetooth_le_scan_filter_feature_t;
1279 * LE connection mode
1282 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1283 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1284 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1285 } bluetooth_le_connection_mode_t;
1288 * structure to hold the device information
1291 bluetooth_device_address_t device_address; /**< device address */
1292 bluetooth_device_name_t device_name; /**< device name */
1293 bluetooth_device_class_t device_class; /**< device class */
1294 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1295 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1297 int rssi; /**< received strength signal*/
1298 gboolean paired; /**< paired flag */
1299 bluetooth_connected_link_t connected; /**< connected link type */
1300 gboolean trust; /**< trust flag */
1301 gboolean is_alias_set; /** is device alias set flag**/
1302 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1303 } bluetooth_device_info_t;
1306 * structure to hold the LE device information
1309 int data_len; /**< manafacturer specific data length */
1310 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1311 } bluetooth_le_advertising_data_t;
1314 guint8 data[BLUETOOTH_EXTENDED_ADVERTISING_DATA_LENGTH_MAX];
1315 } bluetooth_extended_advertising_data_t;
1318 gboolean use_reserved_slot;
1320 } bluetooth_le_slot_and_adv_type_t;
1323 int data_len; /**< manafacturer specific data length */
1324 bluetooth_extended_advertising_data_t data; /**< manafacturer specific data */
1325 } bluetooth_le_extended_advertising_data_t;
1328 bluetooth_device_address_t device_address; /**< device address */
1329 int addr_type; /**< address type*/
1330 int rssi; /**< received strength signal*/
1334 int advertising_sid;
1336 int periodic_adv_int;
1338 /* TODO : Replace bluetooth_le_advertising_data_t adv_ind_data with
1339 * bluetooth_le_extended_advertising_data_t once
1340 * LE_EXTENDED feature is supported */
1341 bluetooth_le_advertising_data_t adv_ind_data;
1342 bluetooth_le_advertising_data_t scan_resp_data;
1343 } bluetooth_le_device_info_t;
1347 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1348 bluetooth_device_address_t device_address; /**< device address */
1349 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1350 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1351 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1352 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1353 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1354 bluetooth_le_advertising_data_t service_data; /**< service data */
1355 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1356 int manufacturer_id; /**< manufacturer ID */
1357 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1358 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1359 int rssi_high_threshold; /**< rssi high threshold */
1360 } bluetooth_le_scan_filter_t;
1363 bluetooth_device_address_t device_address; /**< device address */
1364 unsigned int mtu; /** < MTU set for the ATT connection */
1365 unsigned int status; /** < status of the MTU exchange */
1366 } bluetooth_le_att_mtu_info_t;
1369 bluetooth_device_address_t device_address; /**< device address */
1370 int tx_phy; /** < tx_phy set for the gatt connection */
1371 int rx_phy; /** < rx_phy set for the gatt connection */
1372 int status; /** < status of the PHY */
1373 } bluetooth_le_phy_info_t;
1376 * structure to hold the paired device information
1379 bluetooth_device_address_t device_address; /**< paired device address */
1380 bluetooth_device_name_t device_name; /**< device name */
1381 bluetooth_device_class_t device_class; /**< device class */
1382 } bluetooth_paired_device_info_t;
1385 * structure to hold the paired device information
1388 bluetooth_device_address_t device_address;
1389 /**< device address */
1390 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1391 /**< network interface name */
1392 } bluetooth_network_device_info_t;
1395 * Authentication event types
1399 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1400 BLUETOOTH_AUTH_PIN_REQUEST,
1401 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1402 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1403 } bluetooth_auth_type_t;
1406 * structure to hold the pincode/pass-key req informations
1409 bluetooth_device_address_t device_address; /**< remote device address */
1410 bluetooth_device_name_t device_name; /**< device name */
1411 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1412 bool incoming; /**< stores if bonding request is incoming */
1413 } bluetooth_authentication_request_info_t;
1416 * Stucture to hold discovery option
1419 unsigned short max_response; /**< the number of maximum response */
1420 unsigned short discovery_duration;
1421 /**< duration of discovery (seconds) */
1422 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1423 classOfDevice variable */
1424 } bluetooth_discovery_option_t;
1427 * Stucture to hold event information
1430 int event; /**< event type */
1431 int result; /**< Success or error value */
1433 /**<parameter data pointer */
1435 } bluetooth_event_param_t;
1438 bluetooth_device_address_t device_addr;
1439 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1440 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1441 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1446 bluetooth_device_address_t device_addr;
1447 unsigned char addr_type;
1450 } bt_connection_info_t;
1453 * Stucture to rfcomm receive data
1458 /**< the socket fd */
1459 int buffer_size;/**< the length of the receive buffer */
1461 /**< the receive data buffer */
1462 } bluetooth_rfcomm_received_data_t;
1465 * Stucture to l2cap_le receive data
1468 int socket_fd; /**< the socket fd */
1469 int buffer_size; /**< the length of the receive buffer */
1470 char *buffer; /**< the receive data buffer */
1471 } bluetooth_l2cap_le_received_data_t;
1477 HTYPE_TRANS_HANDSHAKE,
1478 HTYPE_TRANS_HID_CONTROL,
1479 HTYPE_TRANS_GET_REPORT,
1480 HTYPE_TRANS_SET_REPORT,
1481 HTYPE_TRANS_GET_PROTOCOL,
1482 HTYPE_TRANS_SET_PROTOCOL,
1484 HTYPE_TRANS_UNKNOWN,
1485 HTYPE_TRANS_GET_IDLE = 0xF0,
1486 HTYPE_TRANS_SET_IDLE = 0xF1,
1487 } bt_hid_header_type_t;
1493 PTYPE_DATA_RTYPE_INPUT,
1494 PTYPE_DATA_RTYPE_OUTPUT
1495 } bt_hid_param_type_t;
1498 * Stucture to hid receive data
1501 const char *address;
1502 bt_hid_header_type_t type;
1503 /**< Header type containing */
1504 bt_hid_param_type_t param;
1505 /**< Param type in header like INPUT Report or OutPut Report */
1506 int buffer_size;/**< the length of the receive buffer */
1508 /**< the receive data buffer */
1509 } bluetooth_hid_received_data_t;
1512 * Stucture to rfcomm connection
1516 int socket_fd; /**< the socket fd */
1517 int server_id; /* Server id */
1518 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1519 bluetooth_device_address_t device_addr;
1520 /**< device address */
1521 char uuid[BLUETOOTH_UUID_STRING_MAX];
1522 } bluetooth_rfcomm_connection_t;
1525 * Stucture to rfcomm disconnection
1529 /**< the socket fd */
1530 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1531 bluetooth_device_address_t device_addr;
1532 /**< device address */
1533 char uuid[BLUETOOTH_UUID_STRING_MAX];
1534 } bluetooth_rfcomm_disconnection_t;
1538 /**< the socket fd */
1539 bluetooth_device_address_t device_addr;
1540 /**< device address */
1541 } bluetooth_rfcomm_connection_request_t;
1544 * Stucture to l2cap_le connection
1547 int socket_fd; /**< the socket fd */
1548 int server_id; /* Server id */
1549 int device_role; /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1550 bluetooth_device_address_t device_addr; /**< device address */
1552 } bluetooth_l2cap_le_connection_t;
1555 * Stucture to l2cap_le disconnection
1558 int socket_fd; /**< the socket fd */
1560 /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1561 bluetooth_device_address_t device_addr; /**< device address */
1563 } bluetooth_l2cap_le_disconnection_t;
1566 * Stucture to l2cap_le connection request
1569 int socket_fd; /**< the socket fd */
1570 bluetooth_device_address_t device_addr; /**< device address */
1571 } bluetooth_l2cap_le_connection_request_t;
1580 } bt_hdp_qos_type_t;
1586 HDP_ROLE_SOURCE = 0x0,
1588 } bt_hdp_role_type_t;
1592 * Stucture to HDP connected
1595 const char *app_handle; /**< the application handle */
1596 unsigned int channel_id; /**< the channel id */
1597 bt_hdp_qos_type_t type; /**< the QOS type */
1598 bluetooth_device_address_t device_address; /**< the remote address */
1599 } bt_hdp_connected_t;
1602 * Stucture to HDP disconnected
1605 unsigned int channel_id; /**< the channel id */
1606 bluetooth_device_address_t device_address; /**< the remote address */
1607 } bt_hdp_disconnected_t;
1610 * Stucture to HDP data indication
1613 unsigned int channel_id; /**< the channel id */
1614 const char *buffer; /**< the RX data buffer */
1615 unsigned int size; /**< the RX data size */
1616 } bt_hdp_data_ind_t;
1619 * Stucture to OPP client transfer information
1626 } bt_opc_transfer_info_t;
1628 /* TODO: MAP client structures, see above */
1630 * Stucture to Map filter fields
1635 } bt_map_list_filter_fields_info_t;
1637 /* Obex Server transfer type */
1638 #define TRANSFER_PUT "PUT"
1639 #define TRANSFER_GET "GET"
1641 * Stucture to OPP/FTP Server authorize information
1648 } bt_obex_server_authorize_into_t;
1656 } bt_obex_server_type_t;
1659 * Stucture to OPP/FTP server transfer information
1667 unsigned long file_size;
1669 bt_obex_server_type_t server_type;
1671 unsigned char *contact_auth_info;
1672 } bt_obex_server_transfer_info_t;
1675 * Stucture to OPP/FTP server connection/disconnection information
1681 } bt_obex_server_connection_info_t;
1685 * Stucture to OOB data
1689 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1690 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1691 unsigned int hash_len;
1692 unsigned int randomizer_len;
1694 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1695 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1696 unsigned int hash256_len;
1697 unsigned int randomizer256_len;
1699 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1700 unsigned int eir_len;
1704 * Structure to GATT attribute handle data
1710 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1711 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1712 } bt_gatt_handle_info_t;
1715 * Structure to a most basic GATT attribute handle data
1719 unsigned char uuid[16];
1720 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1721 } bt_gatt_handle_property_t;
1724 * Structure to GATT Remote service data
1731 bt_gatt_handle_info_t include_handles;
1732 bt_gatt_handle_info_t char_handle;
1733 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1734 } bt_gatt_service_property_t;
1737 * Structure to GATT Remote characteristic data
1741 char *service_handle;
1742 bt_gatt_handle_info_t handle_info;
1743 } bt_gatt_discovered_char_t;
1746 * Structure to format of GATT Characteristic Value
1750 unsigned char format;
1751 unsigned char exponent;
1752 unsigned short unit;
1753 unsigned char name_space;
1754 unsigned short description;
1755 } bt_gatt_char_format_t;
1758 * Structure to GATT Characteristic property
1766 bt_gatt_char_format_t format;
1768 unsigned int val_len;
1769 unsigned int permission;
1770 char *representation;
1771 bt_gatt_handle_info_t char_desc_handle;
1772 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1773 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1774 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1775 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1776 } bt_gatt_char_property_t;
1779 * Structure to GATT Characteristic descriptor property
1786 unsigned int val_len;
1787 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1788 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1789 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1790 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1791 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1792 } bt_gatt_char_descriptor_property_t;
1795 * Structure to GATT Characteristic value
1802 } bt_gatt_char_value_t;
1805 unsigned char UUID[16];
1809 } bt_gatt_notify_req_t ;
1812 * Structure to GATT Read Request
1816 char *service_handle;
1820 } bt_gatt_read_req_t;
1823 * Structure to GATT Value change
1827 char *service_handle;
1830 gboolean response_needed;
1834 } bt_gatt_value_change_t;
1837 bluetooth_device_address_t device_addr;
1839 bluetooth_gatt_service_change_type_t change_type;
1842 } bt_gatt_service_change_t;
1845 * Structure to GATT characteristc Notification change
1849 char *service_handle;
1850 gboolean att_notify;
1851 } bt_gatt_char_notify_change_t;
1854 * Structure to Indication confirmation
1858 char *service_handle;
1861 } bt_gatt_indicate_confirm_t;
1864 * Structure for GATT response data
1871 } bt_gatt_resp_data_t;
1874 * Structure to RSSI Signal Strength Alert
1885 * Structure to RSSI Signal Strength
1895 * Structure for RSSI Enabled or Disabled
1901 gboolean rssi_enabled;
1902 } bt_rssi_enabled_t;
1905 * Structure for RSSI Threshold
1910 int in_range_threshold;
1912 } bt_rssi_threshold_t;
1916 * Structure for Suppoted Profiles and Trusted Profiles
1923 } bt_supported_profile_trusted_t;
1926 * Structure for PBAP Folder Parameters
1929 unsigned char addressbook;
1930 unsigned char folder_type;
1934 * Structure for PBAP Pull application Parameters
1937 unsigned char format;
1938 unsigned char order;
1939 unsigned short offset;
1940 unsigned short maxlist;
1941 long long unsigned fields;
1942 } bt_pbap_pull_parameters_t;
1945 * Structure for PBAP List application Parameters
1948 unsigned char order;
1949 unsigned short offset;
1950 unsigned short maxlist;
1951 } bt_pbap_list_parameters_t;
1954 * Structure for PBAP Pull vCard application Parameters
1957 unsigned char format;
1958 long long unsigned fields;
1960 } bt_pbap_pull_vcard_parameters_t;
1963 * Structure for PBAP Search application Parameters
1966 unsigned char order;
1967 unsigned short offset;
1968 unsigned short maxlist;
1969 unsigned char search_attribute;
1970 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1971 } bt_pbap_search_parameters_t;
1974 * Structure for PBAP Connection Status
1977 bluetooth_device_address_t btaddr;
1979 } bt_pbap_connected_t;
1982 * Structure for PBAP Phonebook Size
1985 bluetooth_device_address_t btaddr;
1987 } bt_pbap_phonebook_size_t;
1990 * Structure for PBAP Phonebook Pull
1993 bluetooth_device_address_t btaddr;
1996 } bt_pbap_phonebook_pull_t;
1999 * Structure for PBAP vCard List
2002 bluetooth_device_address_t btaddr;
2006 } bt_pbap_vcard_list_t;
2009 * Structure for PBAP vCard Pull
2012 bluetooth_device_address_t btaddr;
2015 } bt_pbap_vcard_pull_t;
2018 * Structure for PBAP Phonebook search List
2021 bluetooth_device_address_t btaddr;
2025 } bt_pbap_phonebook_search_list_t;
2028 * Stucture to HF Call status information
2032 char *number; /*Phone Number */
2033 int direction; /*Direction :Incoming(1), Outgoing(0)*/
2034 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
2035 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
2036 int idx; /*Call index/ID */
2037 } bt_hf_call_status_info_t;
2042 } bt_hf_call_list_s;
2048 TRUSTED_PROFILE_PBAP = 1,
2049 TRUSTED_PROFILE_MAP,
2050 TRUSTED_PROFILE_SAP,
2051 TRUSTED_PROFILE_HFP_HF,
2052 TRUSTED_PROFILE_A2DP,
2053 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
2054 } bluetooth_trusted_profile_t;
2057 * Structure for LE data length change params
2060 bluetooth_device_address_t device_address;
2061 guint16 max_tx_octets;
2062 guint16 max_tx_time;
2063 guint16 max_rx_octets;
2064 guint16 max_rx_time;
2065 } bt_le_data_length_params_t;
2068 * Structure for proximity property change params
2071 bluetooth_device_address_t device_address;
2075 } bt_pxp_property_changed_params_t;
2078 * @brief DPM BT allowance state
2082 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
2083 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
2084 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
2085 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
2089 * @brief DPM API result
2093 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
2094 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
2095 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
2096 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
2097 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
2098 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
2102 * @brief DPM Policy status
2106 BLUETOOTH_DPM_STATUS_ERROR = -1,
2108 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
2109 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
2111 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
2112 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
2114 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2115 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2119 /* policy-group : BLUETOOTH */
2120 BLUETOOTH_DPM_POLICY_ALLOW,
2121 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2122 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2123 BLUETOOTH_DPM_POLICY_DEVICES_ALLOWLIST,
2124 BLUETOOTH_DPM_POLICY_DEVICES_BLOCKLIST,
2125 BLUETOOTH_DPM_POLICY_UUIDS_ALLOWLIST,
2126 BLUETOOTH_DPM_POLICY_UUIDS_BLOCKLIST,
2127 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2128 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2129 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2130 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2131 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2132 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2133 BLUETOOTH_DPM_POLICY_END,
2134 } bt_dpm_policy_cmd_t;
2137 struct bt_dpm_policy {
2143 typedef struct bt_dpm_policy bt_dpm_policy_t;
2146 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2147 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2148 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2149 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2150 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2151 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2152 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2153 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2154 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2155 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2156 BLUETOOTH_DPM_PROFILE_NONE,
2159 struct bt_dpm_profile_val {
2160 int value; /* tells whether the profile is enabled or disabled */
2162 typedef struct dpm_profile_val dpm_profile_state_t;
2165 * Structure to DPM device list
2169 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2170 } bt_dpm_device_list_t;
2173 * Structure to DPM uuid list
2177 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2178 } bt_dpm_uuids_list_t;
2181 * Structure for IPSP Interface Info
2184 bluetooth_device_address_t btaddr;
2186 } bt_ipsp_connection_info_t;
2190 char* remote_address;
2191 } bt_map_client_session_info_s;
2193 typedef char* bt_map_client_message_object_t;
2198 } bt_map_client_list_folders_filter_t;
2203 int8_t subject_length;
2212 } bt_map_client_list_messages_filter_t;
2215 bt_map_client_message_object_t message_object;
2220 char *sender_address;
2223 char *recipient_address;
2228 int64_t attachment_size;
2233 } bt_map_client_message_item_t;
2239 } bt_map_client_push_message_args_t;
2246 char *sender_address;
2249 char *recipient_address;
2258 } bt_map_client_message_t;
2261 char **names; // holding %size null-terminated folder names
2263 } bt_map_client_folders_s;
2266 bt_map_client_message_item_t *message_items;
2268 } bt_map_client_message_items_s;
2271 const char* target_file;
2273 } bt_get_message_callback_data;
2276 * Callback pointer type
2278 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2281 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2282 * @brief Set the callback function pointer for bluetooth event
2285 * This API will register the callback function, when any response and event are received from
2286 * bluetooth framework. @n
2287 * this registered callback function will be get called with appropriate event and data structures.
2288 * This function is a synchronous call. An application developer can call
2289 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2290 * type. This registered function will receive events of bluetooth_event_type_t type along with
2294 * @param[in] callback_ptr A pointer to the callback function
2295 * @param[in] user_data A pointer to user data
2296 * @return BLUETOOTH_ERROR_NONE - Success
2300 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2302 GMainLoop *main_loop = (GMainLoop*) user_data;
2306 // Code for each event
2308 g_main_loop_quit(main_loop);
2315 GMainLoop *main_loop = NULL;
2318 main_loop = g_main_loop_new(NULL, FALSE);
2319 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2320 if (ret >= BLUETOOTH_ERROR_NONE)
2322 // bluetooth_register_callback returned Success
2326 // bluetooth_register_callback returned failiure
2328 g_main_loop_run(main_loop);
2332 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2335 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2336 * @brief Set the callback function pointer for bluetooth le event
2339 * This API will register the callback function, when any response and event are received from
2340 * bluetooth framework. @n
2341 * this registered callback function will be get called with appropriate event and data structures.
2342 * This function is a synchronous call. An application developer can call
2343 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2344 * type. This registered function will receive events of bluetooth_event_type_t type along with
2348 * @param[in] callback_ptr A pointer to the callback function
2349 * @param[in] user_data A pointer to user data
2350 * @return BLUETOOTH_ERROR_NONE - Success
2354 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2357 * @fn int bluetooth_le_unregister_callback(void)
2358 * @brief Set the callback function pointer for bluetooth le event
2361 * This API will register the callback function, when any response and event are received from
2362 * bluetooth framework. @n
2363 * this registered callback function will be get called with appropriate event and data structures.
2364 * This function is a synchronous call. An application developer can call
2365 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2366 * type. This registered function will receive events of bluetooth_event_type_t type along with
2371 * @return BLUETOOTH_ERROR_NONE - Success
2375 int bluetooth_le_unregister_callback(void);
2378 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2379 * @brief Set the callback function pointer for bluetooth event
2382 * This API will register the callback function, when any response and event are received from
2383 * bluetooth framework. @n
2384 * this registered callback function will be get called with appropriate event and data structures.
2385 * This function is a synchronous call. An application developer can call
2386 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2387 * type. This registered function will receive events of bluetooth_event_type_t type along with
2392 * @return BLUETOOTH_ERROR_NONE - Success
2396 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2398 GMainLoop *main_loop = (GMainLoop*) user_data;
2402 // Code for each event
2404 g_main_loop_quit(main_loop);
2411 GMainLoop *main_loop = NULL;
2414 main_loop = g_main_loop_new(NULL, FALSE);
2415 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2416 if (ret >= BLUETOOTH_ERROR_NONE)
2418 // bluetooth_register_callback returned Success
2422 // bluetooth_register_callback returned failiure
2424 ret = bluetooth_deregister_callback(void);
2425 g_main_loop_run(main_loop);
2429 int bluetooth_unregister_callback(void);
2432 * @fn int bluetooth_enable_adapter(void)
2433 * @brief Enable the Bluetooth H/W
2436 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2437 * send request to bluetooth chip for activation.
2438 * This function is typically called at startup or when Bluetooth services are required. This
2439 * function must be called before calling any other API of Bluetooth operations.
2441 * Before performing any operations like Device discover, service search etc.., the adapter must be
2444 * This function is a asynchronous call.
2445 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2446 * through registered callback function with appropriate result code
2447 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2448 * BLUETOOTH_ERROR_NONE - Success \n
2450 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2451 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2453 * @return BLUETOOTH_ERROR_NONE - Success\n
2454 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2455 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2456 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2457 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2459 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2461 void bt_event_callback(int event, bluetooth_event_param_t *param)
2465 case BLUETOOTH_EVENT_ENABLED:
2466 if (param->result == BLUETOOTH_ERROR_NONE)
2468 // Successfully Enabled
2481 ret = bluetooth_enable_adapter();
2485 int bluetooth_enable_adapter(void);
2488 * @fn int bluetooth_disable_adapter(void)
2489 * @brief Disable the Bluetooth H/W
2492 * This function disables Bluetooth protocol stack and hardware. This function is called when
2493 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2495 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2496 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2497 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2499 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2502 * This function is a asynchronous call.
2503 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2504 * through registered callback function.
2507 * @return BLUETOOTH_ERROR_NONE - Success\n
2508 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2509 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2510 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2512 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2514 void bt_event_callback(int event, bluetooth_event_param_t *param)
2518 case BLUETOOTH_EVENT_DISABLED:
2519 if (param->result == BLUETOOTH_ERROR_NONE)
2521 // Successfully disabled
2534 ret = bluetooth_disable_adapter();
2537 int bluetooth_disable_adapter(void);
2538 int bluetooth_read_battery_data(bt_battery_data *latest);
2539 int bluetooth_set_battery_monitor_state(bool state);
2540 int bluetooth_get_battery_monitor_state(void);
2541 int bluetooth_recover_adapter(void);
2542 int bluetooth_check_adapter_le(void);
2543 int bluetooth_enable_adapter_le(void);
2545 int bluetooth_disable_adapter_le(void);
2546 int bluetooth_get_uuid_name(const char *uuid, char **name);
2549 * @fn int bluetooth_reset_adapter(void)
2550 * @brief Reset the Bluetooth H/W and values
2553 * This function resets Bluetooth protocol stack and hardware. This function is called when
2554 * an user want to initialize Bluetooth environment.
2556 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2559 * This function is a synchronous call.
2561 * @return BLUETOOTH_ERROR_NONE - Success\n
2562 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2564 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2569 ret = bluetooth_reset_adapter();
2572 int bluetooth_reset_adapter(void);
2575 * @fn int bluetooth_is_supported(void)
2576 * @brief Check if the bluetooth is supported or not by the current target
2578 * This API checks whether the bluetooth is supported or not.
2579 * This API only run by root permission.
2581 * This function is a synchronous call.
2583 * @return 0 - if bluetooth is not supported\n
2584 * 1 - if bluetooth is supported\n
2585 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2590 ret = bluetooth_is_supported();
2593 int bluetooth_is_supported(void);
2597 * @fn int bluetooth_check_adapter(void)
2598 * @brief Check the current status of the Bluetooth adapter
2601 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2602 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2603 * bluetooth adapter.
2604 * This API get the adapter internal data structure and check current adapter status.
2606 * This function is a synchronous call.
2609 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2610 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2612 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2616 ret = bluetooth_check_adapter();
2619 int bluetooth_check_adapter(void);
2622 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2623 * @brief Get the local adapter bluetooth address
2626 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2627 * the adapter should be enabled.
2628 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2629 * contain Bluetooth address.
2630 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2631 * friendly name for each device.
2632 * There is no event callback for this API.
2634 * This function is a synchronous call.
2637 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2638 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2639 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2640 * @param[out] local_address a device address of local bluetooth adapter
2645 bluetooth_device_address_t local_address={0,};
2648 ret = bluetooth_get_local_address(&local_address);
2651 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2654 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2655 * @brief Get the hci version
2658 * This function is used to get the bluetooth hci version
2659 * Before calling this API make sure that the adapter is enabled.
2661 * This function is a synchronous call.
2664 * @return BLUETOOTH_ERROR_NONE - Success \n
2665 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2666 * @param[out] timeout remain visibility timeout value
2669 bluetooth_version_t *version;
2671 ret = bluetooth_get_local_version (&version);
2674 int bluetooth_get_local_version(bluetooth_version_t *version);
2677 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2678 * @brief Get the local device name
2681 * This function is used, get the local device name. Since its difficult to remember the Adapter
2682 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2683 * friendly name is retrived by the remote device and displaying.
2684 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2686 * This function is a synchronous call.
2689 * @return BLUETOOTH_ERROR_NONE - Success \n
2690 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2691 * @param[out] local_name a local device name
2695 bluetooth_device_name_t local_name={0,}
2697 ret = bluetooth_get_local_name (&local_name);
2700 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2703 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2704 * @brief Set the local device name
2707 * This function is used to set the local device name. This is a human friendly name whose
2708 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2710 * This function is a synchronous call.
2712 * @param[in] local_name bluetooth device name to set local device
2714 * @return BLUETOOTH_ERROR_NONE - Success \n
2715 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2716 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2717 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2718 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2719 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2724 bluetooth_device_name_t local_name={0,}
2726 ret = bluetooth_set_local_name (&local_name);
2729 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2733 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2734 * @brief Check if the uuid is used or not
2736 * This function is used to check if the uuid is used or not.
2738 * This function is a synchronous call.
2740 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2741 * @param[out] used if the uuid is used or not
2743 * @return BLUETOOTH_ERROR_NONE - Success \n
2744 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2745 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2746 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2751 gboolean used = FALSE;
2752 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2753 ret = bluetooth_is_service_used(uuid, &used);
2756 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2759 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2760 * @brief Check if the device is connected to the specific service
2762 * This function is used to check if if the device is connected to the specific service.
2764 * This function is a synchronous call.
2766 * @param[in] local_address a device address of remote bluetooth device
2767 * @param[in] type the service type
2768 * @param[out] is_connected if the device is connected or not
2770 * @return BLUETOOTH_ERROR_NONE - Success \n
2771 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2772 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2773 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2778 gboolean is_connected = FALSE;
2779 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2780 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2783 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2784 bluetooth_service_type_t type,
2785 gboolean *is_connected);
2788 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2789 * @brief Gets device's connected link type
2791 * This function is used to get device's connected link type
2793 * This function is a synchronous call.
2795 * @param[in] device_address a device address of remote bluetooth device
2796 * @param[out] connected_link a device's connected link type
2798 * @return BLUETOOTH_ERROR_NONE - Success \n
2799 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2800 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2801 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2806 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2807 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2808 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2811 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2812 bluetooth_connected_link_t *connected_link);
2815 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2816 * @brief Sets a profile trusted for a device
2818 * This function is used to Set a profile as trusted for a device
2820 * This function is a synchronous call.
2822 * @param[in] device_address a device address of remote bluetooth device
2823 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2824 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2826 * @return BLUETOOTH_ERROR_NONE - Success \n
2827 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2828 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2829 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2833 int bluetooth_set_profile_trusted(
2834 const bluetooth_device_address_t *device_address,
2835 int profile, int trust);
2838 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2839 * @brief Gets a profile is trusted for a device
2841 * This function is used to Get a profile is trusted or not for a device
2843 * This function is a synchronous call.
2845 * @param[in] device_address a device address of remote bluetooth device
2846 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2847 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2849 * @return BLUETOOTH_ERROR_NONE - Success \n
2850 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2851 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2852 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2856 int bluetooth_get_profile_trusted(
2857 const bluetooth_device_address_t *device_address,
2858 int profile, int *trust);
2861 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2862 * @brief Get the visibility mode
2865 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2866 * visibity mode, the property of the device is determined whether it can be discoverable, non
2867 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2869 * This function is a synchronous call.
2872 * @return BLUETOOTH_ERROR_NONE - Success \n
2873 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2874 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2875 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2876 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2877 * @param[out] discoverable_mode current bluetooth discoverable mode
2879 * @see bluetooth_set_discoverable_mode
2881 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2883 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2886 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2889 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2891 * @brief Set the visibility mode
2894 * This function is used to set the discoverable mode (Visibility option).
2896 * Many times user may want to keep his device discoverable so that when peer device is performing
2897 * device search, he/she can find user's device. Application programmer can keep the mode as
2898 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2899 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2900 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2901 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2903 * This function is a synchronous call.
2905 * @return BLUETOOTH_ERROR_NONE - Success \n
2906 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2908 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2909 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2911 * @see bluetooth_get_discoverable_mode
2915 bluetooth_discoverable_mode_t mode;
2917 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2918 ret = bluetooth_set_discoverable_mode (mode, 180);
2922 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2927 * @fn int bluetooth_get_timeout_value(int *timeout)
2928 * @brief Get the visibility timeout value
2931 * This function is used to get the visibility timeout
2932 * Before calling this API make sure that the adapter is enabled.
2934 * This function is a synchronous call.
2937 * @return BLUETOOTH_ERROR_NONE - Success \n
2938 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2939 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2940 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2941 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2942 * @param[out] timeout remain visibility timeout value
2944 * @see bluetooth_set_discoverable_mode
2948 ret = bluetooth_get_timeout_value (&timeout);
2951 int bluetooth_get_timeout_value(int *timeout);
2955 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2956 * unsigned int classOfDeviceMask)
2957 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2959 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2960 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2961 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2962 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2963 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2964 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2965 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2966 * please see bluetooth_device_info_t for more details.
2969 * This API provides searching options like max responses, discovery duration in seconds and class
2970 * of device mask to filter device search. some times there may be too many bluetooth devices in
2971 * vicinity of your device.in such scenario, application can request to reduce number of responces
2972 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2973 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2974 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2975 * application defined time. please note that discovery_duration should be mentioned in seconds.
2976 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2979 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2980 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2981 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2983 * This function is a asynchronous call.
2984 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2985 * through registered callback function.
2987 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2988 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2990 * The completion or cancellation of the discovery is indicated by an
2991 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2993 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2996 * @return BLUETOOTH_ERROR_NONE - Success \n
2997 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2998 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2999 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3000 agent is not running \n
3002 * @param[in] max_response define the maximum response of the number of founded devices
3004 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3005 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3006 (refer to class of device)
3008 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3011 void bt_event_callback(int event, bluetooth_event_param_t *param)
3015 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
3017 bluetooth_device_info_t *device_info = NULL;
3018 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3020 device_info = (bluetooth_device_info_t *)param->param_data;
3021 memcpy(&searched_device, &device_info->device_address,
3022 sizeof(bluetooth_device_address_t));
3023 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3024 device_info->device_address.addr[0],
3025 device_info->device_address.addr[1],
3026 device_info->device_address.addr[2],
3027 device_info->device_address.addr[3],
3028 device_info->device_address.addr[4],
3029 device_info->device_address.addr[5]);
3032 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
3034 bluetooth_device_info_t *device_info = NULL;
3035 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
3037 device_info = (bluetooth_device_info_t *)param->param_data;
3038 memcpy(&searched_device, &device_info->device_address,
3039 sizeof(bluetooth_device_address_t));
3040 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3041 device_info->device_name.name,
3042 device_info->device_address.addr[0],
3043 device_info->device_address.addr[1],
3044 device_info->device_address.addr[2],
3045 device_info->device_address.addr[3],
3046 device_info->device_address.addr[4],
3047 device_info->device_address.addr[5]);
3051 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3052 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3057 unsigned short max_response;
3058 unsigned short discovery_duration;
3059 unsigned classOfDeviceMask;
3063 discovery_duration =0;
3064 classOfDeviceMask =0;
3066 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
3071 int bluetooth_start_discovery(unsigned short max_response,
3072 unsigned short discovery_duration,
3073 unsigned int classOfDeviceMask);
3076 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
3077 * unsigned short max_response,
3078 * unsigned short discovery_duration,
3079 * unsigned int classOfDeviceMask)
3080 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
3082 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
3083 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
3084 * Please see bluetooth_start_discovery() for other parameters description.
3086 * This function is a asynchronous call.
3087 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
3088 * through registered callback function.
3090 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
3091 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
3093 * The completion or cancellation of the discovery is indicated by an
3094 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
3096 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
3099 * @return BLUETOOTH_ERROR_NONE - Success \n
3100 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3101 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3102 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
3103 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3104 agent is not running \n
3106 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
3107 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
3108 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
3109 * @param[in] max_response define the maximum response of the number of founded devices
3111 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3112 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3113 (refer to class of device)
3115 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3118 unsigned short type;
3119 unsigned short max_response;
3120 unsigned short discovery_duration;
3121 unsigned classOfDeviceMask;
3126 discovery_duration =0;
3127 classOfDeviceMask =0;
3129 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3134 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3135 unsigned short max_response,
3136 unsigned short discovery_duration,
3137 unsigned int classOfDeviceMask);
3140 * @fn int bluetooth_cancel_discovery (void)
3141 * @brief Cancel the on-going device discovery operation
3144 * This function stops the on-going device discovery operation. This API has to be called after the
3145 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3146 * the bluetooth_start_discovery API
3148 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3149 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3150 * cancel the discover request once the user received the device to which he wish to connect.
3152 * This function is a asynchronous call.
3153 * If the call is success to cancel discovey then the application will receive
3154 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3155 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3156 * BLUETOOTH_ERROR_NONE
3159 * @return BLUETOOTH_ERROR_NONE - Success \n
3160 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3161 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3162 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3163 other application \n
3164 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3166 * @see bluetooth_start_discovery
3168 void bt_event_callback(int event, bluetooth_event_param_t *param)
3172 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3173 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3182 ret = bluetooth_cancel_discovery();
3185 int bluetooth_cancel_discovery(void);
3188 * @fn int bluetooth_start_le_discovery(void)
3189 * @brief Start the generic device discovery which finds the LE devices.
3191 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3192 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3193 * It try to find LE devices. Bluetooth device address and name are
3194 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3195 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3196 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3197 * please see bluetooth_device_info_t for more details.
3199 * This function is a asynchronous call.
3200 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3201 * through registered callback function.
3203 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3206 * The completion or cancellation of the discovery is indicated by an
3207 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3209 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3212 * @return BLUETOOTH_ERROR_NONE - Success \n
3213 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3214 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3215 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3216 agent is not running \n
3219 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3222 void bt_event_callback(int event, bluetooth_event_param_t *param)
3226 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3228 bluetooth_device_info_t *device_info = NULL;
3229 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3231 device_info = (bluetooth_device_info_t *)param->param_data;
3232 memcpy(&searched_device, &device_info->device_address,
3233 sizeof(bluetooth_device_address_t));
3234 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3235 device_info->device_address.addr[0],
3236 device_info->device_address.addr[1],
3237 device_info->device_address.addr[2],
3238 device_info->device_address.addr[3],
3239 device_info->device_address.addr[4],
3240 device_info->device_address.addr[5]);
3244 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3245 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3251 ret = bluetooth_start_discovery();
3256 int bluetooth_start_le_discovery(void);
3259 * @fn int bluetooth_stop_le_discovery (void)
3260 * @brief Cancel the on-going device LE discovery operation
3263 * This function stops the on-going device discovery operation. This API has to be called after the
3264 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3265 * the bluetooth_start_le_discovery API
3268 * This function is a asynchronous call.
3269 * If the call is success to cancel discovey then the application will receive
3270 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3271 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3272 * BLUETOOTH_ERROR_NONE
3275 * @return BLUETOOTH_ERROR_NONE - Success \n
3276 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3277 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3278 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3279 other application \n
3280 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3282 * @see bluetooth_start_discovery
3284 void bt_event_callback(int event, bluetooth_event_param_t *param)
3288 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3289 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3298 ret = bluetooth_stop_le_discovery();
3301 int bluetooth_stop_le_discovery(void);
3304 * @fn int bluetooth_is_discovering(void)
3305 * @brief Check for the device discovery is in-progress or not.
3307 * This API is used to check the current status of the Discovery operation.If discovery is in\
3308 * progress normally other operations are not allowed.
3309 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3310 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3311 * event before performing other operations. This API is used to get for the current discovery
3312 * operation status and using bluetooth_cancel_discovery()
3313 * we can cancell the ongoing discovery process.
3314 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3317 * This function checks whether the device discovery is started or not.
3319 * This function is a synchronous call.
3322 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3323 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3324 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3327 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3331 ret = bluetooth_is_discovering ();
3334 int bluetooth_is_discovering(void);
3337 * @fn int bluetooth_is_le_discovering(void)
3338 * @brief Check for the device LE discovery is in-progress or not.
3340 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3341 * progress normally other operations are not allowed.
3342 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3343 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3344 * event before performing other operations. This API is used to get for the current discovery
3345 * operation status and using bluetooth_stop_le_discovery()
3346 * we can cancell the ongoing LE discovery process.
3347 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3350 * This function checks whether the device LE discovery is started or not.
3352 * This function is a synchronous call.
3355 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3356 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3357 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3360 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3364 ret = bluetooth_is_le_discovering ();
3367 int bluetooth_is_le_discovering(void);
3370 * @fn int bluetooth_is_le_scanning(void)
3371 * @brief Check for the device LE scan is in-progress or not.
3373 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3374 * progress normally other operations are not allowed.
3376 * This function checks whether the device LE Scan is started or not.
3378 * This function is a synchronous call.
3380 * @return TRUE - LE Scan in progress \n
3381 * FALSE - LE Scan is not in progress \n
3386 gboolean is_le_scanning = 0;
3387 is_le_scanning = bluetooth_is_le_scanning ();
3390 gboolean bluetooth_is_le_scanning(void);
3392 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3395 * @fn int bluetooth_force_hcidump(int timeout)
3396 * @brief Enable /disable force-hcidump
3398 * This function control force-hcidump.
3400 * This function is a synchronous call.
3402 * @return BLUETOOTH_ERROR_NONE - Success \n
3403 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3404 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3406 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3411 int bluetooth_force_hcidump(int timeout);
3414 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3415 * @brief Register scan filter.
3417 * This function registers the scan filter.
3419 * This function is a synchronous call.
3421 * @return BLUETOOTH_ERROR_NONE - Success \n
3423 * @param[in] filter scan filter to register
3427 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3430 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3431 int link_type, bt_rssi_threshold_t rssi_threshold)
3432 * @brief Enable RSSI monitoring
3434 * This function enables RSSI monitoring and sets threshold for a connection
3436 * @return BLUETOOTH_ERROR_NONE - Success \n
3439 * @see bluetooth_get_rssi_strength
3441 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3442 int link_type, bt_rssi_threshold_t *rssi_threshold);
3445 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3446 * @brief Gets Raw RSSI signal Strength
3448 * This function gives the Raw RSSI signal strength for a connection.
3450 * @return BLUETOOTH_ERROR_NONE - Success \n
3453 * @see bluetooth_enable_rssi
3455 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3457 int bluetooth_set_connectable(gboolean is_connectable);
3459 int bluetooth_is_connectable(gboolean *is_connectable);
3461 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3464 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3465 * @brief Initiate a bonding process
3468 * This function initiates a bonding procedure with a peer device. The bonding procedure
3469 * enables authentication and optionally encryption on the Bluetooth link.
3471 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3472 * inititate the bonding request to the devices already in the paired list.
3474 * Usually we call this API after the device discovery.
3475 * This function is a asynchronous call.
3477 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3478 * mentioed result code
3479 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3480 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3481 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3482 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3483 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3485 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3486 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3489 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3492 * @return BLUETOOTH_ERROR_NONE - Success \n
3493 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3494 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3495 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3496 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3498 * @param[in] device_address This indicates an address of the device with which the pairing
3499 * should be initiated
3501 * @see bluetooth_cancel_bonding
3503 void bt_event_callback(int event, bluetooth_event_param_t *param)
3507 case BLUETOOTH_EVENT_BONDING_FINISHED:
3509 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3510 if (param->result >= BLUETOOTH_ERROR_NONE)
3512 bluetooth_device_info_t *device_info = NULL;
3513 device_info = (bluetooth_device_info_t *)param->param_data;
3514 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3515 mjr[%#x] min[%#x] srv[%#x]",
3516 device_info->device_name.name,
3517 device_info->device_address.addr[0],
3518 device_info->device_address.addr[1],
3519 device_info->device_address.addr[2],
3520 device_info->device_address.addr[3],
3521 device_info->device_address.addr[4],
3522 device_info->device_address.addr[5],
3523 device_info->device_class.major_class,
3524 device_info->device_class.minor_class,
3525 device_info->device_class.service_class);
3539 bluetooth_device_address_t device_address={{0}};
3541 ret = bluetooth_bond_device(&device_address);
3545 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3548 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3549 * bluetooth_conn_type_t conn_type)
3550 * @brief Initiate a bonding process
3553 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3554 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3556 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3557 * inititate the bonding request to the devices already in the paired list.
3559 * Usually we call this API after the device discovery.
3560 * This function is a asynchronous call.
3562 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3563 * mentioed result code
3564 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3565 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3566 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3567 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3568 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3570 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3571 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3574 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3577 * @return BLUETOOTH_ERROR_NONE - Success \n
3578 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3579 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3580 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3581 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3583 * @param[in] device_address This indicates an address of the device with which pairing
3584 * should be initiated
3585 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3588 * @see bluetooth_cancel_bonding
3590 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3591 bluetooth_conn_type_t conn_type);
3594 * @fn int bluetooth_cancel_bonding(void)
3595 * @brief Cancel the on-going bonding process
3597 * This API is called to cancel the on-going bonding procedure. It should be called before the
3598 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3599 * This API is useful when the remote device is not responding to the bond request or we wish to
3600 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3602 * This function is a synchronous call.
3604 * @return BLUETOOTH_ERROR_NONE - Success \n
3605 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3606 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3609 * @see bluetooth_bond_device
3615 ret = bluetooth_cancel_bonding();
3618 int bluetooth_cancel_bonding(void);
3621 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3622 * @brief Remove bonding
3625 * To communicate with remote device over bluetooth link, user should bond with peer device.
3626 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3627 * API is used to remove peer device from the list. Please note that after removing the device
3628 * from bonded device list, you cannot communication with peer device until bonding happens again.
3630 * User can call this function by passing bluetooth device address of any bonded device. Please note
3631 * that after successful return of this function, any bluetooth application running on your device
3632 * will not be able to communicate with unbonded device until bond operation happens again using
3633 * bluetooth_bond_device()
3636 * This function is a asynchronous call. The request to remove the specified device from the bonded
3637 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3638 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3639 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3643 * @return BLUETOOTH_ERROR_NONE - Success \n
3644 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3645 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3646 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3647 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3648 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3649 * agent is not running \n
3650 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3653 * @param[in] device_address This indicates an address of the device to remove bonding
3657 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3660 void bt_event_callback(int event, bluetooth_event_param_t *param)
3663 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3664 bluetooth_device_address_t *dev_addr = NULL;
3666 if (param->result == BLUETOOTH_ERROR_NONE) {
3667 dev_addr = (bluetooth_device_address_t *)param->param_data;
3669 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3670 dev_addr->addr[0], dev_addr->addr[1]
3671 dev_addr->addr[2], dev_addr->addr[3]
3672 dev_addr->addr[4], dev_addr->addr[5]
3683 bluetooth_device_address_t *device_address;
3685 // copy valid device address in device_address
3687 ret = bluetooth_unbond_device(device_address);
3690 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3693 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3694 * @brief Get bonded(paired) device list
3697 * This API gets all bonded device list.
3698 * The devices in the bonded device list further can be used to perform the authorization by calling
3699 * bluetooth_authorize_device API.
3701 * This function is a synchronous call.
3702 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3703 * there is no valid information in the dev_list.
3704 * The len field in the dev_list represents the number of bonded devices. The data structure for
3705 * bonded device information is bluetooth_device_info_t.
3708 * @return BLUETOOTH_ERROR_NONE - Success \n
3709 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3711 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3713 void bt_get_bonded_devices(void)
3717 GPtrArray *devinfo = NULL;
3718 bluetooth_device_info_t *ptr;
3720 // allocate the g_pointer_array
3721 devinfo = g_ptr_array_new();
3723 ret = bluetooth_get_bonded_device_list(&devinfo);
3724 if (ret != BLUETOOTH_ERROR_NONE)
3726 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3730 printf("g pointer arrary count : [%d]", devinfo->len);
3731 for (i=0; i<devinfo->len; i++)
3733 ptr = g_ptr_array_index(devinfo, i);
3736 printf("Name [%s]\n", ptr->device_name.name);
3737 printf("Major Class [%d]\n", ptr->device_class.major_class);
3738 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3739 printf("Service Class [%d]\n", ptr->device_class.service_class);
3740 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3741 ptr->device_address.addr[0],
3742 ptr->device_address.addr[1], ptr->device_address.addr[2],
3743 ptr->device_address.addr[3],
3744 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3751 // free g_pointer_array
3752 g_ptr_array_free(devinfo, TRUE);
3757 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3759 int bluetooth_get_profile_connected_device_list(
3760 const char *profile_uuid, GPtrArray **addr_list);
3763 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3764 * bluetooth_device_info_t *dev_info)
3765 * @brief Get a bonded(paired) device
3768 * This API gets a bonded device.
3770 * This function is a synchronous call.
3771 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3772 * there is no valid information in the dev_info.
3773 * The data structure for bonded device information is bluetooth_device_info_t.
3776 * @return BLUETOOTH_ERROR_NONE - Success \n
3777 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3779 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3781 void bt_get_bonded_device(void)
3785 bluetooth_device_info_t devinfo = {0};
3786 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3788 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3789 if (ret != BLUETOOTH_ERROR_NONE)
3791 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3795 printf("Name [%s]\n", devinfo.device_name.name);
3796 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3797 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3798 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3799 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3800 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3801 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3802 devinfo.device_address.addr[5]);
3811 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3812 bluetooth_device_info_t *dev_info);
3815 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3816 * gboolean *is_alias_set)
3817 * @brief Get is_alias_set property of device
3819 * This API gets is_alias_set property of a bonded device.
3821 * This function is a synchronous call.
3822 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3823 * If not,there is no valid information in the is_alias_set.
3825 * @return BLUETOOTH_ERROR_NONE - Success \n
3826 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3831 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3833 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3836 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3837 gboolean *is_alias_set);
3840 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3841 * @brief set alias for bonded device
3844 * This function set alias for bonded device.
3846 * This function is a synchronous call.
3849 * @return BLUETOOTH_ERROR_NONE - Success \n
3850 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3851 * @param[in] device_address This indicates an address of the remote device
3852 * @param[in] alias This indicates an alias to set
3857 ret = bluetooth_set_alias(&remote_address);
3860 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3864 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3865 * @brief Get remote deivice
3868 * This function gets specific remote device.
3870 * This function is a asynchronous call.
3871 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3874 * @return BLUETOOTH_ERROR_NONE - Success \n
3875 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3876 * @param[in] device_address This indicates an address of the remote device
3881 ret = bluetooth_get_remote_device(&remote_address);
3884 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3887 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3888 * gboolean authorized)
3889 * @brief Authorize/Unauthorize a bonded device
3892 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3893 * with/without user confirmation.
3895 * If we select a paired device and make it authorized by calling this API with the authorized
3896 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3897 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3898 * then it will ask for the user conformation before the connection.
3900 * This API supposed to be called on the paired devices. Which means we have to use this API only
3901 * after successful pairing.
3903 * This function is a asynchronous call.
3904 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3906 * @return BLUETOOTH_ERROR_NONE - Success \n
3907 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3908 * @param[in] device_address This indicates an address of the device to authorize \n
3909 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3911 * @see bluetooth_get_bonded_device_list
3913 void bt_event_callback(int event, bluetooth_event_param_t *param)
3917 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3919 if (param->result == BLUETOOTH_ERROR_NONE)
3923 //device authorization failed failure
3931 bluetooth_device_address_t device_address={{0}};
3932 gboolean authorized;
3936 ret = bluetooth_authorize_device(&device_address,authorized);
3939 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3940 gboolean authorized);
3942 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3943 const bluetooth_device_pin_code_t *pin_code);
3945 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3948 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3950 * @brief Receives Legacy Passkey\pin with following authentication response types
3952 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3953 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3956 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3959 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3961 * @brief This API sends user confirmation reply to the local adapter.
3963 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3966 int bluetooth_passkey_confirmation_reply(gboolean reply);
3969 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3970 * @brief Get all services supported by remote device
3973 * This API call initiates the search for the services supported by the specified device. Normally
3974 * the service search will take a couple of seconds to get it completed. Before calling this API
3975 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3976 * perform the service search. We can get the device address by doing a device discovery operation.
3979 * This function is a asynchronous call.
3980 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3982 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3983 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3984 * event is generated with appropriate result code.
3986 * @return BLUETOOTH_ERROR_NONE - Success \n
3987 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3988 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3989 * @param[in] device_address This indicates an address of the device
3990 * whose services need to be found
3992 * @see bluetooth_cancel_service_search
3994 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3997 * @fn int bluetooth_cancel_service_search(void)
3998 * @brief Cancel the ongoing service search operation
4001 * This function cancel the ongoing service search operation. This API is usually calling after the
4002 * bluetooth_search_service API.
4003 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
4004 * if the user wish to cancel the Ongoing service search operation.
4006 * This API should be called just after the bluetooth_search_service API and before the
4007 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
4009 * This function is a synchronous call.
4011 * @return BLUETOOTH_ERROR_NONE - Success \n
4012 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
4013 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
4014 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
4017 * @see bluetooth_search_service
4022 ret = bluetooth_cancel_service_search();
4025 int bluetooth_cancel_service_search(void);
4028 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
4029 * @brief Register rfcomm socket with a specific uuid
4032 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4033 * descriptor of the server.
4034 * This is the first API which is called to create the server. Once we created the server socket,
4035 * we will listen on that return socket.
4036 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
4039 * @return socket FD on Success \n
4040 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4041 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4042 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4043 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4044 * @param[in] UUID (128 bits)
4047 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
4051 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4052 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4056 int bluetooth_rfcomm_create_socket(const char *uuid);
4059 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
4060 * @brief Register rfcomm socket with a specific uuid
4063 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4064 * descriptor of the server.
4065 * This is the first API which is called to create the server. Once we created the server socket,
4066 * we will listen on that return socket.
4067 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
4070 * @return socket FD on Success \n
4071 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4072 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4073 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4074 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4075 * @param[in] UUID (128 bits)
4076 * @param[in] bus_name (const char)
4077 * @param[in] path (const char)
4080 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
4084 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4085 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
4089 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
4092 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
4093 * @brief De-register the rfcomm socket
4096 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
4097 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4098 * descriptor else no event will come. We will call this API only after the
4099 * bluetooth_rfcomm_listen_and_accept.
4100 * This is a synchronous call.
4102 * @return BLUETOOTH_ERROR_NONE - Success \n
4103 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4104 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4105 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4106 * @param[in] int socket_fd
4109 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
4112 void bt_event_callback(int event, bluetooth_event_param_t *param)
4116 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4118 bluetooth_rfcomm_connection_t *discon_ind =
4119 (bluetooth_rfcomm_connection_t *)param->param_data;
4121 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4129 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4130 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4132 ret = bluetooth_rfcomm_remove_socket(fd);
4135 int bluetooth_rfcomm_remove_socket(int socket_fd);
4138 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4139 * @brief De-register the rfcomm socket
4142 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4143 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4144 * descriptor else no event will come. We will call this API only after the
4145 * bluetooth_rfcomm_listen_and_accept_ex.
4146 * This is a synchronous call.
4148 * @return BLUETOOTH_ERROR_NONE - Success \n
4149 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4150 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4151 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4152 * @param[in] UUID (128 bits)
4155 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4158 void bt_event_callback(int event, bluetooth_event_param_t *param)
4162 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4164 bluetooth_rfcomm_connection_t *discon_ind =
4165 (bluetooth_rfcomm_connection_t *)param->param_data;
4167 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4175 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4176 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4178 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4181 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4184 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4185 * @brief Disconnect rfcomm connection
4188 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4189 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4192 * @return BLUETOOTH_ERROR_NONE - Success \n
4193 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4194 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4195 * @param[in] int socket_fd the sending socket fd
4201 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4203 printf("Disconnection failed");
4205 printf("Disconnection Success");
4209 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4212 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4213 * @brief Rfcomm socket listen
4216 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4217 * after the bluetooth_rfcomm_create_socket API.
4218 * This API listen for the incomming connection and once it receives a connection, it will give
4219 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4220 * event to the application. This is an Asynchronous API call.
4223 * @return BLUETOOTH_ERROR_NONE - Success \n
4224 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4225 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4227 * @param[in] int socket_fd
4228 * @param[in] max pending connection.
4231 * @see bluetooth_rfcomm_create_socket
4234 void bt_event_callback(int event, bluetooth_event_param_t* param)
4238 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4240 bluetooth_rfcomm_connection_t *conn_ind =
4241 (bluetooth_rfcomm_connection_t *)param->param_data;
4243 printf("\nConnected from FD %d", conn_ind->socket_fd);
4251 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4252 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4256 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4259 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4260 * @brief Rfcomm socket listen
4263 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4264 * after the bluetooth_rfcomm_create_socket API.
4265 * This API listen for the incomming connection and once it receives a connection, it will give
4266 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4267 * event to the application. This is an Asynchronous API call.
4270 * @return BLUETOOTH_ERROR_NONE - Success \n
4271 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4272 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4274 * @param[in] int socket_fd
4275 * @param[in] max pending connection.
4280 * @see bluetooth_rfcomm_create_socket_ex
4283 void bt_event_callback(int event, bluetooth_event_param_t* param)
4287 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4289 bluetooth_rfcomm_connection_t *conn_ind =
4290 (bluetooth_rfcomm_connection_t *)param->param_data;
4292 printf("\nConnected from FD %d", conn_ind->socket_fd);
4300 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4301 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4306 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4309 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4310 * @brief Rfcomm socket listen
4313 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4314 * after the bluetooth_rfcomm_create_socket API.
4315 * This API listen for the incomming connection and once it receives a connection, it will give
4316 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4317 * event to the application. This is an Asynchronous API call.
4320 * @return BLUETOOTH_ERROR_NONE - Success \n
4321 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4322 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4324 * @param[in] int socket_fd
4325 * @param[in] max pending connection.
4328 * @see bluetooth_rfcomm_create_socket
4331 void bt_event_callback(int event, bluetooth_event_param_t* param)
4335 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4337 char *name = (char *)param->param_data;
4339 printf("\nConnected from %s", name);
4341 bluetooth_rfcomm_accept_connection();
4349 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4350 ret = bluetooth_rfcomm_listen(fd, 1);
4354 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4357 * @fn int bluetooth_rfcomm_accept_connection()
4358 * @brief Accepts the authorization request indicated by the event
4359 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4361 * This function is a synchronous call.
4363 * @return BLUETOOTH_ERROR_NONE - Success \n
4364 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4366 * @param[in] the socket fd of the server
4367 * @param[out] the socket fd of the client
4371 * @see bluetooth_rfcomm_reject_connection
4373 int bluetooth_rfcomm_accept_connection(int server_fd);
4376 * @fn int bluetooth_rfcomm_reject_connection()
4377 * @brief Rejects the authorization request indicated by the event
4378 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4380 * This function is a synchronous call.
4382 * @return BLUETOOTH_ERROR_NONE - Success \n
4383 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4385 * @param[in] the socket fd of the server
4389 * @see bluetooth_rfcomm_accept_connection
4391 int bluetooth_rfcomm_reject_connection(int server_fd);
4394 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4395 * @brief Informs whether rfcomm server uuid is available or not.
4397 * This function is a synchronous call.
4399 * @return TRUE - RFCOMM uuid is available \n
4400 * FALSE - RFCOMM uuid is not available \n
4402 * @param[in] uuid UUID string
4408 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4411 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4412 * const char *remote_uuid)
4413 * @brief Connect to the remote device rfcomm *
4415 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4416 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4417 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4418 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4419 * initiating a connection.
4421 * @return BLUETOOTH_ERROR_NONE - Success \n
4422 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4423 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4424 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4425 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4426 * @param[in] bluetooth_device_address_t remote bt_address
4427 * @param[in] char remote uuid
4429 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4433 void bt_event_callback(int event, bluetooth_event_param_t *param)
4437 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4439 if (param->result >= BLUETOOTH_ERROR_NONE)
4441 bt_sdp_info_t *bt_sdp_info=param->param_data;
4443 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4444 bt_sdp_info->device_addr.addr[0],
4445 bt_sdp_info->device_addr.addr[1],
4446 bt_sdp_info->device_addr.addr[2],
4447 bt_sdp_info->device_addr.addr[3],
4448 bt_sdp_info->device_addr.addr[4],
4449 bt_sdp_info->device_addr.addr[5]);
4451 printf("Supported service list:\n");
4452 for(i=0; i<bt_sdp_info->service_index; i++)
4454 bt_sdp_info->service_list_array[i]);
4457 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4458 //rfcomm_test_uuid);
4462 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4464 bluetooth_rfcomm_connection_t *conn_ind =
4465 (bluetooth_rfcomm_connection_t *)param->param_data;
4467 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4468 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4469 "SERVER" : "CLIENT");
4474 bluetooth_device_address_t remote_address = {{0},};
4475 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4476 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4477 ret = bluetooth_search_service(&remote_address);
4479 printf("Seach failed, Reason = %d", ret);
4481 printf("Search Success, Ret = %d", ret);
4483 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4485 printf("Connection failed, Reason = %d", ret);
4487 printf("Connection Success, Ret = %d", ret);
4491 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4492 const char *remote_uuid);
4495 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4496 * @brief Disconnect rfcomm connection
4499 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4500 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4503 * @return BLUETOOTH_ERROR_NONE - Success \n
4504 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4505 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4506 * @param[in] char remote bt_address
4509 * @see bluetooth_rfcomm_connect
4513 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4515 printf("Disconnection failed");
4517 printf("Disconnection Success");
4522 int bluetooth_rfcomm_disconnect(int socket_fd);
4525 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4526 * @brief Write to rfcomm connection
4529 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4530 * API is used to send the data for server and the client.
4532 * @return BLUETOOTH_ERROR_NONE - Success \n
4533 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4534 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4536 * @param[in] const char *buff Data buffer to send
4537 * @param[in] int length Length of the data
4540 * @see bluetooth_rfcomm_connect
4543 char *buff = "Test data 123456789"
4544 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4546 printf("Send failed");
4548 printf("Send success");
4552 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4555 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4556 * @brief Informs whether rfcomm client is connected.
4558 * This function is a synchronous call.
4560 * @return TRUE - RFCOMM client is connected \n
4561 * FALSE - RFCOMM client is not connected \n
4567 gboolean bluetooth_rfcomm_is_client_connected(void);
4568 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4569 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4572 * @fn int bluetooth_network_activate_server(void)
4573 * @brief Activate the NAP (Network Access Point) service
4575 * This function is a asynchronous call.
4576 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4578 * @return BLUETOOTH_ERROR_NONE - Success \n
4579 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4580 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4581 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4584 * @see bluetooth_network_deactivate_server
4587 int bluetooth_network_activate_server(void);
4590 * @fn int bluetooth_network_deactivate_server(void)
4591 * @brief Deactivate the NAP (Network Access Point) service
4593 * This function is a asynchronous call.
4594 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4596 * @return BLUETOOTH_ERROR_NONE - Success \n
4597 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4598 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4599 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4602 * @see bluetooth_network_activate_server
4605 int bluetooth_network_deactivate_server(void);
4608 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4609 * bluetooth_network_role_t role,
4611 * @brief Connect the network server in the peer
4613 * This function is a asynchronous call.
4614 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4616 * @return BLUETOOTH_ERROR_NONE - Success \n
4617 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4618 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4619 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4622 * @param[in] device_address This indicates an address of the device with which the pairing
4623 * should be initiated
4624 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4625 * need to use the third parameter.
4626 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4627 * connect. UUID string
4629 * @see bluetooth_network_disconnect
4631 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4632 bluetooth_network_role_t role, char *custom_uuid);
4635 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4636 * bluetooth_network_role_t role,
4637 * char *custom_uuid)
4638 * @brief Connect the network server in the peer
4640 * This function is a asynchronous call.
4641 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4643 * @return BLUETOOTH_ERROR_NONE - Success \n
4644 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4645 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4646 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4649 * @param[in] device_address This indicates an address of the device with which the pairing
4650 * should be initiated
4652 * @see bluetooth_network_connect
4654 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4657 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4658 * @brief Disconnect the device from the network
4660 * This function is an asynchronous call.
4661 * The network server disconnect request is responded by
4662 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4664 * @return BLUETOOTH_ERROR_NONE - Success \n
4665 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4666 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4667 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4670 * @param[in] device_address This indicates an address of the connected client device
4672 * @see bluetooth_network_activate_server
4674 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4679 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4680 * bt_hdp_role_type_t role,
4681 * bt_hdp_qos_type_t channel_type,
4682 * char **app_handle)
4683 * @brief Activate the HDP service for a particular data type
4685 * This function is a synchronous call.
4687 * @return BLUETOOTH_ERROR_NONE - Success \n
4688 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4689 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4690 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4693 * @param[in] data_type The data type against corresponding service
4694 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4695 * @param[in] channel_type The QOS type for the channel.
4696 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4697 * For role = HDP_ROLE_SINK, the channel_type
4698 * should be HDP_QOS_ANY.
4699 * @param[out] app_handle The application handler against corresponding service
4701 * @see bluetooth_hdp_deactivate
4703 int bluetooth_hdp_activate(unsigned short data_type,
4704 bt_hdp_role_type_t role,
4705 bt_hdp_qos_type_t channel_type,
4708 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4709 * @brief Deactivate the HDP service for a particular service using the handler
4711 * This function is a synchronous call.
4713 * @return BLUETOOTH_ERROR_NONE - Success \n
4714 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4715 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4716 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4719 * @param[in] app_handle The application handler against corresponding service
4721 * @see bluetooth_hdp_deactivate
4723 int bluetooth_hdp_deactivate(const char *app_handle);
4726 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4727 * const char *buffer, unsigned int size)
4728 * @brief Send data to the remote HDP device
4730 * This function is a synchronous call.
4732 * @return BLUETOOTH_ERROR_NONE - Success \n
4733 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4734 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4735 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4736 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4739 * @param[in] channel_id The channel id for the connection.
4740 * @param[in] buffer The pdu buffer.
4741 * @param[in] size Size of the buffer.
4743 * @see bluetooth_hdp_connect
4745 int bluetooth_hdp_send_data(unsigned int channel_id,
4746 const char *buffer, unsigned int size);
4748 * @fn int bluetooth_hdp_connect(const char *app_handle,
4749 * bt_hdp_qos_type_t channel_type,
4750 * const bluetooth_device_address_t *device_address)
4751 * @brief Connect to the remote device(Mainly used by source)
4753 * This function is a asynchronous call.
4754 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4756 * @return BLUETOOTH_ERROR_NONE - Success \n
4757 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4758 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4759 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4760 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4763 * @param[in] app_handle The application handler against corresponding service
4764 * @param[in] channel_type The QOS type for the channel.
4765 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4766 * @param[in] device_address The remote device Bd address.
4769 * @see bluetooth_hdp_disconnect
4771 int bluetooth_hdp_connect(const char *app_handle,
4772 bt_hdp_qos_type_t channel_type,
4773 const bluetooth_device_address_t *device_address);
4775 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4776 * const bluetooth_device_address_t *device_address)
4777 * @brief Disconnect from the remote device(Mainly used by source)
4779 * This function is a asynchronous call.
4780 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4782 * @return BLUETOOTH_ERROR_NONE - Success \n
4783 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4784 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4785 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4786 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4789 * @param[in] channel_id The channel id for the connection.
4790 * @param[in] device_address The remote device Bd address.
4793 * @see bluetooth_hdp_connect
4795 int bluetooth_hdp_disconnect(unsigned int channel_id,
4796 const bluetooth_device_address_t *device_address);
4800 * @fn int bluetooth_opc_init(void)
4801 * @brief Initialize OPP client.
4803 * This function is a synchronous call.
4804 * No event corresponding to this api
4806 * @return BLUETOOTH_ERROR_NONE - Success \n
4807 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4808 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4809 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4810 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4815 * @see bluetooth_opc_deinit
4817 int bluetooth_opc_init(void);
4820 * @fn int bluetooth_opc_deinit(void)
4821 * @brief Deinitialize OPP client.
4823 * This function is a synchronous call.
4824 * No event corresponding to this api
4826 * @return BLUETOOTH_ERROR_NONE - Success \n
4827 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4828 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4833 * @see bluetooth_opc_init
4836 int bluetooth_opc_deinit(void);
4839 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4840 char **file_name_array)
4841 * @brief Send multiple files to a remote device.
4843 * This function is a asynchronous call.
4844 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4846 * @return BLUETOOTH_ERROR_NONE - Success \n
4847 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4848 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4849 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4850 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4851 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4852 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4855 * @param[in] device_address The remote device Bd address.
4856 * @param[in] file_name_array Array of filepaths to be sent.
4859 * @see bluetooth_opc_cancel_push
4862 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4863 char **file_name_array);
4866 * @fn int bluetooth_opc_cancel_push(void)
4867 * @brief Cancels the ongoing file push.
4869 * This function is a asynchronous call.
4870 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4871 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4873 * @return BLUETOOTH_ERROR_NONE - Success \n
4874 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4875 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4880 * @see bluetooth_opc_push_files
4883 int bluetooth_opc_cancel_push(void);
4886 * @fn gboolean bluetooth_opc_session_is_exist(void)
4887 * @brief Informs whether opc session exists or not.
4889 * This function is a synchronous call.
4891 * @return TRUE - OPC session exists \n
4892 * FALSE - OPC session does not exist \n
4900 gboolean bluetooth_opc_session_is_exist(void);
4903 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4904 * @brief Informs whether opc session exists or not.
4906 * This function is a synchronous call.
4908 * @return BLUETOOTH_ERROR_NONE - Success \n
4909 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4910 * BLUETOOTH_ERROR_INTERNAL \n
4913 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4918 int bluetooth_opc_is_sending(gboolean *is_sending);
4921 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4922 int transfer_id, unsigned char *progress)
4923 * @brief Gets the percentage progress for ongoing transfers.
4925 * This function is a synchronous call.
4927 * @return BLUETOOTH_ERROR_NONE - Success \n
4928 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4929 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4932 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4933 * @param[in] transfer_id Transfer ID
4934 * @param[out] progress Percentage Progress
4938 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4939 int transfer_id, unsigned char *progress);
4942 * @fn int bluetooth_obex_server_init(const char *dst_path)
4943 * @brief Initialize OPP and FTP server.
4945 * This function is a synchronous call.
4946 * No event corresponding to this api
4948 * @return BLUETOOTH_ERROR_NONE - Success \n
4949 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4950 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4951 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4952 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4955 * @param[in] dst_path OPS destination file path.
4957 * @see bluetooth_obex_server_deinit
4959 int bluetooth_obex_server_init(const char *dst_path);
4963 * @fn int bluetooth_obex_server_deinit(void)
4964 * @brief Deinitialize OPP and FTP server.
4966 * This function is a synchronous call.
4967 * No event corresponding to this api
4969 * @return BLUETOOTH_ERROR_NONE - Success \n
4970 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4971 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4976 * @see bluetooth_obex_server_init
4978 int bluetooth_obex_server_deinit(void);
4982 * @fn gboolean bluetooth_obex_server_is_activated(void)
4983 * @brief Informs whether obex server is activated or not.
4985 * This function is a synchronous call.
4987 * @return TRUE - OBEX server is activated \n
4988 * FALSE - OBEX server is not activated \n
4995 gboolean bluetooth_obex_server_is_activated(void);
4999 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
5000 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
5002 * This function is a synchronous call.
5003 * No event corresponding to this api
5005 * @return BLUETOOTH_ERROR_NONE - Success \n
5006 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5007 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5008 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
5009 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5013 * @param[in] dst_path OPS destination file path.
5015 * @see bluetooth_obex_server_deinit_without_agent
5017 int bluetooth_obex_server_init_without_agent(const char *dst_path);
5021 * @fn int bluetooth_obex_server_deinit_without_agent(void)
5022 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
5024 * This function is a synchronous call.
5025 * No event corresponding to this api
5027 * @return BLUETOOTH_ERROR_NONE - Success \n
5028 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5029 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5034 * @see bluetooth_obex_server_init_without_agent
5036 int bluetooth_obex_server_deinit_without_agent(void);
5040 * @fn int bluetooth_obex_server_accept_connection(void)
5041 * @brief Accepts the authorization request indicated by the event
5042 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5044 * This function is a synchronous call.
5046 * @return BLUETOOTH_ERROR_NONE - Success \n
5047 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5048 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5052 * @see bluetooth_obex_server_reject_authorize
5054 int bluetooth_obex_server_accept_connection(void);
5058 * @fn int bluetooth_obex_server_reject_connection(void)
5059 * @brief Rejects the authorization request indicated by the event
5060 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5062 * This function is a synchronous call.
5064 * @return BLUETOOTH_ERROR_NONE - Success \n
5065 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5066 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5070 * @see bluetooth_obex_server_reject_authorize
5072 int bluetooth_obex_server_reject_connection(void);
5076 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
5077 * @brief Accepts the authorization request indicated by the event
5078 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5080 * This function is a asynchronous call.
5081 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
5083 * @return BLUETOOTH_ERROR_NONE - Success \n
5084 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5085 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5086 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5089 * @param[in] filename Authorized filename.
5092 * @see bluetooth_obex_server_reject_authorize
5095 int bluetooth_obex_server_accept_authorize(const char *filename);
5098 * @fn int bluetooth_obex_server_reject_authorize(void)
5099 * @brief Reject the authorization request indicated by the event
5100 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5102 * This function is a asynchronous call.
5103 * No event for this api..
5105 * @return BLUETOOTH_ERROR_NONE - Success \n
5106 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5107 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5112 * @see bluetooth_obex_server_accept_authorize
5115 int bluetooth_obex_server_reject_authorize(void);
5118 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5119 * @brief Set the OPS destination file path..
5121 * This function is a asynchronous call.
5122 * No event for this api..
5124 * @return BLUETOOTH_ERROR_NONE - Success \n
5125 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5126 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5127 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5130 * @param[in] dst_path OPS destination file path.
5136 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5139 * @fn int bluetooth_obex_server_set_root(const char *root)
5140 * @brief Set the FTS root folder..
5142 * This function is a asynchronous call.
5143 * No event for this api..
5145 * @return BLUETOOTH_ERROR_NONE - Success \n
5146 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5147 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5148 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5149 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5150 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5153 * @param[in] root FTS root folder.
5159 int bluetooth_obex_server_set_root(const char *root);
5162 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5163 * @brief Cancel the transfer on server
5165 * This function is an asynchronous call.
5166 * If the function call that cancels transfer is successful, the application would receive
5167 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5168 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5169 * the error code will be BLUETOOTH_ERROR_NONE
5171 * @return BLUETOOTH_ERROR_NONE - Success \n
5172 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5173 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5174 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5175 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5178 * @param[in] transfer_id transfer ID
5183 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5187 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5188 * @brief Cancel the transfer on server
5190 * This function is an asynchronous call.
5191 * If the function call that cancels transfer is successful, the application would receive
5192 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5193 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5194 * the error code will be BLUETOOTH_ERROR_NONE
5196 * @return BLUETOOTH_ERROR_NONE - Success \n
5197 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5198 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5199 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5200 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5207 int bluetooth_obex_server_cancel_all_transfers(void);
5211 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5212 * @brief Informs whether obex server is receiving or not.
5214 * This function is a synchronous call.
5216 * @return BLUETOOTH_ERROR_NONE - Success \n
5217 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5218 * BLUETOOTH_ERROR_INTERNAL \n
5221 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5226 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5230 * @fn int bluetooth_map_client_init(void)
5231 * @brief Initialize MAP client.
5233 * This function is a synchronous call.
5234 * No event corresponding to this api
5236 * @return BLUETOOTH_ERROR_NONE - Success \n
5237 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5238 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5239 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5240 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5245 * @see bluetooth_map_client_deinit
5247 int bluetooth_map_client_init(void);
5249 int bluetooth_map_client_deinit(void);
5251 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5253 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5255 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5257 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5258 bt_map_client_list_folders_filter_t *filter);
5261 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5262 * @brief Return all available fields that can be used in Fields filter.
5264 * This function is a asynchronous call.
5266 * @return BLUETOOTH_ERROR_NONE - Success \n
5267 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5268 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5271 * @param[in] session Information about session.
5274 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5276 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5278 bt_map_client_list_messages_filter_t *filter);
5280 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5282 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5283 const char *source_file,
5285 bt_map_client_push_message_args_t *args);
5287 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5288 const bt_map_client_message_object_t message_object,
5289 const char *target_file,
5294 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5295 * @brief Read the local Hash and Randmizer.
5297 * This function is a synchronous call.
5299 * @return BLUETOOTH_ERROR_NONE - Success \n
5300 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5304 * @param[out] local_oob_data - Pointer to the local OOB data
5310 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5314 * @fn int bluetooth_oob_add_remote_data(
5315 * const bluetooth_device_address_t *remote_device_address,
5316 * bluetooth_bdaddr_type_e address_type,
5317 * bt_oob_data_t *oob_data)
5318 * @brief Add/updated the remote device Hash and Randmizer.
5320 * This function is a synchronous call.
5321 * No event for this api..
5323 * @return BLUETOOTH_ERROR_NONE - Success \n
5324 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5327 * @param[in] remote_device_address - Remote device address
5328 * address_type - bdaddr type
5329 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5335 int bluetooth_oob_add_remote_data(
5336 const bluetooth_device_address_t *remote_device_address,
5337 bluetooth_bdaddr_type_e address_type,
5338 bt_oob_data_t *remote_oob_data);
5342 * @fn int bluetooth_oob_remove_remote_data(
5343 * const bluetooth_device_address_t *remote_device_address)
5344 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5346 * This function is a synchronous call.
5347 * No event for this api..
5349 * @return BLUETOOTH_ERROR_NONE - Success \n
5350 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5353 * @param[in] remote_device_address - Remote device address
5359 int bluetooth_oob_remove_remote_data(
5360 const bluetooth_device_address_t *remote_device_address);
5364 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5365 * @brief Read the local Hash and Randmizer.
5367 * This function is a synchronous call.
5369 * @return BLUETOOTH_ERROR_NONE - Success \n
5370 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5374 * @param[out] local_oob_data - Pointer to the local OOB data
5379 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5382 * @fn int bluetooth_le_oob_add_remote_data(
5383 * const bluetooth_device_address_t *remote_device_address,
5384 * bluetooth_bdaddr_type_e address_type,
5385 * bt_oob_data_t *oob_data)
5386 * @brief Add/updated the remote device Hash and Randmizer.
5388 * This function is a synchronous call.
5389 * No event for this api..
5391 * @return BLUETOOTH_ERROR_NONE - Success \n
5392 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5395 * @param[in] remote_device_address - Remote device address
5396 * address_type - bdaddr type
5397 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5402 int bluetooth_le_oob_add_remote_data(
5403 const bluetooth_device_address_t *remote_device_address,
5404 bluetooth_bdaddr_type_e address_type,
5405 bt_oob_data_t *remote_oob_data);
5408 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5409 * bt_gatt_handle_info_t *prim_svc);
5411 * @brief Gets the GATT based primary services handle supported by remote device
5413 * This function is a synchronous call.
5414 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5416 * @return BLUETOOTH_ERROR_NONE - Success \n
5417 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5418 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5419 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5422 * @param[in] address - Remote device address
5423 * @param[out] prim_svc - Structure containing remote service count and handle list.
5426 * @see bluetooth_gatt_free_primary_services()
5428 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5429 bt_gatt_handle_info_t *prim_svc);
5432 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5434 * @brief Discovers the characteristics of GATT based service of remote device
5436 * This function is an asynchronous call.
5437 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5439 * @return BLUETOOTH_ERROR_NONE - Success \n
5440 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5441 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5442 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5445 * @param[in] service_handle - Handle for remote service.
5450 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5452 int bluetooth_gatt_set_service_change_watcher(
5453 const bluetooth_device_address_t *address, gboolean enable);
5456 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5457 * bt_gatt_service_property_t *service);
5459 * @brief Gets the properties of GATT based service of remote device
5461 * This function is a synchronous call.
5462 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5464 * @return BLUETOOTH_ERROR_NONE - Success \n
5465 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5466 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5467 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5470 * @param[in] service_handle - Handle for remote service.
5471 * @param[out] service - Structure containing remote service property.
5474 * @see bluetooth_gatt_free_service_property()
5476 int bluetooth_gatt_get_service_property(const char *service_handle,
5477 bt_gatt_service_property_t *service);
5480 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5482 * @brief Register to GATT based service to receive value change notification/indication.
5484 * This function is a synchronous call.
5485 * No event for this api.
5487 * @return BLUETOOTH_ERROR_NONE - Success \n
5488 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5489 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5490 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5493 * @param[in] service_handle - Handle for remote service.
5494 * @param[in] service_name - Friednly name of service uuid.
5499 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5502 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5504 * @brief Unregister GATT based service to receive value change notification/indication.
5506 * This function is a synchronous call.
5507 * No event for this api.
5509 * @return BLUETOOTH_ERROR_NONE - Success \n
5510 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5511 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5512 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5515 * @param[in] service_handle - Handle for remote service.
5520 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5523 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5524 * bt_gatt_char_property_t *characteristic);
5526 * @brief Provides characteristic value along with properties.
5528 * This function is a synchronous call.
5529 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5531 * @return BLUETOOTH_ERROR_NONE - Success \n
5532 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5533 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5534 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5537 * @param[in] char_handle - Handle for Characteristic property.
5538 * @param[out] characteristic - Structure containing remote characteristic property.
5541 * @see bluetooth_gatt_free_char_property()
5543 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5544 bt_gatt_char_property_t *characteristic);
5547 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5548 * bt_gatt_char_property_t *characteristic);
5550 * @brief Provides characteristic descriptor value along with its UUID.
5552 * This function is a synchronous call.
5553 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5555 * @return BLUETOOTH_ERROR_NONE - Success \n
5556 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5557 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5558 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5561 * @param[in] desc_handle - Handle for Characteristic descriptor.
5562 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5565 * @see bluetooth_gatt_free_desc_property()
5567 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5568 bt_gatt_char_descriptor_property_t *descriptor);
5572 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5573 * const guint8 *value, int length)
5575 * @brief Set characteristic value.
5577 * This function is a synchronous call.
5579 * @return BLUETOOTH_ERROR_NONE - Success \n
5580 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5581 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5582 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5585 * @param[in] char_handle - Handle for Characteristic property.
5586 * @param[in] value - New value to set for characteristic property.
5587 * @param[in] length - Length of the value to be set.
5592 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5593 const guint8 *value, int length);
5596 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5597 * const guint8 *value, int length, guint8 write_type)
5599 * @brief Set characteristic value by write type.
5601 * This function is a synchronous call if write type is "write without resonse"
5602 * and it is an asynchronous call if write type is "write with response"
5604 * @return BLUETOOTH_ERROR_NONE - Success \n
5605 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5606 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5607 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5610 * @param[in] char_handle - Handle for Characteristic property.
5611 * @param[in] value - New value to set for characteristic property.
5612 * @param[in] length - Length of the value to be set.
5613 * @param[in] write_type - Type of write.
5618 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5619 const guint8 *value, int length,
5620 guint8 write_type, gpointer app_data);
5624 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5625 * const guint8 *value, int length)
5627 * @brief Set characteristic value request.
5629 * This function is an asynchronous call.
5631 * @return BLUETOOTH_ERROR_NONE - Success \n
5632 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5633 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5634 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5637 * @param[in] char_handle - Handle for Characteristic property.
5638 * @param[in] value - New value to set for characteristic property.
5639 * @param[in] length - Length of the value to be set.
5644 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5645 const guint8 *value, int length);
5648 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5650 * @brief Read characteristic value.
5652 * This function is a asynchronous call.
5654 * @return BLUETOOTH_ERROR_NONE - Success \n
5655 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5656 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5657 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5660 * @param[in] char_handle - Handle for Characteristic property.
5665 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5668 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5669 * const char *service_uuid,
5670 * bt_gatt_service_property_t *service)
5672 * @brief Gets the service property from a device based on a particular uuid
5674 * This function is a synchronous call.
5676 * @return BLUETOOTH_ERROR_NONE - Success \n
5677 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5678 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5679 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5682 * @param[in] address - BD address of the remote device
5683 * @param[in] service_uuid - uuid of the service.
5684 * @param[out] service - Structure containing the service property.
5689 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5690 const char *service_uuid,
5691 bt_gatt_service_property_t *service);
5694 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5695 * const char *char_uuid)
5697 * @brief Gets the characteristic property from a service based on a particular char uuid
5699 * This function is an asynchronous call.
5700 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5702 * @return BLUETOOTH_ERROR_NONE - Success \n
5703 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5704 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5705 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5708 * @param[in] service_handle - Service handle.
5709 * @param[in] uuid - Characteristic uuid.
5714 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5715 const char *char_uuid);
5718 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5720 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5722 * This function is a synchronous call.
5723 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5725 * @return BLUETOOTH_ERROR_NONE - Success \n
5726 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5729 * @param[in] prim_svc - GATT handle info structure
5732 * @see bluetooth_gatt_get_primary_services()
5734 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5737 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5739 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5741 * This function is a synchronous call.
5742 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5744 * @return BLUETOOTH_ERROR_NONE - Success \n
5745 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5748 * @param[in] svc_pty - GATT service property structure.
5751 * @see bluetooth_gatt_get_service_property()
5753 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5756 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5758 * @brief Provides characteristic value along with properties.
5760 * This function is a synchronous call.
5761 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5763 * @return BLUETOOTH_ERROR_NONE - Success \n
5764 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5767 * @param[in] char_pty - GATT characteristics property structure.
5770 * @see bluetooth_gatt_get_characteristics_property()
5772 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5775 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5777 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5779 * This function is a synchronous call.
5780 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5782 * @return BLUETOOTH_ERROR_NONE - Success \n
5783 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5786 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5789 * @see bluetooth_gatt_get_char_descriptor_property()
5791 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5793 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5794 gboolean auto_connect, int client_id);
5796 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5799 int bluetooth_get_gatt_data_batching_available_packets(
5800 int *available_packets);
5802 int bluetooth_enable_gatt_data_batching(
5803 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5805 int bluetooth_disable_gatt_data_batching(
5806 const bluetooth_device_address_t *device_address);
5809 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5811 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5813 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5815 * @return BLUETOOTH_ERROR_NONE - Success \n
5816 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5819 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5823 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5826 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5828 * @brief Read characteristic descriptor value.
5830 * This function is a asynchronous call.
5832 * @return BLUETOOTH_ERROR_NONE - Success \n
5833 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5834 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5835 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5838 * @param[in] desc_handle - Handle for Characteristic descriptor
5843 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5846 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5847 * const guint8 *value, int length);
5849 * @brief Set characteristic descriptor value.
5851 * This function is a asynchronous call.
5853 * @return BLUETOOTH_ERROR_NONE - Success \n
5854 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5855 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5856 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5859 * @param[in] desc_handle - Handle for Characteristic descriptor
5860 * @param[in] value - New value to set for characteristic descriptor
5861 * @param[in] length - Length of the value to be set.
5866 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5867 const guint8 *value, int length, gpointer app_data);
5869 /* @fn int bluetooth_gatt_init(void)
5871 * @brief Initializes the gatt service.
5873 * This function is a synchronous call.
5874 * @return BLUETOOTH_ERROR_NONE - Success \n
5875 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5876 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5877 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5880 * @remark Adapter should be enabled
5881 * @see bluetooth_gatt_deinit()
5883 int bluetooth_gatt_init(void);
5885 /* @fn int bluetooth_gatt_init(void)
5887 * @brief DeInitializes the gatt service.
5889 * This function is a synchronous call.
5890 * @return BLUETOOTH_ERROR_NONE - Success \n
5891 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5892 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5893 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5896 * @remark Adapter should be enabled
5897 * @see bluetooth_gatt_init()
5899 int bluetooth_gatt_deinit(void);
5901 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5902 unsigned char **svc_path)
5904 * @brief Exports a new gatt service to the service interface.
5906 * This function is a synchronous call.
5908 * @return BLUETOOTH_ERROR_NONE - Success \n
5909 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5910 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5911 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5914 * @param[in] svc_uuid Gatt service uuid.
5915 * @param[out] svc_path service object path of the exported service.
5916 * @remark Adapter should be enabled
5917 * @see bluetooth_gatt_init()
5919 int bluetooth_gatt_add_service(const char *svc_uuid,
5922 /* @fn int bluetooth_gatt_add_new_characteristic(
5923 const char *svc_path, const char *char_uuid,
5924 bt_gatt_permission_t permissions,
5925 bt_gatt_characteristic_property_t properties,
5926 int flags_length, char **char_path);;
5928 * @brief Exports a new gatt characteristic to the characteristic interface.
5930 * This function is a synchronous call.
5931 * @return BLUETOOTH_ERROR_NONE - Success \n
5932 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5933 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5934 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5936 * @param[in] svc_path service object path of the exported service.
5937 * @param[in] char_uuid Gatt service uuid.
5938 * @param[in] properties GATT characteristic properties.
5939 * @param[out] char_path characteristic object path of the exported characteristic.
5941 * @remark Adapter should be enabled
5942 * @see bluetooth_gatt_add_service()
5944 int bluetooth_gatt_add_new_characteristic(
5945 const char *svc_path, const char *char_uuid,
5946 bt_gatt_permission_t permissions,
5947 bt_gatt_characteristic_property_t properties,
5950 /* @fn bluetooth_gatt_set_characteristic_value(
5951 const char *characteristic, const char *char_value,
5954 * @brief adds gatt charactertisic value to the given charactertistic path.
5956 * This function is a synchronous call.
5957 * @return BLUETOOTH_ERROR_NONE - Success \n
5958 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5959 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5960 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5962 * @param[in] char_value Value of the GATT characteristic to be added.
5963 * @param[in] value_length length of the chantacteristic value..
5964 * @param[out] characteristic characteristic object path..
5966 * @remark Adapter should be enabled
5967 * @see bluetooth_gatt_add_service()
5969 int bluetooth_gatt_set_characteristic_value(
5970 const char *characteristic, const char *char_value,
5973 /* @fn int bluetooth_gatt_add_descriptor(
5974 const char *char_path, const char *desc_uuid,
5975 bt_gatt_permission_t permissions,
5978 * @brief Exports a new gatt descriptor to the descriptor interface.
5980 * This function is a synchronous call.
5982 * @return BLUETOOTH_ERROR_NONE - Success \n
5983 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5984 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5985 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5988 * @param[in] desc_uuid Gatt descriptor uuid.
5989 * @param[in] desc_value GATT descriptor value.
5990 * @param[in] value_length Length of GATT descriptor value.
5991 * @param[in] permissions descriptor permissions.
5992 * @param[in] properties GATT descriptor properties.
5993 * @param[in] char_path characteristics object path of the exported character.
5995 * @remark Adapter should be enabled
5996 * @see bluetooth_gatt_add_service()
5997 * @see bluetooth_gatt_add_characteristics()
5999 int bluetooth_gatt_add_descriptor(
6000 const char *char_path, const char *desc_uuid,
6001 bt_gatt_permission_t permissions,
6004 /* @fn int bluetooth_gatt_set_descriptor_value(
6005 const char *desc_path, const char *desc_value,
6008 * @brief Adds value to the given descriptor handle.
6010 * This function is a synchronous call.
6012 * @return BLUETOOTH_ERROR_NONE - Success \n
6013 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6014 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6015 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6018 * @param[in] desc_value GATT descriptor value.
6019 * @param[in] value_length Length of GATT descriptor value.
6020 * @param[in] desc_path descriptor path to which the value needs to be added.
6022 * @remark Adapter should be enabled
6023 * @see bluetooth_gatt_add_service()
6024 * @see bluetooth_gatt_add_characteristics()
6026 int bluetooth_gatt_set_descriptor_value(
6027 const char *desc_path, const char *desc_value,
6030 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
6032 * @brief Reads the Service registered on manager interface.
6034 * This function is a synchronous call.
6036 * @return BLUETOOTH_ERROR_NONE - Success \n
6037 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6038 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6039 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6042 * @param[in] svc_uuid Gatt Service uuid.
6044 * @remark Adapter should be enabled and service should be registered.
6045 * @see bluetooth_gatt_register_service()
6047 int bluetooth_gatt_get_service(const char *svc_uuid);
6049 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
6051 * @brief Registers the given service path with the library.
6053 * This function is a synchronous call.
6055 * @return BLUETOOTH_ERROR_NONE - Success \n
6056 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6057 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6058 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6061 * @param[in] svc_path service object path of the exported service.
6063 * @remark Adapter should be enabled
6064 * @see bluetooth_gatt_add_service()
6065 * @see bluetooth_gatt_add_characteristics()
6066 * @see bluetooth_gatt_add_descriptor()
6067 * @see bluetooth_gatt_register_application()
6069 int bluetooth_gatt_register_service(const char *svc_path);
6071 /* @fn int bluetooth_gatt_register_application(void)
6073 * @brief Registers the application with the bluez gatt server.
6075 * This function is a synchronous call.
6077 * @return BLUETOOTH_ERROR_NONE - Success \n
6078 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6079 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6080 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6084 * @remark Adapter should be enabled
6085 * @see bluetooth_gatt_init()
6086 * @see bluetooth_gatt_add_service()
6087 * @see bluetooth_gatt_add_characteristics()
6088 * @see bluetooth_gatt_add_descriptor()
6089 * @see bluetooth_gatt_register_service()
6091 int bluetooth_gatt_register_application(void);
6093 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
6095 * @brief Removes(unregister) service from the bluez gatt server db.
6097 * This function is a synchronous call.
6099 * @return BLUETOOTH_ERROR_NONE - Success \n
6100 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6101 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6102 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6105 * @param[in] svc_path service object path of the exported service.
6107 * @remark Adapter should be enabled
6108 * @see bluetooth_gatt_add_service()
6109 * @see bluetooth_gatt_add_characteristics()
6110 * @see bluetooth_gatt_add_descriptor()
6111 * @see bluetooth_gatt_register_service()
6113 int bluetooth_gatt_unregister_service(const char *svc_path);
6115 /* @fn int bluetooth_gatt_unregister_application(void)
6117 * @brief Removes(unregister) the application with the bluez gatt server,
6118 * and deletes all the service registered.
6120 * This function is a synchronous call.
6122 * @return BLUETOOTH_ERROR_NONE - Success \n
6123 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6124 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6125 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6129 * @remark Adapter should be enabled
6130 * @see bluetooth_gatt_init()
6131 * @see bluetooth_gatt_add_service()
6132 * @see bluetooth_gatt_add_characteristics()
6133 * @see bluetooth_gatt_add_descriptor()
6134 * @see bluetooth_gatt_register_service()
6135 * @see bluetooth_gatt_unregister_service()
6137 int bluetooth_gatt_unregister_application(void);
6139 /* @fn int bluetooth_gatt_send_response(int request_id,
6140 * int offset, char *value, int value_length)
6142 * @brief Updates the attribute value in local attribute list.
6144 * This function is a synchronous call.
6146 * @return BLUETOOTH_ERROR_NONE - Success \n
6147 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6148 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6149 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6152 * @param[in] request_id The identification of a read request
6153 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6154 * @param[in] resp_state The identification of response state
6155 * @param[in] offset The offset from where a value is read
6156 * @param[in] value The value to be sent. It will be sent from @a offset.
6157 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6158 * @param[in] value_length Value Length.
6160 * @remark Adapter should be enabled
6161 * @see bluetooth_gatt_add_service()
6162 * @see bluetooth_gatt_add_characteristics()
6163 * @see bluetooth_gatt_add_descriptor()
6164 * @see bluetooth_gatt_register_service()
6166 int bluetooth_gatt_send_response(int request_id, guint req_type,
6167 int resp_state, int offset, char *value, int value_length);
6169 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6171 * @brief Sets the notification property for a characteristic.
6173 * This function is a synchronous call.
6175 * @return BLUETOOTH_ERROR_NONE - Success \n
6176 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6177 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6178 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6181 * @param[in] char_path characteristic object path.
6182 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6184 * @remark Adapter should be enabled
6185 * @see bluetooth_gatt_update_characteristic()
6187 int bluetooth_gatt_server_set_notification(const char *char_path,
6188 bluetooth_device_address_t *unicast_address);
6190 /* @fn int bluetooth_gatt_delete_services(void)
6192 * @brief deletes (unregisters) all services from the gatt server database..
6194 * This function is a synchronous call.
6196 * @return BLUETOOTH_ERROR_NONE - Success \n
6197 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6198 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6199 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6203 * @remark Adapter should be enabled
6204 * @see bluetooth_gatt_add_service()
6205 * @see bluetooth_gatt_add_characteristics()
6206 * @see bluetooth_gatt_add_descriptor()
6207 * @see bluetooth_gatt_register_service()
6208 * @see bluetooth_gatt_unregister_service()
6210 int bluetooth_gatt_delete_services(void);
6212 /* @fn int bluetooth_gatt_update_characteristic(void)
6214 * @brief updates the given characteristic with a new value
6216 * This function is a synchronous call.
6218 * @return BLUETOOTH_ERROR_NONE - Success \n
6219 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6220 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6221 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6225 * @remark Adapter should be enabled
6226 * @see bluetooth_gatt_add_service()
6227 * @see bluetooth_gatt_add_characteristics()
6228 * @see bluetooth_gatt_add_descriptor()
6229 * @see bluetooth_gatt_register_service()
6230 * @see bluetooth_gatt_unregister_service()
6232 int bluetooth_gatt_update_characteristic(const char *char_path,
6233 const char* char_value, int value_length);
6236 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6238 * @brief Set advertising status.
6240 * This function is used to enable or disable LE advertising.
6241 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6243 * This function is a synchronous call.
6245 * @return BLUETOOTH_ERROR_NONE - Success \n
6246 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6247 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6250 * @param[in] enable - The status of advertising
6253 * @see bluetooth_set_advertising_data
6255 int bluetooth_set_advertising(int handle, gboolean enable);
6258 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6260 * @brief Set advertising status along with interval value.
6262 * This function is used to enable or disable LE advertising.
6263 * Interval_min and Interval_max is used to set the best advertising interval.
6264 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6266 * This function is a synchronous call.
6268 * @return BLUETOOTH_ERROR_NONE - Success \n
6269 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6270 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6273 * @param[in] enable - The status of advertising
6274 * @param[in] interval_min - Minimum interval of advertising (msec)
6275 * @param[in] interval_max - Maximum interval of advertising (msec)
6276 * @param[in] filter_policy - Advertising filter policy
6279 * @see bluetooth_set_advertising_data
6281 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6282 bluetooth_advertising_params_t *params);
6285 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6286 * @brief Get the advertising data
6288 * This function is used to get advertising data.
6289 * Before calling this API, the adapter should be enabled.
6291 * This function is a synchronous call.
6293 * @return BLUETOOTH_ERROR_NONE - Success \n
6294 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6295 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6296 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6298 * @param[out] value - Advertising data structure.
6299 * @param[out] length - The length of Advertising data.
6303 bluetooth_advertising_data_t *value = { {0} };
6306 ret = bluetooth_get_advertising_data(&value, &length);
6309 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6312 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6314 * @brief Set advertising data with value
6316 * This function is used to set advertising data and Maximum size of advertising data
6317 * is 28 byte (Except Flag)
6319 * This function is a synchronous call.
6321 * @return BLUETOOTH_ERROR_NONE - Success \n
6322 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6323 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6326 * @param[in] value - Advertising data structure.
6330 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length, bool is_legacy);
6333 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6335 * @brief Check the privilege for advertising parameter setting
6337 * This function is a synchronous call.
6339 * @return BLUETOOTH_ERROR_NONE - Success \n
6340 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6346 int bluetooth_check_privilege_advertising_parameter(void);
6349 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6350 * @brief Get the LE scan response data
6352 * This function is used to get scan response data.
6353 * Before calling this API, the adapter should be enabled.
6355 * This function is a synchronous call.
6357 * @return BLUETOOTH_ERROR_NONE - Success \n
6358 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6359 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6360 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6362 * @param[out] value - Scan response data structure.
6363 * @param[out] length - The length of Scan response data.
6367 bluetooth_scan_resp_data_t *value = { {0} };
6370 ret = bluetooth_get_scan_response_data(&value, &length);
6373 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6376 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6378 * @brief Set scan response data with value
6380 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6382 * This function is a synchronous call.
6384 * @return BLUETOOTH_ERROR_NONE - Success \n
6385 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6386 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6389 * @param[in] value - LE Scan response data structure.
6393 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6396 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6398 * @brief Set scan interval and window
6400 * This function is used to set LE scan interval and window size
6402 * This function is a synchronous call.
6404 * @return BLUETOOTH_ERROR_NONE - Success \n
6405 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6406 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6409 * @param[in] interval - Interval of LE scan (msec)
6410 * @param[in] window - Window size of LE scan (msec)
6414 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6417 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6419 * @brief Set scan type
6421 * This function is used to set LE scan type
6423 * This function is a synchronous call.
6425 * @return BLUETOOTH_ERROR_NONE - Success \n
6426 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6427 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6430 * @param[in] scan_type - LE scan type
6434 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6437 * @fn intbluetooth_set_scan_phy(bleutooth_le_scanning_phy_t phy);
6439 * @brief Set scan phy
6441 * This function is used to set LE scan phy
6443 * This function is a synchronous call.
6445 * @return BLUETOOTH_ERROR_NONE - Success \n
6446 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6447 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6450 * @param[in] phy - LE scanning PHY
6454 int bluetooth_set_le_scan_phy(bleutooth_le_scanning_phy_t phy);
6457 * @fn intbluetooth_set_scan_phy(bluetooth_le_scan_role_t role);
6459 * @brief Set scan role
6461 * This function is used to set LE scan role
6463 * This function is a synchronous call.
6465 * @return BLUETOOTH_ERROR_NONE - Success \n
6466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6467 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6470 * @param[in] role - LE scanning role
6474 int bluetooth_set_le_scan_role(bluetooth_le_scan_role_t role);
6477 * @fn int bluetooth_is_advertising(void)
6478 * @brief Check for the advertising is in-progress or not.
6480 * This API is used to check the current status of the advertising procedure.
6481 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6484 * This function checks whether the advertising is started or not.
6486 * This function is a synchronous call.
6488 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6490 * @return BLUETOOTH_ERROR_NONE - Success \n
6491 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6494 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6498 gboolean is_advertising = 0;
6500 ret = bluetooth_is_advertising(&is_advertising);
6503 int bluetooth_is_advertising(gboolean *is_advertising);
6506 * @fn int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6507 * @brief Add LE device to allow list
6509 * This API is used to add LE device to allow list
6510 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6514 * This function is a synchronous call.
6516 * @param[in] address The address of remote device
6518 * @return BLUETOOTH_ERROR_NONE - Success \n
6519 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6522 * @see bluetooth_set_custom_advertising
6524 int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6527 * @fn int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6528 * @brief Remove LE device from allow list
6530 * This API is used to remove LE device from allow list
6531 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6535 * This function is a synchronous call.
6537 * @param[in] address The address of remote device
6539 * @return BLUETOOTH_ERROR_NONE - Success \n
6540 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6543 * @see bluetooth_set_custom_advertising
6545 int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6548 * @fn int bluetooth_clear_allow_list(void)
6549 * @brief Clear allow list
6551 * This API is used to clear allow list
6552 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6556 * This function is a synchronous call.
6558 * @param[in] address The address of remote device
6560 * @return BLUETOOTH_ERROR_NONE - Success \n
6561 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6564 * @see bluetooth_set_custom_advertising
6566 int bluetooth_clear_allow_list(void);
6569 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6570 * const bluetooth_le_connection_param_t *parameters)
6571 * @brief update connection paramter of LE connection.
6573 * This function is a synchronous call.
6575 * @return BLUETOOTH_ERROR_NONE - Success \n
6576 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6579 * @param[in] address - remote device address value.
6580 * @param[in] parameters - new connection parameters.
6583 * @see bluetooth_bond_device
6585 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6586 const bluetooth_le_connection_param_t *parameters);
6589 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6591 * @brief Enable/Disable LE Privacy feature.
6593 * This function is used to enable or disable LE Privacy feature.
6594 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6596 * This function is a synchronous call.
6598 * @return BLUETOOTH_ERROR_NONE - Success \n
6599 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6600 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6603 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6607 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6610 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6612 * @brief Enable/Disable LE static random address.
6614 * This function is used to enable or disable LE static random address.
6616 * This function is a synchronous call.
6618 * @return BLUETOOTH_ERROR_NONE - Success \n
6619 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6620 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6623 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6627 int bluetooth_set_le_static_random_address(gboolean enable);
6630 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6631 * bluetooth_le_connection_mode_t mode)
6632 * @brief update connection paramter of LE connection.
6634 * This function is a synchronous call.
6636 * @return BLUETOOTH_ERROR_NONE - Success \n
6637 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6638 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6641 * @param[in] address - remote device address value.
6642 * @param[in] mode - new connection mode.
6646 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6647 bluetooth_le_connection_mode_t mode);
6650 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6651 * @brief Request for new ATT MTU value.
6653 * This function is a asynchronous call.
6655 * @return BLUETOOTH_ERROR_NONE - Success \n
6656 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6657 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6660 * @param[in] address - remote device address value.
6661 * @param[in] mtu - MTU value to be set.
6665 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6668 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6669 * unsigned int *mtu)
6670 * @brief Gets the xisting MTU value set for a connection.
6672 * This function is a synchronous call.
6674 * @return BLUETOOTH_ERROR_NONE - Success \n
6675 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6676 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6679 * @param[in] address - remote device address value.
6680 * @param[out] mtu - MTU value set for the connection.
6684 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6688 * @fn int bluetooth_gatt_server_read_phy(const bluetooth_device_address_t *device_address)
6689 * @brief Gets the PHY values set for a connection.
6691 * This function is a asynchronous call. The updated PHYs are notified
6692 * through callback event.
6694 * @return BLUETOOTH_ERROR_NONE - Success \n
6695 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6696 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6699 * @param[in] address - remote device address value.
6703 int bluetooth_gatt_server_read_phy(const bluetooth_device_address_t *device_address);
6706 * @fn int bluetooth_gatt_server_set_phy(const bluetooth_device_address_t *device_address,
6707 int tx_phy, int rx_phy, int phy_options)
6708 * @brief Request a change of the PHY values.
6710 * This function is a asynchronous call. The updated PHYs are notified
6711 * through callback event.
6713 * @return BLUETOOTH_ERROR_NONE - Success \n
6714 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6715 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6718 * @param[in] address - remote device address value.
6719 * @param[in] tx_phy The preferred sender PHY
6720 * @param[in] rx_phy The preferred receiver PHY
6721 * @param[in] phy_options The preferred coding to use when transmitting on LE CODED PHY
6725 int bluetooth_gatt_server_set_phy(const bluetooth_device_address_t *device_address,
6726 int tx_phy, int rx_phy, int phy_options);
6729 * @fn int bluetooth_gatt_client_read_phy(const bluetooth_device_address_t *device_address)
6730 * @brief Gets the PHY values set for a connection.
6732 * This function is a asynchronous call. The updated PHYs are notified
6733 * through callback event.
6735 * @return BLUETOOTH_ERROR_NONE - Success \n
6736 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6737 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6740 * @param[in] address - remote device address value.
6744 int bluetooth_gatt_client_read_phy(const bluetooth_device_address_t *device_address);
6747 * @fn int bluetooth_gatt_client_set_phy(const bluetooth_device_address_t *device_address,
6748 int tx_phy, int rx_phy, int phy_options)
6749 * @brief Request a change of the PHY values.
6751 * This function is a asynchronous call. The updated PHYs are notified
6752 * through callback event.
6754 * @return BLUETOOTH_ERROR_NONE - Success \n
6755 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6756 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6759 * @param[in] address - remote device address value.
6760 * @param[in] tx_phy The preferred sender PHY
6761 * @param[in] rx_phy The preferred receiver PHY
6762 * @param[in] phy_options The preferred coding to use when transmitting on LE CODED PHY
6766 int bluetooth_gatt_client_set_phy(const bluetooth_device_address_t *device_address,
6767 int tx_phy, int rx_phy, int phy_options);
6770 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6771 * bluetooth_device_address_t *id_address)
6772 * @brief Gets the Identity address of remote device.
6774 * This function is a synchronous call.
6776 * @return BLUETOOTH_ERROR_NONE - Success \n
6777 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6778 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6781 * @param[in] device_rpa - remote Resolvable private address.
6782 * @param[out] id_address - remote Identity device address value.
6786 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6787 bluetooth_device_address_t *id_address);
6790 * @fn int bluetooth_le_read_maximum_data_length()
6791 * @brief reads the maximum LE data length supported in the controller.
6793 * This function is a synchronous call.
6795 * @return BLUETOOTH_ERROR_NONE - Success \n
6796 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6802 int bluetooth_le_read_maximum_data_length(
6803 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6805 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6806 * @brief writes the host suggested values for the controllers max transmitted no of payload
6807 * octects to be used for new connections.
6809 * This function is a synchronous call.
6811 * @return BLUETOOTH_ERROR_NONE - Success \n
6812 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6818 int bluetooth_le_write_host_suggested_default_data_length(
6819 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6821 int bluetooth_le_read_suggested_default_data_length(
6822 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6824 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6825 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6827 int bluetooth_pbap_init(void);
6828 int bluetooth_pbap_deinit(void);
6829 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6830 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6831 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6832 bt_pbap_folder_t *folder);
6833 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6834 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6835 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6836 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6837 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6838 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6839 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6840 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6843 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6845 * @brief Set manufacturer data with value
6847 * This function is used to set manufacturer data.
6849 * This function is a synchronous call.
6851 * @return BLUETOOTH_ERROR_NONE - Success \n
6852 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6853 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6856 * @param[in] value - Manufacturer data structure.
6860 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6862 int bluetooth_set_passkey_notification(gboolean enable);
6865 * @fn int bluetooth_dpm_is_mode_allowed(void);
6867 * @brief Checks Restriction for BT mode(BT allowed or not)
6869 * This function is a synchronous call.
6871 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6872 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6873 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6880 int bluetooth_dpm_is_mode_allowed(void);
6883 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6885 * @brief Sets Restriction for BT mode(BT allowed or not)
6887 * This function is a synchronous call.
6889 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6890 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6891 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6894 * @param[in] value - BT Allow value.
6895 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6896 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6897 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6898 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6902 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6905 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6907 * @brief Reads the Restriction for BT mode(BT allowed or not)
6909 * This function is a synchronous call.
6911 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6912 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6913 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6917 * @param[out] value - BT Allow value.
6918 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6919 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6920 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6921 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6925 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6928 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6930 * @brief Sets the Restriction for device.
6932 * This function is a synchronous call.
6934 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6935 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6936 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6939 * @param[in] value - State value.
6940 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6941 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6945 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6948 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6950 * @brief Reads the Restriction for device.
6952 * This function is a synchronous call.
6954 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6955 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6956 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6960 * @param[out] value - State value.
6961 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6962 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6966 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6969 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6971 * @brief Sets the Restriction for uuid.
6973 * This function is a synchronous call.
6975 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6976 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6977 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6980 * @param[in] value - State value.
6981 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6982 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6986 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6989 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6991 * @brief Reads the Restriction for uuid.
6993 * This function is a synchronous call.
6995 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6996 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6997 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7001 * @param[out] value - State value.
7002 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7003 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7007 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
7010 * @fn int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
7012 * @brief Adds the device to blocklist.
7014 * This function is a synchronous call.
7016 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7017 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7018 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7021 * @param[in] device_address - Device address
7025 int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
7028 * @fn int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
7030 * @brief Adds the device to allowlist.
7032 * This function is a synchronous call.
7034 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7035 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7036 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7039 * @param[in] device_address - Device address
7043 int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
7046 * @fn int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
7048 * @brief Adds the Service UUIDS to blocklist.
7050 * This function is a synchronous call.
7052 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7053 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7054 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7057 * @param[in] service_uuids - profile or custom service uuids
7061 int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
7064 * @fn int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
7066 * @brief Adds the Service UUIDS to allowlist.
7068 * This function is a synchronous call.
7070 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7071 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7072 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7075 * @param[in] service_uuids - profile or custom service uuids
7079 int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
7082 * @fn int bluetooth_dpm_clear_devices_from_blocklist();
7084 * @brief Clears the devices from blocklist.
7086 * This function is a synchronous call.
7088 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7089 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7090 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7097 int bluetooth_dpm_clear_devices_from_blocklist(void);
7100 * @fn int bluetooth_dpm_clear_devices_from_allowlist();
7102 * @brief Clears the devices from allowlist.
7104 * This function is a synchronous call.
7106 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7107 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7108 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7115 int bluetooth_dpm_clear_devices_from_allowlist(void);
7118 * @fn int bluetooth_dpm_clear_uuids_from_blocklist();
7120 * @brief Clears the uuids from blocklist.
7122 * This function is a synchronous call.
7124 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7125 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7126 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7133 int bluetooth_dpm_clear_uuids_from_blocklist(void);
7136 * @fn int bluetooth_dpm_clear_uuids_from_allowlist();
7138 * @brief Clears the uuids from allowlist.
7140 * This function is a synchronous call.
7142 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7143 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7144 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7151 int bluetooth_dpm_clear_uuids_from_allowlist(void);
7154 * @fn int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
7156 * @brief reads the devices from blocklist.
7158 * This function is a synchronous call.
7160 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7161 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7162 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7165 * @param[out] device_list - list of devices
7169 int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
7172 * @fn int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7174 * @brief reads the devices from allowlist.
7176 * This function is a synchronous call.
7178 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7179 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7180 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7183 * @param[out] device_list - list of devices
7187 int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7190 * @fn int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7192 * @brief reads the uuids from blocklist.
7194 * This function is a synchronous call.
7196 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7197 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7198 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7201 * @param[in] uuid_list - list of uuids
7205 int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7208 * @fn int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7210 * @brief reads the uuids from allowlist.
7212 * This function is a synchronous call.
7214 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7215 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7216 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7219 * @param[in] uuid_list - list of uuids
7223 int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7226 * @fn int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7228 * @brief Removes the device from allowlist.
7230 * This function is a synchronous call.
7232 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7233 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7234 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7237 * @param[in] device_address - Device address
7241 int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7244 * @fn int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7246 * @brief Removes the device from blocklist.
7248 * This function is a synchronous call.
7250 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7251 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7252 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7255 * @param[in] device_address - Device address
7259 int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7262 * @fn int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7264 * @brief Removes the Service UUIDS from allowlist.
7266 * This function is a synchronous call.
7268 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7269 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7270 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7273 * @param[in] service_uuids - profile or custom service uuids
7277 int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7280 * @fn int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7283 * @brief Removes the Service UUIDS from blocklist.
7285 * This function is a synchronous call.
7287 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7288 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7289 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7292 * @param[in] service_uuids - profile or custom service uuids
7296 int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7299 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7301 * @brief Sets the Restriction for outgoing call.
7303 * This function is a synchronous call.
7305 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7306 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7307 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7310 * @param[in] value - State value.
7311 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7312 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7316 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7319 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7321 * @brief Reads the Restriction for outgoing call.
7323 * This function is a synchronous call.
7325 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7326 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7327 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7331 * @param[out] value - State value.
7332 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7333 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7337 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7340 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7342 * @brief Sets the Restriction for Pairing.
7344 * This function is a synchronous call.
7346 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7347 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7348 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7351 * @param[in] value - State value.
7352 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7353 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7357 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7360 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7362 * @brief Reads the Restriction for Pairing
7364 * This function is a synchronous call.
7366 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7367 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7368 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7372 * @param[out] value - State value.
7373 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7374 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7378 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7381 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7383 * @brief Sets the Restriction for using Profiles.
7385 * This function is a synchronous call.
7387 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7388 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7389 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7392 * @param[in]profile - Profile.
7393 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7394 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7395 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7396 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7397 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7398 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7399 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7400 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7401 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7402 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7403 * BLUETOOTH_DPM_PROFILE_NONE
7404 * @param[in] value - State value.
7405 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7406 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7410 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7413 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7415 * @brief Reads the Restriction for using Profiles.
7417 * This function is a synchronous call.
7419 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7420 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7421 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7424 * @param[in]profile - Profile.
7425 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7426 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7427 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7428 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7429 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7430 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7431 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7432 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7433 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7434 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7435 * BLUETOOTH_DPM_PROFILE_NONE
7436 * @param[out] value - State value.
7437 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7438 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7442 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7445 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7447 * @brief Sets the Restriction for Desktop Connectivity.
7449 * This function is a synchronous call.
7451 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7452 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7453 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7456 * @param[in] value - State value.
7457 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7458 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7462 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7465 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7467 * @brief Reads the Restriction for Desktop Connectivity.
7469 * This function is a synchronous call.
7471 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7472 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7473 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7477 * @param[out] value - State value.
7478 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7479 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7483 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7486 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7488 * @brief Sets the Restriction for Discoverable state.
7490 * This function is a synchronous call.
7492 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7493 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7494 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7497 * @param[in] value - State value.
7498 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7499 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7503 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7506 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7508 * @brief Reads the Restriction for Discoverable state.
7510 * This function is a synchronous call.
7512 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7513 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7514 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7518 * @param[out] value - State value.
7519 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7520 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7524 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7527 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7529 * @brief Sets the Restriction for linited discoverable state..
7531 * This function is a synchronous call.
7533 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7534 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7535 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7538 * @param[in] value - State value.
7539 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7540 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7544 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7547 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7549 * @brief Reads the Restriction for limited discoverable state.
7551 * This function is a synchronous call.
7553 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7554 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7555 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7559 * @param[out] value - State value.
7560 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7561 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7565 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7567 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7569 * @brief Sets the Restriction for Data trasnfer.
7571 * This function is a synchronous call.
7573 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7574 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7575 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7578 * @param[in] value - State value.
7579 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7580 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7584 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7588 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7590 * @brief Reads the Restriction for Data trasnfer.
7592 * This function is a synchronous call.
7594 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7595 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7596 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7600 * @param[out] value - State value.
7601 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7602 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7606 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7609 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7610 * bluetooth_pxp_poperty_t property, int value);
7612 * @brief Sets the Proximity alert level/properties for monitor role.
7614 * This function is a synchronous call.
7616 * @return BLUETOOTH_ERROR_NONE - Success \n
7617 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7618 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7619 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7622 * @param[in] device_address remote device address
7623 * @param[in] property proximity profile property
7624 * @param[in] value alert level/property value to be set
7629 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7630 bluetooth_pxp_poperty_t property, int value);
7633 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7634 * bluetooth_pxp_poperty_t property, int *value);
7636 * @brief Reads the Proximity alert level/properties for monitor role.
7638 * This function is a synchronous call.
7640 * @return BLUETOOTH_ERROR_NONE - Success \n
7641 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7642 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7643 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7646 * @param[in] device_address remote device address
7647 * @param[in] property proximity profile property
7648 * @param[out] value alert level/property value
7652 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7653 bluetooth_pxp_poperty_t property, int *value);
7656 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7657 * int *services_supported);
7659 * @brief Reads the Proximity Monitor profile supported properties/services.
7661 * This function is a synchronous call.
7663 * @return BLUETOOTH_ERROR_NONE - Success \n
7664 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7665 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7666 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7669 * @param[in] device_address remote device address
7670 * @param[out] services_supported proximity profile property/service
7674 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7675 int *services_supported);
7678 * @fn int bluetooth_proximity_reporter_register();
7680 * @brief Register all proximity related services in BlueZ.
7682 * This function is a synchronous call.
7684 * @return BLUETOOTH_ERROR_NONE - Success \n
7685 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7691 int bluetooth_proximity_reporter_register(void);
7694 * @fn int bluetooth_proximity_reporter_unregister();
7696 * @brief Unregister all proximity related services in BlueZ.
7698 * This function is a synchronous call.
7700 * @return BLUETOOTH_ERROR_NONE - Success \n
7701 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7707 int bluetooth_proximity_reporter_unregister(void);
7710 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7711 * bluetooth_pxp_poperty_t property, int *value);
7713 * @brief Reads the Proximity alert level/properties for reporter role.
7715 * This function is a synchronous call.
7717 * @return BLUETOOTH_ERROR_NONE - Success \n
7718 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7719 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7720 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7723 * @param[in] device_address remote device address
7724 * @param[in] property proximity profile property
7725 * @param[out] value alert level/property value
7729 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7730 bluetooth_pxp_poperty_t property, int *value);
7733 * @fn int bluetooth_tds_provider_register(void);
7735 * @brief Register Transport Discovery Provider role.
7737 * This function is a synchronous call.
7739 * @return BLUETOOTH_ERROR_NONE - Success \n
7740 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7741 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7742 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7750 int bluetooth_tds_provider_register(void);
7753 * @fn int bluetooth_tds_provider_unregister(void);
7755 * @brief Unregister Transport Discovery Provider role.
7757 * This function is a synchronous call.
7759 * @return BLUETOOTH_ERROR_NONE - Success \n
7760 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7761 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7762 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7770 int bluetooth_tds_provider_unregister(void);
7773 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7775 * @brief Create Transport Discovery Provider for a transport.
7777 * This function is a synchronous call.
7779 * @return BLUETOOTH_ERROR_NONE - Success \n
7780 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7781 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7782 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7785 * @param[in] Transport (BT, CUSTOM etc.)
7786 * @param[in] Unique handle for TDS provider.
7791 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7794 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7796 * @brief Remove previously created Transport Discovery Provider.
7798 * This function is a synchronous call.
7800 * @return BLUETOOTH_ERROR_NONE - Success \n
7801 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7804 * @param[in] Unique handle for previously created provider.
7809 int bluetooth_tds_provider_destroy(unsigned int handle);
7812 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7814 * @brief Set transport block for in advertisement and gatt db.
7816 * This function is a synchronous call.
7818 * @return BLUETOOTH_ERROR_NONE - Success \n
7819 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7820 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7821 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7824 * @param[in] Provider specific manufacturer data.
7825 * @param[in] Provider specific manufacturer data length.
7830 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7833 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7834 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7836 * @brief Set transport block for in advertisement and gatt db.
7838 * This function is a synchronous call.
7840 * @return BLUETOOTH_ERROR_NONE - Success \n
7841 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7842 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7843 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7846 * @param[in] Unique handle for TDS provider.
7847 * @param[in] Transport state (On/Off/Not Available).
7848 * @param[in] Transport specific data block.
7849 * @param[in] Transport specific data block length.
7854 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7855 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7858 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7859 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7861 * @brief Send response to TDS activation request from remoted device.
7863 * This function is a synchronous call.
7865 * @return BLUETOOTH_ERROR_NONE - Success \n
7866 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7867 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7868 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7871 * @param[in] Remote device BT address.
7872 * @param[in] Unique handle for TDS provider.
7873 * @param[in] Response for TDS activation request.
7874 * @param[in] Transport specific data block to be sent in activation response.
7875 * @param[in] Data block length.
7880 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7881 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7884 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7886 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7888 * This function is an asynchronous call.
7890 * @return BLUETOOTH_ERROR_NONE - Success \n
7891 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7892 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7893 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7894 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7897 * @param[in] device_address remote device address
7898 * @param[in] handle attribute handle
7900 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7901 * when TDS data is received from Remote provider
7903 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7904 const char *handle);
7907 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7909 * @brief Enables CCCD on Remote Provider.
7911 * This function is an asynchronous call.
7913 * @return BLUETOOTH_ERROR_NONE - Success \n
7914 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7915 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7916 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7917 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7920 * @param[in] device_address remote device address
7921 * @param[in] handle attribute handle
7923 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7924 * when Indication is enabled on Remote provider
7926 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7927 const char *handle);
7930 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7931 * unsigned char *buf, int length);
7932 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7934 * This function is an asynchronous call.
7936 * @return BLUETOOTH_ERROR_NONE - Success \n
7937 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7938 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7939 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7940 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7943 * @param[in] device_address remote device address
7944 * @param[in] handle attribute handle
7945 * @param[in] buf Control point activation param
7946 * @param[in] param length
7948 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7949 * is received from remote Provider
7951 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7952 unsigned char *buf, int length);
7955 * @fn int bluetooth_otp_server_init(const char *directory);
7957 * @brief Starts OTP server.
7959 * This function is a synchronous call.
7969 int bluetooth_otp_server_init(const char *directory);
7972 * @fn int bluetooth_otp_server_deinit();
7974 * @brief Stops OTP server.
7976 * This function is a synchronous call.
7986 int bluetooth_otp_server_deinit();
7989 * @fn int bluetooth_otp_enable_notification(const char *handle);
7991 * @brief Enable notification for remote OACP & OLCP characteristics.
7993 * This function is a synchronous call.
8003 int bluetooth_otp_enable_notification(const char *handle);
8006 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
8007 * unsigned char *buf, int length);
8009 * @brief Write value on remote characteristics.
8011 * This function is a synchronous call.
8021 int bluetooth_otp_write_characteristics_value(const char *handle,
8022 unsigned char *buf, int length);
8025 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
8027 * @brief Read value for remote characteristics.
8029 * This function is a synchronous call.
8039 int bluetooth_otp_read_characteristic_value(const char *handle);
8042 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
8044 * @brief Read value for remote characteristics.
8046 * This function is a synchronous call.
8056 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
8059 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
8061 * @brief Read value for remote characteristics.
8063 * This function is a synchronous call.
8073 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
8076 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
8077 * @brief Check if Adapter supports LE 2M PHY feature or not.
8079 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
8080 * in BT 5.0 specification.
8082 * This function is a synchronous call.
8084 * @return BLUETOOTH_ERROR_NONE - Success \n
8085 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8086 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8087 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8088 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
8092 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
8095 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
8096 * @brief Check if Adapter supports LE 2M CODED feature or not.
8098 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
8099 * in BT 5.0 specification.
8101 * This function is a synchronous call.
8103 * @return BLUETOOTH_ERROR_NONE - Success \n
8104 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8105 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8106 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8107 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
8111 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
8114 * @fn int bluetooth_is_le_extended_advertising_supported(gboolean *is_supported)
8115 * @brief Check if Adapter supports LE Extended Advertising feature or not.
8117 * This API is used to check whether LE Adapter supports LE Extended Advertising feature, which is introduced
8118 * in BT 5.0 specification.
8120 * This function is a synchronous call.
8122 * @return BLUETOOTH_ERROR_NONE - Success \n
8123 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8124 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8125 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8126 * @param[out] is_supported. This boolean variable indicates whether LE Extended Advertising is supported or not
8130 int bluetooth_is_le_extended_advertising_supported(gboolean *is_supported);
8133 * @fn int bluetooth_is_le_extended_scan_supported(gboolean *is_supported)
8134 * @brief Check if Adapter supports LE Extended Scan feature or not.
8136 * This API is used to check whether LE Adapter supports LE Extended Scan feature, which is introduced
8137 * in BT 5.0 specification.
8139 * This function is a synchronous call.
8141 * @return BLUETOOTH_ERROR_NONE - Success \n
8142 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8143 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8144 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8145 * @param[out] is_supported. This boolean variable indicates whether LE Extended Scan is supported or not
8149 int bluetooth_is_le_extended_scan_supported(gboolean *is_supported);
8152 * @fn int bluetooth_le_get_maximum_advertising_data_length(gint *data_length)
8153 * @brief gives the maximum advertising data length supported by controller.
8155 * This API is used to get the maximum advertising data length supported by controller. This feature is introduced
8156 * in BT 5.0 specification.
8158 * This function is a synchronous call.
8160 * @return BLUETOOTH_ERROR_NONE - Success \n
8161 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8162 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8163 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8164 * @param[out] data_length. This integer variable indicates the maximum advertising data length supported by the controller
8168 int bluetooth_le_get_maximum_advertising_data_length(gint *data_length);
8171 * @fn int bluetooth_l2cap_le_create_socket(int psm)
8172 * @brief Register l2cap_le socket with a specific PSM
8175 * This API register l2cap_le socket with the given PSM. The return value of this API is the socket
8176 * descriptor of the server.
8177 * This is the first API which is called to create the server. Once we created the server socket,
8178 * we will listen on that return socket.
8179 * So a bluetooth_l2cap_le_listen_and_accept should follow this API call. This is a synchronous call.
8182 * @return socket FD on Success \n
8183 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8184 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
8185 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
8186 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8187 * @param[in] int psm
8190 * @see bluetooth_l2cap_le_listen_and_accept, bluetooth_l2cap_le_remove_socket
8195 fd = bluetooth_l2cap_le_create_socket(test_psm);
8199 int bluetooth_l2cap_le_create_socket(int psm);
8202 * @fn int bluetooth_l2cap_le_remove_socket(int socket_fd)
8203 * @brief De-register the l2cap_le socket
8206 * This API deregister l2cap_le socket with the given socket fd. If the remote device is
8207 * already connected then we will receive the BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED with socket
8208 * descriptor else no event will come. We will call this API only after the
8209 * bluetooth_l2cap_le_listen_and_accept.
8210 * This is a synchronous call.
8212 * @return BLUETOOTH_ERROR_NONE - Success \n
8213 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8214 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
8215 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8216 * @param[in] int socket_fd
8219 * @see bluetooth_l2cap_le_create_socket, bluetooth_l2cap_le_listen_and_accept
8222 void bt_event_callback(int event, bluetooth_event_param_t *param)
8226 case BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED:
8228 bluetooth_l2cap_le_connection_t *discon_ind =
8229 (bluetooth_l2cap_le_connection_t *)param->param_data;
8231 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
8239 fd = bluetooth_l2cap_le_create_socket(test_psm);
8240 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8242 ret = bluetooth_l2cap_le_remove_socket(fd);
8245 int bluetooth_l2cap_le_remove_socket(int socket_fd);
8248 * @fn int bluetooth_l2cap_le_server_disconnect(int socket_fd)
8249 * @brief Disconnect l2cap_le connection
8252 * Disconnect a specific(device node fd) l2cap_le connection. This is a Synchronous call and there
8253 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8256 * @return BLUETOOTH_ERROR_NONE - Success \n
8257 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8258 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8259 * @param[in] int socket_fd
8265 ret = bluetooth_l2cap_le_server_disconnect(g_ret_fd);
8267 printf("Disconnection failed");
8269 printf("Disconnection Success");
8273 int bluetooth_l2cap_le_server_disconnect(int socket_fd);
8276 * @fn int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection)
8277 * @brief L2CAP_LE socket listen
8280 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8281 * after the bluetooth_l2cap_le_create_socket API.
8282 * This API listen for the incoming connection and once it receives a connection, it will give
8283 * BLUETOOTH_EVENT_L2CAP_LE_CONNECTED
8284 * event to the application. This is an Asynchronous API call.
8287 * @return BLUETOOTH_ERROR_NONE - Success \n
8288 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8289 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8291 * @param[in] int socket_fd
8292 * @param[in] max pending connection.
8295 * @see bluetooth_l2cap_le_create_socket
8298 void bt_event_callback(int event, bluetooth_event_param_t* param)
8302 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8304 bluetooth_l2cap_le_connection_t *conn_ind =
8305 (bluetooth_l2cap_le_connection_t *)param->param_data;
8307 printf("\nConnected from FD %d", conn_ind->socket_fd);
8315 fd = bluetooth_l2cap_le_create_socket(test_psm);
8316 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8320 int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection);
8323 * @fn int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection)
8324 * @brief L2cap_le socket listen
8327 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8328 * after the bluetooth_l2cap_le_create_socket API.
8329 * This API listen for the incoming connection and once it receives a connection, it will give
8330 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE
8331 * event to the application. This is an Asynchronous API call.
8334 * @return BLUETOOTH_ERROR_NONE - Success \n
8335 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8336 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8338 * @param[in] int socket_fd
8339 * @param[in] max pending connection.
8342 * @see bluetooth_l2cap_le_create_socket
8345 void bt_event_callback(int event, bluetooth_event_param_t* param)
8349 case BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE:
8351 char *name = (char *)param->param_data;
8353 printf("\nConnected from %s", name);
8355 bluetooth_l2cap_le_accept_connection();
8363 fd = bluetooth_l2cap_le_create_socket(test_psm);
8364 ret = bluetooth_l2cap_le_listen(fd, 1);
8368 int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection);
8371 * @fn int bluetooth_l2cap_le_accept_connection()
8372 * @brief Accepts the authorization request indicated by the event
8373 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8375 * This function is a synchronous call.
8377 * @return BLUETOOTH_ERROR_NONE - Success \n
8378 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8380 * @param[in] the socket fd of the server
8381 * @param[out] the socket fd of the client
8385 * @see bluetooth_l2cap_le_reject_connection
8387 int bluetooth_l2cap_le_accept_connection(int server_fd);
8390 * @fn int bluetooth_l2cap_le_reject_connection()
8391 * @brief Rejects the authorization request indicated by the event
8392 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8394 * This function is a synchronous call.
8396 * @return BLUETOOTH_ERROR_NONE - Success \n
8397 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8399 * @param[in] the socket fd of the server
8403 * @see bluetooth_l2cap_le_accept_connection
8405 int bluetooth_l2cap_le_reject_connection(int server_fd);
8408 * @fn gboolean bluetooth_l2cap_le_is_server_psm_available(int psm)
8409 * @brief Informs whether l2cap_le server psm is available or not.
8411 * This function is a synchronous call.
8413 * @return TRUE - L2CAP_LE PSM is available \n
8414 * FALSE - L2CAP_LE PSM is not available \n
8416 * @param[in] psm (int)
8422 gboolean bluetooth_l2cap_le_is_server_psm_available(int psm);
8425 * @fn int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8427 * @brief Connect to the remote device l2cap_le *
8429 * Connect to a specific l2cap_le socket on a remote device psm. This is a Async call. Once
8430 * the connection is successful callback BLUETOOTH_EVENT_L2CAP_LE_CONNECTED events is generated,
8431 * which contains the socket_fd, device role (L2CAP_LE_ROLE_SERVER/L2CAP_LE_ROLE_CLIENT), device addess
8432 * etc. The socket_fd can be further used to send the data. It better to do a ble scanning before
8433 * initiating a connection.
8435 * @return BLUETOOTH_ERROR_NONE - Success \n
8436 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8437 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8438 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
8439 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
8440 * @param[in] bluetooth_device_address_t remote bt_address
8441 * @param[in] int psm
8443 * @see bluetooth_l2cap_le_disconnect, bluetooth_l2cap_le_write
8447 void bt_event_callback(int event, bluetooth_event_param_t *param)
8451 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8453 bluetooth_l2cap_le_connection_t *conn_ind =
8454 (bluetooth_l2cap_le_connection_t *)param->param_data;
8456 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
8457 (conn_ind->device_role == L2CAP_LE_ROLE_SERVER) ?
8458 "SERVER" : "CLIENT");
8463 bluetooth_device_address_t remote_address = {{0},};
8464 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
8465 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
8467 ret = bluetooth_l2cap_le_connect(&remote_address, test_psm);
8469 printf("Connection failed, Reason = %d", ret);
8471 printf("Connection Success, Ret = %d", ret);
8475 int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8479 * @fn int bluetooth_l2cap_le_disconnect(int socket_fd)
8480 * @brief Disconnect l2cap_le connection
8483 * Disconnect a specific(device node fd) L2CAP_LE connection. This is a Synchronous call and there
8484 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8487 * @return BLUETOOTH_ERROR_NONE - Success \n
8488 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8489 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8490 * @param[in] int remote socket_fd
8493 * @see bluetooth_l2cap_le_connect
8497 ret = bluetooth_l2cap_le_disconnect(g_ret_fd);
8499 printf("Disconnection failed");
8501 printf("Disconnection Success");
8506 int bluetooth_l2cap_le_disconnect(int socket_fd);
8509 * @fn int bluetooth_l2cap_le_write (int fd, const char *buf, int length)
8510 * @brief Write to l2cap_le connection
8513 * This API is used to send the data over the l2cap_le connection. This is a
8514 * synchronous API. The same API is used to send the data for server and the client.
8516 * @return BLUETOOTH_ERROR_NONE - Success \n
8517 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8518 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
8520 * @param[in] const char *buff Data buffer to send
8521 * @param[in] int length Length of the data
8524 * @see bluetooth_l2cap_le_connect
8527 char *buff = "Test data 123456789"
8528 ret = bluetooth_l2cap_le_write(g_ret_fd, buff, 15);
8530 printf("Send failed");
8532 printf("Send success");
8536 int bluetooth_l2cap_le_write(int fd, const char *buf, int length);
8539 * @fn gboolean bluetooth_l2cap_le_client_is_connected(
8540 * const bluetooth_device_address_t *device_address, gboolean *connected)
8541 * @brief Informs whether l2cap_le client is connected.
8543 * This function is a synchronous call.
8545 * @return TRUE - L2CAP_LE client is connected \n
8546 * FALSE - L2CAP_LE client is not connected \n
8552 int bluetooth_l2cap_le_client_is_connected(
8553 const bluetooth_device_address_t *device_address, gboolean *connected);
8556 * @fn gboolean bluetooth_l2cap_le_server_is_connected(
8557 * const bluetooth_device_address_t *device_address, gboolean *connected)
8558 * @brief Informs whether l2cap_le server is connected.
8560 * This function is a synchronous call.
8562 * @return TRUE - L2CAP_LE server is connected \n
8563 * FALSE - L2CAP_LE server is not connected \n
8569 int bluetooth_l2cap_le_server_is_connected(
8570 const bluetooth_device_address_t *device_address, gboolean *connected);
8573 * @fn gboolean bluetooth_l2cap_le_get_psm(int server_fd, int *psm)
8574 * @brief gives the psm of the specific l2cap_le socket connection.
8576 * This function is a synchronous call.
8578 * @return BLUETOOTH_ERROR_NONE - Success \n
8579 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8580 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8582 * @param[in] the socket fd of the server
8583 * @param[out] int *psm
8589 int bluetooth_l2cap_le_get_psm(int id, int *psm);
8592 * @fn gboolean bluetooth_l2cap_le_get_max_buffer_size(int *size)
8593 * @brief gives the maximum size of buffer.
8595 * This function is a synchronous call.
8597 * @return BLUETOOTH_ERROR_NONE - Success \n
8598 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8599 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8601 * @param[out] int *size
8607 int bluetooth_l2cap_le_get_max_buffer_size(int *size);
8615 #endif /* __cplusplus */
8616 #endif /* _BLUETOOTH_API_H_*/