Home | History | Annotate | Download | only in hardware
      1 /*
      2  * Copyright (C) 2015 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  *
     19  *  This file contains constants and definitions that can be used commonly between JNI and stack layer
     20  *
     21  ******************************************************************************/
     22 #ifndef ANDROID_INCLUDE_BT_COMMON_TYPES_H
     23 #define ANDROID_INCLUDE_BT_COMMON_TYPES_H
     24 
     25 #include "bluetooth.h"
     26 
     27 typedef struct
     28 {
     29     uint8_t  client_if;
     30     uint8_t  filt_index;
     31     uint8_t  advertiser_state;
     32     uint8_t  advertiser_info_present;
     33     uint8_t  addr_type;
     34     uint8_t  tx_power;
     35     int8_t  rssi_value;
     36     uint16_t time_stamp;
     37     bt_bdaddr_t bd_addr;
     38     uint8_t  adv_pkt_len;
     39     uint8_t  *p_adv_pkt_data;
     40     uint8_t  scan_rsp_len;
     41     uint8_t  *p_scan_rsp_data;
     42 } btgatt_track_adv_info_t;
     43 
     44 typedef enum
     45 {
     46     BTGATT_DB_PRIMARY_SERVICE,
     47     BTGATT_DB_SECONDARY_SERVICE,
     48     BTGATT_DB_INCLUDED_SERVICE,
     49     BTGATT_DB_CHARACTERISTIC,
     50     BTGATT_DB_DESCRIPTOR,
     51 } bt_gatt_db_attribute_type_t;
     52 
     53 typedef struct
     54 {
     55     uint16_t             id;
     56     bt_uuid_t           uuid;
     57     bt_gatt_db_attribute_type_t type;
     58     uint16_t            attribute_handle;
     59 
     60     /*
     61      * If |type| is |BTGATT_DB_PRIMARY_SERVICE|, or
     62      * |BTGATT_DB_SECONDARY_SERVICE|, this contains the start and end attribute
     63      * handles.
     64      */
     65     uint16_t            start_handle;
     66     uint16_t            end_handle;
     67 
     68     /*
     69      * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of
     70      * the characteristic.
     71      */
     72     uint8_t             properties;
     73 } btgatt_db_element_t;
     74 
     75 #endif  /* ANDROID_INCLUDE_BT_COMMON_TYPES_H */
     76