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_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
884 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
885 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
886 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
887 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
888 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
889 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
890 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
891 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
892 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
893 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
894 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
895 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
896 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
897 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
898 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
899 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
900 BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
901 BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
902 BLUETOOTH_EVENT_HF_CONNECTED,
903 BLUETOOTH_EVENT_HF_DISCONNECTED,
904 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
905 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
906 BLUETOOTH_EVENT_HF_RING_INDICATOR,
907 BLUETOOTH_EVENT_HF_CALL_WAITING,
908 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
909 BLUETOOTH_EVENT_HF_CALL_STARTED,
910 BLUETOOTH_EVENT_HF_CALL_ENDED,
911 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
912 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
913 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
914 BLUETOOTH_EVENT_HF_CALL_STATUS,
915 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
916 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
917 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
918 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
919 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
920 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
921 BLUETOOTH_EVENT_HF_CALL_IDLE,
922 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
923 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
924 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
925 BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
927 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
928 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
929 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
930 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
931 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
933 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
934 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
935 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
936 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
937 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
938 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
939 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
940 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
942 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
943 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
944 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
945 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
946 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
947 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
948 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
950 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
951 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
952 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
953 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
954 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
955 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
956 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
957 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
958 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
960 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
961 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
962 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
963 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
964 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
965 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
966 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
967 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
968 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
969 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
970 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
972 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
973 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
974 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
975 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
976 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
977 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
978 BLUETOOTH_EVENT_MESH_SCAN_STARTED = BLUETOOTH_EVENT_MESH_BASE,
979 BLUETOOTH_EVENT_MESH_SCAN_FINISHED,
980 BLUETOOTH_EVENT_MESH_SCAN_RESULT,
981 BLUETOOTH_EVENT_MESH_AUTHENTICATION_REQUEST,
982 BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED,
983 BLUETOOTH_EVENT_MESH_NODE_BROWSED,
984 BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES,
985 BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
986 BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED,
987 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
988 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST,
989 BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
990 BLUETOOTH_EVENT_MESH_MODEL_MSG_RECEIVED,
991 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST,
992 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED,
993 BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED,
994 BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
995 BLUETOOTH_EVENT_MESH_JOIN_COMPLETED,
996 BLUETOOTH_EVENT_L2CAP_LE_DATA_RECEIVED = BLUETOOTH_EVENT_L2CAP_LE_BASE,
997 /**< L2CAP_LE data receive event */
998 BLUETOOTH_EVENT_L2CAP_LE_CONNECTED, /**< L2CAP_LE server/client connect */
999 BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED, /**< L2CAP_LE server/client disconnect */
1000 BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE,
1001 BLUETOOTH_EVENT_L2CAP_LE_SERVER_REMOVED
1002 } bluetooth_event_type_t;
1005 * This bt_service_uuid_list_t enum indicates service uuid list .
1006 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
1010 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
1011 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
1012 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
1013 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
1014 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
1015 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
1016 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
1017 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
1018 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
1019 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
1020 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
1021 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
1022 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
1024 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
1025 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
1026 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
1027 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
1028 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
1029 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
1030 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
1031 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
1032 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
1033 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
1034 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
1035 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
1036 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
1037 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
1039 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
1040 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
1041 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
1042 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
1043 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
1044 /**<DIRECT PRINTING*/
1045 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
1046 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
1047 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
1048 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
1049 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
1050 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
1051 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
1052 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
1053 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
1054 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
1055 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
1056 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
1057 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
1058 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
1059 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
1060 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
1061 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
1062 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
1063 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
1064 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
1065 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
1066 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
1067 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
1068 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
1069 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
1070 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
1071 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
1072 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
1073 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
1074 } bluetooth_service_uuid_list_t;
1077 * Service class part of class of device returned from device discovery
1080 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1081 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1082 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1083 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1084 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1085 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1086 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1087 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1088 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1089 } bluetooth_device_service_class_t;
1093 * Major device mask (For device discovery)
1096 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1097 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1098 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1099 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1100 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1101 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1102 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1103 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1104 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1105 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1106 } bluetooth_device_major_mask_t;
1110 * Major device class (part of Class of Device)
1113 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1114 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1115 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1116 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1117 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1118 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1119 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1120 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1121 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1122 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1123 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1124 } bluetooth_device_major_class_t;
1127 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1129 /* About Computer Major class */
1130 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1132 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1133 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1134 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1135 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1136 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1138 /* About Phone Major class */
1139 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1140 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1141 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1142 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1143 /**< voice gateway minor class */
1144 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1146 /* About LAN/Network Access Point Major class */
1147 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1149 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1150 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1151 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1153 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1154 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1156 /* About Audio/Video Major class */
1157 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1158 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1160 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1161 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1162 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1163 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1164 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1165 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1166 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1167 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1168 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1169 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1170 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1171 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1172 /**< Video Display and Loud
1173 Speaker minor class */
1174 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1177 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1179 /* About Peripheral Major class */
1180 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1181 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1182 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1183 /**< Combo Keyboard or pointing
1184 device minorclass */
1186 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1187 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1188 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1189 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1190 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1191 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1192 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1193 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1194 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1196 /* About Imaging Major class */
1197 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1198 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1199 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1200 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1202 /* About Wearable Major class */
1203 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1204 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1205 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1206 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1207 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1209 /* About Toy Major class */
1210 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1211 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1212 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1213 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1214 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1216 /* About Health Major class */
1217 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1218 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1219 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1220 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1221 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1222 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1223 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1224 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1225 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1226 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1227 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1228 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1229 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1230 } bluetooth_device_minor_class_t;
1233 * structure to hold the device information
1236 bluetooth_device_major_class_t major_class; /**< major device class */
1237 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1238 bluetooth_device_service_class_t service_class;
1239 /**< service device class */
1240 } bluetooth_device_class_t;
1243 * Discovery Role types
1246 DISCOVERY_ROLE_BREDR = 0x1,
1248 DISCOVERY_ROLE_LE_BREDR
1249 } bt_discovery_role_type_t;
1252 * Connected state types
1255 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1256 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1257 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1258 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1259 } bluetooth_connected_link_t;
1265 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1266 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1267 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1268 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1269 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1270 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1271 BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80, /**< rssi high threshold */
1272 } bluetooth_le_scan_filter_feature_t;
1275 * LE connection mode
1278 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1279 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1280 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1281 } bluetooth_le_connection_mode_t;
1284 * structure to hold the device information
1287 bluetooth_device_address_t device_address; /**< device address */
1288 bluetooth_device_name_t device_name; /**< device name */
1289 bluetooth_device_class_t device_class; /**< device class */
1290 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1291 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1293 int rssi; /**< received strength signal*/
1294 gboolean paired; /**< paired flag */
1295 bluetooth_connected_link_t connected; /**< connected link type */
1296 gboolean trust; /**< trust flag */
1297 gboolean is_alias_set; /** is device alias set flag**/
1298 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1299 } bluetooth_device_info_t;
1302 * structure to hold the LE device information
1305 int data_len; /**< manafacturer specific data length */
1306 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1307 } bluetooth_le_advertising_data_t;
1310 guint8 data[BLUETOOTH_EXTENDED_ADVERTISING_DATA_LENGTH_MAX];
1311 } bluetooth_extended_advertising_data_t;
1314 gboolean use_reserved_slot;
1316 } bluetooth_le_slot_and_adv_type_t;
1319 int data_len; /**< manafacturer specific data length */
1320 bluetooth_extended_advertising_data_t data; /**< manafacturer specific data */
1321 } bluetooth_le_extended_advertising_data_t;
1324 bluetooth_device_address_t device_address; /**< device address */
1325 int addr_type; /**< address type*/
1326 int rssi; /**< received strength signal*/
1330 int advertising_sid;
1332 int periodic_adv_int;
1334 /* TODO : Replace bluetooth_le_advertising_data_t adv_ind_data with
1335 * bluetooth_le_extended_advertising_data_t once
1336 * LE_EXTENDED feature is supported */
1337 bluetooth_le_advertising_data_t adv_ind_data;
1338 bluetooth_le_advertising_data_t scan_resp_data;
1339 } bluetooth_le_device_info_t;
1343 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1344 bluetooth_device_address_t device_address; /**< device address */
1345 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1346 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1347 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1348 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1349 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1350 bluetooth_le_advertising_data_t service_data; /**< service data */
1351 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1352 int manufacturer_id; /**< manufacturer ID */
1353 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1354 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1355 int rssi_high_threshold; /**< rssi high threshold */
1356 } bluetooth_le_scan_filter_t;
1359 bluetooth_device_address_t device_address; /**< device address */
1360 unsigned int mtu; /** < MTU set for the ATT connection */
1361 unsigned int status; /** < status of the MTU exchange */
1362 } bluetooth_le_att_mtu_info_t;
1365 * structure to hold the paired device information
1368 bluetooth_device_address_t device_address; /**< paired device address */
1369 bluetooth_device_name_t device_name; /**< device name */
1370 bluetooth_device_class_t device_class; /**< device class */
1371 } bluetooth_paired_device_info_t;
1374 * structure to hold the paired device information
1377 bluetooth_device_address_t device_address;
1378 /**< device address */
1379 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1380 /**< network interface name */
1381 } bluetooth_network_device_info_t;
1384 * Authentication event types
1388 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1389 BLUETOOTH_AUTH_PIN_REQUEST,
1390 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1391 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1392 } bluetooth_auth_type_t;
1395 * structure to hold the pincode/pass-key req informations
1398 bluetooth_device_address_t device_address; /**< remote device address */
1399 bluetooth_device_name_t device_name; /**< device name */
1400 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1401 bool incoming; /**< stores if bonding request is incoming */
1402 } bluetooth_authentication_request_info_t;
1405 * Stucture to hold discovery option
1408 unsigned short max_response; /**< the number of maximum response */
1409 unsigned short discovery_duration;
1410 /**< duration of discovery (seconds) */
1411 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1412 classOfDevice variable */
1413 } bluetooth_discovery_option_t;
1416 * Stucture to hold event information
1419 int event; /**< event type */
1420 int result; /**< Success or error value */
1422 /**<parameter data pointer */
1424 } bluetooth_event_param_t;
1427 bluetooth_device_address_t device_addr;
1428 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1429 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1430 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1435 bluetooth_device_address_t device_addr;
1436 unsigned char addr_type;
1439 } bt_connection_info_t;
1442 * Stucture to rfcomm receive data
1447 /**< the socket fd */
1448 int buffer_size;/**< the length of the receive buffer */
1450 /**< the receive data buffer */
1451 } bluetooth_rfcomm_received_data_t;
1454 * Stucture to l2cap_le receive data
1457 int socket_fd; /**< the socket fd */
1458 int buffer_size; /**< the length of the receive buffer */
1459 char *buffer; /**< the receive data buffer */
1460 } bluetooth_l2cap_le_received_data_t;
1466 HTYPE_TRANS_HANDSHAKE,
1467 HTYPE_TRANS_HID_CONTROL,
1468 HTYPE_TRANS_GET_REPORT,
1469 HTYPE_TRANS_SET_REPORT,
1470 HTYPE_TRANS_GET_PROTOCOL,
1471 HTYPE_TRANS_SET_PROTOCOL,
1473 HTYPE_TRANS_UNKNOWN,
1474 HTYPE_TRANS_GET_IDLE = 0xF0,
1475 HTYPE_TRANS_SET_IDLE = 0xF1,
1476 } bt_hid_header_type_t;
1482 PTYPE_DATA_RTYPE_INPUT,
1483 PTYPE_DATA_RTYPE_OUTPUT
1484 } bt_hid_param_type_t;
1487 * Stucture to hid receive data
1490 const char *address;
1491 bt_hid_header_type_t type;
1492 /**< Header type containing */
1493 bt_hid_param_type_t param;
1494 /**< Param type in header like INPUT Report or OutPut Report */
1495 int buffer_size;/**< the length of the receive buffer */
1497 /**< the receive data buffer */
1498 } bluetooth_hid_received_data_t;
1501 * Stucture to rfcomm connection
1505 int socket_fd; /**< the socket fd */
1506 int server_id; /* Server id */
1507 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1508 bluetooth_device_address_t device_addr;
1509 /**< device address */
1510 char uuid[BLUETOOTH_UUID_STRING_MAX];
1511 } bluetooth_rfcomm_connection_t;
1514 * Stucture to rfcomm disconnection
1518 /**< the socket fd */
1519 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1520 bluetooth_device_address_t device_addr;
1521 /**< device address */
1522 char uuid[BLUETOOTH_UUID_STRING_MAX];
1523 } bluetooth_rfcomm_disconnection_t;
1527 /**< the socket fd */
1528 bluetooth_device_address_t device_addr;
1529 /**< device address */
1530 } bluetooth_rfcomm_connection_request_t;
1533 * Stucture to l2cap_le connection
1536 int socket_fd; /**< the socket fd */
1537 int server_id; /* Server id */
1538 int device_role; /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1539 bluetooth_device_address_t device_addr; /**< device address */
1541 } bluetooth_l2cap_le_connection_t;
1544 * Stucture to l2cap_le disconnection
1547 int socket_fd; /**< the socket fd */
1549 /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1550 bluetooth_device_address_t device_addr; /**< device address */
1552 } bluetooth_l2cap_le_disconnection_t;
1555 * Stucture to l2cap_le connection request
1558 int socket_fd; /**< the socket fd */
1559 bluetooth_device_address_t device_addr; /**< device address */
1560 } bluetooth_l2cap_le_connection_request_t;
1569 } bt_hdp_qos_type_t;
1575 HDP_ROLE_SOURCE = 0x0,
1577 } bt_hdp_role_type_t;
1581 * Stucture to HDP connected
1584 const char *app_handle; /**< the application handle */
1585 unsigned int channel_id; /**< the channel id */
1586 bt_hdp_qos_type_t type; /**< the QOS type */
1587 bluetooth_device_address_t device_address; /**< the remote address */
1588 } bt_hdp_connected_t;
1591 * Stucture to HDP disconnected
1594 unsigned int channel_id; /**< the channel id */
1595 bluetooth_device_address_t device_address; /**< the remote address */
1596 } bt_hdp_disconnected_t;
1599 * Stucture to HDP data indication
1602 unsigned int channel_id; /**< the channel id */
1603 const char *buffer; /**< the RX data buffer */
1604 unsigned int size; /**< the RX data size */
1605 } bt_hdp_data_ind_t;
1608 * Stucture to OPP client transfer information
1615 } bt_opc_transfer_info_t;
1617 /* TODO: MAP client structures, see above */
1619 * Stucture to Map filter fields
1624 } bt_map_list_filter_fields_info_t;
1626 /* Obex Server transfer type */
1627 #define TRANSFER_PUT "PUT"
1628 #define TRANSFER_GET "GET"
1630 * Stucture to OPP/FTP Server authorize information
1637 } bt_obex_server_authorize_into_t;
1645 } bt_obex_server_type_t;
1648 * Stucture to OPP/FTP server transfer information
1656 unsigned long file_size;
1658 bt_obex_server_type_t server_type;
1660 unsigned char *contact_auth_info;
1661 } bt_obex_server_transfer_info_t;
1664 * Stucture to OPP/FTP server connection/disconnection information
1670 } bt_obex_server_connection_info_t;
1674 * Stucture to OOB data
1678 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1679 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1680 unsigned int hash_len;
1681 unsigned int randomizer_len;
1683 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1684 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1685 unsigned int hash256_len;
1686 unsigned int randomizer256_len;
1688 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1689 unsigned int eir_len;
1693 * Structure to GATT attribute handle data
1699 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1700 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1701 } bt_gatt_handle_info_t;
1704 * Structure to a most basic GATT attribute handle data
1708 unsigned char uuid[16];
1709 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1710 } bt_gatt_handle_property_t;
1713 * Structure to GATT Remote service data
1720 bt_gatt_handle_info_t include_handles;
1721 bt_gatt_handle_info_t char_handle;
1722 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1723 } bt_gatt_service_property_t;
1726 * Structure to GATT Remote characteristic data
1730 char *service_handle;
1731 bt_gatt_handle_info_t handle_info;
1732 } bt_gatt_discovered_char_t;
1735 * Structure to format of GATT Characteristic Value
1739 unsigned char format;
1740 unsigned char exponent;
1741 unsigned short unit;
1742 unsigned char name_space;
1743 unsigned short description;
1744 } bt_gatt_char_format_t;
1747 * Structure to GATT Characteristic property
1755 bt_gatt_char_format_t format;
1757 unsigned int val_len;
1758 unsigned int permission;
1759 char *representation;
1760 bt_gatt_handle_info_t char_desc_handle;
1761 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1762 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1763 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1764 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1765 } bt_gatt_char_property_t;
1768 * Structure to GATT Characteristic descriptor property
1775 unsigned int val_len;
1776 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1777 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1778 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1779 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1780 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1781 } bt_gatt_char_descriptor_property_t;
1784 * Structure to GATT Characteristic value
1791 } bt_gatt_char_value_t;
1794 unsigned char UUID[16];
1798 } bt_gatt_notify_req_t ;
1801 * Structure to GATT Read Request
1805 char *service_handle;
1809 } bt_gatt_read_req_t;
1812 * Structure to GATT Value change
1816 char *service_handle;
1819 gboolean response_needed;
1823 } bt_gatt_value_change_t;
1826 bluetooth_device_address_t device_addr;
1828 bluetooth_gatt_service_change_type_t change_type;
1831 } bt_gatt_service_change_t;
1834 * Structure to GATT characteristc Notification change
1838 char *service_handle;
1839 gboolean att_notify;
1840 } bt_gatt_char_notify_change_t;
1843 * Structure to Indication confirmation
1847 char *service_handle;
1850 } bt_gatt_indicate_confirm_t;
1853 * Structure for GATT response data
1860 } bt_gatt_resp_data_t;
1863 * Structure to RSSI Signal Strength Alert
1874 * Structure to RSSI Signal Strength
1884 * Structure for RSSI Enabled or Disabled
1890 gboolean rssi_enabled;
1891 } bt_rssi_enabled_t;
1894 * Structure for RSSI Threshold
1899 int in_range_threshold;
1901 } bt_rssi_threshold_t;
1905 * Structure for Suppoted Profiles and Trusted Profiles
1912 } bt_supported_profile_trusted_t;
1915 * Structure for PBAP Folder Parameters
1918 unsigned char addressbook;
1919 unsigned char folder_type;
1923 * Structure for PBAP Pull application Parameters
1926 unsigned char format;
1927 unsigned char order;
1928 unsigned short offset;
1929 unsigned short maxlist;
1930 long long unsigned fields;
1931 } bt_pbap_pull_parameters_t;
1934 * Structure for PBAP List application Parameters
1937 unsigned char order;
1938 unsigned short offset;
1939 unsigned short maxlist;
1940 } bt_pbap_list_parameters_t;
1943 * Structure for PBAP Pull vCard application Parameters
1946 unsigned char format;
1947 long long unsigned fields;
1949 } bt_pbap_pull_vcard_parameters_t;
1952 * Structure for PBAP Search application Parameters
1955 unsigned char order;
1956 unsigned short offset;
1957 unsigned short maxlist;
1958 unsigned char search_attribute;
1959 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1960 } bt_pbap_search_parameters_t;
1963 * Structure for PBAP Connection Status
1966 bluetooth_device_address_t btaddr;
1968 } bt_pbap_connected_t;
1971 * Structure for PBAP Phonebook Size
1974 bluetooth_device_address_t btaddr;
1976 } bt_pbap_phonebook_size_t;
1979 * Structure for PBAP Phonebook Pull
1982 bluetooth_device_address_t btaddr;
1985 } bt_pbap_phonebook_pull_t;
1988 * Structure for PBAP vCard List
1991 bluetooth_device_address_t btaddr;
1995 } bt_pbap_vcard_list_t;
1998 * Structure for PBAP vCard Pull
2001 bluetooth_device_address_t btaddr;
2004 } bt_pbap_vcard_pull_t;
2007 * Structure for PBAP Phonebook search List
2010 bluetooth_device_address_t btaddr;
2014 } bt_pbap_phonebook_search_list_t;
2017 * Stucture to HF Call status information
2021 char *number; /*Phone Number */
2022 int direction; /*Direction :Incoming(1), Outgoing(0)*/
2023 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
2024 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
2025 int idx; /*Call index/ID */
2026 } bt_hf_call_status_info_t;
2031 } bt_hf_call_list_s;
2037 TRUSTED_PROFILE_PBAP = 1,
2038 TRUSTED_PROFILE_MAP,
2039 TRUSTED_PROFILE_SAP,
2040 TRUSTED_PROFILE_HFP_HF,
2041 TRUSTED_PROFILE_A2DP,
2042 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
2043 } bluetooth_trusted_profile_t;
2046 * Structure for LE data length change params
2049 bluetooth_device_address_t device_address;
2050 guint16 max_tx_octets;
2051 guint16 max_tx_time;
2052 guint16 max_rx_octets;
2053 guint16 max_rx_time;
2054 } bt_le_data_length_params_t;
2057 * Structure for proximity property change params
2060 bluetooth_device_address_t device_address;
2064 } bt_pxp_property_changed_params_t;
2067 * @brief DPM BT allowance state
2071 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
2072 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
2073 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
2074 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
2078 * @brief DPM API result
2082 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
2083 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
2084 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
2085 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
2086 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
2087 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
2091 * @brief DPM Policy status
2095 BLUETOOTH_DPM_STATUS_ERROR = -1,
2097 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
2098 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
2100 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
2101 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
2103 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2104 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2108 /* policy-group : BLUETOOTH */
2109 BLUETOOTH_DPM_POLICY_ALLOW,
2110 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2111 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2112 BLUETOOTH_DPM_POLICY_DEVICES_ALLOWLIST,
2113 BLUETOOTH_DPM_POLICY_DEVICES_BLOCKLIST,
2114 BLUETOOTH_DPM_POLICY_UUIDS_ALLOWLIST,
2115 BLUETOOTH_DPM_POLICY_UUIDS_BLOCKLIST,
2116 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2117 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2118 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2119 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2120 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2121 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2122 BLUETOOTH_DPM_POLICY_END,
2123 } bt_dpm_policy_cmd_t;
2126 struct bt_dpm_policy {
2132 typedef struct bt_dpm_policy bt_dpm_policy_t;
2135 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2136 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2137 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2138 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2139 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2140 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2141 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2142 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2143 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2144 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2145 BLUETOOTH_DPM_PROFILE_NONE,
2148 struct bt_dpm_profile_val {
2149 int value; /* tells whether the profile is enabled or disabled */
2151 typedef struct dpm_profile_val dpm_profile_state_t;
2154 * Structure to DPM device list
2158 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2159 } bt_dpm_device_list_t;
2162 * Structure to DPM uuid list
2166 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2167 } bt_dpm_uuids_list_t;
2170 * Structure for IPSP Interface Info
2173 bluetooth_device_address_t btaddr;
2175 } bt_ipsp_connection_info_t;
2179 char* remote_address;
2180 } bt_map_client_session_info_s;
2182 typedef char* bt_map_client_message_object_t;
2187 } bt_map_client_list_folders_filter_t;
2192 int8_t subject_length;
2201 } bt_map_client_list_messages_filter_t;
2204 bt_map_client_message_object_t message_object;
2209 char *sender_address;
2212 char *recipient_address;
2217 int64_t attachment_size;
2222 } bt_map_client_message_item_t;
2228 } bt_map_client_push_message_args_t;
2235 char *sender_address;
2238 char *recipient_address;
2247 } bt_map_client_message_t;
2250 char **names; // holding %size null-terminated folder names
2252 } bt_map_client_folders_s;
2255 bt_map_client_message_item_t *message_items;
2257 } bt_map_client_message_items_s;
2260 const char* target_file;
2262 } bt_get_message_callback_data;
2265 * Callback pointer type
2267 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2270 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2271 * @brief Set the callback function pointer for bluetooth event
2274 * This API will register the callback function, when any response and event are received from
2275 * bluetooth framework. @n
2276 * this registered callback function will be get called with appropriate event and data structures.
2277 * This function is a synchronous call. An application developer can call
2278 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2279 * type. This registered function will receive events of bluetooth_event_type_t type along with
2283 * @param[in] callback_ptr A pointer to the callback function
2284 * @param[in] user_data A pointer to user data
2285 * @return BLUETOOTH_ERROR_NONE - Success
2289 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2291 GMainLoop *main_loop = (GMainLoop*) user_data;
2295 // Code for each event
2297 g_main_loop_quit(main_loop);
2304 GMainLoop *main_loop = NULL;
2307 main_loop = g_main_loop_new(NULL, FALSE);
2308 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2309 if (ret >= BLUETOOTH_ERROR_NONE)
2311 // bluetooth_register_callback returned Success
2315 // bluetooth_register_callback returned failiure
2317 g_main_loop_run(main_loop);
2321 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2324 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2325 * @brief Set the callback function pointer for bluetooth le event
2328 * This API will register the callback function, when any response and event are received from
2329 * bluetooth framework. @n
2330 * this registered callback function will be get called with appropriate event and data structures.
2331 * This function is a synchronous call. An application developer can call
2332 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2333 * type. This registered function will receive events of bluetooth_event_type_t type along with
2337 * @param[in] callback_ptr A pointer to the callback function
2338 * @param[in] user_data A pointer to user data
2339 * @return BLUETOOTH_ERROR_NONE - Success
2343 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2346 * @fn int bluetooth_le_unregister_callback(void)
2347 * @brief Set the callback function pointer for bluetooth le event
2350 * This API will register the callback function, when any response and event are received from
2351 * bluetooth framework. @n
2352 * this registered callback function will be get called with appropriate event and data structures.
2353 * This function is a synchronous call. An application developer can call
2354 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2355 * type. This registered function will receive events of bluetooth_event_type_t type along with
2360 * @return BLUETOOTH_ERROR_NONE - Success
2364 int bluetooth_le_unregister_callback(void);
2367 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2368 * @brief Set the callback function pointer for bluetooth event
2371 * This API will register the callback function, when any response and event are received from
2372 * bluetooth framework. @n
2373 * this registered callback function will be get called with appropriate event and data structures.
2374 * This function is a synchronous call. An application developer can call
2375 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2376 * type. This registered function will receive events of bluetooth_event_type_t type along with
2381 * @return BLUETOOTH_ERROR_NONE - Success
2385 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2387 GMainLoop *main_loop = (GMainLoop*) user_data;
2391 // Code for each event
2393 g_main_loop_quit(main_loop);
2400 GMainLoop *main_loop = NULL;
2403 main_loop = g_main_loop_new(NULL, FALSE);
2404 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2405 if (ret >= BLUETOOTH_ERROR_NONE)
2407 // bluetooth_register_callback returned Success
2411 // bluetooth_register_callback returned failiure
2413 ret = bluetooth_deregister_callback(void);
2414 g_main_loop_run(main_loop);
2418 int bluetooth_unregister_callback(void);
2421 * @fn int bluetooth_enable_adapter(void)
2422 * @brief Enable the Bluetooth H/W
2425 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2426 * send request to bluetooth chip for activation.
2427 * This function is typically called at startup or when Bluetooth services are required. This
2428 * function must be called before calling any other API of Bluetooth operations.
2430 * Before performing any operations like Device discover, service search etc.., the adapter must be
2433 * This function is a asynchronous call.
2434 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2435 * through registered callback function with appropriate result code
2436 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2437 * BLUETOOTH_ERROR_NONE - Success \n
2439 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2440 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2442 * @return BLUETOOTH_ERROR_NONE - Success\n
2443 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2444 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2445 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2446 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2448 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2450 void bt_event_callback(int event, bluetooth_event_param_t *param)
2454 case BLUETOOTH_EVENT_ENABLED:
2455 if (param->result == BLUETOOTH_ERROR_NONE)
2457 // Successfully Enabled
2470 ret = bluetooth_enable_adapter();
2474 int bluetooth_enable_adapter(void);
2477 * @fn int bluetooth_disable_adapter(void)
2478 * @brief Disable the Bluetooth H/W
2481 * This function disables Bluetooth protocol stack and hardware. This function is called when
2482 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2484 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2485 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2486 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2488 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2491 * This function is a asynchronous call.
2492 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2493 * through registered callback function.
2496 * @return BLUETOOTH_ERROR_NONE - Success\n
2497 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2498 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2499 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2501 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2503 void bt_event_callback(int event, bluetooth_event_param_t *param)
2507 case BLUETOOTH_EVENT_DISABLED:
2508 if (param->result == BLUETOOTH_ERROR_NONE)
2510 // Successfully disabled
2523 ret = bluetooth_disable_adapter();
2526 int bluetooth_disable_adapter(void);
2527 int bluetooth_read_battery_data(bt_battery_data *latest);
2528 int bluetooth_set_battery_monitor_state(bool state);
2529 int bluetooth_get_battery_monitor_state(void);
2530 int bluetooth_recover_adapter(void);
2531 int bluetooth_check_adapter_le(void);
2532 int bluetooth_enable_adapter_le(void);
2534 int bluetooth_disable_adapter_le(void);
2535 int bluetooth_get_uuid_name(const char *uuid, char **name);
2538 * @fn int bluetooth_reset_adapter(void)
2539 * @brief Reset the Bluetooth H/W and values
2542 * This function resets Bluetooth protocol stack and hardware. This function is called when
2543 * an user want to initialize Bluetooth environment.
2545 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2548 * This function is a synchronous call.
2550 * @return BLUETOOTH_ERROR_NONE - Success\n
2551 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2553 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2558 ret = bluetooth_reset_adapter();
2561 int bluetooth_reset_adapter(void);
2564 * @fn int bluetooth_is_supported(void)
2565 * @brief Check if the bluetooth is supported or not by the current target
2567 * This API checks whether the bluetooth is supported or not.
2568 * This API only run by root permission.
2570 * This function is a synchronous call.
2572 * @return 0 - if bluetooth is not supported\n
2573 * 1 - if bluetooth is supported\n
2574 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2579 ret = bluetooth_is_supported();
2582 int bluetooth_is_supported(void);
2586 * @fn int bluetooth_check_adapter(void)
2587 * @brief Check the current status of the Bluetooth adapter
2590 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2591 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2592 * bluetooth adapter.
2593 * This API get the adapter internal data structure and check current adapter status.
2595 * This function is a synchronous call.
2598 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2599 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2601 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2605 ret = bluetooth_check_adapter();
2608 int bluetooth_check_adapter(void);
2611 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2612 * @brief Get the local adapter bluetooth address
2615 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2616 * the adapter should be enabled.
2617 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2618 * contain Bluetooth address.
2619 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2620 * friendly name for each device.
2621 * There is no event callback for this API.
2623 * This function is a synchronous call.
2626 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2627 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2628 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2629 * @param[out] local_address a device address of local bluetooth adapter
2634 bluetooth_device_address_t local_address={0,};
2637 ret = bluetooth_get_local_address(&local_address);
2640 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2643 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2644 * @brief Get the hci version
2647 * This function is used to get the bluetooth hci version
2648 * Before calling this API make sure that the adapter is enabled.
2650 * This function is a synchronous call.
2653 * @return BLUETOOTH_ERROR_NONE - Success \n
2654 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2655 * @param[out] timeout remain visibility timeout value
2658 bluetooth_version_t *version;
2660 ret = bluetooth_get_local_version (&version);
2663 int bluetooth_get_local_version(bluetooth_version_t *version);
2666 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2667 * @brief Get the local device name
2670 * This function is used, get the local device name. Since its difficult to remember the Adapter
2671 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2672 * friendly name is retrived by the remote device and displaying.
2673 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2675 * This function is a synchronous call.
2678 * @return BLUETOOTH_ERROR_NONE - Success \n
2679 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2680 * @param[out] local_name a local device name
2684 bluetooth_device_name_t local_name={0,}
2686 ret = bluetooth_get_local_name (&local_name);
2689 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2692 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2693 * @brief Set the local device name
2696 * This function is used to set the local device name. This is a human friendly name whose
2697 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2699 * This function is a synchronous call.
2701 * @param[in] local_name bluetooth device name to set local device
2703 * @return BLUETOOTH_ERROR_NONE - Success \n
2704 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2705 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2706 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2707 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2708 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2713 bluetooth_device_name_t local_name={0,}
2715 ret = bluetooth_set_local_name (&local_name);
2718 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2722 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2723 * @brief Check if the uuid is used or not
2725 * This function is used to check if the uuid is used or not.
2727 * This function is a synchronous call.
2729 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2730 * @param[out] used if the uuid is used or not
2732 * @return BLUETOOTH_ERROR_NONE - Success \n
2733 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2734 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2735 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2740 gboolean used = FALSE;
2741 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2742 ret = bluetooth_is_service_used(uuid, &used);
2745 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2748 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2749 * @brief Check if the device is connected to the specific service
2751 * This function is used to check if if the device is connected to the specific service.
2753 * This function is a synchronous call.
2755 * @param[in] local_address a device address of remote bluetooth device
2756 * @param[in] type the service type
2757 * @param[out] is_connected if the device is connected or not
2759 * @return BLUETOOTH_ERROR_NONE - Success \n
2760 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2761 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2762 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2767 gboolean is_connected = FALSE;
2768 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2769 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2772 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2773 bluetooth_service_type_t type,
2774 gboolean *is_connected);
2777 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2778 * @brief Gets device's connected link type
2780 * This function is used to get device's connected link type
2782 * This function is a synchronous call.
2784 * @param[in] device_address a device address of remote bluetooth device
2785 * @param[out] connected_link a device's connected link type
2787 * @return BLUETOOTH_ERROR_NONE - Success \n
2788 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2789 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2790 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2795 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2796 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2797 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2800 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2801 bluetooth_connected_link_t *connected_link);
2804 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2805 * @brief Sets a profile trusted for a device
2807 * This function is used to Set a profile as trusted for a device
2809 * This function is a synchronous call.
2811 * @param[in] device_address a device address of remote bluetooth device
2812 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2813 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2815 * @return BLUETOOTH_ERROR_NONE - Success \n
2816 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2817 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2818 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2822 int bluetooth_set_profile_trusted(
2823 const bluetooth_device_address_t *device_address,
2824 int profile, int trust);
2827 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2828 * @brief Gets a profile is trusted for a device
2830 * This function is used to Get a profile is trusted or not for a device
2832 * This function is a synchronous call.
2834 * @param[in] device_address a device address of remote bluetooth device
2835 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2836 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2838 * @return BLUETOOTH_ERROR_NONE - Success \n
2839 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2840 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2841 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2845 int bluetooth_get_profile_trusted(
2846 const bluetooth_device_address_t *device_address,
2847 int profile, int *trust);
2850 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2851 * @brief Get the visibility mode
2854 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2855 * visibity mode, the property of the device is determined whether it can be discoverable, non
2856 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2858 * This function is a synchronous call.
2861 * @return BLUETOOTH_ERROR_NONE - Success \n
2862 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2863 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2864 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2865 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2866 * @param[out] discoverable_mode current bluetooth discoverable mode
2868 * @see bluetooth_set_discoverable_mode
2870 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2872 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2875 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2878 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2880 * @brief Set the visibility mode
2883 * This function is used to set the discoverable mode (Visibility option).
2885 * Many times user may want to keep his device discoverable so that when peer device is performing
2886 * device search, he/she can find user's device. Application programmer can keep the mode as
2887 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2888 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2889 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2890 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2892 * This function is a synchronous call.
2894 * @return BLUETOOTH_ERROR_NONE - Success \n
2895 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2897 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2898 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2900 * @see bluetooth_get_discoverable_mode
2904 bluetooth_discoverable_mode_t mode;
2906 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2907 ret = bluetooth_set_discoverable_mode (mode, 180);
2911 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2916 * @fn int bluetooth_get_timeout_value(int *timeout)
2917 * @brief Get the visibility timeout value
2920 * This function is used to get the visibility timeout
2921 * Before calling this API make sure that the adapter is enabled.
2923 * This function is a synchronous call.
2926 * @return BLUETOOTH_ERROR_NONE - Success \n
2927 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2928 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2929 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2930 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2931 * @param[out] timeout remain visibility timeout value
2933 * @see bluetooth_set_discoverable_mode
2937 ret = bluetooth_get_timeout_value (&timeout);
2940 int bluetooth_get_timeout_value(int *timeout);
2944 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2945 * unsigned int classOfDeviceMask)
2946 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2948 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2949 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2950 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2951 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2952 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2953 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2954 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2955 * please see bluetooth_device_info_t for more details.
2958 * This API provides searching options like max responses, discovery duration in seconds and class
2959 * of device mask to filter device search. some times there may be too many bluetooth devices in
2960 * vicinity of your device.in such scenario, application can request to reduce number of responces
2961 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2962 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2963 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2964 * application defined time. please note that discovery_duration should be mentioned in seconds.
2965 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2968 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2969 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2970 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2972 * This function is a asynchronous call.
2973 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2974 * through registered callback function.
2976 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2977 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2979 * The completion or cancellation of the discovery is indicated by an
2980 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2982 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2985 * @return BLUETOOTH_ERROR_NONE - Success \n
2986 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2987 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2988 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2989 agent is not running \n
2991 * @param[in] max_response define the maximum response of the number of founded devices
2993 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2994 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2995 (refer to class of device)
2997 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3000 void bt_event_callback(int event, bluetooth_event_param_t *param)
3004 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
3006 bluetooth_device_info_t *device_info = NULL;
3007 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3009 device_info = (bluetooth_device_info_t *)param->param_data;
3010 memcpy(&searched_device, &device_info->device_address,
3011 sizeof(bluetooth_device_address_t));
3012 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3013 device_info->device_address.addr[0],
3014 device_info->device_address.addr[1],
3015 device_info->device_address.addr[2],
3016 device_info->device_address.addr[3],
3017 device_info->device_address.addr[4],
3018 device_info->device_address.addr[5]);
3021 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
3023 bluetooth_device_info_t *device_info = NULL;
3024 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
3026 device_info = (bluetooth_device_info_t *)param->param_data;
3027 memcpy(&searched_device, &device_info->device_address,
3028 sizeof(bluetooth_device_address_t));
3029 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3030 device_info->device_name.name,
3031 device_info->device_address.addr[0],
3032 device_info->device_address.addr[1],
3033 device_info->device_address.addr[2],
3034 device_info->device_address.addr[3],
3035 device_info->device_address.addr[4],
3036 device_info->device_address.addr[5]);
3040 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3041 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3046 unsigned short max_response;
3047 unsigned short discovery_duration;
3048 unsigned classOfDeviceMask;
3052 discovery_duration =0;
3053 classOfDeviceMask =0;
3055 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
3060 int bluetooth_start_discovery(unsigned short max_response,
3061 unsigned short discovery_duration,
3062 unsigned int classOfDeviceMask);
3065 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
3066 * unsigned short max_response,
3067 * unsigned short discovery_duration,
3068 * unsigned int classOfDeviceMask)
3069 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
3071 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
3072 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
3073 * Please see bluetooth_start_discovery() for other parameters description.
3075 * This function is a asynchronous call.
3076 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
3077 * through registered callback function.
3079 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
3080 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
3082 * The completion or cancellation of the discovery is indicated by an
3083 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
3085 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
3088 * @return BLUETOOTH_ERROR_NONE - Success \n
3089 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3090 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3091 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
3092 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3093 agent is not running \n
3095 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
3096 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
3097 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
3098 * @param[in] max_response define the maximum response of the number of founded devices
3100 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3101 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3102 (refer to class of device)
3104 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3107 unsigned short type;
3108 unsigned short max_response;
3109 unsigned short discovery_duration;
3110 unsigned classOfDeviceMask;
3115 discovery_duration =0;
3116 classOfDeviceMask =0;
3118 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3123 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3124 unsigned short max_response,
3125 unsigned short discovery_duration,
3126 unsigned int classOfDeviceMask);
3129 * @fn int bluetooth_cancel_discovery (void)
3130 * @brief Cancel the on-going device discovery operation
3133 * This function stops the on-going device discovery operation. This API has to be called after the
3134 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3135 * the bluetooth_start_discovery API
3137 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3138 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3139 * cancel the discover request once the user received the device to which he wish to connect.
3141 * This function is a asynchronous call.
3142 * If the call is success to cancel discovey then the application will receive
3143 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3144 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3145 * BLUETOOTH_ERROR_NONE
3148 * @return BLUETOOTH_ERROR_NONE - Success \n
3149 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3150 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3151 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3152 other application \n
3153 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3155 * @see bluetooth_start_discovery
3157 void bt_event_callback(int event, bluetooth_event_param_t *param)
3161 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3162 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3171 ret = bluetooth_cancel_discovery();
3174 int bluetooth_cancel_discovery(void);
3177 * @fn int bluetooth_start_le_discovery(void)
3178 * @brief Start the generic device discovery which finds the LE devices.
3180 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3181 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3182 * It try to find LE devices. Bluetooth device address and name are
3183 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3184 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3185 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3186 * please see bluetooth_device_info_t for more details.
3188 * This function is a asynchronous call.
3189 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3190 * through registered callback function.
3192 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3195 * The completion or cancellation of the discovery is indicated by an
3196 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3198 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3201 * @return BLUETOOTH_ERROR_NONE - Success \n
3202 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3203 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3204 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3205 agent is not running \n
3208 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3211 void bt_event_callback(int event, bluetooth_event_param_t *param)
3215 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3217 bluetooth_device_info_t *device_info = NULL;
3218 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3220 device_info = (bluetooth_device_info_t *)param->param_data;
3221 memcpy(&searched_device, &device_info->device_address,
3222 sizeof(bluetooth_device_address_t));
3223 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3224 device_info->device_address.addr[0],
3225 device_info->device_address.addr[1],
3226 device_info->device_address.addr[2],
3227 device_info->device_address.addr[3],
3228 device_info->device_address.addr[4],
3229 device_info->device_address.addr[5]);
3233 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3234 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3240 ret = bluetooth_start_discovery();
3245 int bluetooth_start_le_discovery(void);
3248 * @fn int bluetooth_stop_le_discovery (void)
3249 * @brief Cancel the on-going device LE discovery operation
3252 * This function stops the on-going device discovery operation. This API has to be called after the
3253 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3254 * the bluetooth_start_le_discovery API
3257 * This function is a asynchronous call.
3258 * If the call is success to cancel discovey then the application will receive
3259 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3260 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3261 * BLUETOOTH_ERROR_NONE
3264 * @return BLUETOOTH_ERROR_NONE - Success \n
3265 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3266 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3267 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3268 other application \n
3269 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3271 * @see bluetooth_start_discovery
3273 void bt_event_callback(int event, bluetooth_event_param_t *param)
3277 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3278 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3287 ret = bluetooth_stop_le_discovery();
3290 int bluetooth_stop_le_discovery(void);
3293 * @fn int bluetooth_is_discovering(void)
3294 * @brief Check for the device discovery is in-progress or not.
3296 * This API is used to check the current status of the Discovery operation.If discovery is in\
3297 * progress normally other operations are not allowed.
3298 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3299 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3300 * event before performing other operations. This API is used to get for the current discovery
3301 * operation status and using bluetooth_cancel_discovery()
3302 * we can cancell the ongoing discovery process.
3303 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3306 * This function checks whether the device discovery is started or not.
3308 * This function is a synchronous call.
3311 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3312 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3313 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3316 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3320 ret = bluetooth_is_discovering ();
3323 int bluetooth_is_discovering(void);
3326 * @fn int bluetooth_is_le_discovering(void)
3327 * @brief Check for the device LE discovery is in-progress or not.
3329 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3330 * progress normally other operations are not allowed.
3331 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3332 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3333 * event before performing other operations. This API is used to get for the current discovery
3334 * operation status and using bluetooth_stop_le_discovery()
3335 * we can cancell the ongoing LE discovery process.
3336 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3339 * This function checks whether the device LE discovery is started or not.
3341 * This function is a synchronous call.
3344 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3345 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3346 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3349 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3353 ret = bluetooth_is_le_discovering ();
3356 int bluetooth_is_le_discovering(void);
3359 * @fn int bluetooth_is_le_scanning(void)
3360 * @brief Check for the device LE scan is in-progress or not.
3362 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3363 * progress normally other operations are not allowed.
3365 * This function checks whether the device LE Scan is started or not.
3367 * This function is a synchronous call.
3369 * @return TRUE - LE Scan in progress \n
3370 * FALSE - LE Scan is not in progress \n
3375 gboolean is_le_scanning = 0;
3376 is_le_scanning = bluetooth_is_le_scanning ();
3379 gboolean bluetooth_is_le_scanning(void);
3381 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3384 * @fn int bluetooth_force_hcidump(int timeout)
3385 * @brief Enable /disable force-hcidump
3387 * This function control force-hcidump.
3389 * This function is a synchronous call.
3391 * @return BLUETOOTH_ERROR_NONE - Success \n
3392 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3393 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3395 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3400 int bluetooth_force_hcidump(int timeout);
3403 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3404 * @brief Register scan filter.
3406 * This function registers the scan filter.
3408 * This function is a synchronous call.
3410 * @return BLUETOOTH_ERROR_NONE - Success \n
3412 * @param[in] filter scan filter to register
3416 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3419 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3420 int link_type, bt_rssi_threshold_t rssi_threshold)
3421 * @brief Enable RSSI monitoring
3423 * This function enables RSSI monitoring and sets threshold for a connection
3425 * @return BLUETOOTH_ERROR_NONE - Success \n
3428 * @see bluetooth_get_rssi_strength
3430 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3431 int link_type, bt_rssi_threshold_t *rssi_threshold);
3434 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3435 * @brief Gets Raw RSSI signal Strength
3437 * This function gives the Raw RSSI signal strength for a connection.
3439 * @return BLUETOOTH_ERROR_NONE - Success \n
3442 * @see bluetooth_enable_rssi
3444 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3446 int bluetooth_set_connectable(gboolean is_connectable);
3448 int bluetooth_is_connectable(gboolean *is_connectable);
3450 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3453 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3454 * @brief Initiate a bonding process
3457 * This function initiates a bonding procedure with a peer device. The bonding procedure
3458 * enables authentication and optionally encryption on the Bluetooth link.
3460 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3461 * inititate the bonding request to the devices already in the paired list.
3463 * Usually we call this API after the device discovery.
3464 * This function is a asynchronous call.
3466 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3467 * mentioed result code
3468 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3469 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3470 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3471 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3472 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3474 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3475 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3478 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3481 * @return BLUETOOTH_ERROR_NONE - Success \n
3482 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3483 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3484 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3485 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3487 * @param[in] device_address This indicates an address of the device with which the pairing
3488 * should be initiated
3490 * @see bluetooth_cancel_bonding
3492 void bt_event_callback(int event, bluetooth_event_param_t *param)
3496 case BLUETOOTH_EVENT_BONDING_FINISHED:
3498 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3499 if (param->result >= BLUETOOTH_ERROR_NONE)
3501 bluetooth_device_info_t *device_info = NULL;
3502 device_info = (bluetooth_device_info_t *)param->param_data;
3503 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3504 mjr[%#x] min[%#x] srv[%#x]",
3505 device_info->device_name.name,
3506 device_info->device_address.addr[0],
3507 device_info->device_address.addr[1],
3508 device_info->device_address.addr[2],
3509 device_info->device_address.addr[3],
3510 device_info->device_address.addr[4],
3511 device_info->device_address.addr[5],
3512 device_info->device_class.major_class,
3513 device_info->device_class.minor_class,
3514 device_info->device_class.service_class);
3528 bluetooth_device_address_t device_address={{0}};
3530 ret = bluetooth_bond_device(&device_address);
3534 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3537 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3538 * bluetooth_conn_type_t conn_type)
3539 * @brief Initiate a bonding process
3542 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3543 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3545 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3546 * inititate the bonding request to the devices already in the paired list.
3548 * Usually we call this API after the device discovery.
3549 * This function is a asynchronous call.
3551 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3552 * mentioed result code
3553 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3554 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3555 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3556 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3557 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3559 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3560 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3563 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3566 * @return BLUETOOTH_ERROR_NONE - Success \n
3567 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3568 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3569 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3570 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3572 * @param[in] device_address This indicates an address of the device with which pairing
3573 * should be initiated
3574 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3577 * @see bluetooth_cancel_bonding
3579 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3580 bluetooth_conn_type_t conn_type);
3583 * @fn int bluetooth_cancel_bonding(void)
3584 * @brief Cancel the on-going bonding process
3586 * This API is called to cancel the on-going bonding procedure. It should be called before the
3587 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3588 * This API is useful when the remote device is not responding to the bond request or we wish to
3589 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3591 * This function is a synchronous call.
3593 * @return BLUETOOTH_ERROR_NONE - Success \n
3594 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3595 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3598 * @see bluetooth_bond_device
3604 ret = bluetooth_cancel_bonding();
3607 int bluetooth_cancel_bonding(void);
3610 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3611 * @brief Remove bonding
3614 * To communicate with remote device over bluetooth link, user should bond with peer device.
3615 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3616 * API is used to remove peer device from the list. Please note that after removing the device
3617 * from bonded device list, you cannot communication with peer device until bonding happens again.
3619 * User can call this function by passing bluetooth device address of any bonded device. Please note
3620 * that after successful return of this function, any bluetooth application running on your device
3621 * will not be able to communicate with unbonded device until bond operation happens again using
3622 * bluetooth_bond_device()
3625 * This function is a asynchronous call. The request to remove the specified device from the bonded
3626 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3627 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3628 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3632 * @return BLUETOOTH_ERROR_NONE - Success \n
3633 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3634 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3635 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3636 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3637 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3638 * agent is not running \n
3639 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3642 * @param[in] device_address This indicates an address of the device to remove bonding
3646 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3649 void bt_event_callback(int event, bluetooth_event_param_t *param)
3652 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3653 bluetooth_device_address_t *dev_addr = NULL;
3655 if (param->result == BLUETOOTH_ERROR_NONE) {
3656 dev_addr = (bluetooth_device_address_t *)param->param_data;
3658 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3659 dev_addr->addr[0], dev_addr->addr[1]
3660 dev_addr->addr[2], dev_addr->addr[3]
3661 dev_addr->addr[4], dev_addr->addr[5]
3672 bluetooth_device_address_t *device_address;
3674 // copy valid device address in device_address
3676 ret = bluetooth_unbond_device(device_address);
3679 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3682 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3683 * @brief Get bonded(paired) device list
3686 * This API gets all bonded device list.
3687 * The devices in the bonded device list further can be used to perform the authorization by calling
3688 * bluetooth_authorize_device API.
3690 * This function is a synchronous call.
3691 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3692 * there is no valid information in the dev_list.
3693 * The len field in the dev_list represents the number of bonded devices. The data structure for
3694 * bonded device information is bluetooth_device_info_t.
3697 * @return BLUETOOTH_ERROR_NONE - Success \n
3698 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3700 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3702 void bt_get_bonded_devices(void)
3706 GPtrArray *devinfo = NULL;
3707 bluetooth_device_info_t *ptr;
3709 // allocate the g_pointer_array
3710 devinfo = g_ptr_array_new();
3712 ret = bluetooth_get_bonded_device_list(&devinfo);
3713 if (ret != BLUETOOTH_ERROR_NONE)
3715 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3719 printf("g pointer arrary count : [%d]", devinfo->len);
3720 for (i=0; i<devinfo->len; i++)
3722 ptr = g_ptr_array_index(devinfo, i);
3725 printf("Name [%s]\n", ptr->device_name.name);
3726 printf("Major Class [%d]\n", ptr->device_class.major_class);
3727 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3728 printf("Service Class [%d]\n", ptr->device_class.service_class);
3729 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3730 ptr->device_address.addr[0],
3731 ptr->device_address.addr[1], ptr->device_address.addr[2],
3732 ptr->device_address.addr[3],
3733 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3740 // free g_pointer_array
3741 g_ptr_array_free(devinfo, TRUE);
3746 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3748 int bluetooth_get_profile_connected_device_list(
3749 const char *profile_uuid, GPtrArray **addr_list);
3752 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3753 * bluetooth_device_info_t *dev_info)
3754 * @brief Get a bonded(paired) device
3757 * This API gets a bonded device.
3759 * This function is a synchronous call.
3760 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3761 * there is no valid information in the dev_info.
3762 * The data structure for bonded device information is bluetooth_device_info_t.
3765 * @return BLUETOOTH_ERROR_NONE - Success \n
3766 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3768 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3770 void bt_get_bonded_device(void)
3774 bluetooth_device_info_t devinfo = {0};
3775 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3777 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3778 if (ret != BLUETOOTH_ERROR_NONE)
3780 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3784 printf("Name [%s]\n", devinfo.device_name.name);
3785 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3786 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3787 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3788 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3789 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3790 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3791 devinfo.device_address.addr[5]);
3800 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3801 bluetooth_device_info_t *dev_info);
3804 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3805 * gboolean *is_alias_set)
3806 * @brief Get is_alias_set property of device
3808 * This API gets is_alias_set property of a bonded device.
3810 * This function is a synchronous call.
3811 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3812 * If not,there is no valid information in the is_alias_set.
3814 * @return BLUETOOTH_ERROR_NONE - Success \n
3815 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3820 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3822 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3825 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3826 gboolean *is_alias_set);
3829 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3830 * @brief set alias for bonded device
3833 * This function set alias for bonded device.
3835 * This function is a synchronous call.
3838 * @return BLUETOOTH_ERROR_NONE - Success \n
3839 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3840 * @param[in] device_address This indicates an address of the remote device
3841 * @param[in] alias This indicates an alias to set
3846 ret = bluetooth_set_alias(&remote_address);
3849 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3853 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3854 * @brief Get remote deivice
3857 * This function gets specific remote device.
3859 * This function is a asynchronous call.
3860 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3863 * @return BLUETOOTH_ERROR_NONE - Success \n
3864 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3865 * @param[in] device_address This indicates an address of the remote device
3870 ret = bluetooth_get_remote_device(&remote_address);
3873 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3876 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3877 * gboolean authorized)
3878 * @brief Authorize/Unauthorize a bonded device
3881 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3882 * with/without user confirmation.
3884 * If we select a paired device and make it authorized by calling this API with the authorized
3885 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3886 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3887 * then it will ask for the user conformation before the connection.
3889 * This API supposed to be called on the paired devices. Which means we have to use this API only
3890 * after successful pairing.
3892 * This function is a asynchronous call.
3893 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3895 * @return BLUETOOTH_ERROR_NONE - Success \n
3896 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3897 * @param[in] device_address This indicates an address of the device to authorize \n
3898 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3900 * @see bluetooth_get_bonded_device_list
3902 void bt_event_callback(int event, bluetooth_event_param_t *param)
3906 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3908 if (param->result == BLUETOOTH_ERROR_NONE)
3912 //device authorization failed failure
3920 bluetooth_device_address_t device_address={{0}};
3921 gboolean authorized;
3925 ret = bluetooth_authorize_device(&device_address,authorized);
3928 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3929 gboolean authorized);
3931 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3932 const bluetooth_device_pin_code_t *pin_code);
3934 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3937 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3939 * @brief Receives Legacy Passkey\pin with following authentication response types
3941 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3942 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3945 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3948 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3950 * @brief This API sends user confirmation reply to the local adapter.
3952 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3955 int bluetooth_passkey_confirmation_reply(gboolean reply);
3958 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3959 * @brief Get all services supported by remote device
3962 * This API call initiates the search for the services supported by the specified device. Normally
3963 * the service search will take a couple of seconds to get it completed. Before calling this API
3964 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3965 * perform the service search. We can get the device address by doing a device discovery operation.
3968 * This function is a asynchronous call.
3969 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3971 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3972 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3973 * event is generated with appropriate result code.
3975 * @return BLUETOOTH_ERROR_NONE - Success \n
3976 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3977 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3978 * @param[in] device_address This indicates an address of the device
3979 * whose services need to be found
3981 * @see bluetooth_cancel_service_search
3983 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3986 * @fn int bluetooth_cancel_service_search(void)
3987 * @brief Cancel the ongoing service search operation
3990 * This function cancel the ongoing service search operation. This API is usually calling after the
3991 * bluetooth_search_service API.
3992 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3993 * if the user wish to cancel the Ongoing service search operation.
3995 * This API should be called just after the bluetooth_search_service API and before the
3996 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3998 * This function is a synchronous call.
4000 * @return BLUETOOTH_ERROR_NONE - Success \n
4001 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
4002 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
4003 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
4006 * @see bluetooth_search_service
4011 ret = bluetooth_cancel_service_search();
4014 int bluetooth_cancel_service_search(void);
4017 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
4018 * @brief Register rfcomm socket with a specific uuid
4021 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4022 * descriptor of the server.
4023 * This is the first API which is called to create the server. Once we created the server socket,
4024 * we will listen on that return socket.
4025 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
4028 * @return socket FD on Success \n
4029 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4030 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4031 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4032 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4033 * @param[in] UUID (128 bits)
4036 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
4040 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4041 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4045 int bluetooth_rfcomm_create_socket(const char *uuid);
4048 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
4049 * @brief Register rfcomm socket with a specific uuid
4052 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4053 * descriptor of the server.
4054 * This is the first API which is called to create the server. Once we created the server socket,
4055 * we will listen on that return socket.
4056 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
4059 * @return socket FD on Success \n
4060 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4061 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4062 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4063 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4064 * @param[in] UUID (128 bits)
4065 * @param[in] bus_name (const char)
4066 * @param[in] path (const char)
4069 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
4073 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4074 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
4078 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
4081 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
4082 * @brief De-register the rfcomm socket
4085 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
4086 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4087 * descriptor else no event will come. We will call this API only after the
4088 * bluetooth_rfcomm_listen_and_accept.
4089 * This is a synchronous call.
4091 * @return BLUETOOTH_ERROR_NONE - Success \n
4092 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4093 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4094 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4095 * @param[in] int socket_fd
4098 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
4101 void bt_event_callback(int event, bluetooth_event_param_t *param)
4105 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4107 bluetooth_rfcomm_connection_t *discon_ind =
4108 (bluetooth_rfcomm_connection_t *)param->param_data;
4110 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4118 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4119 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4121 ret = bluetooth_rfcomm_remove_socket(fd);
4124 int bluetooth_rfcomm_remove_socket(int socket_fd);
4127 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4128 * @brief De-register the rfcomm socket
4131 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4132 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4133 * descriptor else no event will come. We will call this API only after the
4134 * bluetooth_rfcomm_listen_and_accept_ex.
4135 * This is a synchronous call.
4137 * @return BLUETOOTH_ERROR_NONE - Success \n
4138 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4139 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4140 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4141 * @param[in] UUID (128 bits)
4144 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4147 void bt_event_callback(int event, bluetooth_event_param_t *param)
4151 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4153 bluetooth_rfcomm_connection_t *discon_ind =
4154 (bluetooth_rfcomm_connection_t *)param->param_data;
4156 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4164 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4165 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4167 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4170 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4173 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4174 * @brief Disconnect rfcomm connection
4177 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4178 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4181 * @return BLUETOOTH_ERROR_NONE - Success \n
4182 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4183 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4184 * @param[in] int socket_fd the sending socket fd
4190 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4192 printf("Disconnection failed");
4194 printf("Disconnection Success");
4198 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4201 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4202 * @brief Rfcomm socket listen
4205 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4206 * after the bluetooth_rfcomm_create_socket API.
4207 * This API listen for the incomming connection and once it receives a connection, it will give
4208 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4209 * event to the application. This is an Asynchronous API call.
4212 * @return BLUETOOTH_ERROR_NONE - Success \n
4213 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4214 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4216 * @param[in] int socket_fd
4217 * @param[in] max pending connection.
4220 * @see bluetooth_rfcomm_create_socket
4223 void bt_event_callback(int event, bluetooth_event_param_t* param)
4227 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4229 bluetooth_rfcomm_connection_t *conn_ind =
4230 (bluetooth_rfcomm_connection_t *)param->param_data;
4232 printf("\nConnected from FD %d", conn_ind->socket_fd);
4240 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4241 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4245 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4248 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4249 * @brief Rfcomm socket listen
4252 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4253 * after the bluetooth_rfcomm_create_socket API.
4254 * This API listen for the incomming connection and once it receives a connection, it will give
4255 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4256 * event to the application. This is an Asynchronous API call.
4259 * @return BLUETOOTH_ERROR_NONE - Success \n
4260 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4261 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4263 * @param[in] int socket_fd
4264 * @param[in] max pending connection.
4269 * @see bluetooth_rfcomm_create_socket_ex
4272 void bt_event_callback(int event, bluetooth_event_param_t* param)
4276 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4278 bluetooth_rfcomm_connection_t *conn_ind =
4279 (bluetooth_rfcomm_connection_t *)param->param_data;
4281 printf("\nConnected from FD %d", conn_ind->socket_fd);
4289 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4290 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4295 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4298 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4299 * @brief Rfcomm socket listen
4302 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4303 * after the bluetooth_rfcomm_create_socket API.
4304 * This API listen for the incomming connection and once it receives a connection, it will give
4305 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4306 * event to the application. This is an Asynchronous API call.
4309 * @return BLUETOOTH_ERROR_NONE - Success \n
4310 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4311 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4313 * @param[in] int socket_fd
4314 * @param[in] max pending connection.
4317 * @see bluetooth_rfcomm_create_socket
4320 void bt_event_callback(int event, bluetooth_event_param_t* param)
4324 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4326 char *name = (char *)param->param_data;
4328 printf("\nConnected from %s", name);
4330 bluetooth_rfcomm_accept_connection();
4338 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4339 ret = bluetooth_rfcomm_listen(fd, 1);
4343 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4346 * @fn int bluetooth_rfcomm_accept_connection()
4347 * @brief Accepts the authorization request indicated by the event
4348 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4350 * This function is a synchronous call.
4352 * @return BLUETOOTH_ERROR_NONE - Success \n
4353 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4355 * @param[in] the socket fd of the server
4356 * @param[out] the socket fd of the client
4360 * @see bluetooth_rfcomm_reject_connection
4362 int bluetooth_rfcomm_accept_connection(int server_fd);
4365 * @fn int bluetooth_rfcomm_reject_connection()
4366 * @brief Rejects the authorization request indicated by the event
4367 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4369 * This function is a synchronous call.
4371 * @return BLUETOOTH_ERROR_NONE - Success \n
4372 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4374 * @param[in] the socket fd of the server
4378 * @see bluetooth_rfcomm_accept_connection
4380 int bluetooth_rfcomm_reject_connection(int server_fd);
4383 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4384 * @brief Informs whether rfcomm server uuid is available or not.
4386 * This function is a synchronous call.
4388 * @return TRUE - RFCOMM uuid is available \n
4389 * FALSE - RFCOMM uuid is not available \n
4391 * @param[in] uuid UUID string
4397 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4400 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4401 * const char *remote_uuid)
4402 * @brief Connect to the remote device rfcomm *
4404 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4405 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4406 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4407 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4408 * initiating a connection.
4410 * @return BLUETOOTH_ERROR_NONE - Success \n
4411 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4412 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4413 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4414 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4415 * @param[in] bluetooth_device_address_t remote bt_address
4416 * @param[in] char remote uuid
4418 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4422 void bt_event_callback(int event, bluetooth_event_param_t *param)
4426 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4428 if (param->result >= BLUETOOTH_ERROR_NONE)
4430 bt_sdp_info_t *bt_sdp_info=param->param_data;
4432 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4433 bt_sdp_info->device_addr.addr[0],
4434 bt_sdp_info->device_addr.addr[1],
4435 bt_sdp_info->device_addr.addr[2],
4436 bt_sdp_info->device_addr.addr[3],
4437 bt_sdp_info->device_addr.addr[4],
4438 bt_sdp_info->device_addr.addr[5]);
4440 printf("Supported service list:\n");
4441 for(i=0; i<bt_sdp_info->service_index; i++)
4443 bt_sdp_info->service_list_array[i]);
4446 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4447 //rfcomm_test_uuid);
4451 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4453 bluetooth_rfcomm_connection_t *conn_ind =
4454 (bluetooth_rfcomm_connection_t *)param->param_data;
4456 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4457 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4458 "SERVER" : "CLIENT");
4463 bluetooth_device_address_t remote_address = {{0},};
4464 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4465 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4466 ret = bluetooth_search_service(&remote_address);
4468 printf("Seach failed, Reason = %d", ret);
4470 printf("Search Success, Ret = %d", ret);
4472 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4474 printf("Connection failed, Reason = %d", ret);
4476 printf("Connection Success, Ret = %d", ret);
4480 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4481 const char *remote_uuid);
4484 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4485 * @brief Disconnect rfcomm connection
4488 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4489 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4492 * @return BLUETOOTH_ERROR_NONE - Success \n
4493 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4494 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4495 * @param[in] char remote bt_address
4498 * @see bluetooth_rfcomm_connect
4502 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4504 printf("Disconnection failed");
4506 printf("Disconnection Success");
4511 int bluetooth_rfcomm_disconnect(int socket_fd);
4514 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4515 * @brief Write to rfcomm connection
4518 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4519 * API is used to send the data for server and the client.
4521 * @return BLUETOOTH_ERROR_NONE - Success \n
4522 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4523 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4525 * @param[in] const char *buff Data buffer to send
4526 * @param[in] int length Length of the data
4529 * @see bluetooth_rfcomm_connect
4532 char *buff = "Test data 123456789"
4533 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4535 printf("Send failed");
4537 printf("Send success");
4541 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4544 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4545 * @brief Informs whether rfcomm client is connected.
4547 * This function is a synchronous call.
4549 * @return TRUE - RFCOMM client is connected \n
4550 * FALSE - RFCOMM client is not connected \n
4556 gboolean bluetooth_rfcomm_is_client_connected(void);
4557 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4558 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4561 * @fn int bluetooth_network_activate_server(void)
4562 * @brief Activate the NAP (Network Access Point) service
4564 * This function is a asynchronous call.
4565 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4567 * @return BLUETOOTH_ERROR_NONE - Success \n
4568 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4569 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4570 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4573 * @see bluetooth_network_deactivate_server
4576 int bluetooth_network_activate_server(void);
4579 * @fn int bluetooth_network_deactivate_server(void)
4580 * @brief Deactivate the NAP (Network Access Point) service
4582 * This function is a asynchronous call.
4583 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4585 * @return BLUETOOTH_ERROR_NONE - Success \n
4586 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4587 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4588 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4591 * @see bluetooth_network_activate_server
4594 int bluetooth_network_deactivate_server(void);
4597 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4598 * bluetooth_network_role_t role,
4600 * @brief Connect the network server in the peer
4602 * This function is a asynchronous call.
4603 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4605 * @return BLUETOOTH_ERROR_NONE - Success \n
4606 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4607 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4608 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4611 * @param[in] device_address This indicates an address of the device with which the pairing
4612 * should be initiated
4613 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4614 * need to use the third parameter.
4615 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4616 * connect. UUID string
4618 * @see bluetooth_network_disconnect
4620 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4621 bluetooth_network_role_t role, char *custom_uuid);
4624 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4625 * bluetooth_network_role_t role,
4626 * char *custom_uuid)
4627 * @brief Connect the network server in the peer
4629 * This function is a asynchronous call.
4630 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4632 * @return BLUETOOTH_ERROR_NONE - Success \n
4633 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4634 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4635 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4638 * @param[in] device_address This indicates an address of the device with which the pairing
4639 * should be initiated
4641 * @see bluetooth_network_connect
4643 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4646 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4647 * @brief Disconnect the device from the network
4649 * This function is an asynchronous call.
4650 * The network server disconnect request is responded by
4651 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4653 * @return BLUETOOTH_ERROR_NONE - Success \n
4654 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4655 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4656 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4659 * @param[in] device_address This indicates an address of the connected client device
4661 * @see bluetooth_network_activate_server
4663 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4668 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4669 * bt_hdp_role_type_t role,
4670 * bt_hdp_qos_type_t channel_type,
4671 * char **app_handle)
4672 * @brief Activate the HDP service for a particular data type
4674 * This function is a synchronous call.
4676 * @return BLUETOOTH_ERROR_NONE - Success \n
4677 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4678 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4679 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4682 * @param[in] data_type The data type against corresponding service
4683 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4684 * @param[in] channel_type The QOS type for the channel.
4685 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4686 * For role = HDP_ROLE_SINK, the channel_type
4687 * should be HDP_QOS_ANY.
4688 * @param[out] app_handle The application handler against corresponding service
4690 * @see bluetooth_hdp_deactivate
4692 int bluetooth_hdp_activate(unsigned short data_type,
4693 bt_hdp_role_type_t role,
4694 bt_hdp_qos_type_t channel_type,
4697 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4698 * @brief Deactivate the HDP service for a particular service using the handler
4700 * This function is a synchronous call.
4702 * @return BLUETOOTH_ERROR_NONE - Success \n
4703 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4704 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4705 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4708 * @param[in] app_handle The application handler against corresponding service
4710 * @see bluetooth_hdp_deactivate
4712 int bluetooth_hdp_deactivate(const char *app_handle);
4715 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4716 * const char *buffer, unsigned int size)
4717 * @brief Send data to the remote HDP device
4719 * This function is a synchronous call.
4721 * @return BLUETOOTH_ERROR_NONE - Success \n
4722 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4723 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4724 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4725 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4728 * @param[in] channel_id The channel id for the connection.
4729 * @param[in] buffer The pdu buffer.
4730 * @param[in] size Size of the buffer.
4732 * @see bluetooth_hdp_connect
4734 int bluetooth_hdp_send_data(unsigned int channel_id,
4735 const char *buffer, unsigned int size);
4737 * @fn int bluetooth_hdp_connect(const char *app_handle,
4738 * bt_hdp_qos_type_t channel_type,
4739 * const bluetooth_device_address_t *device_address)
4740 * @brief Connect to the remote device(Mainly used by source)
4742 * This function is a asynchronous call.
4743 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4745 * @return BLUETOOTH_ERROR_NONE - Success \n
4746 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4747 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4748 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4749 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4752 * @param[in] app_handle The application handler against corresponding service
4753 * @param[in] channel_type The QOS type for the channel.
4754 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4755 * @param[in] device_address The remote device Bd address.
4758 * @see bluetooth_hdp_disconnect
4760 int bluetooth_hdp_connect(const char *app_handle,
4761 bt_hdp_qos_type_t channel_type,
4762 const bluetooth_device_address_t *device_address);
4764 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4765 * const bluetooth_device_address_t *device_address)
4766 * @brief Disconnect from the remote device(Mainly used by source)
4768 * This function is a asynchronous call.
4769 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4771 * @return BLUETOOTH_ERROR_NONE - Success \n
4772 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4773 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4774 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4775 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4778 * @param[in] channel_id The channel id for the connection.
4779 * @param[in] device_address The remote device Bd address.
4782 * @see bluetooth_hdp_connect
4784 int bluetooth_hdp_disconnect(unsigned int channel_id,
4785 const bluetooth_device_address_t *device_address);
4789 * @fn int bluetooth_opc_init(void)
4790 * @brief Initialize OPP client.
4792 * This function is a synchronous call.
4793 * No event corresponding to this api
4795 * @return BLUETOOTH_ERROR_NONE - Success \n
4796 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4797 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4798 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4799 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4804 * @see bluetooth_opc_deinit
4806 int bluetooth_opc_init(void);
4809 * @fn int bluetooth_opc_deinit(void)
4810 * @brief Deinitialize OPP client.
4812 * This function is a synchronous call.
4813 * No event corresponding to this api
4815 * @return BLUETOOTH_ERROR_NONE - Success \n
4816 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4817 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4822 * @see bluetooth_opc_init
4825 int bluetooth_opc_deinit(void);
4828 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4829 char **file_name_array)
4830 * @brief Send multiple files to a remote device.
4832 * This function is a asynchronous call.
4833 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4835 * @return BLUETOOTH_ERROR_NONE - Success \n
4836 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4837 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4838 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4839 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4840 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4841 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4844 * @param[in] device_address The remote device Bd address.
4845 * @param[in] file_name_array Array of filepaths to be sent.
4848 * @see bluetooth_opc_cancel_push
4851 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4852 char **file_name_array);
4855 * @fn int bluetooth_opc_cancel_push(void)
4856 * @brief Cancels the ongoing file push.
4858 * This function is a asynchronous call.
4859 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4860 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4862 * @return BLUETOOTH_ERROR_NONE - Success \n
4863 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4864 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4869 * @see bluetooth_opc_push_files
4872 int bluetooth_opc_cancel_push(void);
4875 * @fn gboolean bluetooth_opc_session_is_exist(void)
4876 * @brief Informs whether opc session exists or not.
4878 * This function is a synchronous call.
4880 * @return TRUE - OPC session exists \n
4881 * FALSE - OPC session does not exist \n
4889 gboolean bluetooth_opc_session_is_exist(void);
4892 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4893 * @brief Informs whether opc session exists or not.
4895 * This function is a synchronous call.
4897 * @return BLUETOOTH_ERROR_NONE - Success \n
4898 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4899 * BLUETOOTH_ERROR_INTERNAL \n
4902 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4907 int bluetooth_opc_is_sending(gboolean *is_sending);
4910 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4911 int transfer_id, unsigned char *progress)
4912 * @brief Gets the percentage progress for ongoing transfers.
4914 * This function is a synchronous call.
4916 * @return BLUETOOTH_ERROR_NONE - Success \n
4917 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4918 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4921 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4922 * @param[in] transfer_id Transfer ID
4923 * @param[out] progress Percentage Progress
4927 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4928 int transfer_id, unsigned char *progress);
4931 * @fn int bluetooth_obex_server_init(const char *dst_path)
4932 * @brief Initialize OPP and FTP server.
4934 * This function is a synchronous call.
4935 * No event corresponding to this api
4937 * @return BLUETOOTH_ERROR_NONE - Success \n
4938 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4939 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4940 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4941 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4944 * @param[in] dst_path OPS destination file path.
4946 * @see bluetooth_obex_server_deinit
4948 int bluetooth_obex_server_init(const char *dst_path);
4952 * @fn int bluetooth_obex_server_deinit(void)
4953 * @brief Deinitialize OPP and FTP server.
4955 * This function is a synchronous call.
4956 * No event corresponding to this api
4958 * @return BLUETOOTH_ERROR_NONE - Success \n
4959 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4960 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4965 * @see bluetooth_obex_server_init
4967 int bluetooth_obex_server_deinit(void);
4971 * @fn gboolean bluetooth_obex_server_is_activated(void)
4972 * @brief Informs whether obex server is activated or not.
4974 * This function is a synchronous call.
4976 * @return TRUE - OBEX server is activated \n
4977 * FALSE - OBEX server is not activated \n
4984 gboolean bluetooth_obex_server_is_activated(void);
4988 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4989 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4991 * This function is a synchronous call.
4992 * No event corresponding to this api
4994 * @return BLUETOOTH_ERROR_NONE - Success \n
4995 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4996 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4997 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4998 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5002 * @param[in] dst_path OPS destination file path.
5004 * @see bluetooth_obex_server_deinit_without_agent
5006 int bluetooth_obex_server_init_without_agent(const char *dst_path);
5010 * @fn int bluetooth_obex_server_deinit_without_agent(void)
5011 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
5013 * This function is a synchronous call.
5014 * No event corresponding to this api
5016 * @return BLUETOOTH_ERROR_NONE - Success \n
5017 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5018 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5023 * @see bluetooth_obex_server_init_without_agent
5025 int bluetooth_obex_server_deinit_without_agent(void);
5029 * @fn int bluetooth_obex_server_accept_connection(void)
5030 * @brief Accepts the authorization request indicated by the event
5031 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5033 * This function is a synchronous call.
5035 * @return BLUETOOTH_ERROR_NONE - Success \n
5036 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5037 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5041 * @see bluetooth_obex_server_reject_authorize
5043 int bluetooth_obex_server_accept_connection(void);
5047 * @fn int bluetooth_obex_server_reject_connection(void)
5048 * @brief Rejects the authorization request indicated by the event
5049 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5051 * This function is a synchronous call.
5053 * @return BLUETOOTH_ERROR_NONE - Success \n
5054 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5055 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5059 * @see bluetooth_obex_server_reject_authorize
5061 int bluetooth_obex_server_reject_connection(void);
5065 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
5066 * @brief Accepts the authorization request indicated by the event
5067 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5069 * This function is a asynchronous call.
5070 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
5072 * @return BLUETOOTH_ERROR_NONE - Success \n
5073 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5074 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5075 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5078 * @param[in] filename Authorized filename.
5081 * @see bluetooth_obex_server_reject_authorize
5084 int bluetooth_obex_server_accept_authorize(const char *filename);
5087 * @fn int bluetooth_obex_server_reject_authorize(void)
5088 * @brief Reject the authorization request indicated by the event
5089 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5091 * This function is a asynchronous call.
5092 * No event for this api..
5094 * @return BLUETOOTH_ERROR_NONE - Success \n
5095 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5096 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5101 * @see bluetooth_obex_server_accept_authorize
5104 int bluetooth_obex_server_reject_authorize(void);
5107 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5108 * @brief Set the OPS destination file path..
5110 * This function is a asynchronous call.
5111 * No event for this api..
5113 * @return BLUETOOTH_ERROR_NONE - Success \n
5114 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5115 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5116 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5119 * @param[in] dst_path OPS destination file path.
5125 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5128 * @fn int bluetooth_obex_server_set_root(const char *root)
5129 * @brief Set the FTS root folder..
5131 * This function is a asynchronous call.
5132 * No event for this api..
5134 * @return BLUETOOTH_ERROR_NONE - Success \n
5135 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5136 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5137 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5138 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5139 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5142 * @param[in] root FTS root folder.
5148 int bluetooth_obex_server_set_root(const char *root);
5151 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5152 * @brief Cancel the transfer on server
5154 * This function is an asynchronous call.
5155 * If the function call that cancels transfer is successful, the application would receive
5156 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5157 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5158 * the error code will be BLUETOOTH_ERROR_NONE
5160 * @return BLUETOOTH_ERROR_NONE - Success \n
5161 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5162 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5163 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5164 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5167 * @param[in] transfer_id transfer ID
5172 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5176 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5177 * @brief Cancel the transfer on server
5179 * This function is an asynchronous call.
5180 * If the function call that cancels transfer is successful, the application would receive
5181 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5182 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5183 * the error code will be BLUETOOTH_ERROR_NONE
5185 * @return BLUETOOTH_ERROR_NONE - Success \n
5186 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5187 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5188 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5189 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5196 int bluetooth_obex_server_cancel_all_transfers(void);
5200 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5201 * @brief Informs whether obex server is receiving or not.
5203 * This function is a synchronous call.
5205 * @return BLUETOOTH_ERROR_NONE - Success \n
5206 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5207 * BLUETOOTH_ERROR_INTERNAL \n
5210 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5215 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5219 * @fn int bluetooth_map_client_init(void)
5220 * @brief Initialize MAP client.
5222 * This function is a synchronous call.
5223 * No event corresponding to this api
5225 * @return BLUETOOTH_ERROR_NONE - Success \n
5226 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5227 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5228 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5229 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5234 * @see bluetooth_map_client_deinit
5236 int bluetooth_map_client_init(void);
5238 int bluetooth_map_client_deinit(void);
5240 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5242 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5244 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5246 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5247 bt_map_client_list_folders_filter_t *filter);
5250 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5251 * @brief Return all available fields that can be used in Fields filter.
5253 * This function is a asynchronous call.
5255 * @return BLUETOOTH_ERROR_NONE - Success \n
5256 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5257 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5260 * @param[in] session Information about session.
5263 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5265 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5267 bt_map_client_list_messages_filter_t *filter);
5269 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5271 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5272 const char *source_file,
5274 bt_map_client_push_message_args_t *args);
5276 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5277 const bt_map_client_message_object_t message_object,
5278 const char *target_file,
5283 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5284 * @brief Read the local Hash and Randmizer.
5286 * This function is a synchronous call.
5288 * @return BLUETOOTH_ERROR_NONE - Success \n
5289 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5293 * @param[out] local_oob_data - Pointer to the local OOB data
5299 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5303 * @fn int bluetooth_oob_add_remote_data(
5304 * const bluetooth_device_address_t *remote_device_address,
5305 * bluetooth_bdaddr_type_e address_type,
5306 * bt_oob_data_t *oob_data)
5307 * @brief Add/updated the remote device Hash and Randmizer.
5309 * This function is a synchronous call.
5310 * No event for this api..
5312 * @return BLUETOOTH_ERROR_NONE - Success \n
5313 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5316 * @param[in] remote_device_address - Remote device address
5317 * address_type - bdaddr type
5318 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5324 int bluetooth_oob_add_remote_data(
5325 const bluetooth_device_address_t *remote_device_address,
5326 bluetooth_bdaddr_type_e address_type,
5327 bt_oob_data_t *remote_oob_data);
5331 * @fn int bluetooth_oob_remove_remote_data(
5332 * const bluetooth_device_address_t *remote_device_address)
5333 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5335 * This function is a synchronous call.
5336 * No event for this api..
5338 * @return BLUETOOTH_ERROR_NONE - Success \n
5339 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5342 * @param[in] remote_device_address - Remote device address
5348 int bluetooth_oob_remove_remote_data(
5349 const bluetooth_device_address_t *remote_device_address);
5353 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5354 * @brief Read the local Hash and Randmizer.
5356 * This function is a synchronous call.
5358 * @return BLUETOOTH_ERROR_NONE - Success \n
5359 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5363 * @param[out] local_oob_data - Pointer to the local OOB data
5368 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5371 * @fn int bluetooth_le_oob_add_remote_data(
5372 * const bluetooth_device_address_t *remote_device_address,
5373 * bluetooth_bdaddr_type_e address_type,
5374 * bt_oob_data_t *oob_data)
5375 * @brief Add/updated the remote device Hash and Randmizer.
5377 * This function is a synchronous call.
5378 * No event for this api..
5380 * @return BLUETOOTH_ERROR_NONE - Success \n
5381 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5384 * @param[in] remote_device_address - Remote device address
5385 * address_type - bdaddr type
5386 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5391 int bluetooth_le_oob_add_remote_data(
5392 const bluetooth_device_address_t *remote_device_address,
5393 bluetooth_bdaddr_type_e address_type,
5394 bt_oob_data_t *remote_oob_data);
5397 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5398 * bt_gatt_handle_info_t *prim_svc);
5400 * @brief Gets the GATT based primary services handle supported by remote device
5402 * This function is a synchronous call.
5403 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5405 * @return BLUETOOTH_ERROR_NONE - Success \n
5406 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5407 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5408 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5411 * @param[in] address - Remote device address
5412 * @param[out] prim_svc - Structure containing remote service count and handle list.
5415 * @see bluetooth_gatt_free_primary_services()
5417 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5418 bt_gatt_handle_info_t *prim_svc);
5421 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5423 * @brief Discovers the characteristics of GATT based service of remote device
5425 * This function is an asynchronous call.
5426 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5428 * @return BLUETOOTH_ERROR_NONE - Success \n
5429 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5430 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5431 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5434 * @param[in] service_handle - Handle for remote service.
5439 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5441 int bluetooth_gatt_set_service_change_watcher(
5442 const bluetooth_device_address_t *address, gboolean enable);
5445 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5446 * bt_gatt_service_property_t *service);
5448 * @brief Gets the properties of GATT based service of remote device
5450 * This function is a synchronous call.
5451 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5453 * @return BLUETOOTH_ERROR_NONE - Success \n
5454 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5455 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5456 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5459 * @param[in] service_handle - Handle for remote service.
5460 * @param[out] service - Structure containing remote service property.
5463 * @see bluetooth_gatt_free_service_property()
5465 int bluetooth_gatt_get_service_property(const char *service_handle,
5466 bt_gatt_service_property_t *service);
5469 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5471 * @brief Register to GATT based service to receive value change notification/indication.
5473 * This function is a synchronous call.
5474 * No event for this api.
5476 * @return BLUETOOTH_ERROR_NONE - Success \n
5477 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5478 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5479 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5482 * @param[in] service_handle - Handle for remote service.
5483 * @param[in] service_name - Friednly name of service uuid.
5488 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5491 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5493 * @brief Unregister GATT based service to receive value change notification/indication.
5495 * This function is a synchronous call.
5496 * No event for this api.
5498 * @return BLUETOOTH_ERROR_NONE - Success \n
5499 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5500 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5501 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5504 * @param[in] service_handle - Handle for remote service.
5509 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5512 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5513 * bt_gatt_char_property_t *characteristic);
5515 * @brief Provides characteristic value along with properties.
5517 * This function is a synchronous call.
5518 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5520 * @return BLUETOOTH_ERROR_NONE - Success \n
5521 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5522 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5523 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5526 * @param[in] char_handle - Handle for Characteristic property.
5527 * @param[out] characteristic - Structure containing remote characteristic property.
5530 * @see bluetooth_gatt_free_char_property()
5532 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5533 bt_gatt_char_property_t *characteristic);
5536 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5537 * bt_gatt_char_property_t *characteristic);
5539 * @brief Provides characteristic descriptor value along with its UUID.
5541 * This function is a synchronous call.
5542 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5544 * @return BLUETOOTH_ERROR_NONE - Success \n
5545 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5546 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5547 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5550 * @param[in] desc_handle - Handle for Characteristic descriptor.
5551 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5554 * @see bluetooth_gatt_free_desc_property()
5556 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5557 bt_gatt_char_descriptor_property_t *descriptor);
5561 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5562 * const guint8 *value, int length)
5564 * @brief Set characteristic value.
5566 * This function is a synchronous call.
5568 * @return BLUETOOTH_ERROR_NONE - Success \n
5569 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5570 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5571 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5574 * @param[in] char_handle - Handle for Characteristic property.
5575 * @param[in] value - New value to set for characteristic property.
5576 * @param[in] length - Length of the value to be set.
5581 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5582 const guint8 *value, int length);
5585 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5586 * const guint8 *value, int length, guint8 write_type)
5588 * @brief Set characteristic value by write type.
5590 * This function is a synchronous call if write type is "write without resonse"
5591 * and it is an asynchronous call if write type is "write with response"
5593 * @return BLUETOOTH_ERROR_NONE - Success \n
5594 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5595 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5596 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5599 * @param[in] char_handle - Handle for Characteristic property.
5600 * @param[in] value - New value to set for characteristic property.
5601 * @param[in] length - Length of the value to be set.
5602 * @param[in] write_type - Type of write.
5607 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5608 const guint8 *value, int length,
5609 guint8 write_type, gpointer app_data);
5613 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5614 * const guint8 *value, int length)
5616 * @brief Set characteristic value request.
5618 * This function is an asynchronous call.
5620 * @return BLUETOOTH_ERROR_NONE - Success \n
5621 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5622 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5623 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5626 * @param[in] char_handle - Handle for Characteristic property.
5627 * @param[in] value - New value to set for characteristic property.
5628 * @param[in] length - Length of the value to be set.
5633 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5634 const guint8 *value, int length);
5637 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5639 * @brief Read characteristic value.
5641 * This function is a asynchronous call.
5643 * @return BLUETOOTH_ERROR_NONE - Success \n
5644 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5645 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5646 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5649 * @param[in] char_handle - Handle for Characteristic property.
5654 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5657 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5658 * const char *service_uuid,
5659 * bt_gatt_service_property_t *service)
5661 * @brief Gets the service property from a device based on a particular uuid
5663 * This function is a synchronous call.
5665 * @return BLUETOOTH_ERROR_NONE - Success \n
5666 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5667 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5668 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5671 * @param[in] address - BD address of the remote device
5672 * @param[in] service_uuid - uuid of the service.
5673 * @param[out] service - Structure containing the service property.
5678 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5679 const char *service_uuid,
5680 bt_gatt_service_property_t *service);
5683 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5684 * const char *char_uuid)
5686 * @brief Gets the characteristic property from a service based on a particular char uuid
5688 * This function is an asynchronous call.
5689 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5691 * @return BLUETOOTH_ERROR_NONE - Success \n
5692 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5693 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5694 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5697 * @param[in] service_handle - Service handle.
5698 * @param[in] uuid - Characteristic uuid.
5703 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5704 const char *char_uuid);
5707 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5709 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5711 * This function is a synchronous call.
5712 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5714 * @return BLUETOOTH_ERROR_NONE - Success \n
5715 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5718 * @param[in] prim_svc - GATT handle info structure
5721 * @see bluetooth_gatt_get_primary_services()
5723 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5726 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5728 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5730 * This function is a synchronous call.
5731 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5733 * @return BLUETOOTH_ERROR_NONE - Success \n
5734 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5737 * @param[in] svc_pty - GATT service property structure.
5740 * @see bluetooth_gatt_get_service_property()
5742 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5745 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5747 * @brief Provides characteristic value along with properties.
5749 * This function is a synchronous call.
5750 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5752 * @return BLUETOOTH_ERROR_NONE - Success \n
5753 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5756 * @param[in] char_pty - GATT characteristics property structure.
5759 * @see bluetooth_gatt_get_characteristics_property()
5761 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5764 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5766 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5768 * This function is a synchronous call.
5769 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5771 * @return BLUETOOTH_ERROR_NONE - Success \n
5772 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5775 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5778 * @see bluetooth_gatt_get_char_descriptor_property()
5780 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5782 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5783 gboolean auto_connect, int client_id);
5785 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5788 int bluetooth_get_gatt_data_batching_available_packets(
5789 int *available_packets);
5791 int bluetooth_enable_gatt_data_batching(
5792 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5794 int bluetooth_disable_gatt_data_batching(
5795 const bluetooth_device_address_t *device_address);
5798 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5800 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5802 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5804 * @return BLUETOOTH_ERROR_NONE - Success \n
5805 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5808 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5812 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5815 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5817 * @brief Read characteristic descriptor value.
5819 * This function is a asynchronous call.
5821 * @return BLUETOOTH_ERROR_NONE - Success \n
5822 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5823 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5824 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5827 * @param[in] desc_handle - Handle for Characteristic descriptor
5832 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5835 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5836 * const guint8 *value, int length);
5838 * @brief Set characteristic descriptor value.
5840 * This function is a asynchronous call.
5842 * @return BLUETOOTH_ERROR_NONE - Success \n
5843 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5844 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5845 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5848 * @param[in] desc_handle - Handle for Characteristic descriptor
5849 * @param[in] value - New value to set for characteristic descriptor
5850 * @param[in] length - Length of the value to be set.
5855 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5856 const guint8 *value, int length, gpointer app_data);
5858 /* @fn int bluetooth_gatt_init(void)
5860 * @brief Initializes the gatt service.
5862 * This function is a synchronous call.
5863 * @return BLUETOOTH_ERROR_NONE - Success \n
5864 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5865 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5866 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5869 * @remark Adapter should be enabled
5870 * @see bluetooth_gatt_deinit()
5872 int bluetooth_gatt_init(void);
5874 /* @fn int bluetooth_gatt_init(void)
5876 * @brief DeInitializes the gatt service.
5878 * This function is a synchronous call.
5879 * @return BLUETOOTH_ERROR_NONE - Success \n
5880 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5881 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5882 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5885 * @remark Adapter should be enabled
5886 * @see bluetooth_gatt_init()
5888 int bluetooth_gatt_deinit(void);
5890 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5891 unsigned char **svc_path)
5893 * @brief Exports a new gatt service to the service interface.
5895 * This function is a synchronous call.
5897 * @return BLUETOOTH_ERROR_NONE - Success \n
5898 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5899 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5900 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5903 * @param[in] svc_uuid Gatt service uuid.
5904 * @param[out] svc_path service object path of the exported service.
5905 * @remark Adapter should be enabled
5906 * @see bluetooth_gatt_init()
5908 int bluetooth_gatt_add_service(const char *svc_uuid,
5911 /* @fn int bluetooth_gatt_add_new_characteristic(
5912 const char *svc_path, const char *char_uuid,
5913 bt_gatt_permission_t permissions,
5914 bt_gatt_characteristic_property_t properties,
5915 int flags_length, char **char_path);;
5917 * @brief Exports a new gatt characteristic to the characteristic interface.
5919 * This function is a synchronous call.
5920 * @return BLUETOOTH_ERROR_NONE - Success \n
5921 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5922 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5923 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5925 * @param[in] svc_path service object path of the exported service.
5926 * @param[in] char_uuid Gatt service uuid.
5927 * @param[in] properties GATT characteristic properties.
5928 * @param[out] char_path characteristic object path of the exported characteristic.
5930 * @remark Adapter should be enabled
5931 * @see bluetooth_gatt_add_service()
5933 int bluetooth_gatt_add_new_characteristic(
5934 const char *svc_path, const char *char_uuid,
5935 bt_gatt_permission_t permissions,
5936 bt_gatt_characteristic_property_t properties,
5939 /* @fn bluetooth_gatt_set_characteristic_value(
5940 const char *characteristic, const char *char_value,
5943 * @brief adds gatt charactertisic value to the given charactertistic path.
5945 * This function is a synchronous call.
5946 * @return BLUETOOTH_ERROR_NONE - Success \n
5947 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5948 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5949 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5951 * @param[in] char_value Value of the GATT characteristic to be added.
5952 * @param[in] value_length length of the chantacteristic value..
5953 * @param[out] characteristic characteristic object path..
5955 * @remark Adapter should be enabled
5956 * @see bluetooth_gatt_add_service()
5958 int bluetooth_gatt_set_characteristic_value(
5959 const char *characteristic, const char *char_value,
5962 /* @fn int bluetooth_gatt_add_descriptor(
5963 const char *char_path, const char *desc_uuid,
5964 bt_gatt_permission_t permissions,
5967 * @brief Exports a new gatt descriptor to the descriptor interface.
5969 * This function is a synchronous call.
5971 * @return BLUETOOTH_ERROR_NONE - Success \n
5972 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5973 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5974 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5977 * @param[in] desc_uuid Gatt descriptor uuid.
5978 * @param[in] desc_value GATT descriptor value.
5979 * @param[in] value_length Length of GATT descriptor value.
5980 * @param[in] permissions descriptor permissions.
5981 * @param[in] properties GATT descriptor properties.
5982 * @param[in] char_path characteristics object path of the exported character.
5984 * @remark Adapter should be enabled
5985 * @see bluetooth_gatt_add_service()
5986 * @see bluetooth_gatt_add_characteristics()
5988 int bluetooth_gatt_add_descriptor(
5989 const char *char_path, const char *desc_uuid,
5990 bt_gatt_permission_t permissions,
5993 /* @fn int bluetooth_gatt_set_descriptor_value(
5994 const char *desc_path, const char *desc_value,
5997 * @brief Adds value to the given descriptor handle.
5999 * This function is a synchronous call.
6001 * @return BLUETOOTH_ERROR_NONE - Success \n
6002 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6003 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6004 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6007 * @param[in] desc_value GATT descriptor value.
6008 * @param[in] value_length Length of GATT descriptor value.
6009 * @param[in] desc_path descriptor path to which the value needs to be added.
6011 * @remark Adapter should be enabled
6012 * @see bluetooth_gatt_add_service()
6013 * @see bluetooth_gatt_add_characteristics()
6015 int bluetooth_gatt_set_descriptor_value(
6016 const char *desc_path, const char *desc_value,
6019 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
6021 * @brief Reads the Service registered on manager interface.
6023 * This function is a synchronous call.
6025 * @return BLUETOOTH_ERROR_NONE - Success \n
6026 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6027 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6028 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6031 * @param[in] svc_uuid Gatt Service uuid.
6033 * @remark Adapter should be enabled and service should be registered.
6034 * @see bluetooth_gatt_register_service()
6036 int bluetooth_gatt_get_service(const char *svc_uuid);
6038 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
6040 * @brief Registers the given service path with the library.
6042 * This function is a synchronous call.
6044 * @return BLUETOOTH_ERROR_NONE - Success \n
6045 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6046 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6047 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6050 * @param[in] svc_path service object path of the exported service.
6052 * @remark Adapter should be enabled
6053 * @see bluetooth_gatt_add_service()
6054 * @see bluetooth_gatt_add_characteristics()
6055 * @see bluetooth_gatt_add_descriptor()
6056 * @see bluetooth_gatt_register_application()
6058 int bluetooth_gatt_register_service(const char *svc_path);
6060 /* @fn int bluetooth_gatt_register_application(void)
6062 * @brief Registers the application with the bluez gatt server.
6064 * This function is a synchronous call.
6066 * @return BLUETOOTH_ERROR_NONE - Success \n
6067 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6068 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6069 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6073 * @remark Adapter should be enabled
6074 * @see bluetooth_gatt_init()
6075 * @see bluetooth_gatt_add_service()
6076 * @see bluetooth_gatt_add_characteristics()
6077 * @see bluetooth_gatt_add_descriptor()
6078 * @see bluetooth_gatt_register_service()
6080 int bluetooth_gatt_register_application(void);
6082 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
6084 * @brief Removes(unregister) service from the bluez gatt server db.
6086 * This function is a synchronous call.
6088 * @return BLUETOOTH_ERROR_NONE - Success \n
6089 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6090 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6091 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6094 * @param[in] svc_path service object path of the exported service.
6096 * @remark Adapter should be enabled
6097 * @see bluetooth_gatt_add_service()
6098 * @see bluetooth_gatt_add_characteristics()
6099 * @see bluetooth_gatt_add_descriptor()
6100 * @see bluetooth_gatt_register_service()
6102 int bluetooth_gatt_unregister_service(const char *svc_path);
6104 /* @fn int bluetooth_gatt_unregister_application(void)
6106 * @brief Removes(unregister) the application with the bluez gatt server,
6107 * and deletes all the service registered.
6109 * This function is a synchronous call.
6111 * @return BLUETOOTH_ERROR_NONE - Success \n
6112 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6113 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6114 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6118 * @remark Adapter should be enabled
6119 * @see bluetooth_gatt_init()
6120 * @see bluetooth_gatt_add_service()
6121 * @see bluetooth_gatt_add_characteristics()
6122 * @see bluetooth_gatt_add_descriptor()
6123 * @see bluetooth_gatt_register_service()
6124 * @see bluetooth_gatt_unregister_service()
6126 int bluetooth_gatt_unregister_application(void);
6128 /* @fn int bluetooth_gatt_send_response(int request_id,
6129 * int offset, char *value, int value_length)
6131 * @brief Updates the attribute value in local attribute list.
6133 * This function is a synchronous call.
6135 * @return BLUETOOTH_ERROR_NONE - Success \n
6136 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6137 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6138 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6141 * @param[in] request_id The identification of a read request
6142 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6143 * @param[in] resp_state The identification of response state
6144 * @param[in] offset The offset from where a value is read
6145 * @param[in] value The value to be sent. It will be sent from @a offset.
6146 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6147 * @param[in] value_length Value Length.
6149 * @remark Adapter should be enabled
6150 * @see bluetooth_gatt_add_service()
6151 * @see bluetooth_gatt_add_characteristics()
6152 * @see bluetooth_gatt_add_descriptor()
6153 * @see bluetooth_gatt_register_service()
6155 int bluetooth_gatt_send_response(int request_id, guint req_type,
6156 int resp_state, int offset, char *value, int value_length);
6158 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6160 * @brief Sets the notification property for a characteristic.
6162 * This function is a synchronous call.
6164 * @return BLUETOOTH_ERROR_NONE - Success \n
6165 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6166 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6167 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6170 * @param[in] char_path characteristic object path.
6171 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6173 * @remark Adapter should be enabled
6174 * @see bluetooth_gatt_update_characteristic()
6176 int bluetooth_gatt_server_set_notification(const char *char_path,
6177 bluetooth_device_address_t *unicast_address);
6179 /* @fn int bluetooth_gatt_delete_services(void)
6181 * @brief deletes (unregisters) all services from the gatt server database..
6183 * This function is a synchronous call.
6185 * @return BLUETOOTH_ERROR_NONE - Success \n
6186 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6187 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6188 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6192 * @remark Adapter should be enabled
6193 * @see bluetooth_gatt_add_service()
6194 * @see bluetooth_gatt_add_characteristics()
6195 * @see bluetooth_gatt_add_descriptor()
6196 * @see bluetooth_gatt_register_service()
6197 * @see bluetooth_gatt_unregister_service()
6199 int bluetooth_gatt_delete_services(void);
6201 /* @fn int bluetooth_gatt_update_characteristic(void)
6203 * @brief updates the given characteristic with a new value
6205 * This function is a synchronous call.
6207 * @return BLUETOOTH_ERROR_NONE - Success \n
6208 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6209 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6210 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6214 * @remark Adapter should be enabled
6215 * @see bluetooth_gatt_add_service()
6216 * @see bluetooth_gatt_add_characteristics()
6217 * @see bluetooth_gatt_add_descriptor()
6218 * @see bluetooth_gatt_register_service()
6219 * @see bluetooth_gatt_unregister_service()
6221 int bluetooth_gatt_update_characteristic(const char *char_path,
6222 const char* char_value, int value_length);
6225 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6227 * @brief Set advertising status.
6229 * This function is used to enable or disable LE advertising.
6230 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6232 * This function is a synchronous call.
6234 * @return BLUETOOTH_ERROR_NONE - Success \n
6235 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6236 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6239 * @param[in] enable - The status of advertising
6242 * @see bluetooth_set_advertising_data
6244 int bluetooth_set_advertising(int handle, gboolean enable);
6247 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6249 * @brief Set advertising status along with interval value.
6251 * This function is used to enable or disable LE advertising.
6252 * Interval_min and Interval_max is used to set the best advertising interval.
6253 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6255 * This function is a synchronous call.
6257 * @return BLUETOOTH_ERROR_NONE - Success \n
6258 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6259 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6262 * @param[in] enable - The status of advertising
6263 * @param[in] interval_min - Minimum interval of advertising (msec)
6264 * @param[in] interval_max - Maximum interval of advertising (msec)
6265 * @param[in] filter_policy - Advertising filter policy
6268 * @see bluetooth_set_advertising_data
6270 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6271 bluetooth_advertising_params_t *params);
6274 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6275 * @brief Get the advertising data
6277 * This function is used to get advertising data.
6278 * Before calling this API, the adapter should be enabled.
6280 * This function is a synchronous call.
6282 * @return BLUETOOTH_ERROR_NONE - Success \n
6283 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6284 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6285 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6287 * @param[out] value - Advertising data structure.
6288 * @param[out] length - The length of Advertising data.
6292 bluetooth_advertising_data_t *value = { {0} };
6295 ret = bluetooth_get_advertising_data(&value, &length);
6298 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6301 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6303 * @brief Set advertising data with value
6305 * This function is used to set advertising data and Maximum size of advertising data
6306 * is 28 byte (Except Flag)
6308 * This function is a synchronous call.
6310 * @return BLUETOOTH_ERROR_NONE - Success \n
6311 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6312 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6315 * @param[in] value - Advertising data structure.
6319 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length, bool is_legacy);
6322 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6324 * @brief Check the privilege for advertising parameter setting
6326 * This function is a synchronous call.
6328 * @return BLUETOOTH_ERROR_NONE - Success \n
6329 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6335 int bluetooth_check_privilege_advertising_parameter(void);
6338 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6339 * @brief Get the LE scan response data
6341 * This function is used to get scan response data.
6342 * Before calling this API, the adapter should be enabled.
6344 * This function is a synchronous call.
6346 * @return BLUETOOTH_ERROR_NONE - Success \n
6347 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6348 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6349 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6351 * @param[out] value - Scan response data structure.
6352 * @param[out] length - The length of Scan response data.
6356 bluetooth_scan_resp_data_t *value = { {0} };
6359 ret = bluetooth_get_scan_response_data(&value, &length);
6362 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6365 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6367 * @brief Set scan response data with value
6369 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6371 * This function is a synchronous call.
6373 * @return BLUETOOTH_ERROR_NONE - Success \n
6374 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6375 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6378 * @param[in] value - LE Scan response data structure.
6382 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6385 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6387 * @brief Set scan interval and window
6389 * This function is used to set LE scan interval and window size
6391 * This function is a synchronous call.
6393 * @return BLUETOOTH_ERROR_NONE - Success \n
6394 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6395 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6398 * @param[in] interval - Interval of LE scan (msec)
6399 * @param[in] window - Window size of LE scan (msec)
6403 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6406 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6408 * @brief Set scan type
6410 * This function is used to set LE scan type
6412 * This function is a synchronous call.
6414 * @return BLUETOOTH_ERROR_NONE - Success \n
6415 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6416 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6419 * @param[in] scan_type - LE scan type
6423 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6426 * @fn intbluetooth_set_scan_phy(bleutooth_le_scanning_phy_t phy);
6428 * @brief Set scan phy
6430 * This function is used to set LE scan phy
6432 * This function is a synchronous call.
6434 * @return BLUETOOTH_ERROR_NONE - Success \n
6435 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6436 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6439 * @param[in] phy - LE scanning PHY
6443 int bluetooth_set_le_scan_phy(bleutooth_le_scanning_phy_t phy);
6446 * @fn intbluetooth_set_scan_phy(bluetooth_le_scan_role_t role);
6448 * @brief Set scan role
6450 * This function is used to set LE scan role
6452 * This function is a synchronous call.
6454 * @return BLUETOOTH_ERROR_NONE - Success \n
6455 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6456 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6459 * @param[in] role - LE scanning role
6463 int bluetooth_set_le_scan_role(bluetooth_le_scan_role_t role);
6466 * @fn int bluetooth_is_advertising(void)
6467 * @brief Check for the advertising is in-progress or not.
6469 * This API is used to check the current status of the advertising procedure.
6470 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6473 * This function checks whether the advertising is started or not.
6475 * This function is a synchronous call.
6477 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6479 * @return BLUETOOTH_ERROR_NONE - Success \n
6480 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6483 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6487 gboolean is_advertising = 0;
6489 ret = bluetooth_is_advertising(&is_advertising);
6492 int bluetooth_is_advertising(gboolean *is_advertising);
6495 * @fn int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6496 * @brief Add LE device to allow list
6498 * This API is used to add LE device to allow list
6499 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6503 * This function is a synchronous call.
6505 * @param[in] address The address of remote device
6507 * @return BLUETOOTH_ERROR_NONE - Success \n
6508 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6511 * @see bluetooth_set_custom_advertising
6513 int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6516 * @fn int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6517 * @brief Remove LE device from allow list
6519 * This API is used to remove LE device from allow list
6520 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6524 * This function is a synchronous call.
6526 * @param[in] address The address of remote device
6528 * @return BLUETOOTH_ERROR_NONE - Success \n
6529 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6532 * @see bluetooth_set_custom_advertising
6534 int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6537 * @fn int bluetooth_clear_allow_list(void)
6538 * @brief Clear allow list
6540 * This API is used to clear allow list
6541 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6545 * This function is a synchronous call.
6547 * @param[in] address The address of remote device
6549 * @return BLUETOOTH_ERROR_NONE - Success \n
6550 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6553 * @see bluetooth_set_custom_advertising
6555 int bluetooth_clear_allow_list(void);
6558 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6559 * const bluetooth_le_connection_param_t *parameters)
6560 * @brief update connection paramter of LE connection.
6562 * This function is a synchronous call.
6564 * @return BLUETOOTH_ERROR_NONE - Success \n
6565 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6568 * @param[in] address - remote device address value.
6569 * @param[in] parameters - new connection parameters.
6572 * @see bluetooth_bond_device
6574 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6575 const bluetooth_le_connection_param_t *parameters);
6578 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6580 * @brief Enable/Disable LE Privacy feature.
6582 * This function is used to enable or disable LE Privacy feature.
6583 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6585 * This function is a synchronous call.
6587 * @return BLUETOOTH_ERROR_NONE - Success \n
6588 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6589 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6592 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6596 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6599 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6601 * @brief Enable/Disable LE static random address.
6603 * This function is used to enable or disable LE static random address.
6605 * This function is a synchronous call.
6607 * @return BLUETOOTH_ERROR_NONE - Success \n
6608 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6609 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6612 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6616 int bluetooth_set_le_static_random_address(gboolean enable);
6619 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6620 * bluetooth_le_connection_mode_t mode)
6621 * @brief update connection paramter of LE connection.
6623 * This function is a synchronous call.
6625 * @return BLUETOOTH_ERROR_NONE - Success \n
6626 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6627 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6630 * @param[in] address - remote device address value.
6631 * @param[in] mode - new connection mode.
6635 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6636 bluetooth_le_connection_mode_t mode);
6639 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6640 * @brief Request for new ATT MTU value.
6642 * This function is a asynchronous call.
6644 * @return BLUETOOTH_ERROR_NONE - Success \n
6645 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6646 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6649 * @param[in] address - remote device address value.
6650 * @param[in] mtu - MTU value to be set.
6654 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6657 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6658 * unsigned int *mtu)
6659 * @brief Gets the xisting MTU value set for a connection.
6661 * This function is a synchronous call.
6663 * @return BLUETOOTH_ERROR_NONE - Success \n
6664 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6665 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6668 * @param[in] address - remote device address value.
6669 * @param[out] mtu - MTU value set for the connection.
6673 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6677 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6678 * bluetooth_device_address_t *id_address)
6679 * @brief Gets the Identity address of remote device.
6681 * This function is a synchronous call.
6683 * @return BLUETOOTH_ERROR_NONE - Success \n
6684 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6685 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6688 * @param[in] device_rpa - remote Resolvable private address.
6689 * @param[out] id_address - remote Identity device address value.
6693 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6694 bluetooth_device_address_t *id_address);
6697 * @fn int bluetooth_le_read_maximum_data_length()
6698 * @brief reads the maximum LE data length supported in the controller.
6700 * This function is a synchronous call.
6702 * @return BLUETOOTH_ERROR_NONE - Success \n
6703 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6709 int bluetooth_le_read_maximum_data_length(
6710 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6712 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6713 * @brief writes the host suggested values for the controllers max transmitted no of payload
6714 * octects to be used for new connections.
6716 * This function is a synchronous call.
6718 * @return BLUETOOTH_ERROR_NONE - Success \n
6719 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6725 int bluetooth_le_write_host_suggested_default_data_length(
6726 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6728 int bluetooth_le_read_suggested_default_data_length(
6729 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6731 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6732 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6734 int bluetooth_pbap_init(void);
6735 int bluetooth_pbap_deinit(void);
6736 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6737 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6738 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6739 bt_pbap_folder_t *folder);
6740 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6741 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6742 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6743 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6744 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6745 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6746 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6747 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6750 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6752 * @brief Set manufacturer data with value
6754 * This function is used to set manufacturer data.
6756 * This function is a synchronous call.
6758 * @return BLUETOOTH_ERROR_NONE - Success \n
6759 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6760 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6763 * @param[in] value - Manufacturer data structure.
6767 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6769 int bluetooth_set_passkey_notification(gboolean enable);
6772 * @fn int bluetooth_dpm_is_mode_allowed(void);
6774 * @brief Checks Restriction for BT mode(BT allowed or not)
6776 * This function is a synchronous call.
6778 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6779 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6780 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6787 int bluetooth_dpm_is_mode_allowed(void);
6790 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6792 * @brief Sets Restriction for BT mode(BT allowed or not)
6794 * This function is a synchronous call.
6796 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6797 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6798 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6801 * @param[in] value - BT Allow value.
6802 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6803 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6804 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6805 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6809 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6812 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6814 * @brief Reads the Restriction for BT mode(BT allowed or not)
6816 * This function is a synchronous call.
6818 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6819 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6820 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6824 * @param[out] value - BT Allow value.
6825 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6826 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6827 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6828 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6832 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6835 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6837 * @brief Sets the Restriction for device.
6839 * This function is a synchronous call.
6841 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6842 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6843 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6846 * @param[in] value - State value.
6847 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6848 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6852 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6855 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6857 * @brief Reads the Restriction for device.
6859 * This function is a synchronous call.
6861 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6862 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6863 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6867 * @param[out] value - State value.
6868 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6869 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6873 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6876 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6878 * @brief Sets the Restriction for uuid.
6880 * This function is a synchronous call.
6882 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6883 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6884 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6887 * @param[in] value - State value.
6888 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6889 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6893 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6896 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6898 * @brief Reads the Restriction for uuid.
6900 * This function is a synchronous call.
6902 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6903 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6904 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6908 * @param[out] value - State value.
6909 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6910 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6914 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6917 * @fn int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
6919 * @brief Adds the device to blocklist.
6921 * This function is a synchronous call.
6923 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6924 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6925 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6928 * @param[in] device_address - Device address
6932 int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
6935 * @fn int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
6937 * @brief Adds the device to allowlist.
6939 * This function is a synchronous call.
6941 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6942 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6943 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6946 * @param[in] device_address - Device address
6950 int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
6953 * @fn int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
6955 * @brief Adds the Service UUIDS to blocklist.
6957 * This function is a synchronous call.
6959 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6960 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6961 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6964 * @param[in] service_uuids - profile or custom service uuids
6968 int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
6971 * @fn int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
6973 * @brief Adds the Service UUIDS to allowlist.
6975 * This function is a synchronous call.
6977 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6978 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6979 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6982 * @param[in] service_uuids - profile or custom service uuids
6986 int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
6989 * @fn int bluetooth_dpm_clear_devices_from_blocklist();
6991 * @brief Clears the devices from blocklist.
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
7004 int bluetooth_dpm_clear_devices_from_blocklist(void);
7007 * @fn int bluetooth_dpm_clear_devices_from_allowlist();
7009 * @brief Clears the devices from allowlist.
7011 * This function is a synchronous call.
7013 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7014 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7015 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7022 int bluetooth_dpm_clear_devices_from_allowlist(void);
7025 * @fn int bluetooth_dpm_clear_uuids_from_blocklist();
7027 * @brief Clears the uuids from blocklist.
7029 * This function is a synchronous call.
7031 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7032 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7033 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7040 int bluetooth_dpm_clear_uuids_from_blocklist(void);
7043 * @fn int bluetooth_dpm_clear_uuids_from_allowlist();
7045 * @brief Clears the uuids from allowlist.
7047 * This function is a synchronous call.
7049 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7050 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7051 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7058 int bluetooth_dpm_clear_uuids_from_allowlist(void);
7061 * @fn int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
7063 * @brief reads the devices from blocklist.
7065 * This function is a synchronous call.
7067 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7068 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7069 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7072 * @param[out] device_list - list of devices
7076 int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
7079 * @fn int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7081 * @brief reads the devices from allowlist.
7083 * This function is a synchronous call.
7085 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7086 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7087 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7090 * @param[out] device_list - list of devices
7094 int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7097 * @fn int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7099 * @brief reads the uuids from blocklist.
7101 * This function is a synchronous call.
7103 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7104 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7105 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7108 * @param[in] uuid_list - list of uuids
7112 int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7115 * @fn int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7117 * @brief reads the uuids from allowlist.
7119 * This function is a synchronous call.
7121 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7122 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7123 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7126 * @param[in] uuid_list - list of uuids
7130 int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7133 * @fn int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7135 * @brief Removes the device from allowlist.
7137 * This function is a synchronous call.
7139 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7140 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7141 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7144 * @param[in] device_address - Device address
7148 int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7151 * @fn int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7153 * @brief Removes the device from blocklist.
7155 * This function is a synchronous call.
7157 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7158 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7159 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7162 * @param[in] device_address - Device address
7166 int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7169 * @fn int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7171 * @brief Removes the Service UUIDS from allowlist.
7173 * This function is a synchronous call.
7175 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7176 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7177 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7180 * @param[in] service_uuids - profile or custom service uuids
7184 int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7187 * @fn int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7190 * @brief Removes the Service UUIDS from blocklist.
7192 * This function is a synchronous call.
7194 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7195 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7196 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7199 * @param[in] service_uuids - profile or custom service uuids
7203 int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7206 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7208 * @brief Sets the Restriction for outgoing call.
7210 * This function is a synchronous call.
7212 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7213 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7214 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7217 * @param[in] value - State value.
7218 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7219 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7223 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7226 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7228 * @brief Reads the Restriction for outgoing call.
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
7238 * @param[out] value - State value.
7239 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7240 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7244 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7247 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7249 * @brief Sets the Restriction for Pairing.
7251 * This function is a synchronous call.
7253 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7254 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7255 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7258 * @param[in] value - State value.
7259 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7260 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7264 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7267 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7269 * @brief Reads the Restriction for Pairing
7271 * This function is a synchronous call.
7273 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7274 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7275 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7279 * @param[out] value - State value.
7280 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7281 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7285 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7288 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7290 * @brief Sets the Restriction for using Profiles.
7292 * This function is a synchronous call.
7294 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7295 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7296 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7299 * @param[in]profile - Profile.
7300 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7301 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7302 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7303 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7304 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7305 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7306 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7307 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7308 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7309 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7310 * BLUETOOTH_DPM_PROFILE_NONE
7311 * @param[in] value - State value.
7312 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7313 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7317 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7320 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7322 * @brief Reads the Restriction for using Profiles.
7324 * This function is a synchronous call.
7326 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7327 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7328 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7331 * @param[in]profile - Profile.
7332 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7333 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7334 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7335 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7336 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7337 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7338 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7339 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7340 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7341 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7342 * BLUETOOTH_DPM_PROFILE_NONE
7343 * @param[out] value - State value.
7344 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7345 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7349 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7352 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7354 * @brief Sets the Restriction for Desktop Connectivity.
7356 * This function is a synchronous call.
7358 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7359 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7360 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7363 * @param[in] value - State value.
7364 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7365 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7369 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7372 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7374 * @brief Reads the Restriction for Desktop Connectivity.
7376 * This function is a synchronous call.
7378 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7379 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7380 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7384 * @param[out] value - State value.
7385 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7386 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7390 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7393 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7395 * @brief Sets the Restriction for Discoverable state.
7397 * This function is a synchronous call.
7399 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7400 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7401 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
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_discoverable_state(bt_dpm_status_t value);
7413 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7415 * @brief Reads the Restriction for Discoverable state.
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
7425 * @param[out] value - State value.
7426 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7427 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7431 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7434 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7436 * @brief Sets the Restriction for linited discoverable state..
7438 * This function is a synchronous call.
7440 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7441 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7442 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7445 * @param[in] value - State value.
7446 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7447 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7451 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7454 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7456 * @brief Reads the Restriction for limited discoverable state.
7458 * This function is a synchronous call.
7460 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7461 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7462 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7466 * @param[out] value - State value.
7467 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7468 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7472 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7474 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7476 * @brief Sets the Restriction for Data trasnfer.
7478 * This function is a synchronous call.
7480 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7481 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7482 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7485 * @param[in] value - State value.
7486 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7487 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7491 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7495 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7497 * @brief Reads the Restriction for Data trasnfer.
7499 * This function is a synchronous call.
7501 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7502 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7503 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7507 * @param[out] value - State value.
7508 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7509 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7513 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7516 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7517 * bluetooth_pxp_poperty_t property, int value);
7519 * @brief Sets the Proximity alert level/properties for monitor role.
7521 * This function is a synchronous call.
7523 * @return BLUETOOTH_ERROR_NONE - Success \n
7524 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7525 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7526 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7529 * @param[in] device_address remote device address
7530 * @param[in] property proximity profile property
7531 * @param[in] value alert level/property value to be set
7536 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7537 bluetooth_pxp_poperty_t property, int value);
7540 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7541 * bluetooth_pxp_poperty_t property, int *value);
7543 * @brief Reads the Proximity alert level/properties for monitor role.
7545 * This function is a synchronous call.
7547 * @return BLUETOOTH_ERROR_NONE - Success \n
7548 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7549 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7550 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7553 * @param[in] device_address remote device address
7554 * @param[in] property proximity profile property
7555 * @param[out] value alert level/property value
7559 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7560 bluetooth_pxp_poperty_t property, int *value);
7563 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7564 * int *services_supported);
7566 * @brief Reads the Proximity Monitor profile supported properties/services.
7568 * This function is a synchronous call.
7570 * @return BLUETOOTH_ERROR_NONE - Success \n
7571 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7572 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7573 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7576 * @param[in] device_address remote device address
7577 * @param[out] services_supported proximity profile property/service
7581 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7582 int *services_supported);
7585 * @fn int bluetooth_proximity_reporter_register();
7587 * @brief Register all proximity related services in BlueZ.
7589 * This function is a synchronous call.
7591 * @return BLUETOOTH_ERROR_NONE - Success \n
7592 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7598 int bluetooth_proximity_reporter_register(void);
7601 * @fn int bluetooth_proximity_reporter_unregister();
7603 * @brief Unregister all proximity related services in BlueZ.
7605 * This function is a synchronous call.
7607 * @return BLUETOOTH_ERROR_NONE - Success \n
7608 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7614 int bluetooth_proximity_reporter_unregister(void);
7617 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7618 * bluetooth_pxp_poperty_t property, int *value);
7620 * @brief Reads the Proximity alert level/properties for reporter role.
7622 * This function is a synchronous call.
7624 * @return BLUETOOTH_ERROR_NONE - Success \n
7625 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7626 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7627 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7630 * @param[in] device_address remote device address
7631 * @param[in] property proximity profile property
7632 * @param[out] value alert level/property value
7636 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7637 bluetooth_pxp_poperty_t property, int *value);
7640 * @fn int bluetooth_tds_provider_register(void);
7642 * @brief Register Transport Discovery Provider role.
7644 * This function is a synchronous call.
7646 * @return BLUETOOTH_ERROR_NONE - Success \n
7647 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7648 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7649 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7657 int bluetooth_tds_provider_register(void);
7660 * @fn int bluetooth_tds_provider_unregister(void);
7662 * @brief Unregister Transport Discovery Provider role.
7664 * This function is a synchronous call.
7666 * @return BLUETOOTH_ERROR_NONE - Success \n
7667 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7668 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7669 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7677 int bluetooth_tds_provider_unregister(void);
7680 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7682 * @brief Create Transport Discovery Provider for a transport.
7684 * This function is a synchronous call.
7686 * @return BLUETOOTH_ERROR_NONE - Success \n
7687 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7688 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7689 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7692 * @param[in] Transport (BT, CUSTOM etc.)
7693 * @param[in] Unique handle for TDS provider.
7698 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7701 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7703 * @brief Remove previously created Transport Discovery Provider.
7705 * This function is a synchronous call.
7707 * @return BLUETOOTH_ERROR_NONE - Success \n
7708 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7711 * @param[in] Unique handle for previously created provider.
7716 int bluetooth_tds_provider_destroy(unsigned int handle);
7719 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7721 * @brief Set transport block for in advertisement and gatt db.
7723 * This function is a synchronous call.
7725 * @return BLUETOOTH_ERROR_NONE - Success \n
7726 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7727 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7728 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7731 * @param[in] Provider specific manufacturer data.
7732 * @param[in] Provider specific manufacturer data length.
7737 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7740 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7741 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7743 * @brief Set transport block for in advertisement and gatt db.
7745 * This function is a synchronous call.
7747 * @return BLUETOOTH_ERROR_NONE - Success \n
7748 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7749 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7750 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7753 * @param[in] Unique handle for TDS provider.
7754 * @param[in] Transport state (On/Off/Not Available).
7755 * @param[in] Transport specific data block.
7756 * @param[in] Transport specific data block length.
7761 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7762 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7765 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7766 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7768 * @brief Send response to TDS activation request from remoted device.
7770 * This function is a synchronous call.
7772 * @return BLUETOOTH_ERROR_NONE - Success \n
7773 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7774 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7775 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7778 * @param[in] Remote device BT address.
7779 * @param[in] Unique handle for TDS provider.
7780 * @param[in] Response for TDS activation request.
7781 * @param[in] Transport specific data block to be sent in activation response.
7782 * @param[in] Data block length.
7787 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7788 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7791 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7793 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7795 * This function is an asynchronous call.
7797 * @return BLUETOOTH_ERROR_NONE - Success \n
7798 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7799 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7800 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7801 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7804 * @param[in] device_address remote device address
7805 * @param[in] handle attribute handle
7807 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7808 * when TDS data is received from Remote provider
7810 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7811 const char *handle);
7814 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7816 * @brief Enables CCCD on Remote Provider.
7818 * This function is an asynchronous call.
7820 * @return BLUETOOTH_ERROR_NONE - Success \n
7821 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7822 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7823 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7824 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7827 * @param[in] device_address remote device address
7828 * @param[in] handle attribute handle
7830 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7831 * when Indication is enabled on Remote provider
7833 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7834 const char *handle);
7837 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7838 * unsigned char *buf, int length);
7839 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7841 * This function is an asynchronous call.
7843 * @return BLUETOOTH_ERROR_NONE - Success \n
7844 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7845 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7846 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7847 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7850 * @param[in] device_address remote device address
7851 * @param[in] handle attribute handle
7852 * @param[in] buf Control point activation param
7853 * @param[in] param length
7855 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7856 * is received from remote Provider
7858 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7859 unsigned char *buf, int length);
7862 * @fn int bluetooth_otp_server_init(const char *directory);
7864 * @brief Starts OTP server.
7866 * This function is a synchronous call.
7876 int bluetooth_otp_server_init(const char *directory);
7879 * @fn int bluetooth_otp_server_deinit();
7881 * @brief Stops OTP server.
7883 * This function is a synchronous call.
7893 int bluetooth_otp_server_deinit();
7896 * @fn int bluetooth_otp_enable_notification(const char *handle);
7898 * @brief Enable notification for remote OACP & OLCP characteristics.
7900 * This function is a synchronous call.
7910 int bluetooth_otp_enable_notification(const char *handle);
7913 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7914 * unsigned char *buf, int length);
7916 * @brief Write value on remote characteristics.
7918 * This function is a synchronous call.
7928 int bluetooth_otp_write_characteristics_value(const char *handle,
7929 unsigned char *buf, int length);
7932 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7934 * @brief Read value for remote characteristics.
7936 * This function is a synchronous call.
7946 int bluetooth_otp_read_characteristic_value(const char *handle);
7949 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7951 * @brief Read value for remote characteristics.
7953 * This function is a synchronous call.
7963 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7966 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7968 * @brief Read value for remote characteristics.
7970 * This function is a synchronous call.
7980 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7983 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7984 * @brief Check if Adapter supports LE 2M PHY feature or not.
7986 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7987 * in BT 5.0 specification.
7989 * This function is a synchronous call.
7991 * @return BLUETOOTH_ERROR_NONE - Success \n
7992 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7993 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7994 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7995 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7999 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
8002 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
8003 * @brief Check if Adapter supports LE 2M CODED feature or not.
8005 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
8006 * in BT 5.0 specification.
8008 * This function is a synchronous call.
8010 * @return BLUETOOTH_ERROR_NONE - Success \n
8011 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8012 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8013 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8014 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
8018 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
8021 * @fn int bluetooth_is_le_extended_advertising_supported(gboolean *is_supported)
8022 * @brief Check if Adapter supports LE Extended Advertising feature or not.
8024 * This API is used to check whether LE Adapter supports LE Extended Advertising feature, which is introduced
8025 * in BT 5.0 specification.
8027 * This function is a synchronous call.
8029 * @return BLUETOOTH_ERROR_NONE - Success \n
8030 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8031 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8032 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8033 * @param[out] is_supported. This boolean variable indicates whether LE Extended Advertising is supported or not
8037 int bluetooth_is_le_extended_advertising_supported(gboolean *is_supported);
8040 * @fn int bluetooth_is_le_extended_scan_supported(gboolean *is_supported)
8041 * @brief Check if Adapter supports LE Extended Scan feature or not.
8043 * This API is used to check whether LE Adapter supports LE Extended Scan feature, which is introduced
8044 * in BT 5.0 specification.
8046 * This function is a synchronous call.
8048 * @return BLUETOOTH_ERROR_NONE - Success \n
8049 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8050 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8051 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8052 * @param[out] is_supported. This boolean variable indicates whether LE Extended Scan is supported or not
8056 int bluetooth_is_le_extended_scan_supported(gboolean *is_supported);
8059 * @fn int bluetooth_le_get_maximum_advertising_data_length(gint *data_length)
8060 * @brief gives the maximum advertising data length supported by controller.
8062 * This API is used to get the maximum advertising data length supported by controller. This feature is introduced
8063 * in BT 5.0 specification.
8065 * This function is a synchronous call.
8067 * @return BLUETOOTH_ERROR_NONE - Success \n
8068 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8069 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8070 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8071 * @param[out] data_length. This integer variable indicates the maximum advertising data length supported by the controller
8075 int bluetooth_le_get_maximum_advertising_data_length(gint *data_length);
8078 * @fn int bluetooth_l2cap_le_create_socket(int psm)
8079 * @brief Register l2cap_le socket with a specific PSM
8082 * This API register l2cap_le socket with the given PSM. The return value of this API is the socket
8083 * descriptor of the server.
8084 * This is the first API which is called to create the server. Once we created the server socket,
8085 * we will listen on that return socket.
8086 * So a bluetooth_l2cap_le_listen_and_accept should follow this API call. This is a synchronous call.
8089 * @return socket FD on Success \n
8090 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8091 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
8092 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
8093 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8094 * @param[in] int psm
8097 * @see bluetooth_l2cap_le_listen_and_accept, bluetooth_l2cap_le_remove_socket
8102 fd = bluetooth_l2cap_le_create_socket(test_psm);
8106 int bluetooth_l2cap_le_create_socket(int psm);
8109 * @fn int bluetooth_l2cap_le_remove_socket(int socket_fd)
8110 * @brief De-register the l2cap_le socket
8113 * This API deregister l2cap_le socket with the given socket fd. If the remote device is
8114 * already connected then we will receive the BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED with socket
8115 * descriptor else no event will come. We will call this API only after the
8116 * bluetooth_l2cap_le_listen_and_accept.
8117 * This is a synchronous call.
8119 * @return BLUETOOTH_ERROR_NONE - Success \n
8120 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8121 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
8122 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8123 * @param[in] int socket_fd
8126 * @see bluetooth_l2cap_le_create_socket, bluetooth_l2cap_le_listen_and_accept
8129 void bt_event_callback(int event, bluetooth_event_param_t *param)
8133 case BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED:
8135 bluetooth_l2cap_le_connection_t *discon_ind =
8136 (bluetooth_l2cap_le_connection_t *)param->param_data;
8138 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
8146 fd = bluetooth_l2cap_le_create_socket(test_psm);
8147 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8149 ret = bluetooth_l2cap_le_remove_socket(fd);
8152 int bluetooth_l2cap_le_remove_socket(int socket_fd);
8155 * @fn int bluetooth_l2cap_le_server_disconnect(int socket_fd)
8156 * @brief Disconnect l2cap_le connection
8159 * Disconnect a specific(device node fd) l2cap_le connection. This is a Synchronous call and there
8160 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8163 * @return BLUETOOTH_ERROR_NONE - Success \n
8164 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8165 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8166 * @param[in] int socket_fd
8172 ret = bluetooth_l2cap_le_server_disconnect(g_ret_fd);
8174 printf("Disconnection failed");
8176 printf("Disconnection Success");
8180 int bluetooth_l2cap_le_server_disconnect(int socket_fd);
8183 * @fn int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection)
8184 * @brief L2CAP_LE socket listen
8187 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8188 * after the bluetooth_l2cap_le_create_socket API.
8189 * This API listen for the incoming connection and once it receives a connection, it will give
8190 * BLUETOOTH_EVENT_L2CAP_LE_CONNECTED
8191 * event to the application. This is an Asynchronous API call.
8194 * @return BLUETOOTH_ERROR_NONE - Success \n
8195 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8196 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8198 * @param[in] int socket_fd
8199 * @param[in] max pending connection.
8202 * @see bluetooth_l2cap_le_create_socket
8205 void bt_event_callback(int event, bluetooth_event_param_t* param)
8209 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8211 bluetooth_l2cap_le_connection_t *conn_ind =
8212 (bluetooth_l2cap_le_connection_t *)param->param_data;
8214 printf("\nConnected from FD %d", conn_ind->socket_fd);
8222 fd = bluetooth_l2cap_le_create_socket(test_psm);
8223 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8227 int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection);
8230 * @fn int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection)
8231 * @brief L2cap_le socket listen
8234 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8235 * after the bluetooth_l2cap_le_create_socket API.
8236 * This API listen for the incoming connection and once it receives a connection, it will give
8237 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE
8238 * event to the application. This is an Asynchronous API call.
8241 * @return BLUETOOTH_ERROR_NONE - Success \n
8242 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8243 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8245 * @param[in] int socket_fd
8246 * @param[in] max pending connection.
8249 * @see bluetooth_l2cap_le_create_socket
8252 void bt_event_callback(int event, bluetooth_event_param_t* param)
8256 case BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE:
8258 char *name = (char *)param->param_data;
8260 printf("\nConnected from %s", name);
8262 bluetooth_l2cap_le_accept_connection();
8270 fd = bluetooth_l2cap_le_create_socket(test_psm);
8271 ret = bluetooth_l2cap_le_listen(fd, 1);
8275 int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection);
8278 * @fn int bluetooth_l2cap_le_accept_connection()
8279 * @brief Accepts the authorization request indicated by the event
8280 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8282 * This function is a synchronous call.
8284 * @return BLUETOOTH_ERROR_NONE - Success \n
8285 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8287 * @param[in] the socket fd of the server
8288 * @param[out] the socket fd of the client
8292 * @see bluetooth_l2cap_le_reject_connection
8294 int bluetooth_l2cap_le_accept_connection(int server_fd);
8297 * @fn int bluetooth_l2cap_le_reject_connection()
8298 * @brief Rejects the authorization request indicated by the event
8299 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8301 * This function is a synchronous call.
8303 * @return BLUETOOTH_ERROR_NONE - Success \n
8304 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8306 * @param[in] the socket fd of the server
8310 * @see bluetooth_l2cap_le_accept_connection
8312 int bluetooth_l2cap_le_reject_connection(int server_fd);
8315 * @fn gboolean bluetooth_l2cap_le_is_server_psm_available(int psm)
8316 * @brief Informs whether l2cap_le server psm is available or not.
8318 * This function is a synchronous call.
8320 * @return TRUE - L2CAP_LE PSM is available \n
8321 * FALSE - L2CAP_LE PSM is not available \n
8323 * @param[in] psm (int)
8329 gboolean bluetooth_l2cap_le_is_server_psm_available(int psm);
8332 * @fn int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8334 * @brief Connect to the remote device l2cap_le *
8336 * Connect to a specific l2cap_le socket on a remote device psm. This is a Async call. Once
8337 * the connection is successful callback BLUETOOTH_EVENT_L2CAP_LE_CONNECTED events is generated,
8338 * which contains the socket_fd, device role (L2CAP_LE_ROLE_SERVER/L2CAP_LE_ROLE_CLIENT), device addess
8339 * etc. The socket_fd can be further used to send the data. It better to do a ble scanning before
8340 * initiating a connection.
8342 * @return BLUETOOTH_ERROR_NONE - Success \n
8343 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8344 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8345 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
8346 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
8347 * @param[in] bluetooth_device_address_t remote bt_address
8348 * @param[in] int psm
8350 * @see bluetooth_l2cap_le_disconnect, bluetooth_l2cap_le_write
8354 void bt_event_callback(int event, bluetooth_event_param_t *param)
8358 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8360 bluetooth_l2cap_le_connection_t *conn_ind =
8361 (bluetooth_l2cap_le_connection_t *)param->param_data;
8363 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
8364 (conn_ind->device_role == L2CAP_LE_ROLE_SERVER) ?
8365 "SERVER" : "CLIENT");
8370 bluetooth_device_address_t remote_address = {{0},};
8371 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
8372 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
8374 ret = bluetooth_l2cap_le_connect(&remote_address, test_psm);
8376 printf("Connection failed, Reason = %d", ret);
8378 printf("Connection Success, Ret = %d", ret);
8382 int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8386 * @fn int bluetooth_l2cap_le_disconnect(int socket_fd)
8387 * @brief Disconnect l2cap_le connection
8390 * Disconnect a specific(device node fd) L2CAP_LE connection. This is a Synchronous call and there
8391 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8394 * @return BLUETOOTH_ERROR_NONE - Success \n
8395 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8396 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8397 * @param[in] int remote socket_fd
8400 * @see bluetooth_l2cap_le_connect
8404 ret = bluetooth_l2cap_le_disconnect(g_ret_fd);
8406 printf("Disconnection failed");
8408 printf("Disconnection Success");
8413 int bluetooth_l2cap_le_disconnect(int socket_fd);
8416 * @fn int bluetooth_l2cap_le_write (int fd, const char *buf, int length)
8417 * @brief Write to l2cap_le connection
8420 * This API is used to send the data over the l2cap_le connection. This is a
8421 * synchronous API. The same API is used to send the data for server and the client.
8423 * @return BLUETOOTH_ERROR_NONE - Success \n
8424 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8425 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
8427 * @param[in] const char *buff Data buffer to send
8428 * @param[in] int length Length of the data
8431 * @see bluetooth_l2cap_le_connect
8434 char *buff = "Test data 123456789"
8435 ret = bluetooth_l2cap_le_write(g_ret_fd, buff, 15);
8437 printf("Send failed");
8439 printf("Send success");
8443 int bluetooth_l2cap_le_write(int fd, const char *buf, int length);
8446 * @fn gboolean bluetooth_l2cap_le_client_is_connected(
8447 * const bluetooth_device_address_t *device_address, gboolean *connected)
8448 * @brief Informs whether l2cap_le client is connected.
8450 * This function is a synchronous call.
8452 * @return TRUE - L2CAP_LE client is connected \n
8453 * FALSE - L2CAP_LE client is not connected \n
8459 int bluetooth_l2cap_le_client_is_connected(
8460 const bluetooth_device_address_t *device_address, gboolean *connected);
8463 * @fn gboolean bluetooth_l2cap_le_server_is_connected(
8464 * const bluetooth_device_address_t *device_address, gboolean *connected)
8465 * @brief Informs whether l2cap_le server is connected.
8467 * This function is a synchronous call.
8469 * @return TRUE - L2CAP_LE server is connected \n
8470 * FALSE - L2CAP_LE server is not connected \n
8476 int bluetooth_l2cap_le_server_is_connected(
8477 const bluetooth_device_address_t *device_address, gboolean *connected);
8480 * @fn gboolean bluetooth_l2cap_le_get_psm(int server_fd, int *psm)
8481 * @brief gives the psm of the specific l2cap_le socket connection.
8483 * This function is a synchronous call.
8485 * @return BLUETOOTH_ERROR_NONE - Success \n
8486 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8487 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8489 * @param[in] the socket fd of the server
8490 * @param[out] int *psm
8496 int bluetooth_l2cap_le_get_psm(int id, int *psm);
8505 #endif /* __cplusplus */
8506 #endif /* _BLUETOOTH_API_H_*/