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 #ifndef ANDROID_INCLUDE_BT_GATT_TYPES_H 18 #define ANDROID_INCLUDE_BT_GATT_TYPES_H 19 20 #include <stdbool.h> 21 #include <stdint.h> 22 #include <sys/cdefs.h> 23 24 #include <bluetooth/uuid.h> 25 26 __BEGIN_DECLS 27 28 /** 29 * GATT Service types 30 */ 31 #define BTGATT_SERVICE_TYPE_PRIMARY 0 32 #define BTGATT_SERVICE_TYPE_SECONDARY 1 33 34 /** 35 * GATT max attribute length (Bluetooth Core Specification 5.4 Volume 3, Part F, 36 * section 3.2.9) 37 */ 38 #define GATT_MAX_ATTR_LEN 512 39 40 /** GATT ID adding instance id tracking to the UUID */ 41 typedef struct { 42 bluetooth::Uuid uuid; 43 uint16_t inst_id; 44 } btgatt_gatt_id_t; 45 46 /** GATT Service ID also identifies the service type (primary/secondary) */ 47 typedef struct { 48 btgatt_gatt_id_t id; 49 uint8_t is_primary; 50 } btgatt_srvc_id_t; 51 52 /** Preferred physical Transport for GATT connection */ 53 typedef enum { 54 GATT_TRANSPORT_AUTO, 55 GATT_TRANSPORT_BREDR, 56 GATT_TRANSPORT_LE 57 } btgatt_transport_t; 58 59 __END_DECLS 60 61 #endif /* ANDROID_INCLUDE_BT_GATT_TYPES_H */ 62