Home | History | Annotate | Download | only in hardware
      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>
     22 #include "bt_gatt_client.h"
     23 #include "bt_gatt_server.h"
     24 
     25 __BEGIN_DECLS
     26 
     27 /** BT-GATT callbacks */
     28 typedef 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. */
     40 typedef 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 */
     62