blob: 9a19ee5126e2600207423716e363ad2875aab6fd [file] [log] [blame]
Andre Eisenbach05f49542012-09-18 12:15:26 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#ifndef ANDROID_INCLUDE_BLUETOOTH_H
18#define ANDROID_INCLUDE_BLUETOOTH_H
19
Sharvil Nanavati3bd8cba2014-05-30 16:43:38 -070020#include <stdbool.h>
Andre Eisenbach05f49542012-09-18 12:15:26 -070021#include <stdint.h>
22#include <sys/cdefs.h>
23#include <sys/types.h>
24
25#include <hardware/hardware.h>
26
27__BEGIN_DECLS
28
29/**
30 * The Bluetooth Hardware Module ID
31 */
32
33#define BT_HARDWARE_MODULE_ID "bluetooth"
34#define BT_STACK_MODULE_ID "bluetooth"
35#define BT_STACK_TEST_MODULE_ID "bluetooth_test"
36
37
38/* Bluetooth profile interface IDs */
39
40#define BT_PROFILE_HANDSFREE_ID "handsfree"
Hemant Guptae7737c82013-08-19 18:02:54 +053041#define BT_PROFILE_HANDSFREE_CLIENT_ID "handsfree_client"
Andre Eisenbach05f49542012-09-18 12:15:26 -070042#define BT_PROFILE_ADVANCED_AUDIO_ID "a2dp"
Mike Lockwood21e50b12014-06-07 14:05:22 -070043#define BT_PROFILE_ADVANCED_AUDIO_SINK_ID "a2dp_sink"
Andre Eisenbach05f49542012-09-18 12:15:26 -070044#define BT_PROFILE_HEALTH_ID "health"
45#define BT_PROFILE_SOCKETS_ID "socket"
46#define BT_PROFILE_HIDHOST_ID "hidhost"
47#define BT_PROFILE_PAN_ID "pan"
Hemant Gupta053cccf2014-04-18 12:25:24 +053048#define BT_PROFILE_MAP_CLIENT_ID "map_client"
Andre Eisenbach05f49542012-09-18 12:15:26 -070049
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -080050#define BT_PROFILE_GATT_ID "gatt"
Ravi Nagarajan482ba782013-02-26 10:34:41 -080051#define BT_PROFILE_AV_RC_ID "avrcp"
Mike Lockwood7da4cb82014-06-02 16:20:51 -070052#define BT_PROFILE_AV_RC_CTRL_ID "avrcp_ctrl"
Andre Eisenbach05f49542012-09-18 12:15:26 -070053
54/** Bluetooth Address */
55typedef struct {
56 uint8_t address[6];
57} __attribute__((packed))bt_bdaddr_t;
58
59/** Bluetooth Device Name */
60typedef struct {
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -080061 uint8_t name[249];
Andre Eisenbach05f49542012-09-18 12:15:26 -070062} __attribute__((packed))bt_bdname_t;
63
64/** Bluetooth Adapter Visibility Modes*/
65typedef enum {
66 BT_SCAN_MODE_NONE,
67 BT_SCAN_MODE_CONNECTABLE,
68 BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE
69} bt_scan_mode_t;
70
71/** Bluetooth Adapter State */
72typedef enum {
73 BT_STATE_OFF,
74 BT_STATE_ON
75} bt_state_t;
76
77/** Bluetooth Error Status */
78/** We need to build on this */
79
80typedef enum {
81 BT_STATUS_SUCCESS,
82 BT_STATUS_FAIL,
83 BT_STATUS_NOT_READY,
84 BT_STATUS_NOMEM,
85 BT_STATUS_BUSY,
86 BT_STATUS_DONE, /* request already completed */
87 BT_STATUS_UNSUPPORTED,
88 BT_STATUS_PARM_INVALID,
89 BT_STATUS_UNHANDLED,
90 BT_STATUS_AUTH_FAILURE,
Hemant Gupta4d864552013-07-31 19:14:02 +053091 BT_STATUS_RMT_DEV_DOWN,
92 BT_STATUS_AUTH_REJECTED
Andre Eisenbach05f49542012-09-18 12:15:26 -070093
94} bt_status_t;
95
96/** Bluetooth PinKey Code */
97typedef struct {
98 uint8_t pin[16];
99} __attribute__((packed))bt_pin_code_t;
100
Satya Callojibe7f0442014-07-03 10:59:16 -0700101typedef struct {
102 uint8_t status;
103 uint8_t ctrl_state; /* stack reported state */
104 uint64_t tx_time; /* in ms */
105 uint64_t rx_time; /* in ms */
106 uint64_t idle_time; /* in ms */
107 uint64_t energy_used; /* a product of mA, V and ms */
108} __attribute__((packed))bt_activity_energy_info;
109
Andre Eisenbach05f49542012-09-18 12:15:26 -0700110/** Bluetooth Adapter Discovery state */
111typedef enum {
112 BT_DISCOVERY_STOPPED,
113 BT_DISCOVERY_STARTED
114} bt_discovery_state_t;
115
116/** Bluetooth ACL connection state */
117typedef enum {
118 BT_ACL_STATE_CONNECTED,
119 BT_ACL_STATE_DISCONNECTED
120} bt_acl_state_t;
121
122/** Bluetooth 128-bit UUID */
123typedef struct {
124 uint8_t uu[16];
125} bt_uuid_t;
126
127/** Bluetooth SDP service record */
128typedef struct
129{
130 bt_uuid_t uuid;
131 uint16_t channel;
132 char name[256]; // what's the maximum length
133} bt_service_record_t;
134
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -0800135
136/** Bluetooth Remote Version info */
137typedef struct
138{
139 int version;
140 int sub_ver;
141 int manufacturer;
142} bt_remote_version_t;
143
Ganesh Ganapathi Batta460343a2014-05-27 16:03:11 -0700144typedef struct
145{
146 uint8_t local_privacy_enabled;
147 uint8_t max_adv_instance;
148 uint8_t rpa_offload_supported;
149 uint8_t max_irk_list_size;
150 uint8_t max_adv_filter_supported;
Prerepa Viswanadham378de1a2014-07-30 15:10:39 -0700151 uint8_t scan_result_storage_size_lobyte;
152 uint8_t scan_result_storage_size_hibyte;
Satya Callojibe7f0442014-07-03 10:59:16 -0700153 uint8_t activity_energy_info_supported;
Ganesh Ganapathi Batta460343a2014-05-27 16:03:11 -0700154}bt_local_le_features_t;
155
Nitin Shivpure59aa62a2014-05-20 18:06:38 +0530156/* Bluetooth Remote DI record */
157typedef struct
158{
159 int vendor;
160 int vendor_id_source;
161 int product;
162 int version;
163 int spec_id;
164} bt_remote_di_record_t;
165
Andre Eisenbach05f49542012-09-18 12:15:26 -0700166/* Bluetooth Adapter and Remote Device property types */
167typedef enum {
168 /* Properties common to both adapter and remote device */
169 /**
170 * Description - Bluetooth Device Name
171 * Access mode - Adapter name can be GET/SET. Remote device can be GET
172 * Data type - bt_bdname_t
173 */
174 BT_PROPERTY_BDNAME = 0x1,
175 /**
176 * Description - Bluetooth Device Address
177 * Access mode - Only GET.
178 * Data type - bt_bdaddr_t
179 */
180 BT_PROPERTY_BDADDR,
181 /**
182 * Description - Bluetooth Service 128-bit UUIDs
183 * Access mode - Only GET.
184 * Data type - Array of bt_uuid_t (Array size inferred from property length).
185 */
186 BT_PROPERTY_UUIDS,
187 /**
188 * Description - Bluetooth Class of Device as found in Assigned Numbers
189 * Access mode - Only GET.
190 * Data type - uint32_t.
191 */
192 BT_PROPERTY_CLASS_OF_DEVICE,
193 /**
194 * Description - Device Type - BREDR, BLE or DUAL Mode
195 * Access mode - Only GET.
196 * Data type - bt_device_type_t
197 */
198 BT_PROPERTY_TYPE_OF_DEVICE,
199 /**
200 * Description - Bluetooth Service Record
201 * Access mode - Only GET.
202 * Data type - bt_service_record_t
203 */
204 BT_PROPERTY_SERVICE_RECORD,
205
206 /* Properties unique to adapter */
207 /**
208 * Description - Bluetooth Adapter scan mode
209 * Access mode - GET and SET
210 * Data type - bt_scan_mode_t.
211 */
212 BT_PROPERTY_ADAPTER_SCAN_MODE,
213 /**
214 * Description - List of bonded devices
215 * Access mode - Only GET.
216 * Data type - Array of bt_bdaddr_t of the bonded remote devices
217 * (Array size inferred from property length).
218 */
219 BT_PROPERTY_ADAPTER_BONDED_DEVICES,
220 /**
221 * Description - Bluetooth Adapter Discovery timeout (in seconds)
222 * Access mode - GET and SET
223 * Data type - uint32_t
224 */
225 BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
226
227 /* Properties unique to remote device */
228 /**
229 * Description - User defined friendly name of the remote device
230 * Access mode - GET and SET
231 * Data type - bt_bdname_t.
232 */
233 BT_PROPERTY_REMOTE_FRIENDLY_NAME,
234 /**
235 * Description - RSSI value of the inquired remote device
236 * Access mode - Only GET.
237 * Data type - int32_t.
238 */
239 BT_PROPERTY_REMOTE_RSSI,
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -0800240 /**
241 * Description - Remote version info
242 * Access mode - SET/GET.
243 * Data type - bt_remote_version_t.
244 */
245
246 BT_PROPERTY_REMOTE_VERSION_INFO,
Andre Eisenbach05f49542012-09-18 12:15:26 -0700247
Ganesh Ganapathi Batta460343a2014-05-27 16:03:11 -0700248 /**
249 * Description - Local LE features
250 * Access mode - GET.
251 * Data type - bt_local_le_features_t.
252 */
253 BT_PROPERTY_LOCAL_LE_FEATURES,
254
Nitin Shivpure59aa62a2014-05-20 18:06:38 +0530255 /* Properties unique to remote device */
256 /**
257 * Description - DI Record of the remote device
258 * Access mode - GET
259 * Data type - bt_remote_di_record_t.
260 */
261 BT_PROPERTY_REMOTE_DI_RECORD = 0xFE,
262
Andre Eisenbach05f49542012-09-18 12:15:26 -0700263 BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP = 0xFF,
264} bt_property_type_t;
265
266/** Bluetooth Adapter Property data structure */
267typedef struct
268{
269 bt_property_type_t type;
270 int len;
271 void *val;
272} bt_property_t;
273
Ganesh Ganapathi Batta460343a2014-05-27 16:03:11 -0700274
Andre Eisenbach05f49542012-09-18 12:15:26 -0700275/** Bluetooth Device Type */
276typedef enum {
277 BT_DEVICE_DEVTYPE_BREDR = 0x1,
278 BT_DEVICE_DEVTYPE_BLE,
279 BT_DEVICE_DEVTYPE_DUAL
280} bt_device_type_t;
281/** Bluetooth Bond state */
282typedef enum {
283 BT_BOND_STATE_NONE,
284 BT_BOND_STATE_BONDING,
285 BT_BOND_STATE_BONDED
286} bt_bond_state_t;
287
288/** Bluetooth SSP Bonding Variant */
289typedef enum {
290 BT_SSP_VARIANT_PASSKEY_CONFIRMATION,
291 BT_SSP_VARIANT_PASSKEY_ENTRY,
292 BT_SSP_VARIANT_CONSENT,
293 BT_SSP_VARIANT_PASSKEY_NOTIFICATION
294} bt_ssp_variant_t;
295
296#define BT_MAX_NUM_UUIDS 32
297
298/** Bluetooth Interface callbacks */
299
300/** Bluetooth Enable/Disable Callback. */
301typedef void (*adapter_state_changed_callback)(bt_state_t state);
302
303/** GET/SET Adapter Properties callback */
304/* TODO: For the GET/SET property APIs/callbacks, we may need a session
305 * identifier to associate the call with the callback. This would be needed
306 * whenever more than one simultaneous instance of the same adapter_type
307 * is get/set.
308 *
309 * If this is going to be handled in the Java framework, then we do not need
310 * to manage sessions here.
311 */
312typedef void (*adapter_properties_callback)(bt_status_t status,
313 int num_properties,
314 bt_property_t *properties);
315
316/** GET/SET Remote Device Properties callback */
317/** TODO: For remote device properties, do not see a need to get/set
318 * multiple properties - num_properties shall be 1
319 */
320typedef void (*remote_device_properties_callback)(bt_status_t status,
321 bt_bdaddr_t *bd_addr,
322 int num_properties,
323 bt_property_t *properties);
324
325/** New device discovered callback */
326/** If EIR data is not present, then BD_NAME and RSSI shall be NULL and -1
327 * respectively */
328typedef void (*device_found_callback)(int num_properties,
329 bt_property_t *properties);
330
331/** Discovery state changed callback */
332typedef void (*discovery_state_changed_callback)(bt_discovery_state_t state);
333
334/** Bluetooth Legacy PinKey Request callback */
335typedef void (*pin_request_callback)(bt_bdaddr_t *remote_bd_addr,
336 bt_bdname_t *bd_name, uint32_t cod);
337
338/** Bluetooth SSP Request callback - Just Works & Numeric Comparison*/
339/** pass_key - Shall be 0 for BT_SSP_PAIRING_VARIANT_CONSENT &
340 * BT_SSP_PAIRING_PASSKEY_ENTRY */
341/* TODO: Passkey request callback shall not be needed for devices with display
342 * capability. We still need support this in the stack for completeness */
343typedef void (*ssp_request_callback)(bt_bdaddr_t *remote_bd_addr,
344 bt_bdname_t *bd_name,
345 uint32_t cod,
346 bt_ssp_variant_t pairing_variant,
347 uint32_t pass_key);
348
349/** Bluetooth Bond state changed callback */
350/* Invoked in response to create_bond, cancel_bond or remove_bond */
351typedef void (*bond_state_changed_callback)(bt_status_t status,
352 bt_bdaddr_t *remote_bd_addr,
353 bt_bond_state_t state);
354
355/** Bluetooth ACL connection state changed callback */
356typedef void (*acl_state_changed_callback)(bt_status_t status, bt_bdaddr_t *remote_bd_addr,
357 bt_acl_state_t state);
358
359typedef enum {
360 ASSOCIATE_JVM,
361 DISASSOCIATE_JVM
362} bt_cb_thread_evt;
363
364/** Thread Associate/Disassociate JVM Callback */
365/* Callback that is invoked by the callback thread to allow upper layer to attach/detach to/from
366 * the JVM */
367typedef void (*callback_thread_event)(bt_cb_thread_evt evt);
368
369/** Bluetooth Test Mode Callback */
370/* Receive any HCI event from controller. Must be in DUT Mode for this callback to be received */
371typedef void (*dut_mode_recv_callback)(uint16_t opcode, uint8_t *buf, uint8_t len);
372
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -0800373/* LE Test mode callbacks
374* This callback shall be invoked whenever the le_tx_test, le_rx_test or le_test_end is invoked
375* The num_packets is valid only for le_test_end command */
376typedef void (*le_test_mode_callback)(bt_status_t status, uint16_t num_packets);
Satya Callojibe7f0442014-07-03 10:59:16 -0700377
378/** Callback invoked when energy details are obtained */
379/* Ctrl_state-Current controller state-Active-1,scan-2,or idle-3 state as defined by HCI spec.
380 * If the ctrl_state value is 0, it means the API call failed
381 * Time values-In milliseconds as returned by the controller
382 * Energy used-Value as returned by the controller
383 * Status-Provides the status of the read_energy_info API call */
384typedef void (*energy_info_callback)(bt_activity_energy_info *energy_info);
385
Andre Eisenbach05f49542012-09-18 12:15:26 -0700386/** TODO: Add callbacks for Link Up/Down and other generic
387 * notifications/callbacks */
388
389/** Bluetooth DM callback structure. */
390typedef struct {
391 /** set to sizeof(bt_callbacks_t) */
392 size_t size;
393 adapter_state_changed_callback adapter_state_changed_cb;
394 adapter_properties_callback adapter_properties_cb;
395 remote_device_properties_callback remote_device_properties_cb;
396 device_found_callback device_found_cb;
397 discovery_state_changed_callback discovery_state_changed_cb;
398 pin_request_callback pin_request_cb;
399 ssp_request_callback ssp_request_cb;
400 bond_state_changed_callback bond_state_changed_cb;
401 acl_state_changed_callback acl_state_changed_cb;
402 callback_thread_event thread_evt_cb;
403 dut_mode_recv_callback dut_mode_recv_cb;
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -0800404 le_test_mode_callback le_test_mode_cb;
Satya Callojibe7f0442014-07-03 10:59:16 -0700405 energy_info_callback energy_info_cb;
Andre Eisenbach05f49542012-09-18 12:15:26 -0700406} bt_callbacks_t;
407
Sharvil Nanavati3bd8cba2014-05-30 16:43:38 -0700408typedef void (*alarm_cb)(void *data);
409typedef bool (*set_wake_alarm_callout)(uint64_t delay_millis, bool should_wake, alarm_cb cb, void *data);
410typedef int (*acquire_wake_lock_callout)(const char *lock_name);
411typedef int (*release_wake_lock_callout)(const char *lock_name);
412
413/** The set of functions required by bluedroid to set wake alarms and
414 * grab wake locks. This struct is passed into the stack through the
415 * |set_os_callouts| function on |bt_interface_t|.
416 */
417typedef struct {
418 /* set to sizeof(bt_os_callouts_t) */
419 size_t size;
420
421 set_wake_alarm_callout set_wake_alarm;
422 acquire_wake_lock_callout acquire_wake_lock;
423 release_wake_lock_callout release_wake_lock;
424} bt_os_callouts_t;
425
Andre Eisenbach05f49542012-09-18 12:15:26 -0700426/** NOTE: By default, no profiles are initialized at the time of init/enable.
427 * Whenever the application invokes the 'init' API of a profile, then one of
428 * the following shall occur:
429 *
430 * 1.) If Bluetooth is not enabled, then the Bluetooth core shall mark the
431 * profile as enabled. Subsequently, when the application invokes the
432 * Bluetooth 'enable', as part of the enable sequence the profile that were
433 * marked shall be enabled by calling appropriate stack APIs. The
434 * 'adapter_properties_cb' shall return the list of UUIDs of the
435 * enabled profiles.
436 *
437 * 2.) If Bluetooth is enabled, then the Bluetooth core shall invoke the stack
438 * profile API to initialize the profile and trigger a
439 * 'adapter_properties_cb' with the current list of UUIDs including the
440 * newly added profile's UUID.
441 *
442 * The reverse shall occur whenever the profile 'cleanup' APIs are invoked
443 */
444
445/** Represents the standard Bluetooth DM interface. */
446typedef struct {
447 /** set to sizeof(bt_interface_t) */
448 size_t size;
449 /**
450 * Opens the interface and provides the callback routines
451 * to the implemenation of this interface.
452 */
453 int (*init)(bt_callbacks_t* callbacks );
454
455 /** Enable Bluetooth. */
456 int (*enable)(void);
457
458 /** Disable Bluetooth. */
459 int (*disable)(void);
460
461 /** Closes the interface. */
462 void (*cleanup)(void);
463
464 /** Get all Bluetooth Adapter properties at init */
465 int (*get_adapter_properties)(void);
466
467 /** Get Bluetooth Adapter property of 'type' */
468 int (*get_adapter_property)(bt_property_type_t type);
469
470 /** Set Bluetooth Adapter property of 'type' */
471 /* Based on the type, val shall be one of
472 * bt_bdaddr_t or bt_bdname_t or bt_scanmode_t etc
473 */
474 int (*set_adapter_property)(const bt_property_t *property);
475
476 /** Get all Remote Device properties */
477 int (*get_remote_device_properties)(bt_bdaddr_t *remote_addr);
478
479 /** Get Remote Device property of 'type' */
480 int (*get_remote_device_property)(bt_bdaddr_t *remote_addr,
481 bt_property_type_t type);
482
483 /** Set Remote Device property of 'type' */
484 int (*set_remote_device_property)(bt_bdaddr_t *remote_addr,
485 const bt_property_t *property);
486
487 /** Get Remote Device's service record for the given UUID */
488 int (*get_remote_service_record)(bt_bdaddr_t *remote_addr,
489 bt_uuid_t *uuid);
490
491 /** Start SDP to get remote services */
492 int (*get_remote_services)(bt_bdaddr_t *remote_addr);
493
494 /** Start Discovery */
495 int (*start_discovery)(void);
496
497 /** Cancel Discovery */
498 int (*cancel_discovery)(void);
499
500 /** Create Bluetooth Bonding */
Andre Eisenbach01206e52014-08-04 17:22:29 -0700501 int (*create_bond)(const bt_bdaddr_t *bd_addr, int transport);
Andre Eisenbach05f49542012-09-18 12:15:26 -0700502
503 /** Remove Bond */
504 int (*remove_bond)(const bt_bdaddr_t *bd_addr);
505
506 /** Cancel Bond */
507 int (*cancel_bond)(const bt_bdaddr_t *bd_addr);
508
Andre Eisenbach0d553bc2014-06-18 12:18:34 -0700509 /**
510 * Get the connection status for a given remote device.
511 * return value of 0 means the device is not connected,
512 * non-zero return status indicates an active connection.
513 */
514 int (*get_connection_state)(const bt_bdaddr_t *bd_addr);
515
Andre Eisenbach05f49542012-09-18 12:15:26 -0700516 /** BT Legacy PinKey Reply */
517 /** If accept==FALSE, then pin_len and pin_code shall be 0x0 */
518 int (*pin_reply)(const bt_bdaddr_t *bd_addr, uint8_t accept,
519 uint8_t pin_len, bt_pin_code_t *pin_code);
520
521 /** BT SSP Reply - Just Works, Numeric Comparison and Passkey
522 * passkey shall be zero for BT_SSP_VARIANT_PASSKEY_COMPARISON &
523 * BT_SSP_VARIANT_CONSENT
524 * For BT_SSP_VARIANT_PASSKEY_ENTRY, if accept==FALSE, then passkey
525 * shall be zero */
526 int (*ssp_reply)(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t variant,
527 uint8_t accept, uint32_t passkey);
528
529 /** Get Bluetooth profile interface */
530 const void* (*get_profile_interface) (const char *profile_id);
531
532 /** Bluetooth Test Mode APIs - Bluetooth must be enabled for these APIs */
533 /* Configure DUT Mode - Use this mode to enter/exit DUT mode */
534 int (*dut_mode_configure)(uint8_t enable);
535
536 /* Send any test HCI (vendor-specific) command to the controller. Must be in DUT Mode */
537 int (*dut_mode_send)(uint16_t opcode, uint8_t *buf, uint8_t len);
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -0800538 /** BLE Test Mode APIs */
539 /* opcode MUST be one of: LE_Receiver_Test, LE_Transmitter_Test, LE_Test_End */
540 int (*le_test_mode)(uint16_t opcode, uint8_t *buf, uint8_t len);
541
Zhihai Xua17b75b2013-06-10 20:23:45 -0700542 /* enable or disable bluetooth HCI snoop log */
543 int (*config_hci_snoop_log)(uint8_t enable);
Sharvil Nanavati3bd8cba2014-05-30 16:43:38 -0700544
545 /** Sets the OS call-out functions that bluedroid needs for alarms and wake locks.
546 * This should be called immediately after a successful |init|.
547 */
548 int (*set_os_callouts)(bt_os_callouts_t *callouts);
Satya Callojibe7f0442014-07-03 10:59:16 -0700549
550 /** Read Energy info details - return value indicates BT_STATUS_SUCCESS or BT_STATUS_NOT_READY
551 * Success indicates that the VSC command was sent to controller
552 */
553 int (*read_energy_info)();
Pramod Sivaramanca854b32013-09-24 19:13:26 +0530554 /** BT stack Test interface */
555 const void* (*get_testapp_interface)(int test_app_profile);
Andre Eisenbach05f49542012-09-18 12:15:26 -0700556} bt_interface_t;
557
558/** TODO: Need to add APIs for Service Discovery, Service authorization and
559 * connection management. Also need to add APIs for configuring
560 * properties of remote bonded devices such as name, UUID etc. */
561
562typedef struct {
563 struct hw_device_t common;
564 const bt_interface_t* (*get_bluetooth_interface)();
565} bluetooth_device_t;
566
567typedef bluetooth_device_t bluetooth_module_t;
568__END_DECLS
569
570#endif /* ANDROID_INCLUDE_BLUETOOTH_H */