blob: 343e5fa9251429075d4b1aaca19a2236aef48a89 [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>
Jakub Pawlowski6ecdb8c2016-07-13 11:53:55 -070022#include "ble_advertiser.h"
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -080023#include "bt_gatt_client.h"
24#include "bt_gatt_server.h"
25
26__BEGIN_DECLS
27
28/** BT-GATT callbacks */
29typedef struct {
30 /** Set to sizeof(btgatt_callbacks_t) */
31 size_t size;
32
33 /** GATT Client callbacks */
34 const btgatt_client_callbacks_t* client;
35
36 /** GATT Server callbacks */
37 const btgatt_server_callbacks_t* server;
Jakub Pawlowski6ecdb8c2016-07-13 11:53:55 -070038
39 /** Advertiser callbacks */
40 const ble_advertiser_callbacks_t* advertiser;
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -080041} btgatt_callbacks_t;
42
43/** Represents the standard Bluetooth GATT interface. */
44typedef struct {
45 /** Set to sizeof(btgatt_interface_t) */
46 size_t size;
47
48 /**
49 * Initializes the interface and provides callback routines
50 */
51 bt_status_t (*init)( const btgatt_callbacks_t* callbacks );
52
53 /** Closes the interface */
54 void (*cleanup)( void );
55
56 /** Pointer to the GATT client interface methods.*/
57 const btgatt_client_interface_t* client;
58
59 /** Pointer to the GATT server interface methods.*/
60 const btgatt_server_interface_t* server;
Jakub Pawlowski6ecdb8c2016-07-13 11:53:55 -070061
62 /** Pointer to the advertiser interface methods.*/
63 const ble_advertiser_interface_t* advertiser;
Ganesh Ganapathi Battafefb3342013-02-05 15:23:45 -080064} btgatt_interface_t;
65
66__END_DECLS
67
68#endif /* ANDROID_INCLUDE_BT_GATT_H */