OSDN Git Service

LE: Add support for the HID-over-GATT profile (1/3)
[android-x86/system-bt.git] / stack / srvc / srvc_battery_int.h
1 /*****************************************************************************
2 **
3 **  Name:          srvc_battery_int.h
4 **
5 **  Description:   this file contains the Battery service internal interface
6 **                 definitions.
7 **
8 **
9 **  Copyright (c) 1999-2008, Broadcom Corp., All Rights Reserved.
10 **  WIDCOMM Bluetooth Core. Proprietary and confidential.
11 ******************************************************************************/
12
13 #ifndef SRVC_BATTERY_INT_H
14 #define SRVC_BATTERY_INT_H
15
16 #include "bt_target.h"
17 #include "srvc_api.h"
18 #include "gatt_api.h"
19
20 #ifndef BA_MAX_INT_NUM
21 #define BA_MAX_INT_NUM     4
22 #endif
23
24 #define BATTERY_LEVEL_SIZE      1
25
26
27 typedef struct
28 {
29     UINT8           app_id;
30     UINT16          ba_level_hdl;
31     UINT16          clt_cfg_hdl;
32     UINT16          rpt_ref_hdl;
33     UINT16          pres_fmt_hdl;
34
35     tBA_CBACK       *p_cback;
36
37     UINT16          pending_handle;
38     UINT8           pending_clcb_idx;
39     UINT8           pending_evt;
40
41 }tBA_INST;
42
43 typedef struct
44 {
45     tBA_INST                battery_inst[BA_MAX_INT_NUM];
46     UINT8                   inst_id;
47     BOOLEAN                 enabled;
48
49 }tBATTERY_CB;
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 /* Global GATT data */
56 #if GATT_DYNAMIC_MEMORY == FALSE
57 GATT_API extern tBATTERY_CB battery_cb;
58 #else
59 GATT_API extern tBATTERY_CB *battery_cb_ptr;
60 #define battery_cb (*battery_cb_ptr)
61 #endif
62
63
64 extern BOOLEAN battery_valid_handle_range(UINT16 handle);
65
66 extern UINT8 battery_s_write_attr_value(UINT8 clcb_idx, tGATT_WRITE_REQ * p_value,
67                                  tGATT_STATUS *p_status);
68 extern UINT8 battery_s_read_attr_value (UINT8 clcb_idx, UINT16 handle, tGATT_VALUE *p_value, BOOLEAN is_long, tGATT_STATUS* p_status);
69
70
71
72 #ifdef __cplusplus
73 }
74 #endif
75 #endif