srvc_dis_int.h revision 911d1ae03efec2d54c3b1b605589d790d1745488
1/******************************************************************************
2 *
3 *  Copyright (C) 1999-2012 Broadcom Corporation
4 *
5 *  Licensed under the Apache License, Version 2.0 (the "License");
6 *  you may not use this file except in compliance with the License.
7 *  You may obtain a copy of the License at:
8 *
9 *  http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 *
17 ******************************************************************************/
18
19#ifndef SRVC_DIS_INT_H
20#define SRVC_DIS_INT_H
21
22#include "bt_target.h"
23#include "gatt_api.h"
24#include "srvc_api.h"
25#include "srvc_eng_int.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#define DIS_MAX_CHAR_NUM 9
32
33typedef struct {
34  uint16_t uuid;
35  uint16_t handle;
36} tDIS_DB_ENTRY;
37
38#define DIS_SYSTEM_ID_SIZE 8
39#define DIS_PNP_ID_SIZE 7
40
41typedef struct {
42  tDIS_DB_ENTRY dis_attr[DIS_MAX_CHAR_NUM];
43  tDIS_VALUE dis_value;
44
45  tDIS_READ_CBACK* p_read_dis_cback;
46
47  uint16_t service_handle;
48  uint16_t max_handle;
49
50  bool enabled;
51
52  uint8_t dis_read_uuid_idx;
53
54  tDIS_ATTR_MASK request_mask;
55} tDIS_CB;
56
57/* Global GATT data */
58extern tDIS_CB dis_cb;
59
60extern bool dis_valid_handle_range(uint16_t handle);
61extern uint8_t dis_read_attr_value(uint8_t clcb_idx, uint16_t handle,
62                                   tGATT_VALUE* p_value, bool is_long,
63                                   tGATT_STATUS* p_status);
64extern uint8_t dis_write_attr_value(tGATT_WRITE_REQ* p_data,
65                                    tGATT_STATUS* p_status);
66
67extern void dis_c_cmpl_cback(tSRVC_CLCB* p_clcb, tGATTC_OPTYPE op,
68                             tGATT_STATUS status, tGATT_CL_COMPLETE* p_data);
69
70#ifdef __cplusplus
71}
72#endif
73#endif
74