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;
1544 main_loop = g_main_loop_new(NULL, FALSE);
1545 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1546 if (ret >= BLUETOOTH_ERROR_NONE)
1548 // bluetooth_register_callback returned Success
1552 // bluetooth_register_callback returned failiure
1554 g_main_loop_run(main_loop);
1558 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1561 * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1562 * @brief Set the callback function pointer for bluetooth le event
1565 * This API will register the callback function, when any response and event are received from
1566 * bluetooth framework. @n
1567 * this registered callback function will be get called with appropriate event and data structures.
1568 * This function is a synchronous call. An application developer can call
1569 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1570 * type. This registered function will receive events of bluetooth_event_type_t type along with
1574 * @param[in] callback_ptr A pointer to the callback function
1575 * @param[in] user_data A pointer to user data
1576 * @return BLUETOOTH_ERROR_NONE - Success
1580 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1583 * @fn int bluetooth_le_unregister_callback(void)
1584 * @brief Set the callback function pointer for bluetooth le event
1587 * This API will register the callback function, when any response and event are received from
1588 * bluetooth framework. @n
1589 * this registered callback function will be get called with appropriate event and data structures.
1590 * This function is a synchronous call. An application developer can call
1591 * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1592 * type. This registered function will receive events of bluetooth_event_type_t type along with
1597 * @return BLUETOOTH_ERROR_NONE - Success
1601 int bluetooth_le_unregister_callback(void);
1604 * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1605 * @brief Set the callback function pointer for bluetooth event
1608 * This API will register the callback function, when any response and event are received from
1609 * bluetooth framework. @n
1610 * this registered callback function will be get called with appropriate event and data structures.
1611 * This function is a synchronous call. An application developer can call
1612 * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1613 * type. This registered function will receive events of bluetooth_event_type_t type along with
1618 * @return BLUETOOTH_ERROR_NONE - Success
1622 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1624 GMainLoop *main_loop = (GMainLoop*) user_data;
1628 // Code for each event
1630 g_main_loop_quit(main_loop);
1637 GMainLoop *main_loop = NULL;
1640 main_loop = g_main_loop_new(NULL, FALSE);
1641 ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1642 if (ret >= BLUETOOTH_ERROR_NONE)
1644 // bluetooth_register_callback returned Success
1648 // bluetooth_register_callback returned failiure
1650 ret = bluetooth_deregister_callback(void);
1651 g_main_loop_run(main_loop);
1655 int bluetooth_unregister_callback(void);
1658 * @fn int bluetooth_enable_adapter(void)
1659 * @brief Enable the Bluetooth H/W
1662 * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1663 * send request to bluetooth chip for activation.
1664 * This function is typically called at startup or when Bluetooth services are required. This
1665 * function must be called before calling any other API of Bluetooth operations.
1667 * Before performing any operations like Device discover, service search etc.., the adapter must be
1670 * This function is a asynchronous call.
1671 * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1672 * through registered callback function with appropriate result code
1673 * BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1674 * BLUETOOTH_ERROR_NONE - Success \n
1676 * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1677 * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1679 * @return BLUETOOTH_ERROR_NONE - Success\n
1680 * BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1681 * BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1682 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1683 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1685 * @see bluetooth_check_adapter, bluetooth_disable_adapter
1687 void bt_event_callback(int event, bluetooth_event_param_t *param)
1691 case BLUETOOTH_EVENT_ENABLED:
1692 if (param->result == BLUETOOTH_ERROR_NONE)
1694 // Successfully Enabled
1707 ret = bluetooth_enable_adapter();
1711 int bluetooth_enable_adapter(void);
1714 * @fn int bluetooth_disable_adapter(void)
1715 * @brief Disable the Bluetooth H/W
1718 * This function disables Bluetooth protocol stack and hardware. This function is called when
1719 * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1721 * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1722 * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1723 * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1725 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1728 * This function is a asynchronous call.
1729 * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1730 * through registered callback function.
1733 * @return BLUETOOTH_ERROR_NONE - Success\n
1734 * BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1735 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1736 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1738 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1740 void bt_event_callback(int event, bluetooth_event_param_t *param)
1744 case BLUETOOTH_EVENT_DISABLED:
1745 if (param->result == BLUETOOTH_ERROR_NONE)
1747 // Successfully disabled
1760 ret = bluetooth_disable_adapter();
1763 int bluetooth_disable_adapter(void);
1764 int bluetooth_recover_adapter(void);
1765 int bluetooth_check_adapter_le(void);
1766 int bluetooth_enable_adapter_le(void);
1768 int bluetooth_disable_adapter_le(void);
1771 * @fn int bluetooth_reset_adapter(void)
1772 * @brief Reset the Bluetooth H/W and values
1775 * This function resets Bluetooth protocol stack and hardware. This function is called when
1776 * an user want to initialize Bluetooth environment.
1778 * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1781 * This function is a synchronous call.
1783 * @return BLUETOOTH_ERROR_NONE - Success\n
1784 * @exception BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1786 * @see bluetooth_check_adapter, bluetooth_enable_adapter
1791 ret = bluetooth_reset_adapter();
1794 int bluetooth_reset_adapter(void);
1797 * @fn int bluetooth_is_supported(void)
1798 * @brief Check if the bluetooth is supported or not by the current target
1800 * This API checks whether the bluetooth is supported or not.
1801 * This API only run by root permission.
1803 * This function is a synchronous call.
1805 * @return 0 - if bluetooth is not supported\n
1806 * 1 - if bluetooth is supported\n
1807 * BLUETOOTH_ERROR_INTERNAL - Error in API internal
1812 ret = bluetooth_is_supported();
1815 int bluetooth_is_supported(void);
1819 * @fn int bluetooth_check_adapter(void)
1820 * @brief Check the current status of the Bluetooth adapter
1823 * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
1824 * the bluetooth adapter should be enabled. This API helps to find out the current state of the
1825 * bluetooth adapter.
1826 * This API get the adapter internal data structure and check current adapter status.
1828 * This function is a synchronous call.
1831 * @return BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
1832 * BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
1834 * @see bluetooth_enable_adapter, bluetooth_disable_adapter
1838 ret = bluetooth_check_adapter();
1841 int bluetooth_check_adapter(void);
1844 * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
1845 * @brief Get the local adapter bluetooth address
1848 * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
1849 * the adapter should be enabled.
1850 * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
1851 * contain Bluetooth address.
1852 * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
1853 * friendly name for each device.
1854 * There is no event callback for this API.
1856 * This function is a synchronous call.
1859 * @return BLUETOOTH_ERROR_NONE - Succeess \n
1860 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
1861 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
1862 * @param[out] local_address a device address of local bluetooth adapter
1867 bluetooth_device_address_t local_address={0,};
1870 ret = bluetooth_get_local_address(&local_address);
1873 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
1876 * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
1877 * @brief Get the hci version
1880 * This function is used to get the bluetooth hci version
1881 * Before calling this API make sure that the adapter is enabled.
1883 * This function is a synchronous call.
1886 * @return BLUETOOTH_ERROR_NONE - Success \n
1887 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1888 * @param[out] timeout remain visibility timeout value
1891 bluetooth_version_t *version;
1893 ret = bluetooth_get_local_version (&version);
1896 int bluetooth_get_local_version(bluetooth_version_t *version);
1899 * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
1900 * @brief Get the local device name
1903 * This function is used, get the local device name. Since its difficult to remember the Adapter
1904 * address, the friendly name can be assigned to the adapter and we can get it using this API. This
1905 * friendly name is retrived by the remote device and displaying.
1906 * Before calling this API, the adapter should be enabled. There is no event callback for this API.
1908 * This function is a synchronous call.
1911 * @return BLUETOOTH_ERROR_NONE - Success \n
1912 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
1913 * @param[out] local_name a local device name
1917 bluetooth_device_name_t local_name={0,}
1919 ret = bluetooth_get_local_name (&local_name);
1922 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
1925 * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
1926 * @brief Set the local device name
1929 * This function is used to set the local device name. This is a human friendly name whose
1930 * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
1932 * This function is a synchronous call.
1934 * @param[in] local_name bluetooth device name to set local device
1936 * @return BLUETOOTH_ERROR_NONE - Success \n
1937 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1938 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1939 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
1940 * BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
1941 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1946 bluetooth_device_name_t local_name={0,}
1948 ret = bluetooth_set_local_name (&local_name);
1951 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
1955 * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
1956 * @brief Check if the uuid is used or not
1958 * This function is used to check if the uuid is used or not.
1960 * This function is a synchronous call.
1962 * @param[in] service_uuid service uuid (UUID 128 bit as string)
1963 * @param[out] used if the uuid is used or not
1965 * @return BLUETOOTH_ERROR_NONE - Success \n
1966 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1967 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1968 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1973 gboolean used = FALSE;
1974 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
1975 ret = bluetooth_is_service_used(uuid, &used);
1978 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
1981 * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
1982 * @brief Check if the device is connected to the specific service
1984 * This function is used to check if if the device is connected to the specific service.
1986 * This function is a synchronous call.
1988 * @param[in] local_address a device address of remote bluetooth device
1989 * @param[in] type the service type
1990 * @param[out] is_connected if the device is connected or not
1992 * @return BLUETOOTH_ERROR_NONE - Success \n
1993 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1994 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1995 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2000 gboolean is_connected = FALSE;
2001 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2002 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2005 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2006 bluetooth_service_type_t type,
2007 gboolean *is_connected);
2010 * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2011 * @brief Gets device's connected link type
2013 * This function is used to get device's connected link type
2015 * This function is a synchronous call.
2017 * @param[in] device_address a device address of remote bluetooth device
2018 * @param[out] connected_link a device's connected link type
2020 * @return BLUETOOTH_ERROR_NONE - Success \n
2021 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2022 * BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2023 * BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2028 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2029 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2030 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2033 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2034 bluetooth_connected_link_t *connected_link);
2037 * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2038 * @brief Get the visibility mode
2041 * This function is used to get the discoverable mode (Visibility option). Depending upon the
2042 * visibity mode, the property of the device is determined whether it can be discoverable, non
2043 * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2045 * This function is a synchronous call.
2048 * @return BLUETOOTH_ERROR_NONE - Success \n
2049 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2050 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2051 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2052 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2053 * @param[out] discoverable_mode current bluetooth discoverable mode
2055 * @see bluetooth_set_discoverable_mode
2057 bluetooth_discoverable_mode_t discoverable_mode_ptr;
2059 ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2062 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2065 * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2067 * @brief Set the visibility mode
2070 * This function is used to set the discoverable mode (Visibility option).
2072 * Many times user may want to keep his device discoverable so that when peer device is performing
2073 * device search, he/she can find user's device. Application programmer can keep the mode as
2074 * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2075 * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2076 * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2077 * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2079 * This function is a synchronous call.
2081 * @return BLUETOOTH_ERROR_NONE - Success \n
2082 * BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2084 * @param[in] discoverable_mode the bluetooth discoverable mode to set
2085 * @param[in] timeout discoverable time in only limited discoverable mode (second), default: 0
2087 * @see bluetooth_get_discoverable_mode
2091 bluetooth_discoverable_mode_t mode;
2093 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2094 ret = bluetooth_set_discoverable_mode (mode, 180);
2098 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2103 * @fn int bluetooth_get_timeout_value(int *timeout)
2104 * @brief Get the visibility timeout value
2107 * This function is used to get the visibility timeout
2108 * Before calling this API make sure that the adapter is enabled.
2110 * This function is a synchronous call.
2113 * @return BLUETOOTH_ERROR_NONE - Success \n
2114 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2115 * BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2116 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2117 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2118 * @param[out] timeout remain visibility timeout value
2120 * @see bluetooth_set_discoverable_mode
2124 ret = bluetooth_get_timeout_value (&timeout);
2127 int bluetooth_get_timeout_value(int *timeout);
2131 * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2132 * unsigned int classOfDeviceMask)
2133 * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2135 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2136 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2137 * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2138 * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2139 * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2140 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2141 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2142 * please see bluetooth_device_info_t for more details.
2145 * This API provides searching options like max responses, discovery duration in seconds and class
2146 * of device mask to filter device search. some times there may be too many bluetooth devices in
2147 * vicinity of your device.in such scenario, application can request to reduce number of responces
2148 * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2149 * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2150 * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2151 * application defined time. please note that discovery_duration should be mentioned in seconds.
2152 * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2155 * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2156 * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2157 * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2159 * This function is a asynchronous call.
2160 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2161 * through registered callback function.
2163 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2164 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2166 * The completion or cancellation of the discovery is indicated by an
2167 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2169 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2172 * @return BLUETOOTH_ERROR_NONE - Success \n
2173 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2174 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2175 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2176 agent is not running \n
2178 * @param[in] max_response define the maximum response of the number of founded devices
2180 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2181 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2182 (refer to class of device)
2184 * @see bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2187 void bt_event_callback(int event, bluetooth_event_param_t *param)
2191 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2193 bluetooth_device_info_t *device_info = NULL;
2194 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2196 device_info = (bluetooth_device_info_t *)param->param_data;
2197 memcpy(&searched_device, &device_info->device_address,
2198 sizeof(bluetooth_device_address_t));
2199 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2200 device_info->device_address.addr[0],
2201 device_info->device_address.addr[1],
2202 device_info->device_address.addr[2],
2203 device_info->device_address.addr[3],
2204 device_info->device_address.addr[4],
2205 device_info->device_address.addr[5]);
2208 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2210 bluetooth_device_info_t *device_info = NULL;
2211 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2213 device_info = (bluetooth_device_info_t *)param->param_data;
2214 memcpy(&searched_device, &device_info->device_address,
2215 sizeof(bluetooth_device_address_t));
2216 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2217 device_info->device_name.name,
2218 device_info->device_address.addr[0],
2219 device_info->device_address.addr[1],
2220 device_info->device_address.addr[2],
2221 device_info->device_address.addr[3],
2222 device_info->device_address.addr[4],
2223 device_info->device_address.addr[5]);
2227 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2228 printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2233 unsigned short max_response;
2234 unsigned short discovery_duration;
2235 unsigned classOfDeviceMask;
2239 discovery_duration =0;
2240 classOfDeviceMask =0;
2242 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2247 int bluetooth_start_discovery(unsigned short max_response,
2248 unsigned short discovery_duration,
2249 unsigned int classOfDeviceMask);
2252 * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2253 * unsigned short max_response,
2254 * unsigned short discovery_duration,
2255 * unsigned int classOfDeviceMask)
2256 * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2258 * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2259 * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2260 * Please see bluetooth_start_discovery() for other parameters description.
2262 * This function is a asynchronous call.
2263 * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2264 * through registered callback function.
2266 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2267 * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2269 * The completion or cancellation of the discovery is indicated by an
2270 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2272 * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2275 * @return BLUETOOTH_ERROR_NONE - Success \n
2276 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2277 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2278 * BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2279 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2280 agent is not running \n
2282 * @param[in] role define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2283 (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2284 DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2285 * @param[in] max_response define the maximum response of the number of founded devices
2287 * @param[in] discovery_duration define bluetooth discovery duration (0 means 180s )
2288 * @param[in] classOfDeviceMask define classes of the device mask which user wants
2289 (refer to class of device)
2291 * @see bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2294 unsigned short type;
2295 unsigned short max_response;
2296 unsigned short discovery_duration;
2297 unsigned classOfDeviceMask;
2302 discovery_duration =0;
2303 classOfDeviceMask =0;
2305 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2310 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2311 unsigned short max_response,
2312 unsigned short discovery_duration,
2313 unsigned int classOfDeviceMask);
2316 * @fn int bluetooth_cancel_discovery (void)
2317 * @brief Cancel the on-going device discovery operation
2320 * This function stops the on-going device discovery operation. This API has to be called after the
2321 * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2322 * the bluetooth_start_discovery API
2324 * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2325 * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2326 * cancel the discover request once the user received the device to which he wish to connect.
2328 * This function is a asynchronous call.
2329 * If the call is success to cancel discovey then the application will receive
2330 * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2331 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2332 * BLUETOOTH_ERROR_NONE
2335 * @return BLUETOOTH_ERROR_NONE - Success \n
2336 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2337 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2338 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2339 other application \n
2340 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2342 * @see bluetooth_start_discovery
2344 void bt_event_callback(int event, bluetooth_event_param_t *param)
2348 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2349 TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2358 ret = bluetooth_cancel_discovery();
2361 int bluetooth_cancel_discovery(void);
2364 * @fn int bluetooth_start_le_discovery(void)
2365 * @brief Start the generic device discovery which finds the LE devices.
2367 * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2368 * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2369 * It try to find LE devices. Bluetooth device address and name are
2370 * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2371 * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2372 * You will receive device address, device name, device class, rssi (received signal strength indicator).
2373 * please see bluetooth_device_info_t for more details.
2375 * This function is a asynchronous call.
2376 * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2377 * through registered callback function.
2379 * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2382 * The completion or cancellation of the discovery is indicated by an
2383 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2385 * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2388 * @return BLUETOOTH_ERROR_NONE - Success \n
2389 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2390 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2391 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2392 agent is not running \n
2395 * @see bluetooth_stop_le_discovery, bluetooth_device_info_t
2398 void bt_event_callback(int event, bluetooth_event_param_t *param)
2402 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2404 bluetooth_device_info_t *device_info = NULL;
2405 printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2407 device_info = (bluetooth_device_info_t *)param->param_data;
2408 memcpy(&searched_device, &device_info->device_address,
2409 sizeof(bluetooth_device_address_t));
2410 printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2411 device_info->device_address.addr[0],
2412 device_info->device_address.addr[1],
2413 device_info->device_address.addr[2],
2414 device_info->device_address.addr[3],
2415 device_info->device_address.addr[4],
2416 device_info->device_address.addr[5]);
2420 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2421 printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2427 ret = bluetooth_start_discovery();
2432 int bluetooth_start_le_discovery(void);
2435 * @fn int bluetooth_stop_le_discovery (void)
2436 * @brief Cancel the on-going device LE discovery operation
2439 * This function stops the on-going device discovery operation. This API has to be called after the
2440 * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2441 * the bluetooth_start_le_discovery API
2444 * This function is a asynchronous call.
2445 * If the call is success to cancel discovey then the application will receive
2446 * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2447 * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2448 * BLUETOOTH_ERROR_NONE
2451 * @return BLUETOOTH_ERROR_NONE - Success \n
2452 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2453 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2454 * BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2455 other application \n
2456 * BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2458 * @see bluetooth_start_discovery
2460 void bt_event_callback(int event, bluetooth_event_param_t *param)
2464 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2465 TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2474 ret = bluetooth_stop_le_discovery();
2477 int bluetooth_stop_le_discovery(void);
2480 * @fn int bluetooth_is_discovering(void)
2481 * @brief Check for the device discovery is in-progress or not.
2483 * This API is used to check the current status of the Discovery operation.If discovery is in\
2484 * progress normally other operations are not allowed.
2485 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2486 * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2487 * event before performing other operations. This API is used to get for the current discovery
2488 * operation status and using bluetooth_cancel_discovery()
2489 * we can cancell the ongoing discovery process.
2490 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2493 * This function checks whether the device discovery is started or not.
2495 * This function is a synchronous call.
2498 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2499 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2500 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2503 * @see bluetooth_start_discovery, bluetooth_cancel_discovery
2507 ret = bluetooth_is_discovering ();
2510 int bluetooth_is_discovering(void);
2513 * @fn int bluetooth_is_le_discovering(void)
2514 * @brief Check for the device LE discovery is in-progress or not.
2516 * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2517 * progress normally other operations are not allowed.
2518 * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2519 * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2520 * event before performing other operations. This API is used to get for the current discovery
2521 * operation status and using bluetooth_stop_le_discovery()
2522 * we can cancell the ongoing LE discovery process.
2523 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2526 * This function checks whether the device LE discovery is started or not.
2528 * This function is a synchronous call.
2531 * @return BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2532 * BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2533 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2536 * @see bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2540 ret = bluetooth_is_le_discovering ();
2543 int bluetooth_is_le_discovering(void);
2546 * @fn int bluetooth_is_le_scanning(void)
2547 * @brief Check for the device LE scan is in-progress or not.
2549 * This API is used to check the current status of the LE Scan operation.If discovery is in\
2550 * progress normally other operations are not allowed.
2552 * This function checks whether the device LE Scan is started or not.
2554 * This function is a synchronous call.
2556 * @return TRUE - LE Scan in progress \n
2557 * FALSE - LE Scan is not in progress \n
2562 gboolean is_le_scanning = 0;
2563 is_le_scanning = bluetooth_is_le_scanning ();
2566 gboolean bluetooth_is_le_scanning(void);
2569 * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2570 * @brief Register scan filter.
2572 * This function registers the scan filter.
2574 * This function is a synchronous call.
2576 * @return BLUETOOTH_ERROR_NONE - Success \n
2578 * @param[in] filter scan filter to register
2579 * @param[out] slot_id the slot ID of scan filter
2583 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2586 * @fn int bluetooth_unregister_scan_filter(int slot_id)
2587 * @brief Register scan filter.
2589 * This function unregisters the scan filter.
2591 * This function is a synchronous call.
2593 * @return BLUETOOTH_ERROR_NONE - Success \n
2595 * @param[in] slot_id the slot ID of scan filter
2599 int bluetooth_unregister_scan_filter(int slot_id);
2602 * @fn int bluetooth_unregister_all_scan_filters(void)
2603 * @brief Register scan filter.
2605 * This function usregisters all scan filters.
2607 * This function is a synchronous call.
2609 * @return BLUETOOTH_ERROR_NONE - Success \n
2613 int bluetooth_unregister_all_scan_filters(void);
2616 * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2617 int link_type, bt_rssi_threshold_t rssi_threshold)
2618 * @brief Enable RSSI monitoring
2620 * This function enables RSSI monitoring and sets threshold for a connection
2622 * @return BLUETOOTH_ERROR_NONE - Success \n
2625 * @see bluetooth_get_rssi_strength
2627 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2628 int link_type, bt_rssi_threshold_t *rssi_threshold);
2631 * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2632 * @brief Gets Raw RSSI signal Strength
2634 * This function gives the Raw RSSI signal strength for a connection.
2636 * @return BLUETOOTH_ERROR_NONE - Success \n
2639 * @see bluetooth_enable_rssi
2641 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2643 int bluetooth_set_connectable(gboolean is_connectable);
2645 int bluetooth_is_connectable(gboolean *is_connectable);
2648 * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2649 * @brief Initiate a bonding process
2652 * This function initiates a bonding procedure with a peer device. The bonding procedure
2653 * enables authentication and optionally encryption on the Bluetooth link.
2655 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2656 * inititate the bonding request to the devices already in the paired list.
2658 * Usually we call this API after the device discovery.
2659 * This function is a asynchronous call.
2661 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2662 * mentioed result code
2663 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2664 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2665 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2666 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2667 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2669 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2670 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2673 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2676 * @return BLUETOOTH_ERROR_NONE - Success \n
2677 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2678 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2679 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2680 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2682 * @param[in] device_address This indicates an address of the device with which the pairing
2683 * should be initiated
2685 * @see bluetooth_cancel_bonding
2687 void bt_event_callback(int event, bluetooth_event_param_t *param)
2691 case BLUETOOTH_EVENT_BONDING_FINISHED:
2693 TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2694 if (param->result >= BLUETOOTH_ERROR_NONE)
2696 bluetooth_device_info_t *device_info = NULL;
2697 device_info = (bluetooth_device_info_t *)param->param_data;
2698 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
2699 mjr[%#x] min[%#x] srv[%#x]",
2700 device_info->device_name.name,
2701 device_info->device_address.addr[0],
2702 device_info->device_address.addr[1],
2703 device_info->device_address.addr[2],
2704 device_info->device_address.addr[3],
2705 device_info->device_address.addr[4],
2706 device_info->device_address.addr[5],
2707 device_info->device_class.major_class,
2708 device_info->device_class.minor_class,
2709 device_info->device_class.service_class);
2723 bluetooth_device_address_t device_address={{0}};
2725 ret = bluetooth_bond_device(&device_address);
2729 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
2732 * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2733 * bluetooth_conn_type_t conn_type)
2734 * @brief Initiate a bonding process
2737 * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
2738 * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
2740 * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2741 * inititate the bonding request to the devices already in the paired list.
2743 * Usually we call this API after the device discovery.
2744 * This function is a asynchronous call.
2746 * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2747 * mentioed result code
2748 * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2749 * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2750 * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2751 * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2752 * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2754 * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2755 * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2758 * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2761 * @return BLUETOOTH_ERROR_NONE - Success \n
2762 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2763 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2764 * BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2765 * BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2767 * @param[in] device_address This indicates an address of the device with which pairing
2768 * should be initiated
2769 * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
2772 * @see bluetooth_cancel_bonding
2774 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2775 bluetooth_conn_type_t conn_type);
2778 * @fn int bluetooth_cancel_bonding(void)
2779 * @brief Cancel the on-going bonding process
2781 * This API is called to cancel the on-going bonding procedure. It should be called before the
2782 * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
2783 * This API is useful when the remote device is not responding to the bond request or we wish to
2784 * cancel the bonding request. In this case we need not wait for the timeout to happen.
2786 * This function is a synchronous call.
2788 * @return BLUETOOTH_ERROR_NONE - Success \n
2789 * BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
2790 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2793 * @see bluetooth_bond_device
2799 ret = bluetooth_cancel_bonding();
2802 int bluetooth_cancel_bonding(void);
2805 * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
2806 * @brief Remove bonding
2809 * To communicate with remote device over bluetooth link, user should bond with peer device.
2810 * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
2811 * API is used to remove peer device from the list. Please note that after removing the device
2812 * from bonded device list, you cannot communication with peer device until bonding happens again.
2814 * User can call this function by passing bluetooth device address of any bonded device. Please note
2815 * that after successful return of this function, any bluetooth application running on your device
2816 * will not be able to communicate with unbonded device until bond operation happens again using
2817 * bluetooth_bond_device()
2820 * This function is a asynchronous call. The request to remove the specified device from the bonded
2821 * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
2822 * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
2823 * in case if there is a problem in locating given bluetooth device address in bonded devices list
2827 * @return BLUETOOTH_ERROR_NONE - Success \n
2828 * BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
2829 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2830 * BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2831 * BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2832 * BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2833 * agent is not running \n
2834 * BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
2837 * @param[in] device_address This indicates an address of the device to remove bonding
2841 * @see bluetooth_bond_device, bluetooth_cancel_bonding
2844 void bt_event_callback(int event, bluetooth_event_param_t *param)
2847 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
2848 bluetooth_device_address_t *dev_addr = NULL;
2850 if (param->result == BLUETOOTH_ERROR_NONE) {
2851 dev_addr = (bluetooth_device_address_t *)param->param_data;
2853 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2854 dev_addr->addr[0], dev_addr->addr[1]
2855 dev_addr->addr[2], dev_addr->addr[3]
2856 dev_addr->addr[4], dev_addr->addr[5]
2867 bluetooth_device_address_t *device_address;
2869 // copy valid device address in device_address
2871 ret = bluetooth_unbond_device(device_address);
2874 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
2877 * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
2878 * @brief Get bonded(paired) device list
2881 * This API gets all bonded device list.
2882 * The devices in the bonded device list further can be used to perform the authorization by calling
2883 * bluetooth_authorize_device API.
2885 * This function is a synchronous call.
2886 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2887 * there is no valid information in the dev_list.
2888 * The len field in the dev_list represents the number of bonded devices. The data structure for
2889 * bonded device information is bluetooth_device_info_t.
2892 * @return BLUETOOTH_ERROR_NONE - Success \n
2893 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2895 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2897 void bt_get_bonded_devices(void)
2901 GPtrArray *devinfo = NULL;
2902 bluetooth_device_info_t *ptr;
2904 // allocate the g_pointer_array
2905 devinfo = g_ptr_array_new();
2907 ret = bluetooth_get_bonded_device_list(&devinfo);
2908 if (ret != BLUETOOTH_ERROR_NONE)
2910 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
2914 printf("g pointer arrary count : [%d]", devinfo->len);
2915 for (i=0; i<devinfo->len; i++)
2917 ptr = g_ptr_array_index(devinfo, i);
2920 printf("Name [%s]\n", ptr->device_name.name);
2921 printf("Major Class [%d]\n", ptr->device_class.major_class);
2922 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
2923 printf("Service Class [%d]\n", ptr->device_class.service_class);
2924 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2925 ptr->device_address.addr[0],
2926 ptr->device_address.addr[1], ptr->device_address.addr[2],
2927 ptr->device_address.addr[3],
2928 ptr->device_address.addr[4], ptr->device_address.addr[5]);
2935 // free g_pointer_array
2936 g_ptr_array_free(devinfo, TRUE);
2941 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
2944 * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2945 * bluetooth_device_info_t *dev_info)
2946 * @brief Get a bonded(paired) device
2949 * This API gets a bonded device.
2951 * This function is a synchronous call.
2952 * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2953 * there is no valid information in the dev_info.
2954 * The data structure for bonded device information is bluetooth_device_info_t.
2957 * @return BLUETOOTH_ERROR_NONE - Success \n
2958 * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2960 * @see bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2962 void bt_get_bonded_device(void)
2966 bluetooth_device_info_t devinfo = {0};
2967 bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
2969 ret = bluetooth_get_bonded_device(&device_address, &devinfo);
2970 if (ret != BLUETOOTH_ERROR_NONE)
2972 printf("bluetooth_get_bonded_device failed with [%d]",ret);
2976 printf("Name [%s]\n", devinfo.device_name.name);
2977 printf("Major Class [%d]\n", devinfo.device_class.major_class);
2978 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
2979 printf("Service Class [%d]\n", devinfo.device_class.service_class);
2980 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
2981 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
2982 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
2983 devinfo.device_address.addr[5]);
2992 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2993 bluetooth_device_info_t *dev_info);
2996 * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
2997 * @brief set alias for bonded device
3000 * This function set alias for bonded device.
3002 * This function is a synchronous call.
3005 * @return BLUETOOTH_ERROR_NONE - Success \n
3006 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3007 * @param[in] device_address This indicates an address of the remote device
3008 * @param[in] alias This indicates an alias to set
3013 ret = bluetooth_set_alias(&remote_address);
3016 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3020 * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3021 * @brief Get remote deivice
3024 * This function gets specific remote device.
3026 * This function is a asynchronous call.
3027 * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3030 * @return BLUETOOTH_ERROR_NONE - Success \n
3031 * BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3032 * @param[in] device_address This indicates an address of the remote device
3037 ret = bluetooth_get_remote_device(&remote_address);
3040 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3043 * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3044 * gboolean authorized)
3045 * @brief Authorize/Unauthorize a bonded device
3048 * This function authorizes/unauthorize a bonded device. It decides the device to connect
3049 * with/without user confirmation.
3051 * If we select a paired device and make it authorized by calling this API with the authorized
3052 * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3053 * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3054 * then it will ask for the user conformation before the connection.
3056 * This API supposed to be called on the paired devices. Which means we have to use this API only
3057 * after successful pairing.
3059 * This function is a asynchronous call.
3060 * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3062 * @return BLUETOOTH_ERROR_NONE - Success \n
3063 * @exception BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3064 * @param[in] device_address This indicates an address of the device to authorize \n
3065 * @param[in] authorized TRUE : authorize FALSE: unauthorize
3067 * @see bluetooth_get_bonded_device_list
3069 void bt_event_callback(int event, bluetooth_event_param_t *param)
3073 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3075 if (param->result == BLUETOOTH_ERROR_NONE)
3079 //device authorization failed failure
3087 bluetooth_device_address_t device_address={{0}};
3088 gboolean authorized;
3092 ret = bluetooth_authorize_device(&device_address,authorized);
3095 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3096 gboolean authorized);
3098 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3099 const bluetooth_device_pin_code_t *pin_code);
3101 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3104 * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3106 * @brief Receives Legacy Passkey\pin with following authentication response types
3108 * @param[in] passkey : This is the PIN or PASSKEY string required for remote device authentication
3109 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3112 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3115 * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3117 * @brief This API sends user confirmation reply to the local adapter.
3119 * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3122 int bluetooth_passkey_confirmation_reply(gboolean reply);
3125 * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3126 * @brief Get all services supported by remote device
3129 * This API call initiates the search for the services supported by the specified device. Normally
3130 * the service search will take a couple of seconds to get it completed. Before calling this API
3131 * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3132 * perform the service search. We can get the device address by doing a device discovery operation.
3135 * This function is a asynchronous call.
3136 * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3138 * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3139 * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3140 * event is generated with appropriate result code.
3142 * @return BLUETOOTH_ERROR_NONE - Success \n
3143 * BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3144 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3145 * @param[in] device_address This indicates an address of the device
3146 * whose services need to be found
3148 * @see bluetooth_cancel_service_search
3150 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3153 * @fn int bluetooth_cancel_service_search(void)
3154 * @brief Cancel the ongoing service search operation
3157 * This function cancel the ongoing service search operation. This API is usually calling after the
3158 * bluetooth_search_service API.
3159 * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3160 * if the user wish to cancel the Ongoing service search operation.
3162 * This API should be called just after the bluetooth_search_service API and before the
3163 * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3165 * This function is a synchronous call.
3167 * @return BLUETOOTH_ERROR_NONE - Success \n
3168 * BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3169 * BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3170 * BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3173 * @see bluetooth_search_service
3178 ret = bluetooth_cancel_service_search();
3181 int bluetooth_cancel_service_search(void);
3184 * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3185 * @brief Register rfcomm socket with a specific uuid
3188 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3189 * descriptor of the server.
3190 * This is the first API which is called to create the server. Once we created the server socket,
3191 * we will listen on that return socket.
3192 * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3195 * @return socket FD on Success \n
3196 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3197 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3198 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3199 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3200 * @param[in] UUID (128 bits)
3203 * @see bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3207 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3208 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3212 int bluetooth_rfcomm_create_socket(const char *uuid);
3215 * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3216 * @brief Register rfcomm socket with a specific uuid
3219 * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3220 * descriptor of the server.
3221 * This is the first API which is called to create the server. Once we created the server socket,
3222 * we will listen on that return socket.
3223 * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3226 * @return socket FD on Success \n
3227 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3228 * BLUETOOTH_ERROR_INTERNAL - Internal error\n
3229 * BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3230 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3231 * @param[in] UUID (128 bits)
3232 * @param[in] bus_name (const char)
3233 * @param[in] path (const char)
3236 * @see bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3240 const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3241 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3245 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3248 * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3249 * @brief De-register the rfcomm socket
3252 * This API deregister rfcomm socket with the given socket fd and UUID. If the remote device is
3253 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3254 * descriptor else no event will come. We will call this API only after the
3255 * bluetooth_rfcomm_listen_and_accept.
3256 * This is a synchronous call.
3258 * @return BLUETOOTH_ERROR_NONE - Success \n
3259 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3260 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3261 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3262 * @param[in] int socket_fd
3265 * @see bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3268 void bt_event_callback(int event, bluetooth_event_param_t *param)
3272 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3274 bluetooth_rfcomm_connection_t *discon_ind =
3275 (bluetooth_rfcomm_connection_t *)param->param_data;
3277 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3285 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3286 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3288 ret = bluetooth_rfcomm_remove_socket(fd);
3291 int bluetooth_rfcomm_remove_socket(int socket_fd);
3294 * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3295 * @brief De-register the rfcomm socket
3298 * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3299 * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3300 * descriptor else no event will come. We will call this API only after the
3301 * bluetooth_rfcomm_listen_and_accept_ex.
3302 * This is a synchronous call.
3304 * @return BLUETOOTH_ERROR_NONE - Success \n
3305 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3306 * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3307 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3308 * @param[in] UUID (128 bits)
3311 * @see bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3314 void bt_event_callback(int event, bluetooth_event_param_t *param)
3318 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3320 bluetooth_rfcomm_connection_t *discon_ind =
3321 (bluetooth_rfcomm_connection_t *)param->param_data;
3323 printf("\nDisconnected from FD %d", discon_ind->socket_fd);
3331 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3332 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3334 ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3337 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3340 * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3341 * @brief Disconnect rfcomm connection
3344 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3345 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3348 * @return BLUETOOTH_ERROR_NONE - Success \n
3349 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3350 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3351 * @param[in] int socket_fd the sending socket fd
3357 ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3359 printf("Disconnection failed");
3361 printf("Disconnection Success");
3365 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3368 * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3369 * @brief Rfcomm socket listen
3372 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3373 * after the bluetooth_rfcomm_create_socket API.
3374 * This API listen for the incomming connection and once it receives a connection, it will give
3375 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3376 * event to the application. This is an Asynchronous API call.
3379 * @return BLUETOOTH_ERROR_NONE - Success \n
3380 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3381 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3383 * @param[in] int socket_fd
3384 * @param[in] max pending connection.
3387 * @see bluetooth_rfcomm_create_socket
3390 void bt_event_callback(int event, bluetooth_event_param_t* param)
3394 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3396 bluetooth_rfcomm_connection_t *conn_ind =
3397 (bluetooth_rfcomm_connection_t *)param->param_data;
3399 printf("\nConnected from FD %d", conn_ind->socket_fd);
3407 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3408 ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3412 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3415 * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3416 * @brief Rfcomm socket listen
3419 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3420 * after the bluetooth_rfcomm_create_socket API.
3421 * This API listen for the incomming connection and once it receives a connection, it will give
3422 * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3423 * event to the application. This is an Asynchronous API call.
3426 * @return BLUETOOTH_ERROR_NONE - Success \n
3427 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3428 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3430 * @param[in] int socket_fd
3431 * @param[in] max pending connection.
3436 * @see bluetooth_rfcomm_create_socket_ex
3439 void bt_event_callback(int event, bluetooth_event_param_t* param)
3443 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3445 bluetooth_rfcomm_connection_t *conn_ind =
3446 (bluetooth_rfcomm_connection_t *)param->param_data;
3448 printf("\nConnected from FD %d", conn_ind->socket_fd);
3456 fd = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3457 ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3462 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3465 * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3466 * @brief Rfcomm socket listen
3469 * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3470 * after the bluetooth_rfcomm_create_socket API.
3471 * This API listen for the incomming connection and once it receives a connection, it will give
3472 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3473 * event to the application. This is an Asynchronous API call.
3476 * @return BLUETOOTH_ERROR_NONE - Success \n
3477 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3478 * BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3480 * @param[in] int socket_fd
3481 * @param[in] max pending connection.
3484 * @see bluetooth_rfcomm_create_socket
3487 void bt_event_callback(int event, bluetooth_event_param_t* param)
3491 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3493 char *name = (char *)param->param_data;
3495 printf("\nConnected from %s", name);
3497 bluetooth_rfcomm_accept_connection();
3505 fd = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3506 ret = bluetooth_rfcomm_listen(fd, 1);
3510 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3513 * @fn int bluetooth_rfcomm_accept_connection()
3514 * @brief Accepts the authorization request indicated by the event
3515 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3517 * This function is a synchronous call.
3519 * @return BLUETOOTH_ERROR_NONE - Success \n
3520 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3522 * @param[in] the socket fd of the server
3523 * @param[out] the socket fd of the client
3527 * @see bluetooth_rfcomm_reject_connection
3529 int bluetooth_rfcomm_accept_connection(int server_fd);
3532 * @fn int bluetooth_rfcomm_reject_connection()
3533 * @brief Rejects the authorization request indicated by the event
3534 * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3536 * This function is a synchronous call.
3538 * @return BLUETOOTH_ERROR_NONE - Success \n
3539 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
3541 * @param[in] the socket fd of the server
3545 * @see bluetooth_rfcomm_accept_connection
3547 int bluetooth_rfcomm_reject_connection(int server_fd);
3550 * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3551 * @brief Informs whether rfcomm server uuid is available or not.
3553 * This function is a synchronous call.
3555 * @return TRUE - RFCOMM uuid is available \n
3556 * FALSE - RFCOMM uuid is not available \n
3558 * @param[in] uuid UUID string
3564 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3567 * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3568 * const char *remote_uuid)
3569 * @brief Connect to the remote device rfcomm *
3571 * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3572 * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3573 * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3574 * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3575 * initiating a connection.
3577 * @return BLUETOOTH_ERROR_NONE - Success \n
3578 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3579 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3580 * BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3581 * BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3582 * @param[in] bluetooth_device_address_t remote bt_address
3583 * @param[in] char remote uuid
3585 * @see bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3589 void bt_event_callback(int event, bluetooth_event_param_t *param)
3593 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3595 if (param->result >= BLUETOOTH_ERROR_NONE)
3597 bt_sdp_info_t *bt_sdp_info=param->param_data;
3599 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3600 bt_sdp_info->device_addr.addr[0],
3601 bt_sdp_info->device_addr.addr[1],
3602 bt_sdp_info->device_addr.addr[2],
3603 bt_sdp_info->device_addr.addr[3],
3604 bt_sdp_info->device_addr.addr[4],
3605 bt_sdp_info->device_addr.addr[5]);
3607 printf("Supported service list:\n");
3608 for(i=0; i<bt_sdp_info->service_index; i++)
3610 bt_sdp_info->service_list_array[i]);
3613 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3614 //rfcomm_test_uuid);
3618 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3620 bluetooth_rfcomm_connection_t *conn_ind =
3621 (bluetooth_rfcomm_connection_t *)param->param_data;
3623 printf("\nConnected from FD %d, Role = %s", conn_ind->socket_fd,
3624 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3625 "SERVER" : "CLIENT");
3630 bluetooth_device_address_t remote_address = {{0},};
3631 remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3632 remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19; remote_address.addr[5]= 0x36;
3633 ret = bluetooth_search_service(&remote_address);
3635 printf("Seach failed, Reason = %d", ret);
3637 printf("Search Success, Ret = %d", ret);
3639 ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3641 printf("Connection failed, Reason = %d", ret);
3643 printf("Connection Success, Ret = %d", ret);
3647 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3648 const char *remote_uuid);
3651 * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3652 * @brief Disconnect rfcomm connection
3655 * Disconnect a specific(device node fd) RFCOMM connection. This is a Synchronous call and there
3656 * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3659 * @return BLUETOOTH_ERROR_NONE - Success \n
3660 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3661 * BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3662 * @param[in] char remote bt_address
3665 * @see bluetooth_rfcomm_connect
3669 ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3671 printf("Disconnection failed");
3673 printf("Disconnection Success");
3678 int bluetooth_rfcomm_disconnect(int socket_fd);
3681 * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3682 * @brief Write to rfcomm connection
3685 * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3686 * API is used to send the data for server and the client.
3688 * @return BLUETOOTH_ERROR_NONE - Success \n
3689 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3690 * BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3692 * @param[in] const char *buff Data buffer to send
3693 * @param[in] int length Length of the data
3696 * @see bluetooth_rfcomm_connect
3699 char *buff = "Test data 123456789"
3700 ret = bluetooth_rfcomm_write(g_ret_fd, buff, 15);
3702 printf("Send failed");
3704 printf("Send success");
3708 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
3711 * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
3712 * @brief Informs whether rfcomm client is connected.
3714 * This function is a synchronous call.
3716 * @return TRUE - RFCOMM client is connected \n
3717 * FALSE - RFCOMM client is not connected \n
3723 gboolean bluetooth_rfcomm_is_client_connected(void);
3724 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3725 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3728 * @fn int bluetooth_network_activate_server(void)
3729 * @brief Activate the NAP (Network Access Point) service
3731 * This function is a asynchronous call.
3732 * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
3734 * @return BLUETOOTH_ERROR_NONE - Success \n
3735 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3736 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3737 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3740 * @see bluetooth_network_deactivate_server
3743 int bluetooth_network_activate_server(void);
3746 * @fn int bluetooth_network_deactivate_server(void)
3747 * @brief Deactivate the NAP (Network Access Point) service
3749 * This function is a asynchronous call.
3750 * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
3752 * @return BLUETOOTH_ERROR_NONE - Success \n
3753 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3754 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3755 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3758 * @see bluetooth_network_activate_server
3761 int bluetooth_network_deactivate_server(void);
3764 * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3765 * bluetooth_network_role_t role,
3767 * @brief Connect the network server in the peer
3769 * This function is a asynchronous call.
3770 * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3772 * @return BLUETOOTH_ERROR_NONE - Success \n
3773 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3774 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3775 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3778 * @param[in] device_address This indicates an address of the device with which the pairing
3779 * should be initiated
3780 * @param[in] role The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
3781 * need to use the third parameter.
3782 * @param[in] custom_uuid If use the CUSTOM value in second parameter, use this parameter to
3783 * connect. UUID string
3785 * @see bluetooth_network_disconnect
3787 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3788 bluetooth_network_role_t role, char *custom_uuid);
3791 * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
3792 * bluetooth_network_role_t role,
3793 * char *custom_uuid)
3794 * @brief Connect the network server in the peer
3796 * This function is a asynchronous call.
3797 * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3799 * @return BLUETOOTH_ERROR_NONE - Success \n
3800 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3801 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3802 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3805 * @param[in] device_address This indicates an address of the device with which the pairing
3806 * should be initiated
3808 * @see bluetooth_network_connect
3810 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
3813 * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
3814 * @brief Disconnect the device from the network
3816 * This function is an asynchronous call.
3817 * The network server disconnect request is responded by
3818 * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
3820 * @return BLUETOOTH_ERROR_NONE - Success \n
3821 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3822 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3823 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3826 * @param[in] device_address This indicates an address of the connected client device
3828 * @see bluetooth_network_activate_server
3830 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
3835 * @fn int bluetooth_hdp_activate(unsigned short data_type,
3836 * bt_hdp_role_type_t role,
3837 * bt_hdp_qos_type_t channel_type,
3838 * char **app_handle)
3839 * @brief Activate the HDP service for a particular data type
3841 * This function is a synchronous call.
3843 * @return BLUETOOTH_ERROR_NONE - Success \n
3844 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3845 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3846 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3849 * @param[in] data_type The data type against corresponding service
3850 * @param[in] role The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
3851 * @param[in] channel_type The QOS type for the channel.
3852 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
3853 * For role = HDP_ROLE_SINK, the channel_type
3854 * should be HDP_QOS_ANY.
3855 * @param[out] app_handle The application handler against corresponding service
3857 * @see bluetooth_hdp_deactivate
3859 int bluetooth_hdp_activate(unsigned short data_type,
3860 bt_hdp_role_type_t role,
3861 bt_hdp_qos_type_t channel_type,
3864 * @fn int bluetooth_hdp_deactivate(const char *app_handle)
3865 * @brief Deactivate the HDP service for a particular service using the handler
3867 * This function is a synchronous call.
3869 * @return BLUETOOTH_ERROR_NONE - Success \n
3870 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3871 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3872 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3875 * @param[in] app_handle The application handler against corresponding service
3877 * @see bluetooth_hdp_deactivate
3879 int bluetooth_hdp_deactivate(const char *app_handle);
3882 * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
3883 * const char *buffer, unsigned int size)
3884 * @brief Send data to the remote HDP device
3886 * This function is a synchronous call.
3888 * @return BLUETOOTH_ERROR_NONE - Success \n
3889 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3890 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3891 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3892 * BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid \n
3895 * @param[in] channel_id The channel id for the connection.
3896 * @param[in] buffer The pdu buffer.
3897 * @param[in] size Size of the buffer.
3899 * @see bluetooth_hdp_connect
3901 int bluetooth_hdp_send_data(unsigned int channel_id,
3902 const char *buffer, unsigned int size);
3904 * @fn int bluetooth_hdp_connect(const char *app_handle,
3905 * bt_hdp_qos_type_t channel_type,
3906 * const bluetooth_device_address_t *device_address)
3907 * @brief Connect to the remote device(Mainly used by source)
3909 * This function is a asynchronous call.
3910 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
3912 * @return BLUETOOTH_ERROR_NONE - Success \n
3913 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3914 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3915 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3916 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3919 * @param[in] app_handle The application handler against corresponding service
3920 * @param[in] channel_type The QOS type for the channel.
3921 * HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
3922 * @param[in] device_address The remote device Bd address.
3925 * @see bluetooth_hdp_disconnect
3927 int bluetooth_hdp_connect(const char *app_handle,
3928 bt_hdp_qos_type_t channel_type,
3929 const bluetooth_device_address_t *device_address);
3931 * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
3932 * const bluetooth_device_address_t *device_address)
3933 * @brief Disconnect from the remote device(Mainly used by source)
3935 * This function is a asynchronous call.
3936 * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
3938 * @return BLUETOOTH_ERROR_NONE - Success \n
3939 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3940 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3941 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3942 * BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3945 * @param[in] channel_id The channel id for the connection.
3946 * @param[in] device_address The remote device Bd address.
3949 * @see bluetooth_hdp_connect
3951 int bluetooth_hdp_disconnect(unsigned int channel_id,
3952 const bluetooth_device_address_t *device_address);
3956 * @fn int bluetooth_opc_init(void)
3957 * @brief Initialize OPP client.
3959 * This function is a synchronous call.
3960 * No event corresponding to this api
3962 * @return BLUETOOTH_ERROR_NONE - Success \n
3963 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3964 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3965 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3966 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3971 * @see bluetooth_opc_deinit
3973 int bluetooth_opc_init(void);
3976 * @fn int bluetooth_opc_deinit(void)
3977 * @brief Deinitialize OPP client.
3979 * This function is a synchronous call.
3980 * No event corresponding to this api
3982 * @return BLUETOOTH_ERROR_NONE - Success \n
3983 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3984 * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3989 * @see bluetooth_opc_init
3992 int bluetooth_opc_deinit(void);
3995 * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
3996 char **file_name_array)
3997 * @brief Send multiple files to a remote device.
3999 * This function is a asynchronous call.
4000 * This api is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4002 * @return BLUETOOTH_ERROR_NONE - Success \n
4003 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4004 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4005 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4006 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4007 * BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4008 * BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4011 * @param[in] device_address The remote device Bd address.
4012 * @param[in] file_name_array Array of filepaths to be sent.
4015 * @see bluetooth_opc_cancel_push
4018 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4019 char **file_name_array);
4022 * @fn int bluetooth_opc_cancel_push(void)
4023 * @brief Cancels the ongoing file push.
4025 * This function is a asynchronous call.
4026 * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4027 * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4029 * @return BLUETOOTH_ERROR_NONE - Success \n
4030 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4031 * BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4036 * @see bluetooth_opc_push_files
4039 int bluetooth_opc_cancel_push(void);
4042 * @fn gboolean bluetooth_opc_session_is_exist(void)
4043 * @brief Informs whether opc session exists or not.
4045 * This function is a synchronous call.
4047 * @return TRUE - OPC session exists \n
4048 * FALSE - OPC session does not exist \n
4056 gboolean bluetooth_opc_session_is_exist(void);
4059 * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4060 * @brief Informs whether opc session exists or not.
4062 * This function is a synchronous call.
4064 * @return BLUETOOTH_ERROR_NONE - Success \n
4065 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4066 * BLUETOOTH_ERROR_INTERNAL \n
4069 * @param[out] is_sending The sending status: (@c TRUE = in sending , @c false = not in sending)
4074 int bluetooth_opc_is_sending(gboolean *is_sending);
4077 * @fn int bluetooth_obex_server_init(const char *dst_path)
4078 * @brief Initialize OPP and FTP server.
4080 * This function is a synchronous call.
4081 * No event corresponding to this api
4083 * @return BLUETOOTH_ERROR_NONE - Success \n
4084 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4085 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4086 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4087 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4090 * @param[in] dst_path OPS destination file path.
4092 * @see bluetooth_obex_server_deinit
4094 int bluetooth_obex_server_init(const char *dst_path);
4098 * @fn int bluetooth_obex_server_deinit(void)
4099 * @brief Deinitialize OPP and FTP server.
4101 * This function is a synchronous call.
4102 * No event corresponding to this api
4104 * @return BLUETOOTH_ERROR_NONE - Success \n
4105 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4106 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4111 * @see bluetooth_obex_server_init
4113 int bluetooth_obex_server_deinit(void);
4117 * @fn gboolean bluetooth_obex_server_is_activated(void)
4118 * @brief Informs whether obex server is activated or not.
4120 * This function is a synchronous call.
4122 * @return TRUE - OBEX server is activated \n
4123 * FALSE - OBEX server is not activated \n
4130 gboolean bluetooth_obex_server_is_activated(void);
4134 * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4135 * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4137 * This function is a synchronous call.
4138 * No event corresponding to this api
4140 * @return BLUETOOTH_ERROR_NONE - Success \n
4141 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4142 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4143 * BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4144 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4148 * @param[in] dst_path OPS destination file path.
4150 * @see bluetooth_obex_server_deinit_without_agent
4152 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4156 * @fn int bluetooth_obex_server_deinit_without_agent(void)
4157 * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4159 * This function is a synchronous call.
4160 * No event corresponding to this api
4162 * @return BLUETOOTH_ERROR_NONE - Success \n
4163 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4164 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4169 * @see bluetooth_obex_server_init_without_agent
4171 int bluetooth_obex_server_deinit_without_agent(void);
4175 * @fn int bluetooth_obex_server_accept_connection(void)
4176 * @brief Accepts the authorization request indicated by the event
4177 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4179 * This function is a synchronous call.
4181 * @return BLUETOOTH_ERROR_NONE - Success \n
4182 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4183 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4187 * @see bluetooth_obex_server_reject_authorize
4189 int bluetooth_obex_server_accept_connection(void);
4193 * @fn int bluetooth_obex_server_reject_connection(void)
4194 * @brief Rejects the authorization request indicated by the event
4195 * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4197 * This function is a synchronous call.
4199 * @return BLUETOOTH_ERROR_NONE - Success \n
4200 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4201 * BLUETOOTH_ERROR_INTERNAL - Internal error \n
4205 * @see bluetooth_obex_server_reject_authorize
4207 int bluetooth_obex_server_reject_connection(void);
4211 * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4212 * @brief Accepts the authorization request indicated by the event
4213 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4215 * This function is a asynchronous call.
4216 * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4218 * @return BLUETOOTH_ERROR_NONE - Success \n
4219 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4220 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4221 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4224 * @param[in] filename Authorized filename.
4227 * @see bluetooth_obex_server_reject_authorize
4230 int bluetooth_obex_server_accept_authorize(const char *filename);
4233 * @fn int bluetooth_obex_server_reject_authorize(void)
4234 * @brief Reject the authorization request indicated by the event
4235 * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4237 * This function is a asynchronous call.
4238 * No event for this api..
4240 * @return BLUETOOTH_ERROR_NONE - Success \n
4241 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4242 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4247 * @see bluetooth_obex_server_accept_authorize
4250 int bluetooth_obex_server_reject_authorize(void);
4253 * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4254 * @brief Set the OPS destination file path..
4256 * This function is a asynchronous call.
4257 * No event for this api..
4259 * @return BLUETOOTH_ERROR_NONE - Success \n
4260 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4261 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4262 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4265 * @param[in] dst_path OPS destination file path.
4271 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4274 * @fn int bluetooth_obex_server_set_root(const char *root)
4275 * @brief Set the FTS root folder..
4277 * This function is a asynchronous call.
4278 * No event for this api..
4280 * @return BLUETOOTH_ERROR_NONE - Success \n
4281 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4282 * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4283 * BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4284 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4285 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4288 * @param[in] root FTS root folder.
4294 int bluetooth_obex_server_set_root(const char *root);
4297 * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4298 * @brief Cancel the transfer on server
4300 * This function is an asynchronous call.
4301 * If the function call that cancels transfer is successful, the application would receive
4302 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4303 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4304 * the error code will be BLUETOOTH_ERROR_NONE
4306 * @return BLUETOOTH_ERROR_NONE - Success \n
4307 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4308 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4309 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4310 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4313 * @param[in] transfer_id transfer ID
4318 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4322 * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4323 * @brief Cancel the transfer on server
4325 * This function is an asynchronous call.
4326 * If the function call that cancels transfer is successful, the application would receive
4327 * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4328 * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4329 * the error code will be BLUETOOTH_ERROR_NONE
4331 * @return BLUETOOTH_ERROR_NONE - Success \n
4332 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4333 * BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4334 * BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4335 * BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4342 int bluetooth_obex_server_cancel_all_transfers(void);
4346 * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4347 * @brief Informs whether obex server is receiving or not.
4349 * This function is a synchronous call.
4351 * @return BLUETOOTH_ERROR_NONE - Success \n
4352 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4353 * BLUETOOTH_ERROR_INTERNAL \n
4356 * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving)
4361 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4365 * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4366 * @brief Read the local Hash and Randmizer.
4368 * This function is a synchronous call.
4370 * @return BLUETOOTH_ERROR_NONE - Success \n
4371 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4375 * @param[out] local_oob_data - Pointer to the local OOB data
4381 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4385 * @fn int bluetooth_oob_add_remote_data(
4386 * const bluetooth_device_address_t *remote_device_address,
4387 * bt_oob_data_t *oob_data)
4388 * @brief Add/updated the remote device Hash and Randmizer.
4390 * This function is a synchronous call.
4391 * No event for this api..
4393 * @return BLUETOOTH_ERROR_NONE - Success \n
4394 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4397 * @param[in] remote_device_address - Remote device address
4398 * remote_oob_data - Ponter to Hash and Randomizer oob data structure
4404 int bluetooth_oob_add_remote_data(
4405 const bluetooth_device_address_t *remote_device_address,
4406 bt_oob_data_t *remote_oob_data);
4410 * @fn int bluetooth_oob_remove_remote_data(
4411 * const bluetooth_device_address_t *remote_device_address)
4412 * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4414 * This function is a synchronous call.
4415 * No event for this api..
4417 * @return BLUETOOTH_ERROR_NONE - Success \n
4418 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4421 * @param[in] remote_device_address - Remote device address
4427 int bluetooth_oob_remove_remote_data(
4428 const bluetooth_device_address_t *remote_device_address);
4431 * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4432 * bt_gatt_handle_info_t *prim_svc);
4434 * @brief Gets the GATT based primary services handle supported by remote device
4436 * This function is a synchronous call.
4437 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4439 * @return BLUETOOTH_ERROR_NONE - Success \n
4440 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4441 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4442 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4445 * @param[in] address - Remote device address
4446 * @param[out] prim_svc - Structure containing remote service count and handle list.
4449 * @see bluetooth_gatt_free_primary_services()
4451 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4452 bt_gatt_handle_info_t *prim_svc);
4455 * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4457 * @brief Discovers the characteristics of GATT based service of remote device
4459 * This function is an asynchronous call.
4460 * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4462 * @return BLUETOOTH_ERROR_NONE - Success \n
4463 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4464 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4465 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4468 * @param[in] service_handle - Handle for remote service.
4473 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4476 * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4477 * bt_gatt_service_property_t *service);
4479 * @brief Gets the properties of GATT based service of remote device
4481 * This function is a synchronous call.
4482 * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4484 * @return BLUETOOTH_ERROR_NONE - Success \n
4485 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4486 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4487 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4490 * @param[in] service_handle - Handle for remote service.
4491 * @param[out] service - Structure containing remote service property.
4494 * @see bluetooth_gatt_free_service_property()
4496 int bluetooth_gatt_get_service_property(const char *service_handle,
4497 bt_gatt_service_property_t *service);
4500 * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4502 * @brief Register to GATT based service to receive value change notification/indication.
4504 * This function is a synchronous call.
4505 * No event for this api.
4507 * @return BLUETOOTH_ERROR_NONE - Success \n
4508 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4509 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4510 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4513 * @param[in] service_handle - Handle for remote service.
4518 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4521 * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4523 * @brief Unregister GATT based service to receive value change notification/indication.
4525 * This function is a synchronous call.
4526 * No event for this api.
4528 * @return BLUETOOTH_ERROR_NONE - Success \n
4529 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4530 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4531 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4534 * @param[in] service_handle - Handle for remote service.
4539 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4542 * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4543 * bt_gatt_char_property_t *characteristic);
4545 * @brief Provides characteristic value along with properties.
4547 * This function is a synchronous call.
4548 * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4550 * @return BLUETOOTH_ERROR_NONE - Success \n
4551 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4552 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4553 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4556 * @param[in] char_handle - Handle for Characteristic property.
4557 * @param[out] characteristic - Structure containing remote characteristic property.
4560 * @see bluetooth_gatt_free_char_property()
4562 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4563 bt_gatt_char_property_t *characteristic);
4566 * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4567 * bt_gatt_char_property_t *characteristic);
4569 * @brief Provides characteristic descriptor value along with its UUID.
4571 * This function is a synchronous call.
4572 * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4574 * @return BLUETOOTH_ERROR_NONE - Success \n
4575 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4576 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4577 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4580 * @param[in] desc_handle - Handle for Characteristic descriptor.
4581 * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4584 * @see bluetooth_gatt_free_desc_property()
4586 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4587 bt_gatt_char_descriptor_property_t *descriptor);
4591 * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4592 * const guint8 *value, int length)
4594 * @brief Set characteristic value.
4596 * This function is a synchronous call.
4598 * @return BLUETOOTH_ERROR_NONE - Success \n
4599 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4600 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4601 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4604 * @param[in] char_handle - Handle for Characteristic property.
4605 * @param[in] value - New value to set for characteristic property.
4606 * @param[in] length - Length of the value to be set.
4611 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4612 const guint8 *value, int length);
4615 * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4616 * const guint8 *value, int length, guint8 write_type)
4618 * @brief Set characteristic value by write type.
4620 * This function is a synchronous call if write type is "write without resonse"
4621 * and it is an asynchronous call if write type is "write with response"
4623 * @return BLUETOOTH_ERROR_NONE - Success \n
4624 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4625 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4626 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4629 * @param[in] char_handle - Handle for Characteristic property.
4630 * @param[in] value - New value to set for characteristic property.
4631 * @param[in] length - Length of the value to be set.
4632 * @param[in] write_type - Type of write.
4637 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4638 const guint8 *value, int length, guint8 write_type);
4642 * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4643 * const guint8 *value, int length)
4645 * @brief Set characteristic value request.
4647 * This function is an asynchronous call.
4649 * @return BLUETOOTH_ERROR_NONE - Success \n
4650 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4651 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4652 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4655 * @param[in] char_handle - Handle for Characteristic property.
4656 * @param[in] value - New value to set for characteristic property.
4657 * @param[in] length - Length of the value to be set.
4662 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4663 const guint8 *value, int length);
4666 * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4668 * @brief Read characteristic value.
4670 * This function is a asynchronous call.
4672 * @return BLUETOOTH_ERROR_NONE - Success \n
4673 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4674 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4675 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4678 * @param[in] char_handle - Handle for Characteristic property.
4683 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
4686 * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4687 * const char *service_uuid,
4688 * bt_gatt_service_property_t *service)
4690 * @brief Gets the service property from a device based on a particular uuid
4692 * This function is a synchronous call.
4694 * @return BLUETOOTH_ERROR_NONE - Success \n
4695 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4696 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4697 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4700 * @param[in] address - BD address of the remote device
4701 * @param[in] service_uuid - uuid of the service.
4702 * @param[out] service - Structure containing the service property.
4707 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4708 const char *service_uuid,
4709 bt_gatt_service_property_t *service);
4712 * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4713 * const char *char_uuid)
4715 * @brief Gets the characteristic property from a service based on a particular char uuid
4717 * This function is an asynchronous call.
4718 * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
4720 * @return BLUETOOTH_ERROR_NONE - Success \n
4721 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4722 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4723 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4726 * @param[in] service_handle - Service handle.
4727 * @param[in] uuid - Characteristic uuid.
4732 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4733 const char *char_uuid);
4736 * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4738 * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
4740 * This function is a synchronous call.
4741 * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
4743 * @return BLUETOOTH_ERROR_NONE - Success \n
4744 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4747 * @param[in] prim_svc - GATT handle info structure
4750 * @see bluetooth_gatt_get_primary_services()
4752 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4755 * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4757 * @brief Releases the memory allocated by bluetooth_gatt_get_service_property()
4759 * This function is a synchronous call.
4760 * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
4762 * @return BLUETOOTH_ERROR_NONE - Success \n
4763 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4766 * @param[in] svc_pty - GATT service property structure.
4769 * @see bluetooth_gatt_get_service_property()
4771 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4774 * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4776 * @brief Provides characteristic value along with properties.
4778 * This function is a synchronous call.
4779 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4781 * @return BLUETOOTH_ERROR_NONE - Success \n
4782 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4785 * @param[in] char_pty - GATT characteristics property structure.
4788 * @see bluetooth_gatt_get_characteristics_property()
4790 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4793 * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4795 * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
4797 * This function is a synchronous call.
4798 * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
4800 * @return BLUETOOTH_ERROR_NONE - Success \n
4801 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4804 * @param[in] desc_pty - GATT characteristics descriptor property structure.
4807 * @see bluetooth_gatt_get_char_descriptor_property()
4809 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4812 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
4814 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
4817 * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4819 * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
4821 * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4823 * @return BLUETOOTH_ERROR_NONE - Success \n
4824 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4827 * @param[in] characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
4831 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4834 * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
4836 * @brief Read characteristic descriptor value.
4838 * This function is a asynchronous call.
4840 * @return BLUETOOTH_ERROR_NONE - Success \n
4841 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4842 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4843 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4846 * @param[in] desc_handle - Handle for Characteristic descriptor
4851 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
4854 * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4855 * const guint8 *value, int length);
4857 * @brief Set characteristic descriptor value.
4859 * This function is a asynchronous call.
4861 * @return BLUETOOTH_ERROR_NONE - Success \n
4862 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4863 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4864 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4867 * @param[in] desc_handle - Handle for Characteristic descriptor
4868 * @param[in] value - New value to set for characteristic descriptor
4869 * @param[in] length - Length of the value to be set.
4874 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4875 const guint8 *value, int length);
4877 /* @fn int bluetooth_gatt_init(void)
4879 * @brief Initializes the gatt service.
4881 * This function is a synchronous call.
4882 * @return BLUETOOTH_ERROR_NONE - Success \n
4883 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4884 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4885 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4888 * @remark Adapter should be enabled
4889 * @see bluetooth_gatt_deinit()
4891 int bluetooth_gatt_init(void);
4893 /* @fn int bluetooth_gatt_init(void)
4895 * @brief DeInitializes the gatt service.
4897 * This function is a synchronous call.
4898 * @return BLUETOOTH_ERROR_NONE - Success \n
4899 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4900 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4901 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4904 * @remark Adapter should be enabled
4905 * @see bluetooth_gatt_init()
4907 int bluetooth_gatt_deinit(void);
4909 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
4910 unsigned char **svc_path)
4912 * @brief Exports a new gatt service to the service interface.
4914 * This function is a synchronous call.
4916 * @return BLUETOOTH_ERROR_NONE - Success \n
4917 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4918 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4919 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4922 * @param[in] svc_uuid Gatt service uuid.
4923 * @param[out] svc_path service object path of the exported service.
4924 * @remark Adapter should be enabled
4925 * @see bluetooth_gatt_init()
4927 int bluetooth_gatt_add_service(const char *svc_uuid,
4930 /* @fn int bluetooth_gatt_add_new_characteristic(
4931 const char *svc_path, const char *char_uuid,
4932 bt_gatt_characteristic_property_t *properties,
4933 int flags_length, char **char_path);;
4935 * @brief Exports a new gatt characteristic to the characteristic interface.
4937 * This function is a synchronous call.
4938 * @return BLUETOOTH_ERROR_NONE - Success \n
4939 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4940 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4941 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4943 * @param[in] svc_path service object path of the exported service.
4944 * @param[in] char_uuid Gatt service uuid.
4945 * @param[in] properties GATT characteristic properties.
4946 * @param[out] char_path characteristic object path of the exported characteristic.
4948 * @remark Adapter should be enabled
4949 * @see bluetooth_gatt_add_service()
4951 int bluetooth_gatt_add_new_characteristic(
4952 const char *svc_path, const char *char_uuid,
4953 bt_gatt_characteristic_property_t properties,
4956 /* @fn bluetooth_gatt_set_characteristic_value(
4957 const char *characteristic, const char *char_value,
4960 * @brief adds gatt charactertisic value to the given charactertistic path.
4962 * This function is a synchronous call.
4963 * @return BLUETOOTH_ERROR_NONE - Success \n
4964 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4965 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4966 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4968 * @param[in] char_value Value of the GATT characteristic to be added.
4969 * @param[in] value_length length of the chantacteristic value..
4970 * @param[out] characteristic characteristic object path..
4972 * @remark Adapter should be enabled
4973 * @see bluetooth_gatt_add_service()
4975 int bluetooth_gatt_set_characteristic_value(
4976 const char *characteristic, const char *char_value,
4979 /* @fn int bluetooth_gatt_add_descriptor(const char *desc_uuid,
4980 const char *desc_value, int value_length,
4981 const char *permissions, const char *char_path,
4984 * @brief Exports a new gatt descriptor to the descriptor interface.
4986 * This function is a synchronous call.
4988 * @return BLUETOOTH_ERROR_NONE - Success \n
4989 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4990 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4991 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4994 * @param[in] desc_uuid Gatt descriptor uuid.
4995 * @param[in] desc_value GATT descriptor value.
4996 * @param[in] value_length Length of GATT descriptor value.
4997 * @param[in] permissions descriptor permissions.
4998 * @param[in] char_path characteristics object path of the exported character.
5000 * @remark Adapter should be enabled
5001 * @see bluetooth_gatt_add_service()
5002 * @see bluetooth_gatt_add_characteristics()
5004 int bluetooth_gatt_add_descriptor(const char *char_path,
5005 const char *desc_uuid,
5008 /* @fn int bluetooth_gatt_set_descriptor_value(
5009 const char *desc_path, const char *desc_value,
5012 * @brief Adds value to the given descriptor handle.
5014 * This function is a synchronous call.
5016 * @return BLUETOOTH_ERROR_NONE - Success \n
5017 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5018 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5019 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5022 * @param[in] desc_value GATT descriptor value.
5023 * @param[in] value_length Length of GATT descriptor value.
5024 * @param[in] desc_path descriptor path to which the value needs to be added.
5026 * @remark Adapter should be enabled
5027 * @see bluetooth_gatt_add_service()
5028 * @see bluetooth_gatt_add_characteristics()
5030 int bluetooth_gatt_set_descriptor_value(
5031 const char *desc_path, const char *desc_value,
5034 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5036 * @brief Reads the Service registered on manager interface.
5038 * This function is a synchronous call.
5040 * @return BLUETOOTH_ERROR_NONE - Success \n
5041 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5042 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5043 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5046 * @param[in] svc_uuid Gatt Service uuid.
5048 * @remark Adapter should be enabled and service should be registered.
5049 * @see bluetooth_gatt_register_service()
5051 int bluetooth_gatt_get_service(const char *svc_uuid);
5053 /* @fn int bluetooth_gatt_register_service(const char *svc_path)
5055 * @brief Registers the given service path with the bluez gatt server.
5057 * This function is a synchronous call.
5059 * @return BLUETOOTH_ERROR_NONE - Success \n
5060 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5061 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5062 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5065 * @param[in] svc_path service object path of the exported service.
5067 * @remark Adapter should be enabled
5068 * @see bluetooth_gatt_add_service()
5069 * @see bluetooth_gatt_add_characteristics()
5070 * @see bluetooth_gatt_add_descriptor()
5072 int bluetooth_gatt_register_service(const char *svc_path);
5074 /* @fn int bluetooth_gatt_unregister_service(const char *svc_path)
5076 * @brief Removes(unregister) service from the bluez gatt server db.
5078 * This function is a synchronous call.
5080 * @return BLUETOOTH_ERROR_NONE - Success \n
5081 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5082 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5083 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5086 * @param[in] svc_path service object path of the exported service.
5088 * @remark Adapter should be enabled
5089 * @see bluetooth_gatt_add_service()
5090 * @see bluetooth_gatt_add_characteristics()
5091 * @see bluetooth_gatt_add_descriptor()
5092 * @see bluetooth_gatt_register_service()
5094 int bluetooth_gatt_unregister_service(const char *svc_path);
5096 /* @fn int bluetooth_gatt_send_response(int request_id,
5097 * int offset, char *value, int value_length)
5099 * @brief Updates the attribute value in local attribute list.
5101 * This function is a synchronous call.
5103 * @return BLUETOOTH_ERROR_NONE - Success \n
5104 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5105 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5106 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5109 * @param[in] request_id The identification of a read request
5110 * @param[in] req_type The identification of request type (TRUE for Read request and FALSE for write request)
5111 * @param[in] resp_state The identification of response state
5112 * @param[in] offset The offset from where a value is read
5113 * @param[in] value The value to be sent. It will be sent from @a offset.
5114 * If it is NULL, a requested GATT handle's value will be sent from @a offset.
5115 * @param[in] value_length Value Length.
5117 * @remark Adapter should be enabled
5118 * @see bluetooth_gatt_add_service()
5119 * @see bluetooth_gatt_add_characteristics()
5120 * @see bluetooth_gatt_add_descriptor()
5121 * @see bluetooth_gatt_register_service()
5123 int bluetooth_gatt_send_response(int request_id, guint req_type,
5124 int resp_state, int offset, char *value, int value_length);
5126 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5128 * @brief Sets the notification property for a characteristic.
5130 * This function is a synchronous call.
5132 * @return BLUETOOTH_ERROR_NONE - Success \n
5133 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5134 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5135 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5138 * @param[in] char_path characteristic object path.
5139 * @param[in] unicast_address remote device address. if set notification is sent to only one device.
5141 * @remark Adapter should be enabled
5142 * @see bluetooth_gatt_update_characteristic()
5144 int bluetooth_gatt_server_set_notification(const char *char_path,
5145 bluetooth_device_address_t *unicast_address);
5147 /* @fn int bluetooth_gatt_delete_services(void)
5149 * @brief deletes (unregisters) all services from the gatt server database..
5151 * This function is a synchronous call.
5153 * @return BLUETOOTH_ERROR_NONE - Success \n
5154 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5155 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5156 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5160 * @remark Adapter should be enabled
5161 * @see bluetooth_gatt_add_service()
5162 * @see bluetooth_gatt_add_characteristics()
5163 * @see bluetooth_gatt_add_descriptor()
5164 * @see bluetooth_gatt_register_service()
5165 * @see bluetooth_gatt_unregister_service()
5167 int bluetooth_gatt_delete_services(void);
5169 /* @fn int bluetooth_gatt_update_characteristic(void)
5171 * @brief updates the given characteristic with a new value
5173 * This function is a synchronous call.
5175 * @return BLUETOOTH_ERROR_NONE - Success \n
5176 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5177 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5178 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5182 * @remark Adapter should be enabled
5183 * @see bluetooth_gatt_add_service()
5184 * @see bluetooth_gatt_add_characteristics()
5185 * @see bluetooth_gatt_add_descriptor()
5186 * @see bluetooth_gatt_register_service()
5187 * @see bluetooth_gatt_unregister_service()
5189 int bluetooth_gatt_update_characteristic(const char *char_path,
5190 const char* char_value, int value_length);
5193 * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5195 * @brief Set advertising status.
5197 * This function is used to enable or disable LE advertising.
5198 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5200 * This function is a synchronous call.
5202 * @return BLUETOOTH_ERROR_NONE - Success \n
5203 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5204 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5207 * @param[in] enable - The status of advertising
5210 * @see bluetooth_set_advertising_data
5212 int bluetooth_set_advertising(int handle, gboolean enable);
5215 * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5217 * @brief Set advertising status along with interval value.
5219 * This function is used to enable or disable LE advertising.
5220 * Interval_min and Interval_max is used to set the best advertising interval.
5221 * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5223 * This function is a synchronous call.
5225 * @return BLUETOOTH_ERROR_NONE - Success \n
5226 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5227 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5230 * @param[in] enable - The status of advertising
5231 * @param[in] interval_min - Minimum interval of advertising (msec)
5232 * @param[in] interval_max - Maximum interval of advertising (msec)
5233 * @param[in] filter_policy - Advertising filter policy
5236 * @see bluetooth_set_advertising_data
5238 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5239 bluetooth_advertising_params_t *params);
5242 * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5243 * @brief Get the advertising data
5245 * This function is used to get advertising data.
5246 * Before calling this API, the adapter should be enabled.
5248 * This function is a synchronous call.
5250 * @return BLUETOOTH_ERROR_NONE - Success \n
5251 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5252 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5253 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5255 * @param[out] value - Advertising data structure.
5256 * @param[out] length - The length of Advertising data.
5260 bluetooth_advertising_data_t *value = { {0} };
5263 ret = bluetooth_get_advertising_data(&value, &length);
5266 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5269 * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5271 * @brief Set advertising data with value
5273 * This function is used to set advertising data and Maximum size of advertising data
5274 * is 28 byte (Except Flag)
5276 * This function is a synchronous call.
5278 * @return BLUETOOTH_ERROR_NONE - Success \n
5279 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5280 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5283 * @param[in] value - Advertising data structure.
5287 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5290 * @fn int bluetooth_check_privilege_advertising_parameter(void);
5292 * @brief Check the privilege for advertising parameter setting
5294 * This function is a synchronous call.
5296 * @return BLUETOOTH_ERROR_NONE - Success \n
5297 * BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5303 int bluetooth_check_privilege_advertising_parameter(void);
5306 * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5307 * @brief Get the LE scan response data
5309 * This function is used to get scan response data.
5310 * Before calling this API, the adapter should be enabled.
5312 * This function is a synchronous call.
5314 * @return BLUETOOTH_ERROR_NONE - Success \n
5315 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5316 * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5317 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5319 * @param[out] value - Scan response data structure.
5320 * @param[out] length - The length of Scan response data.
5324 bluetooth_scan_resp_data_t *value = { {0} };
5327 ret = bluetooth_get_scan_response_data(&value, &length);
5330 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5333 * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5335 * @brief Set scan response data with value
5337 * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5339 * This function is a synchronous call.
5341 * @return BLUETOOTH_ERROR_NONE - Success \n
5342 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5343 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5346 * @param[in] value - LE Scan response data structure.
5350 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5353 * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5355 * @brief Set scan interval and window
5357 * This function is used to set LE scan interval and window size
5359 * This function is a synchronous call.
5361 * @return BLUETOOTH_ERROR_NONE - Success \n
5362 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5363 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5366 * @param[in] interval - Interval of LE scan (msec)
5367 * @param[in] window - Window size of LE scan (msec)
5371 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5374 * @fn int bluetooth_is_advertising(void)
5375 * @brief Check for the advertising is in-progress or not.
5377 * This API is used to check the current status of the advertising procedure.
5378 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5381 * This function checks whether the advertising is started or not.
5383 * This function is a synchronous call.
5385 * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c false = not in progress)
5387 * @return BLUETOOTH_ERROR_NONE - Success \n
5388 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5391 * @see bluetooth_set_advertising, bluetooth_set_custom_advertising
5395 gboolean is_advertising = 0;
5397 ret = bluetooth_is_advertising(&is_advertising);
5400 int bluetooth_is_advertising(gboolean *is_advertising);
5403 * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5404 * @brief Add LE device to white list
5406 * This API is used to add LE device to white list
5407 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5411 * This function is a synchronous call.
5413 * @param[in] address The address of remote device
5415 * @return BLUETOOTH_ERROR_NONE - Success \n
5416 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5419 * @see bluetooth_set_custom_advertising
5421 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5424 * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5425 * @brief Remove LE device from white list
5427 * This API is used to remove LE device from white list
5428 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5432 * This function is a synchronous call.
5434 * @param[in] address The address of remote device
5436 * @return BLUETOOTH_ERROR_NONE - Success \n
5437 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5440 * @see bluetooth_set_custom_advertising
5442 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5445 * @fn int bluetooth_clear_white_list(void)
5446 * @brief Clear white list
5448 * This API is used to clear white list
5449 * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5453 * This function is a synchronous call.
5455 * @param[in] address The address of remote device
5457 * @return BLUETOOTH_ERROR_NONE - Success \n
5458 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5461 * @see bluetooth_set_custom_advertising
5463 int bluetooth_clear_white_list(void);
5466 * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5467 * const bluetooth_le_connection_param_t *parameters)
5468 * @brief update connection paramter of LE connection.
5470 * This function is a synchronous call.
5472 * @return BLUETOOTH_ERROR_NONE - Success \n
5473 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5476 * @param[in] address - remote device address value.
5477 * @param[in] parameters - new connection parameters.
5480 * @see bluetooth_bond_device
5482 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5483 const bluetooth_le_connection_param_t *parameters);
5487 * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5489 * @brief Enable/Disable LE Privacy feature.
5491 * This function is used to enable or disable LE Privacy feature.
5492 * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5494 * This function is a synchronous call.
5496 * @return BLUETOOTH_ERROR_NONE - Success \n
5497 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5498 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5501 * @param[in] enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5505 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5508 * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
5509 * bluetooth_le_connection_mode_t mode)
5510 * @brief update connection paramter of LE connection.
5512 * This function is a synchronous call.
5514 * @return BLUETOOTH_ERROR_NONE - Success \n
5515 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5516 * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
5519 * @param[in] address - remote device address value.
5520 * @param[in] mode - new connection mode.
5524 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
5525 bluetooth_le_connection_mode_t mode);
5528 * @fn int bluetooth_le_read_maximum_data_length()
5529 * @brief reads the maximum LE data length supported in the controller.
5531 * This function is a synchronous call.
5533 * @return BLUETOOTH_ERROR_NONE - Success \n
5534 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5540 int bluetooth_le_read_maximum_data_length(
5541 bluetooth_le_read_maximum_data_length_t *max_le_datalength);
5543 * @fn int bluetooth_le_write_host_suggested_default_data_length()
5544 * @brief writes the host suggested values for the controllers max transmitted no of payload
5545 * octects to be used for new connections.
5547 * This function is a synchronous call.
5549 * @return BLUETOOTH_ERROR_NONE - Success \n
5550 * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5556 int bluetooth_le_write_host_suggested_default_data_length(
5557 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
5559 int bluetooth_le_read_suggested_default_data_length(
5560 bluetooth_le_read_host_suggested_data_length_t *le_data_length);
5562 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
5563 const unsigned int max_tx_octets, const unsigned int max_tx_time);
5565 int bluetooth_pbap_init(void);
5566 int bluetooth_pbap_deinit(void);
5567 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
5568 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
5569 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
5570 bt_pbap_folder_t *folder);
5571 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
5572 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
5573 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
5574 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
5575 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
5576 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
5577 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
5578 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
5581 * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5583 * @brief Set manufacturer data with value
5585 * This function is used to set manufacturer data.
5587 * This function is a synchronous call.
5589 * @return BLUETOOTH_ERROR_NONE - Success \n
5590 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5591 * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5594 * @param[in] value - Manufacturer data structure.
5598 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5605 #endif /* __cplusplus */
5606 #endif /* _BLUETOOTH_API_H_*/