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_
28 #endif /* __cplusplus */
31 * @defgroup BLUETOOTHFW BluetoothFW
33 * A base library for bluetooth framework
35 * @addtogroup BLUETOOTHFW
39 #define BLUETOOTH_ADDRESS_STRING_LENGTH 17 /**< This specifies bluetooth device address length (AA:BB:CC:DD:EE:FF) */
40 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
41 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
42 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
43 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
44 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
45 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
46 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
47 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
49 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
50 a device can support */
52 #define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/
54 #define BLUETOOTH_UUID_STRING_MAX 50
55 #define BLUETOOTH_PATH_STRING 50
57 #define BLUETOOTH_OOB_DATA_LENGTH 16
59 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
62 * This is Bluetooth Connected event role
64 #define RFCOMM_ROLE_SERVER 1
65 #define RFCOMM_ROLE_CLIENT 2
68 * This is RFCOMM default Channel Value
70 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
73 * This is maximum length for search value string for PBAP Phonebook Search
75 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
78 #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids
82 * This is Bluetooth error code
84 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
86 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
87 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
89 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
90 /**< Callback error */
91 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
92 /**< invalid paramerror */
93 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
94 /**< invalid data error */
95 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
96 /**< Memory allocation error */
97 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
98 /**< out of memory error */
99 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
100 /**< timeout error */
101 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
102 /**< No resource error */
103 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
104 /**< internal error */
105 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
106 /**< Not supported error */
107 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
108 /**< Operation is failed because
109 of not enabled BT Adapter */
110 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
111 /**< Enabling is failed because of
112 already enabled BT Adapter */
113 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
114 /**< Operation is failed because of
115 other on going operation */
116 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
117 /**< access denied error */
118 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
119 /**< max client error */
120 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
121 /**< not found error */
122 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
123 /**< service search fail */
124 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
125 /**< pairing failed error */
126 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
127 /**< Not paired error */
128 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
129 /**< no service error */
130 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
131 /**< no connection error */
132 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
133 /**< alread connected error */
134 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
135 /**< connection busy error */
136 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
137 /**< connection error */
138 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
139 /**< max connection error*/
140 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
141 /**< Not in operation */
142 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
143 /**< Cancelled by user */
144 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
145 /**< Service record registration failed */
146 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
147 /**< Operation in progress */
148 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
149 /**< authentication failed error when paring*/
150 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
151 /**< Remote host is down */
152 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
153 /**< End of device list */
155 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
156 /**< Obex agent already exists */
157 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
158 /**< Obex agent does not exist */
160 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
161 /**< Already initialized */
163 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
164 /**< Permission deined */
166 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
167 /**< Nap already done */
169 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
170 /**< Not initialized */
172 #define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27)
173 /**< Authentication rejected */
175 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
176 /**< Device Policy Restricted */
179 * Device disconnection reasons; received from stack
181 #define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04
182 #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
183 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
184 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
185 #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13
186 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14
187 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15
188 #define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16
189 #define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17
190 #define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
191 #define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
196 * Device disconnect reason
199 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
200 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
201 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
202 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
203 } bluetooth_device_disconnect_reason_t;
206 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
209 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
210 } bluetooth_device_address_t;
213 * This is Bluetooth device address type
216 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
217 BLUETOOTH_DEVICE_RANDOM_ADDRESS
218 } bluetooth_device_address_type_t;
221 * This is Bluetooth version
224 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
225 } bluetooth_version_t;
228 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
231 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
232 } bluetooth_device_name_t;
235 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
238 int data_len; /**< manafacturer specific data length */
239 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
240 } bluetooth_manufacturer_data_t;
243 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
244 } bluetooth_device_pin_code_t;
250 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
251 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
252 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
253 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
254 } bluetooth_adapter_state_t;
260 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
261 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
262 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
263 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
264 } bluetooth_adapter_le_state_t;
270 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
271 /*Changed the order to make it compatable with old method */
272 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
273 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
274 /**< Discoverable mode with time limit
275 After specific timeout, it is changed
276 to non discoverable mode */
277 } bluetooth_discoverable_mode_t;
280 * Network connect mode
283 BLUETOOTH_NETWORK_PANU_ROLE,
285 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
286 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
287 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
288 } bluetooth_network_role_t;
294 BLUETOOTH_RFCOMM_SERVICE = 0x01,
295 BLUETOOTH_A2DP_SERVICE = 0x02,
296 BLUETOOTH_HSP_SERVICE = 0x04,
297 BLUETOOTH_HID_SERVICE = 0x08,
298 BLUETOOTH_NAP_SERVICE = 0x10,
299 BLUETOOTH_HFG_SERVICE = 0x20,
300 BLUETOOTH_GATT_SERVICE = 0x40,
301 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
302 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
303 BLUETOOTH_PBAP_SERVICE = 0x200,
304 } bluetooth_service_type_t;
310 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF,
311 /* represents that connection
312 * type can both BR/EDR and LE */
313 BLUETOOTH_DEV_CONN_BREDR = 0x00,
314 BLUETOOTH_DEV_CONN_LE = 0x01,
315 } bluetooth_conn_type_t;
321 BLUETOOTH_CODEC_ID_CVSD = 0x01,
322 BLUETOOTH_CODEC_ID_MSBC = 0x02,
323 } bluetooth_codec_type_t;
329 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
330 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
331 } bluetooth_hf_audio_connected_type_t;
337 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
338 } bluetooth_advertising_data_t;
344 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
345 } bluetooth_scan_resp_data_t;
348 * Advertising filter policy
351 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
352 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
353 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
354 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
355 } bluetooth_advertising_filter_policy_t;
361 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
362 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
363 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
364 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
365 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
366 } bluetooth_advertising_type_t;
369 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
370 BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
371 } bluetooth_gatt_service_change_type_t;
374 BLUETOOTH_GATT_PERMISSION_READ = 0x01,
375 BLUETOOTH_GATT_PERMISSION_WRITE = 0x02,
376 BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04,
377 BLUETOOTH_GATT_PERMISSION_ENCRYPT_WRITE = 0x08,
378 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_READ = 0x10,
379 BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20,
380 } bt_gatt_permission_t;
383 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
384 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
385 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
386 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
387 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
388 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
389 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
390 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE = 0x80,
391 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES = 0x100,
392 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ = 0x200,
393 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE = 0x400,
394 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800,
395 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000,
396 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff,
397 } bt_gatt_characteristic_property_t;
400 * Remote device request types for attributes
403 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
404 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
405 } bluetooth_gatt_att_request_tyep_t;
408 * Proximity Property Type
411 BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */
412 BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */
413 BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */
414 } bluetooth_pxp_poperty_t;
417 * Advertising parameters
422 guint8 filter_policy;
424 } bluetooth_advertising_params_t;
430 int type; /**< passive 0, active 1 */
431 float interval; /**< LE scan interval */
432 float window; /**< LE scan window */
433 } bluetooth_le_scan_params_t;
443 } bluetooth_le_connection_param_t;
446 LE Read Maximum Data Length
449 guint16 max_tx_octets;
451 guint16 max_rx_octets;
453 } bluetooth_le_read_maximum_data_length_t;
456 LE Read Host suggested default Data Length
459 guint16 def_tx_octets;
461 } bluetooth_le_read_host_suggested_data_length_t;
464 * Samsung XSAT Vendor dependent command
469 } bluetooth_vendor_dep_at_cmd_t;
475 BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */
476 BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */
477 } bluetooth_opp_transfer_type_t;
482 } bluetooth_hf_ciev_device_event_t;
484 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
485 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
486 /**< Base ID for GAP Event */
487 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
488 /**< Base ID for SDP events */
489 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
490 /**< Base ID for RFCOMM events */
491 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
492 /**< Base ID for NETWORK events */
493 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
494 /**< Base ID for HDP events */
495 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
496 /**< Base ID for OPC events */
497 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
498 /**< Base ID for Obex Server events */
499 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
500 /**< Base ID for GATT events */
502 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
503 /**< Base ID for Audio events */
504 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
505 /**< Base ID for HID events */
506 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
507 /**< Base ID for Advertising events */
508 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
509 /**< Base ID for PBAP Client events */
510 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
511 /**< Base ID for AVRCP events */
512 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
513 /**< Base ID for IPSP events */
514 #define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020))
515 /**< Base ID for MAP events */
518 * Bluetooth event type
521 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
523 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
524 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
525 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
526 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
527 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
528 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
529 /**< Bluetooth event Discoverable timeout requested*/
530 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
531 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
532 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
533 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
534 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
535 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
536 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
537 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
538 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
539 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
540 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
541 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
542 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
543 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
544 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
545 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
546 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
547 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
548 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
549 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
550 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
552 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
553 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
554 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
555 BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */
556 BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */
558 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
559 /**< Bluetooth event serice search base id */
560 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
561 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
562 /**< RFCOMM data receive event */
563 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
564 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
566 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
568 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
569 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
571 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
573 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
574 /**< Bluetooth Network event */
575 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
576 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
577 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
578 /**< Network disconnected evnet in server */
580 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
581 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
583 BLUETOOTH_EVENT_HDP_CONNECTED
584 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
585 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
586 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
588 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
589 /* OPC Connected event */
590 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
591 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
592 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
593 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
595 BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE,
596 BLUETOOTH_EVENT_MAP_DISCONNECTED,
598 BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE,
599 BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS,
600 BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED,
601 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE,
602 BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED,
604 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE,
605 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS,
606 BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED,
607 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
608 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS,
609 BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED,
610 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE,
611 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS,
612 BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED,
613 BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
614 BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
615 BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
617 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
618 /* Obex server authorize event*/
619 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
620 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
621 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
622 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
623 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
624 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
626 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
627 /**<Discovered GATT service characteristics event*/
628 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
629 /**<Remote GATT charateristic value changed event*/
630 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
631 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
632 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
633 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
634 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
635 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
636 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
637 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
638 BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
639 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
640 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
641 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
642 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
643 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
644 BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
646 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
647 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
648 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
649 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
650 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
651 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
652 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
653 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
654 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
655 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
656 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
657 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
658 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
659 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
660 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
661 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
662 BLUETOOTH_EVENT_HF_CONNECTED,
663 BLUETOOTH_EVENT_HF_DISCONNECTED,
664 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
665 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
666 BLUETOOTH_EVENT_HF_RING_INDICATOR,
667 BLUETOOTH_EVENT_HF_CALL_WAITING,
668 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
669 BLUETOOTH_EVENT_HF_CALL_STARTED,
670 BLUETOOTH_EVENT_HF_CALL_ENDED,
671 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
672 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
673 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
674 BLUETOOTH_EVENT_HF_CALL_STATUS,
675 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
676 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
677 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
678 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
679 BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING,
680 BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL,
681 BLUETOOTH_EVENT_HF_CALL_IDLE,
682 BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
683 BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
684 BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
686 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
687 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
688 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
689 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
690 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
692 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
693 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
694 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
695 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
696 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
697 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
698 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
699 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
701 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
702 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
703 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
704 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
705 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
706 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
707 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
709 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
710 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
711 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
712 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
713 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
714 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
715 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
716 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
717 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
719 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
720 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
721 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
722 BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
723 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
724 BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
725 } bluetooth_event_type_t;
728 * This bt_service_uuid_list_t enum indicates service uuid list .
729 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
733 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
734 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
735 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
736 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
737 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
738 BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
739 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
740 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
741 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
742 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
743 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
744 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
745 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
747 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
748 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
749 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
750 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
751 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
752 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
753 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
754 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
755 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
756 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
757 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
758 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
759 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
760 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
762 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
763 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
764 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
765 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
766 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
767 /**<DIRECT PRINTING*/
768 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
769 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
770 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
771 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
772 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
773 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
774 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
775 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
776 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
777 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
778 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
779 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
780 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
781 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
782 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
783 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
784 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
785 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
786 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
787 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
788 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
789 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
790 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
791 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
792 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
793 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
794 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
795 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
796 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
797 } bluetooth_service_uuid_list_t;
800 * Service class part of class of device returned from device discovery
803 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
804 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
805 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
806 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
807 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
808 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
809 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
810 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
811 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
812 } bluetooth_device_service_class_t;
816 * Major device mask (For device discovery)
819 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
820 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
821 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
822 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
823 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
824 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
825 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
826 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
827 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
828 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
829 } bluetooth_device_major_mask_t;
833 * Major device class (part of Class of Device)
836 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
837 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
838 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
839 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
840 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
841 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
842 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
843 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
844 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
845 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
846 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
847 } bluetooth_device_major_class_t;
850 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
852 /* About Computer Major class */
853 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
855 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
856 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
857 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
858 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
859 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
861 /* About Phone Major class */
862 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
863 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
864 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
865 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
866 /**< voice gateway minor class */
867 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
869 /* About LAN/Network Access Point Major class */
870 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
871 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
872 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
873 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
874 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
875 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
876 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
877 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
879 /* About Audio/Video Major class */
880 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
881 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
883 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
884 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
885 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
886 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
887 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
888 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
889 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
890 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
891 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
892 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
893 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
894 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
895 /**< Video Display and Loud
896 Speaker minor class */
897 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
900 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
902 /* About Peripheral Major class */
903 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
904 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
905 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
906 /**< Combo Keyboard or pointing
909 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
910 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
911 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
912 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
913 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
914 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
915 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
916 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
917 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
919 /* About Imaging Major class */
920 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
921 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
922 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
923 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
925 /* About Wearable Major class */
926 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
927 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
928 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
929 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
930 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
932 /* About Toy Major class */
933 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
934 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
935 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
936 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
937 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
939 /* About Health Major class */
940 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
941 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
942 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
943 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
944 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
945 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
946 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
947 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
948 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
949 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
950 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
951 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
952 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
953 } bluetooth_device_minor_class_t;
956 * structure to hold the device information
959 bluetooth_device_major_class_t major_class; /**< major device class */
960 bluetooth_device_minor_class_t minor_class; /**< minor device class */
961 bluetooth_device_service_class_t service_class;
962 /**< service device class */
963 } bluetooth_device_class_t;
966 * Discovery Role types
969 DISCOVERY_ROLE_BREDR = 0x1,
971 DISCOVERY_ROLE_LE_BREDR
972 } bt_discovery_role_type_t;
975 * Connected state types
978 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
979 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
980 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
981 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
982 } bluetooth_connected_link_t;
988 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
989 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
990 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
991 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
992 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
993 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
994 } bluetooth_le_scan_filter_feature_t;
1000 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1001 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1002 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1003 } bluetooth_le_connection_mode_t;
1006 * structure to hold the device information
1009 bluetooth_device_address_t device_address; /**< device address */
1010 bluetooth_device_name_t device_name; /**< device name */
1011 bluetooth_device_class_t device_class; /**< device class */
1012 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1013 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1015 int rssi; /**< received strength signal*/
1016 gboolean paired; /**< paired flag */
1017 bluetooth_connected_link_t connected; /**< connected link type */
1018 gboolean trust; /**< trust flag */
1019 gboolean is_alias_set; /** is device alias set flag**/
1020 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
1021 } bluetooth_device_info_t;
1024 * structure to hold the LE device information
1027 int data_len; /**< manafacturer specific data length */
1028 bluetooth_advertising_data_t data; /**< manafacturer specific data */
1029 } bluetooth_le_advertising_data_t;
1032 bluetooth_device_address_t device_address; /**< device address */
1033 int addr_type; /**< address type*/
1034 int rssi; /**< received strength signal*/
1035 bluetooth_le_advertising_data_t adv_ind_data;
1036 bluetooth_le_advertising_data_t scan_resp_data;
1037 } bluetooth_le_device_info_t;
1041 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
1042 bluetooth_device_address_t device_address; /**< device address */
1043 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
1044 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
1045 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
1046 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
1047 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1048 bluetooth_le_advertising_data_t service_data; /**< service data */
1049 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
1050 int manufacturer_id; /**< manufacturer ID */
1051 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
1052 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
1053 } bluetooth_le_scan_filter_t;
1056 bluetooth_device_address_t device_address; /**< device address */
1057 unsigned int mtu; /** < MTU set for the ATT connection */
1058 unsigned int status; /** < status of the MTU exchange */
1059 } bluetooth_le_att_mtu_info_t;
1062 * structure to hold the paired device information
1065 bluetooth_device_address_t device_address; /**< paired device address */
1066 bluetooth_device_name_t device_name; /**< device name */
1067 bluetooth_device_class_t device_class; /**< device class */
1068 } bluetooth_paired_device_info_t;
1071 * structure to hold the paired device information
1074 bluetooth_device_address_t device_address;
1075 /**< device address */
1076 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1077 /**< network interface name */
1078 } bluetooth_network_device_info_t;
1081 * Authentication event types
1085 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1086 BLUETOOTH_AUTH_PIN_REQUEST,
1087 BLUETOOTH_AUTH_PASSKEY_REQUEST,
1088 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1089 } bluetooth_auth_type_t;
1092 * structure to hold the pincode/pass-key req informations
1095 bluetooth_device_address_t device_address; /**< remote device address */
1096 bluetooth_device_name_t device_name; /**< device name */
1097 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1098 } bluetooth_authentication_request_info_t;
1101 * Stucture to hold discovery option
1104 unsigned short max_response; /**< the number of maximum response */
1105 unsigned short discovery_duration;
1106 /**< duration of discovery (seconds) */
1107 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
1108 classOfDevice variable */
1109 } bluetooth_discovery_option_t;
1112 * Stucture to hold event information
1115 int event; /**< event type */
1116 int result; /**< Success or error value */
1118 /**<parameter data pointer */
1120 } bluetooth_event_param_t;
1123 bluetooth_device_address_t device_addr;
1124 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1125 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1126 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1131 bluetooth_device_address_t device_addr;
1132 unsigned char addr_type;
1134 } bt_connection_info_t;
1137 * Stucture to rfcomm receive data
1142 /**< the socket fd */
1143 int buffer_size;/**< the length of the receive buffer */
1145 /**< the receive data buffer */
1146 } bluetooth_rfcomm_received_data_t;
1152 HTYPE_TRANS_HANDSHAKE,
1153 HTYPE_TRANS_HID_CONTROL,
1154 HTYPE_TRANS_GET_REPORT,
1155 HTYPE_TRANS_SET_REPORT,
1156 HTYPE_TRANS_GET_PROTOCOL,
1157 HTYPE_TRANS_SET_PROTOCOL,
1160 } bt_hid_header_type_t;
1166 PTYPE_DATA_RTYPE_INPUT,
1167 PTYPE_DATA_RTYPE_OUTPUT
1168 } bt_hid_param_type_t;
1171 * Stucture to hid receive data
1174 const char *address;
1175 bt_hid_header_type_t type;
1176 /**< Header type containing */
1177 bt_hid_param_type_t param;
1178 /**< Param type in header like INPUT Report or OutPut Report */
1179 int buffer_size;/**< the length of the receive buffer */
1181 /**< the receive data buffer */
1182 } bluetooth_hid_received_data_t;
1185 * Stucture to rfcomm connection
1189 int socket_fd; /**< the socket fd */
1190 int server_id; /* Server id */
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_connection_t;
1198 * Stucture to rfcomm disconnection
1202 /**< the socket fd */
1203 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1204 bluetooth_device_address_t device_addr;
1205 /**< device address */
1206 char uuid[BLUETOOTH_UUID_STRING_MAX];
1207 } bluetooth_rfcomm_disconnection_t;
1211 /**< the socket fd */
1212 bluetooth_device_address_t device_addr;
1213 /**< device address */
1214 } bluetooth_rfcomm_connection_request_t;
1218 /**< the socket fd */
1219 bluetooth_device_address_t device_addr;
1220 /**< device address */
1221 } bluetooth_hid_request_t;
1230 } bt_hdp_qos_type_t;
1236 HDP_ROLE_SOURCE = 0x0,
1238 } bt_hdp_role_type_t;
1242 * Stucture to HDP connected
1245 const char *app_handle; /**< the application handle */
1246 unsigned int channel_id; /**< the channel id */
1247 bt_hdp_qos_type_t type; /**< the QOS type */
1248 bluetooth_device_address_t device_address; /**< the remote address */
1249 } bt_hdp_connected_t;
1252 * Stucture to HDP disconnected
1255 unsigned int channel_id; /**< the channel id */
1256 bluetooth_device_address_t device_address; /**< the remote address */
1257 } bt_hdp_disconnected_t;
1260 * Stucture to HDP data indication
1263 unsigned int channel_id; /**< the channel id */
1264 const char *buffer; /**< the RX data buffer */
1265 unsigned int size; /**< the RX data size */
1266 } bt_hdp_data_ind_t;
1269 * Stucture to OPP client transfer information
1276 } bt_opc_transfer_info_t;
1278 /* TODO: MAP client structures, see above */
1280 /* Obex Server transfer type */
1281 #define TRANSFER_PUT "PUT"
1282 #define TRANSFER_GET "GET"
1284 * Stucture to OPP/FTP Server authorize information
1291 } bt_obex_server_authorize_into_t;
1299 } bt_obex_server_type_t;
1302 * Stucture to OPP/FTP server transfer information
1310 unsigned long file_size;
1312 bt_obex_server_type_t server_type;
1314 unsigned char *contact_auth_info;
1315 } bt_obex_server_transfer_info_t;
1318 * Stucture to OPP/FTP server connection/disconnection information
1324 } bt_obex_server_connection_info_t;
1328 * Stucture to OOB data
1332 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1333 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1334 unsigned int hash_len;
1335 unsigned int randomizer_len;
1337 unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1338 unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1339 unsigned int hash256_len;
1340 unsigned int randomizer256_len;
1344 * Structure to GATT attribute handle data
1350 } bt_gatt_handle_info_t;
1353 * Structure to GATT Remote service data
1360 bt_gatt_handle_info_t include_handles;
1361 bt_gatt_handle_info_t char_handle;
1362 } bt_gatt_service_property_t;
1365 * Structure to GATT Remote characteristic data
1369 char *service_handle;
1370 bt_gatt_handle_info_t handle_info;
1371 } bt_gatt_discovered_char_t;
1374 * Structure to format of GATT Characteristic Value
1378 unsigned char format;
1379 unsigned char exponent;
1380 unsigned short unit;
1381 unsigned char name_space;
1382 unsigned short description;
1383 } bt_gatt_char_format_t;
1386 * Structure to GATT Characteristic property
1394 bt_gatt_char_format_t format;
1396 unsigned int val_len;
1397 unsigned int permission;
1398 char *representation;
1399 bt_gatt_handle_info_t char_desc_handle;
1400 } bt_gatt_char_property_t;
1403 * Structure to GATT Characteristic descriptor property
1410 unsigned int val_len;
1411 } bt_gatt_char_descriptor_property_t;
1414 * Structure to GATT Characteristic value
1421 } bt_gatt_char_value_t;
1424 * Structure to GATT Read Request
1428 char *service_handle;
1432 } bt_gatt_read_req_t;
1435 * Structure to GATT Value change
1439 char *service_handle;
1442 gboolean response_needed;
1446 } bt_gatt_value_change_t;
1449 bluetooth_device_address_t device_addr;
1451 bluetooth_gatt_service_change_type_t change_type;
1452 } bt_gatt_service_change_t;
1455 * Structure to GATT characteristc Notification change
1459 char *service_handle;
1460 gboolean att_notify;
1461 } bt_gatt_char_notify_change_t;
1464 * Structure to Indication confirmation
1468 char *service_handle;
1471 } bt_gatt_indicate_confirm_t;
1474 * Structure to RSSI Signal Strength Alert
1485 * Structure to RSSI Signal Strength
1495 * Structure for RSSI Enabled or Disabled
1501 gboolean rssi_enabled;
1502 } bt_rssi_enabled_t;
1505 * Structure for RSSI Threshold
1510 int in_range_threshold;
1512 } bt_rssi_threshold_t;
1516 * Structure for Suppoted Profiles and Trusted Profiles
1523 } bt_supported_profile_trusted_t;
1526 * Structure for PBAP Folder Parameters
1529 unsigned char addressbook;
1530 unsigned char folder_type;
1534 * Structure for PBAP Pull application Parameters
1537 unsigned char format;
1538 unsigned char order;
1539 unsigned short offset;
1540 unsigned short maxlist;
1541 long long unsigned fields;
1542 } bt_pbap_pull_parameters_t;
1545 * Structure for PBAP List application Parameters
1548 unsigned char order;
1549 unsigned short offset;
1550 unsigned short maxlist;
1551 } bt_pbap_list_parameters_t;
1554 * Structure for PBAP Pull vCard application Parameters
1557 unsigned char format;
1558 long long unsigned fields;
1560 } bt_pbap_pull_vcard_parameters_t;
1563 * Structure for PBAP Search application Parameters
1566 unsigned char order;
1567 unsigned short offset;
1568 unsigned short maxlist;
1569 unsigned char search_attribute;
1570 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1571 } bt_pbap_search_parameters_t;
1574 * Structure for PBAP Connection Status
1577 bluetooth_device_address_t btaddr;
1579 } bt_pbap_connected_t;
1582 * Structure for PBAP Phonebook Size
1585 bluetooth_device_address_t btaddr;
1587 } bt_pbap_phonebook_size_t;
1590 * Structure for PBAP Phonebook Pull
1593 bluetooth_device_address_t btaddr;
1596 } bt_pbap_phonebook_pull_t;
1599 * Structure for PBAP vCard List
1602 bluetooth_device_address_t btaddr;
1606 } bt_pbap_vcard_list_t;
1609 * Structure for PBAP vCard Pull
1612 bluetooth_device_address_t btaddr;
1615 } bt_pbap_vcard_pull_t;
1618 * Structure for PBAP Phonebook search List
1621 bluetooth_device_address_t btaddr;
1625 } bt_pbap_phonebook_search_list_t;
1628 * Stucture to HF Call status information
1632 char *number; /*Phone Number */
1633 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1634 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1635 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1636 int idx; /*Call index/ID */
1637 } bt_hf_call_status_info_t;
1642 } bt_hf_call_list_s;
1648 TRUSTED_PROFILE_PBAP = 1,
1649 TRUSTED_PROFILE_MAP,
1650 TRUSTED_PROFILE_SAP,
1651 TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1652 } bluetooth_trusted_profile_t;
1655 * Restricted Profile types
1658 RESTRICTED_PROFILE_HFP_HS = 1,
1659 RESTRICTED_PROFILE_A2DP,
1660 } bluetooth_restricted_profile_t;
1663 * Structure for LE data length change params
1666 bluetooth_device_address_t device_address;
1667 guint16 max_tx_octets;
1668 guint16 max_tx_time;
1669 guint16 max_rx_octets;
1670 guint16 max_rx_time;
1671 } bt_le_data_length_params_t;
1674 * Structure for proximity property change params
1677 bluetooth_device_address_t device_address;
1681 } bt_pxp_property_changed_params_t;
1684 * @brief DPM BT allowance state
1688 BLUETOOTH_DPM_ERROR = -1, /**< bluetooth allowance error */
1689 BLUETOOTH_DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
1690 BLUETOOTH_DPM_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
1691 BLUETOOTH_DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
1695 * @brief DPM API result
1699 BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
1700 BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
1701 BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
1702 BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
1703 BLUETOOTH_DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
1704 BLUETOOTH_DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
1708 * @brief DPM Policy status
1712 BLUETOOTH_DPM_STATUS_ERROR = -1,
1714 BLUETOOTH_DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
1715 BLUETOOTH_DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
1717 BLUETOOTH_DPM_ENABLE = 1, /**< DPM Policy status enabled. */
1718 BLUETOOTH_DPM_DISABLE = 0, /**< DPM Policy status disabled. */
1720 BLUETOOTH_DPM_FALSE = 0, /**< DPM Policy status false. */
1721 BLUETOOTH_DPM_TRUE = 1, /**< DPM Policy status true. */
1725 /* policy-group : BLUETOOTH */
1726 BLUETOOTH_DPM_POLICY_ALLOW,
1727 BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1728 BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1729 BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1730 BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1731 BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1732 BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1733 BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1734 BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1735 BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1736 BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1737 BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1738 BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1739 BLUETOOTH_DPM_POLICY_END,
1740 } bt_dpm_policy_cmd_t;
1743 struct bt_dpm_policy {
1749 typedef struct bt_dpm_policy bt_dpm_policy_t;
1752 BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1753 BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1754 BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1755 BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1756 BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1757 BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1758 BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1759 BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1760 BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1761 BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1762 BLUETOOTH_DPM_PROFILE_NONE,
1765 struct bt_dpm_profile_val {
1766 int value; /* tells whether the profile is enabled or disabled */
1768 typedef struct dpm_profile_val dpm_profile_state_t;
1771 * Structure to DPM device list
1775 bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1776 } bt_dpm_device_list_t;
1779 * Structure to DPM uuid list
1783 char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1784 } bt_dpm_uuids_list_t;
1787 * Structure for IPSP Interface Info
1790 bluetooth_device_address_t btaddr;
1792 } bt_ipsp_connection_info_t;
1796 char* remote_address;
1797 } bt_map_client_session_info_s;
1800 * Callback pointer type
1802 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1805 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1806 * @brief Set the callback function pointer for bluetooth event
1809 * This API will register the callback function, when any response and event are received from
1810 * bluetooth framework. @n
1811 * this registered callback function will be get called with appropriate event and data structures.
1812 * This function is a synchronous call. An application developer can call
1813 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1814 * type. This registered function will receive events of bluetooth_event_type_t type along with
1818 * @param[in] callback_ptr A pointer to the callback function
1819 * @param[in] user_data A pointer to user data
1820 * @return BLUETOOTH_ERROR_NONE - Success
1824 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1826 GMainLoop *main_loop = (GMainLoop*) user_data;
1830 // Code for each event
1832 g_main_loop_quit(main_loop);
1839 GMainLoop *main_loop = NULL;
1842 main_loop = g_main_loop_new(NULL, FALSE);
1843 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1844 if (ret >= BLUETOOTH_ERROR_NONE)
1846 // bluetooth_register_callback returned Success
1850 // bluetooth_register_callback returned failiure
1852 g_main_loop_run(main_loop);
1856 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1859 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1860 * @brief Set the callback function pointer for bluetooth le event
1863 * This API will register the callback function, when any response and event are received from
1864 * bluetooth framework. @n
1865 * this registered callback function will be get called with appropriate event and data structures.
1866 * This function is a synchronous call. An application developer can call
1867 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1868 * type. This registered function will receive events of bluetooth_event_type_t type along with
1872 * @param[in] callback_ptr A pointer to the callback function
1873 * @param[in] user_data A pointer to user data
1874 * @return BLUETOOTH_ERROR_NONE - Success
1878 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1881 * @fn int bluetooth_le_unregister_callback(void)
1882 * @brief Set the callback function pointer for bluetooth le event
1885 * This API will register the callback function, when any response and event are received from
1886 * bluetooth framework. @n
1887 * this registered callback function will be get called with appropriate event and data structures.
1888 * This function is a synchronous call. An application developer can call
1889 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1890 * type. This registered function will receive events of bluetooth_event_type_t type along with
1895 * @return BLUETOOTH_ERROR_NONE - Success
1899 int bluetooth_le_unregister_callback(void);
1902 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1903 * @brief Set the callback function pointer for bluetooth event
1906 * This API will register the callback function, when any response and event are received from
1907 * bluetooth framework. @n
1908 * this registered callback function will be get called with appropriate event and data structures.
1909 * This function is a synchronous call. An application developer can call
1910 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1911 * type. This registered function will receive events of bluetooth_event_type_t type along with
1916 * @return BLUETOOTH_ERROR_NONE - Success
1920 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1922 GMainLoop *main_loop = (GMainLoop*) user_data;
1926 // Code for each event
1928 g_main_loop_quit(main_loop);
1935 GMainLoop *main_loop = NULL;
1938 main_loop = g_main_loop_new(NULL, FALSE);
1939 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1940 if (ret >= BLUETOOTH_ERROR_NONE)
1942 // bluetooth_register_callback returned Success
1946 // bluetooth_register_callback returned failiure
1948 ret = bluetooth_deregister_callback(void);
1949 g_main_loop_run(main_loop);
1953 int bluetooth_unregister_callback(void);
1956 * @fn int bluetooth_enable_adapter(void)
1957 * @brief Enable the Bluetooth H/W
1960 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1961 * send request to bluetooth chip for activation.
1962 * This function is typically called at startup or when Bluetooth services are required. This
1963 * function must be called before calling any other API of Bluetooth operations.
1965 * Before performing any operations like Device discover, service search etc.., the adapter must be
1968 * This function is a asynchronous call.
1969 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1970 * through registered callback function with appropriate result code
1971 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1972 * BLUETOOTH_ERROR_NONE - Success \n
1974 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1975 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1977 * @return BLUETOOTH_ERROR_NONE - Success\n
1978 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1979 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1980 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1981 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1983 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1985 void bt_event_callback(int event, bluetooth_event_param_t *param)
1989 case BLUETOOTH_EVENT_ENABLED:
1990 if (param->result == BLUETOOTH_ERROR_NONE)
1992 // Successfully Enabled
2005 ret = bluetooth_enable_adapter();
2009 int bluetooth_enable_adapter(void);
2012 * @fn int bluetooth_disable_adapter(void)
2013 * @brief Disable the Bluetooth H/W
2016 * This function disables Bluetooth protocol stack and hardware. This function is called when
2017 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2019 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2020 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2021 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2023 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2026 * This function is a asynchronous call.
2027 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2028 * through registered callback function.
2031 * @return BLUETOOTH_ERROR_NONE - Success\n
2032 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2033 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2034 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2036 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2038 void bt_event_callback(int event, bluetooth_event_param_t *param)
2042 case BLUETOOTH_EVENT_DISABLED:
2043 if (param->result == BLUETOOTH_ERROR_NONE)
2045 // Successfully disabled
2058 ret = bluetooth_disable_adapter();
2061 int bluetooth_disable_adapter(void);
2062 int bluetooth_recover_adapter(void);
2063 int bluetooth_check_adapter_le(void);
2064 int bluetooth_enable_adapter_le(void);
2066 int bluetooth_disable_adapter_le(void);
2069 * @fn int bluetooth_reset_adapter(void)
2070 * @brief Reset the Bluetooth H/W and values
2073 * This function resets Bluetooth protocol stack and hardware. This function is called when
2074 * an user want to initialize Bluetooth environment.
2076 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2079 * This function is a synchronous call.
2081 * @return BLUETOOTH_ERROR_NONE - Success\n
2082 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2084 * @see bluetooth_check_adapter, bluetooth_enable_adapter
2089 ret = bluetooth_reset_adapter();
2092 int bluetooth_reset_adapter(void);
2095 * @fn int bluetooth_is_supported(void)
2096 * @brief Check if the bluetooth is supported or not by the current target
2098 * This API checks whether the bluetooth is supported or not.
2099 * This API only run by root permission.
2101 * This function is a synchronous call.
2103 * @return 0 - if bluetooth is not supported\n
2104 * 1 - if bluetooth is supported\n
2105 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
2110 ret = bluetooth_is_supported();
2113 int bluetooth_is_supported(void);
2117 * @fn int bluetooth_check_adapter(void)
2118 * @brief Check the current status of the Bluetooth adapter
2121 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2122 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2123 * bluetooth adapter.
2124 * This API get the adapter internal data structure and check current adapter status.
2126 * This function is a synchronous call.
2129 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2130 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2132 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
2136 ret = bluetooth_check_adapter();
2139 int bluetooth_check_adapter(void);
2142 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2143 * @brief Get the local adapter bluetooth address
2146 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2147 * the adapter should be enabled.
2148 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2149 * contain Bluetooth address.
2150 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2151 * friendly name for each device.
2152 * There is no event callback for this API.
2154 * This function is a synchronous call.
2157 * @return BLUETOOTH_ERROR_NONE - Succeess \n
2158 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
2159 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
2160 * @param[out] local_address a device address of local bluetooth adapter
2165 bluetooth_device_address_t local_address={0,};
2168 ret = bluetooth_get_local_address(&local_address);
2171 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2174 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2175 * @brief Get the hci version
2178 * This function is used to get the bluetooth hci version
2179 * Before calling this API make sure that the adapter is enabled.
2181 * This function is a synchronous call.
2184 * @return BLUETOOTH_ERROR_NONE - Success \n
2185 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2186 * @param[out] timeout remain visibility timeout value
2189 bluetooth_version_t *version;
2191 ret = bluetooth_get_local_version (&version);
2194 int bluetooth_get_local_version(bluetooth_version_t *version);
2197 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2198 * @brief Get the local device name
2201 * This function is used, get the local device name. Since its difficult to remember the Adapter
2202 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2203 * friendly name is retrived by the remote device and displaying.
2204 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2206 * This function is a synchronous call.
2209 * @return BLUETOOTH_ERROR_NONE - Success \n
2210 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2211 * @param[out] local_name a local device name
2215 bluetooth_device_name_t local_name={0,}
2217 ret = bluetooth_get_local_name (&local_name);
2220 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2223 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2224 * @brief Set the local device name
2227 * This function is used to set the local device name. This is a human friendly name whose
2228 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2230 * This function is a synchronous call.
2232 * @param[in] local_name bluetooth device name to set local device
2234 * @return BLUETOOTH_ERROR_NONE - Success \n
2235 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2236 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2237 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2238 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2239 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2244 bluetooth_device_name_t local_name={0,}
2246 ret = bluetooth_set_local_name (&local_name);
2249 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2253 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2254 * @brief Check if the uuid is used or not
2256 * This function is used to check if the uuid is used or not.
2258 * This function is a synchronous call.
2260 * @param[in] service_uuid service uuid (UUID 128 bit as string)
2261 * @param[out] used if the uuid is used or not
2263 * @return BLUETOOTH_ERROR_NONE - Success \n
2264 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2265 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2266 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2271 gboolean used = FALSE;
2272 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2273 ret = bluetooth_is_service_used(uuid, &used);
2276 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2279 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2280 * @brief Check if the device is connected to the specific service
2282 * This function is used to check if if the device is connected to the specific service.
2284 * This function is a synchronous call.
2286 * @param[in] local_address a device address of remote bluetooth device
2287 * @param[in] type the service type
2288 * @param[out] is_connected if the device is connected or not
2290 * @return BLUETOOTH_ERROR_NONE - Success \n
2291 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2292 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2293 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2298 gboolean is_connected = FALSE;
2299 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2300 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2303 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2304 bluetooth_service_type_t type,
2305 gboolean *is_connected);
2308 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2309 * @brief Gets device's connected link type
2311 * This function is used to get device's connected link type
2313 * This function is a synchronous call.
2315 * @param[in] device_address a device address of remote bluetooth device
2316 * @param[out] connected_link a device's connected link type
2318 * @return BLUETOOTH_ERROR_NONE - Success \n
2319 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2320 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2321 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2326 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2327 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2328 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2331 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2332 bluetooth_connected_link_t *connected_link);
2335 * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2336 * @brief Sets a profile trusted for a device
2338 * This function is used to Set a profile as trusted for a device
2340 * This function is a synchronous call.
2342 * @param[in] device_address a device address of remote bluetooth device
2343 * @param[in] profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2344 * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted]
2346 * @return BLUETOOTH_ERROR_NONE - Success \n
2347 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2348 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2349 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2353 int bluetooth_set_profile_trusted(
2354 const bluetooth_device_address_t *device_address,
2355 int profile, int trust);
2358 * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2359 * @brief Gets a profile is trusted for a device
2361 * This function is used to Get a profile is trusted or not for a device
2363 * This function is a synchronous call.
2365 * @param[in] device_address a device address of remote bluetooth device
2366 * @param[in] profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2367 * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted]
2369 * @return BLUETOOTH_ERROR_NONE - Success \n
2370 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2371 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2372 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2376 int bluetooth_get_profile_trusted(
2377 const bluetooth_device_address_t *device_address,
2378 int profile, int *trust);
2381 * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2382 * @brief Sets a profile restricted connection for a device
2384 * This function is used to Set a profile as restricted for a device
2386 * This function is a synchronous call.
2388 * @param[in] device_address a device address of remote bluetooth device
2389 * @param[in] profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2390 * @param[in] restricted to set as restricted or not[1-restricted 0-permitted]
2392 * @return BLUETOOTH_ERROR_NONE - Success \n
2393 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2394 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2395 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2399 int bluetooth_set_profile_restricted(
2400 const bluetooth_device_address_t *device_address,
2401 int profile, int restricted);
2404 * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2405 * @brief Gets a restricted connection state
2407 * This function is used to Get a profile is restricted or not for a device
2409 * This function is a synchronous call.
2411 * @param[in] device_address a device address of remote bluetooth device
2412 * @param[in] profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2413 * @param[out] restricted profile is set as restricted or not[1-restricted 0-permitted]
2415 * @return BLUETOOTH_ERROR_NONE - Success \n
2416 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2417 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2418 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2422 int bluetooth_get_profile_restricted(
2423 const bluetooth_device_address_t *device_address,
2424 int profile, int *restricted);
2427 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2428 * @brief Get the visibility mode
2431 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2432 * visibity mode, the property of the device is determined whether it can be discoverable, non
2433 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2435 * This function is a synchronous call.
2438 * @return BLUETOOTH_ERROR_NONE - Success \n
2439 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2440 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2441 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2442 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2443 * @param[out] discoverable_mode current bluetooth discoverable mode
2445 * @see bluetooth_set_discoverable_mode
2447 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2449 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2452 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2455 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2457 * @brief Set the visibility mode
2460 * This function is used to set the discoverable mode (Visibility option).
2462 * Many times user may want to keep his device discoverable so that when peer device is performing
2463 * device search, he/she can find user's device. Application programmer can keep the mode as
2464 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2465 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2466 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2467 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2469 * This function is a synchronous call.
2471 * @return BLUETOOTH_ERROR_NONE - Success \n
2472 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2474 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2475 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2477 * @see bluetooth_get_discoverable_mode
2481 bluetooth_discoverable_mode_t mode;
2483 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2484 ret = bluetooth_set_discoverable_mode (mode, 180);
2488 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2493 * @fn int bluetooth_get_timeout_value(int *timeout)
2494 * @brief Get the visibility timeout value
2497 * This function is used to get the visibility timeout
2498 * Before calling this API make sure that the adapter is enabled.
2500 * This function is a synchronous call.
2503 * @return BLUETOOTH_ERROR_NONE - Success \n
2504 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2505 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2506 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2507 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2508 * @param[out] timeout remain visibility timeout value
2510 * @see bluetooth_set_discoverable_mode
2514 ret = bluetooth_get_timeout_value (&timeout);
2517 int bluetooth_get_timeout_value(int *timeout);
2521 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2522 * unsigned int classOfDeviceMask)
2523 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2525 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2526 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2527 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2528 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2529 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2530 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2531 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2532 * please see bluetooth_device_info_t for more details.
2535 * This API provides searching options like max responses, discovery duration in seconds and class
2536 * of device mask to filter device search. some times there may be too many bluetooth devices in
2537 * vicinity of your device.in such scenario, application can request to reduce number of responces
2538 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2539 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2540 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2541 * application defined time. please note that discovery_duration should be mentioned in seconds.
2542 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2545 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2546 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2547 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2549 * This function is a asynchronous call.
2550 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2551 * through registered callback function.
2553 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2554 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2556 * The completion or cancellation of the discovery is indicated by an
2557 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2559 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2562 * @return BLUETOOTH_ERROR_NONE - Success \n
2563 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2564 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2565 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2566 agent is not running \n
2568 * @param[in] max_response define the maximum response of the number of founded devices
2570 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2571 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2572 (refer to class of device)
2574 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2577 void bt_event_callback(int event, bluetooth_event_param_t *param)
2581 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2583 bluetooth_device_info_t *device_info = NULL;
2584 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2586 device_info = (bluetooth_device_info_t *)param->param_data;
2587 memcpy(&searched_device, &device_info->device_address,
2588 sizeof(bluetooth_device_address_t));
2589 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2590 device_info->device_address.addr[0],
2591 device_info->device_address.addr[1],
2592 device_info->device_address.addr[2],
2593 device_info->device_address.addr[3],
2594 device_info->device_address.addr[4],
2595 device_info->device_address.addr[5]);
2598 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2600 bluetooth_device_info_t *device_info = NULL;
2601 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2603 device_info = (bluetooth_device_info_t *)param->param_data;
2604 memcpy(&searched_device, &device_info->device_address,
2605 sizeof(bluetooth_device_address_t));
2606 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2607 device_info->device_name.name,
2608 device_info->device_address.addr[0],
2609 device_info->device_address.addr[1],
2610 device_info->device_address.addr[2],
2611 device_info->device_address.addr[3],
2612 device_info->device_address.addr[4],
2613 device_info->device_address.addr[5]);
2617 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2618 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2623 unsigned short max_response;
2624 unsigned short discovery_duration;
2625 unsigned classOfDeviceMask;
2629 discovery_duration =0;
2630 classOfDeviceMask =0;
2632 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2637 int bluetooth_start_discovery(unsigned short max_response,
2638 unsigned short discovery_duration,
2639 unsigned int classOfDeviceMask);
2642 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2643 * unsigned short max_response,
2644 * unsigned short discovery_duration,
2645 * unsigned int classOfDeviceMask)
2646 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2648 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2649 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2650 * Please see bluetooth_start_discovery() for other parameters description.
2652 * This function is a asynchronous call.
2653 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2654 * through registered callback function.
2656 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2657 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2659 * The completion or cancellation of the discovery is indicated by an
2660 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2662 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2665 * @return BLUETOOTH_ERROR_NONE - Success \n
2666 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2667 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2668 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2669 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2670 agent is not running \n
2672 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2673 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2674 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2675 * @param[in] max_response define the maximum response of the number of founded devices
2677 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2678 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2679 (refer to class of device)
2681 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2684 unsigned short type;
2685 unsigned short max_response;
2686 unsigned short discovery_duration;
2687 unsigned classOfDeviceMask;
2692 discovery_duration =0;
2693 classOfDeviceMask =0;
2695 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2700 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2701 unsigned short max_response,
2702 unsigned short discovery_duration,
2703 unsigned int classOfDeviceMask);
2706 * @fn int bluetooth_cancel_discovery (void)
2707 * @brief Cancel the on-going device discovery operation
2710 * This function stops the on-going device discovery operation. This API has to be called after the
2711 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2712 * the bluetooth_start_discovery API
2714 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2715 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2716 * cancel the discover request once the user received the device to which he wish to connect.
2718 * This function is a asynchronous call.
2719 * If the call is success to cancel discovey then the application will receive
2720 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2721 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2722 * BLUETOOTH_ERROR_NONE
2725 * @return BLUETOOTH_ERROR_NONE - Success \n
2726 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2727 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2728 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2729 other application \n
2730 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2732 * @see bluetooth_start_discovery
2734 void bt_event_callback(int event, bluetooth_event_param_t *param)
2738 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2739 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2748 ret = bluetooth_cancel_discovery();
2751 int bluetooth_cancel_discovery(void);
2754 * @fn int bluetooth_start_le_discovery(void)
2755 * @brief Start the generic device discovery which finds the LE devices.
2757 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2758 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2759 * It try to find LE devices. Bluetooth device address and name are
2760 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2761 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2762 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2763 * please see bluetooth_device_info_t for more details.
2765 * This function is a asynchronous call.
2766 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2767 * through registered callback function.
2769 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2772 * The completion or cancellation of the discovery is indicated by an
2773 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2775 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2778 * @return BLUETOOTH_ERROR_NONE - Success \n
2779 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2780 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2781 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2782 agent is not running \n
2785 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2788 void bt_event_callback(int event, bluetooth_event_param_t *param)
2792 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2794 bluetooth_device_info_t *device_info = NULL;
2795 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2797 device_info = (bluetooth_device_info_t *)param->param_data;
2798 memcpy(&searched_device, &device_info->device_address,
2799 sizeof(bluetooth_device_address_t));
2800 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2801 device_info->device_address.addr[0],
2802 device_info->device_address.addr[1],
2803 device_info->device_address.addr[2],
2804 device_info->device_address.addr[3],
2805 device_info->device_address.addr[4],
2806 device_info->device_address.addr[5]);
2810 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2811 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2817 ret = bluetooth_start_discovery();
2822 int bluetooth_start_le_discovery(void);
2825 * @fn int bluetooth_stop_le_discovery (void)
2826 * @brief Cancel the on-going device LE discovery operation
2829 * This function stops the on-going device discovery operation. This API has to be called after the
2830 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2831 * the bluetooth_start_le_discovery API
2834 * This function is a asynchronous call.
2835 * If the call is success to cancel discovey then the application will receive
2836 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2837 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2838 * BLUETOOTH_ERROR_NONE
2841 * @return BLUETOOTH_ERROR_NONE - Success \n
2842 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2843 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2844 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2845 other application \n
2846 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2848 * @see bluetooth_start_discovery
2850 void bt_event_callback(int event, bluetooth_event_param_t *param)
2854 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2855 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2864 ret = bluetooth_stop_le_discovery();
2867 int bluetooth_stop_le_discovery(void);
2870 * @fn int bluetooth_is_discovering(void)
2871 * @brief Check for the device discovery is in-progress or not.
2873 * This API is used to check the current status of the Discovery operation.If discovery is in\
2874 * progress normally other operations are not allowed.
2875 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2876 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2877 * event before performing other operations. This API is used to get for the current discovery
2878 * operation status and using bluetooth_cancel_discovery()
2879 * we can cancell the ongoing discovery process.
2880 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2883 * This function checks whether the device discovery is started or not.
2885 * This function is a synchronous call.
2888 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2889 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2890 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2893 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2897 ret = bluetooth_is_discovering ();
2900 int bluetooth_is_discovering(void);
2903 * @fn int bluetooth_is_le_discovering(void)
2904 * @brief Check for the device LE discovery is in-progress or not.
2906 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2907 * progress normally other operations are not allowed.
2908 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2909 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2910 * event before performing other operations. This API is used to get for the current discovery
2911 * operation status and using bluetooth_stop_le_discovery()
2912 * we can cancell the ongoing LE discovery process.
2913 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2916 * This function checks whether the device LE discovery is started or not.
2918 * This function is a synchronous call.
2921 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2922 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2923 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2926 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2930 ret = bluetooth_is_le_discovering ();
2933 int bluetooth_is_le_discovering(void);
2936 * @fn int bluetooth_is_le_scanning(void)
2937 * @brief Check for the device LE scan is in-progress or not.
2939 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2940 * progress normally other operations are not allowed.
2942 * This function checks whether the device LE Scan is started or not.
2944 * This function is a synchronous call.
2946 * @return TRUE - LE Scan in progress \n
2947 * FALSE - LE Scan is not in progress \n
2952 gboolean is_le_scanning = 0;
2953 is_le_scanning = bluetooth_is_le_scanning ();
2956 gboolean bluetooth_is_le_scanning(void);
2958 gboolean bluetooth_is_scan_filter_supported(void);
2961 * @fn int bluetooth_force_hcidump(int timeout)
2962 * @brief Enable /disable force-hcidump
2964 * This function control force-hcidump.
2966 * This function is a synchronous call.
2968 * @return BLUETOOTH_ERROR_NONE - Success \n
2969 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2970 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2972 * @param[in] start To enable or disable force-hcidump[TRUE / FALSE]
2977 int bluetooth_force_hcidump(int timeout);
2980 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2981 * @brief Register scan filter.
2983 * This function registers the scan filter.
2985 * This function is a synchronous call.
2987 * @return BLUETOOTH_ERROR_NONE - Success \n
2989 * @param[in] filter scan filter to register
2990 * @param[out] slot_id the slot ID of scan filter
2994 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2997 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2998 * @brief Register scan filter.
3000 * This function unregisters the scan filter.
3002 * This function is a synchronous call.
3004 * @return BLUETOOTH_ERROR_NONE - Success \n
3006 * @param[in] slot_id the slot ID of scan filter
3010 int bluetooth_unregister_scan_filter(int slot_id);
3013 * @fn int bluetooth_unregister_all_scan_filters(void)
3014 * @brief Register scan filter.
3016 * This function usregisters all scan filters.
3018 * This function is a synchronous call.
3020 * @return BLUETOOTH_ERROR_NONE - Success \n
3024 int bluetooth_unregister_all_scan_filters(void);
3027 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3028 int link_type, bt_rssi_threshold_t rssi_threshold)
3029 * @brief Enable RSSI monitoring
3031 * This function enables RSSI monitoring and sets threshold for a connection
3033 * @return BLUETOOTH_ERROR_NONE - Success \n
3036 * @see bluetooth_get_rssi_strength
3038 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3039 int link_type, bt_rssi_threshold_t *rssi_threshold);
3042 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3043 * @brief Gets Raw RSSI signal Strength
3045 * This function gives the Raw RSSI signal strength for a connection.
3047 * @return BLUETOOTH_ERROR_NONE - Success \n
3050 * @see bluetooth_enable_rssi
3052 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3054 int bluetooth_set_connectable(gboolean is_connectable);
3056 int bluetooth_is_connectable(gboolean *is_connectable);
3059 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3060 * @brief Initiate a bonding process
3063 * This function initiates a bonding procedure with a peer device. The bonding procedure
3064 * enables authentication and optionally encryption on the Bluetooth link.
3066 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3067 * inititate the bonding request to the devices already in the paired list.
3069 * Usually we call this API after the device discovery.
3070 * This function is a asynchronous call.
3072 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3073 * mentioed result code
3074 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3075 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3076 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3077 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3078 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3080 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3081 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3084 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3087 * @return BLUETOOTH_ERROR_NONE - Success \n
3088 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3089 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3090 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3091 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3093 * @param[in] device_address This indicates an address of the device with which the pairing
3094 * should be initiated
3096 * @see bluetooth_cancel_bonding
3098 void bt_event_callback(int event, bluetooth_event_param_t *param)
3102 case BLUETOOTH_EVENT_BONDING_FINISHED:
3104 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3105 if (param->result >= BLUETOOTH_ERROR_NONE)
3107 bluetooth_device_info_t *device_info = NULL;
3108 device_info = (bluetooth_device_info_t *)param->param_data;
3109 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3110 mjr[%#x] min[%#x] srv[%#x]",
3111 device_info->device_name.name,
3112 device_info->device_address.addr[0],
3113 device_info->device_address.addr[1],
3114 device_info->device_address.addr[2],
3115 device_info->device_address.addr[3],
3116 device_info->device_address.addr[4],
3117 device_info->device_address.addr[5],
3118 device_info->device_class.major_class,
3119 device_info->device_class.minor_class,
3120 device_info->device_class.service_class);
3134 bluetooth_device_address_t device_address={{0}};
3136 ret = bluetooth_bond_device(&device_address);
3140 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3143 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3144 * bluetooth_conn_type_t conn_type)
3145 * @brief Initiate a bonding process
3148 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3149 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3151 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3152 * inititate the bonding request to the devices already in the paired list.
3154 * Usually we call this API after the device discovery.
3155 * This function is a asynchronous call.
3157 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3158 * mentioed result code
3159 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3160 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3161 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3162 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3163 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3165 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3166 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3169 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3172 * @return BLUETOOTH_ERROR_NONE - Success \n
3173 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3174 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3175 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3176 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3178 * @param[in] device_address This indicates an address of the device with which pairing
3179 * should be initiated
3180 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3183 * @see bluetooth_cancel_bonding
3185 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3186 bluetooth_conn_type_t conn_type);
3189 * @fn int bluetooth_cancel_bonding(void)
3190 * @brief Cancel the on-going bonding process
3192 * This API is called to cancel the on-going bonding procedure. It should be called before the
3193 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3194 * This API is useful when the remote device is not responding to the bond request or we wish to
3195 * cancel the bonding request. In this case we need not wait for the timeout to happen.
3197 * This function is a synchronous call.
3199 * @return BLUETOOTH_ERROR_NONE - Success \n
3200 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3201 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3204 * @see bluetooth_bond_device
3210 ret = bluetooth_cancel_bonding();
3213 int bluetooth_cancel_bonding(void);
3216 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3217 * @brief Remove bonding
3220 * To communicate with remote device over bluetooth link, user should bond with peer device.
3221 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3222 * API is used to remove peer device from the list. Please note that after removing the device
3223 * from bonded device list, you cannot communication with peer device until bonding happens again.
3225 * User can call this function by passing bluetooth device address of any bonded device. Please note
3226 * that after successful return of this function, any bluetooth application running on your device
3227 * will not be able to communicate with unbonded device until bond operation happens again using
3228 * bluetooth_bond_device()
3231 * This function is a asynchronous call. The request to remove the specified device from the bonded
3232 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3233 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3234 * in case if there is a problem in locating given bluetooth device address in bonded devices list
3238 * @return BLUETOOTH_ERROR_NONE - Success \n
3239 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3240 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3241 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3242 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3243 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3244 * agent is not running \n
3245 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3248 * @param[in] device_address This indicates an address of the device to remove bonding
3252 * @see bluetooth_bond_device, bluetooth_cancel_bonding
3255 void bt_event_callback(int event, bluetooth_event_param_t *param)
3258 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3259 bluetooth_device_address_t *dev_addr = NULL;
3261 if (param->result == BLUETOOTH_ERROR_NONE) {
3262 dev_addr = (bluetooth_device_address_t *)param->param_data;
3264 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3265 dev_addr->addr[0], dev_addr->addr[1]
3266 dev_addr->addr[2], dev_addr->addr[3]
3267 dev_addr->addr[4], dev_addr->addr[5]
3278 bluetooth_device_address_t *device_address;
3280 // copy valid device address in device_address
3282 ret = bluetooth_unbond_device(device_address);
3285 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3288 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3289 * @brief Get bonded(paired) device list
3292 * This API gets all bonded device list.
3293 * The devices in the bonded device list further can be used to perform the authorization by calling
3294 * bluetooth_authorize_device API.
3296 * This function is a synchronous call.
3297 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3298 * there is no valid information in the dev_list.
3299 * The len field in the dev_list represents the number of bonded devices. The data structure for
3300 * bonded device information is bluetooth_device_info_t.
3303 * @return BLUETOOTH_ERROR_NONE - Success \n
3304 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3306 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3308 void bt_get_bonded_devices(void)
3312 GPtrArray *devinfo = NULL;
3313 bluetooth_device_info_t *ptr;
3315 // allocate the g_pointer_array
3316 devinfo = g_ptr_array_new();
3318 ret = bluetooth_get_bonded_device_list(&devinfo);
3319 if (ret != BLUETOOTH_ERROR_NONE)
3321 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3325 printf("g pointer arrary count : [%d]", devinfo->len);
3326 for (i=0; i<devinfo->len; i++)
3328 ptr = g_ptr_array_index(devinfo, i);
3331 printf("Name [%s]\n", ptr->device_name.name);
3332 printf("Major Class [%d]\n", ptr->device_class.major_class);
3333 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3334 printf("Service Class [%d]\n", ptr->device_class.service_class);
3335 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3336 ptr->device_address.addr[0],
3337 ptr->device_address.addr[1], ptr->device_address.addr[2],
3338 ptr->device_address.addr[3],
3339 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3346 // free g_pointer_array
3347 g_ptr_array_free(devinfo, TRUE);
3352 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3354 int bluetooth_get_profile_connected_device_list(
3355 const char *profile_uuid, GPtrArray **addr_list);
3358 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3359 * bluetooth_device_info_t *dev_info)
3360 * @brief Get a bonded(paired) device
3363 * This API gets a bonded device.
3365 * This function is a synchronous call.
3366 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3367 * there is no valid information in the dev_info.
3368 * The data structure for bonded device information is bluetooth_device_info_t.
3371 * @return BLUETOOTH_ERROR_NONE - Success \n
3372 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3374 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3376 void bt_get_bonded_device(void)
3380 bluetooth_device_info_t devinfo = {0};
3381 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3383 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3384 if (ret != BLUETOOTH_ERROR_NONE)
3386 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3390 printf("Name [%s]\n", devinfo.device_name.name);
3391 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3392 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3393 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3394 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3395 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3396 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3397 devinfo.device_address.addr[5]);
3406 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3407 bluetooth_device_info_t *dev_info);
3411 * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3412 * gboolean *is_alias_set)
3413 * @brief Get is_alias_set property of device
3415 * This API gets is_alias_set property of a bonded device.
3417 * This function is a synchronous call.
3418 * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3419 * If not,there is no valid information in the is_alias_set.
3421 * @return BLUETOOTH_ERROR_NONE - Success \n
3422 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3427 bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3429 ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3432 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3433 gboolean *is_alias_set);
3436 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3437 * @brief set alias for bonded device
3440 * This function set alias for bonded device.
3442 * This function is a synchronous call.
3445 * @return BLUETOOTH_ERROR_NONE - Success \n
3446 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3447 * @param[in] device_address This indicates an address of the remote device
3448 * @param[in] alias This indicates an alias to set
3453 ret = bluetooth_set_alias(&remote_address);
3456 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3460 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3461 * @brief Get remote deivice
3464 * This function gets specific remote device.
3466 * This function is a asynchronous call.
3467 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3470 * @return BLUETOOTH_ERROR_NONE - Success \n
3471 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3472 * @param[in] device_address This indicates an address of the remote device
3477 ret = bluetooth_get_remote_device(&remote_address);
3480 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3483 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3484 * gboolean authorized)
3485 * @brief Authorize/Unauthorize a bonded device
3488 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3489 * with/without user confirmation.
3491 * If we select a paired device and make it authorized by calling this API with the authorized
3492 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3493 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3494 * then it will ask for the user conformation before the connection.
3496 * This API supposed to be called on the paired devices. Which means we have to use this API only
3497 * after successful pairing.
3499 * This function is a asynchronous call.
3500 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3502 * @return BLUETOOTH_ERROR_NONE - Success \n
3503 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3504 * @param[in] device_address This indicates an address of the device to authorize \n
3505 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3507 * @see bluetooth_get_bonded_device_list
3509 void bt_event_callback(int event, bluetooth_event_param_t *param)
3513 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3515 if (param->result == BLUETOOTH_ERROR_NONE)
3519 //device authorization failed failure
3527 bluetooth_device_address_t device_address={{0}};
3528 gboolean authorized;
3532 ret = bluetooth_authorize_device(&device_address,authorized);
3535 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3536 gboolean authorized);
3538 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3539 const bluetooth_device_pin_code_t *pin_code);
3541 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3544 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3546 * @brief Receives Legacy Passkey\pin with following authentication response types
3548 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3549 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3552 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3555 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3557 * @brief This API sends user confirmation reply to the local adapter.
3559 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3562 int bluetooth_passkey_confirmation_reply(gboolean reply);
3565 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3566 * @brief Get all services supported by remote device
3569 * This API call initiates the search for the services supported by the specified device. Normally
3570 * the service search will take a couple of seconds to get it completed. Before calling this API
3571 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3572 * perform the service search. We can get the device address by doing a device discovery operation.
3575 * This function is a asynchronous call.
3576 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3578 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3579 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3580 * event is generated with appropriate result code.
3582 * @return BLUETOOTH_ERROR_NONE - Success \n
3583 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3584 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3585 * @param[in] device_address This indicates an address of the device
3586 * whose services need to be found
3588 * @see bluetooth_cancel_service_search
3590 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3593 * @fn int bluetooth_cancel_service_search(void)
3594 * @brief Cancel the ongoing service search operation
3597 * This function cancel the ongoing service search operation. This API is usually calling after the
3598 * bluetooth_search_service API.
3599 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3600 * if the user wish to cancel the Ongoing service search operation.
3602 * This API should be called just after the bluetooth_search_service API and before the
3603 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3605 * This function is a synchronous call.
3607 * @return BLUETOOTH_ERROR_NONE - Success \n
3608 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3609 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3610 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3613 * @see bluetooth_search_service
3618 ret = bluetooth_cancel_service_search();
3621 int bluetooth_cancel_service_search(void);
3624 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3625 * @brief Register rfcomm socket with a specific uuid
3628 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3629 * descriptor of the server.
3630 * This is the first API which is called to create the server. Once we created the server socket,
3631 * we will listen on that return socket.
3632 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3635 * @return socket FD on Success \n
3636 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3637 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3638 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3639 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3640 * @param[in] UUID (128 bits)
3643 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3647 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3648 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3652 int bluetooth_rfcomm_create_socket(const char *uuid);
3655 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3656 * @brief Register rfcomm socket with a specific uuid
3659 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3660 * descriptor of the server.
3661 * This is the first API which is called to create the server. Once we created the server socket,
3662 * we will listen on that return socket.
3663 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3666 * @return socket FD on Success \n
3667 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3668 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3669 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3670 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3671 * @param[in] UUID (128 bits)
3672 * @param[in] bus_name (const char)
3673 * @param[in] path (const char)
3676 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3680 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3681 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3685 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3688 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3689 * @brief De-register the rfcomm socket
3692 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3693 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3694 * descriptor else no event will come. We will call this API only after the
3695 * bluetooth_rfcomm_listen_and_accept.
3696 * This is a synchronous call.
3698 * @return BLUETOOTH_ERROR_NONE - Success \n
3699 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3700 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3701 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3702 * @param[in] int socket_fd
3705 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3708 void bt_event_callback(int event, bluetooth_event_param_t *param)
3712 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3714 bluetooth_rfcomm_connection_t *discon_ind =
3715 (bluetooth_rfcomm_connection_t *)param->param_data;
3717 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3725 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3726 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3728 ret = bluetooth_rfcomm_remove_socket(fd);
3731 int bluetooth_rfcomm_remove_socket(int socket_fd);
3734 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3735 * @brief De-register the rfcomm socket
3738 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3739 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3740 * descriptor else no event will come. We will call this API only after the
3741 * bluetooth_rfcomm_listen_and_accept_ex.
3742 * This is a synchronous call.
3744 * @return BLUETOOTH_ERROR_NONE - Success \n
3745 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3746 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3747 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3748 * @param[in] UUID (128 bits)
3751 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3754 void bt_event_callback(int event, bluetooth_event_param_t *param)
3758 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3760 bluetooth_rfcomm_connection_t *discon_ind =
3761 (bluetooth_rfcomm_connection_t *)param->param_data;
3763 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3771 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3772 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3774 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3777 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3780 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3781 * @brief Disconnect rfcomm connection
3784 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3785 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3788 * @return BLUETOOTH_ERROR_NONE - Success \n
3789 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3790 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3791 * @param[in] int socket_fd the sending socket fd
3797 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3799 printf("Disconnection failed");
3801 printf("Disconnection Success");
3805 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3808 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3809 * @brief Rfcomm socket listen
3812 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3813 * after the bluetooth_rfcomm_create_socket API.
3814 * This API listen for the incomming connection and once it receives a connection, it will give
3815 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3816 * event to the application. This is an Asynchronous API call.
3819 * @return BLUETOOTH_ERROR_NONE - Success \n
3820 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3821 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3823 * @param[in] int socket_fd
3824 * @param[in] max pending connection.
3827 * @see bluetooth_rfcomm_create_socket
3830 void bt_event_callback(int event, bluetooth_event_param_t* param)
3834 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3836 bluetooth_rfcomm_connection_t *conn_ind =
3837 (bluetooth_rfcomm_connection_t *)param->param_data;
3839 printf("\nConnected from FD %d", conn_ind->socket_fd);
3847 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3848 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3852 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3855 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3856 * @brief Rfcomm socket listen
3859 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3860 * after the bluetooth_rfcomm_create_socket API.
3861 * This API listen for the incomming connection and once it receives a connection, it will give
3862 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3863 * event to the application. This is an Asynchronous API call.
3866 * @return BLUETOOTH_ERROR_NONE - Success \n
3867 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3868 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3870 * @param[in] int socket_fd
3871 * @param[in] max pending connection.
3876 * @see bluetooth_rfcomm_create_socket_ex
3879 void bt_event_callback(int event, bluetooth_event_param_t* param)
3883 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3885 bluetooth_rfcomm_connection_t *conn_ind =
3886 (bluetooth_rfcomm_connection_t *)param->param_data;
3888 printf("\nConnected from FD %d", conn_ind->socket_fd);
3896 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3897 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3902 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3905 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3906 * @brief Rfcomm socket listen
3909 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3910 * after the bluetooth_rfcomm_create_socket API.
3911 * This API listen for the incomming connection and once it receives a connection, it will give
3912 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3913 * event to the application. This is an Asynchronous API call.
3916 * @return BLUETOOTH_ERROR_NONE - Success \n
3917 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3918 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3920 * @param[in] int socket_fd
3921 * @param[in] max pending connection.
3924 * @see bluetooth_rfcomm_create_socket
3927 void bt_event_callback(int event, bluetooth_event_param_t* param)
3931 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3933 char *name = (char *)param->param_data;
3935 printf("\nConnected from %s", name);
3937 bluetooth_rfcomm_accept_connection();
3945 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3946 ret = bluetooth_rfcomm_listen(fd, 1);
3950 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3953 * @fn int bluetooth_rfcomm_accept_connection()
3954 * @brief Accepts the authorization request indicated by the event
3955 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3957 * This function is a synchronous call.
3959 * @return BLUETOOTH_ERROR_NONE - Success \n
3960 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3962 * @param[in] the socket fd of the server
3963 * @param[out] the socket fd of the client
3967 * @see bluetooth_rfcomm_reject_connection
3969 int bluetooth_rfcomm_accept_connection(int server_fd);
3972 * @fn int bluetooth_rfcomm_reject_connection()
3973 * @brief Rejects the authorization request indicated by the event
3974 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3976 * This function is a synchronous call.
3978 * @return BLUETOOTH_ERROR_NONE - Success \n
3979 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3981 * @param[in] the socket fd of the server
3985 * @see bluetooth_rfcomm_accept_connection
3987 int bluetooth_rfcomm_reject_connection(int server_fd);
3990 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3991 * @brief Informs whether rfcomm server uuid is available or not.
3993 * This function is a synchronous call.
3995 * @return TRUE - RFCOMM uuid is available \n
3996 * FALSE - RFCOMM uuid is not available \n
3998 * @param[in] uuid UUID string
4004 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4007 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4008 * const char *remote_uuid)
4009 * @brief Connect to the remote device rfcomm *
4011 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4012 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4013 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4014 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4015 * initiating a connection.
4017 * @return BLUETOOTH_ERROR_NONE - Success \n
4018 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4019 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4020 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4021 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4022 * @param[in] bluetooth_device_address_t remote bt_address
4023 * @param[in] char remote uuid
4025 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4029 void bt_event_callback(int event, bluetooth_event_param_t *param)
4033 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4035 if (param->result >= BLUETOOTH_ERROR_NONE)
4037 bt_sdp_info_t *bt_sdp_info=param->param_data;
4039 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4040 bt_sdp_info->device_addr.addr[0],
4041 bt_sdp_info->device_addr.addr[1],
4042 bt_sdp_info->device_addr.addr[2],
4043 bt_sdp_info->device_addr.addr[3],
4044 bt_sdp_info->device_addr.addr[4],
4045 bt_sdp_info->device_addr.addr[5]);
4047 printf("Supported service list:\n");
4048 for(i=0; i<bt_sdp_info->service_index; i++)
4050 bt_sdp_info->service_list_array[i]);
4053 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4054 //rfcomm_test_uuid);
4058 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4060 bluetooth_rfcomm_connection_t *conn_ind =
4061 (bluetooth_rfcomm_connection_t *)param->param_data;
4063 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
4064 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4065 "SERVER" : "CLIENT");
4070 bluetooth_device_address_t remote_address = {{0},};
4071 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4072 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
4073 ret = bluetooth_search_service(&remote_address);
4075 printf("Seach failed, Reason = %d", ret);
4077 printf("Search Success, Ret = %d", ret);
4079 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4081 printf("Connection failed, Reason = %d", ret);
4083 printf("Connection Success, Ret = %d", ret);
4087 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4088 const char *remote_uuid);
4091 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4092 * @brief Disconnect rfcomm connection
4095 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
4096 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4099 * @return BLUETOOTH_ERROR_NONE - Success \n
4100 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4101 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4102 * @param[in] char remote bt_address
4105 * @see bluetooth_rfcomm_connect
4109 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4111 printf("Disconnection failed");
4113 printf("Disconnection Success");
4118 int bluetooth_rfcomm_disconnect(int socket_fd);
4121 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4122 * @brief Write to rfcomm connection
4125 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4126 * API is used to send the data for server and the client.
4128 * @return BLUETOOTH_ERROR_NONE - Success \n
4129 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4130 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4132 * @param[in] const char *buff Data buffer to send
4133 * @param[in] int length Length of the data
4136 * @see bluetooth_rfcomm_connect
4139 char *buff = "Test data 123456789"
4140 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4142 printf("Send failed");
4144 printf("Send success");
4148 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4151 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4152 * @brief Informs whether rfcomm client is connected.
4154 * This function is a synchronous call.
4156 * @return TRUE - RFCOMM client is connected \n
4157 * FALSE - RFCOMM client is not connected \n
4163 gboolean bluetooth_rfcomm_is_client_connected(void);
4164 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4165 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4168 * @fn int bluetooth_network_activate_server(void)
4169 * @brief Activate the NAP (Network Access Point) service
4171 * This function is a asynchronous call.
4172 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4174 * @return BLUETOOTH_ERROR_NONE - Success \n
4175 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4176 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4177 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4180 * @see bluetooth_network_deactivate_server
4183 int bluetooth_network_activate_server(void);
4186 * @fn int bluetooth_network_deactivate_server(void)
4187 * @brief Deactivate the NAP (Network Access Point) service
4189 * This function is a asynchronous call.
4190 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED 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 * @see bluetooth_network_activate_server
4201 int bluetooth_network_deactivate_server(void);
4204 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4205 * bluetooth_network_role_t role,
4207 * @brief Connect the network server in the peer
4209 * This function is a asynchronous call.
4210 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4212 * @return BLUETOOTH_ERROR_NONE - Success \n
4213 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4214 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4215 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4218 * @param[in] device_address This indicates an address of the device with which the pairing
4219 * should be initiated
4220 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4221 * need to use the third parameter.
4222 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
4223 * connect. UUID string
4225 * @see bluetooth_network_disconnect
4227 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4228 bluetooth_network_role_t role, char *custom_uuid);
4231 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4232 * bluetooth_network_role_t role,
4233 * char *custom_uuid)
4234 * @brief Connect the network server in the peer
4236 * This function is a asynchronous call.
4237 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4239 * @return BLUETOOTH_ERROR_NONE - Success \n
4240 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4241 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4242 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4245 * @param[in] device_address This indicates an address of the device with which the pairing
4246 * should be initiated
4248 * @see bluetooth_network_connect
4250 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4253 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4254 * @brief Disconnect the device from the network
4256 * This function is an asynchronous call.
4257 * The network server disconnect request is responded by
4258 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4260 * @return BLUETOOTH_ERROR_NONE - Success \n
4261 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4262 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4263 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4266 * @param[in] device_address This indicates an address of the connected client device
4268 * @see bluetooth_network_activate_server
4270 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4275 * @fn int bluetooth_hdp_activate(unsigned short data_type,
4276 * bt_hdp_role_type_t role,
4277 * bt_hdp_qos_type_t channel_type,
4278 * char **app_handle)
4279 * @brief Activate the HDP service for a particular data type
4281 * This function is a synchronous call.
4283 * @return BLUETOOTH_ERROR_NONE - Success \n
4284 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4285 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4286 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4289 * @param[in] data_type The data type against corresponding service
4290 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4291 * @param[in] channel_type The QOS type for the channel.
4292 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4293 * For role = HDP_ROLE_SINK, the channel_type
4294 * should be HDP_QOS_ANY.
4295 * @param[out] app_handle The application handler against corresponding service
4297 * @see bluetooth_hdp_deactivate
4299 int bluetooth_hdp_activate(unsigned short data_type,
4300 bt_hdp_role_type_t role,
4301 bt_hdp_qos_type_t channel_type,
4304 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4305 * @brief Deactivate the HDP service for a particular service using the handler
4307 * This function is a synchronous call.
4309 * @return BLUETOOTH_ERROR_NONE - Success \n
4310 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4311 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4312 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4315 * @param[in] app_handle The application handler against corresponding service
4317 * @see bluetooth_hdp_deactivate
4319 int bluetooth_hdp_deactivate(const char *app_handle);
4322 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4323 * const char *buffer, unsigned int size)
4324 * @brief Send data to the remote HDP device
4326 * This function is a synchronous call.
4328 * @return BLUETOOTH_ERROR_NONE - Success \n
4329 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4330 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4331 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4332 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
4335 * @param[in] channel_id The channel id for the connection.
4336 * @param[in] buffer The pdu buffer.
4337 * @param[in] size Size of the buffer.
4339 * @see bluetooth_hdp_connect
4341 int bluetooth_hdp_send_data(unsigned int channel_id,
4342 const char *buffer, unsigned int size);
4344 * @fn int bluetooth_hdp_connect(const char *app_handle,
4345 * bt_hdp_qos_type_t channel_type,
4346 * const bluetooth_device_address_t *device_address)
4347 * @brief Connect to the remote device(Mainly used by source)
4349 * This function is a asynchronous call.
4350 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4352 * @return BLUETOOTH_ERROR_NONE - Success \n
4353 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4354 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4355 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4356 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4359 * @param[in] app_handle The application handler against corresponding service
4360 * @param[in] channel_type The QOS type for the channel.
4361 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4362 * @param[in] device_address The remote device Bd address.
4365 * @see bluetooth_hdp_disconnect
4367 int bluetooth_hdp_connect(const char *app_handle,
4368 bt_hdp_qos_type_t channel_type,
4369 const bluetooth_device_address_t *device_address);
4371 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4372 * const bluetooth_device_address_t *device_address)
4373 * @brief Disconnect from the remote device(Mainly used by source)
4375 * This function is a asynchronous call.
4376 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4378 * @return BLUETOOTH_ERROR_NONE - Success \n
4379 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4380 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4381 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4382 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4385 * @param[in] channel_id The channel id for the connection.
4386 * @param[in] device_address The remote device Bd address.
4389 * @see bluetooth_hdp_connect
4391 int bluetooth_hdp_disconnect(unsigned int channel_id,
4392 const bluetooth_device_address_t *device_address);
4396 * @fn int bluetooth_opc_init(void)
4397 * @brief Initialize 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_INTERNAL - Internal Error \n
4405 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4406 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4411 * @see bluetooth_opc_deinit
4413 int bluetooth_opc_init(void);
4416 * @fn int bluetooth_opc_deinit(void)
4417 * @brief Deinitialize OPP client.
4419 * This function is a synchronous call.
4420 * No event corresponding to this api
4422 * @return BLUETOOTH_ERROR_NONE - Success \n
4423 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4424 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4429 * @see bluetooth_opc_init
4432 int bluetooth_opc_deinit(void);
4435 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4436 char **file_name_array)
4437 * @brief Send multiple files to a remote device.
4439 * This function is a asynchronous call.
4440 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4442 * @return BLUETOOTH_ERROR_NONE - Success \n
4443 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4444 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4445 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4446 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4447 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4448 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4451 * @param[in] device_address The remote device Bd address.
4452 * @param[in] file_name_array Array of filepaths to be sent.
4455 * @see bluetooth_opc_cancel_push
4458 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4459 char **file_name_array);
4462 * @fn int bluetooth_opc_cancel_push(void)
4463 * @brief Cancels the ongoing file push.
4465 * This function is a asynchronous call.
4466 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4467 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4469 * @return BLUETOOTH_ERROR_NONE - Success \n
4470 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4471 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4476 * @see bluetooth_opc_push_files
4479 int bluetooth_opc_cancel_push(void);
4482 * @fn gboolean bluetooth_opc_session_is_exist(void)
4483 * @brief Informs whether opc session exists or not.
4485 * This function is a synchronous call.
4487 * @return TRUE - OPC session exists \n
4488 * FALSE - OPC session does not exist \n
4496 gboolean bluetooth_opc_session_is_exist(void);
4499 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4500 * @brief Informs whether opc session exists or not.
4502 * This function is a synchronous call.
4504 * @return BLUETOOTH_ERROR_NONE - Success \n
4505 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4506 * BLUETOOTH_ERROR_INTERNAL \n
4509 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4514 int bluetooth_opc_is_sending(gboolean *is_sending);
4517 * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4518 int transfer_id, unsigned char *progress)
4519 * @brief Gets the percentage progress for ongoing transfers.
4521 * This function is a synchronous call.
4523 * @return BLUETOOTH_ERROR_NONE - Success \n
4524 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4525 * BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4528 * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending)
4529 * @param[in] transfer_id Transfer ID
4530 * @param[out] progress Percentage Progress
4534 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4535 int transfer_id, unsigned char *progress);
4538 * @fn int bluetooth_obex_server_init(const char *dst_path)
4539 * @brief Initialize OPP and FTP server.
4541 * This function is a synchronous call.
4542 * No event corresponding to this api
4544 * @return BLUETOOTH_ERROR_NONE - Success \n
4545 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4546 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4547 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4548 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4551 * @param[in] dst_path OPS destination file path.
4553 * @see bluetooth_obex_server_deinit
4555 int bluetooth_obex_server_init(const char *dst_path);
4559 * @fn int bluetooth_obex_server_deinit(void)
4560 * @brief Deinitialize OPP and FTP server.
4562 * This function is a synchronous call.
4563 * No event corresponding to this api
4565 * @return BLUETOOTH_ERROR_NONE - Success \n
4566 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4567 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4572 * @see bluetooth_obex_server_init
4574 int bluetooth_obex_server_deinit(void);
4578 * @fn gboolean bluetooth_obex_server_is_activated(void)
4579 * @brief Informs whether obex server is activated or not.
4581 * This function is a synchronous call.
4583 * @return TRUE - OBEX server is activated \n
4584 * FALSE - OBEX server is not activated \n
4591 gboolean bluetooth_obex_server_is_activated(void);
4595 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4596 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4598 * This function is a synchronous call.
4599 * No event corresponding to this api
4601 * @return BLUETOOTH_ERROR_NONE - Success \n
4602 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4603 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4604 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4605 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4609 * @param[in] dst_path OPS destination file path.
4611 * @see bluetooth_obex_server_deinit_without_agent
4613 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4617 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4618 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4620 * This function is a synchronous call.
4621 * No event corresponding to this api
4623 * @return BLUETOOTH_ERROR_NONE - Success \n
4624 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4625 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4630 * @see bluetooth_obex_server_init_without_agent
4632 int bluetooth_obex_server_deinit_without_agent(void);
4636 * @fn int bluetooth_obex_server_accept_connection(void)
4637 * @brief Accepts the authorization request indicated by the event
4638 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4640 * This function is a synchronous call.
4642 * @return BLUETOOTH_ERROR_NONE - Success \n
4643 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4644 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4648 * @see bluetooth_obex_server_reject_authorize
4650 int bluetooth_obex_server_accept_connection(void);
4654 * @fn int bluetooth_obex_server_reject_connection(void)
4655 * @brief Rejects the authorization request indicated by the event
4656 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4658 * This function is a synchronous call.
4660 * @return BLUETOOTH_ERROR_NONE - Success \n
4661 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4662 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4666 * @see bluetooth_obex_server_reject_authorize
4668 int bluetooth_obex_server_reject_connection(void);
4672 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4673 * @brief Accepts the authorization request indicated by the event
4674 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4676 * This function is a asynchronous call.
4677 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4679 * @return BLUETOOTH_ERROR_NONE - Success \n
4680 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4681 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4682 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4685 * @param[in] filename Authorized filename.
4688 * @see bluetooth_obex_server_reject_authorize
4691 int bluetooth_obex_server_accept_authorize(const char *filename);
4694 * @fn int bluetooth_obex_server_reject_authorize(void)
4695 * @brief Reject the authorization request indicated by the event
4696 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4698 * This function is a asynchronous call.
4699 * No event for this api..
4701 * @return BLUETOOTH_ERROR_NONE - Success \n
4702 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4703 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4708 * @see bluetooth_obex_server_accept_authorize
4711 int bluetooth_obex_server_reject_authorize(void);
4714 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4715 * @brief Set the OPS destination file path..
4717 * This function is a asynchronous call.
4718 * No event for this api..
4720 * @return BLUETOOTH_ERROR_NONE - Success \n
4721 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4722 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4723 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4726 * @param[in] dst_path OPS destination file path.
4732 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4735 * @fn int bluetooth_obex_server_set_root(const char *root)
4736 * @brief Set the FTS root folder..
4738 * This function is a asynchronous call.
4739 * No event for this api..
4741 * @return BLUETOOTH_ERROR_NONE - Success \n
4742 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4743 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4744 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4745 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4746 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4749 * @param[in] root FTS root folder.
4755 int bluetooth_obex_server_set_root(const char *root);
4758 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4759 * @brief Cancel the transfer on server
4761 * This function is an asynchronous call.
4762 * If the function call that cancels transfer is successful, the application would receive
4763 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4764 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4765 * the error code will be BLUETOOTH_ERROR_NONE
4767 * @return BLUETOOTH_ERROR_NONE - Success \n
4768 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4769 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4770 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4771 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4774 * @param[in] transfer_id transfer ID
4779 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4783 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4784 * @brief Cancel the transfer on server
4786 * This function is an asynchronous call.
4787 * If the function call that cancels transfer is successful, the application would receive
4788 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4789 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4790 * the error code will be BLUETOOTH_ERROR_NONE
4792 * @return BLUETOOTH_ERROR_NONE - Success \n
4793 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4794 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4795 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4796 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4803 int bluetooth_obex_server_cancel_all_transfers(void);
4807 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4808 * @brief Informs whether obex server is receiving or not.
4810 * This function is a synchronous call.
4812 * @return BLUETOOTH_ERROR_NONE - Success \n
4813 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4814 * BLUETOOTH_ERROR_INTERNAL \n
4817 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4822 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4826 * @fn int bluetooth_map_client_init(void)
4827 * @brief Initialize MAP client.
4829 * This function is a synchronous call.
4830 * No event corresponding to this api
4832 * @return BLUETOOTH_ERROR_NONE - Success \n
4833 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4834 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4835 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4836 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4841 * @see bluetooth_map_client_deinit
4843 int bluetooth_map_client_init(void);
4845 int bluetooth_map_client_deinit(void);
4847 int bluetooth_map_client_create_session(
4848 bt_map_client_session_info_s *session
4851 int bluetooth_map_client_destroy_session(
4852 bt_map_client_session_info_s *session
4855 int bluetooth_map_client_set_folder(
4856 bt_map_client_session_info_s *session,
4860 int bluetooth_map_client_list_folders(
4861 bt_map_client_session_info_s *session,
4865 int bluetooth_map_client_list_filter_fields(
4866 bt_map_client_session_info_s *session
4869 int bluetooth_map_client_list_messages(
4870 bt_map_client_session_info_s *session,
4875 int bluetooth_map_client_update_inbox(
4876 bt_map_client_session_info_s *session
4879 int bluetooth_map_client_push_message(
4880 bt_map_client_session_info_s *session,
4881 const char *source_file,
4886 int bluetooth_map_client_get_message(
4887 bt_map_client_session_info_s *session,
4888 const char *message_object_name,
4889 const char *target_file,
4895 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4896 * @brief Read the local Hash and Randmizer.
4898 * This function is a synchronous call.
4900 * @return BLUETOOTH_ERROR_NONE - Success \n
4901 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4905 * @param[out] local_oob_data - Pointer to the local OOB data
4911 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4915 * @fn int bluetooth_oob_add_remote_data(
4916 * const bluetooth_device_address_t *remote_device_address,
4917 * bt_oob_data_t *oob_data)
4918 * @brief Add/updated the remote device Hash and Randmizer.
4920 * This function is a synchronous call.
4921 * No event for this api..
4923 * @return BLUETOOTH_ERROR_NONE - Success \n
4924 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4927 * @param[in] remote_device_address - Remote device address
4928 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4934 int bluetooth_oob_add_remote_data(
4935 const bluetooth_device_address_t *remote_device_address,
4936 bt_oob_data_t *remote_oob_data);
4940 * @fn int bluetooth_oob_remove_remote_data(
4941 * const bluetooth_device_address_t *remote_device_address)
4942 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4944 * This function is a synchronous call.
4945 * No event for this api..
4947 * @return BLUETOOTH_ERROR_NONE - Success \n
4948 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4951 * @param[in] remote_device_address - Remote device address
4957 int bluetooth_oob_remove_remote_data(
4958 const bluetooth_device_address_t *remote_device_address);
4961 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4962 * bt_gatt_handle_info_t *prim_svc);
4964 * @brief Gets the GATT based primary services handle supported by remote device
4966 * This function is a synchronous call.
4967 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4969 * @return BLUETOOTH_ERROR_NONE - Success \n
4970 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4971 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4972 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4975 * @param[in] address - Remote device address
4976 * @param[out] prim_svc - Structure containing remote service count and handle list.
4979 * @see bluetooth_gatt_free_primary_services()
4981 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4982 bt_gatt_handle_info_t *prim_svc);
4985 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4987 * @brief Discovers the characteristics of GATT based service of remote device
4989 * This function is an asynchronous call.
4990 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4992 * @return BLUETOOTH_ERROR_NONE - Success \n
4993 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4994 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4995 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4998 * @param[in] service_handle - Handle for remote service.
5003 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5005 int bluetooth_gatt_set_service_change_watcher(
5006 const bluetooth_device_address_t *address, gboolean enable);
5009 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5010 * bt_gatt_service_property_t *service);
5012 * @brief Gets the properties of GATT based service of remote device
5014 * This function is a synchronous call.
5015 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5017 * @return BLUETOOTH_ERROR_NONE - Success \n
5018 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5019 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5020 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5023 * @param[in] service_handle - Handle for remote service.
5024 * @param[out] service - Structure containing remote service property.
5027 * @see bluetooth_gatt_free_service_property()
5029 int bluetooth_gatt_get_service_property(const char *service_handle,
5030 bt_gatt_service_property_t *service);
5033 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5035 * @brief Register to GATT based service to receive value change notification/indication.
5037 * This function is a synchronous call.
5038 * No event for this api.
5040 * @return BLUETOOTH_ERROR_NONE - Success \n
5041 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5042 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5043 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5046 * @param[in] service_handle - Handle for remote service.
5051 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5054 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5056 * @brief Unregister GATT based service to receive value change notification/indication.
5058 * This function is a synchronous call.
5059 * No event for this api.
5061 * @return BLUETOOTH_ERROR_NONE - Success \n
5062 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5063 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5064 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5067 * @param[in] service_handle - Handle for remote service.
5072 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5075 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5076 * bt_gatt_char_property_t *characteristic);
5078 * @brief Provides characteristic value along with properties.
5080 * This function is a synchronous call.
5081 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5083 * @return BLUETOOTH_ERROR_NONE - Success \n
5084 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5085 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5086 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5089 * @param[in] char_handle - Handle for Characteristic property.
5090 * @param[out] characteristic - Structure containing remote characteristic property.
5093 * @see bluetooth_gatt_free_char_property()
5095 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5096 bt_gatt_char_property_t *characteristic);
5099 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5100 * bt_gatt_char_property_t *characteristic);
5102 * @brief Provides characteristic descriptor value along with its UUID.
5104 * This function is a synchronous call.
5105 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5107 * @return BLUETOOTH_ERROR_NONE - Success \n
5108 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5109 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5110 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5113 * @param[in] desc_handle - Handle for Characteristic descriptor.
5114 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5117 * @see bluetooth_gatt_free_desc_property()
5119 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5120 bt_gatt_char_descriptor_property_t *descriptor);
5124 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5125 * const guint8 *value, int length)
5127 * @brief Set characteristic value.
5129 * This function is a synchronous call.
5131 * @return BLUETOOTH_ERROR_NONE - Success \n
5132 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5133 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5134 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5137 * @param[in] char_handle - Handle for Characteristic property.
5138 * @param[in] value - New value to set for characteristic property.
5139 * @param[in] length - Length of the value to be set.
5144 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5145 const guint8 *value, int length);
5148 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5149 * const guint8 *value, int length, guint8 write_type)
5151 * @brief Set characteristic value by write type.
5153 * This function is a synchronous call if write type is "write without resonse"
5154 * and it is an asynchronous call if write type is "write with response"
5156 * @return BLUETOOTH_ERROR_NONE - Success \n
5157 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5158 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5159 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5162 * @param[in] char_handle - Handle for Characteristic property.
5163 * @param[in] value - New value to set for characteristic property.
5164 * @param[in] length - Length of the value to be set.
5165 * @param[in] write_type - Type of write.
5170 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5171 const guint8 *value, int length, guint8 write_type);
5175 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5176 * const guint8 *value, int length)
5178 * @brief Set characteristic value request.
5180 * This function is an asynchronous call.
5182 * @return BLUETOOTH_ERROR_NONE - Success \n
5183 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5184 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5185 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5188 * @param[in] char_handle - Handle for Characteristic property.
5189 * @param[in] value - New value to set for characteristic property.
5190 * @param[in] length - Length of the value to be set.
5195 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5196 const guint8 *value, int length);
5199 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5201 * @brief Read characteristic value.
5203 * This function is a asynchronous call.
5205 * @return BLUETOOTH_ERROR_NONE - Success \n
5206 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5207 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5208 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5211 * @param[in] char_handle - Handle for Characteristic property.
5216 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5219 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5220 * const char *service_uuid,
5221 * bt_gatt_service_property_t *service)
5223 * @brief Gets the service property from a device based on a particular uuid
5225 * This function is a synchronous call.
5227 * @return BLUETOOTH_ERROR_NONE - Success \n
5228 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5229 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5230 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5233 * @param[in] address - BD address of the remote device
5234 * @param[in] service_uuid - uuid of the service.
5235 * @param[out] service - Structure containing the service property.
5240 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5241 const char *service_uuid,
5242 bt_gatt_service_property_t *service);
5245 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5246 * const char *char_uuid)
5248 * @brief Gets the characteristic property from a service based on a particular char uuid
5250 * This function is an asynchronous call.
5251 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5253 * @return BLUETOOTH_ERROR_NONE - Success \n
5254 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5255 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5256 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5259 * @param[in] service_handle - Service handle.
5260 * @param[in] uuid - Characteristic uuid.
5265 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5266 const char *char_uuid);
5269 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5271 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5273 * This function is a synchronous call.
5274 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5276 * @return BLUETOOTH_ERROR_NONE - Success \n
5277 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5280 * @param[in] prim_svc - GATT handle info structure
5283 * @see bluetooth_gatt_get_primary_services()
5285 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5288 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5290 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
5292 * This function is a synchronous call.
5293 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5295 * @return BLUETOOTH_ERROR_NONE - Success \n
5296 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5299 * @param[in] svc_pty - GATT service property structure.
5302 * @see bluetooth_gatt_get_service_property()
5304 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5307 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5309 * @brief Provides characteristic value along with properties.
5311 * This function is a synchronous call.
5312 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5314 * @return BLUETOOTH_ERROR_NONE - Success \n
5315 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5318 * @param[in] char_pty - GATT characteristics property structure.
5321 * @see bluetooth_gatt_get_characteristics_property()
5323 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5326 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5328 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5330 * This function is a synchronous call.
5331 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5333 * @return BLUETOOTH_ERROR_NONE - Success \n
5334 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5337 * @param[in] desc_pty - GATT characteristics descriptor property structure.
5340 * @see bluetooth_gatt_get_char_descriptor_property()
5342 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5344 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5346 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5349 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5351 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5353 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5355 * @return BLUETOOTH_ERROR_NONE - Success \n
5356 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5359 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5363 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5366 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5368 * @brief Read characteristic descriptor value.
5370 * This function is a asynchronous call.
5372 * @return BLUETOOTH_ERROR_NONE - Success \n
5373 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5374 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5375 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5378 * @param[in] desc_handle - Handle for Characteristic descriptor
5383 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5386 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5387 * const guint8 *value, int length);
5389 * @brief Set characteristic descriptor value.
5391 * This function is a asynchronous call.
5393 * @return BLUETOOTH_ERROR_NONE - Success \n
5394 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5395 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5396 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5399 * @param[in] desc_handle - Handle for Characteristic descriptor
5400 * @param[in] value - New value to set for characteristic descriptor
5401 * @param[in] length - Length of the value to be set.
5406 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5407 const guint8 *value, int length);
5409 /* @fn int bluetooth_gatt_init(void)
5411 * @brief Initializes the gatt service.
5413 * This function is a synchronous call.
5414 * @return BLUETOOTH_ERROR_NONE - Success \n
5415 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5416 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5417 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5420 * @remark Adapter should be enabled
5421 * @see bluetooth_gatt_deinit()
5423 int bluetooth_gatt_init(void);
5425 /* @fn int bluetooth_gatt_init(void)
5427 * @brief DeInitializes the gatt service.
5429 * This function is a synchronous call.
5430 * @return BLUETOOTH_ERROR_NONE - Success \n
5431 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5432 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5433 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5436 * @remark Adapter should be enabled
5437 * @see bluetooth_gatt_init()
5439 int bluetooth_gatt_deinit(void);
5441 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5442 unsigned char **svc_path)
5444 * @brief Exports a new gatt service to the service interface.
5446 * This function is a synchronous call.
5448 * @return BLUETOOTH_ERROR_NONE - Success \n
5449 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5450 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5451 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5454 * @param[in] svc_uuid Gatt service uuid.
5455 * @param[out] svc_path service object path of the exported service.
5456 * @remark Adapter should be enabled
5457 * @see bluetooth_gatt_init()
5459 int bluetooth_gatt_add_service(const char *svc_uuid,
5462 /* @fn int bluetooth_gatt_add_new_characteristic(
5463 const char *svc_path, const char *char_uuid,
5464 bt_gatt_permission_t permissions,
5465 bt_gatt_characteristic_property_t properties,
5466 int flags_length, char **char_path);;
5468 * @brief Exports a new gatt characteristic to the characteristic interface.
5470 * This function is a synchronous call.
5471 * @return BLUETOOTH_ERROR_NONE - Success \n
5472 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5473 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5474 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5476 * @param[in] svc_path service object path of the exported service.
5477 * @param[in] char_uuid Gatt service uuid.
5478 * @param[in] properties GATT characteristic properties.
5479 * @param[out] char_path characteristic object path of the exported characteristic.
5481 * @remark Adapter should be enabled
5482 * @see bluetooth_gatt_add_service()
5484 int bluetooth_gatt_add_new_characteristic(
5485 const char *svc_path, const char *char_uuid,
5486 bt_gatt_permission_t permissions,
5487 bt_gatt_characteristic_property_t properties,
5490 /* @fn bluetooth_gatt_set_characteristic_value(
5491 const char *characteristic, const char *char_value,
5494 * @brief adds gatt charactertisic value to the given charactertistic path.
5496 * This function is a synchronous call.
5497 * @return BLUETOOTH_ERROR_NONE - Success \n
5498 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5499 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5500 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5502 * @param[in] char_value Value of the GATT characteristic to be added.
5503 * @param[in] value_length length of the chantacteristic value..
5504 * @param[out] characteristic characteristic object path..
5506 * @remark Adapter should be enabled
5507 * @see bluetooth_gatt_add_service()
5509 int bluetooth_gatt_set_characteristic_value(
5510 const char *characteristic, const char *char_value,
5513 /* @fn int bluetooth_gatt_add_descriptor(
5514 const char *char_path, const char *desc_uuid,
5515 bt_gatt_permission_t permissions,
5518 * @brief Exports a new gatt descriptor to the descriptor interface.
5520 * This function is a synchronous call.
5522 * @return BLUETOOTH_ERROR_NONE - Success \n
5523 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5524 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5525 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5528 * @param[in] desc_uuid Gatt descriptor uuid.
5529 * @param[in] desc_value GATT descriptor value.
5530 * @param[in] value_length Length of GATT descriptor value.
5531 * @param[in] permissions descriptor permissions.
5532 * @param[in] properties GATT descriptor properties.
5533 * @param[in] char_path characteristics object path of the exported character.
5535 * @remark Adapter should be enabled
5536 * @see bluetooth_gatt_add_service()
5537 * @see bluetooth_gatt_add_characteristics()
5539 int bluetooth_gatt_add_descriptor(
5540 const char *char_path, const char *desc_uuid,
5541 bt_gatt_permission_t permissions,
5544 /* @fn int bluetooth_gatt_set_descriptor_value(
5545 const char *desc_path, const char *desc_value,
5548 * @brief Adds value to the given descriptor handle.
5550 * This function is a synchronous call.
5552 * @return BLUETOOTH_ERROR_NONE - Success \n
5553 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5554 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5555 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5558 * @param[in] desc_value GATT descriptor value.
5559 * @param[in] value_length Length of GATT descriptor value.
5560 * @param[in] desc_path descriptor path to which the value needs to be added.
5562 * @remark Adapter should be enabled
5563 * @see bluetooth_gatt_add_service()
5564 * @see bluetooth_gatt_add_characteristics()
5566 int bluetooth_gatt_set_descriptor_value(
5567 const char *desc_path, const char *desc_value,
5570 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5572 * @brief Reads the Service registered on manager interface.
5574 * This function is a synchronous call.
5576 * @return BLUETOOTH_ERROR_NONE - Success \n
5577 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5578 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5579 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5582 * @param[in] svc_uuid Gatt Service uuid.
5584 * @remark Adapter should be enabled and service should be registered.
5585 * @see bluetooth_gatt_register_service()
5587 int bluetooth_gatt_get_service(const char *svc_uuid);
5589 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5591 * @brief Registers the given service path with the library.
5593 * This function is a synchronous call.
5595 * @return BLUETOOTH_ERROR_NONE - Success \n
5596 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5597 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5598 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5601 * @param[in] svc_path service object path of the exported service.
5603 * @remark Adapter should be enabled
5604 * @see bluetooth_gatt_add_service()
5605 * @see bluetooth_gatt_add_characteristics()
5606 * @see bluetooth_gatt_add_descriptor()
5607 * @see bluetooth_gatt_register_application()
5609 int bluetooth_gatt_register_service(const char *svc_path);
5611 /* @fn int bluetooth_gatt_register_application(void)
5613 * @brief Registers the application with the bluez gatt server.
5615 * This function is a synchronous call.
5617 * @return BLUETOOTH_ERROR_NONE - Success \n
5618 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5619 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5620 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5624 * @remark Adapter should be enabled
5625 * @see bluetooth_gatt_init()
5626 * @see bluetooth_gatt_add_service()
5627 * @see bluetooth_gatt_add_characteristics()
5628 * @see bluetooth_gatt_add_descriptor()
5629 * @see bluetooth_gatt_register_service()
5631 int bluetooth_gatt_register_application(void);
5633 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5635 * @brief Removes(unregister) service from the bluez gatt server db.
5637 * This function is a synchronous call.
5639 * @return BLUETOOTH_ERROR_NONE - Success \n
5640 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5641 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5642 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5645 * @param[in] svc_path service object path of the exported service.
5647 * @remark Adapter should be enabled
5648 * @see bluetooth_gatt_add_service()
5649 * @see bluetooth_gatt_add_characteristics()
5650 * @see bluetooth_gatt_add_descriptor()
5651 * @see bluetooth_gatt_register_service()
5653 int bluetooth_gatt_unregister_service(const char *svc_path);
5655 /* @fn int bluetooth_gatt_unregister_application(void)
5657 * @brief Removes(unregister) the application with the bluez gatt server,
5658 * and deletes all the service registered.
5660 * This function is a synchronous call.
5662 * @return BLUETOOTH_ERROR_NONE - Success \n
5663 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5664 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5665 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5669 * @remark Adapter should be enabled
5670 * @see bluetooth_gatt_init()
5671 * @see bluetooth_gatt_add_service()
5672 * @see bluetooth_gatt_add_characteristics()
5673 * @see bluetooth_gatt_add_descriptor()
5674 * @see bluetooth_gatt_register_service()
5675 * @see bluetooth_gatt_unregister_service()
5677 int bluetooth_gatt_unregister_application(void);
5679 /* @fn int bluetooth_gatt_send_response(int request_id,
5680 * int offset, char *value, int value_length)
5682 * @brief Updates the attribute value in local attribute list.
5684 * This function is a synchronous call.
5686 * @return BLUETOOTH_ERROR_NONE - Success \n
5687 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5688 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5689 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5692 * @param[in] request_id The identification of a read request
5693 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5694 * @param[in] resp_state The identification of response state
5695 * @param[in] offset The offset from where a value is read
5696 * @param[in] value The value to be sent. It will be sent from @a offset.
5697 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5698 * @param[in] value_length Value Length.
5700 * @remark Adapter should be enabled
5701 * @see bluetooth_gatt_add_service()
5702 * @see bluetooth_gatt_add_characteristics()
5703 * @see bluetooth_gatt_add_descriptor()
5704 * @see bluetooth_gatt_register_service()
5706 int bluetooth_gatt_send_response(int request_id, guint req_type,
5707 int resp_state, int offset, char *value, int value_length);
5709 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5711 * @brief Sets the notification property for a characteristic.
5713 * This function is a synchronous call.
5715 * @return BLUETOOTH_ERROR_NONE - Success \n
5716 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5717 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5718 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5721 * @param[in] char_path characteristic object path.
5722 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5724 * @remark Adapter should be enabled
5725 * @see bluetooth_gatt_update_characteristic()
5727 int bluetooth_gatt_server_set_notification(const char *char_path,
5728 bluetooth_device_address_t *unicast_address);
5730 /* @fn int bluetooth_gatt_delete_services(void)
5732 * @brief deletes (unregisters) all services from the gatt server database..
5734 * This function is a synchronous call.
5736 * @return BLUETOOTH_ERROR_NONE - Success \n
5737 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5738 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5739 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5743 * @remark Adapter should be enabled
5744 * @see bluetooth_gatt_add_service()
5745 * @see bluetooth_gatt_add_characteristics()
5746 * @see bluetooth_gatt_add_descriptor()
5747 * @see bluetooth_gatt_register_service()
5748 * @see bluetooth_gatt_unregister_service()
5750 int bluetooth_gatt_delete_services(void);
5752 /* @fn int bluetooth_gatt_update_characteristic(void)
5754 * @brief updates the given characteristic with a new value
5756 * This function is a synchronous call.
5758 * @return BLUETOOTH_ERROR_NONE - Success \n
5759 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5760 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5761 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5765 * @remark Adapter should be enabled
5766 * @see bluetooth_gatt_add_service()
5767 * @see bluetooth_gatt_add_characteristics()
5768 * @see bluetooth_gatt_add_descriptor()
5769 * @see bluetooth_gatt_register_service()
5770 * @see bluetooth_gatt_unregister_service()
5772 int bluetooth_gatt_update_characteristic(const char *char_path,
5773 const char* char_value, int value_length);
5776 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5778 * @brief Set advertising status.
5780 * This function is used to enable or disable LE advertising.
5781 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5783 * This function is a synchronous call.
5785 * @return BLUETOOTH_ERROR_NONE - Success \n
5786 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5787 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5790 * @param[in] enable - The status of advertising
5793 * @see bluetooth_set_advertising_data
5795 int bluetooth_set_advertising(int handle, gboolean enable);
5798 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5800 * @brief Set advertising status along with interval value.
5802 * This function is used to enable or disable LE advertising.
5803 * Interval_min and Interval_max is used to set the best advertising interval.
5804 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
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_INTERNAL - Internal IPC error \n
5813 * @param[in] enable - The status of advertising
5814 * @param[in] interval_min - Minimum interval of advertising (msec)
5815 * @param[in] interval_max - Maximum interval of advertising (msec)
5816 * @param[in] filter_policy - Advertising filter policy
5819 * @see bluetooth_set_advertising_data
5821 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5822 bluetooth_advertising_params_t *params);
5825 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5826 * @brief Get the advertising data
5828 * This function is used to get advertising data.
5829 * Before calling this API, the adapter should be enabled.
5831 * This function is a synchronous call.
5833 * @return BLUETOOTH_ERROR_NONE - Success \n
5834 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5835 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5836 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5838 * @param[out] value - Advertising data structure.
5839 * @param[out] length - The length of Advertising data.
5843 bluetooth_advertising_data_t *value = { {0} };
5846 ret = bluetooth_get_advertising_data(&value, &length);
5849 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5852 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5854 * @brief Set advertising data with value
5856 * This function is used to set advertising data and Maximum size of advertising data
5857 * is 28 byte (Except Flag)
5859 * This function is a synchronous call.
5861 * @return BLUETOOTH_ERROR_NONE - Success \n
5862 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5863 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5866 * @param[in] value - Advertising data structure.
5870 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5873 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5875 * @brief Check the privilege for advertising parameter setting
5877 * This function is a synchronous call.
5879 * @return BLUETOOTH_ERROR_NONE - Success \n
5880 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5886 int bluetooth_check_privilege_advertising_parameter(void);
5889 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5890 * @brief Get the LE scan response data
5892 * This function is used to get scan response data.
5893 * Before calling this API, the adapter should be enabled.
5895 * This function is a synchronous call.
5897 * @return BLUETOOTH_ERROR_NONE - Success \n
5898 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5899 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5900 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5902 * @param[out] value - Scan response data structure.
5903 * @param[out] length - The length of Scan response data.
5907 bluetooth_scan_resp_data_t *value = { {0} };
5910 ret = bluetooth_get_scan_response_data(&value, &length);
5913 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5916 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5918 * @brief Set scan response data with value
5920 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5922 * This function is a synchronous call.
5924 * @return BLUETOOTH_ERROR_NONE - Success \n
5925 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5926 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5929 * @param[in] value - LE Scan response data structure.
5933 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5936 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5938 * @brief Set scan interval and window
5940 * This function is used to set LE scan interval and window size
5942 * This function is a synchronous call.
5944 * @return BLUETOOTH_ERROR_NONE - Success \n
5945 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5946 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5949 * @param[in] interval - Interval of LE scan (msec)
5950 * @param[in] window - Window size of LE scan (msec)
5954 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5957 * @fn int bluetooth_is_advertising(void)
5958 * @brief Check for the advertising is in-progress or not.
5960 * This API is used to check the current status of the advertising procedure.
5961 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5964 * This function checks whether the advertising is started or not.
5966 * This function is a synchronous call.
5968 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5970 * @return BLUETOOTH_ERROR_NONE - Success \n
5971 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5974 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5978 gboolean is_advertising = 0;
5980 ret = bluetooth_is_advertising(&is_advertising);
5983 int bluetooth_is_advertising(gboolean *is_advertising);
5986 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5987 * @brief Add LE device to white list
5989 * This API is used to add LE device to white list
5990 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5994 * This function is a synchronous call.
5996 * @param[in] address The address of remote device
5998 * @return BLUETOOTH_ERROR_NONE - Success \n
5999 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6002 * @see bluetooth_set_custom_advertising
6004 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6007 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6008 * @brief Remove LE device from white list
6010 * This API is used to remove LE device from white list
6011 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6015 * This function is a synchronous call.
6017 * @param[in] address The address of remote device
6019 * @return BLUETOOTH_ERROR_NONE - Success \n
6020 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6023 * @see bluetooth_set_custom_advertising
6025 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6028 * @fn int bluetooth_clear_white_list(void)
6029 * @brief Clear white list
6031 * This API is used to clear white list
6032 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6036 * This function is a synchronous call.
6038 * @param[in] address The address of remote device
6040 * @return BLUETOOTH_ERROR_NONE - Success \n
6041 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6044 * @see bluetooth_set_custom_advertising
6046 int bluetooth_clear_white_list(void);
6049 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6050 * const bluetooth_le_connection_param_t *parameters)
6051 * @brief update connection paramter of LE connection.
6053 * This function is a synchronous call.
6055 * @return BLUETOOTH_ERROR_NONE - Success \n
6056 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6059 * @param[in] address - remote device address value.
6060 * @param[in] parameters - new connection parameters.
6063 * @see bluetooth_bond_device
6065 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6066 const bluetooth_le_connection_param_t *parameters);
6069 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6071 * @brief Enable/Disable LE Privacy feature.
6073 * This function is used to enable or disable LE Privacy feature.
6074 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6076 * This function is a synchronous call.
6078 * @return BLUETOOTH_ERROR_NONE - Success \n
6079 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6080 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6083 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6087 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6090 * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6092 * @brief Enable/Disable LE static random address.
6094 * This function is used to enable or disable LE static random address.
6096 * This function is a synchronous call.
6098 * @return BLUETOOTH_ERROR_NONE - Success \n
6099 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6100 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6103 * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False].
6107 int bluetooth_set_le_static_random_address(gboolean enable);
6110 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6111 * bluetooth_le_connection_mode_t mode)
6112 * @brief update connection paramter of LE connection.
6114 * This function is a synchronous call.
6116 * @return BLUETOOTH_ERROR_NONE - Success \n
6117 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6118 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6121 * @param[in] address - remote device address value.
6122 * @param[in] mode - new connection mode.
6126 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6127 bluetooth_le_connection_mode_t mode);
6130 * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6131 * @brief Request for new ATT MTU value.
6133 * This function is a asynchronous call.
6135 * @return BLUETOOTH_ERROR_NONE - Success \n
6136 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6137 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6140 * @param[in] address - remote device address value.
6141 * @param[in] mtu - MTU value to be set.
6145 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6148 * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6149 * unsigned int *mtu)
6150 * @brief Gets the xisting MTU value set for a connection.
6152 * This function is a synchronous call.
6154 * @return BLUETOOTH_ERROR_NONE - Success \n
6155 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6156 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6159 * @param[in] address - remote device address value.
6160 * @param[out] mtu - MTU value set for the connection.
6164 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6168 * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6169 * bluetooth_device_address_t *id_address)
6170 * @brief Gets the Identity address of remote device.
6172 * This function is a synchronous call.
6174 * @return BLUETOOTH_ERROR_NONE - Success \n
6175 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6176 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6179 * @param[in] device_rpa - remote Resolvable private address.
6180 * @param[out] id_address - remote Identity device address value.
6184 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6185 bluetooth_device_address_t *id_address);
6188 * @fn int bluetooth_le_read_maximum_data_length()
6189 * @brief reads the maximum LE data length supported in the controller.
6191 * This function is a synchronous call.
6193 * @return BLUETOOTH_ERROR_NONE - Success \n
6194 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6200 int bluetooth_le_read_maximum_data_length(
6201 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6203 * @fn int bluetooth_le_write_host_suggested_default_data_length()
6204 * @brief writes the host suggested values for the controllers max transmitted no of payload
6205 * octects to be used for new connections.
6207 * This function is a synchronous call.
6209 * @return BLUETOOTH_ERROR_NONE - Success \n
6210 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6216 int bluetooth_le_write_host_suggested_default_data_length(
6217 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6219 int bluetooth_le_read_suggested_default_data_length(
6220 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6222 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6223 const unsigned int max_tx_octets, const unsigned int max_tx_time);
6225 int bluetooth_pbap_init(void);
6226 int bluetooth_pbap_deinit(void);
6227 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6228 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6229 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6230 bt_pbap_folder_t *folder);
6231 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6232 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6233 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6234 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6235 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6236 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6237 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6238 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6241 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6243 * @brief Set manufacturer data with value
6245 * This function is used to set manufacturer data.
6247 * This function is a synchronous call.
6249 * @return BLUETOOTH_ERROR_NONE - Success \n
6250 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6251 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6254 * @param[in] value - Manufacturer data structure.
6258 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6260 int bluetooth_set_passkey_notification(gboolean enable);
6263 * @fn int bluetooth_dpm_is_mode_allowed(void);
6265 * @brief Checks Restriction for BT mode(BT allowed or not)
6267 * This function is a synchronous call.
6269 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6270 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6271 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6278 int bluetooth_dpm_is_mode_allowed(void);
6281 * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6283 * @brief Sets Restriction for BT mode(BT allowed or not)
6285 * This function is a synchronous call.
6287 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6288 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6289 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6292 * @param[in] value - BT Allow value.
6293 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6294 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6295 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6296 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6300 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6303 * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6305 * @brief Reads the Restriction for BT mode(BT allowed or not)
6307 * This function is a synchronous call.
6309 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6310 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6311 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6315 * @param[out] value - BT Allow value.
6316 * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error
6317 * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed
6318 * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only
6319 * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted
6323 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6326 * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6328 * @brief Sets the Restriction for device.
6330 * This function is a synchronous call.
6332 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6333 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6334 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6337 * @param[in] value - State value.
6338 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6339 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6343 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6346 * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6348 * @brief Reads the Restriction for device.
6350 * This function is a synchronous call.
6352 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6353 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6354 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6358 * @param[out] value - State value.
6359 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6360 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6364 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6367 * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6369 * @brief Sets the Restriction for uuid.
6371 * This function is a synchronous call.
6373 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6374 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6375 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6378 * @param[in] value - State value.
6379 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6380 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6384 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6387 * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6389 * @brief Reads the Restriction for uuid.
6391 * This function is a synchronous call.
6393 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6394 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6395 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6399 * @param[out] value - State value.
6400 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6401 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6405 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6408 * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6410 * @brief Adds the device to blacklist.
6412 * This function is a synchronous call.
6414 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6415 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6416 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6419 * @param[in] device_address - Device address
6423 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6426 * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6428 * @brief Adds the device to whitelist.
6430 * This function is a synchronous call.
6432 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6433 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6434 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6437 * @param[in] device_address - Device address
6441 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6444 * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6446 * @brief Adds the Service UUIDS to blacklist.
6448 * This function is a synchronous call.
6450 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6451 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6452 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6455 * @param[in] service_uuids - profile or custom service uuids
6459 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6462 * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6464 * @brief Adds the Service UUIDS to whitelist.
6466 * This function is a synchronous call.
6468 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6469 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6470 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6473 * @param[in] service_uuids - profile or custom service uuids
6477 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6480 * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6482 * @brief Clears the devices from blacklist.
6484 * This function is a synchronous call.
6486 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6487 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6488 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6495 int bluetooth_dpm_clear_devices_from_blacklist(void);
6498 * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6500 * @brief Clears the devices from whitelist.
6502 * This function is a synchronous call.
6504 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6505 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6506 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6513 int bluetooth_dpm_clear_devices_from_whitelist(void);
6516 * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6518 * @brief Clears the uuids from blacklist.
6520 * This function is a synchronous call.
6522 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6523 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6524 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6531 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6534 * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6536 * @brief Clears the uuids from whitelist.
6538 * This function is a synchronous call.
6540 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6541 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6542 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6549 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6552 * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6554 * @brief reads the devices from blacklist.
6556 * This function is a synchronous call.
6558 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6559 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6560 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6563 * @param[out] device_list - list of devices
6567 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6570 * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6572 * @brief reads the devices from whitelist.
6574 * This function is a synchronous call.
6576 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6577 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6578 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6581 * @param[out] device_list - list of devices
6585 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6588 * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6590 * @brief reads the uuids from blacklist.
6592 * This function is a synchronous call.
6594 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6595 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6596 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6599 * @param[in] uuid_list - list of uuids
6603 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6606 * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6608 * @brief reads the uuids from whitelist.
6610 * This function is a synchronous call.
6612 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6613 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6614 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6617 * @param[in] uuid_list - list of uuids
6621 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6624 * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6626 * @brief Removes the device from whitelist.
6628 * This function is a synchronous call.
6630 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6631 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6632 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6635 * @param[in] device_address - Device address
6639 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6642 * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6644 * @brief Removes the device from blacklist.
6646 * This function is a synchronous call.
6648 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6649 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6650 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6653 * @param[in] device_address - Device address
6657 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6660 * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6662 * @brief Removes the Service UUIDS from whitelist.
6664 * This function is a synchronous call.
6666 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6667 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6668 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6671 * @param[in] service_uuids - profile or custom service uuids
6675 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6678 * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6680 * @brief Removes the Service UUIDS from blacklist.
6682 * This function is a synchronous call.
6684 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6685 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6686 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6689 * @param[in] service_uuids - profile or custom service uuids
6693 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6696 * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6698 * @brief Sets the Restriction for outgoing call.
6700 * This function is a synchronous call.
6702 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6703 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6704 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6707 * @param[in] value - State value.
6708 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6709 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6713 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6716 * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6718 * @brief Reads the Restriction for outgoing call.
6720 * This function is a synchronous call.
6722 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6723 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6724 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6728 * @param[out] value - State value.
6729 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6730 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6734 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6737 * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6739 * @brief Sets the Restriction for Pairing.
6741 * This function is a synchronous call.
6743 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6744 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6745 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6748 * @param[in] value - State value.
6749 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6750 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6754 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6757 * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6759 * @brief Reads the Restriction for Pairing
6761 * This function is a synchronous call.
6763 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6764 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6765 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6769 * @param[out] value - State value.
6770 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6771 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6775 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6778 * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6780 * @brief Sets the Restriction for using Profiles.
6782 * This function is a synchronous call.
6784 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6785 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6786 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6789 * @param[in]profile - Profile.
6790 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6791 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6792 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6793 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6794 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6795 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6796 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6797 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6798 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6799 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6800 * BLUETOOTH_DPM_PROFILE_NONE
6801 * @param[in] value - State value.
6802 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6803 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6807 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6810 * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6812 * @brief Reads the Restriction for using Profiles.
6814 * This function is a synchronous call.
6816 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6817 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6818 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6821 * @param[in]profile - Profile.
6822 * BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6823 * BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6824 * BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6825 * BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6826 * BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6827 * BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6828 * BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6829 * BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6830 * BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6831 * BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6832 * BLUETOOTH_DPM_PROFILE_NONE
6833 * @param[out] value - State value.
6834 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6835 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6839 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6842 * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6844 * @brief Sets the Restriction for Desktop Connectivity.
6846 * This function is a synchronous call.
6848 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6849 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6850 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6853 * @param[in] value - State value.
6854 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6855 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6859 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6862 * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6864 * @brief Reads the Restriction for Desktop Connectivity.
6866 * This function is a synchronous call.
6868 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6869 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6870 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6874 * @param[out] value - State value.
6875 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6876 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6880 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6883 * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6885 * @brief Sets the Restriction for Discoverable state.
6887 * This function is a synchronous call.
6889 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6890 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6891 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6894 * @param[in] value - State value.
6895 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6896 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6900 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6903 * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6905 * @brief Reads the Restriction for Discoverable state.
6907 * This function is a synchronous call.
6909 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6910 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6911 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6915 * @param[out] value - State value.
6916 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6917 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6921 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
6924 * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6926 * @brief Sets the Restriction for linited discoverable state..
6928 * This function is a synchronous call.
6930 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6931 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6932 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6935 * @param[in] value - State value.
6936 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6937 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6941 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
6944 * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6946 * @brief Reads the Restriction for limited discoverable state.
6948 * This function is a synchronous call.
6950 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6951 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6952 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6956 * @param[out] value - State value.
6957 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6958 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6962 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
6964 * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6966 * @brief Sets the Restriction for Data trasnfer.
6968 * This function is a synchronous call.
6970 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6971 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6972 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6975 * @param[in] value - State value.
6976 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6977 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
6981 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
6985 * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
6987 * @brief Reads the Restriction for Data trasnfer.
6989 * This function is a synchronous call.
6991 * @return BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6992 * BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6993 * BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6997 * @param[out] value - State value.
6998 * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed.
6999 * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted.
7003 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7006 * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7007 * bluetooth_pxp_poperty_t property, int value);
7009 * @brief Sets the Proximity alert level/properties for monitor role.
7011 * This function is a synchronous call.
7013 * @return BLUETOOTH_ERROR_NONE - Success \n
7014 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7015 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7016 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7019 * @param[in] device_address remote device address
7020 * @param[in] property proximity profile property
7021 * @param[in] value alert level/property value to be set
7026 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7027 bluetooth_pxp_poperty_t property, int value);
7030 * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7031 * bluetooth_pxp_poperty_t property, int *value);
7033 * @brief Reads the Proximity alert level/properties for monitor role.
7035 * This function is a synchronous call.
7037 * @return BLUETOOTH_ERROR_NONE - Success \n
7038 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7039 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7040 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7043 * @param[in] device_address remote device address
7044 * @param[in] property proximity profile property
7045 * @param[out] value alert level/property value
7049 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7050 bluetooth_pxp_poperty_t property, int *value);
7053 * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7054 * int *services_supported);
7056 * @brief Reads the Proximity Monitor profile supported properties/services.
7058 * This function is a synchronous call.
7060 * @return BLUETOOTH_ERROR_NONE - Success \n
7061 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7062 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7063 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7066 * @param[in] device_address remote device address
7067 * @param[out] services_supported proximity profile property/service
7071 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7072 int *services_supported);
7075 * @fn int bluetooth_proximity_reporter_register();
7077 * @brief Register all proximity related services in BlueZ.
7079 * This function is a synchronous call.
7081 * @return BLUETOOTH_ERROR_NONE - Success \n
7082 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7088 int bluetooth_proximity_reporter_register(void);
7091 * @fn int bluetooth_proximity_reporter_unregister();
7093 * @brief Unregister all proximity related services in BlueZ.
7095 * This function is a synchronous call.
7097 * @return BLUETOOTH_ERROR_NONE - Success \n
7098 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7104 int bluetooth_proximity_reporter_unregister(void);
7107 * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7108 * bluetooth_pxp_poperty_t property, int *value);
7110 * @brief Reads the Proximity alert level/properties for reporter role.
7112 * This function is a synchronous call.
7114 * @return BLUETOOTH_ERROR_NONE - Success \n
7115 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7116 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7117 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7120 * @param[in] device_address remote device address
7121 * @param[in] property proximity profile property
7122 * @param[out] value alert level/property value
7126 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7127 bluetooth_pxp_poperty_t property, int *value);
7135 #endif /* __cplusplus */
7136 #endif /* _BLUETOOTH_API_H_*/