Ganesh Ganapathi Batta | fefb334 | 2013-02-05 15:23:45 -0800 | [diff] [blame] | 1 | /* |
| 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 Pawlowski | 6ecdb8c | 2016-07-13 11:53:55 -0700 | [diff] [blame] | 22 | #include "ble_advertiser.h" |
Jakub Pawlowski | 1e24ce9 | 2016-10-27 12:26:07 -0700 | [diff] [blame] | 23 | #include "ble_scanner.h" |
Ganesh Ganapathi Batta | fefb334 | 2013-02-05 15:23:45 -0800 | [diff] [blame] | 24 | #include "bt_gatt_client.h" |
| 25 | #include "bt_gatt_server.h" |
| 26 | |
| 27 | __BEGIN_DECLS |
| 28 | |
| 29 | /** BT-GATT callbacks */ |
| 30 | typedef struct { |
| 31 | /** Set to sizeof(btgatt_callbacks_t) */ |
| 32 | size_t size; |
| 33 | |
| 34 | /** GATT Client callbacks */ |
| 35 | const btgatt_client_callbacks_t* client; |
| 36 | |
| 37 | /** GATT Server callbacks */ |
| 38 | const btgatt_server_callbacks_t* server; |
Jakub Pawlowski | 1e24ce9 | 2016-10-27 12:26:07 -0700 | [diff] [blame] | 39 | |
| 40 | /** LE scanner callbacks */ |
| 41 | const btgatt_scanner_callbacks_t* scanner; |
Ganesh Ganapathi Batta | fefb334 | 2013-02-05 15:23:45 -0800 | [diff] [blame] | 42 | } btgatt_callbacks_t; |
| 43 | |
| 44 | /** Represents the standard Bluetooth GATT interface. */ |
| 45 | typedef struct { |
| 46 | /** Set to sizeof(btgatt_interface_t) */ |
| 47 | size_t size; |
| 48 | |
| 49 | /** |
| 50 | * Initializes the interface and provides callback routines |
| 51 | */ |
| 52 | bt_status_t (*init)( const btgatt_callbacks_t* callbacks ); |
| 53 | |
| 54 | /** Closes the interface */ |
| 55 | void (*cleanup)( void ); |
| 56 | |
| 57 | /** Pointer to the GATT client interface methods.*/ |
| 58 | const btgatt_client_interface_t* client; |
| 59 | |
| 60 | /** Pointer to the GATT server interface methods.*/ |
| 61 | const btgatt_server_interface_t* server; |
Jakub Pawlowski | 6ecdb8c | 2016-07-13 11:53:55 -0700 | [diff] [blame] | 62 | |
Jakub Pawlowski | 1e24ce9 | 2016-10-27 12:26:07 -0700 | [diff] [blame] | 63 | /** Pointer to the LE scanner interface methods.*/ |
Jakub Pawlowski | d5286ae | 2016-12-14 13:38:18 -0800 | [diff] [blame] | 64 | BleScannerInterface* scanner; |
Jakub Pawlowski | 1e24ce9 | 2016-10-27 12:26:07 -0700 | [diff] [blame] | 65 | |
Jakub Pawlowski | 6ecdb8c | 2016-07-13 11:53:55 -0700 | [diff] [blame] | 66 | /** Pointer to the advertiser interface methods.*/ |
Jakub Pawlowski | 4a63528 | 2016-10-06 16:53:23 -0700 | [diff] [blame] | 67 | BleAdvertiserInterface* advertiser; |
Ganesh Ganapathi Batta | fefb334 | 2013-02-05 15:23:45 -0800 | [diff] [blame] | 68 | } btgatt_interface_t; |
| 69 | |
| 70 | __END_DECLS |
| 71 | |
| 72 | #endif /* ANDROID_INCLUDE_BT_GATT_H */ |