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_
27 #endif /* __cplusplus */
30 * @defgroup BLUETOOTHFW BluetoothFW
32 * A base library for bluetooth framework
34 * @addtogroup BLUETOOTHFW
38 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
39 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
40 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
41 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
42 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
43 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
44 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
45 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
47 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
48 a device can support */
50 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
52 #define BLUETOOTH_UUID_STRING_MAX 50
53 #define BLUETOOTH_PATH_STRING 50
55 #define BLUETOOTH_OOB_DATA_LENGTH 16
57 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
60 * This is Bluetooth Connected event role
62 #define RFCOMM_ROLE_SERVER 1
63 #define RFCOMM_ROLE_CLIENT 2
66 * This is RFCOMM default Channel Value
68 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
71 * This is maximum length for search value string for PBAP Phonebook Search
73 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
76 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
80 * This is Bluetooth error code
82 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
84 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
85 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
87 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
88 /**< Callback error */
89 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
90 /**< invalid paramerror */
91 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
92 /**< invalid data error */
93 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
94 /**< Memory allocation error */
95 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
96 /**< out of memory error */
97 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
99 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
100 /**< No resource error */
101 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
102 /**< internal error */
103 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
104 /**< Not supported error */
105 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
106 /**< Operation is failed because
107 of not enabled BT Adapter */
108 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
109 /**< Enabling is failed because of
110 already enabled BT Adapter */
111 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
112 /**< Operation is failed because of
113 other on going operation */
114 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
115 /**< access denied error */
116 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
117 /**< max client error */
118 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
119 /**< not found error */
120 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
121 /**< service search fail */
122 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
123 /**< pairing failed error */
124 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
125 /**< Not paired error */
126 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
127 /**< no service error */
128 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
129 /**< no connection error */
130 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
131 /**< alread connected error */
132 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
133 /**< connection busy error */
134 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
135 /**< connection error */
136 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
137 /**< max connection error*/
138 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
139 /**< Not in operation */
140 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
141 /**< Cancelled by user */
142 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
143 /**< Service record registration failed */
144 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
145 /**< Operation in progress */
146 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
147 /**< authentication failed error when paring*/
148 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
149 /**< Remote host is down */
150 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
151 /**< End of device list */
153 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
154 /**< Obex agent already exists */
155 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
156 /**< Obex agent does not exist */
158 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
159 /**< Already initialized */
161 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
162 /**< Permission deined */
164 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
165 /**< Nap already done */
167 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
168 /**< Not initialized */
170 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
171 /**< Authentication rejected */
173 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
174 /**< Device Policy Restricted */
177 * Device disconnection reasons; received from stack
179 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
180 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
181 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
182 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
183 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
184 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
185 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
186 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
187 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
188 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
189 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
194 * Device disconnect reason
197 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
198 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
199 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
200 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
201 } bluetooth_device_disconnect_reason_t;
204 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
207 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
208 } bluetooth_device_address_t;
211 * This is Bluetooth device address type
214 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
215 BLUETOOTH_DEVICE_RANDOM_ADDRESS
216 } bluetooth_device_address_type_t;
219 * This is Bluetooth version
222 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
223 } bluetooth_version_t;
226 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
229 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
230 } bluetooth_device_name_t;
233 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
236 int data_len; /**< manafacturer specific data length */
237 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
238 } bluetooth_manufacturer_data_t;
241 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
242 } bluetooth_device_pin_code_t;
248 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
249 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
250 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
251 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
252 } bluetooth_adapter_state_t;
258 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
259 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
260 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
261 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
262 } bluetooth_adapter_le_state_t;
268 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
269 /*Changed the order to make it compatable with old method */
270 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
271 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
272 /**< Discoverable mode with time limit
273 After specific timeout, it is changed
274 to non discoverable mode */
275 } bluetooth_discoverable_mode_t;
278 * Network connect mode
281 BLUETOOTH_NETWORK_PANU_ROLE,
283 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
284 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
285 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
286 } bluetooth_network_role_t;
292 BLUETOOTH_RFCOMM_SERVICE = 0x01,
293 BLUETOOTH_A2DP_SERVICE = 0x02,
294 BLUETOOTH_HSP_SERVICE = 0x04,
295 BLUETOOTH_HID_SERVICE = 0x08,
296 BLUETOOTH_NAP_SERVICE = 0x10,
297 BLUETOOTH_HFG_SERVICE = 0x20,
298 BLUETOOTH_GATT_SERVICE = 0x40,
299 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
300 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
301 BLUETOOTH_PBAP_SERVICE = 0x200,
302 } bluetooth_service_type_t;
308 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
309 /* represents that connection
310 * type can both BR/EDR and LE */
311 BLUETOOTH_DEV_CONN_BREDR = 0x00,
312 BLUETOOTH_DEV_CONN_LE = 0x01,
313 } bluetooth_conn_type_t;
319 BLUETOOTH_CODEC_ID_CVSD = 0x01,
320 BLUETOOTH_CODEC_ID_MSBC = 0x02,
321 } bluetooth_codec_type_t;
327 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
328 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
329 } bluetooth_hf_audio_connected_type_t;
335 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
336 } bluetooth_advertising_data_t;
342 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
343 } bluetooth_scan_resp_data_t;
346 * Advertising filter policy
349 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
350 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
351 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
352 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
353 } bluetooth_advertising_filter_policy_t;
359 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
360 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
361 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
362 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
363 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
364 } bluetooth_advertising_type_t;
367 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
368 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
369 } bluetooth_gatt_service_change_type_t;
372 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
373 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
374 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
375 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
376 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
377 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
378 } bt_gatt_permission_t;
381 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
382 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
383 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
384 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
385 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
386 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
387 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
388 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
389 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
390 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
391 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
392 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
393 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
394 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
395 } bt_gatt_characteristic_property_t;
398 * Remote device request types for attributes
401 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
402 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
403 } bluetooth_gatt_att_request_tyep_t;
406 * Proximity Property Type
409 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
410 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
411 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
412 } bluetooth_pxp_poperty_t;
415 * Advertising parameters
420 guint8 filter_policy;
422 } bluetooth_advertising_params_t;
428 int type; /**< passive 0, active 1 */
429 float interval; /**< LE scan interval */
430 float window; /**< LE scan window */
431 } bluetooth_le_scan_params_t;
441 } bluetooth_le_connection_param_t;
444 LE Read Maximum Data Length
447 guint16 max_tx_octets;
449 guint16 max_rx_octets;
451 } bluetooth_le_read_maximum_data_length_t;
454 LE Read Host suggested default Data Length
457 guint16 def_tx_octets;
459 } bluetooth_le_read_host_suggested_data_length_t;
462 * Samsung XSAT Vendor dependent command
467 } bluetooth_vendor_dep_at_cmd_t;
473 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
474 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
475 } bluetooth_opp_transfer_type_t;
480 } bluetooth_hf_ciev_device_event_t;
482 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
483 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
484 /**< Base ID for GAP Event */
485 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
486 /**< Base ID for SDP events */
487 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
488 /**< Base ID for RFCOMM events */
489 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
490 /**< Base ID for NETWORK events */
491 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
492 /**< Base ID for HDP events */
493 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
494 /**< Base ID for OPC events */
495 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
496 /**< Base ID for Obex Server events */
497 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
498 /**< Base ID for GATT events */
500 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
501 /**< Base ID for Audio events */
502 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
503 /**< Base ID for HID events */
504 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
505 /**< Base ID for Advertising events */
506 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
507 /**< Base ID for PBAP Client events */
508 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
509 /**< Base ID for AVRCP events */
510 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
511 /**< Base ID for IPSP events */
514 * Bluetooth event type
517 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
519 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
520 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
521 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
522 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
523 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
524 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
525 /**< Bluetooth event Discoverable timeout requested*/
526 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
527 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
528 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
529 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
530 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
531 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
532 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
533 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
534 BLUETOOTH_EVENT_REMOTE_IBEACON_DEVICE_FOUND, /**< Bluetooth event remote ibeacon device found (iBeacon LE dev) */
535 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
536 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
537 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
538 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
539 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
540 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
541 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
542 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
543 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
544 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
545 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
546 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
547 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
549 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
550 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
551 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
552 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
553 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
555 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
556 /**< Bluetooth event serice search base id */
557 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
558 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
559 /**< RFCOMM data receive event */
560 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
561 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
563 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
565 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
566 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
568 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
570 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
571 /**< Bluetooth Network event */
572 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
573 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
574 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
575 /**< Network disconnected evnet in server */
577 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
578 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
580 BLUETOOTH_EVENT_HDP_CONNECTED
581 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
582 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
583 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
585 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
586 /* OPC Connected event */
587 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
588 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
589 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
590 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
592 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
593 /* Obex server authorize event*/
594 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
595 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
596 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
597 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
598 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
599 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
601 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
602 /**<Discovered GATT service characteristics event*/
603 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
604 /**<Remote GATT charateristic value changed event*/
605 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
606 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
607 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
608 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
609 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
610 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
611 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
612 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
613 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
614 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
615 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
616 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
617 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
618 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
619 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
621 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
622 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
623 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
624 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
625 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
626 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
627 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
628 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
629 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
630 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
631 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
632 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
633 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
634 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
635 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
636 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
637 BLUETOOTH_EVENT_HF_CONNECTED,
638 BLUETOOTH_EVENT_HF_DISCONNECTED,
639 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
640 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
641 BLUETOOTH_EVENT_HF_RING_INDICATOR,
642 BLUETOOTH_EVENT_HF_CALL_WAITING,
643 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
644 BLUETOOTH_EVENT_HF_CALL_STARTED,
645 BLUETOOTH_EVENT_HF_CALL_ENDED,
646 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
647 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
648 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
649 BLUETOOTH_EVENT_HF_CALL_STATUS,
650 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
651 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
652 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
653 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
654 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
655 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
656 BLUETOOTH_EVENT_HF_CALL_IDLE,
657 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
658 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
659 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
661 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
662 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
663 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
664 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
665 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
667 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
668 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
669 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
670 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
671 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
672 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
673 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
674 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
676 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
677 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
678 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
679 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
680 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
681 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
682 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
684 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
685 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
686 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
687 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
688 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
689 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
690 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
691 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
692 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
694 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
695 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
696 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
697 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
698 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
699 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
700 } bluetooth_event_type_t;
703 * This bt_service_uuid_list_t enum indicates service uuid list .
704 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
708 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
709 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
710 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
711 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
712 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
713 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
714 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
715 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
716 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
717 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
718 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
719 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
721 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
722 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
723 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
724 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
725 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
726 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
727 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
728 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
729 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
730 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
731 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
732 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
733 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
734 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
736 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
737 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
738 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
739 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
740 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
741 /**<DIRECT PRINTING*/
742 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
743 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
744 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
745 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
746 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
747 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
748 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
749 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
750 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
751 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
752 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
753 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
754 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
755 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
756 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
757 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
758 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
759 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
760 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
761 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
762 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
763 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
764 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
765 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
766 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
767 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
768 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
769 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
770 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
771 } bluetooth_service_uuid_list_t;
774 * Service class part of class of device returned from device discovery
777 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
778 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
779 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
780 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
781 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
782 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
783 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
784 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
785 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
786 } bluetooth_device_service_class_t;
790 * Major device mask (For device discovery)
793 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
794 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
795 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
796 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
797 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
798 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
799 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
800 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
801 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
802 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
803 } bluetooth_device_major_mask_t;
807 * Major device class (part of Class of Device)
810 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
811 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
812 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
813 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
814 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
815 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
816 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
817 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
818 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
819 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
820 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
821 } bluetooth_device_major_class_t;
824 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
826 /* About Computer Major class */
827 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
829 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
830 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
831 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
832 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
833 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
835 /* About Phone Major class */
836 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
837 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
838 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
839 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
840 /**< voice gateway minor class */
841 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
843 /* About LAN/Network Access Point Major class */
844 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
845 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
846 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
847 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
848 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
849 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
850 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
851 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
853 /* About Audio/Video Major class */
854 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
855 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
857 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
858 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
859 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
860 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
861 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
862 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
863 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
864 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
865 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
866 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
867 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
868 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
869 /**< Video Display and Loud
870 Speaker minor class */
871 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
874 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
876 /* About Peripheral Major class */
877 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
878 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
879 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
880 /**< Combo Keyboard or pointing
883 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
884 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
885 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
886 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
887 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
888 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
889 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
890 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
891 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
893 /* About Imaging Major class */
894 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
895 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
896 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
897 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
899 /* About Wearable Major class */
900 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
901 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
902 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
903 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
904 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
906 /* About Toy Major class */
907 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
908 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
909 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
910 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
911 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
913 /* About Health Major class */
914 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
915 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
916 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
917 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
918 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
919 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
920 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
921 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
922 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
923 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
924 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
925 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
926 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
927 } bluetooth_device_minor_class_t;
930 * structure to hold the device information
933 bluetooth_device_major_class_t major_class; /**< major device class */
934 bluetooth_device_minor_class_t minor_class; /**< minor device class */
935 bluetooth_device_service_class_t service_class;
936 /**< service device class */
937 } bluetooth_device_class_t;
940 * Discovery Role types
943 DISCOVERY_ROLE_BREDR = 0x1,
945 DISCOVERY_ROLE_LE_BREDR
946 } bt_discovery_role_type_t;
949 * Connected state types
952 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
953 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
954 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
955 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
956 } bluetooth_connected_link_t;
962 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
963 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
964 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
965 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
966 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
967 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
968 } bluetooth_le_scan_filter_feature_t;
974 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
975 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
976 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
977 } bluetooth_le_connection_mode_t;
980 * structure to hold the device information
983 bluetooth_device_address_t device_address; /**< device address */
984 bluetooth_device_name_t device_name; /**< device name */
985 bluetooth_device_class_t device_class; /**< device class */
986 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
987 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
989 int rssi; /**< received strength signal*/
990 gboolean paired; /**< paired flag */
991 bluetooth_connected_link_t connected; /**< connected link type */
992 gboolean trust; /**< trust flag */
993 gboolean is_alias_set; /** is device alias set flag**/
994 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
995 } bluetooth_device_info_t;
998 * structure to hold the LE device information
1001 int data_len; /**< manafacturer specific data length */
1002 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1003 } bluetooth_le_advertising_data_t;
1006 bluetooth_device_address_t device_address; /**< device address */
1007 int addr_type; /**< address type*/
1008 int rssi; /**< received strength signal*/
1009 bluetooth_le_advertising_data_t adv_ind_data;
1010 bluetooth_le_advertising_data_t scan_resp_data;
1011 } bluetooth_le_device_info_t;
1014 bluetooth_device_address_t device_address; /**< device address */
1015 int addr_type; /**< address type*/
1016 int rssi; /**< received strength signal*/
1018 int company_id; /** <Company ID> */
1019 int ibeacon_type; /** <iBeacon type> */
1020 int major_id; /** <Major ID> */
1021 int minor_id; /** <Minor ID> */
1022 int measured_power; /** <Measured Power value for proximity> */
1023 int uuid_len; /** <uuid string len> */
1024 char uuid[BLUETOOTH_UUID_STRING_MAX]; /** <customr/specific UUID> */
1025 } bluetooth_ibeacon_device_info_t;
1029 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1030 bluetooth_device_address_t device_address; /**< device address */
1031 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1032 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1033 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1034 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1035 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1036 bluetooth_le_advertising_data_t service_data; /**< service data */
1037 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1038 int manufacturer_id; /**< manufacturer ID */
1039 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1040 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1041 } bluetooth_le_scan_filter_t;
1044 bluetooth_device_address_t device_address; /**< device address */
1045 unsigned int mtu; /** < MTU set for the ATT connection */
1046 unsigned int status; /** < status of the MTU exchange */
1047 } bluetooth_le_att_mtu_info_t;
1050 * structure to hold the paired device information
1053 bluetooth_device_address_t device_address; /**< paired device address */
1054 bluetooth_device_name_t device_name; /**< device name */
1055 bluetooth_device_class_t device_class; /**< device class */
1056 } bluetooth_paired_device_info_t;
1059 * structure to hold the paired device information
1062 bluetooth_device_address_t device_address;
1063 /**< device address */
1064 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1065 /**< network interface name */
1066 } bluetooth_network_device_info_t;
1069 * Authentication event types
1073 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1074 BLUETOOTH_AUTH_PIN_REQUEST,
1075 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1076 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1077 } bluetooth_auth_type_t;
1080 * structure to hold the pincode/pass-key req informations
1083 bluetooth_device_address_t device_address; /**< remote device address */
1084 bluetooth_device_name_t device_name; /**< device name */
1085 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1086 } bluetooth_authentication_request_info_t;
1089 * Stucture to hold discovery option
1092 unsigned short max_response; /**< the number of maximum response */
1093 unsigned short discovery_duration;
1094 /**< duration of discovery (seconds) */
1095 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1096 classOfDevice variable */
1097 } bluetooth_discovery_option_t;
1100 * Stucture to hold event information
1103 int event; /**< event type */
1104 int result; /**< Success or error value */
1106 /**<parameter data pointer */
1108 } bluetooth_event_param_t;
1111 bluetooth_device_address_t device_addr;
1112 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1113 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1114 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1119 bluetooth_device_address_t device_addr;
1120 unsigned char addr_type;
1122 } bt_connection_info_t;
1125 * Stucture to rfcomm receive data
1130 /**< the socket fd */
1131 int buffer_size;/**< the length of the receive buffer */
1133 /**< the receive data buffer */
1134 } bluetooth_rfcomm_received_data_t;
1140 HTYPE_TRANS_HANDSHAKE,
1141 HTYPE_TRANS_HID_CONTROL,
1142 HTYPE_TRANS_GET_REPORT,
1143 HTYPE_TRANS_SET_REPORT,
1144 HTYPE_TRANS_GET_PROTOCOL,
1145 HTYPE_TRANS_SET_PROTOCOL,
1148 } bt_hid_header_type_t;
1154 PTYPE_DATA_RTYPE_INPUT,
1155 PTYPE_DATA_RTYPE_OUTPUT
1156 } bt_hid_param_type_t;
1159 * Stucture to hid receive data
1162 const char *address;
1163 bt_hid_header_type_t type;
1164 /**< Header type containing */
1165 bt_hid_param_type_t param;
1166 /**< Param type in header like INPUT Report or OutPut Report */
1167 int buffer_size;/**< the length of the receive buffer */
1169 /**< the receive data buffer */
1170 } bluetooth_hid_received_data_t;
1173 * Stucture to rfcomm connection
1177 int socket_fd; /**< the socket fd */
1178 int server_id; /* Server id */
1179 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1180 bluetooth_device_address_t device_addr;
1181 /**< device address */
1182 char uuid[BLUETOOTH_UUID_STRING_MAX];
1183 } bluetooth_rfcomm_connection_t;
1186 * Stucture to rfcomm disconnection
1190 /**< the socket fd */
1191 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1192 bluetooth_device_address_t device_addr;
1193 /**< device address */
1194 char uuid[BLUETOOTH_UUID_STRING_MAX];
1195 } bluetooth_rfcomm_disconnection_t;
1199 /**< the socket fd */
1200 bluetooth_device_address_t device_addr;
1201 /**< device address */
1202 } bluetooth_rfcomm_connection_request_t;
1206 /**< the socket fd */
1207 bluetooth_device_address_t device_addr;
1208 /**< device address */
1209 } bluetooth_hid_request_t;
1218 } bt_hdp_qos_type_t;
1224 HDP_ROLE_SOURCE = 0x0,
1226 } bt_hdp_role_type_t;
1230 * Stucture to HDP connected
1233 const char *app_handle; /**< the application handle */
1234 unsigned int channel_id; /**< the channel id */
1235 bt_hdp_qos_type_t type; /**< the QOS type */
1236 bluetooth_device_address_t device_address; /**< the remote address */
1237 } bt_hdp_connected_t;
1240 * Stucture to HDP disconnected
1243 unsigned int channel_id; /**< the channel id */
1244 bluetooth_device_address_t device_address; /**< the remote address */
1245 } bt_hdp_disconnected_t;
1248 * Stucture to HDP data indication
1251 unsigned int channel_id; /**< the channel id */
1252 const char *buffer; /**< the RX data buffer */
1253 unsigned int size; /**< the RX data size */
1254 } bt_hdp_data_ind_t;
1257 * Stucture to OPP client transfer information
1264 } bt_opc_transfer_info_t;
1266 /* Obex Server transfer type */
1267 #define TRANSFER_PUT "PUT"
1268 #define TRANSFER_GET "GET"
1270 * Stucture to OPP/FTP Server authorize information
1277 } bt_obex_server_authorize_into_t;
1285 } bt_obex_server_type_t;
1288 * Stucture to OPP/FTP server transfer information
1296 unsigned long file_size;
1298 bt_obex_server_type_t server_type;
1300 unsigned char *contact_auth_info;
1301 } bt_obex_server_transfer_info_t;
1304 * Stucture to OPP/FTP server connection/disconnection information
1310 } bt_obex_server_connection_info_t;
1314 * Stucture to OOB data
1318 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1319 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1320 unsigned int hash_len;
1321 unsigned int randomizer_len;
1323 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1324 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1325 unsigned int hash256_len;
1326 unsigned int randomizer256_len;
1330 * Structure to GATT attribute handle data
1336 } bt_gatt_handle_info_t;
1339 * Structure to GATT Remote service data
1346 bt_gatt_handle_info_t include_handles;
1347 bt_gatt_handle_info_t char_handle;
1348 } bt_gatt_service_property_t;
1351 * Structure to GATT Remote characteristic data
1355 char *service_handle;
1356 bt_gatt_handle_info_t handle_info;
1357 } bt_gatt_discovered_char_t;
1360 * Structure to format of GATT Characteristic Value
1364 unsigned char format;
1365 unsigned char exponent;
1366 unsigned short unit;
1367 unsigned char name_space;
1368 unsigned short description;
1369 } bt_gatt_char_format_t;
1372 * Structure to GATT Characteristic property
1380 bt_gatt_char_format_t format;
1382 unsigned int val_len;
1383 unsigned int permission;
1384 char *representation;
1385 bt_gatt_handle_info_t char_desc_handle;
1386 } bt_gatt_char_property_t;
1389 * Structure to GATT Characteristic descriptor property
1396 unsigned int val_len;
1397 } bt_gatt_char_descriptor_property_t;
1400 * Structure to GATT Characteristic value
1407 } bt_gatt_char_value_t;
1410 * Structure to GATT Read Request
1414 char *service_handle;
1418 } bt_gatt_read_req_t;
1421 * Structure to GATT Value change
1425 char *service_handle;
1431 } bt_gatt_value_change_t;
1434 bluetooth_device_address_t device_addr;
1436 bluetooth_gatt_service_change_type_t change_type;
1437 } bt_gatt_service_change_t;
1440 * Structure to GATT characteristc Notification change
1444 char *service_handle;
1445 gboolean att_notify;
1446 } bt_gatt_char_notify_change_t;
1449 * Structure to Indication confirmation
1453 char *service_handle;
1456 } bt_gatt_indicate_confirm_t;
1459 * Structure to RSSI Signal Strength Alert
1470 * Structure to RSSI Signal Strength
1480 * Structure for RSSI Enabled or Disabled
1486 gboolean rssi_enabled;
1487 } bt_rssi_enabled_t;
1490 * Structure for RSSI Threshold
1495 int in_range_threshold;
1497 } bt_rssi_threshold_t;
1501 * Structure for Suppoted Profiles and Trusted Profiles
1508 } bt_supported_profile_trusted_t;
1511 * Structure for PBAP Folder Parameters
1514 unsigned char addressbook;
1515 unsigned char folder_type;
1519 * Structure for PBAP Pull application Parameters
1522 unsigned char format;
1523 unsigned char order;
1524 unsigned short offset;
1525 unsigned short maxlist;
1526 long long unsigned fields;
1527 } bt_pbap_pull_parameters_t;
1530 * Structure for PBAP List application Parameters
1533 unsigned char order;
1534 unsigned short offset;
1535 unsigned short maxlist;
1536 } bt_pbap_list_parameters_t;
1539 * Structure for PBAP Pull vCard application Parameters
1542 unsigned char format;
1543 long long unsigned fields;
1545 } bt_pbap_pull_vcard_parameters_t;
1548 * Structure for PBAP Search application Parameters
1551 unsigned char order;
1552 unsigned short offset;
1553 unsigned short maxlist;
1554 unsigned char search_attribute;
1555 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1556 } bt_pbap_search_parameters_t;
1559 * Structure for PBAP Connection Status
1562 bluetooth_device_address_t btaddr;
1564 } bt_pbap_connected_t;
1567 * Structure for PBAP Phonebook Size
1570 bluetooth_device_address_t btaddr;
1572 } bt_pbap_phonebook_size_t;
1575 * Structure for PBAP Phonebook Pull
1578 bluetooth_device_address_t btaddr;
1581 } bt_pbap_phonebook_pull_t;
1584 * Structure for PBAP vCard List
1587 bluetooth_device_address_t btaddr;
1591 } bt_pbap_vcard_list_t;
1594 * Structure for PBAP vCard Pull
1597 bluetooth_device_address_t btaddr;
1600 } bt_pbap_vcard_pull_t;
1603 * Structure for PBAP Phonebook search List
1606 bluetooth_device_address_t btaddr;
1610 } bt_pbap_phonebook_search_list_t;
1613 * Stucture to HF Call status information
1617 char *number; /*Phone Number */
1618 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1619 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1620 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1621 int idx; /*Call index/ID */
1622 } bt_hf_call_status_info_t;
1627 } bt_hf_call_list_s;
1633 TRUSTED_PROFILE_PBAP = 1,
1634 TRUSTED_PROFILE_MAP,
1635 TRUSTED_PROFILE_SAP,
1636 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1637 } bluetooth_trusted_profile_t;
1640 * Restricted Profile types
1643 RESTRICTED_PROFILE_HFP_HS = 1,
1644 RESTRICTED_PROFILE_A2DP,
1645 } bluetooth_restricted_profile_t;
1648 * Structure for LE data length change params
1651 bluetooth_device_address_t device_address;
1652 guint16 max_tx_octets;
1653 guint16 max_tx_time;
1654 guint16 max_rx_octets;
1655 guint16 max_rx_time;
1656 } bt_le_data_length_params_t;
1659 * Structure for proximity property change params
1662 bluetooth_device_address_t device_address;
1666 } bt_pxp_property_changed_params_t;
1669 * @brief DPM BT allowance state
1673 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1674 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1675 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1676 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1680 * @brief DPM API result
1684 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1685 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1686 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1687 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1688 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1689 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1693 * @brief DPM Policy status
1697 BLUETOOTH_DPM_STATUS_ERROR = -1,
1699 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1700 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1702 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1703 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1705 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1706 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1710 /* policy-group : BLUETOOTH */
1711 BLUETOOTH_DPM_POLICY_ALLOW,
1712 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1713 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1714 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1715 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1716 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1717 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1718 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1719 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1720 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1721 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1722 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1723 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1724 BLUETOOTH_DPM_POLICY_END,
1725 } bt_dpm_policy_cmd_t;
1728 struct bt_dpm_policy {
1734 typedef struct bt_dpm_policy bt_dpm_policy_t;
1737 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1738 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1739 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1740 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1741 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1742 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1743 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1744 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1745 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1746 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1747 BLUETOOTH_DPM_PROFILE_NONE,
1750 struct bt_dpm_profile_val {
1751 int value; /* tells whether the profile is enabled or disabled */
1753 typedef struct dpm_profile_val dpm_profile_state_t;
1756 * Structure to DPM device list
1760 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1761 } bt_dpm_device_list_t;
1764 * Structure to DPM uuid list
1768 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1769 } bt_dpm_uuids_list_t;
1772 * Structure for IPSP Interface Info
1775 bluetooth_device_address_t btaddr;
1777 } bt_ipsp_connection_info_t;
1780 * Callback pointer type
1782 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1785 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1786 * @brief Set the callback function pointer for bluetooth event
1789 * This API will register the callback function, when any response and event are received from
1790 * bluetooth framework. @n
1791 * this registered callback function will be get called with appropriate event and data structures.
1792 * This function is a synchronous call. An application developer can call
1793 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1794 * type. This registered function will receive events of bluetooth_event_type_t type along with
1798 * @param[in] callback_ptr A pointer to the callback function
1799 * @param[in] user_data A pointer to user data
1800 * @return BLUETOOTH_ERROR_NONE - Success
1804 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1806 GMainLoop *main_loop = (GMainLoop*) user_data;
1810 // Code for each event
1812 g_main_loop_quit(main_loop);
1819 GMainLoop *main_loop = NULL;
1822 main_loop = g_main_loop_new(NULL, FALSE);
1823 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1824 if (ret >= BLUETOOTH_ERROR_NONE)
1826 // bluetooth_register_callback returned Success
1830 // bluetooth_register_callback returned failiure
1832 g_main_loop_run(main_loop);
1836 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1839 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1840 * @brief Set the callback function pointer for bluetooth le event
1843 * This API will register the callback function, when any response and event are received from
1844 * bluetooth framework. @n
1845 * this registered callback function will be get called with appropriate event and data structures.
1846 * This function is a synchronous call. An application developer can call
1847 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1848 * type. This registered function will receive events of bluetooth_event_type_t type along with
1852 * @param[in] callback_ptr A pointer to the callback function
1853 * @param[in] user_data A pointer to user data
1854 * @return BLUETOOTH_ERROR_NONE - Success
1858 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1861 * @fn int bluetooth_le_unregister_callback(void)
1862 * @brief Set the callback function pointer for bluetooth le event
1865 * This API will register the callback function, when any response and event are received from
1866 * bluetooth framework. @n
1867 * this registered callback function will be get called with appropriate event and data structures.
1868 * This function is a synchronous call. An application developer can call
1869 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1870 * type. This registered function will receive events of bluetooth_event_type_t type along with
1875 * @return BLUETOOTH_ERROR_NONE - Success
1879 int bluetooth_le_unregister_callback(void);
1882 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1883 * @brief Set the callback function pointer for bluetooth event
1886 * This API will register the callback function, when any response and event are received from
1887 * bluetooth framework. @n
1888 * this registered callback function will be get called with appropriate event and data structures.
1889 * This function is a synchronous call. An application developer can call
1890 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1891 * type. This registered function will receive events of bluetooth_event_type_t type along with
1896 * @return BLUETOOTH_ERROR_NONE - Success
1900 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1902 GMainLoop *main_loop = (GMainLoop*) user_data;
1906 // Code for each event
1908 g_main_loop_quit(main_loop);
1915 GMainLoop *main_loop = NULL;
1918 main_loop = g_main_loop_new(NULL, FALSE);
1919 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1920 if (ret >= BLUETOOTH_ERROR_NONE)
1922 // bluetooth_register_callback returned Success
1926 // bluetooth_register_callback returned failiure
1928 ret = bluetooth_deregister_callback(void);
1929 g_main_loop_run(main_loop);
1933 int bluetooth_unregister_callback(void);
1936 * @fn int bluetooth_enable_adapter(void)
1937 * @brief Enable the Bluetooth H/W
1940 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1941 * send request to bluetooth chip for activation.
1942 * This function is typically called at startup or when Bluetooth services are required. This
1943 * function must be called before calling any other API of Bluetooth operations.
1945 * Before performing any operations like Device discover, service search etc.., the adapter must be
1948 * This function is a asynchronous call.
1949 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1950 * through registered callback function with appropriate result code
1951 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1952 * BLUETOOTH_ERROR_NONE - Success \n
1954 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1955 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1957 * @return BLUETOOTH_ERROR_NONE - Success\n
1958 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1959 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1960 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1961 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1963 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1965 void bt_event_callback(int event, bluetooth_event_param_t *param)
1969 case BLUETOOTH_EVENT_ENABLED:
1970 if (param->result == BLUETOOTH_ERROR_NONE)
1972 // Successfully Enabled
1985 ret = bluetooth_enable_adapter();
1989 int bluetooth_enable_adapter(void);
1992 * @fn int bluetooth_disable_adapter(void)
1993 * @brief Disable the Bluetooth H/W
1996 * This function disables Bluetooth protocol stack and hardware. This function is called when
1997 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1999 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2000 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2001 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2003 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2006 * This function is a asynchronous call.
2007 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2008 * through registered callback function.
2011 * @return BLUETOOTH_ERROR_NONE - Success\n
2012 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2013 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2014 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2016 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2018 void bt_event_callback(int event, bluetooth_event_param_t *param)
2022 case BLUETOOTH_EVENT_DISABLED:
2023 if (param->result == BLUETOOTH_ERROR_NONE)
2025 // Successfully disabled
2038 ret = bluetooth_disable_adapter();
2041 int bluetooth_disable_adapter(void);
2042 int bluetooth_recover_adapter(void);
2043 int bluetooth_check_adapter_le(void);
2044 int bluetooth_enable_adapter_le(void);
2046 int bluetooth_disable_adapter_le(void);
2049 * @fn int bluetooth_reset_adapter(void)
2050 * @brief Reset the Bluetooth H/W and values
2053 * This function resets Bluetooth protocol stack and hardware. This function is called when
2054 * an user want to initialize Bluetooth environment.
2056 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2059 * This function is a synchronous call.
2061 * @return BLUETOOTH_ERROR_NONE - Success\n
2062 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2064 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2069 ret = bluetooth_reset_adapter();
2072 int bluetooth_reset_adapter(void);
2075 * @fn int bluetooth_is_supported(void)
2076 * @brief Check if the bluetooth is supported or not by the current target
2078 * This API checks whether the bluetooth is supported or not.
2079 * This API only run by root permission.
2081 * This function is a synchronous call.
2083 * @return 0 - if bluetooth is not supported\n
2084 * 1 - if bluetooth is supported\n
2085 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2090 ret = bluetooth_is_supported();
2093 int bluetooth_is_supported(void);
2097 * @fn int bluetooth_check_adapter(void)
2098 * @brief Check the current status of the Bluetooth adapter
2101 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2102 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2103 * bluetooth adapter.
2104 * This API get the adapter internal data structure and check current adapter status.
2106 * This function is a synchronous call.
2109 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2110 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2112 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2116 ret = bluetooth_check_adapter();
2119 int bluetooth_check_adapter(void);
2122 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2123 * @brief Get the local adapter bluetooth address
2126 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2127 * the adapter should be enabled.
2128 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2129 * contain Bluetooth address.
2130 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2131 * friendly name for each device.
2132 * There is no event callback for this API.
2134 * This function is a synchronous call.
2137 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2138 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2139 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2140 * @param[out] local_address a device address of local bluetooth adapter
2145 bluetooth_device_address_t local_address={0,};
2148 ret = bluetooth_get_local_address(&local_address);
2151 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2154 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2155 * @brief Get the hci version
2158 * This function is used to get the bluetooth hci version
2159 * Before calling this API make sure that the adapter is enabled.
2161 * This function is a synchronous call.
2164 * @return BLUETOOTH_ERROR_NONE - Success \n
2165 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2166 * @param[out] timeout remain visibility timeout value
2169 bluetooth_version_t *version;
2171 ret = bluetooth_get_local_version (&version);
2174 int bluetooth_get_local_version(bluetooth_version_t *version);
2177 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2178 * @brief Get the local device name
2181 * This function is used, get the local device name. Since its difficult to remember the Adapter
2182 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2183 * friendly name is retrived by the remote device and displaying.
2184 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2186 * This function is a synchronous call.
2189 * @return BLUETOOTH_ERROR_NONE - Success \n
2190 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2191 * @param[out] local_name a local device name
2195 bluetooth_device_name_t local_name={0,}
2197 ret = bluetooth_get_local_name (&local_name);
2200 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2203 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2204 * @brief Set the local device name
2207 * This function is used to set the local device name. This is a human friendly name whose
2208 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2210 * This function is a synchronous call.
2212 * @param[in] local_name bluetooth device name to set local device
2214 * @return BLUETOOTH_ERROR_NONE - Success \n
2215 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2216 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2217 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2218 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2219 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2224 bluetooth_device_name_t local_name={0,}
2226 ret = bluetooth_set_local_name (&local_name);
2229 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2233 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2234 * @brief Check if the uuid is used or not
2236 * This function is used to check if the uuid is used or not.
2238 * This function is a synchronous call.
2240 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2241 * @param[out] used if the uuid is used or not
2243 * @return BLUETOOTH_ERROR_NONE - Success \n
2244 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2245 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2246 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2251 gboolean used = FALSE;
2252 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2253 ret = bluetooth_is_service_used(uuid, &used);
2256 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2259 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2260 * @brief Check if the device is connected to the specific service
2262 * This function is used to check if if the device is connected to the specific service.
2264 * This function is a synchronous call.
2266 * @param[in] local_address a device address of remote bluetooth device
2267 * @param[in] type the service type
2268 * @param[out] is_connected if the device is connected or not
2270 * @return BLUETOOTH_ERROR_NONE - Success \n
2271 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2272 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2273 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2278 gboolean is_connected = FALSE;
2279 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2280 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2283 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2284 bluetooth_service_type_t type,
2285 gboolean *is_connected);
2288 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2289 * @brief Gets device's connected link type
2291 * This function is used to get device's connected link type
2293 * This function is a synchronous call.
2295 * @param[in] device_address a device address of remote bluetooth device
2296 * @param[out] connected_link a device's connected link type
2298 * @return BLUETOOTH_ERROR_NONE - Success \n
2299 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2300 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2301 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2306 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2307 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2308 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2311 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2312 bluetooth_connected_link_t *connected_link);
2315 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2316 * @brief Sets a profile trusted for a device
2318 * This function is used to Set a profile as trusted for a device
2320 * This function is a synchronous call.
2322 * @param[in] device_address a device address of remote bluetooth device
2323 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2324 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2326 * @return BLUETOOTH_ERROR_NONE - Success \n
2327 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2328 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2329 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2333 int bluetooth_set_profile_trusted(
2334 const bluetooth_device_address_t *device_address,
2335 int profile, int trust);
2338 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2339 * @brief Gets a profile is trusted for a device
2341 * This function is used to Get a profile is trusted or not for a device
2343 * This function is a synchronous call.
2345 * @param[in] device_address a device address of remote bluetooth device
2346 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2347 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2349 * @return BLUETOOTH_ERROR_NONE - Success \n
2350 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2351 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2352 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2356 int bluetooth_get_profile_trusted(
2357 const bluetooth_device_address_t *device_address,
2358 int profile, int *trust);
2361 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2362 * @brief Sets a profile restricted connection for a device
2364 * This function is used to Set a profile as restricted for a device
2366 * This function is a synchronous call.
2368 * @param[in] device_address a device address of remote bluetooth device
2369 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2370 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2372 * @return BLUETOOTH_ERROR_NONE - Success \n
2373 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2374 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2375 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2379 int bluetooth_set_profile_restricted(
2380 const bluetooth_device_address_t *device_address,
2381 int profile, int restricted);
2384 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2385 * @brief Gets a restricted connection state
2387 * This function is used to Get a profile is restricted or not for a device
2389 * This function is a synchronous call.
2391 * @param[in] device_address a device address of remote bluetooth device
2392 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2393 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2395 * @return BLUETOOTH_ERROR_NONE - Success \n
2396 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2397 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2398 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2402 int bluetooth_get_profile_restricted(
2403 const bluetooth_device_address_t *device_address,
2404 int profile, int *restricted);
2407 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2408 * @brief Get the visibility mode
2411 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2412 * visibity mode, the property of the device is determined whether it can be discoverable, non
2413 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2415 * This function is a synchronous call.
2418 * @return BLUETOOTH_ERROR_NONE - Success \n
2419 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2420 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2421 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2422 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2423 * @param[out] discoverable_mode current bluetooth discoverable mode
2425 * @see bluetooth_set_discoverable_mode
2427 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2429 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2432 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2435 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2437 * @brief Set the visibility mode
2440 * This function is used to set the discoverable mode (Visibility option).
2442 * Many times user may want to keep his device discoverable so that when peer device is performing
2443 * device search, he/she can find user's device. Application programmer can keep the mode as
2444 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2445 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2446 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2447 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2449 * This function is a synchronous call.
2451 * @return BLUETOOTH_ERROR_NONE - Success \n
2452 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2454 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2455 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2457 * @see bluetooth_get_discoverable_mode
2461 bluetooth_discoverable_mode_t mode;
2463 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2464 ret = bluetooth_set_discoverable_mode (mode, 180);
2468 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2473 * @fn int bluetooth_get_timeout_value(int *timeout)
2474 * @brief Get the visibility timeout value
2477 * This function is used to get the visibility timeout
2478 * Before calling this API make sure that the adapter is enabled.
2480 * This function is a synchronous call.
2483 * @return BLUETOOTH_ERROR_NONE - Success \n
2484 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2485 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2486 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2487 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2488 * @param[out] timeout remain visibility timeout value
2490 * @see bluetooth_set_discoverable_mode
2494 ret = bluetooth_get_timeout_value (&timeout);
2497 int bluetooth_get_timeout_value(int *timeout);
2501 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2502 * unsigned int classOfDeviceMask)
2503 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2505 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2506 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2507 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2508 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2509 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2510 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2511 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2512 * please see bluetooth_device_info_t for more details.
2515 * This API provides searching options like max responses, discovery duration in seconds and class
2516 * of device mask to filter device search. some times there may be too many bluetooth devices in
2517 * vicinity of your device.in such scenario, application can request to reduce number of responces
2518 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2519 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2520 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2521 * application defined time. please note that discovery_duration should be mentioned in seconds.
2522 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2525 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2526 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2527 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2529 * This function is a asynchronous call.
2530 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2531 * through registered callback function.
2533 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2534 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2536 * The completion or cancellation of the discovery is indicated by an
2537 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2539 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2542 * @return BLUETOOTH_ERROR_NONE - Success \n
2543 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2544 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2545 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2546 agent is not running \n
2548 * @param[in] max_response define the maximum response of the number of founded devices
2550 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2551 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2552 (refer to class of device)
2554 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2557 void bt_event_callback(int event, bluetooth_event_param_t *param)
2561 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2563 bluetooth_device_info_t *device_info = NULL;
2564 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2566 device_info = (bluetooth_device_info_t *)param->param_data;
2567 memcpy(&searched_device, &device_info->device_address,
2568 sizeof(bluetooth_device_address_t));
2569 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2570 device_info->device_address.addr[0],
2571 device_info->device_address.addr[1],
2572 device_info->device_address.addr[2],
2573 device_info->device_address.addr[3],
2574 device_info->device_address.addr[4],
2575 device_info->device_address.addr[5]);
2578 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2580 bluetooth_device_info_t *device_info = NULL;
2581 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2583 device_info = (bluetooth_device_info_t *)param->param_data;
2584 memcpy(&searched_device, &device_info->device_address,
2585 sizeof(bluetooth_device_address_t));
2586 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2587 device_info->device_name.name,
2588 device_info->device_address.addr[0],
2589 device_info->device_address.addr[1],
2590 device_info->device_address.addr[2],
2591 device_info->device_address.addr[3],
2592 device_info->device_address.addr[4],
2593 device_info->device_address.addr[5]);
2597 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2598 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2603 unsigned short max_response;
2604 unsigned short discovery_duration;
2605 unsigned classOfDeviceMask;
2609 discovery_duration =0;
2610 classOfDeviceMask =0;
2612 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2617 int bluetooth_start_discovery(unsigned short max_response,
2618 unsigned short discovery_duration,
2619 unsigned int classOfDeviceMask);
2622 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2623 * unsigned short max_response,
2624 * unsigned short discovery_duration,
2625 * unsigned int classOfDeviceMask)
2626 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2628 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2629 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2630 * Please see bluetooth_start_discovery() for other parameters description.
2632 * This function is a asynchronous call.
2633 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2634 * through registered callback function.
2636 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2637 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2639 * The completion or cancellation of the discovery is indicated by an
2640 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2642 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2645 * @return BLUETOOTH_ERROR_NONE - Success \n
2646 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2647 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2648 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2649 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2650 agent is not running \n
2652 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2653 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2654 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2655 * @param[in] max_response define the maximum response of the number of founded devices
2657 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2658 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2659 (refer to class of device)
2661 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2664 unsigned short type;
2665 unsigned short max_response;
2666 unsigned short discovery_duration;
2667 unsigned classOfDeviceMask;
2672 discovery_duration =0;
2673 classOfDeviceMask =0;
2675 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2680 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2681 unsigned short max_response,
2682 unsigned short discovery_duration,
2683 unsigned int classOfDeviceMask);
2686 * @fn int bluetooth_cancel_discovery (void)
2687 * @brief Cancel the on-going device discovery operation
2690 * This function stops the on-going device discovery operation. This API has to be called after the
2691 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2692 * the bluetooth_start_discovery API
2694 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2695 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2696 * cancel the discover request once the user received the device to which he wish to connect.
2698 * This function is a asynchronous call.
2699 * If the call is success to cancel discovey then the application will receive
2700 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2701 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2702 * BLUETOOTH_ERROR_NONE
2705 * @return BLUETOOTH_ERROR_NONE - Success \n
2706 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2707 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2708 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2709 other application \n
2710 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2712 * @see bluetooth_start_discovery
2714 void bt_event_callback(int event, bluetooth_event_param_t *param)
2718 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2719 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2728 ret = bluetooth_cancel_discovery();
2731 int bluetooth_cancel_discovery(void);
2734 * @fn int bluetooth_start_le_discovery(void)
2735 * @brief Start the generic device discovery which finds the LE devices.
2737 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2738 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2739 * It try to find LE devices. Bluetooth device address and name are
2740 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2741 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2742 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2743 * please see bluetooth_device_info_t for more details.
2745 * This function is a asynchronous call.
2746 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2747 * through registered callback function.
2749 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2752 * The completion or cancellation of the discovery is indicated by an
2753 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2755 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2758 * @return BLUETOOTH_ERROR_NONE - Success \n
2759 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2760 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2761 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2762 agent is not running \n
2765 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2768 void bt_event_callback(int event, bluetooth_event_param_t *param)
2772 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2774 bluetooth_device_info_t *device_info = NULL;
2775 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2777 device_info = (bluetooth_device_info_t *)param->param_data;
2778 memcpy(&searched_device, &device_info->device_address,
2779 sizeof(bluetooth_device_address_t));
2780 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2781 device_info->device_address.addr[0],
2782 device_info->device_address.addr[1],
2783 device_info->device_address.addr[2],
2784 device_info->device_address.addr[3],
2785 device_info->device_address.addr[4],
2786 device_info->device_address.addr[5]);
2790 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2791 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2797 ret = bluetooth_start_discovery();
2802 int bluetooth_start_le_discovery(void);
2805 * @fn int bluetooth_stop_le_discovery (void)
2806 * @brief Cancel the on-going device LE discovery operation
2809 * This function stops the on-going device discovery operation. This API has to be called after the
2810 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2811 * the bluetooth_start_le_discovery API
2814 * This function is a asynchronous call.
2815 * If the call is success to cancel discovey then the application will receive
2816 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2817 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2818 * BLUETOOTH_ERROR_NONE
2821 * @return BLUETOOTH_ERROR_NONE - Success \n
2822 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2823 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2824 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2825 other application \n
2826 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2828 * @see bluetooth_start_discovery
2830 void bt_event_callback(int event, bluetooth_event_param_t *param)
2834 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2835 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2844 ret = bluetooth_stop_le_discovery();
2847 int bluetooth_stop_le_discovery(void);
2850 * @fn int bluetooth_is_discovering(void)
2851 * @brief Check for the device discovery is in-progress or not.
2853 * This API is used to check the current status of the Discovery operation.If discovery is in\
2854 * progress normally other operations are not allowed.
2855 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2856 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2857 * event before performing other operations. This API is used to get for the current discovery
2858 * operation status and using bluetooth_cancel_discovery()
2859 * we can cancell the ongoing discovery process.
2860 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2863 * This function checks whether the device discovery is started or not.
2865 * This function is a synchronous call.
2868 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2869 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2870 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2873 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2877 ret = bluetooth_is_discovering ();
2880 int bluetooth_is_discovering(void);
2883 * @fn int bluetooth_is_le_discovering(void)
2884 * @brief Check for the device LE discovery is in-progress or not.
2886 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2887 * progress normally other operations are not allowed.
2888 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2889 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2890 * event before performing other operations. This API is used to get for the current discovery
2891 * operation status and using bluetooth_stop_le_discovery()
2892 * we can cancell the ongoing LE discovery process.
2893 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2896 * This function checks whether the device LE discovery is started or not.
2898 * This function is a synchronous call.
2901 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2902 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2903 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2906 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2910 ret = bluetooth_is_le_discovering ();
2913 int bluetooth_is_le_discovering(void);
2916 * @fn int bluetooth_is_le_scanning(void)
2917 * @brief Check for the device LE scan is in-progress or not.
2919 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2920 * progress normally other operations are not allowed.
2922 * This function checks whether the device LE Scan is started or not.
2924 * This function is a synchronous call.
2926 * @return TRUE - LE Scan in progress \n
2927 * FALSE - LE Scan is not in progress \n
2932 gboolean is_le_scanning = 0;
2933 is_le_scanning = bluetooth_is_le_scanning ();
2936 gboolean bluetooth_is_le_scanning(void);
2938 gboolean bluetooth_is_scan_filter_supported(void);
2941 * @fn int bluetooth_force_hcidump(int timeout)
2942 * @brief Enable /disable force-hcidump
2944 * This function control force-hcidump.
2946 * This function is a synchronous call.
2948 * @return BLUETOOTH_ERROR_NONE - Success \n
2949 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2950 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2952 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
2957 int bluetooth_force_hcidump(int timeout);
2960 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2961 * @brief Register scan filter.
2963 * This function registers the scan filter.
2965 * This function is a synchronous call.
2967 * @return BLUETOOTH_ERROR_NONE - Success \n
2969 * @param[in] filter scan filter to register
2970 * @param[out] slot_id the slot ID of scan filter
2974 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2977 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2978 * @brief Register scan filter.
2980 * This function unregisters the scan filter.
2982 * This function is a synchronous call.
2984 * @return BLUETOOTH_ERROR_NONE - Success \n
2986 * @param[in] slot_id the slot ID of scan filter
2990 int bluetooth_unregister_scan_filter(int slot_id);
2993 * @fn int bluetooth_unregister_all_scan_filters(void)
2994 * @brief Register scan filter.
2996 * This function usregisters all scan filters.
2998 * This function is a synchronous call.
3000 * @return BLUETOOTH_ERROR_NONE - Success \n
3004 int bluetooth_unregister_all_scan_filters(void);
3007 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3008 int link_type, bt_rssi_threshold_t rssi_threshold)
3009 * @brief Enable RSSI monitoring
3011 * This function enables RSSI monitoring and sets threshold for a connection
3013 * @return BLUETOOTH_ERROR_NONE - Success \n
3016 * @see bluetooth_get_rssi_strength
3018 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3019 int link_type, bt_rssi_threshold_t *rssi_threshold);
3022 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3023 * @brief Gets Raw RSSI signal Strength
3025 * This function gives the Raw RSSI signal strength for a connection.
3027 * @return BLUETOOTH_ERROR_NONE - Success \n
3030 * @see bluetooth_enable_rssi
3032 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3034 int bluetooth_set_connectable(gboolean is_connectable);
3036 int bluetooth_is_connectable(gboolean *is_connectable);
3039 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3040 * @brief Initiate a bonding process
3043 * This function initiates a bonding procedure with a peer device. The bonding procedure
3044 * enables authentication and optionally encryption on the Bluetooth link.
3046 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3047 * inititate the bonding request to the devices already in the paired list.
3049 * Usually we call this API after the device discovery.
3050 * This function is a asynchronous call.
3052 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3053 * mentioed result code
3054 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3055 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3056 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3057 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3058 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3060 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3061 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3064 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3067 * @return BLUETOOTH_ERROR_NONE - Success \n
3068 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3069 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3070 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3071 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3073 * @param[in] device_address This indicates an address of the device with which the pairing
3074 * should be initiated
3076 * @see bluetooth_cancel_bonding
3078 void bt_event_callback(int event, bluetooth_event_param_t *param)
3082 case BLUETOOTH_EVENT_BONDING_FINISHED:
3084 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3085 if (param->result >= BLUETOOTH_ERROR_NONE)
3087 bluetooth_device_info_t *device_info = NULL;
3088 device_info = (bluetooth_device_info_t *)param->param_data;
3089 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3090 mjr[%#x] min[%#x] srv[%#x]",
3091 device_info->device_name.name,
3092 device_info->device_address.addr[0],
3093 device_info->device_address.addr[1],
3094 device_info->device_address.addr[2],
3095 device_info->device_address.addr[3],
3096 device_info->device_address.addr[4],
3097 device_info->device_address.addr[5],
3098 device_info->device_class.major_class,
3099 device_info->device_class.minor_class,
3100 device_info->device_class.service_class);
3114 bluetooth_device_address_t device_address={{0}};
3116 ret = bluetooth_bond_device(&device_address);
3120 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3123 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3124 * bluetooth_conn_type_t conn_type)
3125 * @brief Initiate a bonding process
3128 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3129 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3131 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3132 * inititate the bonding request to the devices already in the paired list.
3134 * Usually we call this API after the device discovery.
3135 * This function is a asynchronous call.
3137 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3138 * mentioed result code
3139 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3140 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3141 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3142 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3143 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3145 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3146 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3149 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3152 * @return BLUETOOTH_ERROR_NONE - Success \n
3153 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3154 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3155 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3156 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3158 * @param[in] device_address This indicates an address of the device with which pairing
3159 * should be initiated
3160 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3163 * @see bluetooth_cancel_bonding
3165 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3166 bluetooth_conn_type_t conn_type);
3169 * @fn int bluetooth_cancel_bonding(void)
3170 * @brief Cancel the on-going bonding process
3172 * This API is called to cancel the on-going bonding procedure. It should be called before the
3173 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3174 * This API is useful when the remote device is not responding to the bond request or we wish to
3175 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3177 * This function is a synchronous call.
3179 * @return BLUETOOTH_ERROR_NONE - Success \n
3180 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3181 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3184 * @see bluetooth_bond_device
3190 ret = bluetooth_cancel_bonding();
3193 int bluetooth_cancel_bonding(void);
3196 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3197 * @brief Remove bonding
3200 * To communicate with remote device over bluetooth link, user should bond with peer device.
3201 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3202 * API is used to remove peer device from the list. Please note that after removing the device
3203 * from bonded device list, you cannot communication with peer device until bonding happens again.
3205 * User can call this function by passing bluetooth device address of any bonded device. Please note
3206 * that after successful return of this function, any bluetooth application running on your device
3207 * will not be able to communicate with unbonded device until bond operation happens again using
3208 * bluetooth_bond_device()
3211 * This function is a asynchronous call. The request to remove the specified device from the bonded
3212 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3213 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3214 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3218 * @return BLUETOOTH_ERROR_NONE - Success \n
3219 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3220 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3221 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3222 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3223 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3224 * agent is not running \n
3225 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3228 * @param[in] device_address This indicates an address of the device to remove bonding
3232 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3235 void bt_event_callback(int event, bluetooth_event_param_t *param)
3238 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3239 bluetooth_device_address_t *dev_addr = NULL;
3241 if (param->result == BLUETOOTH_ERROR_NONE) {
3242 dev_addr = (bluetooth_device_address_t *)param->param_data;
3244 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3245 dev_addr->addr[0], dev_addr->addr[1]
3246 dev_addr->addr[2], dev_addr->addr[3]
3247 dev_addr->addr[4], dev_addr->addr[5]
3258 bluetooth_device_address_t *device_address;
3260 // copy valid device address in device_address
3262 ret = bluetooth_unbond_device(device_address);
3265 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3268 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3269 * @brief Get bonded(paired) device list
3272 * This API gets all bonded device list.
3273 * The devices in the bonded device list further can be used to perform the authorization by calling
3274 * bluetooth_authorize_device API.
3276 * This function is a synchronous call.
3277 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3278 * there is no valid information in the dev_list.
3279 * The len field in the dev_list represents the number of bonded devices. The data structure for
3280 * bonded device information is bluetooth_device_info_t.
3283 * @return BLUETOOTH_ERROR_NONE - Success \n
3284 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3286 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3288 void bt_get_bonded_devices(void)
3292 GPtrArray *devinfo = NULL;
3293 bluetooth_device_info_t *ptr;
3295 // allocate the g_pointer_array
3296 devinfo = g_ptr_array_new();
3298 ret = bluetooth_get_bonded_device_list(&devinfo);
3299 if (ret != BLUETOOTH_ERROR_NONE)
3301 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3305 printf("g pointer arrary count : [%d]", devinfo->len);
3306 for (i=0; i<devinfo->len; i++)
3308 ptr = g_ptr_array_index(devinfo, i);
3311 printf("Name [%s]\n", ptr->device_name.name);
3312 printf("Major Class [%d]\n", ptr->device_class.major_class);
3313 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3314 printf("Service Class [%d]\n", ptr->device_class.service_class);
3315 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3316 ptr->device_address.addr[0],
3317 ptr->device_address.addr[1], ptr->device_address.addr[2],
3318 ptr->device_address.addr[3],
3319 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3326 // free g_pointer_array
3327 g_ptr_array_free(devinfo, TRUE);
3332 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3334 int bluetooth_get_profile_connected_device_list(
3335 const char *profile_uuid, GPtrArray **addr_list);
3338 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3339 * bluetooth_device_info_t *dev_info)
3340 * @brief Get a bonded(paired) device
3343 * This API gets a bonded device.
3345 * This function is a synchronous call.
3346 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3347 * there is no valid information in the dev_info.
3348 * The data structure for bonded device information is bluetooth_device_info_t.
3351 * @return BLUETOOTH_ERROR_NONE - Success \n
3352 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3354 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3356 void bt_get_bonded_device(void)
3360 bluetooth_device_info_t devinfo = {0};
3361 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3363 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3364 if (ret != BLUETOOTH_ERROR_NONE)
3366 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3370 printf("Name [%s]\n", devinfo.device_name.name);
3371 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3372 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3373 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3374 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3375 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3376 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3377 devinfo.device_address.addr[5]);
3386 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3387 bluetooth_device_info_t *dev_info);
3391 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3392 * gboolean *is_alias_set)
3393 * @brief Get is_alias_set property of device
3395 * This API gets is_alias_set property of a bonded device.
3397 * This function is a synchronous call.
3398 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3399 * If not,there is no valid information in the is_alias_set.
3401 * @return BLUETOOTH_ERROR_NONE - Success \n
3402 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3407 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3409 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3412 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3413 gboolean *is_alias_set);
3416 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3417 * @brief set alias for bonded device
3420 * This function set alias for bonded device.
3422 * This function is a synchronous call.
3425 * @return BLUETOOTH_ERROR_NONE - Success \n
3426 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3427 * @param[in] device_address This indicates an address of the remote device
3428 * @param[in] alias This indicates an alias to set
3433 ret = bluetooth_set_alias(&remote_address);
3436 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3440 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3441 * @brief Get remote deivice
3444 * This function gets specific remote device.
3446 * This function is a asynchronous call.
3447 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3450 * @return BLUETOOTH_ERROR_NONE - Success \n
3451 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3452 * @param[in] device_address This indicates an address of the remote device
3457 ret = bluetooth_get_remote_device(&remote_address);
3460 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3463 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3464 * gboolean authorized)
3465 * @brief Authorize/Unauthorize a bonded device
3468 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3469 * with/without user confirmation.
3471 * If we select a paired device and make it authorized by calling this API with the authorized
3472 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3473 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3474 * then it will ask for the user conformation before the connection.
3476 * This API supposed to be called on the paired devices. Which means we have to use this API only
3477 * after successful pairing.
3479 * This function is a asynchronous call.
3480 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3482 * @return BLUETOOTH_ERROR_NONE - Success \n
3483 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3484 * @param[in] device_address This indicates an address of the device to authorize \n
3485 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3487 * @see bluetooth_get_bonded_device_list
3489 void bt_event_callback(int event, bluetooth_event_param_t *param)
3493 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3495 if (param->result == BLUETOOTH_ERROR_NONE)
3499 //device authorization failed failure
3507 bluetooth_device_address_t device_address={{0}};
3508 gboolean authorized;
3512 ret = bluetooth_authorize_device(&device_address,authorized);
3515 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3516 gboolean authorized);
3518 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3519 const bluetooth_device_pin_code_t *pin_code);
3521 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3524 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3526 * @brief Receives Legacy Passkey\pin with following authentication response types
3528 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3529 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3532 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3535 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3537 * @brief This API sends user confirmation reply to the local adapter.
3539 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3542 int bluetooth_passkey_confirmation_reply(gboolean reply);
3545 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3546 * @brief Get all services supported by remote device
3549 * This API call initiates the search for the services supported by the specified device. Normally
3550 * the service search will take a couple of seconds to get it completed. Before calling this API
3551 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3552 * perform the service search. We can get the device address by doing a device discovery operation.
3555 * This function is a asynchronous call.
3556 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3558 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3559 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3560 * event is generated with appropriate result code.
3562 * @return BLUETOOTH_ERROR_NONE - Success \n
3563 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3564 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3565 * @param[in] device_address This indicates an address of the device
3566 * whose services need to be found
3568 * @see bluetooth_cancel_service_search
3570 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3573 * @fn int bluetooth_cancel_service_search(void)
3574 * @brief Cancel the ongoing service search operation
3577 * This function cancel the ongoing service search operation. This API is usually calling after the
3578 * bluetooth_search_service API.
3579 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3580 * if the user wish to cancel the Ongoing service search operation.
3582 * This API should be called just after the bluetooth_search_service API and before the
3583 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3585 * This function is a synchronous call.
3587 * @return BLUETOOTH_ERROR_NONE - Success \n
3588 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3589 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3590 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3593 * @see bluetooth_search_service
3598 ret = bluetooth_cancel_service_search();
3601 int bluetooth_cancel_service_search(void);
3604 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3605 * @brief Register rfcomm socket with a specific uuid
3608 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3609 * descriptor of the server.
3610 * This is the first API which is called to create the server. Once we created the server socket,
3611 * we will listen on that return socket.
3612 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3615 * @return socket FD on Success \n
3616 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3617 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3618 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3619 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3620 * @param[in] UUID (128 bits)
3623 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3627 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3628 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3632 int bluetooth_rfcomm_create_socket(const char *uuid);
3635 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3636 * @brief Register rfcomm socket with a specific uuid
3639 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3640 * descriptor of the server.
3641 * This is the first API which is called to create the server. Once we created the server socket,
3642 * we will listen on that return socket.
3643 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3646 * @return socket FD on Success \n
3647 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3648 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3649 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3650 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3651 * @param[in] UUID (128 bits)
3652 * @param[in] bus_name (const char)
3653 * @param[in] path (const char)
3656 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3660 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3661 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3665 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3668 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3669 * @brief De-register the rfcomm socket
3672 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3673 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3674 * descriptor else no event will come. We will call this API only after the
3675 * bluetooth_rfcomm_listen_and_accept.
3676 * This is a synchronous call.
3678 * @return BLUETOOTH_ERROR_NONE - Success \n
3679 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3680 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3681 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3682 * @param[in] int socket_fd
3685 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3688 void bt_event_callback(int event, bluetooth_event_param_t *param)
3692 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3694 bluetooth_rfcomm_connection_t *discon_ind =
3695 (bluetooth_rfcomm_connection_t *)param->param_data;
3697 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3705 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3706 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3708 ret = bluetooth_rfcomm_remove_socket(fd);
3711 int bluetooth_rfcomm_remove_socket(int socket_fd);
3714 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3715 * @brief De-register the rfcomm socket
3718 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3719 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3720 * descriptor else no event will come. We will call this API only after the
3721 * bluetooth_rfcomm_listen_and_accept_ex.
3722 * This is a synchronous call.
3724 * @return BLUETOOTH_ERROR_NONE - Success \n
3725 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3726 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3727 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3728 * @param[in] UUID (128 bits)
3731 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3734 void bt_event_callback(int event, bluetooth_event_param_t *param)
3738 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3740 bluetooth_rfcomm_connection_t *discon_ind =
3741 (bluetooth_rfcomm_connection_t *)param->param_data;
3743 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3751 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3752 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3754 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3757 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3760 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3761 * @brief Disconnect rfcomm connection
3764 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3765 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3768 * @return BLUETOOTH_ERROR_NONE - Success \n
3769 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3770 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3771 * @param[in] int socket_fd the sending socket fd
3777 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3779 printf("Disconnection failed");
3781 printf("Disconnection Success");
3785 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3788 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3789 * @brief Rfcomm socket listen
3792 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3793 * after the bluetooth_rfcomm_create_socket API.
3794 * This API listen for the incomming connection and once it receives a connection, it will give
3795 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3796 * event to the application. This is an Asynchronous API call.
3799 * @return BLUETOOTH_ERROR_NONE - Success \n
3800 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3801 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3803 * @param[in] int socket_fd
3804 * @param[in] max pending connection.
3807 * @see bluetooth_rfcomm_create_socket
3810 void bt_event_callback(int event, bluetooth_event_param_t* param)
3814 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3816 bluetooth_rfcomm_connection_t *conn_ind =
3817 (bluetooth_rfcomm_connection_t *)param->param_data;
3819 printf("\nConnected from FD %d", conn_ind->socket_fd);
3827 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3828 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3832 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3835 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3836 * @brief Rfcomm socket listen
3839 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3840 * after the bluetooth_rfcomm_create_socket API.
3841 * This API listen for the incomming connection and once it receives a connection, it will give
3842 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3843 * event to the application. This is an Asynchronous API call.
3846 * @return BLUETOOTH_ERROR_NONE - Success \n
3847 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3848 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3850 * @param[in] int socket_fd
3851 * @param[in] max pending connection.
3856 * @see bluetooth_rfcomm_create_socket_ex
3859 void bt_event_callback(int event, bluetooth_event_param_t* param)
3863 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3865 bluetooth_rfcomm_connection_t *conn_ind =
3866 (bluetooth_rfcomm_connection_t *)param->param_data;
3868 printf("\nConnected from FD %d", conn_ind->socket_fd);
3876 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3877 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3882 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3885 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3886 * @brief Rfcomm socket listen
3889 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3890 * after the bluetooth_rfcomm_create_socket API.
3891 * This API listen for the incomming connection and once it receives a connection, it will give
3892 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3893 * event to the application. This is an Asynchronous API call.
3896 * @return BLUETOOTH_ERROR_NONE - Success \n
3897 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3898 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3900 * @param[in] int socket_fd
3901 * @param[in] max pending connection.
3904 * @see bluetooth_rfcomm_create_socket
3907 void bt_event_callback(int event, bluetooth_event_param_t* param)
3911 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3913 char *name = (char *)param->param_data;
3915 printf("\nConnected from %s", name);
3917 bluetooth_rfcomm_accept_connection();
3925 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3926 ret = bluetooth_rfcomm_listen(fd, 1);
3930 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3933 * @fn int bluetooth_rfcomm_accept_connection()
3934 * @brief Accepts the authorization request indicated by the event
3935 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3937 * This function is a synchronous call.
3939 * @return BLUETOOTH_ERROR_NONE - Success \n
3940 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3942 * @param[in] the socket fd of the server
3943 * @param[out] the socket fd of the client
3947 * @see bluetooth_rfcomm_reject_connection
3949 int bluetooth_rfcomm_accept_connection(int server_fd);
3952 * @fn int bluetooth_rfcomm_reject_connection()
3953 * @brief Rejects the authorization request indicated by the event
3954 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3956 * This function is a synchronous call.
3958 * @return BLUETOOTH_ERROR_NONE - Success \n
3959 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3961 * @param[in] the socket fd of the server
3965 * @see bluetooth_rfcomm_accept_connection
3967 int bluetooth_rfcomm_reject_connection(int server_fd);
3970 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3971 * @brief Informs whether rfcomm server uuid is available or not.
3973 * This function is a synchronous call.
3975 * @return TRUE - RFCOMM uuid is available \n
3976 * FALSE - RFCOMM uuid is not available \n
3978 * @param[in] uuid UUID string
3984 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3987 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3988 * const char *remote_uuid)
3989 * @brief Connect to the remote device rfcomm *
3991 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3992 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3993 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3994 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3995 * initiating a connection.
3997 * @return BLUETOOTH_ERROR_NONE - Success \n
3998 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3999 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4000 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4001 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4002 * @param[in] bluetooth_device_address_t remote bt_address
4003 * @param[in] char remote uuid
4005 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4009 void bt_event_callback(int event, bluetooth_event_param_t *param)
4013 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4015 if (param->result >= BLUETOOTH_ERROR_NONE)
4017 bt_sdp_info_t *bt_sdp_info=param->param_data;
4019 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4020 bt_sdp_info->device_addr.addr[0],
4021 bt_sdp_info->device_addr.addr[1],
4022 bt_sdp_info->device_addr.addr[2],
4023 bt_sdp_info->device_addr.addr[3],
4024 bt_sdp_info->device_addr.addr[4],
4025 bt_sdp_info->device_addr.addr[5]);
4027 printf("Supported service list:\n");
4028 for(i=0; i<bt_sdp_info->service_index; i++)
4030 bt_sdp_info->service_list_array[i]);
4033 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4034 //rfcomm_test_uuid);
4038 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4040 bluetooth_rfcomm_connection_t *conn_ind =
4041 (bluetooth_rfcomm_connection_t *)param->param_data;
4043 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4044 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4045 "SERVER" : "CLIENT");
4050 bluetooth_device_address_t remote_address = {{0},};
4051 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4052 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4053 ret = bluetooth_search_service(&remote_address);
4055 printf("Seach failed, Reason = %d", ret);
4057 printf("Search Success, Ret = %d", ret);
4059 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4061 printf("Connection failed, Reason = %d", ret);
4063 printf("Connection Success, Ret = %d", ret);
4067 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4068 const char *remote_uuid);
4071 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4072 * @brief Disconnect rfcomm connection
4075 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4076 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4079 * @return BLUETOOTH_ERROR_NONE - Success \n
4080 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4081 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4082 * @param[in] char remote bt_address
4085 * @see bluetooth_rfcomm_connect
4089 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4091 printf("Disconnection failed");
4093 printf("Disconnection Success");
4098 int bluetooth_rfcomm_disconnect(int socket_fd);
4101 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4102 * @brief Write to rfcomm connection
4105 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4106 * API is used to send the data for server and the client.
4108 * @return BLUETOOTH_ERROR_NONE - Success \n
4109 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4110 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4112 * @param[in] const char *buff Data buffer to send
4113 * @param[in] int length Length of the data
4116 * @see bluetooth_rfcomm_connect
4119 char *buff = "Test data 123456789"
4120 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4122 printf("Send failed");
4124 printf("Send success");
4128 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4131 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4132 * @brief Informs whether rfcomm client is connected.
4134 * This function is a synchronous call.
4136 * @return TRUE - RFCOMM client is connected \n
4137 * FALSE - RFCOMM client is not connected \n
4143 gboolean bluetooth_rfcomm_is_client_connected(void);
4144 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4145 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4148 * @fn int bluetooth_network_activate_server(void)
4149 * @brief Activate the NAP (Network Access Point) service
4151 * This function is a asynchronous call.
4152 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4154 * @return BLUETOOTH_ERROR_NONE - Success \n
4155 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4156 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4157 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4160 * @see bluetooth_network_deactivate_server
4163 int bluetooth_network_activate_server(void);
4166 * @fn int bluetooth_network_deactivate_server(void)
4167 * @brief Deactivate the NAP (Network Access Point) service
4169 * This function is a asynchronous call.
4170 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4172 * @return BLUETOOTH_ERROR_NONE - Success \n
4173 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4174 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4175 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4178 * @see bluetooth_network_activate_server
4181 int bluetooth_network_deactivate_server(void);
4184 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4185 * bluetooth_network_role_t role,
4187 * @brief Connect the network server in the peer
4189 * This function is a asynchronous call.
4190 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4192 * @return BLUETOOTH_ERROR_NONE - Success \n
4193 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4194 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4195 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4198 * @param[in] device_address This indicates an address of the device with which the pairing
4199 * should be initiated
4200 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4201 * need to use the third parameter.
4202 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4203 * connect. UUID string
4205 * @see bluetooth_network_disconnect
4207 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4208 bluetooth_network_role_t role, char *custom_uuid);
4211 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4212 * bluetooth_network_role_t role,
4213 * char *custom_uuid)
4214 * @brief Connect the network server in the peer
4216 * This function is a asynchronous call.
4217 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4219 * @return BLUETOOTH_ERROR_NONE - Success \n
4220 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4221 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4222 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4225 * @param[in] device_address This indicates an address of the device with which the pairing
4226 * should be initiated
4228 * @see bluetooth_network_connect
4230 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4233 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4234 * @brief Disconnect the device from the network
4236 * This function is an asynchronous call.
4237 * The network server disconnect request is responded by
4238 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4240 * @return BLUETOOTH_ERROR_NONE - Success \n
4241 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4242 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4243 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4246 * @param[in] device_address This indicates an address of the connected client device
4248 * @see bluetooth_network_activate_server
4250 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4255 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4256 * bt_hdp_role_type_t role,
4257 * bt_hdp_qos_type_t channel_type,
4258 * char **app_handle)
4259 * @brief Activate the HDP service for a particular data type
4261 * This function is a synchronous call.
4263 * @return BLUETOOTH_ERROR_NONE - Success \n
4264 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4265 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4266 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4269 * @param[in] data_type The data type against corresponding service
4270 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4271 * @param[in] channel_type The QOS type for the channel.
4272 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4273 * For role = HDP_ROLE_SINK, the channel_type
4274 * should be HDP_QOS_ANY.
4275 * @param[out] app_handle The application handler against corresponding service
4277 * @see bluetooth_hdp_deactivate
4279 int bluetooth_hdp_activate(unsigned short data_type,
4280 bt_hdp_role_type_t role,
4281 bt_hdp_qos_type_t channel_type,
4284 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4285 * @brief Deactivate the HDP service for a particular service using the handler
4287 * This function is a synchronous call.
4289 * @return BLUETOOTH_ERROR_NONE - Success \n
4290 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4291 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4292 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4295 * @param[in] app_handle The application handler against corresponding service
4297 * @see bluetooth_hdp_deactivate
4299 int bluetooth_hdp_deactivate(const char *app_handle);
4302 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4303 * const char *buffer, unsigned int size)
4304 * @brief Send data to the remote HDP device
4306 * This function is a synchronous call.
4308 * @return BLUETOOTH_ERROR_NONE - Success \n
4309 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4310 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4311 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4312 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4315 * @param[in] channel_id The channel id for the connection.
4316 * @param[in] buffer The pdu buffer.
4317 * @param[in] size Size of the buffer.
4319 * @see bluetooth_hdp_connect
4321 int bluetooth_hdp_send_data(unsigned int channel_id,
4322 const char *buffer, unsigned int size);
4324 * @fn int bluetooth_hdp_connect(const char *app_handle,
4325 * bt_hdp_qos_type_t channel_type,
4326 * const bluetooth_device_address_t *device_address)
4327 * @brief Connect to the remote device(Mainly used by source)
4329 * This function is a asynchronous call.
4330 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4332 * @return BLUETOOTH_ERROR_NONE - Success \n
4333 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4334 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4335 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4336 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4339 * @param[in] app_handle The application handler against corresponding service
4340 * @param[in] channel_type The QOS type for the channel.
4341 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4342 * @param[in] device_address The remote device Bd address.
4345 * @see bluetooth_hdp_disconnect
4347 int bluetooth_hdp_connect(const char *app_handle,
4348 bt_hdp_qos_type_t channel_type,
4349 const bluetooth_device_address_t *device_address);
4351 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4352 * const bluetooth_device_address_t *device_address)
4353 * @brief Disconnect from the remote device(Mainly used by source)
4355 * This function is a asynchronous call.
4356 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4358 * @return BLUETOOTH_ERROR_NONE - Success \n
4359 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4360 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4361 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4362 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4365 * @param[in] channel_id The channel id for the connection.
4366 * @param[in] device_address The remote device Bd address.
4369 * @see bluetooth_hdp_connect
4371 int bluetooth_hdp_disconnect(unsigned int channel_id,
4372 const bluetooth_device_address_t *device_address);
4376 * @fn int bluetooth_opc_init(void)
4377 * @brief Initialize OPP client.
4379 * This function is a synchronous call.
4380 * No event corresponding to this api
4382 * @return BLUETOOTH_ERROR_NONE - Success \n
4383 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4384 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4385 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4386 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4391 * @see bluetooth_opc_deinit
4393 int bluetooth_opc_init(void);
4396 * @fn int bluetooth_opc_deinit(void)
4397 * @brief Deinitialize OPP client.
4399 * This function is a synchronous call.
4400 * No event corresponding to this api
4402 * @return BLUETOOTH_ERROR_NONE - Success \n
4403 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4404 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4409 * @see bluetooth_opc_init
4412 int bluetooth_opc_deinit(void);
4415 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4416 char **file_name_array)
4417 * @brief Send multiple files to a remote device.
4419 * This function is a asynchronous call.
4420 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4422 * @return BLUETOOTH_ERROR_NONE - Success \n
4423 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4424 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4425 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4426 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4427 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4428 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4431 * @param[in] device_address The remote device Bd address.
4432 * @param[in] file_name_array Array of filepaths to be sent.
4435 * @see bluetooth_opc_cancel_push
4438 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4439 char **file_name_array);
4442 * @fn int bluetooth_opc_cancel_push(void)
4443 * @brief Cancels the ongoing file push.
4445 * This function is a asynchronous call.
4446 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4447 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4449 * @return BLUETOOTH_ERROR_NONE - Success \n
4450 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4451 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4456 * @see bluetooth_opc_push_files
4459 int bluetooth_opc_cancel_push(void);
4462 * @fn gboolean bluetooth_opc_session_is_exist(void)
4463 * @brief Informs whether opc session exists or not.
4465 * This function is a synchronous call.
4467 * @return TRUE - OPC session exists \n
4468 * FALSE - OPC session does not exist \n
4476 gboolean bluetooth_opc_session_is_exist(void);
4479 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4480 * @brief Informs whether opc session exists or not.
4482 * This function is a synchronous call.
4484 * @return BLUETOOTH_ERROR_NONE - Success \n
4485 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4486 * BLUETOOTH_ERROR_INTERNAL \n
4489 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4494 int bluetooth_opc_is_sending(gboolean *is_sending);
4497 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4498 int transfer_id, unsigned char *progress)
4499 * @brief Gets the percentage progress for ongoing transfers.
4501 * This function is a synchronous call.
4503 * @return BLUETOOTH_ERROR_NONE - Success \n
4504 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4505 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4508 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4509 * @param[in] transfer_id Transfer ID
4510 * @param[out] progress Percentage Progress
4514 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4515 int transfer_id, unsigned char *progress);
4518 * @fn int bluetooth_obex_server_init(const char *dst_path)
4519 * @brief Initialize OPP and FTP server.
4521 * This function is a synchronous call.
4522 * No event corresponding to this api
4524 * @return BLUETOOTH_ERROR_NONE - Success \n
4525 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4526 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4527 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4528 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4531 * @param[in] dst_path OPS destination file path.
4533 * @see bluetooth_obex_server_deinit
4535 int bluetooth_obex_server_init(const char *dst_path);
4539 * @fn int bluetooth_obex_server_deinit(void)
4540 * @brief Deinitialize OPP and FTP server.
4542 * This function is a synchronous call.
4543 * No event corresponding to this api
4545 * @return BLUETOOTH_ERROR_NONE - Success \n
4546 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4547 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4552 * @see bluetooth_obex_server_init
4554 int bluetooth_obex_server_deinit(void);
4558 * @fn gboolean bluetooth_obex_server_is_activated(void)
4559 * @brief Informs whether obex server is activated or not.
4561 * This function is a synchronous call.
4563 * @return TRUE - OBEX server is activated \n
4564 * FALSE - OBEX server is not activated \n
4571 gboolean bluetooth_obex_server_is_activated(void);
4575 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4576 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4578 * This function is a synchronous call.
4579 * No event corresponding to this api
4581 * @return BLUETOOTH_ERROR_NONE - Success \n
4582 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4583 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4584 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4585 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4589 * @param[in] dst_path OPS destination file path.
4591 * @see bluetooth_obex_server_deinit_without_agent
4593 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4597 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4598 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4600 * This function is a synchronous call.
4601 * No event corresponding to this api
4603 * @return BLUETOOTH_ERROR_NONE - Success \n
4604 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4605 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4610 * @see bluetooth_obex_server_init_without_agent
4612 int bluetooth_obex_server_deinit_without_agent(void);
4616 * @fn int bluetooth_obex_server_accept_connection(void)
4617 * @brief Accepts the authorization request indicated by the event
4618 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4620 * This function is a synchronous call.
4622 * @return BLUETOOTH_ERROR_NONE - Success \n
4623 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4624 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4628 * @see bluetooth_obex_server_reject_authorize
4630 int bluetooth_obex_server_accept_connection(void);
4634 * @fn int bluetooth_obex_server_reject_connection(void)
4635 * @brief Rejects the authorization request indicated by the event
4636 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4638 * This function is a synchronous call.
4640 * @return BLUETOOTH_ERROR_NONE - Success \n
4641 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4642 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4646 * @see bluetooth_obex_server_reject_authorize
4648 int bluetooth_obex_server_reject_connection(void);
4652 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4653 * @brief Accepts the authorization request indicated by the event
4654 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4656 * This function is a asynchronous call.
4657 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4659 * @return BLUETOOTH_ERROR_NONE - Success \n
4660 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4661 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4662 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4665 * @param[in] filename Authorized filename.
4668 * @see bluetooth_obex_server_reject_authorize
4671 int bluetooth_obex_server_accept_authorize(const char *filename);
4674 * @fn int bluetooth_obex_server_reject_authorize(void)
4675 * @brief Reject the authorization request indicated by the event
4676 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4678 * This function is a asynchronous call.
4679 * No event for this api..
4681 * @return BLUETOOTH_ERROR_NONE - Success \n
4682 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4683 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4688 * @see bluetooth_obex_server_accept_authorize
4691 int bluetooth_obex_server_reject_authorize(void);
4694 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4695 * @brief Set the OPS destination file path..
4697 * This function is a asynchronous call.
4698 * No event for this api..
4700 * @return BLUETOOTH_ERROR_NONE - Success \n
4701 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4702 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4703 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4706 * @param[in] dst_path OPS destination file path.
4712 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4715 * @fn int bluetooth_obex_server_set_root(const char *root)
4716 * @brief Set the FTS root folder..
4718 * This function is a asynchronous call.
4719 * No event for this api..
4721 * @return BLUETOOTH_ERROR_NONE - Success \n
4722 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4723 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4724 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4725 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4726 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4729 * @param[in] root FTS root folder.
4735 int bluetooth_obex_server_set_root(const char *root);
4738 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4739 * @brief Cancel the transfer on server
4741 * This function is an asynchronous call.
4742 * If the function call that cancels transfer is successful, the application would receive
4743 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4744 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4745 * the error code will be BLUETOOTH_ERROR_NONE
4747 * @return BLUETOOTH_ERROR_NONE - Success \n
4748 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4749 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4750 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4751 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4754 * @param[in] transfer_id transfer ID
4759 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4763 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4764 * @brief Cancel the transfer on server
4766 * This function is an asynchronous call.
4767 * If the function call that cancels transfer is successful, the application would receive
4768 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4769 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4770 * the error code will be BLUETOOTH_ERROR_NONE
4772 * @return BLUETOOTH_ERROR_NONE - Success \n
4773 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4774 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4775 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4776 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4783 int bluetooth_obex_server_cancel_all_transfers(void);
4787 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4788 * @brief Informs whether obex server is receiving or not.
4790 * This function is a synchronous call.
4792 * @return BLUETOOTH_ERROR_NONE - Success \n
4793 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4794 * BLUETOOTH_ERROR_INTERNAL \n
4797 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4802 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4806 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4807 * @brief Read the local Hash and Randmizer.
4809 * This function is a synchronous call.
4811 * @return BLUETOOTH_ERROR_NONE - Success \n
4812 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4816 * @param[out] local_oob_data - Pointer to the local OOB data
4822 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4826 * @fn int bluetooth_oob_add_remote_data(
4827 * const bluetooth_device_address_t *remote_device_address,
4828 * bt_oob_data_t *oob_data)
4829 * @brief Add/updated the remote device Hash and Randmizer.
4831 * This function is a synchronous call.
4832 * No event for this api..
4834 * @return BLUETOOTH_ERROR_NONE - Success \n
4835 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4838 * @param[in] remote_device_address - Remote device address
4839 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4845 int bluetooth_oob_add_remote_data(
4846 const bluetooth_device_address_t *remote_device_address,
4847 bt_oob_data_t *remote_oob_data);
4851 * @fn int bluetooth_oob_remove_remote_data(
4852 * const bluetooth_device_address_t *remote_device_address)
4853 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4855 * This function is a synchronous call.
4856 * No event for this api..
4858 * @return BLUETOOTH_ERROR_NONE - Success \n
4859 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4862 * @param[in] remote_device_address - Remote device address
4868 int bluetooth_oob_remove_remote_data(
4869 const bluetooth_device_address_t *remote_device_address);
4872 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4873 * bt_gatt_handle_info_t *prim_svc);
4875 * @brief Gets the GATT based primary services handle supported by remote device
4877 * This function is a synchronous call.
4878 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4880 * @return BLUETOOTH_ERROR_NONE - Success \n
4881 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4882 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4883 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4886 * @param[in] address - Remote device address
4887 * @param[out] prim_svc - Structure containing remote service count and handle list.
4890 * @see bluetooth_gatt_free_primary_services()
4892 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4893 bt_gatt_handle_info_t *prim_svc);
4896 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4898 * @brief Discovers the characteristics of GATT based service of remote device
4900 * This function is an asynchronous call.
4901 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4903 * @return BLUETOOTH_ERROR_NONE - Success \n
4904 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4905 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4906 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4909 * @param[in] service_handle - Handle for remote service.
4914 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4916 int bluetooth_gatt_set_service_change_watcher(
4917 const bluetooth_device_address_t *address, gboolean enable);
4920 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4921 * bt_gatt_service_property_t *service);
4923 * @brief Gets the properties of GATT based service of remote device
4925 * This function is a synchronous call.
4926 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4928 * @return BLUETOOTH_ERROR_NONE - Success \n
4929 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4930 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4931 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4934 * @param[in] service_handle - Handle for remote service.
4935 * @param[out] service - Structure containing remote service property.
4938 * @see bluetooth_gatt_free_service_property()
4940 int bluetooth_gatt_get_service_property(const char *service_handle,
4941 bt_gatt_service_property_t *service);
4944 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4946 * @brief Register to GATT based service to receive value change notification/indication.
4948 * This function is a synchronous call.
4949 * No event for this api.
4951 * @return BLUETOOTH_ERROR_NONE - Success \n
4952 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4953 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4954 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4957 * @param[in] service_handle - Handle for remote service.
4962 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4965 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4967 * @brief Unregister GATT based service to receive value change notification/indication.
4969 * This function is a synchronous call.
4970 * No event for this api.
4972 * @return BLUETOOTH_ERROR_NONE - Success \n
4973 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4974 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4975 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4978 * @param[in] service_handle - Handle for remote service.
4983 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4986 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4987 * bt_gatt_char_property_t *characteristic);
4989 * @brief Provides characteristic value along with properties.
4991 * This function is a synchronous call.
4992 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4994 * @return BLUETOOTH_ERROR_NONE - Success \n
4995 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4996 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4997 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5000 * @param[in] char_handle - Handle for Characteristic property.
5001 * @param[out] characteristic - Structure containing remote characteristic property.
5004 * @see bluetooth_gatt_free_char_property()
5006 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5007 bt_gatt_char_property_t *characteristic);
5010 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5011 * bt_gatt_char_property_t *characteristic);
5013 * @brief Provides characteristic descriptor value along with its UUID.
5015 * This function is a synchronous call.
5016 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5018 * @return BLUETOOTH_ERROR_NONE - Success \n
5019 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5020 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5021 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5024 * @param[in] desc_handle - Handle for Characteristic descriptor.
5025 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5028 * @see bluetooth_gatt_free_desc_property()
5030 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5031 bt_gatt_char_descriptor_property_t *descriptor);
5035 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5036 * const guint8 *value, int length)
5038 * @brief Set characteristic value.
5040 * This function is a synchronous call.
5042 * @return BLUETOOTH_ERROR_NONE - Success \n
5043 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5044 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5045 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5048 * @param[in] char_handle - Handle for Characteristic property.
5049 * @param[in] value - New value to set for characteristic property.
5050 * @param[in] length - Length of the value to be set.
5055 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5056 const guint8 *value, int length);
5059 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5060 * const guint8 *value, int length, guint8 write_type)
5062 * @brief Set characteristic value by write type.
5064 * This function is a synchronous call if write type is "write without resonse"
5065 * and it is an asynchronous call if write type is "write with response"
5067 * @return BLUETOOTH_ERROR_NONE - Success \n
5068 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5069 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5070 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5073 * @param[in] char_handle - Handle for Characteristic property.
5074 * @param[in] value - New value to set for characteristic property.
5075 * @param[in] length - Length of the value to be set.
5076 * @param[in] write_type - Type of write.
5081 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5082 const guint8 *value, int length, guint8 write_type);
5086 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5087 * const guint8 *value, int length)
5089 * @brief Set characteristic value request.
5091 * This function is an asynchronous call.
5093 * @return BLUETOOTH_ERROR_NONE - Success \n
5094 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5095 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5096 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5099 * @param[in] char_handle - Handle for Characteristic property.
5100 * @param[in] value - New value to set for characteristic property.
5101 * @param[in] length - Length of the value to be set.
5106 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5107 const guint8 *value, int length);
5110 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5112 * @brief Read characteristic value.
5114 * This function is a asynchronous call.
5116 * @return BLUETOOTH_ERROR_NONE - Success \n
5117 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5118 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5119 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5122 * @param[in] char_handle - Handle for Characteristic property.
5127 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5130 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5131 * const char *service_uuid,
5132 * bt_gatt_service_property_t *service)
5134 * @brief Gets the service property from a device based on a particular uuid
5136 * This function is a synchronous call.
5138 * @return BLUETOOTH_ERROR_NONE - Success \n
5139 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5140 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5141 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5144 * @param[in] address - BD address of the remote device
5145 * @param[in] service_uuid - uuid of the service.
5146 * @param[out] service - Structure containing the service property.
5151 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5152 const char *service_uuid,
5153 bt_gatt_service_property_t *service);
5156 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5157 * const char *char_uuid)
5159 * @brief Gets the characteristic property from a service based on a particular char uuid
5161 * This function is an asynchronous call.
5162 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5164 * @return BLUETOOTH_ERROR_NONE - Success \n
5165 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5166 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5167 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5170 * @param[in] service_handle - Service handle.
5171 * @param[in] uuid - Characteristic uuid.
5176 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5177 const char *char_uuid);
5180 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5182 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5184 * This function is a synchronous call.
5185 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5187 * @return BLUETOOTH_ERROR_NONE - Success \n
5188 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5191 * @param[in] prim_svc - GATT handle info structure
5194 * @see bluetooth_gatt_get_primary_services()
5196 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5199 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5201 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5203 * This function is a synchronous call.
5204 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5206 * @return BLUETOOTH_ERROR_NONE - Success \n
5207 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5210 * @param[in] svc_pty - GATT service property structure.
5213 * @see bluetooth_gatt_get_service_property()
5215 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5218 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5220 * @brief Provides characteristic value along with properties.
5222 * This function is a synchronous call.
5223 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5225 * @return BLUETOOTH_ERROR_NONE - Success \n
5226 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5229 * @param[in] char_pty - GATT characteristics property structure.
5232 * @see bluetooth_gatt_get_characteristics_property()
5234 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5237 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5239 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5241 * This function is a synchronous call.
5242 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5244 * @return BLUETOOTH_ERROR_NONE - Success \n
5245 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5248 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5251 * @see bluetooth_gatt_get_char_descriptor_property()
5253 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5255 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5257 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5260 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5262 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5264 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5266 * @return BLUETOOTH_ERROR_NONE - Success \n
5267 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5270 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5274 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5277 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5279 * @brief Read characteristic descriptor value.
5281 * This function is a asynchronous call.
5283 * @return BLUETOOTH_ERROR_NONE - Success \n
5284 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5285 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5286 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5289 * @param[in] desc_handle - Handle for Characteristic descriptor
5294 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5297 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5298 * const guint8 *value, int length);
5300 * @brief Set characteristic descriptor value.
5302 * This function is a asynchronous call.
5304 * @return BLUETOOTH_ERROR_NONE - Success \n
5305 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5306 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5307 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5310 * @param[in] desc_handle - Handle for Characteristic descriptor
5311 * @param[in] value - New value to set for characteristic descriptor
5312 * @param[in] length - Length of the value to be set.
5317 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5318 const guint8 *value, int length);
5320 /* @fn int bluetooth_gatt_init(void)
5322 * @brief Initializes the gatt service.
5324 * This function is a synchronous call.
5325 * @return BLUETOOTH_ERROR_NONE - Success \n
5326 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5327 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5328 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5331 * @remark Adapter should be enabled
5332 * @see bluetooth_gatt_deinit()
5334 int bluetooth_gatt_init(void);
5336 /* @fn int bluetooth_gatt_init(void)
5338 * @brief DeInitializes the gatt service.
5340 * This function is a synchronous call.
5341 * @return BLUETOOTH_ERROR_NONE - Success \n
5342 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5343 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5344 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5347 * @remark Adapter should be enabled
5348 * @see bluetooth_gatt_init()
5350 int bluetooth_gatt_deinit(void);
5352 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5353 unsigned char **svc_path)
5355 * @brief Exports a new gatt service to the service interface.
5357 * This function is a synchronous call.
5359 * @return BLUETOOTH_ERROR_NONE - Success \n
5360 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5361 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5362 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5365 * @param[in] svc_uuid Gatt service uuid.
5366 * @param[out] svc_path service object path of the exported service.
5367 * @remark Adapter should be enabled
5368 * @see bluetooth_gatt_init()
5370 int bluetooth_gatt_add_service(const char *svc_uuid,
5373 /* @fn int bluetooth_gatt_add_new_characteristic(
5374 const char *svc_path, const char *char_uuid,
5375 bt_gatt_permission_t permissions,
5376 bt_gatt_characteristic_property_t properties,
5377 int flags_length, char **char_path);;
5379 * @brief Exports a new gatt characteristic to the characteristic interface.
5381 * This function is a synchronous call.
5382 * @return BLUETOOTH_ERROR_NONE - Success \n
5383 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5384 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5385 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5387 * @param[in] svc_path service object path of the exported service.
5388 * @param[in] char_uuid Gatt service uuid.
5389 * @param[in] properties GATT characteristic properties.
5390 * @param[out] char_path characteristic object path of the exported characteristic.
5392 * @remark Adapter should be enabled
5393 * @see bluetooth_gatt_add_service()
5395 int bluetooth_gatt_add_new_characteristic(
5396 const char *svc_path, const char *char_uuid,
5397 bt_gatt_permission_t permissions,
5398 bt_gatt_characteristic_property_t properties,
5401 /* @fn bluetooth_gatt_set_characteristic_value(
5402 const char *characteristic, const char *char_value,
5405 * @brief adds gatt charactertisic value to the given charactertistic path.
5407 * This function is a synchronous call.
5408 * @return BLUETOOTH_ERROR_NONE - Success \n
5409 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5410 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5411 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5413 * @param[in] char_value Value of the GATT characteristic to be added.
5414 * @param[in] value_length length of the chantacteristic value..
5415 * @param[out] characteristic characteristic object path..
5417 * @remark Adapter should be enabled
5418 * @see bluetooth_gatt_add_service()
5420 int bluetooth_gatt_set_characteristic_value(
5421 const char *characteristic, const char *char_value,
5424 /* @fn int bluetooth_gatt_add_descriptor(
5425 const char *char_path, const char *desc_uuid,
5426 bt_gatt_permission_t permissions,
5429 * @brief Exports a new gatt descriptor to the descriptor interface.
5431 * This function is a synchronous call.
5433 * @return BLUETOOTH_ERROR_NONE - Success \n
5434 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5435 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5436 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5439 * @param[in] desc_uuid Gatt descriptor uuid.
5440 * @param[in] desc_value GATT descriptor value.
5441 * @param[in] value_length Length of GATT descriptor value.
5442 * @param[in] permissions descriptor permissions.
5443 * @param[in] properties GATT descriptor properties.
5444 * @param[in] char_path characteristics object path of the exported character.
5446 * @remark Adapter should be enabled
5447 * @see bluetooth_gatt_add_service()
5448 * @see bluetooth_gatt_add_characteristics()
5450 int bluetooth_gatt_add_descriptor(
5451 const char *char_path, const char *desc_uuid,
5452 bt_gatt_permission_t permissions,
5455 /* @fn int bluetooth_gatt_set_descriptor_value(
5456 const char *desc_path, const char *desc_value,
5459 * @brief Adds value to the given descriptor handle.
5461 * This function is a synchronous call.
5463 * @return BLUETOOTH_ERROR_NONE - Success \n
5464 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5465 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5466 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5469 * @param[in] desc_value GATT descriptor value.
5470 * @param[in] value_length Length of GATT descriptor value.
5471 * @param[in] desc_path descriptor path to which the value needs to be added.
5473 * @remark Adapter should be enabled
5474 * @see bluetooth_gatt_add_service()
5475 * @see bluetooth_gatt_add_characteristics()
5477 int bluetooth_gatt_set_descriptor_value(
5478 const char *desc_path, const char *desc_value,
5481 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5483 * @brief Reads the Service registered on manager interface.
5485 * This function is a synchronous call.
5487 * @return BLUETOOTH_ERROR_NONE - Success \n
5488 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5489 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5490 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5493 * @param[in] svc_uuid Gatt Service uuid.
5495 * @remark Adapter should be enabled and service should be registered.
5496 * @see bluetooth_gatt_register_service()
5498 int bluetooth_gatt_get_service(const char *svc_uuid);
5500 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5502 * @brief Registers the given service path with the library.
5504 * This function is a synchronous call.
5506 * @return BLUETOOTH_ERROR_NONE - Success \n
5507 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5508 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5509 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5512 * @param[in] svc_path service object path of the exported service.
5514 * @remark Adapter should be enabled
5515 * @see bluetooth_gatt_add_service()
5516 * @see bluetooth_gatt_add_characteristics()
5517 * @see bluetooth_gatt_add_descriptor()
5518 * @see bluetooth_gatt_register_application()
5520 int bluetooth_gatt_register_service(const char *svc_path);
5522 /* @fn int bluetooth_gatt_register_application(void)
5524 * @brief Registers the application with the bluez gatt server.
5526 * This function is a synchronous call.
5528 * @return BLUETOOTH_ERROR_NONE - Success \n
5529 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5530 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5531 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5535 * @remark Adapter should be enabled
5536 * @see bluetooth_gatt_init()
5537 * @see bluetooth_gatt_add_service()
5538 * @see bluetooth_gatt_add_characteristics()
5539 * @see bluetooth_gatt_add_descriptor()
5540 * @see bluetooth_gatt_register_service()
5542 int bluetooth_gatt_register_application(void);
5544 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5546 * @brief Removes(unregister) service from the bluez gatt server db.
5548 * This function is a synchronous call.
5550 * @return BLUETOOTH_ERROR_NONE - Success \n
5551 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5552 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5553 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5556 * @param[in] svc_path service object path of the exported service.
5558 * @remark Adapter should be enabled
5559 * @see bluetooth_gatt_add_service()
5560 * @see bluetooth_gatt_add_characteristics()
5561 * @see bluetooth_gatt_add_descriptor()
5562 * @see bluetooth_gatt_register_service()
5564 int bluetooth_gatt_unregister_service(const char *svc_path);
5566 /* @fn int bluetooth_gatt_unregister_application(void)
5568 * @brief Removes(unregister) the application with the bluez gatt server,
5569 * and deletes all the service registered.
5571 * This function is a synchronous call.
5573 * @return BLUETOOTH_ERROR_NONE - Success \n
5574 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5575 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5576 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5580 * @remark Adapter should be enabled
5581 * @see bluetooth_gatt_init()
5582 * @see bluetooth_gatt_add_service()
5583 * @see bluetooth_gatt_add_characteristics()
5584 * @see bluetooth_gatt_add_descriptor()
5585 * @see bluetooth_gatt_register_service()
5586 * @see bluetooth_gatt_unregister_service()
5588 int bluetooth_gatt_unregister_application(void);
5590 /* @fn int bluetooth_gatt_send_response(int request_id,
5591 * int offset, char *value, int value_length)
5593 * @brief Updates the attribute value in local attribute list.
5595 * This function is a synchronous call.
5597 * @return BLUETOOTH_ERROR_NONE - Success \n
5598 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5599 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5600 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5603 * @param[in] request_id The identification of a read request
5604 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5605 * @param[in] resp_state The identification of response state
5606 * @param[in] offset The offset from where a value is read
5607 * @param[in] value The value to be sent. It will be sent from @a offset.
5608 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5609 * @param[in] value_length Value Length.
5611 * @remark Adapter should be enabled
5612 * @see bluetooth_gatt_add_service()
5613 * @see bluetooth_gatt_add_characteristics()
5614 * @see bluetooth_gatt_add_descriptor()
5615 * @see bluetooth_gatt_register_service()
5617 int bluetooth_gatt_send_response(int request_id, guint req_type,
5618 int resp_state, int offset, char *value, int value_length);
5620 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5622 * @brief Sets the notification property for a characteristic.
5624 * This function is a synchronous call.
5626 * @return BLUETOOTH_ERROR_NONE - Success \n
5627 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5628 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5629 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5632 * @param[in] char_path characteristic object path.
5633 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5635 * @remark Adapter should be enabled
5636 * @see bluetooth_gatt_update_characteristic()
5638 int bluetooth_gatt_server_set_notification(const char *char_path,
5639 bluetooth_device_address_t *unicast_address);
5641 /* @fn int bluetooth_gatt_delete_services(void)
5643 * @brief deletes (unregisters) all services from the gatt server database..
5645 * This function is a synchronous call.
5647 * @return BLUETOOTH_ERROR_NONE - Success \n
5648 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5649 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5650 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5654 * @remark Adapter should be enabled
5655 * @see bluetooth_gatt_add_service()
5656 * @see bluetooth_gatt_add_characteristics()
5657 * @see bluetooth_gatt_add_descriptor()
5658 * @see bluetooth_gatt_register_service()
5659 * @see bluetooth_gatt_unregister_service()
5661 int bluetooth_gatt_delete_services(void);
5663 /* @fn int bluetooth_gatt_update_characteristic(void)
5665 * @brief updates the given characteristic with a new value
5667 * This function is a synchronous call.
5669 * @return BLUETOOTH_ERROR_NONE - Success \n
5670 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5671 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5672 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5676 * @remark Adapter should be enabled
5677 * @see bluetooth_gatt_add_service()
5678 * @see bluetooth_gatt_add_characteristics()
5679 * @see bluetooth_gatt_add_descriptor()
5680 * @see bluetooth_gatt_register_service()
5681 * @see bluetooth_gatt_unregister_service()
5683 int bluetooth_gatt_update_characteristic(const char *char_path,
5684 const char* char_value, int value_length);
5687 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5689 * @brief Set advertising status.
5691 * This function is used to enable or disable LE advertising.
5692 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5694 * This function is a synchronous call.
5696 * @return BLUETOOTH_ERROR_NONE - Success \n
5697 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5698 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5701 * @param[in] enable - The status of advertising
5704 * @see bluetooth_set_advertising_data
5706 int bluetooth_set_advertising(int handle, gboolean enable);
5709 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5711 * @brief Set advertising status along with interval value.
5713 * This function is used to enable or disable LE advertising.
5714 * Interval_min and Interval_max is used to set the best advertising interval.
5715 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5717 * This function is a synchronous call.
5719 * @return BLUETOOTH_ERROR_NONE - Success \n
5720 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5721 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5724 * @param[in] enable - The status of advertising
5725 * @param[in] interval_min - Minimum interval of advertising (msec)
5726 * @param[in] interval_max - Maximum interval of advertising (msec)
5727 * @param[in] filter_policy - Advertising filter policy
5730 * @see bluetooth_set_advertising_data
5732 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5733 bluetooth_advertising_params_t *params);
5736 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5737 * @brief Get the advertising data
5739 * This function is used to get advertising data.
5740 * Before calling this API, the adapter should be enabled.
5742 * This function is a synchronous call.
5744 * @return BLUETOOTH_ERROR_NONE - Success \n
5745 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5746 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5747 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5749 * @param[out] value - Advertising data structure.
5750 * @param[out] length - The length of Advertising data.
5754 bluetooth_advertising_data_t *value = { {0} };
5757 ret = bluetooth_get_advertising_data(&value, &length);
5760 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5763 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5765 * @brief Set advertising data with value
5767 * This function is used to set advertising data and Maximum size of advertising data
5768 * is 28 byte (Except Flag)
5770 * This function is a synchronous call.
5772 * @return BLUETOOTH_ERROR_NONE - Success \n
5773 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5774 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5777 * @param[in] value - Advertising data structure.
5781 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5784 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5786 * @brief Check the privilege for advertising parameter setting
5788 * This function is a synchronous call.
5790 * @return BLUETOOTH_ERROR_NONE - Success \n
5791 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5797 int bluetooth_check_privilege_advertising_parameter(void);
5800 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5801 * @brief Get the LE scan response data
5803 * This function is used to get scan response data.
5804 * Before calling this API, the adapter should be enabled.
5806 * This function is a synchronous call.
5808 * @return BLUETOOTH_ERROR_NONE - Success \n
5809 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5810 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5811 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5813 * @param[out] value - Scan response data structure.
5814 * @param[out] length - The length of Scan response data.
5818 bluetooth_scan_resp_data_t *value = { {0} };
5821 ret = bluetooth_get_scan_response_data(&value, &length);
5824 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5827 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5829 * @brief Set scan response data with value
5831 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5833 * This function is a synchronous call.
5835 * @return BLUETOOTH_ERROR_NONE - Success \n
5836 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5837 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5840 * @param[in] value - LE Scan response data structure.
5844 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5847 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5849 * @brief Set scan interval and window
5851 * This function is used to set LE scan interval and window size
5853 * This function is a synchronous call.
5855 * @return BLUETOOTH_ERROR_NONE - Success \n
5856 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5857 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5860 * @param[in] interval - Interval of LE scan (msec)
5861 * @param[in] window - Window size of LE scan (msec)
5865 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5868 * @fn int bluetooth_is_advertising(void)
5869 * @brief Check for the advertising is in-progress or not.
5871 * This API is used to check the current status of the advertising procedure.
5872 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5875 * This function checks whether the advertising is started or not.
5877 * This function is a synchronous call.
5879 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5881 * @return BLUETOOTH_ERROR_NONE - Success \n
5882 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5885 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5889 gboolean is_advertising = 0;
5891 ret = bluetooth_is_advertising(&is_advertising);
5894 int bluetooth_is_advertising(gboolean *is_advertising);
5897 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5898 * @brief Add LE device to white list
5900 * This API is used to add LE device to white list
5901 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5905 * This function is a synchronous call.
5907 * @param[in] address The address of remote device
5909 * @return BLUETOOTH_ERROR_NONE - Success \n
5910 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5913 * @see bluetooth_set_custom_advertising
5915 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5918 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5919 * @brief Remove LE device from white list
5921 * This API is used to remove LE device from white list
5922 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5926 * This function is a synchronous call.
5928 * @param[in] address The address of remote device
5930 * @return BLUETOOTH_ERROR_NONE - Success \n
5931 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5934 * @see bluetooth_set_custom_advertising
5936 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5939 * @fn int bluetooth_clear_white_list(void)
5940 * @brief Clear white list
5942 * This API is used to clear white list
5943 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5947 * This function is a synchronous call.
5949 * @param[in] address The address of remote device
5951 * @return BLUETOOTH_ERROR_NONE - Success \n
5952 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5955 * @see bluetooth_set_custom_advertising
5957 int bluetooth_clear_white_list(void);
5960 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5961 * const bluetooth_le_connection_param_t *parameters)
5962 * @brief update connection paramter of LE connection.
5964 * This function is a synchronous call.
5966 * @return BLUETOOTH_ERROR_NONE - Success \n
5967 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5970 * @param[in] address - remote device address value.
5971 * @param[in] parameters - new connection parameters.
5974 * @see bluetooth_bond_device
5976 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5977 const bluetooth_le_connection_param_t *parameters);
5980 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5982 * @brief Enable/Disable LE Privacy feature.
5984 * This function is used to enable or disable LE Privacy feature.
5985 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5987 * This function is a synchronous call.
5989 * @return BLUETOOTH_ERROR_NONE - Success \n
5990 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5991 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5994 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5998 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6001 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6003 * @brief Enable/Disable LE static random address.
6005 * This function is used to enable or disable LE static random address.
6007 * This function is a synchronous call.
6009 * @return BLUETOOTH_ERROR_NONE - Success \n
6010 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6011 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6014 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6018 int bluetooth_set_le_static_random_address(gboolean enable);
6021 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6022 * bluetooth_le_connection_mode_t mode)
6023 * @brief update connection paramter of LE connection.
6025 * This function is a synchronous call.
6027 * @return BLUETOOTH_ERROR_NONE - Success \n
6028 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6029 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6032 * @param[in] address - remote device address value.
6033 * @param[in] mode - new connection mode.
6037 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6038 bluetooth_le_connection_mode_t mode);
6041 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6042 * @brief Request for new ATT MTU value.
6044 * This function is a asynchronous call.
6046 * @return BLUETOOTH_ERROR_NONE - Success \n
6047 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6048 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6051 * @param[in] address - remote device address value.
6052 * @param[in] mtu - MTU value to be set.
6056 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6059 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6060 * unsigned int *mtu)
6061 * @brief Gets the xisting MTU value set for a connection.
6063 * This function is a synchronous call.
6065 * @return BLUETOOTH_ERROR_NONE - Success \n
6066 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6067 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6070 * @param[in] address - remote device address value.
6071 * @param[out] mtu - MTU value set for the connection.
6075 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6079 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6080 * bluetooth_device_address_t *id_address)
6081 * @brief Gets the Identity address of remote device.
6083 * This function is a synchronous call.
6085 * @return BLUETOOTH_ERROR_NONE - Success \n
6086 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6087 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6090 * @param[in] device_rpa - remote Resolvable private address.
6091 * @param[out] id_address - remote Identity device address value.
6095 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6096 bluetooth_device_address_t *id_address);
6099 * @fn int bluetooth_le_read_maximum_data_length()
6100 * @brief reads the maximum LE data length supported in the controller.
6102 * This function is a synchronous call.
6104 * @return BLUETOOTH_ERROR_NONE - Success \n
6105 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6111 int bluetooth_le_read_maximum_data_length(
6112 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6114 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6115 * @brief writes the host suggested values for the controllers max transmitted no of payload
6116 * octects to be used for new connections.
6118 * This function is a synchronous call.
6120 * @return BLUETOOTH_ERROR_NONE - Success \n
6121 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6127 int bluetooth_le_write_host_suggested_default_data_length(
6128 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6130 int bluetooth_le_read_suggested_default_data_length(
6131 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6133 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6134 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6136 int bluetooth_pbap_init(void);
6137 int bluetooth_pbap_deinit(void);
6138 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6139 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6140 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6141 bt_pbap_folder_t *folder);
6142 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6143 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6144 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6145 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6146 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6147 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6148 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6149 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6152 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6154 * @brief Set manufacturer data with value
6156 * This function is used to set manufacturer data.
6158 * This function is a synchronous call.
6160 * @return BLUETOOTH_ERROR_NONE - Success \n
6161 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6162 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6165 * @param[in] value - Manufacturer data structure.
6169 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6171 int bluetooth_set_passkey_notification(gboolean enable);
6173 #ifdef TIZEN_DPM_VCONF_ENABLE
6175 * @fn int bluetooth_dpm_is_mode_allowed(void);
6177 * @brief Checks Restriction for BT mode(BT allowed or not)
6179 * This function is a synchronous call.
6181 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6182 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6183 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6190 int bluetooth_dpm_is_mode_allowed(void);
6194 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6196 * @brief Sets Restriction for BT mode(BT allowed or not)
6198 * This function is a synchronous call.
6200 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6201 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6202 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6205 * @param[in] value - BT Allow value.
6206 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6207 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6208 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6209 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6213 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6216 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6218 * @brief Reads the Restriction for BT mode(BT allowed or not)
6220 * This function is a synchronous call.
6222 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6223 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6224 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6228 * @param[out] value - BT Allow value.
6229 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6230 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6231 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6232 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6236 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6239 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6241 * @brief Sets the Restriction for device.
6243 * This function is a synchronous call.
6245 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6246 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6247 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6250 * @param[in] value - State value.
6251 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6252 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6256 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6259 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6261 * @brief Reads the Restriction for device.
6263 * This function is a synchronous call.
6265 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6266 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6267 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6271 * @param[out] value - State value.
6272 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6273 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6277 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6280 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6282 * @brief Sets the Restriction for uuid.
6284 * This function is a synchronous call.
6286 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6287 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6288 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6291 * @param[in] value - State value.
6292 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6293 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6297 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6300 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6302 * @brief Reads the Restriction for uuid.
6304 * This function is a synchronous call.
6306 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6307 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6308 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6312 * @param[out] value - State value.
6313 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6314 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6318 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6321 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6323 * @brief Adds the device to blacklist.
6325 * This function is a synchronous call.
6327 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6328 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6329 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6332 * @param[in] device_address - Device address
6336 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6339 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6341 * @brief Adds the device to whitelist.
6343 * This function is a synchronous call.
6345 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6346 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6347 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6350 * @param[in] device_address - Device address
6354 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6357 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6359 * @brief Adds the Service UUIDS to blacklist.
6361 * This function is a synchronous call.
6363 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6364 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6365 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6368 * @param[in] service_uuids - profile or custom service uuids
6372 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6375 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6377 * @brief Adds the Service UUIDS to whitelist.
6379 * This function is a synchronous call.
6381 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6382 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6383 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6386 * @param[in] service_uuids - profile or custom service uuids
6390 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6393 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6395 * @brief Clears the devices from blacklist.
6397 * This function is a synchronous call.
6399 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6400 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6401 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6408 int bluetooth_dpm_clear_devices_from_blacklist(void);
6411 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6413 * @brief Clears the devices from whitelist.
6415 * This function is a synchronous call.
6417 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6418 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6419 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6426 int bluetooth_dpm_clear_devices_from_whitelist(void);
6429 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6431 * @brief Clears the uuids from blacklist.
6433 * This function is a synchronous call.
6435 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6436 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6437 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6444 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6447 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6449 * @brief Clears the uuids from whitelist.
6451 * This function is a synchronous call.
6453 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6454 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6455 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6462 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6465 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6467 * @brief reads the devices from blacklist.
6469 * This function is a synchronous call.
6471 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6472 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6473 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6476 * @param[out] device_list - list of devices
6480 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6483 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6485 * @brief reads the devices from whitelist.
6487 * This function is a synchronous call.
6489 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6490 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6491 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6494 * @param[out] device_list - list of devices
6498 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6501 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6503 * @brief reads the uuids from blacklist.
6505 * This function is a synchronous call.
6507 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6508 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6509 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6512 * @param[in] uuid_list - list of uuids
6516 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6519 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6521 * @brief reads the uuids from whitelist.
6523 * This function is a synchronous call.
6525 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6526 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6527 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6530 * @param[in] uuid_list - list of uuids
6534 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6537 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6539 * @brief Removes the device from whitelist.
6541 * This function is a synchronous call.
6543 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6544 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6545 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6548 * @param[in] device_address - Device address
6552 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6555 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6557 * @brief Removes the device from blacklist.
6559 * This function is a synchronous call.
6561 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6562 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6563 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6566 * @param[in] device_address - Device address
6570 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6573 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6575 * @brief Removes the Service UUIDS from whitelist.
6577 * This function is a synchronous call.
6579 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6580 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6581 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6584 * @param[in] service_uuids - profile or custom service uuids
6588 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6591 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6593 * @brief Removes the Service UUIDS from blacklist.
6595 * This function is a synchronous call.
6597 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6598 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6599 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6602 * @param[in] service_uuids - profile or custom service uuids
6606 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6609 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6611 * @brief Sets the Restriction for outgoing call.
6613 * This function is a synchronous call.
6615 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6616 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6617 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6620 * @param[in] value - State value.
6621 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6622 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6626 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6629 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6631 * @brief Reads the Restriction for outgoing call.
6633 * This function is a synchronous call.
6635 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6636 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6637 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6641 * @param[out] value - State value.
6642 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6643 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6647 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6650 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6652 * @brief Sets the Restriction for Pairing.
6654 * This function is a synchronous call.
6656 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6657 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6658 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6661 * @param[in] value - State value.
6662 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6663 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6667 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6670 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6672 * @brief Reads the Restriction for Pairing
6674 * This function is a synchronous call.
6676 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6677 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6678 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6682 * @param[out] value - State value.
6683 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6684 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6688 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6691 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6693 * @brief Sets the Restriction for using Profiles.
6695 * This function is a synchronous call.
6697 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6698 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6699 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6702 * @param[in]profile - Profile.
6703 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6704 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6705 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6706 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6707 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6708 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6709 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6710 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6711 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6712 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6713 * BLUETOOTH_DPM_PROFILE_NONE
6714 * @param[in] value - State value.
6715 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6716 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6720 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6723 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6725 * @brief Reads the Restriction for using Profiles.
6727 * This function is a synchronous call.
6729 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6730 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6731 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6734 * @param[in]profile - Profile.
6735 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6736 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6737 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6738 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6739 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6740 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6741 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6742 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6743 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6744 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6745 * BLUETOOTH_DPM_PROFILE_NONE
6746 * @param[out] value - State value.
6747 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6748 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6752 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6755 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6757 * @brief Sets the Restriction for Desktop Connectivity.
6759 * This function is a synchronous call.
6761 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6762 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6763 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6766 * @param[in] value - State value.
6767 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6768 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6772 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6775 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6777 * @brief Reads the Restriction for Desktop Connectivity.
6779 * This function is a synchronous call.
6781 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6782 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6783 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6787 * @param[out] value - State value.
6788 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6789 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6793 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6796 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6798 * @brief Sets the Restriction for Discoverable state.
6800 * This function is a synchronous call.
6802 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6803 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6804 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6807 * @param[in] value - State value.
6808 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6809 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6813 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6816 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6818 * @brief Reads the Restriction for Discoverable state.
6820 * This function is a synchronous call.
6822 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6823 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6824 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6828 * @param[out] value - State value.
6829 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6830 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6834 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6837 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6839 * @brief Sets the Restriction for linited discoverable state..
6841 * This function is a synchronous call.
6843 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6844 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6845 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6848 * @param[in] value - State value.
6849 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6850 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6854 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6857 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6859 * @brief Reads the Restriction for limited discoverable state.
6861 * This function is a synchronous call.
6863 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6864 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6865 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6869 * @param[out] value - State value.
6870 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6871 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6875 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6877 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6879 * @brief Sets the Restriction for Data trasnfer.
6881 * This function is a synchronous call.
6883 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6884 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6885 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6888 * @param[in] value - State value.
6889 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6890 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6894 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6898 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6900 * @brief Reads the Restriction for Data trasnfer.
6902 * This function is a synchronous call.
6904 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6905 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6906 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6910 * @param[out] value - State value.
6911 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6912 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6916 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6919 * @fn int bluetooth_set_proximity_property(const bluetooth_device_address_t *device_address,
6920 * bluetooth_pxp_poperty_t property, int value);
6922 * @brief Sets the Proximity alert level/properties.
6924 * This function is a synchronous call.
6926 * @return BLUETOOTH_ERROR_NONE - Success \n
6927 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
6928 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
6929 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
6932 * @param[in] device_address remote device address
6933 * @param[in] property proximity profile property
6934 * @param[in] value alert level/property value to be set
6939 int bluetooth_set_proximity_property(const bluetooth_device_address_t *device_address,
6940 bluetooth_pxp_poperty_t property, int value);
6943 * @fn int bluetooth_get_proximity_property(const bluetooth_device_address_t *device_address,
6944 * bluetooth_pxp_poperty_t property, int *value);
6946 * @brief Reads the Proximity alert level/properties.
6948 * This function is a synchronous call.
6950 * @return BLUETOOTH_ERROR_NONE - Success \n
6951 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
6952 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
6953 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
6956 * @param[in] device_address remote device address
6957 * @param[in] property proximity profile property
6958 * @param[out] value alert level/property value
6962 int bluetooth_get_proximity_property(const bluetooth_device_address_t *device_address,
6963 bluetooth_pxp_poperty_t property, int *value);
6966 * @fn int bluetooth_get_proximity_supported_services(const bluetooth_device_address_t *device_address,
6967 * int *services_supported);
6969 * @brief Reads the Proximity profile supported properties/services.
6971 * This function is a synchronous call.
6973 * @return BLUETOOTH_ERROR_NONE - Success \n
6974 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
6975 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
6976 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
6979 * @param[in] device_address remote device address
6980 * @param[out] services_supported proximity profile property/service
6984 int bluetooth_get_proximity_supported_services(const bluetooth_device_address_t *device_address,
6985 int *services_supported);
6988 * @fn int bluetooth_register__proximity_reporter();
6990 * @brief Register all proximity related services in BlueZ.
6992 * This function is a synchronous call.
6994 * @return BLUETOOTH_ERROR_NONE - Success \n
6995 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7001 int bluetooth_register_proximity_reporter();
7004 * @fn int bluetooth_unregister__proximity_reporter();
7006 * @brief Unregister all proximity related services in BlueZ.
7008 * This function is a synchronous call.
7010 * @return BLUETOOTH_ERROR_NONE - Success \n
7011 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7017 int bluetooth_unregister_proximity_reporter();
7025 #endif /* __cplusplus */
7026 #endif /* _BLUETOOTH_API_H_*/