2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef _BLUETOOTH_API_H_
19 #define _BLUETOOTH_API_H_
27 #endif /* __cplusplus */
30 * @defgroup BLUETOOTHFW BluetoothFW
32 * A base library for bluetooth framework
34 * @addtogroup BLUETOOTHFW
38 #define BLUETOOTH_ADDRESS_LENGTH 6 /**< This specifies bluetooth device address length */
39 #define BLUETOOTH_VERSION_LENGTH_MAX 30 /**< This specifies bluetooth device version length */
40 #define BLUETOOTH_INTERFACE_NAME_LENGTH 16
41 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */
42 #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */
43 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */
44 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */
45 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */
47 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services
48 a device can support */
50 #define BLUETOOTH_UUID_STRING_MAX 50
51 #define BLUETOOTH_PATH_STRING 50
53 #define BLUETOOTH_OOB_DATA_LENGTH 16
55 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
58 * This is Bluetooth Connected event role
60 #define RFCOMM_ROLE_SERVER 1
61 #define RFCOMM_ROLE_CLIENT 2
64 * This is RFCOMM default Channel Value
66 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
69 * This is maximum length for search value string for PBAP Phonebook Search
71 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
75 * This is Bluetooth error code
77 #define BLUETOOTH_ERROR_BASE ((int)0) /**< Error code base */
79 #define BLUETOOTH_ERROR_NONE ((int)0) /**< No error #0 */
80 #define BLUETOOTH_ERROR_CANCEL ((int)BLUETOOTH_ERROR_BASE - 0x01)
82 #define BLUETOOTH_ERROR_INVALID_CALLBACK ((int)BLUETOOTH_ERROR_BASE - 0x02)
83 /**< Callback error */
84 #define BLUETOOTH_ERROR_INVALID_PARAM ((int)BLUETOOTH_ERROR_BASE - 0x03)
85 /**< invalid paramerror */
86 #define BLUETOOTH_ERROR_INVALID_DATA ((int)BLUETOOTH_ERROR_BASE - 0x04)
87 /**< invalid data error */
88 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION ((int)BLUETOOTH_ERROR_BASE - 0x05)
89 /**< Memory allocation error */
90 #define BLUETOOTH_ERROR_OUT_OF_MEMORY ((int)BLUETOOTH_ERROR_BASE - 0x06)
91 /**< out of memory error */
92 #define BLUETOOTH_ERROR_TIMEOUT ((int)BLUETOOTH_ERROR_BASE - 0x07)
94 #define BLUETOOTH_ERROR_NO_RESOURCES ((int)BLUETOOTH_ERROR_BASE - 0x08)
95 /**< No resource error */
96 #define BLUETOOTH_ERROR_INTERNAL ((int)BLUETOOTH_ERROR_BASE - 0x09)
97 /**< internal error */
98 #define BLUETOOTH_ERROR_NOT_SUPPORT ((int)BLUETOOTH_ERROR_BASE - 0x0a)
99 /**< Not supported error */
100 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0b)
101 /**< Operation is failed because
102 of not enabled BT Adapter */
103 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED ((int)BLUETOOTH_ERROR_BASE - 0x0c)
104 /**< Enabling is failed because of
105 already enabled BT Adapter */
106 #define BLUETOOTH_ERROR_DEVICE_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x0d)
107 /**< Operation is failed because of
108 other on going operation */
109 #define BLUETOOTH_ERROR_ACCESS_DENIED ((int)BLUETOOTH_ERROR_BASE - 0x0e)
110 /**< access denied error */
111 #define BLUETOOTH_ERROR_MAX_CLIENT ((int)BLUETOOTH_ERROR_BASE - 0x0f)
112 /**< max client error */
113 #define BLUETOOTH_ERROR_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x10)
114 /**< not found error */
115 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x11)
116 /**< service search fail */
117 #define BLUETOOTH_ERROR_PARING_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x12)
118 /**< pairing failed error */
119 #define BLUETOOTH_ERROR_NOT_PAIRED ((int)BLUETOOTH_ERROR_BASE - 0x13)
120 /**< Not paired error */
121 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND ((int)BLUETOOTH_ERROR_BASE - 0x14)
122 /**< no service error */
123 #define BLUETOOTH_ERROR_NOT_CONNECTED ((int)BLUETOOTH_ERROR_BASE - 0x15)
124 /**< no connection error */
125 #define BLUETOOTH_ERROR_ALREADY_CONNECT ((int)BLUETOOTH_ERROR_BASE - 0x16)
126 /**< alread connected error */
127 #define BLUETOOTH_ERROR_CONNECTION_BUSY ((int)BLUETOOTH_ERROR_BASE - 0x17)
128 /**< connection busy error */
129 #define BLUETOOTH_ERROR_CONNECTION_ERROR ((int)BLUETOOTH_ERROR_BASE - 0x18)
130 /**< connection error */
131 #define BLUETOOTH_ERROR_MAX_CONNECTION ((int)BLUETOOTH_ERROR_BASE - 0x19)
132 /**< max connection error*/
133 #define BLUETOOTH_ERROR_NOT_IN_OPERATION ((int)BLUETOOTH_ERROR_BASE - 0x1a)
134 /**< Not in operation */
135 #define BLUETOOTH_ERROR_CANCEL_BY_USER ((int)BLUETOOTH_ERROR_BASE - 0x1b)
136 /**< Cancelled by user */
137 #define BLUETOOTH_ERROR_REGISTRATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1c)
138 /**< Service record registration failed */
139 #define BLUETOOTH_ERROR_IN_PROGRESS ((int)BLUETOOTH_ERROR_BASE - 0x1d)
140 /**< Operation in progress */
141 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED ((int)BLUETOOTH_ERROR_BASE - 0x1e)
142 /**< authentication failed error when paring*/
143 #define BLUETOOTH_ERROR_HOST_DOWN ((int)BLUETOOTH_ERROR_BASE - 0x1f)
144 /**< Remote host is down */
145 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST ((int)BLUETOOTH_ERROR_BASE - 0x20)
146 /**< End of device list */
148 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x21)
149 /**< Obex agent already exists */
150 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST ((int)BLUETOOTH_ERROR_BASE - 0x22)
151 /**< Obex agent does not exist */
153 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x23)
154 /**< Already initialized */
156 #define BLUETOOTH_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x24)
157 /**< Permission deined */
159 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED ((int)BLUETOOTH_ERROR_BASE - 0x25)
160 /**< Nap already done */
162 #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26)
163 /**< Not initialized */
166 * Device disconnect reason
169 BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
170 BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
171 BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
172 BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
173 } bluetooth_device_disconnect_reason_t;
176 * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
179 unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
180 } bluetooth_device_address_t;
183 * This is Bluetooth device address type
187 BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
188 BLUETOOTH_DEVICE_RANDOM_ADDRESS
189 } bluetooth_device_address_type_t;
192 * This is Bluetooth version
195 char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
196 } bluetooth_version_t;
199 * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
202 char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
203 } bluetooth_device_name_t;
206 * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
209 int data_len; /**< manafacturer specific data length */
210 char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
211 } bluetooth_manufacturer_data_t;
214 char pin_code[BLUETOOTH_PIN_CODE_MAX_LENGTH + 1];
215 } bluetooth_device_pin_code_t;
221 BLUETOOTH_ADAPTER_DISABLED, /**< Bluetooth adapter is disabled */
222 BLUETOOTH_ADAPTER_ENABLED, /**< Bluetooth adapter is enabled */
223 BLUETOOTH_ADAPTER_CHANGING_ENABLE, /**< Bluetooth adapter is currently enabling */
224 BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
225 } bluetooth_adapter_state_t;
231 BLUETOOTH_ADAPTER_LE_DISABLED, /**< Bluetooth adapter le is disabled */
232 BLUETOOTH_ADAPTER_LE_ENABLED, /**< Bluetooth adapter le is enabled */
233 BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE, /**< Bluetooth adapter le is currently enabling */
234 BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
235 } bluetooth_adapter_le_state_t;
241 BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE, /**< Non discoverable mode */
242 /*Changed the order to make it compatable with old method */
243 BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
244 BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
245 /**< Discoverable mode with time limit
246 After specific timeout, it is changed
247 to non discoverable mode */
248 } bluetooth_discoverable_mode_t;
251 * Network connect mode
254 BLUETOOTH_NETWORK_PANU_ROLE,
256 BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
257 BLUETOOTH_NETWORK_GN_ROLE, /**< Group ad-hoc Network */
258 BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
259 } bluetooth_network_role_t;
265 BLUETOOTH_RFCOMM_SERVICE = 0x01,
266 BLUETOOTH_A2DP_SERVICE = 0x02,
267 BLUETOOTH_HSP_SERVICE = 0x04,
268 BLUETOOTH_HID_SERVICE = 0x08,
269 BLUETOOTH_NAP_SERVICE = 0x10,
270 BLUETOOTH_HFG_SERVICE = 0x20,
271 BLUETOOTH_GATT_SERVICE = 0x40,
272 BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
273 BLUETOOTH_A2DP_SINK_SERVICE = 0x100,
274 } bluetooth_service_type_t;
280 BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, /* represents that connection
281 * type can both BR/EDR and LE */
282 BLUETOOTH_DEV_CONN_BREDR = 0x00,
283 BLUETOOTH_DEV_CONN_LE = 0x01,
284 } bluetooth_conn_type_t;
290 BLUETOOTH_CODEC_ID_CVSD = 0x01,
291 BLUETOOTH_CODEC_ID_MSBC = 0x02,
292 } bluetooth_codec_type_t;
298 BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
299 BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
300 } bluetooth_hf_audio_connected_type_t;
306 guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
307 } bluetooth_advertising_data_t;
313 guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
314 } bluetooth_scan_resp_data_t;
317 * Advertising filter policy
320 BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
321 BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
322 BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
323 BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
324 } bluetooth_advertising_filter_policy_t;
330 BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
331 BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
332 BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
333 BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
334 BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
335 } bluetooth_advertising_type_t;
339 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
340 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
341 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
342 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
343 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
344 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
345 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
346 BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0x80
347 }bt_gatt_characteristic_property_t;
350 * Remote device request types for attributes
353 BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ = 0x00, /* Read Requested*/
354 BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE = 0x01, /* Write Requested*/
355 } bluetooth_gatt_att_request_tyep_t;
358 * Advertising parameters
363 guint8 filter_policy;
365 } bluetooth_advertising_params_t;
371 int type; /**< passive 0, active 1 */
372 float interval; /**< LE scan interval */
373 float window; /**< LE scan window */
374 } bluetooth_le_scan_params_t;
380 guint16 interval_min;
381 guint16 interval_max;
384 } bluetooth_le_connection_param_t;
387 LE Read Maximum Data Length
390 guint16 max_tx_octets;
392 guint16 max_rx_octets;
394 } bluetooth_le_read_maximum_data_length_t;
397 LE Read Host suggested default Data Length
400 guint16 def_tx_octets;
402 } bluetooth_le_read_host_suggested_data_length_t;
405 * Samsung XSAT Vendor dependent command
410 } bluetooth_vendor_dep_at_cmd_t;
413 #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */
414 #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
415 /**< Base ID for GAP Event */
416 #define BLUETOOTH_EVENT_SDP_BASE ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
417 /**< Base ID for SDP events */
418 #define BLUETOOTH_EVENT_RFCOMM_BASE ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
419 /**< Base ID for RFCOMM events */
420 #define BLUETOOTH_EVENT_NETWORK_BASE ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
421 /**< Base ID for NETWORK events */
422 #define BLUETOOTH_EVENT_HDP_BASE ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
423 /**< Base ID for HDP events */
424 #define BLUETOOTH_EVENT_OPC_BASE ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
425 /**< Base ID for OPC events */
426 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
427 /**< Base ID for Obex Server events */
428 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
429 /**< Base ID for GATT events */
431 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
432 /**< Base ID for Audio events */
433 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
434 /**< Base ID for HID events */
435 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
436 /**< Base ID for Advertising events */
437 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
438 /**< Base ID for PBAP Client events */
439 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
440 /**< Base ID for AVRCP events */
441 #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020))
442 /**< Base ID for IPSP events */
445 * Bluetooth event type
448 BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
450 BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
451 BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
452 BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
453 BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
454 BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
455 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
456 /**< Bluetooth event Discoverable timeout requested*/
457 BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED, /**< Bluetooth event mode changed */
458 BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
459 BLUETOOTH_EVENT_DISCOVERY_STARTED, /**< Bluetooth event discovery started */
460 BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */
461 BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */
462 BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */
463 BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */
464 BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */
465 BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
466 BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */
467 BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */
468 BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, /**< Bluetooth event paired device found */
469 BLUETOOTH_EVENT_REMOTE_DEVICE_READ, /**< Bluetooth event read remote device */
470 BLUETOOTH_EVENT_DEVICE_AUTHORIZED, /**< Bluetooth event authorize device */
471 BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED, /**< Bluetooth event unauthorize device */
472 BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED, /**< Bluetooth event mode changed */
473 BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, /**Bluetooth event for displaying keyboard passkey to user*/
474 BLUETOOTH_EVENT_PIN_REQUEST, /**Bluetooth event for PIN input by user*/
475 BLUETOOTH_EVENT_PASSKEY_REQUEST, /**Bluetooth event for entering Passkey by user*/
476 BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST, /**Bluetooth event for Passkey confirmation by user*/
477 BLUETOOTH_EVENT_CONNECTABLE_CHANGED, /**< Bluetooth event connectable changed */
479 BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */
480 BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */
481 BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */
483 BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
484 /**< Bluetooth event serice search base id */
485 BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED, /**< Bluetooth event service search cancelled */
486 BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
487 /**< RFCOMM data receive event */
488 BLUETOOTH_EVENT_RFCOMM_CONNECTED, /**< Rfcomm server incomming connection */
489 BLUETOOTH_EVENT_RFCOMM_DISCONNECTED, /**< Rfcomm server/client disconnect */
491 BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
493 BLUETOOTH_EVENT_DEVICE_CONNECTED, /**< Bluetooth event device connected */
494 BLUETOOTH_EVENT_DEVICE_DISCONNECTED, /**< Bluetooth event device disconnected */
496 BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
498 BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
499 /**< Bluetooth Network event */
500 BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
501 BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED, /**< Network connected event in server */
502 BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
503 /**< Network disconnected evnet in server */
505 BLUETOOTH_EVENT_NETWORK_CONNECTED, /**< Network connected event in client*/
506 BLUETOOTH_EVENT_NETWORK_DISCONNECTED, /**< Network disconnected evnet in client*/
508 BLUETOOTH_EVENT_HDP_CONNECTED
509 = BLUETOOTH_EVENT_HDP_BASE, /**<HDP Connect>*/
510 BLUETOOTH_EVENT_HDP_DISCONNECTED, /**<HDP Disconnect>*/
511 BLUETOOTH_EVENT_HDP_DATA_RECEIVED, /**<HDP Data Indication>*/
513 BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
514 /* OPC Connected event */
515 BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */
516 BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */
517 BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */
518 BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */
520 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
521 /* Obex server authorize event*/
522 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/
523 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
524 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
525 BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
526 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
527 BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
529 BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
530 /**<Discovered GATT service characteristics event*/
531 BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
532 /**<Remote GATT charateristic value changed event*/
533 BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
534 BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
535 BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
536 BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
537 BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
538 BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
539 BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
540 BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
541 BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
542 BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
543 BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
544 BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
545 BLUETOOTH_EVENT_GATT_SERVER_INDICATE_CONFIRMED, /** <GATT Characteristic Notification change event */
547 BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
548 BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
549 BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
550 BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
551 BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
552 BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED, /**<AV & AG service disconnected event*/
553 BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
554 BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
555 BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
556 BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
557 BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
558 BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
559 BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle status event*/
560 BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
561 BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
562 BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
563 BLUETOOTH_EVENT_HF_CONNECTED,
564 BLUETOOTH_EVENT_HF_DISCONNECTED,
565 BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
566 BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
567 BLUETOOTH_EVENT_HF_RING_INDICATOR,
568 BLUETOOTH_EVENT_HF_CALL_WAITING,
569 BLUETOOTH_EVENT_HF_CALL_TERMINATED,
570 BLUETOOTH_EVENT_HF_CALL_STARTED,
571 BLUETOOTH_EVENT_HF_CALL_ENDED,
572 BLUETOOTH_EVENT_HF_CALL_UNHOLD,
573 BLUETOOTH_EVENT_HF_CALL_SWAPPED,
574 BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
575 BLUETOOTH_EVENT_HF_CALL_STATUS,
576 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
577 BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
578 BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
579 BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
581 BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
582 BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
583 BLUETOOTH_HID_DEVICE_CONNECTED, /**< HID Device connected event*/
584 BLUETOOTH_HID_DEVICE_DISCONNECTED, /**< HID Device disconnected event*/
585 BLUETOOTH_HID_DEVICE_DATA_RECEIVED, /**< HID Device data received event*/
587 BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
588 BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
589 BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
590 BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
591 BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
592 BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
593 BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
594 BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
596 BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
597 BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
598 BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
599 BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
600 BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
601 BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
602 BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
604 BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
605 BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
606 BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle status event*/
607 BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
608 BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
609 BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
610 BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
611 BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
612 BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
614 BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED = BLUETOOTH_EVENT_IPSP_BASE, /**<IPSP init event*/
615 BLUETOOTH_EVENT_IPSP_CONNECTED, /**< IPSP connected event */
616 BLUETOOTH_EVENT_IPSP_DISCONNECTED, /**< IPSP Disconnected event */
617 BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
618 } bluetooth_event_type_t;
621 * This bt_service_uuid_list_t enum indicates service uuid list .
622 * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
626 BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101), /**<SPP*/
627 BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102), /**<LAP*/
628 BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
629 BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
630 BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
631 BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
632 BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
633 BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
634 BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109), /**<CTP*/
635 BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A), /**<AUDIO SOURCE*/
636 BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B), /**<AUDIO SINK*/
637 BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C), /**<AV REMOTE CONTROL
639 BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D), /**<A2DP*/
640 BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E), /**<AV REMOTE CONTROL UUID*/
641 BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
642 BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110), /**<ICP*/
643 BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111), /**<FAX*/
644 BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112), /**<HS AG */
645 BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115), /**<PAN*/
646 BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116), /**<PAN*/
647 BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117), /**<PAN*/
648 BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
649 BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118), /**<OBEX BPPS*/ /* Will be removed */
650 BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
651 BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A), /**<OBEX_IMAGING*/
652 BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B), /**<OBEX_IMAGING
654 BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C), /**<IMAGING AUTOMATIC ARCHIVE*/
655 BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D), /**<IMAGING REFERENCED OBJECTS*/
656 BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E), /**<HF*/
657 BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F), /**<HFG*/
658 BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
659 /**<DIRECT PRINTING*/
660 BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121), /**<REFLECTED UI*/
661 BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122), /**<BASIC PRINTING*/
662 BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123), /**<PRINTING STATUS*/
663 BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
664 BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124), /**<HID*/
665 BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125), /**<HCRP*/
666 BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126), /**<HCR PRINT*/
667 BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127), /**<HCR SCAN*/
668 BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D), /**<SIM ACCESS PROFILE*/
669 BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E), /**<PBAP - PCE*/
670 BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/
671 BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F), /**<OBEX PBA*/ /* Will be removed */
672 BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130), /**<OBEX PBA*/
673 BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131), /**<HEADSET HS*/
674 BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
675 BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
676 BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
677 BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200), /**<PNP*/
678 BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201), /**<GENERIC NETWORKING*/
679 BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
680 BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203), /**<GENERIC AUDIO*/
681 BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204), /**<GENERIC TELEPHONY*/
682 BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303), /**<VEDIO SOURCE*/
683 BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304), /**<VEDIO SINK*/
684 BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305), /**<VEDIO DISTRIBUTION*/
685 BLUETOOTH_HDP_UUID = ((unsigned short)0x1400), /**<HDP*/
686 BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401), /**<HDP SOURCE*/
687 BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402), /**<HDP SINK*/
688 BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000) /**<OBEX_SYNC*/ /* Will be removed */
689 } bluetooth_service_uuid_list_t;
692 * Service class part of class of device returned from device discovery
695 BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
696 BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000, /**< */
697 BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000, /**< */
698 BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000, /**< */
699 BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000, /**< */
700 BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000, /**< */
701 BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000, /**< */
702 BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000, /**< */
703 BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000, /**< */
704 } bluetooth_device_service_class_t;
708 * Major device mask (For device discovery)
711 BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
712 BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
713 BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
714 BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
715 BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
716 BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
717 BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
718 BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
719 BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
720 BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
721 } bluetooth_device_major_mask_t;
725 * Major device class (part of Class of Device)
728 BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00, /**< Miscellaneous major device class*/
729 BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01, /**< Computer major device class*/
730 BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02, /**< Phone major device class*/
731 BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03, /**< LAN major device class*/
732 BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04, /**< AUDIO major device class*/
733 BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05, /**< Peripheral major device class*/
734 BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06, /**< Imaging major device class*/
735 BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07, /**< Wearable device class*/
736 BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08, /**< Toy device class*/
737 BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09, /**< Health device class*/
738 BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F /**< Unknown major device class*/
739 } bluetooth_device_major_class_t;
742 BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00, /**< unclassified minor class */
744 /* About Computer Major class */
745 BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04, /**< desktop workstation
747 BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08, /**< server minor class */
748 BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C, /**< laptop minor class */
749 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10, /**< PDA minor class */
750 BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14, /**< PALM minor class */
751 BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18, /**< Wearable PC minor class */
753 /* About Phone Major class */
754 BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04, /**< Cellular minor class */
755 BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08, /**< cordless minor class */
756 BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C, /**< smart phone minor class */
757 BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
758 /**< voice gateway minor class */
759 BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14, /**< ISDN minor class */
761 /* About LAN/Network Access Point Major class */
762 BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04, /**< Fully available minor class */
763 BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20, /**< 1-17% utilized minor class */
764 BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40, /**< 17-33% utilized minor class */
765 BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60, /**< 33-50% utilized minor class */
766 BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80, /**< 50-67% utilized minor class */
767 BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0, /**< 67-83% utilized minor class */
768 BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0, /**< 83-99% utilized minor class */
769 BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0, /**< No service available minor class */
771 /* About Audio/Video Major class */
772 BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04, /**< Headset minor class */
773 BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08, /**< Handsfree minor class*/
775 BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10, /**< Microphone minor class */
776 BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14, /**< Loud Speaker minor class */
777 BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18, /**< Headphones minor class */
778 BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C, /**< Portable Audio minor class */
779 BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20, /**< Car Audio minor class */
780 BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24, /**< Set top box minor class */
781 BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28, /**< Hifi minor class */
782 BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C, /**< VCR minor class */
783 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30, /**< Video Camera minor class */
784 BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34, /**< CAM Corder minor class */
785 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38, /**<Video Monitor minor class */
786 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
787 /**< Video Display and Loud
788 Speaker minor class */
789 BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
792 BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48, /**< Gaming or toy minor class */
794 /* About Peripheral Major class */
795 BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40, /**< Key board minor class */
796 BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80, /**< Pointing Device minor class */
797 BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
798 /**< Combo Keyboard or pointing
801 BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04, /**< JoyStick minor class */
802 BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08, /**< Game Pad minor class */
803 BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C, /**< Remote Control minor class */
804 BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10, /**< Sensing Device minor class */
805 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14, /**< Digitizer minor class */
806 BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18, /**< Card Reader minor class */
807 BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C, /**< Digital pen minor class */
808 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20, /**< Handheld scanner for bar-codes, RFID minor class */
809 BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24, /**< Handheld gestural input device minor class */
811 /* About Imaging Major class */
812 BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10, /**< Display minor class */
813 BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20, /**< Camera minor class */
814 BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40, /**< Scanner minor class */
815 BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80, /**< Printer minor class */
817 /* About Wearable Major class */
818 BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04, /**< Wrist watch minor class */
819 BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08, /**< Pager minor class */
820 BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C, /**< Jacket minor class */
821 BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10, /**< Helmet minor class */
822 BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14, /**< Glasses minor class */
824 /* About Toy Major class */
825 BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04, /**< Robot minor class */
826 BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08, /**< Vehicle minor class */
827 BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C, /**< Doll or Action minor class */
828 BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10, /**< Controller minor class */
829 BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14, /**< Game minor class */
831 /* About Health Major class */
832 BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04, /**< Blood Pressure minor class */
833 BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08, /**< Thermometer minor class */
834 BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C, /**< Weighing Scale minor class */
835 BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10, /**< Glucose minor class */
836 BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14, /**< Pulse Oximeter minor class */
837 BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
838 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C, /**< Medical minor class */
839 BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20, /**< Step Counter minor class */
840 BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24, /**< Body composition analyzer minor class */
841 BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28, /**< Peak flow monitor minor class */
842 BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
843 BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30, /**< Knee prosthesis minor class */
844 BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34, /**< Ankle prosthesis minor class */
845 } bluetooth_device_minor_class_t;
848 * structure to hold the device information
851 bluetooth_device_major_class_t major_class; /**< major device class */
852 bluetooth_device_minor_class_t minor_class; /**< minor device class */
853 bluetooth_device_service_class_t service_class;
854 /**< service device class */
855 } bluetooth_device_class_t;
858 * Discovery Role types
861 DISCOVERY_ROLE_BREDR = 0x1,
863 DISCOVERY_ROLE_LE_BREDR
864 } bt_discovery_role_type_t;
867 * Connected state types
870 BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
871 BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
872 BLUETOOTH_CONNECTED_LINK_LE = 0x02,
873 BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
874 } bluetooth_connected_link_t;
880 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01, /**< device address */
881 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04, /**< service uuid */
882 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08, /**< service solicitation uuid */
883 BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10, /**< device name */
884 BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20, /**< manufacturer data */
885 BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40, /**< service data */
886 } bluetooth_le_scan_filter_feature_t;
892 BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
893 BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
894 BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
895 } bluetooth_le_connection_mode_t;
898 * structure to hold the device information
901 bluetooth_device_address_t device_address; /**< device address */
902 bluetooth_device_name_t device_name; /**< device name */
903 bluetooth_device_class_t device_class; /**< device class */
904 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
905 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
907 int rssi; /**< received strength signal*/
908 gboolean paired; /**< paired flag */
909 bluetooth_connected_link_t connected; /**< connected link type */
910 gboolean trust; /**< trust flag */
911 bluetooth_manufacturer_data_t manufacturer_data; /**< manafacturer specific class */
912 } bluetooth_device_info_t;
915 * structure to hold the LE device information
918 int data_len; /**< manafacturer specific data length */
919 bluetooth_advertising_data_t data; /**< manafacturer specific data */
920 } bluetooth_le_advertising_data_t;
923 bluetooth_device_address_t device_address; /**< device address */
924 int addr_type; /**< address type*/
925 int rssi; /**< received strength signal*/
926 bluetooth_le_advertising_data_t adv_ind_data;
927 bluetooth_le_advertising_data_t scan_resp_data;
928 } bluetooth_le_device_info_t;
932 bluetooth_le_scan_filter_feature_t added_features; /**< added features */
933 bluetooth_device_address_t device_address; /**< device address */
934 char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX]; /**< device name */
935 bluetooth_le_advertising_data_t service_uuid; /**< service uuid */
936 bluetooth_le_advertising_data_t service_uuid_mask; /**< service uuid mask */
937 bluetooth_le_advertising_data_t service_solicitation_uuid; /**< service solicitation uuid */
938 bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
939 bluetooth_le_advertising_data_t service_data; /**< service data */
940 bluetooth_le_advertising_data_t service_data_mask; /**< service data mask */
941 int manufacturer_id; /**< manufacturer ID */
942 bluetooth_le_advertising_data_t manufacturer_data; /**< manufacturer data */
943 bluetooth_le_advertising_data_t manufacturer_data_mask; /**< manufacturer data mask */
944 } bluetooth_le_scan_filter_t;
947 * structure to hold the paired device information
950 bluetooth_device_address_t device_address; /**< paired device address */
951 bluetooth_device_name_t device_name; /**< device name */
952 bluetooth_device_class_t device_class; /**< device class */
953 } bluetooth_paired_device_info_t;
956 * structure to hold the paired device information
959 bluetooth_device_address_t device_address;
960 /**< device address */
961 char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
962 /**< network interface name */
963 } bluetooth_network_device_info_t;
966 * Authentication event types
970 BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
971 BLUETOOTH_AUTH_PIN_REQUEST,
972 BLUETOOTH_AUTH_PASSKEY_REQUEST,
973 BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
974 } bluetooth_auth_type_t;
977 * structure to hold the pincode/pass-key req informations
980 bluetooth_device_address_t device_address; /**< remote device address */
981 bluetooth_device_name_t device_name; /**< device name */
982 char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
983 } bluetooth_authentication_request_info_t;
986 * Stucture to hold discovery option
989 unsigned short max_response; /**< the number of maximum response */
990 unsigned short discovery_duration;
991 /**< duration of discovery (seconds) */
992 unsigned int classOfDeviceMask; /**< mask for values of class of device. to be used with
993 classOfDevice variable */
994 } bluetooth_discovery_option_t;
997 * Stucture to hold event information
1000 int event; /**< event type */
1001 int result; /**< Success or error value */
1003 /**<parameter data pointer */
1005 } bluetooth_event_param_t;
1008 bluetooth_device_address_t device_addr;
1009 char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1010 unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1011 unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1016 bluetooth_device_address_t device_addr;
1017 unsigned char addr_type;
1019 } bt_connection_info_t;
1022 * Stucture to rfcomm receive data
1027 /**< the socket fd */
1028 int buffer_size;/**< the length of the receive buffer */
1030 /**< the receive data buffer */
1031 } bluetooth_rfcomm_received_data_t;
1037 HTYPE_TRANS_HANDSHAKE,
1038 HTYPE_TRANS_HID_CONTROL,
1039 HTYPE_TRANS_GET_REPORT,
1040 HTYPE_TRANS_SET_REPORT,
1041 HTYPE_TRANS_GET_PROTOCOL,
1042 HTYPE_TRANS_SET_PROTOCOL,
1045 }bt_hid_header_type_t;
1051 PTYPE_DATA_RTYPE_INPUT,
1052 PTYPE_DATA_RTYPE_OUTPUT
1053 }bt_hid_param_type_t;
1056 * Stucture to hid receive data
1059 const char *address;
1060 bt_hid_header_type_t type;
1061 /**< Header type containing */
1062 bt_hid_param_type_t param;
1063 /**< Param type in header like INPUT Report or OutPut Report */
1064 int buffer_size;/**< the length of the receive buffer */
1066 /**< the receive data buffer */
1067 } bluetooth_hid_received_data_t;
1070 * Stucture to rfcomm connection
1074 int socket_fd; /**< the socket fd */
1075 int server_id; /* Server id */
1076 int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1077 bluetooth_device_address_t device_addr;
1078 /**< device address */
1079 char uuid[BLUETOOTH_UUID_STRING_MAX];
1080 } bluetooth_rfcomm_connection_t;
1083 * Stucture to rfcomm disconnection
1087 /**< the socket fd */
1088 int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1089 bluetooth_device_address_t device_addr;
1090 /**< device address */
1091 char uuid[BLUETOOTH_UUID_STRING_MAX];
1092 } bluetooth_rfcomm_disconnection_t;
1096 /**< the socket fd */
1097 bluetooth_device_address_t device_addr;
1098 /**< device address */
1099 } bluetooth_rfcomm_connection_request_t;
1103 /**< the socket fd */
1104 bluetooth_device_address_t device_addr;
1105 /**< device address */
1106 } bluetooth_hid_request_t;
1121 HDP_ROLE_SOURCE = 0x0,
1123 }bt_hdp_role_type_t;
1127 * Stucture to HDP connected
1130 const char *app_handle; /**< the application handle */
1131 unsigned int channel_id; /**< the channel id */
1132 bt_hdp_qos_type_t type; /**< the QOS type */
1133 bluetooth_device_address_t device_address; /**< the remote address */
1134 } bt_hdp_connected_t;
1137 * Stucture to HDP disconnected
1140 unsigned int channel_id; /**< the channel id */
1141 bluetooth_device_address_t device_address; /**< the remote address */
1142 } bt_hdp_disconnected_t;
1145 * Stucture to HDP data indication
1148 unsigned int channel_id; /**< the channel id */
1149 const char *buffer; /**< the RX data buffer */
1150 unsigned int size; /**< the RX data size */
1151 } bt_hdp_data_ind_t;
1154 * Stucture to OPP client transfer information
1160 }bt_opc_transfer_info_t;
1162 /* Obex Server transfer type */
1163 #define TRANSFER_PUT "PUT"
1164 #define TRANSFER_GET "GET"
1166 * Stucture to OPP/FTP Server authorize information
1171 } bt_obex_server_authorize_into_t;
1179 } bt_obex_server_type_t;
1182 * Stucture to OPP/FTP server transfer information
1190 unsigned long file_size;
1192 bt_obex_server_type_t server_type;
1193 } bt_obex_server_transfer_info_t;
1196 * Stucture to OOB data
1200 unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1201 unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1202 unsigned int hash_len;
1203 unsigned int randomizer_len;
1207 * Structure to GATT attribute handle data
1213 } bt_gatt_handle_info_t;
1216 * Structure to GATT Remote service data
1223 bt_gatt_handle_info_t include_handles;
1224 bt_gatt_handle_info_t char_handle;
1225 } bt_gatt_service_property_t;
1228 * Structure to GATT Remote characteristic data
1232 char *service_handle;
1233 bt_gatt_handle_info_t handle_info;
1234 } bt_gatt_discovered_char_t;
1237 * Structure to format of GATT Characteristic Value
1241 unsigned char format;
1242 unsigned char exponent;
1243 unsigned short unit;
1244 unsigned char name_space;
1245 unsigned short description;
1246 } bt_gatt_char_format_t;
1249 * Structure to GATT Characteristic property
1257 bt_gatt_char_format_t format;
1259 unsigned int val_len;
1260 unsigned int permission;
1261 char *representation;
1262 bt_gatt_handle_info_t char_desc_handle;
1263 } bt_gatt_char_property_t;
1266 * Structure to GATT Characteristic descriptor property
1273 unsigned int val_len;
1274 } bt_gatt_char_descriptor_property_t;
1277 * Structure to GATT Characteristic value
1284 } bt_gatt_char_value_t;
1287 * Structure to GATT Read Request
1291 char *service_handle;
1295 } bt_gatt_read_req_t;
1298 * Structure to GATT Value change
1302 char *service_handle;
1308 } bt_gatt_value_change_t;
1311 * Structure to GATT characteristc Notification change
1315 char *service_handle;
1316 gboolean att_notify;
1317 } bt_gatt_char_notify_change_t;
1320 * Structure to Indication confirmation
1324 char *service_handle;
1327 } bt_gatt_indicate_confirm_t;
1330 * Structure to RSSI Signal Strength Alert
1341 * Structure to RSSI Signal Strength
1351 * Structure for RSSI Enabled or Disabled
1357 gboolean rssi_enabled;
1358 } bt_rssi_enabled_t;
1361 * Structure for RSSI Threshold
1366 int in_range_threshold;
1368 } bt_rssi_threshold_t;
1371 * Structure for PBAP Folder Parameters
1374 unsigned char addressbook;
1375 unsigned char folder_type;
1379 * Structure for PBAP Pull application Parameters
1382 unsigned char format;
1383 unsigned char order;
1384 unsigned short offset;
1385 unsigned short maxlist;
1386 long long unsigned fields;
1387 } bt_pbap_pull_parameters_t;
1390 * Structure for PBAP List application Parameters
1393 unsigned char order;
1394 unsigned short offset;
1395 unsigned short maxlist;
1396 } bt_pbap_list_parameters_t;
1399 * Structure for PBAP Pull vCard application Parameters
1402 unsigned char format;
1403 long long unsigned fields;
1405 } bt_pbap_pull_vcard_parameters_t;
1408 * Structure for PBAP Search application Parameters
1411 unsigned char order;
1412 unsigned short offset;
1413 unsigned short maxlist;
1414 unsigned char search_attribute;
1415 char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1416 } bt_pbap_search_parameters_t;
1419 * Structure for PBAP Connection Status
1422 bluetooth_device_address_t btaddr;
1424 } bt_pbap_connected_t;
1427 * Structure for PBAP Phonebook Size
1430 bluetooth_device_address_t btaddr;
1432 } bt_pbap_phonebook_size_t;
1435 * Structure for PBAP Phonebook Pull
1438 bluetooth_device_address_t btaddr;
1441 } bt_pbap_phonebook_pull_t;
1444 * Structure for PBAP vCard List
1447 bluetooth_device_address_t btaddr;
1451 } bt_pbap_vcard_list_t;
1454 * Structure for PBAP vCard Pull
1457 bluetooth_device_address_t btaddr;
1460 } bt_pbap_vcard_pull_t;
1463 * Structure for PBAP Phonebook search List
1466 bluetooth_device_address_t btaddr;
1470 } bt_pbap_phonebook_search_list_t;
1473 * Stucture to HF Call status information
1477 char *number; /*Phone Number */
1478 int direction; /*Direction :Incoming(1), Outgoing(0)*/
1479 int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1480 int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1481 int idx; /*Call index/ID */
1482 } bt_hf_call_status_info_t;
1487 } bt_hf_call_list_s;
1490 * Structure for LE data length change params
1494 bluetooth_device_address_t device_address;
1495 guint16 max_tx_octets;
1496 guint16 max_tx_time;
1497 guint16 max_rx_octets;
1498 guint16 max_rx_time;
1499 } bt_le_data_length_params_t;
1502 * Callback pointer type
1504 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1507 * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1508 * @brief Set the callback function pointer for bluetooth event
1511 * This API will register the callback function, when any response and event are received from
1512 * bluetooth framework. @n
1513 * this registered callback function will be get called with appropriate event and data structures.
1514 * This function is a synchronous call. An application developer can call
1515 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1516 * type. This registered function will receive events of bluetooth_event_type_t type along with
1520 * @param[in] callback_ptr A pointer to the callback function
1521 * @param[in] user_data A pointer to user data
1522 * @return BLUETOOTH_ERROR_NONE - Success
1526 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1528 GMainLoop *main_loop = (GMainLoop*) user_data;
1532 // Code for each event
1534 g_main_loop_quit(main_loop);
1541 GMainLoop *main_loop = NULL;
1543 main_loop = g_main_loop_new(NULL, FALSE);
1544 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1545 if (ret >= BLUETOOTH_ERROR_NONE)
1547 // bluetooth_register_callback returned Success
1551 // bluetooth_register_callback returned failiure
1553 g_main_loop_run(main_loop);
1557 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1560 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1561 * @brief Set the callback function pointer for bluetooth le event
1564 * This API will register the callback function, when any response and event are received from
1565 * bluetooth framework. @n
1566 * this registered callback function will be get called with appropriate event and data structures.
1567 * This function is a synchronous call. An application developer can call
1568 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1569 * type. This registered function will receive events of bluetooth_event_type_t type along with
1573 * @param[in] callback_ptr A pointer to the callback function
1574 * @param[in] user_data A pointer to user data
1575 * @return BLUETOOTH_ERROR_NONE - Success
1579 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1582 * @fn int bluetooth_le_unregister_callback(void)
1583 * @brief Set the callback function pointer for bluetooth le event
1586 * This API will register the callback function, when any response and event are received from
1587 * bluetooth framework. @n
1588 * this registered callback function will be get called with appropriate event and data structures.
1589 * This function is a synchronous call. An application developer can call
1590 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1591 * type. This registered function will receive events of bluetooth_event_type_t type along with
1596 * @return BLUETOOTH_ERROR_NONE - Success
1600 int bluetooth_le_unregister_callback(void);
1603 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1604 * @brief Set the callback function pointer for bluetooth event
1607 * This API will register the callback function, when any response and event are received from
1608 * bluetooth framework. @n
1609 * this registered callback function will be get called with appropriate event and data structures.
1610 * This function is a synchronous call. An application developer can call
1611 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1612 * type. This registered function will receive events of bluetooth_event_type_t type along with
1617 * @return BLUETOOTH_ERROR_NONE - Success
1621 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1623 GMainLoop *main_loop = (GMainLoop*) user_data;
1627 // Code for each event
1629 g_main_loop_quit(main_loop);
1636 GMainLoop *main_loop = NULL;
1638 main_loop = g_main_loop_new(NULL, FALSE);
1639 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1640 if (ret >= BLUETOOTH_ERROR_NONE)
1642 // bluetooth_register_callback returned Success
1646 // bluetooth_register_callback returned failiure
1648 ret = bluetooth_deregister_callback(void);
1649 g_main_loop_run(main_loop);
1653 int bluetooth_unregister_callback(void);
1656 * @fn int bluetooth_enable_adapter(void)
1657 * @brief Enable the Bluetooth H/W
1660 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1661 * send request to bluetooth chip for activation.
1662 * This function is typically called at startup or when Bluetooth services are required. This
1663 * function must be called before calling any other API of Bluetooth operations.
1665 * Before performing any operations like Device discover, service search etc.., the adapter must be
1668 * This function is a asynchronous call.
1669 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1670 * through registered callback function with appropriate result code
1671 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1672 * BLUETOOTH_ERROR_NONE - Success \n
1674 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1675 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1677 * @return BLUETOOTH_ERROR_NONE - Success\n
1678 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1679 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1680 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1681 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1683 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1685 void bt_event_callback(int event, bluetooth_event_param_t *param)
1689 case BLUETOOTH_EVENT_ENABLED:
1690 if (param->result == BLUETOOTH_ERROR_NONE)
1692 // Successfully Enabled
1705 ret = bluetooth_enable_adapter();
1709 int bluetooth_enable_adapter(void);
1712 * @fn int bluetooth_disable_adapter(void)
1713 * @brief Disable the Bluetooth H/W
1716 * This function disables Bluetooth protocol stack and hardware. This function is called when
1717 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1719 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1720 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1721 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1723 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1726 * This function is a asynchronous call.
1727 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1728 * through registered callback function.
1731 * @return BLUETOOTH_ERROR_NONE - Success\n
1732 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1733 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1734 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1736 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1738 void bt_event_callback(int event, bluetooth_event_param_t *param)
1742 case BLUETOOTH_EVENT_DISABLED:
1743 if (param->result == BLUETOOTH_ERROR_NONE)
1745 // Successfully disabled
1758 ret = bluetooth_disable_adapter();
1761 int bluetooth_disable_adapter(void);
1762 int bluetooth_recover_adapter(void);
1763 int bluetooth_check_adapter_le(void);
1764 int bluetooth_enable_adapter_le(void);
1766 int bluetooth_disable_adapter_le(void);
1769 * @fn int bluetooth_reset_adapter(void)
1770 * @brief Reset the Bluetooth H/W and values
1773 * This function resets Bluetooth protocol stack and hardware. This function is called when
1774 * an user want to initialize Bluetooth environment.
1776 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1779 * This function is a synchronous call.
1781 * @return BLUETOOTH_ERROR_NONE - Success\n
1782 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1784 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1789 ret = bluetooth_reset_adapter();
1792 int bluetooth_reset_adapter(void);
1795 * @fn int bluetooth_is_supported(void)
1796 * @brief Check if the bluetooth is supported or not by the current target
1798 * This API checks whether the bluetooth is supported or not.
1799 * This API only run by root permission.
1801 * This function is a synchronous call.
1803 * @return 0 - if bluetooth is not supported\n
1804 * 1 - if bluetooth is supported\n
1805 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
1810 ret = bluetooth_is_supported();
1813 int bluetooth_is_supported(void);
1817 * @fn int bluetooth_check_adapter(void)
1818 * @brief Check the current status of the Bluetooth adapter
1821 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
1822 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
1823 * bluetooth adapter.
1824 * This API get the adapter internal data structure and check current adapter status.
1826 * This function is a synchronous call.
1829 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
1830 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
1832 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
1836 ret = bluetooth_check_adapter();
1839 int bluetooth_check_adapter(void);
1842 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
1843 * @brief Get the local adapter bluetooth address
1846 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
1847 * the adapter should be enabled.
1848 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
1849 * contain Bluetooth address.
1850 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
1851 * friendly name for each device.
1852 * There is no event callback for this API.
1854 * This function is a synchronous call.
1857 * @return BLUETOOTH_ERROR_NONE - Succeess \n
1858 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
1859 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
1860 * @param[out] local_address a device address of local bluetooth adapter
1865 bluetooth_device_address_t local_address={0,};
1868 ret = bluetooth_get_local_address(&local_address);
1871 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
1874 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
1875 * @brief Get the hci version
1878 * This function is used to get the bluetooth hci version
1879 * Before calling this API make sure that the adapter is enabled.
1881 * This function is a synchronous call.
1884 * @return BLUETOOTH_ERROR_NONE - Success \n
1885 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1886 * @param[out] timeout remain visibility timeout value
1889 bluetooth_version_t *version;
1891 ret = bluetooth_get_local_version (&version);
1894 int bluetooth_get_local_version(bluetooth_version_t *version);
1897 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
1898 * @brief Get the local device name
1901 * This function is used, get the local device name. Since its difficult to remember the Adapter
1902 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
1903 * friendly name is retrived by the remote device and displaying.
1904 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
1906 * This function is a synchronous call.
1909 * @return BLUETOOTH_ERROR_NONE - Success \n
1910 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
1911 * @param[out] local_name a local device name
1915 bluetooth_device_name_t local_name={0,}
1917 ret = bluetooth_get_local_name (&local_name);
1920 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
1923 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
1924 * @brief Set the local device name
1927 * This function is used to set the local device name. This is a human friendly name whose
1928 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
1930 * This function is a synchronous call.
1932 * @param[in] local_name bluetooth device name to set local device
1934 * @return BLUETOOTH_ERROR_NONE - Success \n
1935 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1936 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1937 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
1938 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
1939 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1944 bluetooth_device_name_t local_name={0,}
1946 ret = bluetooth_set_local_name (&local_name);
1949 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
1953 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
1954 * @brief Check if the uuid is used or not
1956 * This function is used to check if the uuid is used or not.
1958 * This function is a synchronous call.
1960 * @param[in] service_uuid service uuid (UUID 128 bit as string)
1961 * @param[out] used if the uuid is used or not
1963 * @return BLUETOOTH_ERROR_NONE - Success \n
1964 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1965 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1966 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1971 gboolean used = FALSE;
1972 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
1973 ret = bluetooth_is_service_used(uuid, &used);
1976 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
1979 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
1980 * @brief Check if the device is connected to the specific service
1982 * This function is used to check if if the device is connected to the specific service.
1984 * This function is a synchronous call.
1986 * @param[in] local_address a device address of remote bluetooth device
1987 * @param[in] type the service type
1988 * @param[out] is_connected if the device is connected or not
1990 * @return BLUETOOTH_ERROR_NONE - Success \n
1991 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1992 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1993 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1998 gboolean is_connected = FALSE;
1999 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2000 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2003 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2004 bluetooth_service_type_t type,
2005 gboolean *is_connected);
2008 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2009 * @brief Gets device's connected link type
2011 * This function is used to get device's connected link type
2013 * This function is a synchronous call.
2015 * @param[in] device_address a device address of remote bluetooth device
2016 * @param[out] connected_link a device's connected link type
2018 * @return BLUETOOTH_ERROR_NONE - Success \n
2019 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2020 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2021 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2026 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2027 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2028 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2031 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2032 bluetooth_connected_link_t *connected_link);
2035 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2036 * @brief Get the visibility mode
2039 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2040 * visibity mode, the property of the device is determined whether it can be discoverable, non
2041 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2043 * This function is a synchronous call.
2046 * @return BLUETOOTH_ERROR_NONE - Success \n
2047 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2048 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2049 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2050 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2051 * @param[out] discoverable_mode current bluetooth discoverable mode
2053 * @see bluetooth_set_discoverable_mode
2055 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2057 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2060 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2063 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2065 * @brief Set the visibility mode
2068 * This function is used to set the discoverable mode (Visibility option).
2070 * Many times user may want to keep his device discoverable so that when peer device is performing
2071 * device search, he/she can find user's device. Application programmer can keep the mode as
2072 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2073 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2074 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2075 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2077 * This function is a synchronous call.
2079 * @return BLUETOOTH_ERROR_NONE - Success \n
2080 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2082 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2083 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2085 * @see bluetooth_get_discoverable_mode
2089 bluetooth_discoverable_mode_t mode;
2091 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2092 ret = bluetooth_set_discoverable_mode (mode, 180);
2096 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2101 * @fn int bluetooth_get_timeout_value(int *timeout)
2102 * @brief Get the visibility timeout value
2105 * This function is used to get the visibility timeout
2106 * Before calling this API make sure that the adapter is enabled.
2108 * This function is a synchronous call.
2111 * @return BLUETOOTH_ERROR_NONE - Success \n
2112 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2113 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2114 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2115 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2116 * @param[out] timeout remain visibility timeout value
2118 * @see bluetooth_set_discoverable_mode
2122 ret = bluetooth_get_timeout_value (&timeout);
2125 int bluetooth_get_timeout_value(int *timeout);
2129 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2130 * unsigned int classOfDeviceMask)
2131 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2133 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2134 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2135 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2136 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2137 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2138 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2139 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2140 * please see bluetooth_device_info_t for more details.
2143 * This API provides searching options like max responses, discovery duration in seconds and class
2144 * of device mask to filter device search. some times there may be too many bluetooth devices in
2145 * vicinity of your device.in such scenario, application can request to reduce number of responces
2146 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2147 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2148 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2149 * application defined time. please note that discovery_duration should be mentioned in seconds.
2150 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2153 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2154 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2155 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2157 * This function is a asynchronous call.
2158 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2159 * through registered callback function.
2161 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2162 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2164 * The completion or cancellation of the discovery is indicated by an
2165 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2167 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2170 * @return BLUETOOTH_ERROR_NONE - Success \n
2171 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2172 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2173 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2174 agent is not running \n
2176 * @param[in] max_response define the maximum response of the number of founded devices
2178 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2179 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2180 (refer to class of device)
2182 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2185 void bt_event_callback(int event, bluetooth_event_param_t *param)
2189 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2191 bluetooth_device_info_t *device_info = NULL;
2192 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2194 device_info = (bluetooth_device_info_t *)param->param_data;
2195 memcpy(&searched_device, &device_info->device_address,
2196 sizeof(bluetooth_device_address_t));
2197 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2198 device_info->device_address.addr[0],
2199 device_info->device_address.addr[1],
2200 device_info->device_address.addr[2],
2201 device_info->device_address.addr[3],
2202 device_info->device_address.addr[4],
2203 device_info->device_address.addr[5]);
2206 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2208 bluetooth_device_info_t *device_info = NULL;
2209 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2211 device_info = (bluetooth_device_info_t *)param->param_data;
2212 memcpy(&searched_device, &device_info->device_address,
2213 sizeof(bluetooth_device_address_t));
2214 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2215 device_info->device_name.name,
2216 device_info->device_address.addr[0],
2217 device_info->device_address.addr[1],
2218 device_info->device_address.addr[2],
2219 device_info->device_address.addr[3],
2220 device_info->device_address.addr[4],
2221 device_info->device_address.addr[5]);
2225 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2226 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2231 unsigned short max_response;
2232 unsigned short discovery_duration;
2233 unsigned classOfDeviceMask;
2237 discovery_duration =0;
2238 classOfDeviceMask =0;
2240 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2245 int bluetooth_start_discovery(unsigned short max_response,
2246 unsigned short discovery_duration,
2247 unsigned int classOfDeviceMask);
2250 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2251 * unsigned short max_response,
2252 * unsigned short discovery_duration,
2253 * unsigned int classOfDeviceMask)
2254 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2256 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2257 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2258 * Please see bluetooth_start_discovery() for other parameters description.
2260 * This function is a asynchronous call.
2261 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2262 * through registered callback function.
2264 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2265 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2267 * The completion or cancellation of the discovery is indicated by an
2268 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2270 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2273 * @return BLUETOOTH_ERROR_NONE - Success \n
2274 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2275 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2276 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2277 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2278 agent is not running \n
2280 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2281 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2282 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2283 * @param[in] max_response define the maximum response of the number of founded devices
2285 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2286 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2287 (refer to class of device)
2289 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2292 unsigned short type;
2293 unsigned short max_response;
2294 unsigned short discovery_duration;
2295 unsigned classOfDeviceMask;
2300 discovery_duration =0;
2301 classOfDeviceMask =0;
2303 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2308 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2309 unsigned short max_response,
2310 unsigned short discovery_duration,
2311 unsigned int classOfDeviceMask);
2314 * @fn int bluetooth_cancel_discovery (void)
2315 * @brief Cancel the on-going device discovery operation
2318 * This function stops the on-going device discovery operation. This API has to be called after the
2319 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2320 * the bluetooth_start_discovery API
2322 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2323 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2324 * cancel the discover request once the user received the device to which he wish to connect.
2326 * This function is a asynchronous call.
2327 * If the call is success to cancel discovey then the application will receive
2328 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2329 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2330 * BLUETOOTH_ERROR_NONE
2333 * @return BLUETOOTH_ERROR_NONE - Success \n
2334 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2335 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2336 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2337 other application \n
2338 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2340 * @see bluetooth_start_discovery
2342 void bt_event_callback(int event, bluetooth_event_param_t *param)
2346 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2347 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2356 ret = bluetooth_cancel_discovery();
2359 int bluetooth_cancel_discovery(void);
2362 * @fn int bluetooth_start_le_discovery(void)
2363 * @brief Start the generic device discovery which finds the LE devices.
2365 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2366 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2367 * It try to find LE devices. Bluetooth device address and name are
2368 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2369 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2370 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2371 * please see bluetooth_device_info_t for more details.
2373 * This function is a asynchronous call.
2374 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2375 * through registered callback function.
2377 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2380 * The completion or cancellation of the discovery is indicated by an
2381 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2383 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2386 * @return BLUETOOTH_ERROR_NONE - Success \n
2387 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2388 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2389 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2390 agent is not running \n
2393 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2396 void bt_event_callback(int event, bluetooth_event_param_t *param)
2400 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2402 bluetooth_device_info_t *device_info = NULL;
2403 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2405 device_info = (bluetooth_device_info_t *)param->param_data;
2406 memcpy(&searched_device, &device_info->device_address,
2407 sizeof(bluetooth_device_address_t));
2408 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2409 device_info->device_address.addr[0],
2410 device_info->device_address.addr[1],
2411 device_info->device_address.addr[2],
2412 device_info->device_address.addr[3],
2413 device_info->device_address.addr[4],
2414 device_info->device_address.addr[5]);
2418 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2419 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2425 ret = bluetooth_start_discovery();
2430 int bluetooth_start_le_discovery(void);
2433 * @fn int bluetooth_stop_le_discovery (void)
2434 * @brief Cancel the on-going device LE discovery operation
2437 * This function stops the on-going device discovery operation. This API has to be called after the
2438 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2439 * the bluetooth_start_le_discovery API
2442 * This function is a asynchronous call.
2443 * If the call is success to cancel discovey then the application will receive
2444 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2445 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2446 * BLUETOOTH_ERROR_NONE
2449 * @return BLUETOOTH_ERROR_NONE - Success \n
2450 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2451 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2452 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2453 other application \n
2454 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2456 * @see bluetooth_start_discovery
2458 void bt_event_callback(int event, bluetooth_event_param_t *param)
2462 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2463 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2472 ret = bluetooth_stop_le_discovery();
2475 int bluetooth_stop_le_discovery(void);
2478 * @fn int bluetooth_is_discovering(void)
2479 * @brief Check for the device discovery is in-progress or not.
2481 * This API is used to check the current status of the Discovery operation.If discovery is in\
2482 * progress normally other operations are not allowed.
2483 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2484 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2485 * event before performing other operations. This API is used to get for the current discovery
2486 * operation status and using bluetooth_cancel_discovery()
2487 * we can cancell the ongoing discovery process.
2488 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2491 * This function checks whether the device discovery is started or not.
2493 * This function is a synchronous call.
2496 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2497 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2498 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2501 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2505 ret = bluetooth_is_discovering ();
2508 int bluetooth_is_discovering(void);
2511 * @fn int bluetooth_is_le_discovering(void)
2512 * @brief Check for the device LE discovery is in-progress or not.
2514 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2515 * progress normally other operations are not allowed.
2516 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2517 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2518 * event before performing other operations. This API is used to get for the current discovery
2519 * operation status and using bluetooth_stop_le_discovery()
2520 * we can cancell the ongoing LE discovery process.
2521 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2524 * This function checks whether the device LE discovery is started or not.
2526 * This function is a synchronous call.
2529 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2530 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2531 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2534 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2538 ret = bluetooth_is_le_discovering ();
2541 int bluetooth_is_le_discovering(void);
2544 * @fn int bluetooth_is_le_scanning(void)
2545 * @brief Check for the device LE scan is in-progress or not.
2547 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2548 * progress normally other operations are not allowed.
2550 * This function checks whether the device LE Scan is started or not.
2552 * This function is a synchronous call.
2554 * @return TRUE - LE Scan in progress \n
2555 * FALSE - LE Scan is not in progress \n
2560 gboolean is_le_scanning = 0;
2561 is_le_scanning = bluetooth_is_le_scanning ();
2564 gboolean bluetooth_is_le_scanning(void);
2567 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2568 * @brief Register scan filter.
2570 * This function registers the scan filter.
2572 * This function is a synchronous call.
2574 * @return BLUETOOTH_ERROR_NONE - Success \n
2576 * @param[in] filter scan filter to register
2577 * @param[out] slot_id the slot ID of scan filter
2581 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2584 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2585 * @brief Register scan filter.
2587 * This function unregisters the scan filter.
2589 * This function is a synchronous call.
2591 * @return BLUETOOTH_ERROR_NONE - Success \n
2593 * @param[in] slot_id the slot ID of scan filter
2597 int bluetooth_unregister_scan_filter(int slot_id);
2600 * @fn int bluetooth_unregister_all_scan_filters(void)
2601 * @brief Register scan filter.
2603 * This function usregisters all scan filters.
2605 * This function is a synchronous call.
2607 * @return BLUETOOTH_ERROR_NONE - Success \n
2611 int bluetooth_unregister_all_scan_filters(void);
2614 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2615 int link_type, bt_rssi_threshold_t rssi_threshold)
2616 * @brief Enable RSSI monitoring
2618 * This function enables RSSI monitoring and sets threshold for a connection
2620 * @return BLUETOOTH_ERROR_NONE - Success \n
2623 * @see bluetooth_get_rssi_strength
2625 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2626 int link_type, bt_rssi_threshold_t *rssi_threshold);
2629 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2630 * @brief Gets Raw RSSI signal Strength
2632 * This function gives the Raw RSSI signal strength for a connection.
2634 * @return BLUETOOTH_ERROR_NONE - Success \n
2637 * @see bluetooth_enable_rssi
2639 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2641 int bluetooth_set_connectable(gboolean is_connectable);
2643 int bluetooth_is_connectable(gboolean *is_connectable);
2646 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2647 * @brief Initiate a bonding process
2650 * This function initiates a bonding procedure with a peer device. The bonding procedure
2651 * enables authentication and optionally encryption on the Bluetooth link.
2653 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2654 * inititate the bonding request to the devices already in the paired list.
2656 * Usually we call this API after the device discovery.
2657 * This function is a asynchronous call.
2659 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2660 * mentioed result code
2661 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2662 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2663 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2664 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2665 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2667 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2668 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2671 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2674 * @return BLUETOOTH_ERROR_NONE - Success \n
2675 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2676 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2677 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2678 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2680 * @param[in] device_address This indicates an address of the device with which the pairing
2681 * should be initiated
2683 * @see bluetooth_cancel_bonding
2685 void bt_event_callback(int event, bluetooth_event_param_t *param)
2689 case BLUETOOTH_EVENT_BONDING_FINISHED:
2691 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2692 if (param->result >= BLUETOOTH_ERROR_NONE)
2694 bluetooth_device_info_t *device_info = NULL;
2695 device_info = (bluetooth_device_info_t *)param->param_data;
2696 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
2697 mjr[%#x] min[%#x] srv[%#x]",
2698 device_info->device_name.name,
2699 device_info->device_address.addr[0],
2700 device_info->device_address.addr[1],
2701 device_info->device_address.addr[2],
2702 device_info->device_address.addr[3],
2703 device_info->device_address.addr[4],
2704 device_info->device_address.addr[5],
2705 device_info->device_class.major_class,
2706 device_info->device_class.minor_class,
2707 device_info->device_class.service_class);
2721 bluetooth_device_address_t device_address={{0}};
2723 ret = bluetooth_bond_device(&device_address);
2727 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
2730 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2731 * bluetooth_conn_type_t conn_type)
2732 * @brief Initiate a bonding process
2735 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
2736 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
2738 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2739 * inititate the bonding request to the devices already in the paired list.
2741 * Usually we call this API after the device discovery.
2742 * This function is a asynchronous call.
2744 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2745 * mentioed result code
2746 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2747 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2748 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2749 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2750 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2752 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2753 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2756 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2759 * @return BLUETOOTH_ERROR_NONE - Success \n
2760 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2761 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2762 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2763 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2765 * @param[in] device_address This indicates an address of the device with which pairing
2766 * should be initiated
2767 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
2770 * @see bluetooth_cancel_bonding
2772 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2773 bluetooth_conn_type_t conn_type);
2776 * @fn int bluetooth_cancel_bonding(void)
2777 * @brief Cancel the on-going bonding process
2779 * This API is called to cancel the on-going bonding procedure. It should be called before the
2780 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
2781 * This API is useful when the remote device is not responding to the bond request or we wish to
2782 * cancel the bonding request. In this case we need not wait for the timeout to happen.
2784 * This function is a synchronous call.
2786 * @return BLUETOOTH_ERROR_NONE - Success \n
2787 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
2788 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2791 * @see bluetooth_bond_device
2797 ret = bluetooth_cancel_bonding();
2800 int bluetooth_cancel_bonding(void);
2803 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
2804 * @brief Remove bonding
2807 * To communicate with remote device over bluetooth link, user should bond with peer device.
2808 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
2809 * API is used to remove peer device from the list. Please note that after removing the device
2810 * from bonded device list, you cannot communication with peer device until bonding happens again.
2812 * User can call this function by passing bluetooth device address of any bonded device. Please note
2813 * that after successful return of this function, any bluetooth application running on your device
2814 * will not be able to communicate with unbonded device until bond operation happens again using
2815 * bluetooth_bond_device()
2818 * This function is a asynchronous call. The request to remove the specified device from the bonded
2819 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
2820 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
2821 * in case if there is a problem in locating given bluetooth device address in bonded devices list
2825 * @return BLUETOOTH_ERROR_NONE - Success \n
2826 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
2827 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2828 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2829 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2830 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2831 * agent is not running \n
2832 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
2835 * @param[in] device_address This indicates an address of the device to remove bonding
2839 * @see bluetooth_bond_device, bluetooth_cancel_bonding
2842 void bt_event_callback(int event, bluetooth_event_param_t *param)
2845 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
2846 bluetooth_device_address_t *dev_addr = NULL;
2848 if (param->result == BLUETOOTH_ERROR_NONE) {
2849 dev_addr = (bluetooth_device_address_t *)param->param_data;
2851 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2852 dev_addr->addr[0], dev_addr->addr[1]
2853 dev_addr->addr[2], dev_addr->addr[3]
2854 dev_addr->addr[4], dev_addr->addr[5]
2865 bluetooth_device_address_t *device_address;
2867 // copy valid device address in device_address
2869 ret = bluetooth_unbond_device(device_address);
2872 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
2875 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
2876 * @brief Get bonded(paired) device list
2879 * This API gets all bonded device list.
2880 * The devices in the bonded device list further can be used to perform the authorization by calling
2881 * bluetooth_authorize_device API.
2883 * This function is a synchronous call.
2884 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2885 * there is no valid information in the dev_list.
2886 * The len field in the dev_list represents the number of bonded devices. The data structure for
2887 * bonded device information is bluetooth_device_info_t.
2890 * @return BLUETOOTH_ERROR_NONE - Success \n
2891 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2893 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2895 void bt_get_bonded_devices(void)
2899 GPtrArray *devinfo = NULL;
2900 bluetooth_device_info_t *ptr;
2902 // allocate the g_pointer_array
2903 devinfo = g_ptr_array_new();
2905 ret = bluetooth_get_bonded_device_list(&devinfo);
2906 if (ret != BLUETOOTH_ERROR_NONE)
2908 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
2912 printf("g pointer arrary count : [%d]", devinfo->len);
2913 for (i=0; i<devinfo->len; i++)
2915 ptr = g_ptr_array_index(devinfo, i);
2918 printf("Name [%s]\n", ptr->device_name.name);
2919 printf("Major Class [%d]\n", ptr->device_class.major_class);
2920 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
2921 printf("Service Class [%d]\n", ptr->device_class.service_class);
2922 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2923 ptr->device_address.addr[0],
2924 ptr->device_address.addr[1], ptr->device_address.addr[2],
2925 ptr->device_address.addr[3],
2926 ptr->device_address.addr[4], ptr->device_address.addr[5]);
2933 // free g_pointer_array
2934 g_ptr_array_free(devinfo, TRUE);
2939 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
2942 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2943 * bluetooth_device_info_t *dev_info)
2944 * @brief Get a bonded(paired) device
2947 * This API gets a bonded device.
2949 * This function is a synchronous call.
2950 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2951 * there is no valid information in the dev_info.
2952 * The data structure for bonded device information is bluetooth_device_info_t.
2955 * @return BLUETOOTH_ERROR_NONE - Success \n
2956 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2958 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2960 void bt_get_bonded_device(void)
2964 bluetooth_device_info_t devinfo = {0};
2965 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
2967 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
2968 if (ret != BLUETOOTH_ERROR_NONE)
2970 printf("bluetooth_get_bonded_device failed with [%d]",ret);
2974 printf("Name [%s]\n", devinfo.device_name.name);
2975 printf("Major Class [%d]\n", devinfo.device_class.major_class);
2976 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
2977 printf("Service Class [%d]\n", devinfo.device_class.service_class);
2978 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
2979 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
2980 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
2981 devinfo.device_address.addr[5]);
2990 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2991 bluetooth_device_info_t *dev_info);
2994 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
2995 * @brief set alias for bonded device
2998 * This function set alias for bonded device.
3000 * This function is a synchronous call.
3003 * @return BLUETOOTH_ERROR_NONE - Success \n
3004 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3005 * @param[in] device_address This indicates an address of the remote device
3006 * @param[in] alias This indicates an alias to set
3011 ret = bluetooth_set_alias(&remote_address);
3014 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3018 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3019 * @brief Get remote deivice
3022 * This function gets specific remote device.
3024 * This function is a asynchronous call.
3025 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3028 * @return BLUETOOTH_ERROR_NONE - Success \n
3029 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3030 * @param[in] device_address This indicates an address of the remote device
3035 ret = bluetooth_get_remote_device(&remote_address);
3038 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3041 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3042 * gboolean authorized)
3043 * @brief Authorize/Unauthorize a bonded device
3046 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3047 * with/without user confirmation.
3049 * If we select a paired device and make it authorized by calling this API with the authorized
3050 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3051 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3052 * then it will ask for the user conformation before the connection.
3054 * This API supposed to be called on the paired devices. Which means we have to use this API only
3055 * after successful pairing.
3057 * This function is a asynchronous call.
3058 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3060 * @return BLUETOOTH_ERROR_NONE - Success \n
3061 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3062 * @param[in] device_address This indicates an address of the device to authorize \n
3063 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3065 * @see bluetooth_get_bonded_device_list
3067 void bt_event_callback(int event, bluetooth_event_param_t *param)
3071 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3073 if (param->result == BLUETOOTH_ERROR_NONE)
3077 //device authorization failed failure
3085 bluetooth_device_address_t device_address={{0}};
3086 gboolean authorized;
3090 ret = bluetooth_authorize_device(&device_address,authorized);
3093 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3094 gboolean authorized);
3096 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3097 const bluetooth_device_pin_code_t *pin_code);
3099 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3102 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3104 * @brief Receives Legacy Passkey\pin with following authentication response types
3106 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3107 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3110 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3113 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3115 * @brief This API sends user confirmation reply to the local adapter.
3117 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3120 int bluetooth_passkey_confirmation_reply(gboolean reply);
3123 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3124 * @brief Get all services supported by remote device
3127 * This API call initiates the search for the services supported by the specified device. Normally
3128 * the service search will take a couple of seconds to get it completed. Before calling this API
3129 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3130 * perform the service search. We can get the device address by doing a device discovery operation.
3133 * This function is a asynchronous call.
3134 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3136 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3137 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3138 * event is generated with appropriate result code.
3140 * @return BLUETOOTH_ERROR_NONE - Success \n
3141 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3142 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3143 * @param[in] device_address This indicates an address of the device
3144 * whose services need to be found
3146 * @see bluetooth_cancel_service_search
3148 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3151 * @fn int bluetooth_cancel_service_search(void)
3152 * @brief Cancel the ongoing service search operation
3155 * This function cancel the ongoing service search operation. This API is usually calling after the
3156 * bluetooth_search_service API.
3157 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3158 * if the user wish to cancel the Ongoing service search operation.
3160 * This API should be called just after the bluetooth_search_service API and before the
3161 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3163 * This function is a synchronous call.
3165 * @return BLUETOOTH_ERROR_NONE - Success \n
3166 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3167 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3168 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3171 * @see bluetooth_search_service
3176 ret = bluetooth_cancel_service_search();
3179 int bluetooth_cancel_service_search(void);
3182 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3183 * @brief Register rfcomm socket with a specific uuid
3186 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3187 * descriptor of the server.
3188 * This is the first API which is called to create the server. Once we created the server socket,
3189 * we will listen on that return socket.
3190 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3193 * @return socket FD on Success \n
3194 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3195 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3196 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3197 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3198 * @param[in] UUID (128 bits)
3201 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3205 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3206 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3210 int bluetooth_rfcomm_create_socket(const char *uuid);
3213 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3214 * @brief Register rfcomm socket with a specific uuid
3217 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3218 * descriptor of the server.
3219 * This is the first API which is called to create the server. Once we created the server socket,
3220 * we will listen on that return socket.
3221 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3224 * @return socket FD on Success \n
3225 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3226 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3227 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3228 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3229 * @param[in] UUID (128 bits)
3230 * @param[in] bus_name (const char)
3231 * @param[in] path (const char)
3234 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3238 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3239 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3243 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3246 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3247 * @brief De-register the rfcomm socket
3250 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3251 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3252 * descriptor else no event will come. We will call this API only after the
3253 * bluetooth_rfcomm_listen_and_accept.
3254 * This is a synchronous call.
3256 * @return BLUETOOTH_ERROR_NONE - Success \n
3257 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3258 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3259 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3260 * @param[in] int socket_fd
3263 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3266 void bt_event_callback(int event, bluetooth_event_param_t *param)
3270 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3272 bluetooth_rfcomm_connection_t *discon_ind =
3273 (bluetooth_rfcomm_connection_t *)param->param_data;
3275 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3283 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3284 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3286 ret = bluetooth_rfcomm_remove_socket(fd);
3289 int bluetooth_rfcomm_remove_socket(int socket_fd);
3292 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3293 * @brief De-register the rfcomm socket
3296 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3297 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3298 * descriptor else no event will come. We will call this API only after the
3299 * bluetooth_rfcomm_listen_and_accept_ex.
3300 * This is a synchronous call.
3302 * @return BLUETOOTH_ERROR_NONE - Success \n
3303 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3304 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3305 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3306 * @param[in] UUID (128 bits)
3309 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3312 void bt_event_callback(int event, bluetooth_event_param_t *param)
3316 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3318 bluetooth_rfcomm_connection_t *discon_ind =
3319 (bluetooth_rfcomm_connection_t *)param->param_data;
3321 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3329 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3330 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3332 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3335 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3338 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3339 * @brief Disconnect rfcomm connection
3342 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3343 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3346 * @return BLUETOOTH_ERROR_NONE - Success \n
3347 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3348 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3349 * @param[in] int socket_fd the sending socket fd
3355 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3357 printf("Disconnection failed");
3359 printf("Disconnection Success");
3363 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3366 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3367 * @brief Rfcomm socket listen
3370 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3371 * after the bluetooth_rfcomm_create_socket API.
3372 * This API listen for the incomming connection and once it receives a connection, it will give
3373 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3374 * event to the application. This is an Asynchronous API call.
3377 * @return BLUETOOTH_ERROR_NONE - Success \n
3378 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3379 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3381 * @param[in] int socket_fd
3382 * @param[in] max pending connection.
3385 * @see bluetooth_rfcomm_create_socket
3388 void bt_event_callback(int event, bluetooth_event_param_t* param)
3392 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3394 bluetooth_rfcomm_connection_t *conn_ind =
3395 (bluetooth_rfcomm_connection_t *)param->param_data;
3397 printf("\nConnected from FD %d", conn_ind->socket_fd);
3405 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3406 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3410 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3413 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3414 * @brief Rfcomm socket listen
3417 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3418 * after the bluetooth_rfcomm_create_socket API.
3419 * This API listen for the incomming connection and once it receives a connection, it will give
3420 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3421 * event to the application. This is an Asynchronous API call.
3424 * @return BLUETOOTH_ERROR_NONE - Success \n
3425 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3426 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3428 * @param[in] int socket_fd
3429 * @param[in] max pending connection.
3434 * @see bluetooth_rfcomm_create_socket_ex
3437 void bt_event_callback(int event, bluetooth_event_param_t* param)
3441 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3443 bluetooth_rfcomm_connection_t *conn_ind =
3444 (bluetooth_rfcomm_connection_t *)param->param_data;
3446 printf("\nConnected from FD %d", conn_ind->socket_fd);
3454 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3455 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3460 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3463 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3464 * @brief Rfcomm socket listen
3467 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3468 * after the bluetooth_rfcomm_create_socket API.
3469 * This API listen for the incomming connection and once it receives a connection, it will give
3470 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3471 * event to the application. This is an Asynchronous API call.
3474 * @return BLUETOOTH_ERROR_NONE - Success \n
3475 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3476 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3478 * @param[in] int socket_fd
3479 * @param[in] max pending connection.
3482 * @see bluetooth_rfcomm_create_socket
3485 void bt_event_callback(int event, bluetooth_event_param_t* param)
3489 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3491 char *name = (char *)param->param_data;
3493 printf("\nConnected from %s", name);
3495 bluetooth_rfcomm_accept_connection();
3503 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3504 ret = bluetooth_rfcomm_listen(fd, 1);
3508 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3511 * @fn int bluetooth_rfcomm_accept_connection()
3512 * @brief Accepts the authorization request indicated by the event
3513 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3515 * This function is a synchronous call.
3517 * @return BLUETOOTH_ERROR_NONE - Success \n
3518 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3520 * @param[in] the socket fd of the server
3521 * @param[out] the socket fd of the client
3525 * @see bluetooth_rfcomm_reject_connection
3527 int bluetooth_rfcomm_accept_connection(int server_fd);
3530 * @fn int bluetooth_rfcomm_reject_connection()
3531 * @brief Rejects the authorization request indicated by the event
3532 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3534 * This function is a synchronous call.
3536 * @return BLUETOOTH_ERROR_NONE - Success \n
3537 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3539 * @param[in] the socket fd of the server
3543 * @see bluetooth_rfcomm_accept_connection
3545 int bluetooth_rfcomm_reject_connection(int server_fd);
3548 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3549 * @brief Informs whether rfcomm server uuid is available or not.
3551 * This function is a synchronous call.
3553 * @return TRUE - RFCOMM uuid is available \n
3554 * FALSE - RFCOMM uuid is not available \n
3556 * @param[in] uuid UUID string
3562 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3565 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3566 * const char *remote_uuid)
3567 * @brief Connect to the remote device rfcomm *
3569 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3570 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3571 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3572 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3573 * initiating a connection.
3575 * @return BLUETOOTH_ERROR_NONE - Success \n
3576 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3577 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3578 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3579 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3580 * @param[in] bluetooth_device_address_t remote bt_address
3581 * @param[in] char remote uuid
3583 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3587 void bt_event_callback(int event, bluetooth_event_param_t *param)
3591 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3593 if (param->result >= BLUETOOTH_ERROR_NONE)
3595 bt_sdp_info_t *bt_sdp_info=param->param_data;
3597 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3598 bt_sdp_info->device_addr.addr[0],
3599 bt_sdp_info->device_addr.addr[1],
3600 bt_sdp_info->device_addr.addr[2],
3601 bt_sdp_info->device_addr.addr[3],
3602 bt_sdp_info->device_addr.addr[4],
3603 bt_sdp_info->device_addr.addr[5]);
3605 printf("Supported service list:\n");
3606 for(i=0; i<bt_sdp_info->service_index; i++)
3608 bt_sdp_info->service_list_array[i]);
3611 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3612 //rfcomm_test_uuid);
3616 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3618 bluetooth_rfcomm_connection_t *conn_ind =
3619 (bluetooth_rfcomm_connection_t *)param->param_data;
3621 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
3622 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3623 "SERVER" : "CLIENT");
3628 bluetooth_device_address_t remote_address = {{0},};
3629 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3630 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
3631 ret = bluetooth_search_service(&remote_address);
3633 printf("Seach failed, Reason = %d", ret);
3635 printf("Search Success, Ret = %d", ret);
3637 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3639 printf("Connection failed, Reason = %d", ret);
3641 printf("Connection Success, Ret = %d", ret);
3645 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3646 const char *remote_uuid);
3649 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3650 * @brief Disconnect rfcomm connection
3653 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3654 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3657 * @return BLUETOOTH_ERROR_NONE - Success \n
3658 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3659 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3660 * @param[in] char remote bt_address
3663 * @see bluetooth_rfcomm_connect
3667 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3669 printf("Disconnection failed");
3671 printf("Disconnection Success");
3676 int bluetooth_rfcomm_disconnect(int socket_fd);
3679 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3680 * @brief Write to rfcomm connection
3683 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3684 * API is used to send the data for server and the client.
3686 * @return BLUETOOTH_ERROR_NONE - Success \n
3687 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3688 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3690 * @param[in] const char *buff Data buffer to send
3691 * @param[in] int length Length of the data
3694 * @see bluetooth_rfcomm_connect
3697 char *buff = "Test data 123456789"
3698 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
3700 printf("Send failed");
3702 printf("Send success");
3706 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
3709 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
3710 * @brief Informs whether rfcomm client is connected.
3712 * This function is a synchronous call.
3714 * @return TRUE - RFCOMM client is connected \n
3715 * FALSE - RFCOMM client is not connected \n
3721 gboolean bluetooth_rfcomm_is_client_connected(void);
3722 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3723 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3726 * @fn int bluetooth_network_activate_server(void)
3727 * @brief Activate the NAP (Network Access Point) service
3729 * This function is a asynchronous call.
3730 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
3732 * @return BLUETOOTH_ERROR_NONE - Success \n
3733 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3734 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3735 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3738 * @see bluetooth_network_deactivate_server
3741 int bluetooth_network_activate_server(void);
3744 * @fn int bluetooth_network_deactivate_server(void)
3745 * @brief Deactivate the NAP (Network Access Point) service
3747 * This function is a asynchronous call.
3748 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
3750 * @return BLUETOOTH_ERROR_NONE - Success \n
3751 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3752 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3753 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3756 * @see bluetooth_network_activate_server
3759 int bluetooth_network_deactivate_server(void);
3762 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3763 * bluetooth_network_role_t role,
3765 * @brief Connect the network server in the peer
3767 * This function is a asynchronous call.
3768 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3770 * @return BLUETOOTH_ERROR_NONE - Success \n
3771 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3772 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3773 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3776 * @param[in] device_address This indicates an address of the device with which the pairing
3777 * should be initiated
3778 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
3779 * need to use the third parameter.
3780 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
3781 * connect. UUID string
3783 * @see bluetooth_network_disconnect
3785 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3786 bluetooth_network_role_t role, char *custom_uuid);
3789 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
3790 * bluetooth_network_role_t role,
3791 * char *custom_uuid)
3792 * @brief Connect the network server in the peer
3794 * This function is a asynchronous call.
3795 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3797 * @return BLUETOOTH_ERROR_NONE - Success \n
3798 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3799 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3800 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3803 * @param[in] device_address This indicates an address of the device with which the pairing
3804 * should be initiated
3806 * @see bluetooth_network_connect
3808 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
3811 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
3812 * @brief Disconnect the device from the network
3814 * This function is an asynchronous call.
3815 * The network server disconnect request is responded by
3816 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
3818 * @return BLUETOOTH_ERROR_NONE - Success \n
3819 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3820 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3821 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3824 * @param[in] device_address This indicates an address of the connected client device
3826 * @see bluetooth_network_activate_server
3828 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
3833 * @fn int bluetooth_hdp_activate(unsigned short data_type,
3834 * bt_hdp_role_type_t role,
3835 * bt_hdp_qos_type_t channel_type,
3836 * char **app_handle)
3837 * @brief Activate the HDP service for a particular data type
3839 * This function is a synchronous call.
3841 * @return BLUETOOTH_ERROR_NONE - Success \n
3842 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3843 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3844 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3847 * @param[in] data_type The data type against corresponding service
3848 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
3849 * @param[in] channel_type The QOS type for the channel.
3850 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
3851 * For role = HDP_ROLE_SINK, the channel_type
3852 * should be HDP_QOS_ANY.
3853 * @param[out] app_handle The application handler against corresponding service
3855 * @see bluetooth_hdp_deactivate
3857 int bluetooth_hdp_activate(unsigned short data_type,
3858 bt_hdp_role_type_t role,
3859 bt_hdp_qos_type_t channel_type,
3862 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
3863 * @brief Deactivate the HDP service for a particular service using the handler
3865 * This function is a synchronous call.
3867 * @return BLUETOOTH_ERROR_NONE - Success \n
3868 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3869 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3870 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3873 * @param[in] app_handle The application handler against corresponding service
3875 * @see bluetooth_hdp_deactivate
3877 int bluetooth_hdp_deactivate(const char *app_handle);
3880 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
3881 * const char *buffer, unsigned int size)
3882 * @brief Send data to the remote HDP device
3884 * This function is a synchronous call.
3886 * @return BLUETOOTH_ERROR_NONE - Success \n
3887 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3888 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3889 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3890 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
3893 * @param[in] channel_id The channel id for the connection.
3894 * @param[in] buffer The pdu buffer.
3895 * @param[in] size Size of the buffer.
3897 * @see bluetooth_hdp_connect
3899 int bluetooth_hdp_send_data(unsigned int channel_id,
3900 const char *buffer, unsigned int size);
3902 * @fn int bluetooth_hdp_connect(const char *app_handle,
3903 * bt_hdp_qos_type_t channel_type,
3904 * const bluetooth_device_address_t *device_address)
3905 * @brief Connect to the remote device(Mainly used by source)
3907 * This function is a asynchronous call.
3908 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
3910 * @return BLUETOOTH_ERROR_NONE - Success \n
3911 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3912 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3913 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3914 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3917 * @param[in] app_handle The application handler against corresponding service
3918 * @param[in] channel_type The QOS type for the channel.
3919 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
3920 * @param[in] device_address The remote device Bd address.
3923 * @see bluetooth_hdp_disconnect
3925 int bluetooth_hdp_connect(const char *app_handle,
3926 bt_hdp_qos_type_t channel_type,
3927 const bluetooth_device_address_t *device_address);
3929 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
3930 * const bluetooth_device_address_t *device_address)
3931 * @brief Disconnect from the remote device(Mainly used by source)
3933 * This function is a asynchronous call.
3934 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
3936 * @return BLUETOOTH_ERROR_NONE - Success \n
3937 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3938 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3939 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3940 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3943 * @param[in] channel_id The channel id for the connection.
3944 * @param[in] device_address The remote device Bd address.
3947 * @see bluetooth_hdp_connect
3949 int bluetooth_hdp_disconnect(unsigned int channel_id,
3950 const bluetooth_device_address_t *device_address);
3954 * @fn int bluetooth_opc_init(void)
3955 * @brief Initialize OPP client.
3957 * This function is a synchronous call.
3958 * No event corresponding to this api
3960 * @return BLUETOOTH_ERROR_NONE - Success \n
3961 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3962 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3963 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3964 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3969 * @see bluetooth_opc_deinit
3971 int bluetooth_opc_init(void);
3974 * @fn int bluetooth_opc_deinit(void)
3975 * @brief Deinitialize OPP client.
3977 * This function is a synchronous call.
3978 * No event corresponding to this api
3980 * @return BLUETOOTH_ERROR_NONE - Success \n
3981 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3982 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3987 * @see bluetooth_opc_init
3990 int bluetooth_opc_deinit(void);
3993 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
3994 char **file_name_array)
3995 * @brief Send multiple files to a remote device.
3997 * This function is a asynchronous call.
3998 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4000 * @return BLUETOOTH_ERROR_NONE - Success \n
4001 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4002 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4003 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4004 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4005 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4006 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4009 * @param[in] device_address The remote device Bd address.
4010 * @param[in] file_name_array Array of filepaths to be sent.
4013 * @see bluetooth_opc_cancel_push
4016 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4017 char **file_name_array);
4020 * @fn int bluetooth_opc_cancel_push(void)
4021 * @brief Cancels the ongoing file push.
4023 * This function is a asynchronous call.
4024 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4025 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4027 * @return BLUETOOTH_ERROR_NONE - Success \n
4028 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4029 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4034 * @see bluetooth_opc_push_files
4037 int bluetooth_opc_cancel_push(void);
4040 * @fn gboolean bluetooth_opc_session_is_exist(void)
4041 * @brief Informs whether opc session exists or not.
4043 * This function is a synchronous call.
4045 * @return TRUE - OPC session exists \n
4046 * FALSE - OPC session does not exist \n
4054 gboolean bluetooth_opc_session_is_exist(void);
4057 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4058 * @brief Informs whether opc session exists or not.
4060 * This function is a synchronous call.
4062 * @return BLUETOOTH_ERROR_NONE - Success \n
4063 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4064 * BLUETOOTH_ERROR_INTERNAL \n
4067 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4072 int bluetooth_opc_is_sending(gboolean *is_sending);
4075 * @fn int bluetooth_obex_server_init(const char *dst_path)
4076 * @brief Initialize OPP and FTP server.
4078 * This function is a synchronous call.
4079 * No event corresponding to this api
4081 * @return BLUETOOTH_ERROR_NONE - Success \n
4082 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4083 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4084 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4085 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4088 * @param[in] dst_path OPS destination file path.
4090 * @see bluetooth_obex_server_deinit
4092 int bluetooth_obex_server_init(const char *dst_path);
4096 * @fn int bluetooth_obex_server_deinit(void)
4097 * @brief Deinitialize OPP and FTP server.
4099 * This function is a synchronous call.
4100 * No event corresponding to this api
4102 * @return BLUETOOTH_ERROR_NONE - Success \n
4103 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4104 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4109 * @see bluetooth_obex_server_init
4111 int bluetooth_obex_server_deinit(void);
4115 * @fn gboolean bluetooth_obex_server_is_activated(void)
4116 * @brief Informs whether obex server is activated or not.
4118 * This function is a synchronous call.
4120 * @return TRUE - OBEX server is activated \n
4121 * FALSE - OBEX server is not activated \n
4128 gboolean bluetooth_obex_server_is_activated(void);
4132 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4133 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4135 * This function is a synchronous call.
4136 * No event corresponding to this api
4138 * @return BLUETOOTH_ERROR_NONE - Success \n
4139 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4140 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4141 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4142 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4146 * @param[in] dst_path OPS destination file path.
4148 * @see bluetooth_obex_server_deinit_without_agent
4150 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4154 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4155 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4157 * This function is a synchronous call.
4158 * No event corresponding to this api
4160 * @return BLUETOOTH_ERROR_NONE - Success \n
4161 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4162 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4167 * @see bluetooth_obex_server_init_without_agent
4169 int bluetooth_obex_server_deinit_without_agent(void);
4173 * @fn int bluetooth_obex_server_accept_connection(void)
4174 * @brief Accepts the authorization request indicated by the event
4175 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4177 * This function is a synchronous call.
4179 * @return BLUETOOTH_ERROR_NONE - Success \n
4180 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4181 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4185 * @see bluetooth_obex_server_reject_authorize
4187 int bluetooth_obex_server_accept_connection(void);
4191 * @fn int bluetooth_obex_server_reject_connection(void)
4192 * @brief Rejects the authorization request indicated by the event
4193 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4195 * This function is a synchronous call.
4197 * @return BLUETOOTH_ERROR_NONE - Success \n
4198 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4199 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4203 * @see bluetooth_obex_server_reject_authorize
4205 int bluetooth_obex_server_reject_connection(void);
4209 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4210 * @brief Accepts the authorization request indicated by the event
4211 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4213 * This function is a asynchronous call.
4214 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4216 * @return BLUETOOTH_ERROR_NONE - Success \n
4217 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4218 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4219 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4222 * @param[in] filename Authorized filename.
4225 * @see bluetooth_obex_server_reject_authorize
4228 int bluetooth_obex_server_accept_authorize(const char *filename);
4231 * @fn int bluetooth_obex_server_reject_authorize(void)
4232 * @brief Reject the authorization request indicated by the event
4233 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4235 * This function is a asynchronous call.
4236 * No event for this api..
4238 * @return BLUETOOTH_ERROR_NONE - Success \n
4239 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4240 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4245 * @see bluetooth_obex_server_accept_authorize
4248 int bluetooth_obex_server_reject_authorize(void);
4251 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4252 * @brief Set the OPS destination file path..
4254 * This function is a asynchronous call.
4255 * No event for this api..
4257 * @return BLUETOOTH_ERROR_NONE - Success \n
4258 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4259 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4260 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4263 * @param[in] dst_path OPS destination file path.
4269 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4272 * @fn int bluetooth_obex_server_set_root(const char *root)
4273 * @brief Set the FTS root folder..
4275 * This function is a asynchronous call.
4276 * No event for this api..
4278 * @return BLUETOOTH_ERROR_NONE - Success \n
4279 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4280 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4281 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4282 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4283 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4286 * @param[in] root FTS root folder.
4292 int bluetooth_obex_server_set_root(const char *root);
4295 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4296 * @brief Cancel the transfer on server
4298 * This function is an asynchronous call.
4299 * If the function call that cancels transfer is successful, the application would receive
4300 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4301 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4302 * the error code will be BLUETOOTH_ERROR_NONE
4304 * @return BLUETOOTH_ERROR_NONE - Success \n
4305 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4306 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4307 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4308 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4311 * @param[in] transfer_id transfer ID
4316 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4320 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4321 * @brief Cancel the transfer on server
4323 * This function is an asynchronous call.
4324 * If the function call that cancels transfer is successful, the application would receive
4325 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4326 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4327 * the error code will be BLUETOOTH_ERROR_NONE
4329 * @return BLUETOOTH_ERROR_NONE - Success \n
4330 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4331 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4332 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4333 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4340 int bluetooth_obex_server_cancel_all_transfers(void);
4344 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4345 * @brief Informs whether obex server is receiving or not.
4347 * This function is a synchronous call.
4349 * @return BLUETOOTH_ERROR_NONE - Success \n
4350 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4351 * BLUETOOTH_ERROR_INTERNAL \n
4354 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4359 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4363 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4364 * @brief Read the local Hash and Randmizer.
4366 * This function is a synchronous call.
4368 * @return BLUETOOTH_ERROR_NONE - Success \n
4369 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4373 * @param[out] local_oob_data - Pointer to the local OOB data
4379 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4383 * @fn int bluetooth_oob_add_remote_data(
4384 * const bluetooth_device_address_t *remote_device_address,
4385 * bt_oob_data_t *oob_data)
4386 * @brief Add/updated the remote device Hash and Randmizer.
4388 * This function is a synchronous call.
4389 * No event for this api..
4391 * @return BLUETOOTH_ERROR_NONE - Success \n
4392 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4395 * @param[in] remote_device_address - Remote device address
4396 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4402 int bluetooth_oob_add_remote_data(
4403 const bluetooth_device_address_t *remote_device_address,
4404 bt_oob_data_t *remote_oob_data);
4408 * @fn int bluetooth_oob_remove_remote_data(
4409 * const bluetooth_device_address_t *remote_device_address)
4410 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4412 * This function is a synchronous call.
4413 * No event for this api..
4415 * @return BLUETOOTH_ERROR_NONE - Success \n
4416 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4419 * @param[in] remote_device_address - Remote device address
4425 int bluetooth_oob_remove_remote_data(
4426 const bluetooth_device_address_t *remote_device_address);
4429 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4430 * bt_gatt_handle_info_t *prim_svc);
4432 * @brief Gets the GATT based primary services handle supported by remote device
4434 * This function is a synchronous call.
4435 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4437 * @return BLUETOOTH_ERROR_NONE - Success \n
4438 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4439 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4440 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4443 * @param[in] address - Remote device address
4444 * @param[out] prim_svc - Structure containing remote service count and handle list.
4447 * @see bluetooth_gatt_free_primary_services()
4449 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4450 bt_gatt_handle_info_t *prim_svc);
4453 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4455 * @brief Discovers the characteristics of GATT based service of remote device
4457 * This function is an asynchronous call.
4458 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4460 * @return BLUETOOTH_ERROR_NONE - Success \n
4461 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4462 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4463 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4466 * @param[in] service_handle - Handle for remote service.
4471 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4474 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4475 * bt_gatt_service_property_t *service);
4477 * @brief Gets the properties of GATT based service of remote device
4479 * This function is a synchronous call.
4480 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4482 * @return BLUETOOTH_ERROR_NONE - Success \n
4483 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4484 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4485 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4488 * @param[in] service_handle - Handle for remote service.
4489 * @param[out] service - Structure containing remote service property.
4492 * @see bluetooth_gatt_free_service_property()
4494 int bluetooth_gatt_get_service_property(const char *service_handle,
4495 bt_gatt_service_property_t *service);
4498 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4500 * @brief Register to GATT based service to receive value change notification/indication.
4502 * This function is a synchronous call.
4503 * No event for this api.
4505 * @return BLUETOOTH_ERROR_NONE - Success \n
4506 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4507 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4508 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4511 * @param[in] service_handle - Handle for remote service.
4516 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4519 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4521 * @brief Unregister GATT based service to receive value change notification/indication.
4523 * This function is a synchronous call.
4524 * No event for this api.
4526 * @return BLUETOOTH_ERROR_NONE - Success \n
4527 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4528 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4529 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4532 * @param[in] service_handle - Handle for remote service.
4537 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4540 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4541 * bt_gatt_char_property_t *characteristic);
4543 * @brief Provides characteristic value along with properties.
4545 * This function is a synchronous call.
4546 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4548 * @return BLUETOOTH_ERROR_NONE - Success \n
4549 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4550 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4551 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4554 * @param[in] char_handle - Handle for Characteristic property.
4555 * @param[out] characteristic - Structure containing remote characteristic property.
4558 * @see bluetooth_gatt_free_char_property()
4560 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4561 bt_gatt_char_property_t *characteristic);
4564 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4565 * bt_gatt_char_property_t *characteristic);
4567 * @brief Provides characteristic descriptor value along with its UUID.
4569 * This function is a synchronous call.
4570 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4572 * @return BLUETOOTH_ERROR_NONE - Success \n
4573 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4574 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4575 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4578 * @param[in] desc_handle - Handle for Characteristic descriptor.
4579 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4582 * @see bluetooth_gatt_free_desc_property()
4584 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4585 bt_gatt_char_descriptor_property_t *descriptor);
4589 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4590 * const guint8 *value, int length)
4592 * @brief Set characteristic value.
4594 * This function is a synchronous call.
4596 * @return BLUETOOTH_ERROR_NONE - Success \n
4597 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4598 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4599 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4602 * @param[in] char_handle - Handle for Characteristic property.
4603 * @param[in] value - New value to set for characteristic property.
4604 * @param[in] length - Length of the value to be set.
4609 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4610 const guint8 *value, int length);
4613 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4614 * const guint8 *value, int length, guint8 write_type)
4616 * @brief Set characteristic value by write type.
4618 * This function is a synchronous call if write type is "write without resonse"
4619 * and it is an asynchronous call if write type is "write with response"
4621 * @return BLUETOOTH_ERROR_NONE - Success \n
4622 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4623 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4624 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4627 * @param[in] char_handle - Handle for Characteristic property.
4628 * @param[in] value - New value to set for characteristic property.
4629 * @param[in] length - Length of the value to be set.
4630 * @param[in] write_type - Type of write.
4635 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4636 const guint8 *value, int length, guint8 write_type);
4640 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4641 * const guint8 *value, int length)
4643 * @brief Set characteristic value request.
4645 * This function is an asynchronous call.
4647 * @return BLUETOOTH_ERROR_NONE - Success \n
4648 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4649 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4650 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4653 * @param[in] char_handle - Handle for Characteristic property.
4654 * @param[in] value - New value to set for characteristic property.
4655 * @param[in] length - Length of the value to be set.
4660 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4661 const guint8 *value, int length);
4664 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4666 * @brief Read characteristic value.
4668 * This function is a asynchronous call.
4670 * @return BLUETOOTH_ERROR_NONE - Success \n
4671 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4672 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4673 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4676 * @param[in] char_handle - Handle for Characteristic property.
4681 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
4684 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4685 * const char *service_uuid,
4686 * bt_gatt_service_property_t *service)
4688 * @brief Gets the service property from a device based on a particular uuid
4690 * This function is a synchronous call.
4692 * @return BLUETOOTH_ERROR_NONE - Success \n
4693 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4694 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4695 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4698 * @param[in] address - BD address of the remote device
4699 * @param[in] service_uuid - uuid of the service.
4700 * @param[out] service - Structure containing the service property.
4705 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4706 const char *service_uuid,
4707 bt_gatt_service_property_t *service);
4710 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4711 * const char *char_uuid)
4713 * @brief Gets the characteristic property from a service based on a particular char uuid
4715 * This function is an asynchronous call.
4716 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
4718 * @return BLUETOOTH_ERROR_NONE - Success \n
4719 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4720 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4721 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4724 * @param[in] service_handle - Service handle.
4725 * @param[in] uuid - Characteristic uuid.
4730 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4731 const char *char_uuid);
4734 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4736 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
4738 * This function is a synchronous call.
4739 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
4741 * @return BLUETOOTH_ERROR_NONE - Success \n
4742 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4745 * @param[in] prim_svc - GATT handle info structure
4748 * @see bluetooth_gatt_get_primary_services()
4750 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4753 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4755 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
4757 * This function is a synchronous call.
4758 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
4760 * @return BLUETOOTH_ERROR_NONE - Success \n
4761 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4764 * @param[in] svc_pty - GATT service property structure.
4767 * @see bluetooth_gatt_get_service_property()
4769 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4772 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4774 * @brief Provides characteristic value along with properties.
4776 * This function is a synchronous call.
4777 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4779 * @return BLUETOOTH_ERROR_NONE - Success \n
4780 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4783 * @param[in] char_pty - GATT characteristics property structure.
4786 * @see bluetooth_gatt_get_characteristics_property()
4788 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4791 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4793 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
4795 * This function is a synchronous call.
4796 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
4798 * @return BLUETOOTH_ERROR_NONE - Success \n
4799 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4802 * @param[in] desc_pty - GATT characteristics descriptor property structure.
4805 * @see bluetooth_gatt_get_char_descriptor_property()
4807 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4810 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
4812 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
4815 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4817 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
4819 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4821 * @return BLUETOOTH_ERROR_NONE - Success \n
4822 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4825 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
4829 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4832 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
4834 * @brief Read characteristic descriptor value.
4836 * This function is a asynchronous call.
4838 * @return BLUETOOTH_ERROR_NONE - Success \n
4839 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4840 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4841 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4844 * @param[in] desc_handle - Handle for Characteristic descriptor
4849 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
4852 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4853 * const guint8 *value, int length);
4855 * @brief Set characteristic descriptor value.
4857 * This function is a asynchronous call.
4859 * @return BLUETOOTH_ERROR_NONE - Success \n
4860 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4861 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4862 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4865 * @param[in] desc_handle - Handle for Characteristic descriptor
4866 * @param[in] value - New value to set for characteristic descriptor
4867 * @param[in] length - Length of the value to be set.
4872 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4873 const guint8 *value, int length);
4875 /* @fn int bluetooth_gatt_init(void)
4877 * @brief Initializes the gatt service.
4879 * This function is a synchronous call.
4880 * @return BLUETOOTH_ERROR_NONE - Success \n
4881 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4882 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4883 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4886 * @remark Adapter should be enabled
4887 * @see bluetooth_gatt_deinit()
4889 int bluetooth_gatt_init(void);
4891 /* @fn int bluetooth_gatt_init(void)
4893 * @brief DeInitializes the gatt service.
4895 * This function is a synchronous call.
4896 * @return BLUETOOTH_ERROR_NONE - Success \n
4897 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4898 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4899 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4902 * @remark Adapter should be enabled
4903 * @see bluetooth_gatt_init()
4905 int bluetooth_gatt_deinit(void);
4907 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
4908 unsigned char **svc_path)
4910 * @brief Exports a new gatt service to the service interface.
4912 * This function is a synchronous call.
4914 * @return BLUETOOTH_ERROR_NONE - Success \n
4915 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4916 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4917 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4920 * @param[in] svc_uuid Gatt service uuid.
4921 * @param[out] svc_path service object path of the exported service.
4922 * @remark Adapter should be enabled
4923 * @see bluetooth_gatt_init()
4925 int bluetooth_gatt_add_service(const char *svc_uuid,
4928 /* @fn int bluetooth_gatt_add_new_characteristic(
4929 const char *svc_path, const char *char_uuid,
4930 bt_gatt_characteristic_property_t *properties,
4931 int flags_length, char **char_path);;
4933 * @brief Exports a new gatt characteristic to the characteristic interface.
4935 * This function is a synchronous call.
4936 * @return BLUETOOTH_ERROR_NONE - Success \n
4937 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4938 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4939 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4941 * @param[in] svc_path service object path of the exported service.
4942 * @param[in] char_uuid Gatt service uuid.
4943 * @param[in] properties GATT characteristic properties.
4944 * @param[out] char_path characteristic object path of the exported characteristic.
4946 * @remark Adapter should be enabled
4947 * @see bluetooth_gatt_add_service()
4949 int bluetooth_gatt_add_new_characteristic(
4950 const char *svc_path, const char *char_uuid,
4951 bt_gatt_characteristic_property_t properties,
4954 /* @fn bluetooth_gatt_set_characteristic_value(
4955 const char *characteristic, const char *char_value,
4958 * @brief adds gatt charactertisic value to the given charactertistic path.
4960 * This function is a synchronous call.
4961 * @return BLUETOOTH_ERROR_NONE - Success \n
4962 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4963 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4964 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4966 * @param[in] char_value Value of the GATT characteristic to be added.
4967 * @param[in] value_length length of the chantacteristic value..
4968 * @param[out] characteristic characteristic object path..
4970 * @remark Adapter should be enabled
4971 * @see bluetooth_gatt_add_service()
4973 int bluetooth_gatt_set_characteristic_value(
4974 const char *characteristic, const char *char_value,
4977 /* @fn int bluetooth_gatt_add_descriptor(const char *desc_uuid,
4978 const char *desc_value, int value_length,
4979 const char *permissions, const char *char_path,
4982 * @brief Exports a new gatt descriptor to the descriptor interface.
4984 * This function is a synchronous call.
4986 * @return BLUETOOTH_ERROR_NONE - Success \n
4987 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4988 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4989 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4992 * @param[in] desc_uuid Gatt descriptor uuid.
4993 * @param[in] desc_value GATT descriptor value.
4994 * @param[in] value_length Length of GATT descriptor value.
4995 * @param[in] permissions descriptor permissions.
4996 * @param[in] char_path characteristics object path of the exported character.
4998 * @remark Adapter should be enabled
4999 * @see bluetooth_gatt_add_service()
5000 * @see bluetooth_gatt_add_characteristics()
5002 int bluetooth_gatt_add_descriptor(const char *char_path,
5003 const char *desc_uuid,
5006 /* @fn int bluetooth_gatt_set_descriptor_value(
5007 const char *desc_path, const char *desc_value,
5010 * @brief Adds value to the given descriptor handle.
5012 * This function is a synchronous call.
5014 * @return BLUETOOTH_ERROR_NONE - Success \n
5015 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5016 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5017 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5020 * @param[in] desc_value GATT descriptor value.
5021 * @param[in] value_length Length of GATT descriptor value.
5022 * @param[in] desc_path descriptor path to which the value needs to be added.
5024 * @remark Adapter should be enabled
5025 * @see bluetooth_gatt_add_service()
5026 * @see bluetooth_gatt_add_characteristics()
5028 int bluetooth_gatt_set_descriptor_value(
5029 const char *desc_path, const char *desc_value,
5032 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5034 * @brief Reads the Service registered on manager interface.
5036 * This function is a synchronous call.
5038 * @return BLUETOOTH_ERROR_NONE - Success \n
5039 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5040 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5041 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5044 * @param[in] svc_uuid Gatt Service uuid.
5046 * @remark Adapter should be enabled and service should be registered.
5047 * @see bluetooth_gatt_register_service()
5049 int bluetooth_gatt_get_service(const char *svc_uuid);
5051 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5053 * @brief Registers the given service path with the bluez gatt server.
5055 * This function is a synchronous call.
5057 * @return BLUETOOTH_ERROR_NONE - Success \n
5058 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5059 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5060 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5063 * @param[in] svc_path service object path of the exported service.
5065 * @remark Adapter should be enabled
5066 * @see bluetooth_gatt_add_service()
5067 * @see bluetooth_gatt_add_characteristics()
5068 * @see bluetooth_gatt_add_descriptor()
5070 int bluetooth_gatt_register_service(const char *svc_path);
5072 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5074 * @brief Removes(unregister) service from the bluez gatt server db.
5076 * This function is a synchronous call.
5078 * @return BLUETOOTH_ERROR_NONE - Success \n
5079 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5080 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5081 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5084 * @param[in] svc_path service object path of the exported service.
5086 * @remark Adapter should be enabled
5087 * @see bluetooth_gatt_add_service()
5088 * @see bluetooth_gatt_add_characteristics()
5089 * @see bluetooth_gatt_add_descriptor()
5090 * @see bluetooth_gatt_register_service()
5092 int bluetooth_gatt_unregister_service(const char *svc_path);
5094 /* @fn int bluetooth_gatt_send_response(int request_id,
5095 * int offset, char *value, int value_length)
5097 * @brief Updates the attribute value in local attribute list.
5099 * This function is a synchronous call.
5101 * @return BLUETOOTH_ERROR_NONE - Success \n
5102 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5103 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5107 * @param[in] request_id The identification of a read request
5108 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5109 * @param[in] resp_state The identification of response state
5110 * @param[in] offset The offset from where a value is read
5111 * @param[in] value The value to be sent. It will be sent from @a offset.
5112 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5113 * @param[in] value_length Value Length.
5115 * @remark Adapter should be enabled
5116 * @see bluetooth_gatt_add_service()
5117 * @see bluetooth_gatt_add_characteristics()
5118 * @see bluetooth_gatt_add_descriptor()
5119 * @see bluetooth_gatt_register_service()
5121 int bluetooth_gatt_send_response(int request_id, guint req_type,
5122 int resp_state, int offset, char *value, int value_length);
5124 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5126 * @brief Sets the notification property for a characteristic.
5128 * This function is a synchronous call.
5130 * @return BLUETOOTH_ERROR_NONE - Success \n
5131 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5132 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5133 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5136 * @param[in] char_path characteristic object path.
5137 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5139 * @remark Adapter should be enabled
5140 * @see bluetooth_gatt_update_characteristic()
5142 int bluetooth_gatt_server_set_notification(const char *char_path,
5143 bluetooth_device_address_t *unicast_address);
5145 /* @fn int bluetooth_gatt_delete_services(void)
5147 * @brief deletes (unregisters) all services from the gatt server database..
5149 * This function is a synchronous call.
5151 * @return BLUETOOTH_ERROR_NONE - Success \n
5152 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5153 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5154 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5158 * @remark Adapter should be enabled
5159 * @see bluetooth_gatt_add_service()
5160 * @see bluetooth_gatt_add_characteristics()
5161 * @see bluetooth_gatt_add_descriptor()
5162 * @see bluetooth_gatt_register_service()
5163 * @see bluetooth_gatt_unregister_service()
5165 int bluetooth_gatt_delete_services(void);
5167 /* @fn int bluetooth_gatt_update_characteristic(void)
5169 * @brief updates the given characteristic with a new value
5171 * This function is a synchronous call.
5173 * @return BLUETOOTH_ERROR_NONE - Success \n
5174 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5175 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5176 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5180 * @remark Adapter should be enabled
5181 * @see bluetooth_gatt_add_service()
5182 * @see bluetooth_gatt_add_characteristics()
5183 * @see bluetooth_gatt_add_descriptor()
5184 * @see bluetooth_gatt_register_service()
5185 * @see bluetooth_gatt_unregister_service()
5187 int bluetooth_gatt_update_characteristic(const char *char_path,
5188 const char* char_value, int value_length);
5191 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5193 * @brief Set advertising status.
5195 * This function is used to enable or disable LE advertising.
5196 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5198 * This function is a synchronous call.
5200 * @return BLUETOOTH_ERROR_NONE - Success \n
5201 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5202 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5205 * @param[in] enable - The status of advertising
5208 * @see bluetooth_set_advertising_data
5210 int bluetooth_set_advertising(int handle, gboolean enable);
5213 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5215 * @brief Set advertising status along with interval value.
5217 * This function is used to enable or disable LE advertising.
5218 * Interval_min and Interval_max is used to set the best advertising interval.
5219 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5221 * This function is a synchronous call.
5223 * @return BLUETOOTH_ERROR_NONE - Success \n
5224 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5225 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5228 * @param[in] enable - The status of advertising
5229 * @param[in] interval_min - Minimum interval of advertising (msec)
5230 * @param[in] interval_max - Maximum interval of advertising (msec)
5231 * @param[in] filter_policy - Advertising filter policy
5234 * @see bluetooth_set_advertising_data
5236 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5237 bluetooth_advertising_params_t *params);
5240 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5241 * @brief Get the advertising data
5243 * This function is used to get advertising data.
5244 * Before calling this API, the adapter should be enabled.
5246 * This function is a synchronous call.
5248 * @return BLUETOOTH_ERROR_NONE - Success \n
5249 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5250 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5251 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5253 * @param[out] value - Advertising data structure.
5254 * @param[out] length - The length of Advertising data.
5258 bluetooth_advertising_data_t *value = { {0} };
5261 ret = bluetooth_get_advertising_data(&value, &length);
5264 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5267 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5269 * @brief Set advertising data with value
5271 * This function is used to set advertising data and Maximum size of advertising data
5272 * is 28 byte (Except Flag)
5274 * This function is a synchronous call.
5276 * @return BLUETOOTH_ERROR_NONE - Success \n
5277 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5278 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5281 * @param[in] value - Advertising data structure.
5285 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5288 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5290 * @brief Check the privilege for advertising parameter setting
5292 * This function is a synchronous call.
5294 * @return BLUETOOTH_ERROR_NONE - Success \n
5295 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5301 int bluetooth_check_privilege_advertising_parameter(void);
5304 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5305 * @brief Get the LE scan response data
5307 * This function is used to get scan response data.
5308 * Before calling this API, the adapter should be enabled.
5310 * This function is a synchronous call.
5312 * @return BLUETOOTH_ERROR_NONE - Success \n
5313 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5314 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5315 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5317 * @param[out] value - Scan response data structure.
5318 * @param[out] length - The length of Scan response data.
5322 bluetooth_scan_resp_data_t *value = { {0} };
5325 ret = bluetooth_get_scan_response_data(&value, &length);
5328 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5331 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5333 * @brief Set scan response data with value
5335 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5337 * This function is a synchronous call.
5339 * @return BLUETOOTH_ERROR_NONE - Success \n
5340 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5341 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5344 * @param[in] value - LE Scan response data structure.
5348 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5351 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5353 * @brief Set scan interval and window
5355 * This function is used to set LE scan interval and window size
5357 * This function is a synchronous call.
5359 * @return BLUETOOTH_ERROR_NONE - Success \n
5360 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5361 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5364 * @param[in] interval - Interval of LE scan (msec)
5365 * @param[in] window - Window size of LE scan (msec)
5369 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5372 * @fn int bluetooth_is_advertising(void)
5373 * @brief Check for the advertising is in-progress or not.
5375 * This API is used to check the current status of the advertising procedure.
5376 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5379 * This function checks whether the advertising is started or not.
5381 * This function is a synchronous call.
5383 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5385 * @return BLUETOOTH_ERROR_NONE - Success \n
5386 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5389 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5393 gboolean is_advertising = 0;
5395 ret = bluetooth_is_advertising(&is_advertising);
5398 int bluetooth_is_advertising(gboolean *is_advertising);
5401 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5402 * @brief Add LE device to white list
5404 * This API is used to add LE device to white list
5405 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5409 * This function is a synchronous call.
5411 * @param[in] address The address of remote device
5413 * @return BLUETOOTH_ERROR_NONE - Success \n
5414 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5417 * @see bluetooth_set_custom_advertising
5419 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5422 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5423 * @brief Remove LE device from white list
5425 * This API is used to remove LE device from white list
5426 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5430 * This function is a synchronous call.
5432 * @param[in] address The address of remote device
5434 * @return BLUETOOTH_ERROR_NONE - Success \n
5435 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5438 * @see bluetooth_set_custom_advertising
5440 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5443 * @fn int bluetooth_clear_white_list(void)
5444 * @brief Clear white list
5446 * This API is used to clear white list
5447 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5451 * This function is a synchronous call.
5453 * @param[in] address The address of remote device
5455 * @return BLUETOOTH_ERROR_NONE - Success \n
5456 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5459 * @see bluetooth_set_custom_advertising
5461 int bluetooth_clear_white_list(void);
5464 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5465 * const bluetooth_le_connection_param_t *parameters)
5466 * @brief update connection paramter of LE connection.
5468 * This function is a synchronous call.
5470 * @return BLUETOOTH_ERROR_NONE - Success \n
5471 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5474 * @param[in] address - remote device address value.
5475 * @param[in] parameters - new connection parameters.
5478 * @see bluetooth_bond_device
5480 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5481 const bluetooth_le_connection_param_t *parameters);
5485 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5487 * @brief Enable/Disable LE Privacy feature.
5489 * This function is used to enable or disable LE Privacy feature.
5490 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5492 * This function is a synchronous call.
5494 * @return BLUETOOTH_ERROR_NONE - Success \n
5495 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5496 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5499 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5503 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5506 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
5507 * bluetooth_le_connection_mode_t mode)
5508 * @brief update connection paramter of LE connection.
5510 * This function is a synchronous call.
5512 * @return BLUETOOTH_ERROR_NONE - Success \n
5513 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5514 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5517 * @param[in] address - remote device address value.
5518 * @param[in] mode - new connection mode.
5522 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
5523 bluetooth_le_connection_mode_t mode);
5526 * @fn int bluetooth_le_read_maximum_data_length()
5527 * @brief reads the maximum LE data length supported in the controller.
5529 * This function is a synchronous call.
5531 * @return BLUETOOTH_ERROR_NONE - Success \n
5532 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5538 int bluetooth_le_read_maximum_data_length(
5539 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
5541 * @fn int bluetooth_le_write_host_suggested_default_data_length()
5542 * @brief writes the host suggested values for the controllers max transmitted no of payload
5543 * octects to be used for new connections.
5545 * This function is a synchronous call.
5547 * @return BLUETOOTH_ERROR_NONE - Success \n
5548 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5554 int bluetooth_le_write_host_suggested_default_data_length(
5555 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
5557 int bluetooth_le_read_suggested_default_data_length(
5558 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
5560 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
5561 const unsigned int max_tx_octets, const unsigned int max_tx_time);
5563 int bluetooth_pbap_init(void);
5564 int bluetooth_pbap_deinit(void);
5565 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
5566 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
5567 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
5568 bt_pbap_folder_t *folder);
5569 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
5570 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
5571 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
5572 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
5573 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
5574 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
5575 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
5576 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
5579 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5581 * @brief Set manufacturer data with value
5583 * This function is used to set manufacturer data.
5585 * This function is a synchronous call.
5587 * @return BLUETOOTH_ERROR_NONE - Success \n
5588 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5589 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5592 * @param[in] value - Manufacturer data structure.
5596 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5603 #endif /* __cplusplus */
5604 #endif /* _BLUETOOTH_API_H_*/