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 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
448 } bluetooth_advertising_data_t;
454 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
455 } bluetooth_scan_resp_data_t;
458 * Advertising filter policy
461 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
462 BLUETOOTH_ALLOW_CONN_ALL_SCAN_ALLOW_LIST = 0x01,
463 BLUETOOTH_ALLOW_SCAN_ALL_CONN_ALLOW_LIST = 0x02,
464 BLUETOOTH_ALLOW_SCAN_CONN_ALLOW_LIST = 0x03,
465 } bluetooth_advertising_filter_policy_t;
471 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
472 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
473 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
474 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
475 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
476 } bluetooth_advertising_type_t;
479 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
480 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
481 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_RESYNC = 0x03,
482 } bluetooth_gatt_service_change_type_t;
485 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
486 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
487 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
488 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
489 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
490 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
491 } bt_gatt_permission_t;
494 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
495 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
496 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
497 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
498 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
499 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
500 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
501 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
502 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
503 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
504 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
505 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
506 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
507 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
508 } bt_gatt_characteristic_property_t;
511 * Remote device request types for attributes
514 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
515 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
516 } bluetooth_gatt_att_request_tyep_t;
519 * Proximity Property Type
522 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
523 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
524 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
525 } bluetooth_pxp_poperty_t;
531 BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */
532 BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
533 BLUETOOTH_TDS_TRANSPORT_WIFI_NAN, /* Wi-Fi Alliance Neighbor Awareness Networking */
534 BLUETOOTH_TDS_TRANSPORT_WIFI_SVC_ADV, /* Wi-Fi Alliance Service Advertisement */
536 BLUETOOTH_TDS_TRANSPORT_INVALID
537 } bluetooth_tds_transport_t;
540 * TDS transport state
543 BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0,
544 BLUETOOTH_TDS_TRANSPORT_STATE_ON,
545 BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE,
546 BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED
547 } bluetooth_tds_transport_state_t;
554 guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX];
555 } bluetooth_tds_data_t;
558 * TDS activation request
561 bluetooth_device_address_t rem_addr;
562 bluetooth_tds_transport_t transport;
563 bluetooth_tds_data_t tds_data;
564 } bluetooth_tds_activation_req_t;
567 * TDS Control Point data
570 int length; /**< Control point data length */
571 guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */
572 } bluetooth_control_point_data_t;
575 * TDS Indication Response data
578 bluetooth_device_address_t rem_addr; /**< Device address */
579 bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */
580 } bluetooth_tds_indication_res_t;
583 * Structure to hold the TDS Complete data information which is read from remote TDS provider
586 bluetooth_device_address_t device_address; /**< Device address */
587 int data_length; /**< Data length */
588 char *data; /**< Complete Transport Specific data */
589 } bluetooth_tds_transport_data_info_t;
592 * OTP Characteristics Value
595 int length; /**< Characteristics value length */
596 guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
597 } bluetooth_otp_charc_data_t;
600 * Structure to hold the OTP response data from remote OTP server
603 char *handle; /**< Handle */
604 int data_length; /**< Data length */
605 char *data; /**< Read data */
606 } bluetooth_otp_resp_info_t;
609 * Structure to hold the OTC Channel Info
612 gboolean connected; /**< Connection Status */
614 char *address; /**< Remote address */
615 } bluetooth_otc_info_t;
618 * Advertising parameters
623 guint8 filter_policy;
626 } bluetooth_advertising_params_t;
632 int type; /**< passive 0, active 1 */
633 float interval; /**< LE scan interval */
634 float window; /**< LE scan window */
635 } bluetooth_le_scan_params_t;
641 BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
642 BLUETOOTH_LE_ACTIVE_SCAN
643 } bluetooth_le_scan_type_t;
646 BLUETOOTH_LE_SCAN_ALL = 0x00,
647 BLUETOOTH_LE_SCAN_LEGACY_ONLY,
648 BLUETOOTH_LE_SCAN_EXTENDED_ONLY
649 } bluetooth_le_scan_role_t;
652 BLUETOOTH_ALL_PHY = 0x00,
653 BLUETOOTH_1M_PHY = 0x01,
654 BLUETOOTH_ONE_M_CODED_PHY = 0x03
655 } bleutooth_le_scanning_phy_t;
665 } bluetooth_le_connection_param_t;
668 LE Read Maximum Data Length
671 guint16 max_tx_octets;
673 guint16 max_rx_octets;
675 } bluetooth_le_read_maximum_data_length_t;
678 LE Read Host suggested default Data Length
681 guint16 def_tx_octets;
683 } bluetooth_le_read_host_suggested_data_length_t;
686 * Samsung XSAT Vendor dependent command
691 } bluetooth_vendor_dep_at_cmd_t;
697 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
698 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
699 } bluetooth_opp_transfer_type_t;
704 } bluetooth_hf_ciev_device_event_t;
706 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
707 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
708 /**< Base ID for GAP Event */
709 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
710 /**< Base ID for SDP events */
711 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
712 /**< Base ID for RFCOMM events */
713 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
714 /**< Base ID for NETWORK events */
715 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
716 /**< Base ID for HDP events */
717 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
718 /**< Base ID for OPC events */
719 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
720 /**< Base ID for Obex Server events */
721 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
722 /**< Base ID for GATT events */
724 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
725 /**< Base ID for Audio events */
726 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
727 /**< Base ID for HID events */
728 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
729 /**< Base ID for Advertising events */
730 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
731 /**< Base ID for PBAP Client events */
732 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
733 /**< Base ID for AVRCP events */
734 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
735 /**< Base ID for IPSP events */
736 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
737 /**< Base ID for MAP events */
738 #define BLUETOOTH_EVENT_MESH_BASE ((int)(BLUETOOTH_EVENT_MAP_BASE + 0x0020))
739 /**< Base ID for MAP events */
740 #define BLUETOOTH_EVENT_L2CAP_LE_BASE ((int)(BLUETOOTH_EVENT_MESH_BASE + 0x0040))
741 /**< Base ID for L2CAP_LE events */
744 * Bluetooth event type
747 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
749 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
750 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
751 BLUETOOTH_EVENT_DISABLED_BATTERY_DATA, /**< Bluetooth event adapter disabled battery data*/
752 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
753 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
754 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
755 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
756 /**< Bluetooth event Discoverable timeout requested*/
757 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
758 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
759 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
760 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
761 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
762 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
763 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
764 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
765 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
766 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
767 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
768 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
769 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
770 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
771 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
772 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
773 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
774 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
775 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
776 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
777 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
779 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
780 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
781 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
782 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
783 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
785 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
786 /**< Bluetooth event serice search base id */
787 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
788 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
789 /**< RFCOMM data receive event */
790 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
791 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
793 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
795 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
796 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
798 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
800 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
801 /**< Bluetooth Network event */
802 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
803 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
804 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
805 /**< Network disconnected evnet in server */
807 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
808 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
810 BLUETOOTH_EVENT_HDP_CONNECTED
811 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
812 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
813 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
815 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
816 /* OPC Connected event */
817 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
818 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
819 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
820 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
822 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
823 BLUETOOTH_EVENT_MAP_DISCONNECTED,
825 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
826 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
827 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
828 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
829 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
831 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
832 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
833 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
834 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
835 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
836 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
837 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
838 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
839 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
840 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
841 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
842 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
843 BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
845 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
846 /* Obex server authorize event*/
847 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
848 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
849 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
850 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
851 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
852 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
854 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
855 /**<Discovered GATT service characteristics event*/
856 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
857 /**<Remote GATT charateristic value changed event*/
858 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
859 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
860 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
861 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
862 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
863 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
864 BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
865 BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
866 BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
867 BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
868 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
869 BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
870 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
871 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
872 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
873 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
874 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
875 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
876 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
877 BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
878 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
879 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
880 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
881 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
882 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
883 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
884 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
885 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
886 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
887 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
888 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
889 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
890 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
891 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
892 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
893 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
894 BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
895 BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
896 BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
897 BLUETOOTH_EVENT_HF_CONNECTED,
898 BLUETOOTH_EVENT_HF_DISCONNECTED,
899 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
900 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
901 BLUETOOTH_EVENT_HF_RING_INDICATOR,
902 BLUETOOTH_EVENT_HF_CALL_WAITING,
903 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
904 BLUETOOTH_EVENT_HF_CALL_STARTED,
905 BLUETOOTH_EVENT_HF_CALL_ENDED,
906 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
907 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
908 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
909 BLUETOOTH_EVENT_HF_CALL_STATUS,
910 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
911 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
912 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
913 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
914 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
915 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
916 BLUETOOTH_EVENT_HF_CALL_IDLE,
917 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
918 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
919 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
920 BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
922 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
923 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
924 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
925 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
926 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
928 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
929 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
930 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
931 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
932 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
933 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
934 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
935 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
937 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
938 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
939 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
940 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
941 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
942 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
943 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
945 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
946 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
947 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
948 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
949 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
950 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
951 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
952 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
953 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
955 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
956 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
957 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
958 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
959 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
960 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
961 BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
962 BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
963 BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
964 BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
965 BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
967 BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
968 BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
969 BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
970 BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
971 BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
972 BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
973 BLUETOOTH_EVENT_MESH_SCAN_STARTED = BLUETOOTH_EVENT_MESH_BASE,
974 BLUETOOTH_EVENT_MESH_SCAN_FINISHED,
975 BLUETOOTH_EVENT_MESH_SCAN_RESULT,
976 BLUETOOTH_EVENT_MESH_AUTHENTICATION_REQUEST,
977 BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED,
978 BLUETOOTH_EVENT_MESH_NODE_BROWSED,
979 BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES,
980 BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
981 BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED,
982 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
983 BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST,
984 BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
985 BLUETOOTH_EVENT_MESH_MODEL_MSG_RECEIVED,
986 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST,
987 BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED,
988 BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED,
989 BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
990 BLUETOOTH_EVENT_MESH_JOIN_COMPLETED,
991 BLUETOOTH_EVENT_L2CAP_LE_DATA_RECEIVED = BLUETOOTH_EVENT_L2CAP_LE_BASE,
992 /**< L2CAP_LE data receive event */
993 BLUETOOTH_EVENT_L2CAP_LE_CONNECTED, /**< L2CAP_LE server/client connect */
994 BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED, /**< L2CAP_LE server/client disconnect */
995 BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE,
996 BLUETOOTH_EVENT_L2CAP_LE_SERVER_REMOVED
997 } bluetooth_event_type_t;
1000 * This bt_service_uuid_list_t enum indicates service uuid list .
1001 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
1005 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
1006 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
1007 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
1008 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
1009 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
1010 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
1011 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
1012 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
1013 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
1014 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
1015 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
1016 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
1017 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
1019 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
1020 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
1021 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
1022 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
1023 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
1024 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
1025 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
1026 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
1027 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
1028 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
1029 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
1030 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
1031 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
1032 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
1034 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
1035 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
1036 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
1037 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
1038 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
1039 /**<DIRECT PRINTING*/
1040 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
1041 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
1042 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
1043 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
1044 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
1045 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
1046 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
1047 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
1048 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
1049 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
1050 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
1051 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
1052 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
1053 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
1054 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
1055 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
1056 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
1057 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
1058 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
1059 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
1060 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
1061 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
1062 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
1063 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
1064 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
1065 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
1066 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
1067 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
1068 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
1069 } bluetooth_service_uuid_list_t;
1072 * Service class part of class of device returned from device discovery
1075 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
1076 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
1077 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
1078 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
1079 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
1080 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
1081 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
1082 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
1083 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
1084 } bluetooth_device_service_class_t;
1088 * Major device mask (For device discovery)
1091 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
1092 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
1093 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
1094 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
1095 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
1096 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
1097 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
1098 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
1099 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
1100 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
1101 } bluetooth_device_major_mask_t;
1105 * Major device class (part of Class of Device)
1108 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
1109 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
1110 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
1111 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
1112 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
1113 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
1114 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
1115 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
1116 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
1117 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
1118 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
1119 } bluetooth_device_major_class_t;
1122 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
1124 /* About Computer Major class */
1125 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
1127 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
1128 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
1129 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
1130 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
1131 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
1133 /* About Phone Major class */
1134 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
1135 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
1136 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
1137 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
1138 /**< voice gateway minor class */
1139 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
1141 /* About LAN/Network Access Point Major class */
1142 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
1143 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
1144 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
1145 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
1146 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
1147 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
1148 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
1149 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
1151 /* About Audio/Video Major class */
1152 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
1153 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
1155 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
1156 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
1157 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
1158 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
1159 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
1160 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
1161 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
1162 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
1163 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
1164 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
1165 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
1166 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
1167 /**< Video Display and Loud
1168 Speaker minor class */
1169 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
1172 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
1174 /* About Peripheral Major class */
1175 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
1176 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
1177 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
1178 /**< Combo Keyboard or pointing
1179 device minorclass */
1181 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
1182 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
1183 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
1184 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
1185 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
1186 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
1187 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
1188 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
1189 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
1191 /* About Imaging Major class */
1192 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
1193 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
1194 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
1195 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
1197 /* About Wearable Major class */
1198 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
1199 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
1200 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
1201 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
1202 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
1204 /* About Toy Major class */
1205 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
1206 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
1207 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
1208 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
1209 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
1211 /* About Health Major class */
1212 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
1213 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
1214 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
1215 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
1216 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
1217 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
1218 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
1219 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
1220 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
1221 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
1222 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
1223 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
1224 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
1225 } bluetooth_device_minor_class_t;
1228 * structure to hold the device information
1231 bluetooth_device_major_class_t major_class; /**< major device class */
1232 bluetooth_device_minor_class_t minor_class; /**< minor device class */
1233 bluetooth_device_service_class_t service_class;
1234 /**< service device class */
1235 } bluetooth_device_class_t;
1238 * Discovery Role types
1241 DISCOVERY_ROLE_BREDR = 0x1,
1243 DISCOVERY_ROLE_LE_BREDR
1244 } bt_discovery_role_type_t;
1247 * Connected state types
1250 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
1251 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
1252 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
1253 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
1254 } bluetooth_connected_link_t;
1260 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
1261 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
1262 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
1263 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
1264 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
1265 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
1266 BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80, /**< rssi high threshold */
1267 } bluetooth_le_scan_filter_feature_t;
1270 * LE connection mode
1273 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1274 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1275 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1276 } bluetooth_le_connection_mode_t;
1279 * structure to hold the device information
1282 bluetooth_device_address_t device_address; /**< device address */
1283 bluetooth_device_name_t device_name; /**< device name */
1284 bluetooth_device_class_t device_class; /**< device class */
1285 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1286 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1288 int rssi; /**< received strength signal*/
1289 gboolean paired; /**< paired flag */
1290 bluetooth_connected_link_t connected; /**< connected link type */
1291 gboolean trust; /**< trust flag */
1292 gboolean is_alias_set; /** is device alias set flag**/
1293 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1294 } bluetooth_device_info_t;
1297 * structure to hold the LE device information
1300 int data_len; /**< manafacturer specific data length */
1301 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1302 } bluetooth_le_advertising_data_t;
1305 guint8 data[BLUETOOTH_EXTENDED_ADVERTISING_DATA_LENGTH_MAX];
1306 } bluetooth_extended_advertising_data_t;
1309 int data_len; /**< manafacturer specific data length */
1310 bluetooth_extended_advertising_data_t data; /**< manafacturer specific data */
1311 } bluetooth_le_extended_advertising_data_t;
1314 bluetooth_device_address_t device_address; /**< device address */
1315 int addr_type; /**< address type*/
1316 int rssi; /**< received strength signal*/
1320 int advertising_sid;
1322 int periodic_adv_int;
1324 /* TODO : Replace bluetooth_le_advertising_data_t adv_ind_data with
1325 * bluetooth_le_extended_advertising_data_t once
1326 * LE_EXTENDED feature is supported */
1327 bluetooth_le_advertising_data_t adv_ind_data;
1328 bluetooth_le_advertising_data_t scan_resp_data;
1329 } bluetooth_le_device_info_t;
1333 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1334 bluetooth_device_address_t device_address; /**< device address */
1335 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1336 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1337 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1338 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1339 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1340 bluetooth_le_advertising_data_t service_data; /**< service data */
1341 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1342 int manufacturer_id; /**< manufacturer ID */
1343 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1344 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1345 int rssi_high_threshold; /**< rssi high threshold */
1346 } bluetooth_le_scan_filter_t;
1349 bluetooth_device_address_t device_address; /**< device address */
1350 unsigned int mtu; /** < MTU set for the ATT connection */
1351 unsigned int status; /** < status of the MTU exchange */
1352 } bluetooth_le_att_mtu_info_t;
1355 * structure to hold the paired device information
1358 bluetooth_device_address_t device_address; /**< paired device address */
1359 bluetooth_device_name_t device_name; /**< device name */
1360 bluetooth_device_class_t device_class; /**< device class */
1361 } bluetooth_paired_device_info_t;
1364 * structure to hold the paired device information
1367 bluetooth_device_address_t device_address;
1368 /**< device address */
1369 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1370 /**< network interface name */
1371 } bluetooth_network_device_info_t;
1374 * Authentication event types
1378 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1379 BLUETOOTH_AUTH_PIN_REQUEST,
1380 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1381 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1382 } bluetooth_auth_type_t;
1385 * structure to hold the pincode/pass-key req informations
1388 bluetooth_device_address_t device_address; /**< remote device address */
1389 bluetooth_device_name_t device_name; /**< device name */
1390 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1391 bool incoming; /**< stores if bonding request is incoming */
1392 } bluetooth_authentication_request_info_t;
1395 * Stucture to hold discovery option
1398 unsigned short max_response; /**< the number of maximum response */
1399 unsigned short discovery_duration;
1400 /**< duration of discovery (seconds) */
1401 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1402 classOfDevice variable */
1403 } bluetooth_discovery_option_t;
1406 * Stucture to hold event information
1409 int event; /**< event type */
1410 int result; /**< Success or error value */
1412 /**<parameter data pointer */
1414 } bluetooth_event_param_t;
1417 bluetooth_device_address_t device_addr;
1418 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1419 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1420 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1425 bluetooth_device_address_t device_addr;
1426 unsigned char addr_type;
1429 } bt_connection_info_t;
1432 * Stucture to rfcomm receive data
1437 /**< the socket fd */
1438 int buffer_size;/**< the length of the receive buffer */
1440 /**< the receive data buffer */
1441 } bluetooth_rfcomm_received_data_t;
1444 * Stucture to l2cap_le receive data
1447 int socket_fd; /**< the socket fd */
1448 int buffer_size; /**< the length of the receive buffer */
1449 char *buffer; /**< the receive data buffer */
1450 } bluetooth_l2cap_le_received_data_t;
1456 HTYPE_TRANS_HANDSHAKE,
1457 HTYPE_TRANS_HID_CONTROL,
1458 HTYPE_TRANS_GET_REPORT,
1459 HTYPE_TRANS_SET_REPORT,
1460 HTYPE_TRANS_GET_PROTOCOL,
1461 HTYPE_TRANS_SET_PROTOCOL,
1463 HTYPE_TRANS_UNKNOWN,
1464 HTYPE_TRANS_GET_IDLE = 0xF0,
1465 HTYPE_TRANS_SET_IDLE = 0xF1,
1466 } bt_hid_header_type_t;
1472 PTYPE_DATA_RTYPE_INPUT,
1473 PTYPE_DATA_RTYPE_OUTPUT
1474 } bt_hid_param_type_t;
1477 * Stucture to hid receive data
1480 const char *address;
1481 bt_hid_header_type_t type;
1482 /**< Header type containing */
1483 bt_hid_param_type_t param;
1484 /**< Param type in header like INPUT Report or OutPut Report */
1485 int buffer_size;/**< the length of the receive buffer */
1487 /**< the receive data buffer */
1488 } bluetooth_hid_received_data_t;
1491 * Stucture to rfcomm connection
1495 int socket_fd; /**< the socket fd */
1496 int server_id; /* Server id */
1497 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1498 bluetooth_device_address_t device_addr;
1499 /**< device address */
1500 char uuid[BLUETOOTH_UUID_STRING_MAX];
1501 } bluetooth_rfcomm_connection_t;
1504 * Stucture to rfcomm disconnection
1508 /**< the socket fd */
1509 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1510 bluetooth_device_address_t device_addr;
1511 /**< device address */
1512 char uuid[BLUETOOTH_UUID_STRING_MAX];
1513 } bluetooth_rfcomm_disconnection_t;
1517 /**< the socket fd */
1518 bluetooth_device_address_t device_addr;
1519 /**< device address */
1520 } bluetooth_rfcomm_connection_request_t;
1523 * Stucture to l2cap_le connection
1526 int socket_fd; /**< the socket fd */
1527 int server_id; /* Server id */
1528 int device_role; /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1529 bluetooth_device_address_t device_addr; /**< device address */
1531 } bluetooth_l2cap_le_connection_t;
1534 * Stucture to l2cap_le disconnection
1537 int socket_fd; /**< the socket fd */
1539 /** < Device role - L2CAP_LE_ROLE_SERVER or L2CAP_LE_ROLE_CLIENT */
1540 bluetooth_device_address_t device_addr; /**< device address */
1542 } bluetooth_l2cap_le_disconnection_t;
1545 * Stucture to l2cap_le connection request
1548 int socket_fd; /**< the socket fd */
1549 bluetooth_device_address_t device_addr; /**< device address */
1550 } bluetooth_l2cap_le_connection_request_t;
1559 } bt_hdp_qos_type_t;
1565 HDP_ROLE_SOURCE = 0x0,
1567 } bt_hdp_role_type_t;
1571 * Stucture to HDP connected
1574 const char *app_handle; /**< the application handle */
1575 unsigned int channel_id; /**< the channel id */
1576 bt_hdp_qos_type_t type; /**< the QOS type */
1577 bluetooth_device_address_t device_address; /**< the remote address */
1578 } bt_hdp_connected_t;
1581 * Stucture to HDP disconnected
1584 unsigned int channel_id; /**< the channel id */
1585 bluetooth_device_address_t device_address; /**< the remote address */
1586 } bt_hdp_disconnected_t;
1589 * Stucture to HDP data indication
1592 unsigned int channel_id; /**< the channel id */
1593 const char *buffer; /**< the RX data buffer */
1594 unsigned int size; /**< the RX data size */
1595 } bt_hdp_data_ind_t;
1598 * Stucture to OPP client transfer information
1605 } bt_opc_transfer_info_t;
1607 /* TODO: MAP client structures, see above */
1609 * Stucture to Map filter fields
1614 } bt_map_list_filter_fields_info_t;
1616 /* Obex Server transfer type */
1617 #define TRANSFER_PUT "PUT"
1618 #define TRANSFER_GET "GET"
1620 * Stucture to OPP/FTP Server authorize information
1627 } bt_obex_server_authorize_into_t;
1635 } bt_obex_server_type_t;
1638 * Stucture to OPP/FTP server transfer information
1646 unsigned long file_size;
1648 bt_obex_server_type_t server_type;
1650 unsigned char *contact_auth_info;
1651 } bt_obex_server_transfer_info_t;
1654 * Stucture to OPP/FTP server connection/disconnection information
1660 } bt_obex_server_connection_info_t;
1664 * Stucture to OOB data
1668 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1669 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1670 unsigned int hash_len;
1671 unsigned int randomizer_len;
1673 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1674 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1675 unsigned int hash256_len;
1676 unsigned int randomizer256_len;
1678 unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1679 unsigned int eir_len;
1683 * Structure to GATT attribute handle data
1689 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1690 int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1691 } bt_gatt_handle_info_t;
1694 * Structure to a most basic GATT attribute handle data
1698 unsigned char uuid[16];
1699 char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1700 } bt_gatt_handle_property_t;
1703 * Structure to GATT Remote service data
1710 bt_gatt_handle_info_t include_handles;
1711 bt_gatt_handle_info_t char_handle;
1712 bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device */
1713 } bt_gatt_service_property_t;
1716 * Structure to GATT Remote characteristic data
1720 char *service_handle;
1721 bt_gatt_handle_info_t handle_info;
1722 } bt_gatt_discovered_char_t;
1725 * Structure to format of GATT Characteristic Value
1729 unsigned char format;
1730 unsigned char exponent;
1731 unsigned short unit;
1732 unsigned char name_space;
1733 unsigned short description;
1734 } bt_gatt_char_format_t;
1737 * Structure to GATT Characteristic property
1745 bt_gatt_char_format_t format;
1747 unsigned int val_len;
1748 unsigned int permission;
1749 char *representation;
1750 bt_gatt_handle_info_t char_desc_handle;
1751 bt_gatt_handle_property_t prop; /* Added Char UUID, instance_id */
1752 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1753 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1754 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1755 } bt_gatt_char_property_t;
1758 * Structure to GATT Characteristic descriptor property
1765 unsigned int val_len;
1766 bt_gatt_handle_property_t prop; /* Added Descriptor UUID, instance_id */
1767 bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1768 bt_gatt_handle_property_t svc_prop; /* Added Service UUID, instance_id */
1769 char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1770 char address[BLUETOOTH_ADDRESS_STRING_LENGTH]; /* Added */
1771 } bt_gatt_char_descriptor_property_t;
1774 * Structure to GATT Characteristic value
1781 } bt_gatt_char_value_t;
1784 unsigned char UUID[16];
1788 } bt_gatt_notify_req_t ;
1791 * Structure to GATT Read Request
1795 char *service_handle;
1799 } bt_gatt_read_req_t;
1802 * Structure to GATT Value change
1806 char *service_handle;
1809 gboolean response_needed;
1813 } bt_gatt_value_change_t;
1816 bluetooth_device_address_t device_addr;
1818 bluetooth_gatt_service_change_type_t change_type;
1821 } bt_gatt_service_change_t;
1824 * Structure to GATT characteristc Notification change
1828 char *service_handle;
1829 gboolean att_notify;
1830 } bt_gatt_char_notify_change_t;
1833 * Structure to Indication confirmation
1837 char *service_handle;
1840 } bt_gatt_indicate_confirm_t;
1843 * Structure for GATT response data
1850 } bt_gatt_resp_data_t;
1853 * Structure to RSSI Signal Strength Alert
1864 * Structure to RSSI Signal Strength
1874 * Structure for RSSI Enabled or Disabled
1880 gboolean rssi_enabled;
1881 } bt_rssi_enabled_t;
1884 * Structure for RSSI Threshold
1889 int in_range_threshold;
1891 } bt_rssi_threshold_t;
1895 * Structure for Suppoted Profiles and Trusted Profiles
1902 } bt_supported_profile_trusted_t;
1905 * Structure for PBAP Folder Parameters
1908 unsigned char addressbook;
1909 unsigned char folder_type;
1913 * Structure for PBAP Pull application Parameters
1916 unsigned char format;
1917 unsigned char order;
1918 unsigned short offset;
1919 unsigned short maxlist;
1920 long long unsigned fields;
1921 } bt_pbap_pull_parameters_t;
1924 * Structure for PBAP List application Parameters
1927 unsigned char order;
1928 unsigned short offset;
1929 unsigned short maxlist;
1930 } bt_pbap_list_parameters_t;
1933 * Structure for PBAP Pull vCard application Parameters
1936 unsigned char format;
1937 long long unsigned fields;
1939 } bt_pbap_pull_vcard_parameters_t;
1942 * Structure for PBAP Search application Parameters
1945 unsigned char order;
1946 unsigned short offset;
1947 unsigned short maxlist;
1948 unsigned char search_attribute;
1949 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1950 } bt_pbap_search_parameters_t;
1953 * Structure for PBAP Connection Status
1956 bluetooth_device_address_t btaddr;
1958 } bt_pbap_connected_t;
1961 * Structure for PBAP Phonebook Size
1964 bluetooth_device_address_t btaddr;
1966 } bt_pbap_phonebook_size_t;
1969 * Structure for PBAP Phonebook Pull
1972 bluetooth_device_address_t btaddr;
1975 } bt_pbap_phonebook_pull_t;
1978 * Structure for PBAP vCard List
1981 bluetooth_device_address_t btaddr;
1985 } bt_pbap_vcard_list_t;
1988 * Structure for PBAP vCard Pull
1991 bluetooth_device_address_t btaddr;
1994 } bt_pbap_vcard_pull_t;
1997 * Structure for PBAP Phonebook search List
2000 bluetooth_device_address_t btaddr;
2004 } bt_pbap_phonebook_search_list_t;
2007 * Stucture to HF Call status information
2011 char *number; /*Phone Number */
2012 int direction; /*Direction :Incoming(1), Outgoing(0)*/
2013 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
2014 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
2015 int idx; /*Call index/ID */
2016 } bt_hf_call_status_info_t;
2021 } bt_hf_call_list_s;
2027 TRUSTED_PROFILE_PBAP = 1,
2028 TRUSTED_PROFILE_MAP,
2029 TRUSTED_PROFILE_SAP,
2030 TRUSTED_PROFILE_HFP_HF,
2031 TRUSTED_PROFILE_A2DP,
2032 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
2033 } bluetooth_trusted_profile_t;
2036 * Structure for LE data length change params
2039 bluetooth_device_address_t device_address;
2040 guint16 max_tx_octets;
2041 guint16 max_tx_time;
2042 guint16 max_rx_octets;
2043 guint16 max_rx_time;
2044 } bt_le_data_length_params_t;
2047 * Structure for proximity property change params
2050 bluetooth_device_address_t device_address;
2054 } bt_pxp_property_changed_params_t;
2057 * @brief DPM BT allowance state
2061 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
2062 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
2063 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
2064 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
2068 * @brief DPM API result
2072 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
2073 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
2074 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
2075 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
2076 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
2077 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
2081 * @brief DPM Policy status
2085 BLUETOOTH_DPM_STATUS_ERROR = -1,
2087 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
2088 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
2090 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
2091 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
2093 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
2094 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
2098 /* policy-group : BLUETOOTH */
2099 BLUETOOTH_DPM_POLICY_ALLOW,
2100 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2101 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2102 BLUETOOTH_DPM_POLICY_DEVICES_ALLOWLIST,
2103 BLUETOOTH_DPM_POLICY_DEVICES_BLOCKLIST,
2104 BLUETOOTH_DPM_POLICY_UUIDS_ALLOWLIST,
2105 BLUETOOTH_DPM_POLICY_UUIDS_BLOCKLIST,
2106 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2107 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2108 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2109 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2110 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2111 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2112 BLUETOOTH_DPM_POLICY_END,
2113 } bt_dpm_policy_cmd_t;
2116 struct bt_dpm_policy {
2122 typedef struct bt_dpm_policy bt_dpm_policy_t;
2125 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2126 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2127 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2128 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2129 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2130 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2131 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2132 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2133 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2134 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2135 BLUETOOTH_DPM_PROFILE_NONE,
2138 struct bt_dpm_profile_val {
2139 int value; /* tells whether the profile is enabled or disabled */
2141 typedef struct dpm_profile_val dpm_profile_state_t;
2144 * Structure to DPM device list
2148 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2149 } bt_dpm_device_list_t;
2152 * Structure to DPM uuid list
2156 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2157 } bt_dpm_uuids_list_t;
2160 * Structure for IPSP Interface Info
2163 bluetooth_device_address_t btaddr;
2165 } bt_ipsp_connection_info_t;
2169 char* remote_address;
2170 } bt_map_client_session_info_s;
2172 typedef char* bt_map_client_message_object_t;
2177 } bt_map_client_list_folders_filter_t;
2182 int8_t subject_length;
2191 } bt_map_client_list_messages_filter_t;
2194 bt_map_client_message_object_t message_object;
2199 char *sender_address;
2202 char *recipient_address;
2207 int64_t attachment_size;
2212 } bt_map_client_message_item_t;
2218 } bt_map_client_push_message_args_t;
2225 char *sender_address;
2228 char *recipient_address;
2237 } bt_map_client_message_t;
2240 char **names; // holding %size null-terminated folder names
2242 } bt_map_client_folders_s;
2245 bt_map_client_message_item_t *message_items;
2247 } bt_map_client_message_items_s;
2250 const char* target_file;
2252 } bt_get_message_callback_data;
2255 * Callback pointer type
2257 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2260 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2261 * @brief Set the callback function pointer for bluetooth event
2264 * This API will register the callback function, when any response and event are received from
2265 * bluetooth framework. @n
2266 * this registered callback function will be get called with appropriate event and data structures.
2267 * This function is a synchronous call. An application developer can call
2268 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2269 * type. This registered function will receive events of bluetooth_event_type_t type along with
2273 * @param[in] callback_ptr A pointer to the callback function
2274 * @param[in] user_data A pointer to user data
2275 * @return BLUETOOTH_ERROR_NONE - Success
2279 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2281 GMainLoop *main_loop = (GMainLoop*) user_data;
2285 // Code for each event
2287 g_main_loop_quit(main_loop);
2294 GMainLoop *main_loop = NULL;
2297 main_loop = g_main_loop_new(NULL, FALSE);
2298 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2299 if (ret >= BLUETOOTH_ERROR_NONE)
2301 // bluetooth_register_callback returned Success
2305 // bluetooth_register_callback returned failiure
2307 g_main_loop_run(main_loop);
2311 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2314 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2315 * @brief Set the callback function pointer for bluetooth le event
2318 * This API will register the callback function, when any response and event are received from
2319 * bluetooth framework. @n
2320 * this registered callback function will be get called with appropriate event and data structures.
2321 * This function is a synchronous call. An application developer can call
2322 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2323 * type. This registered function will receive events of bluetooth_event_type_t type along with
2327 * @param[in] callback_ptr A pointer to the callback function
2328 * @param[in] user_data A pointer to user data
2329 * @return BLUETOOTH_ERROR_NONE - Success
2333 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2336 * @fn int bluetooth_le_unregister_callback(void)
2337 * @brief Set the callback function pointer for bluetooth le event
2340 * This API will register the callback function, when any response and event are received from
2341 * bluetooth framework. @n
2342 * this registered callback function will be get called with appropriate event and data structures.
2343 * This function is a synchronous call. An application developer can call
2344 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2345 * type. This registered function will receive events of bluetooth_event_type_t type along with
2350 * @return BLUETOOTH_ERROR_NONE - Success
2354 int bluetooth_le_unregister_callback(void);
2357 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2358 * @brief Set the callback function pointer for bluetooth event
2361 * This API will register the callback function, when any response and event are received from
2362 * bluetooth framework. @n
2363 * this registered callback function will be get called with appropriate event and data structures.
2364 * This function is a synchronous call. An application developer can call
2365 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2366 * type. This registered function will receive events of bluetooth_event_type_t type along with
2371 * @return BLUETOOTH_ERROR_NONE - Success
2375 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2377 GMainLoop *main_loop = (GMainLoop*) user_data;
2381 // Code for each event
2383 g_main_loop_quit(main_loop);
2390 GMainLoop *main_loop = NULL;
2393 main_loop = g_main_loop_new(NULL, FALSE);
2394 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2395 if (ret >= BLUETOOTH_ERROR_NONE)
2397 // bluetooth_register_callback returned Success
2401 // bluetooth_register_callback returned failiure
2403 ret = bluetooth_deregister_callback(void);
2404 g_main_loop_run(main_loop);
2408 int bluetooth_unregister_callback(void);
2411 * @fn int bluetooth_enable_adapter(void)
2412 * @brief Enable the Bluetooth H/W
2415 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2416 * send request to bluetooth chip for activation.
2417 * This function is typically called at startup or when Bluetooth services are required. This
2418 * function must be called before calling any other API of Bluetooth operations.
2420 * Before performing any operations like Device discover, service search etc.., the adapter must be
2423 * This function is a asynchronous call.
2424 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2425 * through registered callback function with appropriate result code
2426 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2427 * BLUETOOTH_ERROR_NONE - Success \n
2429 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2430 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2432 * @return BLUETOOTH_ERROR_NONE - Success\n
2433 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2434 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2435 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2436 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2438 * @see bluetooth_check_adapter, bluetooth_disable_adapter
2440 void bt_event_callback(int event, bluetooth_event_param_t *param)
2444 case BLUETOOTH_EVENT_ENABLED:
2445 if (param->result == BLUETOOTH_ERROR_NONE)
2447 // Successfully Enabled
2460 ret = bluetooth_enable_adapter();
2464 int bluetooth_enable_adapter(void);
2467 * @fn int bluetooth_disable_adapter(void)
2468 * @brief Disable the Bluetooth H/W
2471 * This function disables Bluetooth protocol stack and hardware. This function is called when
2472 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2474 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2475 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2476 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2478 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2481 * This function is a asynchronous call.
2482 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2483 * through registered callback function.
2486 * @return BLUETOOTH_ERROR_NONE - Success\n
2487 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2488 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2489 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2491 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2493 void bt_event_callback(int event, bluetooth_event_param_t *param)
2497 case BLUETOOTH_EVENT_DISABLED:
2498 if (param->result == BLUETOOTH_ERROR_NONE)
2500 // Successfully disabled
2513 ret = bluetooth_disable_adapter();
2516 int bluetooth_disable_adapter(void);
2517 int bluetooth_read_battery_data(bt_battery_data *latest);
2518 int bluetooth_set_battery_monitor_state(bool state);
2519 int bluetooth_get_battery_monitor_state(void);
2520 int bluetooth_recover_adapter(void);
2521 int bluetooth_check_adapter_le(void);
2522 int bluetooth_enable_adapter_le(void);
2524 int bluetooth_disable_adapter_le(void);
2525 int bluetooth_get_uuid_name(const char *uuid, char **name);
2528 * @fn int bluetooth_reset_adapter(void)
2529 * @brief Reset the Bluetooth H/W and values
2532 * This function resets Bluetooth protocol stack and hardware. This function is called when
2533 * an user want to initialize Bluetooth environment.
2535 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2538 * This function is a synchronous call.
2540 * @return BLUETOOTH_ERROR_NONE - Success\n
2541 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2543 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2548 ret = bluetooth_reset_adapter();
2551 int bluetooth_reset_adapter(void);
2554 * @fn int bluetooth_is_supported(void)
2555 * @brief Check if the bluetooth is supported or not by the current target
2557 * This API checks whether the bluetooth is supported or not.
2558 * This API only run by root permission.
2560 * This function is a synchronous call.
2562 * @return 0 - if bluetooth is not supported\n
2563 * 1 - if bluetooth is supported\n
2564 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2569 ret = bluetooth_is_supported();
2572 int bluetooth_is_supported(void);
2576 * @fn int bluetooth_check_adapter(void)
2577 * @brief Check the current status of the Bluetooth adapter
2580 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2581 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2582 * bluetooth adapter.
2583 * This API get the adapter internal data structure and check current adapter status.
2585 * This function is a synchronous call.
2588 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2589 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2591 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2595 ret = bluetooth_check_adapter();
2598 int bluetooth_check_adapter(void);
2601 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2602 * @brief Get the local adapter bluetooth address
2605 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2606 * the adapter should be enabled.
2607 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2608 * contain Bluetooth address.
2609 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2610 * friendly name for each device.
2611 * There is no event callback for this API.
2613 * This function is a synchronous call.
2616 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2617 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2618 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2619 * @param[out] local_address a device address of local bluetooth adapter
2624 bluetooth_device_address_t local_address={0,};
2627 ret = bluetooth_get_local_address(&local_address);
2630 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2633 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2634 * @brief Get the hci version
2637 * This function is used to get the bluetooth hci version
2638 * Before calling this API make sure that the adapter is enabled.
2640 * This function is a synchronous call.
2643 * @return BLUETOOTH_ERROR_NONE - Success \n
2644 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2645 * @param[out] timeout remain visibility timeout value
2648 bluetooth_version_t *version;
2650 ret = bluetooth_get_local_version (&version);
2653 int bluetooth_get_local_version(bluetooth_version_t *version);
2656 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2657 * @brief Get the local device name
2660 * This function is used, get the local device name. Since its difficult to remember the Adapter
2661 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2662 * friendly name is retrived by the remote device and displaying.
2663 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2665 * This function is a synchronous call.
2668 * @return BLUETOOTH_ERROR_NONE - Success \n
2669 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2670 * @param[out] local_name a local device name
2674 bluetooth_device_name_t local_name={0,}
2676 ret = bluetooth_get_local_name (&local_name);
2679 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2682 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2683 * @brief Set the local device name
2686 * This function is used to set the local device name. This is a human friendly name whose
2687 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2689 * This function is a synchronous call.
2691 * @param[in] local_name bluetooth device name to set local device
2693 * @return BLUETOOTH_ERROR_NONE - Success \n
2694 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2695 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2696 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2697 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2698 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2703 bluetooth_device_name_t local_name={0,}
2705 ret = bluetooth_set_local_name (&local_name);
2708 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2712 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2713 * @brief Check if the uuid is used or not
2715 * This function is used to check if the uuid is used or not.
2717 * This function is a synchronous call.
2719 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2720 * @param[out] used if the uuid is used or not
2722 * @return BLUETOOTH_ERROR_NONE - Success \n
2723 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2724 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2725 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2730 gboolean used = FALSE;
2731 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2732 ret = bluetooth_is_service_used(uuid, &used);
2735 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2738 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2739 * @brief Check if the device is connected to the specific service
2741 * This function is used to check if if the device is connected to the specific service.
2743 * This function is a synchronous call.
2745 * @param[in] local_address a device address of remote bluetooth device
2746 * @param[in] type the service type
2747 * @param[out] is_connected if the device is connected or not
2749 * @return BLUETOOTH_ERROR_NONE - Success \n
2750 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2751 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2752 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2757 gboolean is_connected = FALSE;
2758 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2759 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2762 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2763 bluetooth_service_type_t type,
2764 gboolean *is_connected);
2767 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2768 * @brief Gets device's connected link type
2770 * This function is used to get device's connected link type
2772 * This function is a synchronous call.
2774 * @param[in] device_address a device address of remote bluetooth device
2775 * @param[out] connected_link a device's connected link type
2777 * @return BLUETOOTH_ERROR_NONE - Success \n
2778 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2779 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2780 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2785 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2786 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2787 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2790 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2791 bluetooth_connected_link_t *connected_link);
2794 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2795 * @brief Sets a profile trusted for a device
2797 * This function is used to Set a profile as trusted for a device
2799 * This function is a synchronous call.
2801 * @param[in] device_address a device address of remote bluetooth device
2802 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2803 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2805 * @return BLUETOOTH_ERROR_NONE - Success \n
2806 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2807 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2808 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2812 int bluetooth_set_profile_trusted(
2813 const bluetooth_device_address_t *device_address,
2814 int profile, int trust);
2817 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2818 * @brief Gets a profile is trusted for a device
2820 * This function is used to Get a profile is trusted or not for a device
2822 * This function is a synchronous call.
2824 * @param[in] device_address a device address of remote bluetooth device
2825 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2826 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2828 * @return BLUETOOTH_ERROR_NONE - Success \n
2829 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2830 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2831 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2835 int bluetooth_get_profile_trusted(
2836 const bluetooth_device_address_t *device_address,
2837 int profile, int *trust);
2840 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2841 * @brief Get the visibility mode
2844 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2845 * visibity mode, the property of the device is determined whether it can be discoverable, non
2846 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2848 * This function is a synchronous call.
2851 * @return BLUETOOTH_ERROR_NONE - Success \n
2852 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2853 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2854 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2855 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2856 * @param[out] discoverable_mode current bluetooth discoverable mode
2858 * @see bluetooth_set_discoverable_mode
2860 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2862 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2865 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2868 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2870 * @brief Set the visibility mode
2873 * This function is used to set the discoverable mode (Visibility option).
2875 * Many times user may want to keep his device discoverable so that when peer device is performing
2876 * device search, he/she can find user's device. Application programmer can keep the mode as
2877 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2878 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2879 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2880 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2882 * This function is a synchronous call.
2884 * @return BLUETOOTH_ERROR_NONE - Success \n
2885 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2887 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2888 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2890 * @see bluetooth_get_discoverable_mode
2894 bluetooth_discoverable_mode_t mode;
2896 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2897 ret = bluetooth_set_discoverable_mode (mode, 180);
2901 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2906 * @fn int bluetooth_get_timeout_value(int *timeout)
2907 * @brief Get the visibility timeout value
2910 * This function is used to get the visibility timeout
2911 * Before calling this API make sure that the adapter is enabled.
2913 * This function is a synchronous call.
2916 * @return BLUETOOTH_ERROR_NONE - Success \n
2917 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2918 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2919 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2920 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2921 * @param[out] timeout remain visibility timeout value
2923 * @see bluetooth_set_discoverable_mode
2927 ret = bluetooth_get_timeout_value (&timeout);
2930 int bluetooth_get_timeout_value(int *timeout);
2934 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2935 * unsigned int classOfDeviceMask)
2936 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2938 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2939 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2940 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2941 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2942 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2943 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2944 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2945 * please see bluetooth_device_info_t for more details.
2948 * This API provides searching options like max responses, discovery duration in seconds and class
2949 * of device mask to filter device search. some times there may be too many bluetooth devices in
2950 * vicinity of your device.in such scenario, application can request to reduce number of responces
2951 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2952 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2953 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2954 * application defined time. please note that discovery_duration should be mentioned in seconds.
2955 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2958 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2959 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2960 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2962 * This function is a asynchronous call.
2963 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2964 * through registered callback function.
2966 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2967 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2969 * The completion or cancellation of the discovery is indicated by an
2970 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2972 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2975 * @return BLUETOOTH_ERROR_NONE - Success \n
2976 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2977 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2978 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2979 agent is not running \n
2981 * @param[in] max_response define the maximum response of the number of founded devices
2983 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2984 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2985 (refer to class of device)
2987 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2990 void bt_event_callback(int event, bluetooth_event_param_t *param)
2994 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2996 bluetooth_device_info_t *device_info = NULL;
2997 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2999 device_info = (bluetooth_device_info_t *)param->param_data;
3000 memcpy(&searched_device, &device_info->device_address,
3001 sizeof(bluetooth_device_address_t));
3002 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3003 device_info->device_address.addr[0],
3004 device_info->device_address.addr[1],
3005 device_info->device_address.addr[2],
3006 device_info->device_address.addr[3],
3007 device_info->device_address.addr[4],
3008 device_info->device_address.addr[5]);
3011 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
3013 bluetooth_device_info_t *device_info = NULL;
3014 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
3016 device_info = (bluetooth_device_info_t *)param->param_data;
3017 memcpy(&searched_device, &device_info->device_address,
3018 sizeof(bluetooth_device_address_t));
3019 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3020 device_info->device_name.name,
3021 device_info->device_address.addr[0],
3022 device_info->device_address.addr[1],
3023 device_info->device_address.addr[2],
3024 device_info->device_address.addr[3],
3025 device_info->device_address.addr[4],
3026 device_info->device_address.addr[5]);
3030 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3031 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3036 unsigned short max_response;
3037 unsigned short discovery_duration;
3038 unsigned classOfDeviceMask;
3042 discovery_duration =0;
3043 classOfDeviceMask =0;
3045 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
3050 int bluetooth_start_discovery(unsigned short max_response,
3051 unsigned short discovery_duration,
3052 unsigned int classOfDeviceMask);
3055 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
3056 * unsigned short max_response,
3057 * unsigned short discovery_duration,
3058 * unsigned int classOfDeviceMask)
3059 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
3061 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
3062 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
3063 * Please see bluetooth_start_discovery() for other parameters description.
3065 * This function is a asynchronous call.
3066 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
3067 * through registered callback function.
3069 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
3070 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
3072 * The completion or cancellation of the discovery is indicated by an
3073 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
3075 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
3078 * @return BLUETOOTH_ERROR_NONE - Success \n
3079 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3080 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3081 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
3082 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3083 agent is not running \n
3085 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
3086 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
3087 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
3088 * @param[in] max_response define the maximum response of the number of founded devices
3090 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
3091 * @param[in] classOfDeviceMask define classes of the device mask which user wants
3092 (refer to class of device)
3094 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3097 unsigned short type;
3098 unsigned short max_response;
3099 unsigned short discovery_duration;
3100 unsigned classOfDeviceMask;
3105 discovery_duration =0;
3106 classOfDeviceMask =0;
3108 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3113 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3114 unsigned short max_response,
3115 unsigned short discovery_duration,
3116 unsigned int classOfDeviceMask);
3119 * @fn int bluetooth_cancel_discovery (void)
3120 * @brief Cancel the on-going device discovery operation
3123 * This function stops the on-going device discovery operation. This API has to be called after the
3124 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3125 * the bluetooth_start_discovery API
3127 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3128 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3129 * cancel the discover request once the user received the device to which he wish to connect.
3131 * This function is a asynchronous call.
3132 * If the call is success to cancel discovey then the application will receive
3133 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3134 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3135 * BLUETOOTH_ERROR_NONE
3138 * @return BLUETOOTH_ERROR_NONE - Success \n
3139 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3140 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3141 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3142 other application \n
3143 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3145 * @see bluetooth_start_discovery
3147 void bt_event_callback(int event, bluetooth_event_param_t *param)
3151 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3152 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3161 ret = bluetooth_cancel_discovery();
3164 int bluetooth_cancel_discovery(void);
3167 * @fn int bluetooth_start_le_discovery(void)
3168 * @brief Start the generic device discovery which finds the LE devices.
3170 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3171 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3172 * It try to find LE devices. Bluetooth device address and name are
3173 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3174 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3175 * You will receive device address, device name, device class, rssi (received signal strength indicator).
3176 * please see bluetooth_device_info_t for more details.
3178 * This function is a asynchronous call.
3179 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3180 * through registered callback function.
3182 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3185 * The completion or cancellation of the discovery is indicated by an
3186 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3188 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3191 * @return BLUETOOTH_ERROR_NONE - Success \n
3192 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3193 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3194 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3195 agent is not running \n
3198 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
3201 void bt_event_callback(int event, bluetooth_event_param_t *param)
3205 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3207 bluetooth_device_info_t *device_info = NULL;
3208 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3210 device_info = (bluetooth_device_info_t *)param->param_data;
3211 memcpy(&searched_device, &device_info->device_address,
3212 sizeof(bluetooth_device_address_t));
3213 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3214 device_info->device_address.addr[0],
3215 device_info->device_address.addr[1],
3216 device_info->device_address.addr[2],
3217 device_info->device_address.addr[3],
3218 device_info->device_address.addr[4],
3219 device_info->device_address.addr[5]);
3223 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3224 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3230 ret = bluetooth_start_discovery();
3235 int bluetooth_start_le_discovery(void);
3238 * @fn int bluetooth_stop_le_discovery (void)
3239 * @brief Cancel the on-going device LE discovery operation
3242 * This function stops the on-going device discovery operation. This API has to be called after the
3243 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3244 * the bluetooth_start_le_discovery API
3247 * This function is a asynchronous call.
3248 * If the call is success to cancel discovey then the application will receive
3249 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3250 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3251 * BLUETOOTH_ERROR_NONE
3254 * @return BLUETOOTH_ERROR_NONE - Success \n
3255 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3256 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3257 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3258 other application \n
3259 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3261 * @see bluetooth_start_discovery
3263 void bt_event_callback(int event, bluetooth_event_param_t *param)
3267 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3268 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3277 ret = bluetooth_stop_le_discovery();
3280 int bluetooth_stop_le_discovery(void);
3283 * @fn int bluetooth_is_discovering(void)
3284 * @brief Check for the device discovery is in-progress or not.
3286 * This API is used to check the current status of the Discovery operation.If discovery is in\
3287 * progress normally other operations are not allowed.
3288 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3289 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3290 * event before performing other operations. This API is used to get for the current discovery
3291 * operation status and using bluetooth_cancel_discovery()
3292 * we can cancell the ongoing discovery process.
3293 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3296 * This function checks whether the device discovery is started or not.
3298 * This function is a synchronous call.
3301 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3302 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3303 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3306 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
3310 ret = bluetooth_is_discovering ();
3313 int bluetooth_is_discovering(void);
3316 * @fn int bluetooth_is_le_discovering(void)
3317 * @brief Check for the device LE discovery is in-progress or not.
3319 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3320 * progress normally other operations are not allowed.
3321 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3322 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3323 * event before performing other operations. This API is used to get for the current discovery
3324 * operation status and using bluetooth_stop_le_discovery()
3325 * we can cancell the ongoing LE discovery process.
3326 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3329 * This function checks whether the device LE discovery is started or not.
3331 * This function is a synchronous call.
3334 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3335 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3336 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3339 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3343 ret = bluetooth_is_le_discovering ();
3346 int bluetooth_is_le_discovering(void);
3349 * @fn int bluetooth_is_le_scanning(void)
3350 * @brief Check for the device LE scan is in-progress or not.
3352 * This API is used to check the current status of the LE Scan operation.If discovery is in\
3353 * progress normally other operations are not allowed.
3355 * This function checks whether the device LE Scan is started or not.
3357 * This function is a synchronous call.
3359 * @return TRUE - LE Scan in progress \n
3360 * FALSE - LE Scan is not in progress \n
3365 gboolean is_le_scanning = 0;
3366 is_le_scanning = bluetooth_is_le_scanning ();
3369 gboolean bluetooth_is_le_scanning(void);
3371 int bluetooth_is_scan_filter_supported(gboolean *is_supported);
3374 * @fn int bluetooth_force_hcidump(int timeout)
3375 * @brief Enable /disable force-hcidump
3377 * This function control force-hcidump.
3379 * This function is a synchronous call.
3381 * @return BLUETOOTH_ERROR_NONE - Success \n
3382 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3383 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3385 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
3390 int bluetooth_force_hcidump(int timeout);
3393 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3394 * @brief Register scan filter.
3396 * This function registers the scan filter.
3398 * This function is a synchronous call.
3400 * @return BLUETOOTH_ERROR_NONE - Success \n
3402 * @param[in] filter scan filter to register
3406 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3409 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3410 int link_type, bt_rssi_threshold_t rssi_threshold)
3411 * @brief Enable RSSI monitoring
3413 * This function enables RSSI monitoring and sets threshold for a connection
3415 * @return BLUETOOTH_ERROR_NONE - Success \n
3418 * @see bluetooth_get_rssi_strength
3420 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3421 int link_type, bt_rssi_threshold_t *rssi_threshold);
3424 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3425 * @brief Gets Raw RSSI signal Strength
3427 * This function gives the Raw RSSI signal strength for a connection.
3429 * @return BLUETOOTH_ERROR_NONE - Success \n
3432 * @see bluetooth_enable_rssi
3434 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3436 int bluetooth_set_connectable(gboolean is_connectable);
3438 int bluetooth_is_connectable(gboolean *is_connectable);
3440 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3443 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3444 * @brief Initiate a bonding process
3447 * This function initiates a bonding procedure with a peer device. The bonding procedure
3448 * enables authentication and optionally encryption on the Bluetooth link.
3450 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3451 * inititate the bonding request to the devices already in the paired list.
3453 * Usually we call this API after the device discovery.
3454 * This function is a asynchronous call.
3456 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3457 * mentioed result code
3458 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3459 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3460 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3461 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3462 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3464 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3465 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3468 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3471 * @return BLUETOOTH_ERROR_NONE - Success \n
3472 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3473 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3474 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3475 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3477 * @param[in] device_address This indicates an address of the device with which the pairing
3478 * should be initiated
3480 * @see bluetooth_cancel_bonding
3482 void bt_event_callback(int event, bluetooth_event_param_t *param)
3486 case BLUETOOTH_EVENT_BONDING_FINISHED:
3488 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3489 if (param->result >= BLUETOOTH_ERROR_NONE)
3491 bluetooth_device_info_t *device_info = NULL;
3492 device_info = (bluetooth_device_info_t *)param->param_data;
3493 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3494 mjr[%#x] min[%#x] srv[%#x]",
3495 device_info->device_name.name,
3496 device_info->device_address.addr[0],
3497 device_info->device_address.addr[1],
3498 device_info->device_address.addr[2],
3499 device_info->device_address.addr[3],
3500 device_info->device_address.addr[4],
3501 device_info->device_address.addr[5],
3502 device_info->device_class.major_class,
3503 device_info->device_class.minor_class,
3504 device_info->device_class.service_class);
3518 bluetooth_device_address_t device_address={{0}};
3520 ret = bluetooth_bond_device(&device_address);
3524 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3527 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3528 * bluetooth_conn_type_t conn_type)
3529 * @brief Initiate a bonding process
3532 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3533 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3535 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3536 * inititate the bonding request to the devices already in the paired list.
3538 * Usually we call this API after the device discovery.
3539 * This function is a asynchronous call.
3541 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3542 * mentioed result code
3543 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3544 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3545 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3546 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3547 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3549 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3550 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3553 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3556 * @return BLUETOOTH_ERROR_NONE - Success \n
3557 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3558 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3559 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3560 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3562 * @param[in] device_address This indicates an address of the device with which pairing
3563 * should be initiated
3564 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3567 * @see bluetooth_cancel_bonding
3569 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3570 bluetooth_conn_type_t conn_type);
3573 * @fn int bluetooth_cancel_bonding(void)
3574 * @brief Cancel the on-going bonding process
3576 * This API is called to cancel the on-going bonding procedure. It should be called before the
3577 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3578 * This API is useful when the remote device is not responding to the bond request or we wish to
3579 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3581 * This function is a synchronous call.
3583 * @return BLUETOOTH_ERROR_NONE - Success \n
3584 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3585 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3588 * @see bluetooth_bond_device
3594 ret = bluetooth_cancel_bonding();
3597 int bluetooth_cancel_bonding(void);
3600 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3601 * @brief Remove bonding
3604 * To communicate with remote device over bluetooth link, user should bond with peer device.
3605 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3606 * API is used to remove peer device from the list. Please note that after removing the device
3607 * from bonded device list, you cannot communication with peer device until bonding happens again.
3609 * User can call this function by passing bluetooth device address of any bonded device. Please note
3610 * that after successful return of this function, any bluetooth application running on your device
3611 * will not be able to communicate with unbonded device until bond operation happens again using
3612 * bluetooth_bond_device()
3615 * This function is a asynchronous call. The request to remove the specified device from the bonded
3616 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3617 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3618 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3622 * @return BLUETOOTH_ERROR_NONE - Success \n
3623 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3624 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3625 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3626 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3627 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3628 * agent is not running \n
3629 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3632 * @param[in] device_address This indicates an address of the device to remove bonding
3636 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3639 void bt_event_callback(int event, bluetooth_event_param_t *param)
3642 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3643 bluetooth_device_address_t *dev_addr = NULL;
3645 if (param->result == BLUETOOTH_ERROR_NONE) {
3646 dev_addr = (bluetooth_device_address_t *)param->param_data;
3648 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3649 dev_addr->addr[0], dev_addr->addr[1]
3650 dev_addr->addr[2], dev_addr->addr[3]
3651 dev_addr->addr[4], dev_addr->addr[5]
3662 bluetooth_device_address_t *device_address;
3664 // copy valid device address in device_address
3666 ret = bluetooth_unbond_device(device_address);
3669 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3672 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3673 * @brief Get bonded(paired) device list
3676 * This API gets all bonded device list.
3677 * The devices in the bonded device list further can be used to perform the authorization by calling
3678 * bluetooth_authorize_device API.
3680 * This function is a synchronous call.
3681 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3682 * there is no valid information in the dev_list.
3683 * The len field in the dev_list represents the number of bonded devices. The data structure for
3684 * bonded device information is bluetooth_device_info_t.
3687 * @return BLUETOOTH_ERROR_NONE - Success \n
3688 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3690 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3692 void bt_get_bonded_devices(void)
3696 GPtrArray *devinfo = NULL;
3697 bluetooth_device_info_t *ptr;
3699 // allocate the g_pointer_array
3700 devinfo = g_ptr_array_new();
3702 ret = bluetooth_get_bonded_device_list(&devinfo);
3703 if (ret != BLUETOOTH_ERROR_NONE)
3705 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3709 printf("g pointer arrary count : [%d]", devinfo->len);
3710 for (i=0; i<devinfo->len; i++)
3712 ptr = g_ptr_array_index(devinfo, i);
3715 printf("Name [%s]\n", ptr->device_name.name);
3716 printf("Major Class [%d]\n", ptr->device_class.major_class);
3717 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3718 printf("Service Class [%d]\n", ptr->device_class.service_class);
3719 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3720 ptr->device_address.addr[0],
3721 ptr->device_address.addr[1], ptr->device_address.addr[2],
3722 ptr->device_address.addr[3],
3723 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3730 // free g_pointer_array
3731 g_ptr_array_free(devinfo, TRUE);
3736 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3738 int bluetooth_get_profile_connected_device_list(
3739 const char *profile_uuid, GPtrArray **addr_list);
3742 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3743 * bluetooth_device_info_t *dev_info)
3744 * @brief Get a bonded(paired) device
3747 * This API gets a bonded device.
3749 * This function is a synchronous call.
3750 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3751 * there is no valid information in the dev_info.
3752 * The data structure for bonded device information is bluetooth_device_info_t.
3755 * @return BLUETOOTH_ERROR_NONE - Success \n
3756 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3758 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3760 void bt_get_bonded_device(void)
3764 bluetooth_device_info_t devinfo = {0};
3765 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3767 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3768 if (ret != BLUETOOTH_ERROR_NONE)
3770 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3774 printf("Name [%s]\n", devinfo.device_name.name);
3775 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3776 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3777 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3778 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3779 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3780 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3781 devinfo.device_address.addr[5]);
3790 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3791 bluetooth_device_info_t *dev_info);
3794 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3795 * gboolean *is_alias_set)
3796 * @brief Get is_alias_set property of device
3798 * This API gets is_alias_set property of a bonded device.
3800 * This function is a synchronous call.
3801 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3802 * If not,there is no valid information in the is_alias_set.
3804 * @return BLUETOOTH_ERROR_NONE - Success \n
3805 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3810 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3812 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3815 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3816 gboolean *is_alias_set);
3819 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3820 * @brief set alias for bonded device
3823 * This function set alias for bonded device.
3825 * This function is a synchronous call.
3828 * @return BLUETOOTH_ERROR_NONE - Success \n
3829 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3830 * @param[in] device_address This indicates an address of the remote device
3831 * @param[in] alias This indicates an alias to set
3836 ret = bluetooth_set_alias(&remote_address);
3839 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3843 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3844 * @brief Get remote deivice
3847 * This function gets specific remote device.
3849 * This function is a asynchronous call.
3850 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3853 * @return BLUETOOTH_ERROR_NONE - Success \n
3854 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3855 * @param[in] device_address This indicates an address of the remote device
3860 ret = bluetooth_get_remote_device(&remote_address);
3863 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3866 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3867 * gboolean authorized)
3868 * @brief Authorize/Unauthorize a bonded device
3871 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3872 * with/without user confirmation.
3874 * If we select a paired device and make it authorized by calling this API with the authorized
3875 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3876 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3877 * then it will ask for the user conformation before the connection.
3879 * This API supposed to be called on the paired devices. Which means we have to use this API only
3880 * after successful pairing.
3882 * This function is a asynchronous call.
3883 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3885 * @return BLUETOOTH_ERROR_NONE - Success \n
3886 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3887 * @param[in] device_address This indicates an address of the device to authorize \n
3888 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3890 * @see bluetooth_get_bonded_device_list
3892 void bt_event_callback(int event, bluetooth_event_param_t *param)
3896 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3898 if (param->result == BLUETOOTH_ERROR_NONE)
3902 //device authorization failed failure
3910 bluetooth_device_address_t device_address={{0}};
3911 gboolean authorized;
3915 ret = bluetooth_authorize_device(&device_address,authorized);
3918 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3919 gboolean authorized);
3921 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3922 const bluetooth_device_pin_code_t *pin_code);
3924 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3927 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3929 * @brief Receives Legacy Passkey\pin with following authentication response types
3931 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3932 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3935 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3938 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3940 * @brief This API sends user confirmation reply to the local adapter.
3942 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3945 int bluetooth_passkey_confirmation_reply(gboolean reply);
3948 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3949 * @brief Get all services supported by remote device
3952 * This API call initiates the search for the services supported by the specified device. Normally
3953 * the service search will take a couple of seconds to get it completed. Before calling this API
3954 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3955 * perform the service search. We can get the device address by doing a device discovery operation.
3958 * This function is a asynchronous call.
3959 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3961 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3962 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3963 * event is generated with appropriate result code.
3965 * @return BLUETOOTH_ERROR_NONE - Success \n
3966 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3967 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3968 * @param[in] device_address This indicates an address of the device
3969 * whose services need to be found
3971 * @see bluetooth_cancel_service_search
3973 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3976 * @fn int bluetooth_cancel_service_search(void)
3977 * @brief Cancel the ongoing service search operation
3980 * This function cancel the ongoing service search operation. This API is usually calling after the
3981 * bluetooth_search_service API.
3982 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3983 * if the user wish to cancel the Ongoing service search operation.
3985 * This API should be called just after the bluetooth_search_service API and before the
3986 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3988 * This function is a synchronous call.
3990 * @return BLUETOOTH_ERROR_NONE - Success \n
3991 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3992 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3993 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3996 * @see bluetooth_search_service
4001 ret = bluetooth_cancel_service_search();
4004 int bluetooth_cancel_service_search(void);
4007 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
4008 * @brief Register rfcomm socket with a specific uuid
4011 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4012 * descriptor of the server.
4013 * This is the first API which is called to create the server. Once we created the server socket,
4014 * we will listen on that return socket.
4015 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
4018 * @return socket FD on Success \n
4019 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4020 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4021 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4022 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4023 * @param[in] UUID (128 bits)
4026 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
4030 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4031 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4035 int bluetooth_rfcomm_create_socket(const char *uuid);
4038 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
4039 * @brief Register rfcomm socket with a specific uuid
4042 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
4043 * descriptor of the server.
4044 * This is the first API which is called to create the server. Once we created the server socket,
4045 * we will listen on that return socket.
4046 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
4049 * @return socket FD on Success \n
4050 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4051 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
4052 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
4053 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4054 * @param[in] UUID (128 bits)
4055 * @param[in] bus_name (const char)
4056 * @param[in] path (const char)
4059 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
4063 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
4064 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
4068 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
4071 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
4072 * @brief De-register the rfcomm socket
4075 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
4076 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4077 * descriptor else no event will come. We will call this API only after the
4078 * bluetooth_rfcomm_listen_and_accept.
4079 * This is a synchronous call.
4081 * @return BLUETOOTH_ERROR_NONE - Success \n
4082 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4083 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4084 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4085 * @param[in] int socket_fd
4088 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
4091 void bt_event_callback(int event, bluetooth_event_param_t *param)
4095 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4097 bluetooth_rfcomm_connection_t *discon_ind =
4098 (bluetooth_rfcomm_connection_t *)param->param_data;
4100 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4108 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4109 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4111 ret = bluetooth_rfcomm_remove_socket(fd);
4114 int bluetooth_rfcomm_remove_socket(int socket_fd);
4117 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4118 * @brief De-register the rfcomm socket
4121 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4122 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4123 * descriptor else no event will come. We will call this API only after the
4124 * bluetooth_rfcomm_listen_and_accept_ex.
4125 * This is a synchronous call.
4127 * @return BLUETOOTH_ERROR_NONE - Success \n
4128 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4129 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4130 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4131 * @param[in] UUID (128 bits)
4134 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4137 void bt_event_callback(int event, bluetooth_event_param_t *param)
4141 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4143 bluetooth_rfcomm_connection_t *discon_ind =
4144 (bluetooth_rfcomm_connection_t *)param->param_data;
4146 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
4154 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4155 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4157 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4160 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4163 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4164 * @brief Disconnect rfcomm connection
4167 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4168 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4171 * @return BLUETOOTH_ERROR_NONE - Success \n
4172 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4173 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4174 * @param[in] int socket_fd the sending socket fd
4180 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4182 printf("Disconnection failed");
4184 printf("Disconnection Success");
4188 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4191 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4192 * @brief Rfcomm socket listen
4195 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4196 * after the bluetooth_rfcomm_create_socket API.
4197 * This API listen for the incomming connection and once it receives a connection, it will give
4198 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4199 * event to the application. This is an Asynchronous API call.
4202 * @return BLUETOOTH_ERROR_NONE - Success \n
4203 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4204 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4206 * @param[in] int socket_fd
4207 * @param[in] max pending connection.
4210 * @see bluetooth_rfcomm_create_socket
4213 void bt_event_callback(int event, bluetooth_event_param_t* param)
4217 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4219 bluetooth_rfcomm_connection_t *conn_ind =
4220 (bluetooth_rfcomm_connection_t *)param->param_data;
4222 printf("\nConnected from FD %d", conn_ind->socket_fd);
4230 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4231 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4235 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4238 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4239 * @brief Rfcomm socket listen
4242 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4243 * after the bluetooth_rfcomm_create_socket API.
4244 * This API listen for the incomming connection and once it receives a connection, it will give
4245 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4246 * event to the application. This is an Asynchronous API call.
4249 * @return BLUETOOTH_ERROR_NONE - Success \n
4250 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4251 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4253 * @param[in] int socket_fd
4254 * @param[in] max pending connection.
4259 * @see bluetooth_rfcomm_create_socket_ex
4262 void bt_event_callback(int event, bluetooth_event_param_t* param)
4266 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4268 bluetooth_rfcomm_connection_t *conn_ind =
4269 (bluetooth_rfcomm_connection_t *)param->param_data;
4271 printf("\nConnected from FD %d", conn_ind->socket_fd);
4279 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4280 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4285 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4288 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4289 * @brief Rfcomm socket listen
4292 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4293 * after the bluetooth_rfcomm_create_socket API.
4294 * This API listen for the incomming connection and once it receives a connection, it will give
4295 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4296 * event to the application. This is an Asynchronous API call.
4299 * @return BLUETOOTH_ERROR_NONE - Success \n
4300 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4301 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4303 * @param[in] int socket_fd
4304 * @param[in] max pending connection.
4307 * @see bluetooth_rfcomm_create_socket
4310 void bt_event_callback(int event, bluetooth_event_param_t* param)
4314 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4316 char *name = (char *)param->param_data;
4318 printf("\nConnected from %s", name);
4320 bluetooth_rfcomm_accept_connection();
4328 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4329 ret = bluetooth_rfcomm_listen(fd, 1);
4333 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4336 * @fn int bluetooth_rfcomm_accept_connection()
4337 * @brief Accepts the authorization request indicated by the event
4338 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4340 * This function is a synchronous call.
4342 * @return BLUETOOTH_ERROR_NONE - Success \n
4343 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4345 * @param[in] the socket fd of the server
4346 * @param[out] the socket fd of the client
4350 * @see bluetooth_rfcomm_reject_connection
4352 int bluetooth_rfcomm_accept_connection(int server_fd);
4355 * @fn int bluetooth_rfcomm_reject_connection()
4356 * @brief Rejects the authorization request indicated by the event
4357 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4359 * This function is a synchronous call.
4361 * @return BLUETOOTH_ERROR_NONE - Success \n
4362 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4364 * @param[in] the socket fd of the server
4368 * @see bluetooth_rfcomm_accept_connection
4370 int bluetooth_rfcomm_reject_connection(int server_fd);
4373 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4374 * @brief Informs whether rfcomm server uuid is available or not.
4376 * This function is a synchronous call.
4378 * @return TRUE - RFCOMM uuid is available \n
4379 * FALSE - RFCOMM uuid is not available \n
4381 * @param[in] uuid UUID string
4387 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4390 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4391 * const char *remote_uuid)
4392 * @brief Connect to the remote device rfcomm *
4394 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4395 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4396 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4397 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4398 * initiating a connection.
4400 * @return BLUETOOTH_ERROR_NONE - Success \n
4401 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4402 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4403 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4404 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4405 * @param[in] bluetooth_device_address_t remote bt_address
4406 * @param[in] char remote uuid
4408 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4412 void bt_event_callback(int event, bluetooth_event_param_t *param)
4416 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4418 if (param->result >= BLUETOOTH_ERROR_NONE)
4420 bt_sdp_info_t *bt_sdp_info=param->param_data;
4422 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4423 bt_sdp_info->device_addr.addr[0],
4424 bt_sdp_info->device_addr.addr[1],
4425 bt_sdp_info->device_addr.addr[2],
4426 bt_sdp_info->device_addr.addr[3],
4427 bt_sdp_info->device_addr.addr[4],
4428 bt_sdp_info->device_addr.addr[5]);
4430 printf("Supported service list:\n");
4431 for(i=0; i<bt_sdp_info->service_index; i++)
4433 bt_sdp_info->service_list_array[i]);
4436 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4437 //rfcomm_test_uuid);
4441 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4443 bluetooth_rfcomm_connection_t *conn_ind =
4444 (bluetooth_rfcomm_connection_t *)param->param_data;
4446 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4447 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4448 "SERVER" : "CLIENT");
4453 bluetooth_device_address_t remote_address = {{0},};
4454 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4455 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4456 ret = bluetooth_search_service(&remote_address);
4458 printf("Seach failed, Reason = %d", ret);
4460 printf("Search Success, Ret = %d", ret);
4462 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4464 printf("Connection failed, Reason = %d", ret);
4466 printf("Connection Success, Ret = %d", ret);
4470 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4471 const char *remote_uuid);
4474 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4475 * @brief Disconnect rfcomm connection
4478 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4479 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4482 * @return BLUETOOTH_ERROR_NONE - Success \n
4483 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4484 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4485 * @param[in] char remote bt_address
4488 * @see bluetooth_rfcomm_connect
4492 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4494 printf("Disconnection failed");
4496 printf("Disconnection Success");
4501 int bluetooth_rfcomm_disconnect(int socket_fd);
4504 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4505 * @brief Write to rfcomm connection
4508 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4509 * API is used to send the data for server and the client.
4511 * @return BLUETOOTH_ERROR_NONE - Success \n
4512 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4513 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4515 * @param[in] const char *buff Data buffer to send
4516 * @param[in] int length Length of the data
4519 * @see bluetooth_rfcomm_connect
4522 char *buff = "Test data 123456789"
4523 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4525 printf("Send failed");
4527 printf("Send success");
4531 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4534 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4535 * @brief Informs whether rfcomm client is connected.
4537 * This function is a synchronous call.
4539 * @return TRUE - RFCOMM client is connected \n
4540 * FALSE - RFCOMM client is not connected \n
4546 gboolean bluetooth_rfcomm_is_client_connected(void);
4547 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4548 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4551 * @fn int bluetooth_network_activate_server(void)
4552 * @brief Activate the NAP (Network Access Point) service
4554 * This function is a asynchronous call.
4555 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4557 * @return BLUETOOTH_ERROR_NONE - Success \n
4558 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4559 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4560 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4563 * @see bluetooth_network_deactivate_server
4566 int bluetooth_network_activate_server(void);
4569 * @fn int bluetooth_network_deactivate_server(void)
4570 * @brief Deactivate the NAP (Network Access Point) service
4572 * This function is a asynchronous call.
4573 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4575 * @return BLUETOOTH_ERROR_NONE - Success \n
4576 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4577 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4578 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4581 * @see bluetooth_network_activate_server
4584 int bluetooth_network_deactivate_server(void);
4587 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4588 * bluetooth_network_role_t role,
4590 * @brief Connect the network server in the peer
4592 * This function is a asynchronous call.
4593 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4595 * @return BLUETOOTH_ERROR_NONE - Success \n
4596 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4597 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4598 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4601 * @param[in] device_address This indicates an address of the device with which the pairing
4602 * should be initiated
4603 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4604 * need to use the third parameter.
4605 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4606 * connect. UUID string
4608 * @see bluetooth_network_disconnect
4610 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4611 bluetooth_network_role_t role, char *custom_uuid);
4614 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4615 * bluetooth_network_role_t role,
4616 * char *custom_uuid)
4617 * @brief Connect the network server in the peer
4619 * This function is a asynchronous call.
4620 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4622 * @return BLUETOOTH_ERROR_NONE - Success \n
4623 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4624 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4625 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4628 * @param[in] device_address This indicates an address of the device with which the pairing
4629 * should be initiated
4631 * @see bluetooth_network_connect
4633 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4636 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4637 * @brief Disconnect the device from the network
4639 * This function is an asynchronous call.
4640 * The network server disconnect request is responded by
4641 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4643 * @return BLUETOOTH_ERROR_NONE - Success \n
4644 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4645 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4646 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4649 * @param[in] device_address This indicates an address of the connected client device
4651 * @see bluetooth_network_activate_server
4653 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4658 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4659 * bt_hdp_role_type_t role,
4660 * bt_hdp_qos_type_t channel_type,
4661 * char **app_handle)
4662 * @brief Activate the HDP service for a particular data type
4664 * This function is a synchronous call.
4666 * @return BLUETOOTH_ERROR_NONE - Success \n
4667 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4668 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4669 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4672 * @param[in] data_type The data type against corresponding service
4673 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4674 * @param[in] channel_type The QOS type for the channel.
4675 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4676 * For role = HDP_ROLE_SINK, the channel_type
4677 * should be HDP_QOS_ANY.
4678 * @param[out] app_handle The application handler against corresponding service
4680 * @see bluetooth_hdp_deactivate
4682 int bluetooth_hdp_activate(unsigned short data_type,
4683 bt_hdp_role_type_t role,
4684 bt_hdp_qos_type_t channel_type,
4687 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4688 * @brief Deactivate the HDP service for a particular service using the handler
4690 * This function is a synchronous call.
4692 * @return BLUETOOTH_ERROR_NONE - Success \n
4693 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4694 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4695 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4698 * @param[in] app_handle The application handler against corresponding service
4700 * @see bluetooth_hdp_deactivate
4702 int bluetooth_hdp_deactivate(const char *app_handle);
4705 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4706 * const char *buffer, unsigned int size)
4707 * @brief Send data to the remote HDP device
4709 * This function is a synchronous call.
4711 * @return BLUETOOTH_ERROR_NONE - Success \n
4712 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4713 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4714 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4715 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4718 * @param[in] channel_id The channel id for the connection.
4719 * @param[in] buffer The pdu buffer.
4720 * @param[in] size Size of the buffer.
4722 * @see bluetooth_hdp_connect
4724 int bluetooth_hdp_send_data(unsigned int channel_id,
4725 const char *buffer, unsigned int size);
4727 * @fn int bluetooth_hdp_connect(const char *app_handle,
4728 * bt_hdp_qos_type_t channel_type,
4729 * const bluetooth_device_address_t *device_address)
4730 * @brief Connect to the remote device(Mainly used by source)
4732 * This function is a asynchronous call.
4733 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4735 * @return BLUETOOTH_ERROR_NONE - Success \n
4736 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4737 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4738 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4739 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4742 * @param[in] app_handle The application handler against corresponding service
4743 * @param[in] channel_type The QOS type for the channel.
4744 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4745 * @param[in] device_address The remote device Bd address.
4748 * @see bluetooth_hdp_disconnect
4750 int bluetooth_hdp_connect(const char *app_handle,
4751 bt_hdp_qos_type_t channel_type,
4752 const bluetooth_device_address_t *device_address);
4754 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4755 * const bluetooth_device_address_t *device_address)
4756 * @brief Disconnect from the remote device(Mainly used by source)
4758 * This function is a asynchronous call.
4759 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4761 * @return BLUETOOTH_ERROR_NONE - Success \n
4762 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4763 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4764 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4765 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4768 * @param[in] channel_id The channel id for the connection.
4769 * @param[in] device_address The remote device Bd address.
4772 * @see bluetooth_hdp_connect
4774 int bluetooth_hdp_disconnect(unsigned int channel_id,
4775 const bluetooth_device_address_t *device_address);
4779 * @fn int bluetooth_opc_init(void)
4780 * @brief Initialize OPP client.
4782 * This function is a synchronous call.
4783 * No event corresponding to this api
4785 * @return BLUETOOTH_ERROR_NONE - Success \n
4786 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4787 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4788 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4789 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4794 * @see bluetooth_opc_deinit
4796 int bluetooth_opc_init(void);
4799 * @fn int bluetooth_opc_deinit(void)
4800 * @brief Deinitialize OPP client.
4802 * This function is a synchronous call.
4803 * No event corresponding to this api
4805 * @return BLUETOOTH_ERROR_NONE - Success \n
4806 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4807 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4812 * @see bluetooth_opc_init
4815 int bluetooth_opc_deinit(void);
4818 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4819 char **file_name_array)
4820 * @brief Send multiple files to a remote device.
4822 * This function is a asynchronous call.
4823 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4825 * @return BLUETOOTH_ERROR_NONE - Success \n
4826 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4827 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4828 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4829 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4830 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4831 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4834 * @param[in] device_address The remote device Bd address.
4835 * @param[in] file_name_array Array of filepaths to be sent.
4838 * @see bluetooth_opc_cancel_push
4841 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4842 char **file_name_array);
4845 * @fn int bluetooth_opc_cancel_push(void)
4846 * @brief Cancels the ongoing file push.
4848 * This function is a asynchronous call.
4849 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4850 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4852 * @return BLUETOOTH_ERROR_NONE - Success \n
4853 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4854 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4859 * @see bluetooth_opc_push_files
4862 int bluetooth_opc_cancel_push(void);
4865 * @fn gboolean bluetooth_opc_session_is_exist(void)
4866 * @brief Informs whether opc session exists or not.
4868 * This function is a synchronous call.
4870 * @return TRUE - OPC session exists \n
4871 * FALSE - OPC session does not exist \n
4879 gboolean bluetooth_opc_session_is_exist(void);
4882 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4883 * @brief Informs whether opc session exists or not.
4885 * This function is a synchronous call.
4887 * @return BLUETOOTH_ERROR_NONE - Success \n
4888 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4889 * BLUETOOTH_ERROR_INTERNAL \n
4892 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4897 int bluetooth_opc_is_sending(gboolean *is_sending);
4900 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4901 int transfer_id, unsigned char *progress)
4902 * @brief Gets the percentage progress for ongoing transfers.
4904 * This function is a synchronous call.
4906 * @return BLUETOOTH_ERROR_NONE - Success \n
4907 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4908 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4911 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4912 * @param[in] transfer_id Transfer ID
4913 * @param[out] progress Percentage Progress
4917 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4918 int transfer_id, unsigned char *progress);
4921 * @fn int bluetooth_obex_server_init(const char *dst_path)
4922 * @brief Initialize OPP and FTP server.
4924 * This function is a synchronous call.
4925 * No event corresponding to this api
4927 * @return BLUETOOTH_ERROR_NONE - Success \n
4928 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4929 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4930 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4931 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4934 * @param[in] dst_path OPS destination file path.
4936 * @see bluetooth_obex_server_deinit
4938 int bluetooth_obex_server_init(const char *dst_path);
4942 * @fn int bluetooth_obex_server_deinit(void)
4943 * @brief Deinitialize OPP and FTP server.
4945 * This function is a synchronous call.
4946 * No event corresponding to this api
4948 * @return BLUETOOTH_ERROR_NONE - Success \n
4949 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4950 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4955 * @see bluetooth_obex_server_init
4957 int bluetooth_obex_server_deinit(void);
4961 * @fn gboolean bluetooth_obex_server_is_activated(void)
4962 * @brief Informs whether obex server is activated or not.
4964 * This function is a synchronous call.
4966 * @return TRUE - OBEX server is activated \n
4967 * FALSE - OBEX server is not activated \n
4974 gboolean bluetooth_obex_server_is_activated(void);
4978 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4979 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4981 * This function is a synchronous call.
4982 * No event corresponding to this api
4984 * @return BLUETOOTH_ERROR_NONE - Success \n
4985 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4986 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4987 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4988 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4992 * @param[in] dst_path OPS destination file path.
4994 * @see bluetooth_obex_server_deinit_without_agent
4996 int bluetooth_obex_server_init_without_agent(const char *dst_path);
5000 * @fn int bluetooth_obex_server_deinit_without_agent(void)
5001 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
5003 * This function is a synchronous call.
5004 * No event corresponding to this api
5006 * @return BLUETOOTH_ERROR_NONE - Success \n
5007 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5008 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5013 * @see bluetooth_obex_server_init_without_agent
5015 int bluetooth_obex_server_deinit_without_agent(void);
5019 * @fn int bluetooth_obex_server_accept_connection(void)
5020 * @brief Accepts the authorization request indicated by the event
5021 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5023 * This function is a synchronous call.
5025 * @return BLUETOOTH_ERROR_NONE - Success \n
5026 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5027 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5031 * @see bluetooth_obex_server_reject_authorize
5033 int bluetooth_obex_server_accept_connection(void);
5037 * @fn int bluetooth_obex_server_reject_connection(void)
5038 * @brief Rejects the authorization request indicated by the event
5039 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
5041 * This function is a synchronous call.
5043 * @return BLUETOOTH_ERROR_NONE - Success \n
5044 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5045 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
5049 * @see bluetooth_obex_server_reject_authorize
5051 int bluetooth_obex_server_reject_connection(void);
5055 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
5056 * @brief Accepts the authorization request indicated by the event
5057 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5059 * This function is a asynchronous call.
5060 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
5062 * @return BLUETOOTH_ERROR_NONE - Success \n
5063 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5064 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5065 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5068 * @param[in] filename Authorized filename.
5071 * @see bluetooth_obex_server_reject_authorize
5074 int bluetooth_obex_server_accept_authorize(const char *filename);
5077 * @fn int bluetooth_obex_server_reject_authorize(void)
5078 * @brief Reject the authorization request indicated by the event
5079 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
5081 * This function is a asynchronous call.
5082 * No event for this api..
5084 * @return BLUETOOTH_ERROR_NONE - Success \n
5085 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5086 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5091 * @see bluetooth_obex_server_accept_authorize
5094 int bluetooth_obex_server_reject_authorize(void);
5097 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5098 * @brief Set the OPS destination file path..
5100 * This function is a asynchronous call.
5101 * No event for this api..
5103 * @return BLUETOOTH_ERROR_NONE - Success \n
5104 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5105 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5106 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5109 * @param[in] dst_path OPS destination file path.
5115 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5118 * @fn int bluetooth_obex_server_set_root(const char *root)
5119 * @brief Set the FTS root folder..
5121 * This function is a asynchronous call.
5122 * No event for this api..
5124 * @return BLUETOOTH_ERROR_NONE - Success \n
5125 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5126 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5127 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5128 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5129 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5132 * @param[in] root FTS root folder.
5138 int bluetooth_obex_server_set_root(const char *root);
5141 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5142 * @brief Cancel the transfer on server
5144 * This function is an asynchronous call.
5145 * If the function call that cancels transfer is successful, the application would receive
5146 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5147 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5148 * the error code will be BLUETOOTH_ERROR_NONE
5150 * @return BLUETOOTH_ERROR_NONE - Success \n
5151 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5152 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5153 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5154 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5157 * @param[in] transfer_id transfer ID
5162 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5166 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5167 * @brief Cancel the transfer on server
5169 * This function is an asynchronous call.
5170 * If the function call that cancels transfer is successful, the application would receive
5171 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5172 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5173 * the error code will be BLUETOOTH_ERROR_NONE
5175 * @return BLUETOOTH_ERROR_NONE - Success \n
5176 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5177 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5178 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5179 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5186 int bluetooth_obex_server_cancel_all_transfers(void);
5190 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5191 * @brief Informs whether obex server is receiving or not.
5193 * This function is a synchronous call.
5195 * @return BLUETOOTH_ERROR_NONE - Success \n
5196 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5197 * BLUETOOTH_ERROR_INTERNAL \n
5200 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
5205 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5209 * @fn int bluetooth_map_client_init(void)
5210 * @brief Initialize MAP client.
5212 * This function is a synchronous call.
5213 * No event corresponding to this api
5215 * @return BLUETOOTH_ERROR_NONE - Success \n
5216 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5217 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5218 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5219 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5224 * @see bluetooth_map_client_deinit
5226 int bluetooth_map_client_init(void);
5228 int bluetooth_map_client_deinit(void);
5230 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5232 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5234 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5236 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5237 bt_map_client_list_folders_filter_t *filter);
5240 * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5241 * @brief Return all available fields that can be used in Fields filter.
5243 * This function is a asynchronous call.
5245 * @return BLUETOOTH_ERROR_NONE - Success \n
5246 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5247 * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5250 * @param[in] session Information about session.
5253 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5255 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5257 bt_map_client_list_messages_filter_t *filter);
5259 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5261 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5262 const char *source_file,
5264 bt_map_client_push_message_args_t *args);
5266 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5267 const bt_map_client_message_object_t message_object,
5268 const char *target_file,
5273 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5274 * @brief Read the local Hash and Randmizer.
5276 * This function is a synchronous call.
5278 * @return BLUETOOTH_ERROR_NONE - Success \n
5279 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5283 * @param[out] local_oob_data - Pointer to the local OOB data
5289 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5293 * @fn int bluetooth_oob_add_remote_data(
5294 * const bluetooth_device_address_t *remote_device_address,
5295 * bluetooth_bdaddr_type_e address_type,
5296 * bt_oob_data_t *oob_data)
5297 * @brief Add/updated the remote device Hash and Randmizer.
5299 * This function is a synchronous call.
5300 * No event for this api..
5302 * @return BLUETOOTH_ERROR_NONE - Success \n
5303 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5306 * @param[in] remote_device_address - Remote device address
5307 * address_type - bdaddr type
5308 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5314 int bluetooth_oob_add_remote_data(
5315 const bluetooth_device_address_t *remote_device_address,
5316 bluetooth_bdaddr_type_e address_type,
5317 bt_oob_data_t *remote_oob_data);
5321 * @fn int bluetooth_oob_remove_remote_data(
5322 * const bluetooth_device_address_t *remote_device_address)
5323 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5325 * This function is a synchronous call.
5326 * No event for this api..
5328 * @return BLUETOOTH_ERROR_NONE - Success \n
5329 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5332 * @param[in] remote_device_address - Remote device address
5338 int bluetooth_oob_remove_remote_data(
5339 const bluetooth_device_address_t *remote_device_address);
5343 * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5344 * @brief Read the local Hash and Randmizer.
5346 * This function is a synchronous call.
5348 * @return BLUETOOTH_ERROR_NONE - Success \n
5349 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5353 * @param[out] local_oob_data - Pointer to the local OOB data
5358 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5361 * @fn int bluetooth_le_oob_add_remote_data(
5362 * const bluetooth_device_address_t *remote_device_address,
5363 * bluetooth_bdaddr_type_e address_type,
5364 * bt_oob_data_t *oob_data)
5365 * @brief Add/updated the remote device Hash and Randmizer.
5367 * This function is a synchronous call.
5368 * No event for this api..
5370 * @return BLUETOOTH_ERROR_NONE - Success \n
5371 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5374 * @param[in] remote_device_address - Remote device address
5375 * address_type - bdaddr type
5376 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
5381 int bluetooth_le_oob_add_remote_data(
5382 const bluetooth_device_address_t *remote_device_address,
5383 bluetooth_bdaddr_type_e address_type,
5384 bt_oob_data_t *remote_oob_data);
5387 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5388 * bt_gatt_handle_info_t *prim_svc);
5390 * @brief Gets the GATT based primary services handle supported by remote device
5392 * This function is a synchronous call.
5393 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5395 * @return BLUETOOTH_ERROR_NONE - Success \n
5396 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5397 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5398 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5401 * @param[in] address - Remote device address
5402 * @param[out] prim_svc - Structure containing remote service count and handle list.
5405 * @see bluetooth_gatt_free_primary_services()
5407 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5408 bt_gatt_handle_info_t *prim_svc);
5411 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5413 * @brief Discovers the characteristics of GATT based service of remote device
5415 * This function is an asynchronous call.
5416 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5418 * @return BLUETOOTH_ERROR_NONE - Success \n
5419 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5420 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5421 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5424 * @param[in] service_handle - Handle for remote service.
5429 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5431 int bluetooth_gatt_set_service_change_watcher(
5432 const bluetooth_device_address_t *address, gboolean enable);
5435 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5436 * bt_gatt_service_property_t *service);
5438 * @brief Gets the properties of GATT based service of remote device
5440 * This function is a synchronous call.
5441 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5443 * @return BLUETOOTH_ERROR_NONE - Success \n
5444 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5445 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5446 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5449 * @param[in] service_handle - Handle for remote service.
5450 * @param[out] service - Structure containing remote service property.
5453 * @see bluetooth_gatt_free_service_property()
5455 int bluetooth_gatt_get_service_property(const char *service_handle,
5456 bt_gatt_service_property_t *service);
5459 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5461 * @brief Register to GATT based service to receive value change notification/indication.
5463 * This function is a synchronous call.
5464 * No event for this api.
5466 * @return BLUETOOTH_ERROR_NONE - Success \n
5467 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5468 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5469 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5472 * @param[in] service_handle - Handle for remote service.
5473 * @param[in] service_name - Friednly name of service uuid.
5478 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5481 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5483 * @brief Unregister GATT based service to receive value change notification/indication.
5485 * This function is a synchronous call.
5486 * No event for this api.
5488 * @return BLUETOOTH_ERROR_NONE - Success \n
5489 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5490 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5491 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5494 * @param[in] service_handle - Handle for remote service.
5499 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5502 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5503 * bt_gatt_char_property_t *characteristic);
5505 * @brief Provides characteristic value along with properties.
5507 * This function is a synchronous call.
5508 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5510 * @return BLUETOOTH_ERROR_NONE - Success \n
5511 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5512 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5513 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5516 * @param[in] char_handle - Handle for Characteristic property.
5517 * @param[out] characteristic - Structure containing remote characteristic property.
5520 * @see bluetooth_gatt_free_char_property()
5522 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5523 bt_gatt_char_property_t *characteristic);
5526 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5527 * bt_gatt_char_property_t *characteristic);
5529 * @brief Provides characteristic descriptor value along with its UUID.
5531 * This function is a synchronous call.
5532 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5534 * @return BLUETOOTH_ERROR_NONE - Success \n
5535 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5536 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5537 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5540 * @param[in] desc_handle - Handle for Characteristic descriptor.
5541 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5544 * @see bluetooth_gatt_free_desc_property()
5546 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5547 bt_gatt_char_descriptor_property_t *descriptor);
5551 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5552 * const guint8 *value, int length)
5554 * @brief Set characteristic value.
5556 * This function is a synchronous call.
5558 * @return BLUETOOTH_ERROR_NONE - Success \n
5559 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5560 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5561 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5564 * @param[in] char_handle - Handle for Characteristic property.
5565 * @param[in] value - New value to set for characteristic property.
5566 * @param[in] length - Length of the value to be set.
5571 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5572 const guint8 *value, int length);
5575 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5576 * const guint8 *value, int length, guint8 write_type)
5578 * @brief Set characteristic value by write type.
5580 * This function is a synchronous call if write type is "write without resonse"
5581 * and it is an asynchronous call if write type is "write with response"
5583 * @return BLUETOOTH_ERROR_NONE - Success \n
5584 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5585 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5586 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5589 * @param[in] char_handle - Handle for Characteristic property.
5590 * @param[in] value - New value to set for characteristic property.
5591 * @param[in] length - Length of the value to be set.
5592 * @param[in] write_type - Type of write.
5597 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5598 const guint8 *value, int length,
5599 guint8 write_type, gpointer app_data);
5603 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5604 * const guint8 *value, int length)
5606 * @brief Set characteristic value request.
5608 * This function is an asynchronous call.
5610 * @return BLUETOOTH_ERROR_NONE - Success \n
5611 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5612 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5613 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5616 * @param[in] char_handle - Handle for Characteristic property.
5617 * @param[in] value - New value to set for characteristic property.
5618 * @param[in] length - Length of the value to be set.
5623 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5624 const guint8 *value, int length);
5627 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5629 * @brief Read characteristic value.
5631 * This function is a asynchronous call.
5633 * @return BLUETOOTH_ERROR_NONE - Success \n
5634 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5635 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5636 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5639 * @param[in] char_handle - Handle for Characteristic property.
5644 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5647 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5648 * const char *service_uuid,
5649 * bt_gatt_service_property_t *service)
5651 * @brief Gets the service property from a device based on a particular uuid
5653 * This function is a synchronous call.
5655 * @return BLUETOOTH_ERROR_NONE - Success \n
5656 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5657 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5658 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5661 * @param[in] address - BD address of the remote device
5662 * @param[in] service_uuid - uuid of the service.
5663 * @param[out] service - Structure containing the service property.
5668 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5669 const char *service_uuid,
5670 bt_gatt_service_property_t *service);
5673 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5674 * const char *char_uuid)
5676 * @brief Gets the characteristic property from a service based on a particular char uuid
5678 * This function is an asynchronous call.
5679 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5681 * @return BLUETOOTH_ERROR_NONE - Success \n
5682 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5683 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5684 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5687 * @param[in] service_handle - Service handle.
5688 * @param[in] uuid - Characteristic uuid.
5693 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5694 const char *char_uuid);
5697 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5699 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5701 * This function is a synchronous call.
5702 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5704 * @return BLUETOOTH_ERROR_NONE - Success \n
5705 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5708 * @param[in] prim_svc - GATT handle info structure
5711 * @see bluetooth_gatt_get_primary_services()
5713 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5716 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5718 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5720 * This function is a synchronous call.
5721 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5723 * @return BLUETOOTH_ERROR_NONE - Success \n
5724 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5727 * @param[in] svc_pty - GATT service property structure.
5730 * @see bluetooth_gatt_get_service_property()
5732 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5735 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5737 * @brief Provides characteristic value along with properties.
5739 * This function is a synchronous call.
5740 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5742 * @return BLUETOOTH_ERROR_NONE - Success \n
5743 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5746 * @param[in] char_pty - GATT characteristics property structure.
5749 * @see bluetooth_gatt_get_characteristics_property()
5751 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5754 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5756 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5758 * This function is a synchronous call.
5759 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5761 * @return BLUETOOTH_ERROR_NONE - Success \n
5762 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5765 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5768 * @see bluetooth_gatt_get_char_descriptor_property()
5770 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5772 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5773 gboolean auto_connect, int client_id);
5775 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5778 int bluetooth_get_gatt_data_batching_available_packets(
5779 int *available_packets);
5781 int bluetooth_enable_gatt_data_batching(
5782 const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5784 int bluetooth_disable_gatt_data_batching(
5785 const bluetooth_device_address_t *device_address);
5788 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5790 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5792 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5794 * @return BLUETOOTH_ERROR_NONE - Success \n
5795 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5798 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5802 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5805 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5807 * @brief Read characteristic descriptor value.
5809 * This function is a asynchronous call.
5811 * @return BLUETOOTH_ERROR_NONE - Success \n
5812 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5813 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5814 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5817 * @param[in] desc_handle - Handle for Characteristic descriptor
5822 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5825 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5826 * const guint8 *value, int length);
5828 * @brief Set characteristic descriptor value.
5830 * This function is a asynchronous call.
5832 * @return BLUETOOTH_ERROR_NONE - Success \n
5833 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5834 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5835 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5838 * @param[in] desc_handle - Handle for Characteristic descriptor
5839 * @param[in] value - New value to set for characteristic descriptor
5840 * @param[in] length - Length of the value to be set.
5845 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5846 const guint8 *value, int length, gpointer app_data);
5848 /* @fn int bluetooth_gatt_init(void)
5850 * @brief Initializes the gatt service.
5852 * This function is a synchronous call.
5853 * @return BLUETOOTH_ERROR_NONE - Success \n
5854 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5855 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5856 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5859 * @remark Adapter should be enabled
5860 * @see bluetooth_gatt_deinit()
5862 int bluetooth_gatt_init(void);
5864 /* @fn int bluetooth_gatt_init(void)
5866 * @brief DeInitializes the gatt service.
5868 * This function is a synchronous call.
5869 * @return BLUETOOTH_ERROR_NONE - Success \n
5870 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5871 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5872 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5875 * @remark Adapter should be enabled
5876 * @see bluetooth_gatt_init()
5878 int bluetooth_gatt_deinit(void);
5880 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5881 unsigned char **svc_path)
5883 * @brief Exports a new gatt service to the service interface.
5885 * This function is a synchronous call.
5887 * @return BLUETOOTH_ERROR_NONE - Success \n
5888 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5889 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5890 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5893 * @param[in] svc_uuid Gatt service uuid.
5894 * @param[out] svc_path service object path of the exported service.
5895 * @remark Adapter should be enabled
5896 * @see bluetooth_gatt_init()
5898 int bluetooth_gatt_add_service(const char *svc_uuid,
5901 /* @fn int bluetooth_gatt_add_new_characteristic(
5902 const char *svc_path, const char *char_uuid,
5903 bt_gatt_permission_t permissions,
5904 bt_gatt_characteristic_property_t properties,
5905 int flags_length, char **char_path);;
5907 * @brief Exports a new gatt characteristic to the characteristic interface.
5909 * This function is a synchronous call.
5910 * @return BLUETOOTH_ERROR_NONE - Success \n
5911 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5912 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5913 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5915 * @param[in] svc_path service object path of the exported service.
5916 * @param[in] char_uuid Gatt service uuid.
5917 * @param[in] properties GATT characteristic properties.
5918 * @param[out] char_path characteristic object path of the exported characteristic.
5920 * @remark Adapter should be enabled
5921 * @see bluetooth_gatt_add_service()
5923 int bluetooth_gatt_add_new_characteristic(
5924 const char *svc_path, const char *char_uuid,
5925 bt_gatt_permission_t permissions,
5926 bt_gatt_characteristic_property_t properties,
5929 /* @fn bluetooth_gatt_set_characteristic_value(
5930 const char *characteristic, const char *char_value,
5933 * @brief adds gatt charactertisic value to the given charactertistic path.
5935 * This function is a synchronous call.
5936 * @return BLUETOOTH_ERROR_NONE - Success \n
5937 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5938 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5939 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5941 * @param[in] char_value Value of the GATT characteristic to be added.
5942 * @param[in] value_length length of the chantacteristic value..
5943 * @param[out] characteristic characteristic object path..
5945 * @remark Adapter should be enabled
5946 * @see bluetooth_gatt_add_service()
5948 int bluetooth_gatt_set_characteristic_value(
5949 const char *characteristic, const char *char_value,
5952 /* @fn int bluetooth_gatt_add_descriptor(
5953 const char *char_path, const char *desc_uuid,
5954 bt_gatt_permission_t permissions,
5957 * @brief Exports a new gatt descriptor to the descriptor interface.
5959 * This function is a synchronous call.
5961 * @return BLUETOOTH_ERROR_NONE - Success \n
5962 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5963 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5964 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5967 * @param[in] desc_uuid Gatt descriptor uuid.
5968 * @param[in] desc_value GATT descriptor value.
5969 * @param[in] value_length Length of GATT descriptor value.
5970 * @param[in] permissions descriptor permissions.
5971 * @param[in] properties GATT descriptor properties.
5972 * @param[in] char_path characteristics object path of the exported character.
5974 * @remark Adapter should be enabled
5975 * @see bluetooth_gatt_add_service()
5976 * @see bluetooth_gatt_add_characteristics()
5978 int bluetooth_gatt_add_descriptor(
5979 const char *char_path, const char *desc_uuid,
5980 bt_gatt_permission_t permissions,
5983 /* @fn int bluetooth_gatt_set_descriptor_value(
5984 const char *desc_path, const char *desc_value,
5987 * @brief Adds value to the given descriptor handle.
5989 * This function is a synchronous call.
5991 * @return BLUETOOTH_ERROR_NONE - Success \n
5992 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5993 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5994 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5997 * @param[in] desc_value GATT descriptor value.
5998 * @param[in] value_length Length of GATT descriptor value.
5999 * @param[in] desc_path descriptor path to which the value needs to be added.
6001 * @remark Adapter should be enabled
6002 * @see bluetooth_gatt_add_service()
6003 * @see bluetooth_gatt_add_characteristics()
6005 int bluetooth_gatt_set_descriptor_value(
6006 const char *desc_path, const char *desc_value,
6009 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
6011 * @brief Reads the Service registered on manager interface.
6013 * This function is a synchronous call.
6015 * @return BLUETOOTH_ERROR_NONE - Success \n
6016 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6017 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6018 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6021 * @param[in] svc_uuid Gatt Service uuid.
6023 * @remark Adapter should be enabled and service should be registered.
6024 * @see bluetooth_gatt_register_service()
6026 int bluetooth_gatt_get_service(const char *svc_uuid);
6028 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
6030 * @brief Registers the given service path with the library.
6032 * This function is a synchronous call.
6034 * @return BLUETOOTH_ERROR_NONE - Success \n
6035 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6036 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6037 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6040 * @param[in] svc_path service object path of the exported service.
6042 * @remark Adapter should be enabled
6043 * @see bluetooth_gatt_add_service()
6044 * @see bluetooth_gatt_add_characteristics()
6045 * @see bluetooth_gatt_add_descriptor()
6046 * @see bluetooth_gatt_register_application()
6048 int bluetooth_gatt_register_service(const char *svc_path);
6050 /* @fn int bluetooth_gatt_register_application(void)
6052 * @brief Registers the application with the bluez gatt server.
6054 * This function is a synchronous call.
6056 * @return BLUETOOTH_ERROR_NONE - Success \n
6057 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6058 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6059 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6063 * @remark Adapter should be enabled
6064 * @see bluetooth_gatt_init()
6065 * @see bluetooth_gatt_add_service()
6066 * @see bluetooth_gatt_add_characteristics()
6067 * @see bluetooth_gatt_add_descriptor()
6068 * @see bluetooth_gatt_register_service()
6070 int bluetooth_gatt_register_application(void);
6072 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
6074 * @brief Removes(unregister) service from the bluez gatt server db.
6076 * This function is a synchronous call.
6078 * @return BLUETOOTH_ERROR_NONE - Success \n
6079 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6080 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6081 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6084 * @param[in] svc_path service object path of the exported service.
6086 * @remark Adapter should be enabled
6087 * @see bluetooth_gatt_add_service()
6088 * @see bluetooth_gatt_add_characteristics()
6089 * @see bluetooth_gatt_add_descriptor()
6090 * @see bluetooth_gatt_register_service()
6092 int bluetooth_gatt_unregister_service(const char *svc_path);
6094 /* @fn int bluetooth_gatt_unregister_application(void)
6096 * @brief Removes(unregister) the application with the bluez gatt server,
6097 * and deletes all the service registered.
6099 * This function is a synchronous call.
6101 * @return BLUETOOTH_ERROR_NONE - Success \n
6102 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6103 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6108 * @remark Adapter should be enabled
6109 * @see bluetooth_gatt_init()
6110 * @see bluetooth_gatt_add_service()
6111 * @see bluetooth_gatt_add_characteristics()
6112 * @see bluetooth_gatt_add_descriptor()
6113 * @see bluetooth_gatt_register_service()
6114 * @see bluetooth_gatt_unregister_service()
6116 int bluetooth_gatt_unregister_application(void);
6118 /* @fn int bluetooth_gatt_send_response(int request_id,
6119 * int offset, char *value, int value_length)
6121 * @brief Updates the attribute value in local attribute list.
6123 * This function is a synchronous call.
6125 * @return BLUETOOTH_ERROR_NONE - Success \n
6126 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6127 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6128 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6131 * @param[in] request_id The identification of a read request
6132 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
6133 * @param[in] resp_state The identification of response state
6134 * @param[in] offset The offset from where a value is read
6135 * @param[in] value The value to be sent. It will be sent from @a offset.
6136 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
6137 * @param[in] value_length Value Length.
6139 * @remark Adapter should be enabled
6140 * @see bluetooth_gatt_add_service()
6141 * @see bluetooth_gatt_add_characteristics()
6142 * @see bluetooth_gatt_add_descriptor()
6143 * @see bluetooth_gatt_register_service()
6145 int bluetooth_gatt_send_response(int request_id, guint req_type,
6146 int resp_state, int offset, char *value, int value_length);
6148 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6150 * @brief Sets the notification property for a characteristic.
6152 * This function is a synchronous call.
6154 * @return BLUETOOTH_ERROR_NONE - Success \n
6155 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6156 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6157 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6160 * @param[in] char_path characteristic object path.
6161 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
6163 * @remark Adapter should be enabled
6164 * @see bluetooth_gatt_update_characteristic()
6166 int bluetooth_gatt_server_set_notification(const char *char_path,
6167 bluetooth_device_address_t *unicast_address);
6169 /* @fn int bluetooth_gatt_delete_services(void)
6171 * @brief deletes (unregisters) all services from the gatt server database..
6173 * This function is a synchronous call.
6175 * @return BLUETOOTH_ERROR_NONE - Success \n
6176 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6177 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6178 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6182 * @remark Adapter should be enabled
6183 * @see bluetooth_gatt_add_service()
6184 * @see bluetooth_gatt_add_characteristics()
6185 * @see bluetooth_gatt_add_descriptor()
6186 * @see bluetooth_gatt_register_service()
6187 * @see bluetooth_gatt_unregister_service()
6189 int bluetooth_gatt_delete_services(void);
6191 /* @fn int bluetooth_gatt_update_characteristic(void)
6193 * @brief updates the given characteristic with a new value
6195 * This function is a synchronous call.
6197 * @return BLUETOOTH_ERROR_NONE - Success \n
6198 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6199 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6200 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6204 * @remark Adapter should be enabled
6205 * @see bluetooth_gatt_add_service()
6206 * @see bluetooth_gatt_add_characteristics()
6207 * @see bluetooth_gatt_add_descriptor()
6208 * @see bluetooth_gatt_register_service()
6209 * @see bluetooth_gatt_unregister_service()
6211 int bluetooth_gatt_update_characteristic(const char *char_path,
6212 const char* char_value, int value_length);
6215 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6217 * @brief Set advertising status.
6219 * This function is used to enable or disable LE advertising.
6220 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6222 * This function is a synchronous call.
6224 * @return BLUETOOTH_ERROR_NONE - Success \n
6225 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6226 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6229 * @param[in] enable - The status of advertising
6232 * @see bluetooth_set_advertising_data
6234 int bluetooth_set_advertising(int handle, gboolean enable);
6237 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6239 * @brief Set advertising status along with interval value.
6241 * This function is used to enable or disable LE advertising.
6242 * Interval_min and Interval_max is used to set the best advertising interval.
6243 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6245 * This function is a synchronous call.
6247 * @return BLUETOOTH_ERROR_NONE - Success \n
6248 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6249 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6252 * @param[in] enable - The status of advertising
6253 * @param[in] interval_min - Minimum interval of advertising (msec)
6254 * @param[in] interval_max - Maximum interval of advertising (msec)
6255 * @param[in] filter_policy - Advertising filter policy
6258 * @see bluetooth_set_advertising_data
6260 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6261 bluetooth_advertising_params_t *params);
6264 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6265 * @brief Get the advertising data
6267 * This function is used to get advertising data.
6268 * Before calling this API, the adapter should be enabled.
6270 * This function is a synchronous call.
6272 * @return BLUETOOTH_ERROR_NONE - Success \n
6273 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6274 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6275 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6277 * @param[out] value - Advertising data structure.
6278 * @param[out] length - The length of Advertising data.
6282 bluetooth_advertising_data_t *value = { {0} };
6285 ret = bluetooth_get_advertising_data(&value, &length);
6288 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6291 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6293 * @brief Set advertising data with value
6295 * This function is used to set advertising data and Maximum size of advertising data
6296 * is 28 byte (Except Flag)
6298 * This function is a synchronous call.
6300 * @return BLUETOOTH_ERROR_NONE - Success \n
6301 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6302 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6305 * @param[in] value - Advertising data structure.
6309 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6312 * @fn int bluetooth_check_privilege_advertising_parameter(void);
6314 * @brief Check the privilege for advertising parameter setting
6316 * This function is a synchronous call.
6318 * @return BLUETOOTH_ERROR_NONE - Success \n
6319 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6325 int bluetooth_check_privilege_advertising_parameter(void);
6328 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6329 * @brief Get the LE scan response data
6331 * This function is used to get scan response data.
6332 * Before calling this API, the adapter should be enabled.
6334 * This function is a synchronous call.
6336 * @return BLUETOOTH_ERROR_NONE - Success \n
6337 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6338 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6339 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6341 * @param[out] value - Scan response data structure.
6342 * @param[out] length - The length of Scan response data.
6346 bluetooth_scan_resp_data_t *value = { {0} };
6349 ret = bluetooth_get_scan_response_data(&value, &length);
6352 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6355 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6357 * @brief Set scan response data with value
6359 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6361 * This function is a synchronous call.
6363 * @return BLUETOOTH_ERROR_NONE - Success \n
6364 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6365 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6368 * @param[in] value - LE Scan response data structure.
6372 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6375 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6377 * @brief Set scan interval and window
6379 * This function is used to set LE scan interval and window size
6381 * This function is a synchronous call.
6383 * @return BLUETOOTH_ERROR_NONE - Success \n
6384 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6385 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6388 * @param[in] interval - Interval of LE scan (msec)
6389 * @param[in] window - Window size of LE scan (msec)
6393 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6396 * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6398 * @brief Set scan type
6400 * This function is used to set LE scan type
6402 * This function is a synchronous call.
6404 * @return BLUETOOTH_ERROR_NONE - Success \n
6405 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6406 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6409 * @param[in] scan_type - LE scan type
6413 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6416 * @fn intbluetooth_set_scan_phy(bleutooth_le_scanning_phy_t phy);
6418 * @brief Set scan phy
6420 * This function is used to set LE scan phy
6422 * This function is a synchronous call.
6424 * @return BLUETOOTH_ERROR_NONE - Success \n
6425 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6426 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6429 * @param[in] phy - LE scanning PHY
6433 int bluetooth_set_le_scan_phy(bleutooth_le_scanning_phy_t phy);
6436 * @fn intbluetooth_set_scan_phy(bluetooth_le_scan_role_t role);
6438 * @brief Set scan role
6440 * This function is used to set LE scan role
6442 * This function is a synchronous call.
6444 * @return BLUETOOTH_ERROR_NONE - Success \n
6445 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6446 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6449 * @param[in] role - LE scanning role
6453 int bluetooth_set_le_scan_role(bluetooth_le_scan_role_t role);
6456 * @fn int bluetooth_is_advertising(void)
6457 * @brief Check for the advertising is in-progress or not.
6459 * This API is used to check the current status of the advertising procedure.
6460 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6463 * This function checks whether the advertising is started or not.
6465 * This function is a synchronous call.
6467 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
6469 * @return BLUETOOTH_ERROR_NONE - Success \n
6470 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6473 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
6477 gboolean is_advertising = 0;
6479 ret = bluetooth_is_advertising(&is_advertising);
6482 int bluetooth_is_advertising(gboolean *is_advertising);
6485 * @fn int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6486 * @brief Add LE device to allow list
6488 * This API is used to add LE device to allow list
6489 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6493 * This function is a synchronous call.
6495 * @param[in] address The address of remote device
6497 * @return BLUETOOTH_ERROR_NONE - Success \n
6498 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6501 * @see bluetooth_set_custom_advertising
6503 int bluetooth_add_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6506 * @fn int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6507 * @brief Remove LE device from allow list
6509 * This API is used to remove LE device from allow list
6510 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6514 * This function is a synchronous call.
6516 * @param[in] address The address of remote device
6518 * @return BLUETOOTH_ERROR_NONE - Success \n
6519 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6522 * @see bluetooth_set_custom_advertising
6524 int bluetooth_remove_allow_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6527 * @fn int bluetooth_clear_allow_list(void)
6528 * @brief Clear allow list
6530 * This API is used to clear allow list
6531 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6535 * This function is a synchronous call.
6537 * @param[in] address The address of remote device
6539 * @return BLUETOOTH_ERROR_NONE - Success \n
6540 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6543 * @see bluetooth_set_custom_advertising
6545 int bluetooth_clear_allow_list(void);
6548 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6549 * const bluetooth_le_connection_param_t *parameters)
6550 * @brief update connection paramter of LE connection.
6552 * This function is a synchronous call.
6554 * @return BLUETOOTH_ERROR_NONE - Success \n
6555 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6558 * @param[in] address - remote device address value.
6559 * @param[in] parameters - new connection parameters.
6562 * @see bluetooth_bond_device
6564 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6565 const bluetooth_le_connection_param_t *parameters);
6568 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6570 * @brief Enable/Disable LE Privacy feature.
6572 * This function is used to enable or disable LE Privacy feature.
6573 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6575 * This function is a synchronous call.
6577 * @return BLUETOOTH_ERROR_NONE - Success \n
6578 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6579 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6582 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6586 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6589 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6591 * @brief Enable/Disable LE static random address.
6593 * This function is used to enable or disable LE static random address.
6595 * This function is a synchronous call.
6597 * @return BLUETOOTH_ERROR_NONE - Success \n
6598 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6599 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6602 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6606 int bluetooth_set_le_static_random_address(gboolean enable);
6609 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6610 * bluetooth_le_connection_mode_t mode)
6611 * @brief update connection paramter of LE connection.
6613 * This function is a synchronous call.
6615 * @return BLUETOOTH_ERROR_NONE - Success \n
6616 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6617 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6620 * @param[in] address - remote device address value.
6621 * @param[in] mode - new connection mode.
6625 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6626 bluetooth_le_connection_mode_t mode);
6629 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6630 * @brief Request for new ATT MTU value.
6632 * This function is a asynchronous call.
6634 * @return BLUETOOTH_ERROR_NONE - Success \n
6635 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6636 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6639 * @param[in] address - remote device address value.
6640 * @param[in] mtu - MTU value to be set.
6644 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6647 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6648 * unsigned int *mtu)
6649 * @brief Gets the xisting MTU value set for a connection.
6651 * This function is a synchronous call.
6653 * @return BLUETOOTH_ERROR_NONE - Success \n
6654 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6655 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6658 * @param[in] address - remote device address value.
6659 * @param[out] mtu - MTU value set for the connection.
6663 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6667 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6668 * bluetooth_device_address_t *id_address)
6669 * @brief Gets the Identity address of remote device.
6671 * This function is a synchronous call.
6673 * @return BLUETOOTH_ERROR_NONE - Success \n
6674 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6675 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6678 * @param[in] device_rpa - remote Resolvable private address.
6679 * @param[out] id_address - remote Identity device address value.
6683 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6684 bluetooth_device_address_t *id_address);
6687 * @fn int bluetooth_le_read_maximum_data_length()
6688 * @brief reads the maximum LE data length supported in the controller.
6690 * This function is a synchronous call.
6692 * @return BLUETOOTH_ERROR_NONE - Success \n
6693 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6699 int bluetooth_le_read_maximum_data_length(
6700 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6702 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6703 * @brief writes the host suggested values for the controllers max transmitted no of payload
6704 * octects to be used for new connections.
6706 * This function is a synchronous call.
6708 * @return BLUETOOTH_ERROR_NONE - Success \n
6709 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6715 int bluetooth_le_write_host_suggested_default_data_length(
6716 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6718 int bluetooth_le_read_suggested_default_data_length(
6719 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6721 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6722 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6724 int bluetooth_pbap_init(void);
6725 int bluetooth_pbap_deinit(void);
6726 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6727 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6728 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6729 bt_pbap_folder_t *folder);
6730 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6731 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6732 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6733 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6734 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6735 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6736 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6737 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6740 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6742 * @brief Set manufacturer data with value
6744 * This function is used to set manufacturer data.
6746 * This function is a synchronous call.
6748 * @return BLUETOOTH_ERROR_NONE - Success \n
6749 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6750 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6753 * @param[in] value - Manufacturer data structure.
6757 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6759 int bluetooth_set_passkey_notification(gboolean enable);
6762 * @fn int bluetooth_dpm_is_mode_allowed(void);
6764 * @brief Checks Restriction for BT mode(BT allowed or not)
6766 * This function is a synchronous call.
6768 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6769 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6770 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6777 int bluetooth_dpm_is_mode_allowed(void);
6780 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6782 * @brief Sets Restriction for BT mode(BT allowed or not)
6784 * This function is a synchronous call.
6786 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6787 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6788 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6791 * @param[in] value - BT Allow value.
6792 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6793 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6794 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6795 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6799 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6802 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6804 * @brief Reads the Restriction for BT mode(BT allowed or not)
6806 * This function is a synchronous call.
6808 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6809 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6810 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6814 * @param[out] value - BT Allow value.
6815 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6816 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6817 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6818 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6822 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6825 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6827 * @brief Sets the Restriction for device.
6829 * This function is a synchronous call.
6831 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6832 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6833 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6836 * @param[in] value - State value.
6837 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6838 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6842 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6845 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6847 * @brief Reads the Restriction for device.
6849 * This function is a synchronous call.
6851 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6852 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6853 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6857 * @param[out] value - State value.
6858 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6859 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6863 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6866 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6868 * @brief Sets the Restriction for uuid.
6870 * This function is a synchronous call.
6872 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6873 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6874 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6877 * @param[in] value - State value.
6878 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6879 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6883 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6886 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6888 * @brief Reads the Restriction for uuid.
6890 * This function is a synchronous call.
6892 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6893 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6894 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6898 * @param[out] value - State value.
6899 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6900 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6904 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6907 * @fn int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
6909 * @brief Adds the device to blocklist.
6911 * This function is a synchronous call.
6913 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6914 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6915 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6918 * @param[in] device_address - Device address
6922 int bluetooth_dpm_add_devices_to_blocklist(const bluetooth_device_address_t *device_address);
6925 * @fn int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
6927 * @brief Adds the device to allowlist.
6929 * This function is a synchronous call.
6931 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6932 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6933 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6936 * @param[in] device_address - Device address
6940 int bluetooth_dpm_add_devices_to_allowlist(const bluetooth_device_address_t *device_address);
6943 * @fn int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
6945 * @brief Adds the Service UUIDS to blocklist.
6947 * This function is a synchronous call.
6949 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6950 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6951 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6954 * @param[in] service_uuids - profile or custom service uuids
6958 int bluetooth_dpm_add_uuids_to_blocklist(const char *service_uuid);
6961 * @fn int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
6963 * @brief Adds the Service UUIDS to allowlist.
6965 * This function is a synchronous call.
6967 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6968 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6969 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6972 * @param[in] service_uuids - profile or custom service uuids
6976 int bluetooth_dpm_add_uuids_to_allowlist(const char *service_uuid);
6979 * @fn int bluetooth_dpm_clear_devices_from_blocklist();
6981 * @brief Clears the devices from blocklist.
6983 * This function is a synchronous call.
6985 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6986 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6987 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6994 int bluetooth_dpm_clear_devices_from_blocklist(void);
6997 * @fn int bluetooth_dpm_clear_devices_from_allowlist();
6999 * @brief Clears the devices from allowlist.
7001 * This function is a synchronous call.
7003 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7004 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7005 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7012 int bluetooth_dpm_clear_devices_from_allowlist(void);
7015 * @fn int bluetooth_dpm_clear_uuids_from_blocklist();
7017 * @brief Clears the uuids from blocklist.
7019 * This function is a synchronous call.
7021 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7022 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7023 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7030 int bluetooth_dpm_clear_uuids_from_blocklist(void);
7033 * @fn int bluetooth_dpm_clear_uuids_from_allowlist();
7035 * @brief Clears the uuids from allowlist.
7037 * This function is a synchronous call.
7039 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7040 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7041 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7048 int bluetooth_dpm_clear_uuids_from_allowlist(void);
7051 * @fn int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
7053 * @brief reads the devices from blocklist.
7055 * This function is a synchronous call.
7057 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7058 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7059 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7062 * @param[out] device_list - list of devices
7066 int bluetooth_dpm_get_devices_from_blocklist(bt_dpm_device_list_t *device_list);
7069 * @fn int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7071 * @brief reads the devices from allowlist.
7073 * This function is a synchronous call.
7075 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7076 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7077 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7080 * @param[out] device_list - list of devices
7084 int bluetooth_dpm_get_devices_from_allowlist(bt_dpm_device_list_t *device_list);
7087 * @fn int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7089 * @brief reads the uuids from blocklist.
7091 * This function is a synchronous call.
7093 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7094 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7095 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7098 * @param[in] uuid_list - list of uuids
7102 int bluetooth_dpm_get_uuids_from_blocklist(bt_dpm_uuids_list_t *uuid_list);
7105 * @fn int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7107 * @brief reads the uuids from allowlist.
7109 * This function is a synchronous call.
7111 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7112 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7113 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7116 * @param[in] uuid_list - list of uuids
7120 int bluetooth_dpm_get_uuids_from_allowlist(bt_dpm_uuids_list_t *uuid_list);
7123 * @fn int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7125 * @brief Removes the device from allowlist.
7127 * This function is a synchronous call.
7129 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7130 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7131 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7134 * @param[in] device_address - Device address
7138 int bluetooth_dpm_remove_device_from_allowlist(const bluetooth_device_address_t *device_address);
7141 * @fn int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7143 * @brief Removes the device from blocklist.
7145 * This function is a synchronous call.
7147 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7148 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7149 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7152 * @param[in] device_address - Device address
7156 int bluetooth_dpm_remove_device_from_blocklist(const bluetooth_device_address_t *device_address);
7159 * @fn int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7161 * @brief Removes the Service UUIDS from allowlist.
7163 * This function is a synchronous call.
7165 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7166 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7167 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7170 * @param[in] service_uuids - profile or custom service uuids
7174 int bluetooth_dpm_remove_uuid_from_allowlist(const char *service_uuid);
7177 * @fn int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7180 * @brief Removes the Service UUIDS from blocklist.
7182 * This function is a synchronous call.
7184 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7185 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7186 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7189 * @param[in] service_uuids - profile or custom service uuids
7193 int bluetooth_dpm_remove_uuid_from_blocklist(const char *service_uuid);
7196 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7198 * @brief Sets the Restriction for outgoing call.
7200 * This function is a synchronous call.
7202 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7203 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7204 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7207 * @param[in] value - State value.
7208 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7209 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7213 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7216 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7218 * @brief Reads the Restriction for outgoing call.
7220 * This function is a synchronous call.
7222 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7223 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7224 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7228 * @param[out] value - State value.
7229 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7230 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7234 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7237 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7239 * @brief Sets the Restriction for Pairing.
7241 * This function is a synchronous call.
7243 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7244 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7245 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7248 * @param[in] value - State value.
7249 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7250 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7254 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7257 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7259 * @brief Reads the Restriction for Pairing
7261 * This function is a synchronous call.
7263 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7264 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7265 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7269 * @param[out] value - State value.
7270 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7271 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7275 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7278 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7280 * @brief Sets the Restriction for using Profiles.
7282 * This function is a synchronous call.
7284 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7285 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7286 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7289 * @param[in]profile - Profile.
7290 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7291 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7292 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7293 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7294 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7295 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7296 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7297 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7298 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7299 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7300 * BLUETOOTH_DPM_PROFILE_NONE
7301 * @param[in] value - State value.
7302 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7303 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7307 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7310 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7312 * @brief Reads the Restriction for using Profiles.
7314 * This function is a synchronous call.
7316 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7317 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7318 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7321 * @param[in]profile - Profile.
7322 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7323 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7324 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7325 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7326 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7327 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7328 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7329 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7330 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7331 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7332 * BLUETOOTH_DPM_PROFILE_NONE
7333 * @param[out] value - State value.
7334 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7335 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7339 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7342 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7344 * @brief Sets the Restriction for Desktop Connectivity.
7346 * This function is a synchronous call.
7348 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7349 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7350 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7353 * @param[in] value - State value.
7354 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7355 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7359 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7362 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7364 * @brief Reads the Restriction for Desktop Connectivity.
7366 * This function is a synchronous call.
7368 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7369 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7370 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7374 * @param[out] value - State value.
7375 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7376 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7380 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7383 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7385 * @brief Sets the Restriction for Discoverable state.
7387 * This function is a synchronous call.
7389 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7390 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7391 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7394 * @param[in] value - State value.
7395 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7396 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7400 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7403 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7405 * @brief Reads the Restriction for Discoverable state.
7407 * This function is a synchronous call.
7409 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7410 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7411 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7415 * @param[out] value - State value.
7416 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7417 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7421 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7424 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7426 * @brief Sets the Restriction for linited discoverable state..
7428 * This function is a synchronous call.
7430 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7431 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7432 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7435 * @param[in] value - State value.
7436 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7437 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7441 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7444 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7446 * @brief Reads the Restriction for limited discoverable state.
7448 * This function is a synchronous call.
7450 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7451 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7452 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7456 * @param[out] value - State value.
7457 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7458 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7462 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7464 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7466 * @brief Sets the Restriction for Data trasnfer.
7468 * This function is a synchronous call.
7470 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7471 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7472 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7475 * @param[in] value - State value.
7476 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7477 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7481 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7485 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7487 * @brief Reads the Restriction for Data trasnfer.
7489 * This function is a synchronous call.
7491 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7492 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7493 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7497 * @param[out] value - State value.
7498 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
7499 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7503 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7506 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7507 * bluetooth_pxp_poperty_t property, int value);
7509 * @brief Sets the Proximity alert level/properties for monitor role.
7511 * This function is a synchronous call.
7513 * @return BLUETOOTH_ERROR_NONE - Success \n
7514 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7515 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7516 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7519 * @param[in] device_address remote device address
7520 * @param[in] property proximity profile property
7521 * @param[in] value alert level/property value to be set
7526 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7527 bluetooth_pxp_poperty_t property, int value);
7530 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7531 * bluetooth_pxp_poperty_t property, int *value);
7533 * @brief Reads the Proximity alert level/properties for monitor role.
7535 * This function is a synchronous call.
7537 * @return BLUETOOTH_ERROR_NONE - Success \n
7538 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7539 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7540 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7543 * @param[in] device_address remote device address
7544 * @param[in] property proximity profile property
7545 * @param[out] value alert level/property value
7549 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7550 bluetooth_pxp_poperty_t property, int *value);
7553 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7554 * int *services_supported);
7556 * @brief Reads the Proximity Monitor profile supported properties/services.
7558 * This function is a synchronous call.
7560 * @return BLUETOOTH_ERROR_NONE - Success \n
7561 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7562 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7563 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7566 * @param[in] device_address remote device address
7567 * @param[out] services_supported proximity profile property/service
7571 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7572 int *services_supported);
7575 * @fn int bluetooth_proximity_reporter_register();
7577 * @brief Register all proximity related services in BlueZ.
7579 * This function is a synchronous call.
7581 * @return BLUETOOTH_ERROR_NONE - Success \n
7582 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7588 int bluetooth_proximity_reporter_register(void);
7591 * @fn int bluetooth_proximity_reporter_unregister();
7593 * @brief Unregister all proximity related services in BlueZ.
7595 * This function is a synchronous call.
7597 * @return BLUETOOTH_ERROR_NONE - Success \n
7598 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7604 int bluetooth_proximity_reporter_unregister(void);
7607 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7608 * bluetooth_pxp_poperty_t property, int *value);
7610 * @brief Reads the Proximity alert level/properties for reporter role.
7612 * This function is a synchronous call.
7614 * @return BLUETOOTH_ERROR_NONE - Success \n
7615 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7616 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7617 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7620 * @param[in] device_address remote device address
7621 * @param[in] property proximity profile property
7622 * @param[out] value alert level/property value
7626 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7627 bluetooth_pxp_poperty_t property, int *value);
7630 * @fn int bluetooth_tds_provider_register(void);
7632 * @brief Register Transport Discovery Provider role.
7634 * This function is a synchronous call.
7636 * @return BLUETOOTH_ERROR_NONE - Success \n
7637 * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7638 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7639 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7647 int bluetooth_tds_provider_register(void);
7650 * @fn int bluetooth_tds_provider_unregister(void);
7652 * @brief Unregister Transport Discovery Provider role.
7654 * This function is a synchronous call.
7656 * @return BLUETOOTH_ERROR_NONE - Success \n
7657 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7658 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7659 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7667 int bluetooth_tds_provider_unregister(void);
7670 * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7672 * @brief Create Transport Discovery Provider for a transport.
7674 * This function is a synchronous call.
7676 * @return BLUETOOTH_ERROR_NONE - Success \n
7677 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7678 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7679 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7682 * @param[in] Transport (BT, CUSTOM etc.)
7683 * @param[in] Unique handle for TDS provider.
7688 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7691 * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7693 * @brief Remove previously created Transport Discovery Provider.
7695 * This function is a synchronous call.
7697 * @return BLUETOOTH_ERROR_NONE - Success \n
7698 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7701 * @param[in] Unique handle for previously created provider.
7706 int bluetooth_tds_provider_destroy(unsigned int handle);
7709 * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7711 * @brief Set transport block for in advertisement and gatt db.
7713 * This function is a synchronous call.
7715 * @return BLUETOOTH_ERROR_NONE - Success \n
7716 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7717 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7718 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7721 * @param[in] Provider specific manufacturer data.
7722 * @param[in] Provider specific manufacturer data length.
7727 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7730 * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7731 * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7733 * @brief Set transport block for in advertisement and gatt db.
7735 * This function is a synchronous call.
7737 * @return BLUETOOTH_ERROR_NONE - Success \n
7738 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7739 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7740 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7743 * @param[in] Unique handle for TDS provider.
7744 * @param[in] Transport state (On/Off/Not Available).
7745 * @param[in] Transport specific data block.
7746 * @param[in] Transport specific data block length.
7751 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7752 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7755 * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7756 * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7758 * @brief Send response to TDS activation request from remoted device.
7760 * This function is a synchronous call.
7762 * @return BLUETOOTH_ERROR_NONE - Success \n
7763 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7764 * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7765 * BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7768 * @param[in] Remote device BT address.
7769 * @param[in] Unique handle for TDS provider.
7770 * @param[in] Response for TDS activation request.
7771 * @param[in] Transport specific data block to be sent in activation response.
7772 * @param[in] Data block length.
7777 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7778 unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7781 * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7783 * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7785 * This function is an asynchronous call.
7787 * @return BLUETOOTH_ERROR_NONE - Success \n
7788 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7789 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7790 * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7791 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7794 * @param[in] device_address remote device address
7795 * @param[in] handle attribute handle
7797 * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7798 * when TDS data is received from Remote provider
7800 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7801 const char *handle);
7804 * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7806 * @brief Enables CCCD on Remote Provider.
7808 * This function is an asynchronous call.
7810 * @return BLUETOOTH_ERROR_NONE - Success \n
7811 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7812 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7813 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7814 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7817 * @param[in] device_address remote device address
7818 * @param[in] handle attribute handle
7820 * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7821 * when Indication is enabled on Remote provider
7823 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7824 const char *handle);
7827 * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7828 * unsigned char *buf, int length);
7829 * @brief Sends activation request for Alternate Transport enable on Remote Provider
7831 * This function is an asynchronous call.
7833 * @return BLUETOOTH_ERROR_NONE - Success \n
7834 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7835 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7836 * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7837 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7840 * @param[in] device_address remote device address
7841 * @param[in] handle attribute handle
7842 * @param[in] buf Control point activation param
7843 * @param[in] param length
7845 * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7846 * is received from remote Provider
7848 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7849 unsigned char *buf, int length);
7852 * @fn int bluetooth_otp_server_init(const char *directory);
7854 * @brief Starts OTP server.
7856 * This function is a synchronous call.
7866 int bluetooth_otp_server_init(const char *directory);
7869 * @fn int bluetooth_otp_server_deinit();
7871 * @brief Stops OTP server.
7873 * This function is a synchronous call.
7883 int bluetooth_otp_server_deinit();
7886 * @fn int bluetooth_otp_enable_notification(const char *handle);
7888 * @brief Enable notification for remote OACP & OLCP characteristics.
7890 * This function is a synchronous call.
7900 int bluetooth_otp_enable_notification(const char *handle);
7903 * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7904 * unsigned char *buf, int length);
7906 * @brief Write value on remote characteristics.
7908 * This function is a synchronous call.
7918 int bluetooth_otp_write_characteristics_value(const char *handle,
7919 unsigned char *buf, int length);
7922 * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7924 * @brief Read value for remote characteristics.
7926 * This function is a synchronous call.
7936 int bluetooth_otp_read_characteristic_value(const char *handle);
7939 * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7941 * @brief Read value for remote characteristics.
7943 * This function is a synchronous call.
7953 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7956 * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7958 * @brief Read value for remote characteristics.
7960 * This function is a synchronous call.
7970 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7973 * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7974 * @brief Check if Adapter supports LE 2M PHY feature or not.
7976 * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7977 * in BT 5.0 specification.
7979 * This function is a synchronous call.
7981 * @return BLUETOOTH_ERROR_NONE - Success \n
7982 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
7983 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
7984 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
7985 * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7989 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7992 * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7993 * @brief Check if Adapter supports LE 2M CODED feature or not.
7995 * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7996 * in BT 5.0 specification.
7998 * This function is a synchronous call.
8000 * @return BLUETOOTH_ERROR_NONE - Success \n
8001 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8002 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8003 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8004 * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
8008 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
8011 * @fn int bluetooth_is_le_extended_advertising_supported(gboolean *is_supported)
8012 * @brief Check if Adapter supports LE Extended Advertising feature or not.
8014 * This API is used to check whether LE Adapter supports LE Extended Advertising feature, which is introduced
8015 * in BT 5.0 specification.
8017 * This function is a synchronous call.
8019 * @return BLUETOOTH_ERROR_NONE - Success \n
8020 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8021 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8022 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8023 * @param[out] is_supported. This boolean variable indicates whether LE Extended Advertising is supported or not
8027 int bluetooth_is_le_extended_advertising_supported(gboolean *is_supported);
8030 * @fn int bluetooth_is_le_extended_scan_supported(gboolean *is_supported)
8031 * @brief Check if Adapter supports LE Extended Scan feature or not.
8033 * This API is used to check whether LE Adapter supports LE Extended Scan feature, which is introduced
8034 * in BT 5.0 specification.
8036 * This function is a synchronous call.
8038 * @return BLUETOOTH_ERROR_NONE - Success \n
8039 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8040 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8041 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8042 * @param[out] is_supported. This boolean variable indicates whether LE Extended Scan is supported or not
8046 int bluetooth_is_le_extended_scan_supported(gboolean *is_supported);
8049 * @fn int bluetooth_le_get_maximum_advertising_data_length(gint *data_length)
8050 * @brief gives the maximum advertising data length supported by controller.
8052 * This API is used to get the maximum advertising data length supported by controller. This feature is introduced
8053 * in BT 5.0 specification.
8055 * This function is a synchronous call.
8057 * @return BLUETOOTH_ERROR_NONE - Success \n
8058 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
8059 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8060 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8061 * @param[out] data_length. This integer variable indicates the maximum advertising data length supported by the controller
8065 int bluetooth_le_get_maximum_advertising_data_length(gint *data_length);
8068 * @fn int bluetooth_l2cap_le_create_socket(int psm)
8069 * @brief Register l2cap_le socket with a specific PSM
8072 * This API register l2cap_le socket with the given PSM. The return value of this API is the socket
8073 * descriptor of the server.
8074 * This is the first API which is called to create the server. Once we created the server socket,
8075 * we will listen on that return socket.
8076 * So a bluetooth_l2cap_le_listen_and_accept should follow this API call. This is a synchronous call.
8079 * @return socket FD on Success \n
8080 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8081 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
8082 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
8083 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8084 * @param[in] int psm
8087 * @see bluetooth_l2cap_le_listen_and_accept, bluetooth_l2cap_le_remove_socket
8092 fd = bluetooth_l2cap_le_create_socket(test_psm);
8096 int bluetooth_l2cap_le_create_socket(int psm);
8099 * @fn int bluetooth_l2cap_le_remove_socket(int socket_fd)
8100 * @brief De-register the l2cap_le socket
8103 * This API deregister l2cap_le socket with the given socket fd. If the remote device is
8104 * already connected then we will receive the BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED with socket
8105 * descriptor else no event will come. We will call this API only after the
8106 * bluetooth_l2cap_le_listen_and_accept.
8107 * This is a synchronous call.
8109 * @return BLUETOOTH_ERROR_NONE - Success \n
8110 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8111 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
8112 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8113 * @param[in] int socket_fd
8116 * @see bluetooth_l2cap_le_create_socket, bluetooth_l2cap_le_listen_and_accept
8119 void bt_event_callback(int event, bluetooth_event_param_t *param)
8123 case BLUETOOTH_EVENT_L2CAP_LE_DISCONNECTED:
8125 bluetooth_l2cap_le_connection_t *discon_ind =
8126 (bluetooth_l2cap_le_connection_t *)param->param_data;
8128 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
8136 fd = bluetooth_l2cap_le_create_socket(test_psm);
8137 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8139 ret = bluetooth_l2cap_le_remove_socket(fd);
8142 int bluetooth_l2cap_le_remove_socket(int socket_fd);
8145 * @fn int bluetooth_l2cap_le_server_disconnect(int socket_fd)
8146 * @brief Disconnect l2cap_le connection
8149 * Disconnect a specific(device node fd) l2cap_le connection. This is a Synchronous call and there
8150 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8153 * @return BLUETOOTH_ERROR_NONE - Success \n
8154 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8155 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8156 * @param[in] int socket_fd
8162 ret = bluetooth_l2cap_le_server_disconnect(g_ret_fd);
8164 printf("Disconnection failed");
8166 printf("Disconnection Success");
8170 int bluetooth_l2cap_le_server_disconnect(int socket_fd);
8173 * @fn int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection)
8174 * @brief L2CAP_LE socket listen
8177 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8178 * after the bluetooth_l2cap_le_create_socket API.
8179 * This API listen for the incoming connection and once it receives a connection, it will give
8180 * BLUETOOTH_EVENT_L2CAP_LE_CONNECTED
8181 * event to the application. This is an Asynchronous API call.
8184 * @return BLUETOOTH_ERROR_NONE - Success \n
8185 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8186 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8188 * @param[in] int socket_fd
8189 * @param[in] max pending connection.
8192 * @see bluetooth_l2cap_le_create_socket
8195 void bt_event_callback(int event, bluetooth_event_param_t* param)
8199 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8201 bluetooth_l2cap_le_connection_t *conn_ind =
8202 (bluetooth_l2cap_le_connection_t *)param->param_data;
8204 printf("\nConnected from FD %d", conn_ind->socket_fd);
8212 fd = bluetooth_l2cap_le_create_socket(test_psm);
8213 ret = bluetooth_l2cap_le_listen_and_accept(fd, 1);
8217 int bluetooth_l2cap_le_listen_and_accept(int socket_fd, int max_pending_connection);
8220 * @fn int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection)
8221 * @brief L2cap_le socket listen
8224 * This API make l2cap_le socket listen and accept with socket. We will call this API immediately
8225 * after the bluetooth_l2cap_le_create_socket API.
8226 * This API listen for the incoming connection and once it receives a connection, it will give
8227 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE
8228 * event to the application. This is an Asynchronous API call.
8231 * @return BLUETOOTH_ERROR_NONE - Success \n
8232 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8233 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
8235 * @param[in] int socket_fd
8236 * @param[in] max pending connection.
8239 * @see bluetooth_l2cap_le_create_socket
8242 void bt_event_callback(int event, bluetooth_event_param_t* param)
8246 case BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE:
8248 char *name = (char *)param->param_data;
8250 printf("\nConnected from %s", name);
8252 bluetooth_l2cap_le_accept_connection();
8260 fd = bluetooth_l2cap_le_create_socket(test_psm);
8261 ret = bluetooth_l2cap_le_listen(fd, 1);
8265 int bluetooth_l2cap_le_listen(int socket_fd, int max_pending_connection);
8268 * @fn int bluetooth_l2cap_le_accept_connection()
8269 * @brief Accepts the authorization request indicated by the event
8270 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8272 * This function is a synchronous call.
8274 * @return BLUETOOTH_ERROR_NONE - Success \n
8275 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8277 * @param[in] the socket fd of the server
8278 * @param[out] the socket fd of the client
8282 * @see bluetooth_l2cap_le_reject_connection
8284 int bluetooth_l2cap_le_accept_connection(int server_fd);
8287 * @fn int bluetooth_l2cap_le_reject_connection()
8288 * @brief Rejects the authorization request indicated by the event
8289 * BLUETOOTH_EVENT_L2CAP_LE_AUTHORIZE.
8291 * This function is a synchronous call.
8293 * @return BLUETOOTH_ERROR_NONE - Success \n
8294 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
8296 * @param[in] the socket fd of the server
8300 * @see bluetooth_l2cap_le_accept_connection
8302 int bluetooth_l2cap_le_reject_connection(int server_fd);
8305 * @fn gboolean bluetooth_l2cap_le_is_server_psm_available(int psm)
8306 * @brief Informs whether l2cap_le server psm is available or not.
8308 * This function is a synchronous call.
8310 * @return TRUE - L2CAP_LE PSM is available \n
8311 * FALSE - L2CAP_LE PSM is not available \n
8313 * @param[in] psm (int)
8319 gboolean bluetooth_l2cap_le_is_server_psm_available(int psm);
8322 * @fn int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8324 * @brief Connect to the remote device l2cap_le *
8326 * Connect to a specific l2cap_le socket on a remote device psm. This is a Async call. Once
8327 * the connection is successful callback BLUETOOTH_EVENT_L2CAP_LE_CONNECTED events is generated,
8328 * which contains the socket_fd, device role (L2CAP_LE_ROLE_SERVER/L2CAP_LE_ROLE_CLIENT), device addess
8329 * etc. The socket_fd can be further used to send the data. It better to do a ble scanning before
8330 * initiating a connection.
8332 * @return BLUETOOTH_ERROR_NONE - Success \n
8333 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
8334 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8335 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
8336 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
8337 * @param[in] bluetooth_device_address_t remote bt_address
8338 * @param[in] int psm
8340 * @see bluetooth_l2cap_le_disconnect, bluetooth_l2cap_le_write
8344 void bt_event_callback(int event, bluetooth_event_param_t *param)
8348 case BLUETOOTH_EVENT_L2CAP_LE_CONNECTED:
8350 bluetooth_l2cap_le_connection_t *conn_ind =
8351 (bluetooth_l2cap_le_connection_t *)param->param_data;
8353 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
8354 (conn_ind->device_role == L2CAP_LE_ROLE_SERVER) ?
8355 "SERVER" : "CLIENT");
8360 bluetooth_device_address_t remote_address = {{0},};
8361 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
8362 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
8364 ret = bluetooth_l2cap_le_connect(&remote_address, test_psm);
8366 printf("Connection failed, Reason = %d", ret);
8368 printf("Connection Success, Ret = %d", ret);
8372 int bluetooth_l2cap_le_connect(const bluetooth_device_address_t *remote_bt_address,
8376 * @fn int bluetooth_l2cap_le_disconnect(int socket_fd)
8377 * @brief Disconnect l2cap_le connection
8380 * Disconnect a specific(device node fd) L2CAP_LE connection. This is a Synchronous call and there
8381 * is no callback events for this API. We have to provide the valid client fd to disconnect from the
8384 * @return BLUETOOTH_ERROR_NONE - Success \n
8385 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8386 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
8387 * @param[in] int remote socket_fd
8390 * @see bluetooth_l2cap_le_connect
8394 ret = bluetooth_l2cap_le_disconnect(g_ret_fd);
8396 printf("Disconnection failed");
8398 printf("Disconnection Success");
8403 int bluetooth_l2cap_le_disconnect(int socket_fd);
8406 * @fn int bluetooth_l2cap_le_write (int fd, const char *buf, int length)
8407 * @brief Write to l2cap_le connection
8410 * This API is used to send the data over the l2cap_le connection. This is a
8411 * synchronous API. The same API is used to send the data for server and the client.
8413 * @return BLUETOOTH_ERROR_NONE - Success \n
8414 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8415 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
8417 * @param[in] const char *buff Data buffer to send
8418 * @param[in] int length Length of the data
8421 * @see bluetooth_l2cap_le_connect
8424 char *buff = "Test data 123456789"
8425 ret = bluetooth_l2cap_le_write(g_ret_fd, buff, 15);
8427 printf("Send failed");
8429 printf("Send success");
8433 int bluetooth_l2cap_le_write(int fd, const char *buf, int length);
8436 * @fn gboolean bluetooth_l2cap_le_client_is_connected(
8437 * const bluetooth_device_address_t *device_address, gboolean *connected)
8438 * @brief Informs whether l2cap_le client is connected.
8440 * This function is a synchronous call.
8442 * @return TRUE - L2CAP_LE client is connected \n
8443 * FALSE - L2CAP_LE client is not connected \n
8449 int bluetooth_l2cap_le_client_is_connected(
8450 const bluetooth_device_address_t *device_address, gboolean *connected);
8453 * @fn gboolean bluetooth_l2cap_le_server_is_connected(
8454 * const bluetooth_device_address_t *device_address, gboolean *connected)
8455 * @brief Informs whether l2cap_le server is connected.
8457 * This function is a synchronous call.
8459 * @return TRUE - L2CAP_LE server is connected \n
8460 * FALSE - L2CAP_LE server is not connected \n
8466 int bluetooth_l2cap_le_server_is_connected(
8467 const bluetooth_device_address_t *device_address, gboolean *connected);
8470 * @fn gboolean bluetooth_l2cap_le_get_psm(int server_fd, int *psm)
8471 * @brief gives the psm of the specific l2cap_le socket connection.
8473 * This function is a synchronous call.
8475 * @return BLUETOOTH_ERROR_NONE - Success \n
8476 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
8477 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
8479 * @param[in] the socket fd of the server
8480 * @param[out] int *psm
8486 int bluetooth_l2cap_le_get_psm(int id, int *psm);
8495 #endif /* __cplusplus */
8496 #endif /* _BLUETOOTH_API_H_*/