blob: 42e14c2f15e4832dcf5388cd758da4d5e7bd6c72 [file] [log] [blame]
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -08001/*
2 * Copyright (C) 2013 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
18#ifndef ANDROID_INCLUDE_BT_GATT_H
19#define ANDROID_INCLUDE_BT_GATT_H
20
21#include <stdint.h>
22#include "bt_gatt_client.h"
23#include "bt_gatt_server.h"
24
25__BEGIN_DECLS
26
27/** BT-GATT callbacks */
28typedef struct {
29 /** Set to sizeof(btgatt_callbacks_t) */
30 size_t size;
31
32 /** GATT Client callbacks */
33 const btgatt_client_callbacks_t* client;
34
35 /** GATT Server callbacks */
36 const btgatt_server_callbacks_t* server;
37} btgatt_callbacks_t;
38
39/** Represents the standard Bluetooth GATT interface. */
40typedef struct {
41 /** Set to sizeof(btgatt_interface_t) */
42 size_t size;
43
44 /**
45 * Initializes the interface and provides callback routines
46 */
47 bt_status_t (*init)( const btgatt_callbacks_t* callbacks );
48
49 /** Closes the interface */
50 void (*cleanup)( void );
51
52 /** Pointer to the GATT client interface methods.*/
53 const btgatt_client_interface_t* client;
54
55 /** Pointer to the GATT server interface methods.*/
56 const btgatt_server_interface_t* server;
57} btgatt_interface_t;
58
59__END_DECLS
60
61#endif /* ANDROID_INCLUDE_BT_GATT_H */