1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef HCI_DEF_COMMON_H
17 #define HCI_DEF_COMMON_H
18 
19 #include <stdint.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #pragma pack(1)
26 
27 typedef struct {
28     uint8_t status;
29 } HciStatusParam;
30 
31 #define BD_ADDR_LENGTH 6
32 
33 typedef struct {
34     uint8_t raw[BD_ADDR_LENGTH];
35 } HciBdAddr;
36 
37 #define LMP_FEATURES_SIZE 8
38 
39 typedef struct {
40     uint8_t raw[LMP_FEATURES_SIZE];
41 } HciLmpFeatures;
42 
43 #define MAX_EXTENED_FEATURES_PAGE_NUMBER 2
44 #define MAX_EXTENED_FEATURES_PAGE_COUNT (MAX_EXTENED_FEATURES_PAGE_NUMBER + 1)
45 
46 typedef struct {
47     uint8_t page[MAX_EXTENED_FEATURES_PAGE_COUNT][LMP_FEATURES_SIZE];
48 } HciExtendedLmpFeatures;
49 
50 #define LE_FEATURES_SIZE 8
51 
52 typedef struct {
53     uint8_t raw[LE_FEATURES_SIZE];
54 } HciLeFeatures;
55 
56 #pragma pack(0)
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif