@@ -85,7 +85,7 @@ struct bt_att_info_128 {
8585#define BT_ATT_OP_FIND_INFO_RSP 0x05
8686struct bt_att_find_info_rsp {
8787 uint8_t format ;
88- uint8_t info [0 ];
88+ uint8_t info [];
8989} __packed ;
9090
9191/* Find By Type Value Request */
@@ -94,7 +94,7 @@ struct bt_att_find_type_req {
9494 uint16_t start_handle ;
9595 uint16_t end_handle ;
9696 uint16_t type ;
97- uint8_t value [0 ];
97+ uint8_t value [];
9898} __packed ;
9999
100100struct bt_att_handle_group {
@@ -105,27 +105,27 @@ struct bt_att_handle_group {
105105/* Find By Type Value Response */
106106#define BT_ATT_OP_FIND_TYPE_RSP 0x07
107107struct bt_att_find_type_rsp {
108- struct bt_att_handle_group list [ 0 ] ;
108+ FLEXIBLE_ARRAY_DECLARE ( struct bt_att_handle_group , list ) ;
109109} __packed ;
110110
111111/* Read By Type Request */
112112#define BT_ATT_OP_READ_TYPE_REQ 0x08
113113struct bt_att_read_type_req {
114114 uint16_t start_handle ;
115115 uint16_t end_handle ;
116- uint8_t uuid [0 ];
116+ uint8_t uuid [];
117117} __packed ;
118118
119119struct bt_att_data {
120120 uint16_t handle ;
121- uint8_t value [0 ];
121+ uint8_t value [];
122122} __packed ;
123123
124124/* Read By Type Response */
125125#define BT_ATT_OP_READ_TYPE_RSP 0x09
126126struct bt_att_read_type_rsp {
127127 uint8_t len ;
128- struct bt_att_data data [0 ];
128+ struct bt_att_data data [];
129129} __packed ;
130130
131131/* Read Request */
@@ -137,7 +137,7 @@ struct bt_att_read_req {
137137/* Read Response */
138138#define BT_ATT_OP_READ_RSP 0x0b
139139struct bt_att_read_rsp {
140- uint8_t value [ 0 ] ;
140+ FLEXIBLE_ARRAY_DECLARE ( uint8_t , value ) ;
141141} __packed ;
142142
143143/* Read Blob Request */
@@ -150,49 +150,49 @@ struct bt_att_read_blob_req {
150150/* Read Blob Response */
151151#define BT_ATT_OP_READ_BLOB_RSP 0x0d
152152struct bt_att_read_blob_rsp {
153- uint8_t value [ 0 ] ;
153+ FLEXIBLE_ARRAY_DECLARE ( uint8_t , value ) ;
154154} __packed ;
155155
156156/* Read Multiple Request */
157157#define BT_ATT_READ_MULT_MIN_LEN_REQ 0x04
158158
159159#define BT_ATT_OP_READ_MULT_REQ 0x0e
160160struct bt_att_read_mult_req {
161- uint16_t handles [ 0 ] ;
161+ FLEXIBLE_ARRAY_DECLARE ( uint16_t , handles ) ;
162162} __packed ;
163163
164164/* Read Multiple Response */
165165#define BT_ATT_OP_READ_MULT_RSP 0x0f
166166struct bt_att_read_mult_rsp {
167- uint8_t value [ 0 ] ;
167+ FLEXIBLE_ARRAY_DECLARE ( uint8_t , value ) ;
168168} __packed ;
169169
170170/* Read by Group Type Request */
171171#define BT_ATT_OP_READ_GROUP_REQ 0x10
172172struct bt_att_read_group_req {
173173 uint16_t start_handle ;
174174 uint16_t end_handle ;
175- uint8_t uuid [0 ];
175+ uint8_t uuid [];
176176} __packed ;
177177
178178struct bt_att_group_data {
179179 uint16_t start_handle ;
180180 uint16_t end_handle ;
181- uint8_t value [0 ];
181+ uint8_t value [];
182182} __packed ;
183183
184184/* Read by Group Type Response */
185185#define BT_ATT_OP_READ_GROUP_RSP 0x11
186186struct bt_att_read_group_rsp {
187187 uint8_t len ;
188- struct bt_att_group_data data [0 ];
188+ struct bt_att_group_data data [];
189189} __packed ;
190190
191191/* Write Request */
192192#define BT_ATT_OP_WRITE_REQ 0x12
193193struct bt_att_write_req {
194194 uint16_t handle ;
195- uint8_t value [0 ];
195+ uint8_t value [];
196196} __packed ;
197197
198198/* Write Response */
@@ -203,15 +203,15 @@ struct bt_att_write_req {
203203struct bt_att_prepare_write_req {
204204 uint16_t handle ;
205205 uint16_t offset ;
206- uint8_t value [0 ];
206+ uint8_t value [];
207207} __packed ;
208208
209209/* Prepare Write Respond */
210210#define BT_ATT_OP_PREPARE_WRITE_RSP 0x17
211211struct bt_att_prepare_write_rsp {
212212 uint16_t handle ;
213213 uint16_t offset ;
214- uint8_t value [0 ];
214+ uint8_t value [];
215215} __packed ;
216216
217217/* Execute Write Request */
@@ -230,14 +230,14 @@ struct bt_att_exec_write_req {
230230#define BT_ATT_OP_NOTIFY 0x1b
231231struct bt_att_notify {
232232 uint16_t handle ;
233- uint8_t value [0 ];
233+ uint8_t value [];
234234} __packed ;
235235
236236/* Handle Value Indication */
237237#define BT_ATT_OP_INDICATE 0x1d
238238struct bt_att_indicate {
239239 uint16_t handle ;
240- uint8_t value [0 ];
240+ uint8_t value [];
241241} __packed ;
242242
243243/* Handle Value Confirm */
@@ -249,36 +249,36 @@ struct bt_att_signature {
249249
250250#define BT_ATT_OP_READ_MULT_VL_REQ 0x20
251251struct bt_att_read_mult_vl_req {
252- uint16_t handles [ 0 ] ;
252+ FLEXIBLE_ARRAY_DECLARE ( uint16_t , handles ) ;
253253} __packed ;
254254
255255/* Read Multiple Response */
256256#define BT_ATT_OP_READ_MULT_VL_RSP 0x21
257257struct bt_att_read_mult_vl_rsp {
258258 uint16_t len ;
259- uint8_t value [0 ];
259+ uint8_t value [];
260260} __packed ;
261261
262262/* Handle Multiple Value Notification */
263263#define BT_ATT_OP_NOTIFY_MULT 0x23
264264struct bt_att_notify_mult {
265265 uint16_t handle ;
266266 uint16_t len ;
267- uint8_t value [0 ];
267+ uint8_t value [];
268268} __packed ;
269269
270270/* Write Command */
271271#define BT_ATT_OP_WRITE_CMD 0x52
272272struct bt_att_write_cmd {
273273 uint16_t handle ;
274- uint8_t value [0 ];
274+ uint8_t value [];
275275} __packed ;
276276
277277/* Signed Write Command */
278278#define BT_ATT_OP_SIGNED_WRITE_CMD 0xd2
279279struct bt_att_signed_write_cmd {
280280 uint16_t handle ;
281- uint8_t value [0 ];
281+ uint8_t value [];
282282} __packed ;
283283
284284typedef void (* bt_att_func_t )(struct bt_conn * conn , int err ,
0 commit comments