天嵌二次封装库使用手册  V1.0
a2mp.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  *
4  * BlueZ - Bluetooth protocol stack for Linux
5  *
6  * Copyright (C) 2012 Intel Corporation. All rights reserved.
7  * Copyright (c) 2012 Code Aurora Forum. All rights reserved.
8  *
9  */
10 
11 #ifndef __A2MP_H
12 #define __A2MP_H
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /* A2MP Protocol */
19 
20 /* A2MP command codes */
21 
22 #define A2MP_COMMAND_REJ 0x01
23 #define A2MP_DISCOVER_REQ 0x02
24 #define A2MP_DISCOVER_RSP 0x03
25 #define A2MP_CHANGE_NOTIFY 0x04
26 #define A2MP_CHANGE_RSP 0x05
27 #define A2MP_INFO_REQ 0x06
28 #define A2MP_INFO_RSP 0x07
29 #define A2MP_ASSOC_REQ 0x08
30 #define A2MP_ASSOC_RSP 0x09
31 #define A2MP_CREATE_REQ 0x0a
32 #define A2MP_CREATE_RSP 0x0b
33 #define A2MP_DISCONN_REQ 0x0c
34 #define A2MP_DISCONN_RSP 0x0d
35 
36 struct a2mp_hdr {
37  uint8_t code;
38  uint8_t ident;
39  uint16_t len;
40 } __attribute__ ((packed));
41 #define A2MP_HDR_SIZE 4
42 
44  uint16_t reason;
45 } __attribute__ ((packed));
46 
48  uint16_t mtu;
49  uint16_t mask;
50 } __attribute__ ((packed));
51 
52 struct a2mp_ctrl {
53  uint8_t id;
54  uint8_t type;
55  uint8_t status;
56 } __attribute__ ((packed));
57 
59  uint16_t mtu;
60  uint16_t mask;
61  struct a2mp_ctrl ctrl_list[0];
62 } __attribute__ ((packed));
63 
64 struct a2mp_info_req {
65  uint8_t id;
66 } __attribute__ ((packed));
67 
68 struct a2mp_info_rsp {
69  uint8_t id;
70  uint8_t status;
71  uint32_t total_bw;
72  uint32_t max_bw;
73  uint32_t min_latency;
74  uint16_t pal_caps;
75  uint16_t assoc_size;
76 } __attribute__ ((packed));
77 
79  uint8_t id;
80 } __attribute__ ((packed));
81 
83  uint8_t id;
84  uint8_t status;
85  uint8_t assoc_data[0];
86 } __attribute__ ((packed));
87 
89  uint8_t local_id;
90  uint8_t remote_id;
91  uint8_t assoc_data[0];
92 } __attribute__ ((packed));
93 
95  uint8_t local_id;
96  uint8_t remote_id;
97  uint8_t status;
98 } __attribute__ ((packed));
99 
101  uint8_t local_id;
102  uint8_t remote_id;
103 } __attribute__ ((packed));
104 
106  uint8_t local_id;
107  uint8_t remote_id;
108  uint8_t status;
109 } __attribute__ ((packed));
110 
111 #define A2MP_COMMAND_NOT_RECOGNIZED 0x0000
112 
113 /* AMP controller status */
114 #define AMP_CTRL_POWERED_DOWN 0x00
115 #define AMP_CTRL_BLUETOOTH_ONLY 0x01
116 #define AMP_CTRL_NO_CAPACITY 0x02
117 #define AMP_CTRL_LOW_CAPACITY 0x03
118 #define AMP_CTRL_MEDIUM_CAPACITY 0x04
119 #define AMP_CTRL_HIGH_CAPACITY 0x05
120 #define AMP_CTRL_FULL_CAPACITY 0x06
121 
122 /* A2MP response status */
123 #define A2MP_STATUS_SUCCESS 0x00
124 #define A2MP_STATUS_INVALID_CTRL_ID 0x01
125 #define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02
126 #define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02
127 #define A2MP_STATUS_COLLISION_OCCURED 0x03
128 #define A2MP_STATUS_DISCONN_REQ_RECVD 0x04
129 #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05
130 #define A2MP_STATUS_SECURITY_VIOLATION 0x06
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 #endif /* __A2MP_H */
Definition: a2mp.h:68
Definition: a2mp.h:88
Definition: a2mp.h:82
Definition: a2mp.h:100
Definition: amp.h:35
Definition: a2mp.h:78
Definition: a2mp.h:36
Definition: a2mp.h:58
Definition: a2mp.h:43
Definition: a2mp.h:47
Definition: a2mp.h:105
Definition: a2mp.h:64
Definition: a2mp.h:52
Definition: a2mp.h:94