1little_endian_packets
2
3checksum Fcs : 16 "l2cap/"
4
5packet BasicFrame {
6  _size_(_payload_) : 16,
7  channel_id : 16,
8  _payload_,
9}
10
11packet BasicFrameWithFcs {
12  _checksum_start_(fcs),
13  _size_(_payload_) : 16,
14  channel_id : 16,
15  _payload_ : [+2], // Include Fcs in the _size_
16  fcs : Fcs,
17}
18
19enum Continuation : 1 {
20  END = 0,
21  CONTINUE = 1,
22}
23
24// ChannelId 2 is connectionless
25packet GroupFrame : BasicFrame (channel_id = 0x02) {
26  psm : 16,
27  _payload_,
28}
29
30enum FrameType : 1 {
31  I_FRAME = 0,
32  S_FRAME = 1,
33}
34
35enum SupervisoryFunction : 2 {
36  RECEIVER_READY = 0,
37  REJECT = 1,
38  RECEIVER_NOT_READY = 2,
39  SELECT_REJECT = 3,
40}
41
42enum RetransmissionDisable : 1 {
43  NORMAL = 0,
44  DISABLE = 1,
45}
46
47enum SegmentationAndReassembly : 2 {
48  UNSEGMENTED = 0,
49  START = 1,
50  END = 2,
51  CONTINUATION = 3,
52}
53
54packet StandardFrame : BasicFrame {
55  frame_type : FrameType,
56  _body_,
57}
58
59packet StandardFrameWithFcs : BasicFrameWithFcs {
60  frame_type : FrameType,
61  _body_,
62}
63
64group StandardSupervisoryControl {
65  _fixed_ = 0 : 1,
66  s : SupervisoryFunction,
67  _reserved_ : 3,
68  r : RetransmissionDisable,
69  req_seq : 6,
70  _reserved_ : 2,
71}
72
73group StandardInformationControl {
74  tx_seq : 6,
75  r : RetransmissionDisable,
76  req_seq : 6,
77  sar : SegmentationAndReassembly,
78}
79
80packet StandardSupervisoryFrame : StandardFrame (frame_type = S_FRAME) {
81  StandardSupervisoryControl,
82}
83
84packet StandardSupervisoryFrameWithFcs : StandardFrameWithFcs (frame_type = S_FRAME) {
85  StandardSupervisoryControl,
86}
87
88packet StandardInformationFrame : StandardFrame (frame_type = I_FRAME) {
89  StandardInformationControl,
90  _payload_,
91}
92
93packet StandardInformationFrameWithFcs : StandardFrameWithFcs (frame_type = I_FRAME) {
94  StandardInformationControl,
95  _payload_,
96}
97
98packet StandardInformationStartFrame : StandardInformationFrame (sar = START) {
99  l2cap_sdu_length : 16,
100  _payload_,
101}
102
103packet StandardInformationStartFrameWithFcs : StandardInformationFrameWithFcs (sar = START) {
104  l2cap_sdu_length : 16,
105  _payload_,
106}
107
108enum Poll : 1 {
109  NOT_SET = 0,
110  POLL = 1,
111}
112
113enum Final : 1 {
114  NOT_SET = 0,
115  POLL_RESPONSE = 1,
116}
117
118group EnhancedSupervisoryControl {
119  _fixed_ = 0 : 1,
120  s : SupervisoryFunction,
121  p : Poll,
122  _reserved_ : 2,
123  f : Final,
124  req_seq : 6,
125  _reserved_ : 2,
126}
127
128group EnhancedInformationControl {
129  tx_seq : 6,
130  f : Final,
131  req_seq : 6,
132  sar : SegmentationAndReassembly,
133}
134
135packet EnhancedSupervisoryFrame : StandardFrame (frame_type = S_FRAME) {
136  EnhancedSupervisoryControl,
137}
138
139packet EnhancedSupervisoryFrameWithFcs : StandardFrameWithFcs (frame_type = S_FRAME) {
140  EnhancedSupervisoryControl,
141}
142
143packet EnhancedInformationFrame : StandardFrame (frame_type = I_FRAME) {
144  EnhancedInformationControl,
145  _payload_,
146}
147
148packet EnhancedInformationFrameWithFcs : StandardFrameWithFcs (frame_type = I_FRAME) {
149  EnhancedInformationControl,
150  _payload_,
151}
152
153packet EnhancedInformationStartFrame : EnhancedInformationFrame (sar = START) {
154  l2cap_sdu_length : 16,
155  _payload_,
156}
157
158packet EnhancedInformationStartFrameWithFcs : EnhancedInformationFrameWithFcs (sar = START) {
159  l2cap_sdu_length : 16,
160  _payload_,
161}
162
163group ExtendedSupervisoryControl {
164  f : Final,
165  req_seq : 14,
166  s : SupervisoryFunction,
167  p : Poll,
168  _reserved_ : 5,
169  _reserved_ : 8,
170}
171
172group ExtendedInformationControl {
173  f : Final,
174  req_seq : 14,
175  sar : SegmentationAndReassembly,
176  tx_seq : 14,
177}
178
179packet ExtendedSupervisoryFrame : StandardFrame (frame_type = S_FRAME) {
180  ExtendedSupervisoryControl,
181}
182
183packet ExtendedSupervisoryFrameWithFcs : StandardFrameWithFcs (frame_type = S_FRAME) {
184  ExtendedSupervisoryControl,
185}
186
187packet ExtendedInformationFrame : StandardFrame (frame_type = I_FRAME) {
188  ExtendedInformationControl,
189  _payload_,
190}
191
192packet ExtendedInformationFrameWithFcs : StandardFrameWithFcs (frame_type = I_FRAME) {
193  ExtendedInformationControl,
194  _payload_,
195}
196
197packet ExtendedInformationStartFrame : ExtendedInformationFrame (sar = START) {
198  l2cap_sdu_length : 16,
199  _payload_,
200}
201
202packet ExtendedInformationStartFrameWithFcs : ExtendedInformationFrameWithFcs (sar = START) {
203  l2cap_sdu_length : 16,
204  _payload_,
205}
206
207packet FirstLeInformationFrame : BasicFrame {
208  l2cap_sdu_length : 16,
209  _payload_,
210}
211
212enum CommandCode : 8 {
213  COMMAND_REJECT = 0x01,
214  CONNECTION_REQUEST = 0x02,
215  CONNECTION_RESPONSE = 0x03,
216  CONFIGURATION_REQUEST = 0x04,
217  CONFIGURATION_RESPONSE = 0x05,
218  DISCONNECTION_REQUEST = 0x06,
219  DISCONNECTION_RESPONSE = 0x07,
220  ECHO_REQUEST = 0x08,
221  ECHO_RESPONSE = 0x09,
222  INFORMATION_REQUEST = 0x0A,
223  INFORMATION_RESPONSE = 0x0B,
224  CREATE_CHANNEL_REQUEST = 0x0C,
225  CREATE_CHANNEL_RESPONSE = 0x0D,
226  MOVE_CHANNEL_REQUEST = 0x0E,
227  MOVE_CHANNEL_RESPONSE = 0x0F,
228  MOVE_CHANNEL_CONFIRMATION_REQUEST = 0x10,
229  MOVE_CHANNEL_CONFIRMATION_RESPONSE = 0x11,
230  FLOW_CONTROL_CREDIT = 0x16,  // Core 5.2 COC
231  CREDIT_BASED_CONNECTION_REQUEST = 0x17,
232  CREDIT_BASED_CONNECTION_RESPONSE = 0x18,
233  CREDIT_BASED_RECONFIGURE_REQUEST = 0x19,
234  CREDIT_BASED_RECONFIGURE_RESPONSE = 0x1A,
235}
236
237packet ControlFrame : BasicFrame (channel_id = 0x0001) {
238  _payload_,
239}
240
241packet Control {
242  code : CommandCode,
243  identifier : 8,
244  _size_(_payload_) : 16,
245  _payload_,
246}
247
248enum CommandRejectReason : 16 {
249  COMMAND_NOT_UNDERSTOOD = 0x0000,
250  SIGNALING_MTU_EXCEEDED = 0x0001,
251  INVALID_CID_IN_REQUEST = 0x0002,
252}
253
254packet CommandReject : Control (code = COMMAND_REJECT) {
255  reason : CommandRejectReason,
256  _body_,
257}
258
259packet CommandRejectNotUnderstood : CommandReject (reason = COMMAND_NOT_UNDERSTOOD) {
260}
261
262packet CommandRejectMtuExceeded : CommandReject (reason = SIGNALING_MTU_EXCEEDED) {
263  actual_mtu : 16,
264}
265
266packet CommandRejectInvalidCid : CommandReject (reason = INVALID_CID_IN_REQUEST) {
267  local_channel : 16, // Relative to the sender of the CommandReject
268  remote_channel : 16,
269}
270
271packet ConnectionRequest : Control (code = CONNECTION_REQUEST) {
272  psm : 16,
273  source_cid : 16,
274}
275
276enum ConnectionResponseResult : 16 {
277  SUCCESS = 0x0000,
278  PENDING = 0x0001,
279  PSM_NOT_SUPPORTED = 0x0002,
280  SECURITY_BLOCK = 0x0003,
281  NO_RESOURCES_AVAILABLE = 0x0004,
282  INVALID_CID = 0x0006,
283  SOURCE_CID_ALREADY_ALLOCATED = 0x0007,
284}
285
286enum ConnectionResponseStatus : 16 {
287  NO_FURTHER_INFORMATION_AVAILABLE = 0x0000,
288  AUTHENTICATION_PENDING = 0x0001,
289  AUTHORIZATION_PENDING = 0x0002,
290}
291
292packet ConnectionResponse : Control (code = CONNECTION_RESPONSE) {
293  destination_cid : 16,
294  source_cid : 16,
295  result : ConnectionResponseResult,
296  status : ConnectionResponseStatus,
297}
298
299enum ConfigurationOptionType : 7 {
300  MTU = 0x01,
301  FLUSH_TIMEOUT = 0x02,
302  QUALITY_OF_SERVICE = 0x03,
303  RETRANSMISSION_AND_FLOW_CONTROL = 0x04,
304  FRAME_CHECK_SEQUENCE = 0x05,
305  EXTENDED_FLOW_SPECIFICATION = 0x06,
306  EXTENDED_WINDOW_SIZE = 0x07,
307}
308
309enum ConfigurationOptionIsHint : 1 {
310  OPTION_MUST_BE_RECOGNIZED = 0,
311  OPTION_IS_A_HINT = 1,
312}
313
314struct ConfigurationOption {
315  type : ConfigurationOptionType,
316  is_hint : ConfigurationOptionIsHint,
317  _size_(_body_) : 8,
318  _body_,
319}
320
321struct MtuConfigurationOption : ConfigurationOption (type = MTU) {
322  mtu : 16,
323}
324
325struct FlushTimeoutConfigurationOption : ConfigurationOption (type = FLUSH_TIMEOUT) {
326  flush_timeout : 16,
327}
328
329enum QosServiceType : 8 {
330  NO_TRAFFIC = 0x00,
331  BEST_EFFORT = 0x01, // Default
332  GUARANTEED = 0x02,
333}
334
335struct QualityOfServiceConfigurationOption : ConfigurationOption (type = QUALITY_OF_SERVICE) {
336  _reserved_ : 8, // Flags
337  service_type : QosServiceType,
338  token_rate : 32,         // 0 = ignore, 0xffffffff = max available
339  token_bucket_size : 32,  // 0 = ignore, 0xffffffff = max available
340  peak_bandwidth : 32,     // Octets/second 0 = ignore
341  latency : 32,            // microseconds 0xffffffff = ignore
342  delay_variation : 32,    // microseconds 0xffffffff = ignore
343}
344
345enum RetransmissionAndFlowControlModeOption : 8 {
346  L2CAP_BASIC = 0x00,
347  RETRANSMISSION = 0x01,
348  FLOW_CONTROL = 0x02,
349  ENHANCED_RETRANSMISSION = 0x03,
350  STREAMING = 0x04,
351}
352
353
354struct RetransmissionAndFlowControlConfigurationOption : ConfigurationOption (type = RETRANSMISSION_AND_FLOW_CONTROL) {
355  mode : RetransmissionAndFlowControlModeOption,
356  tx_window_size : 8, // 1-32 for Flow Control and Retransmission, 1-63 for Enhanced
357  max_transmit : 8,
358  retransmission_time_out : 16,
359  monitor_time_out : 16,
360  maximum_pdu_size : 16,
361}
362
363enum FcsType : 8 {
364  NO_FCS = 0,
365  DEFAULT = 1,  // 16-bit FCS
366}
367
368struct FrameCheckSequenceOption : ConfigurationOption (type = FRAME_CHECK_SEQUENCE) {
369  fcs_type : FcsType,
370}
371
372
373struct ExtendedFlowSpecificationOption : ConfigurationOption (type = EXTENDED_FLOW_SPECIFICATION) {
374  identifier : 8, // Default 0x01, must be 0x01 for Extended Flow-Best-Effort
375  service_type : QosServiceType,
376  maximum_sdu_size : 16, // Octets
377  sdu_interarrival_time : 32, // in microseconds
378  access_latency : 32, // in microseconds, without HCI and stack overheads
379  flush_timeout : 32, // in microseconds 0x0 = no retransmissions 0xFFFFFFFF = never flushed
380}
381
382struct ExtendedWindowSizeOption : ConfigurationOption (type = EXTENDED_WINDOW_SIZE) {
383  max_window_size : 16, // 0x0000 = Valid for streaming, 0x0001-0x3FFF Valid for Enhanced Retransmission
384}
385
386packet ConfigurationRequest : Control (code = CONFIGURATION_REQUEST) {
387  destination_cid : 16,
388  continuation : Continuation,
389  _reserved_ : 15,
390  config : ConfigurationOption[],
391}
392
393enum ConfigurationResponseResult : 16 {
394  SUCCESS = 0x0000,
395  UNACCEPTABLE_PARAMETERS = 0x0001,
396  REJECTED = 0x0002,
397  UNKNOWN_OPTIONS = 0x0003,
398  PENDING = 0x0004,
399  FLOW_SPEC_REJECTED = 0x0005,
400}
401
402packet ConfigurationResponse : Control (code = CONFIGURATION_RESPONSE) {
403  source_cid : 16,
404  continuation : Continuation,
405  _reserved_ : 15,
406  result : ConfigurationResponseResult,
407  config : ConfigurationOption[],
408}
409
410packet DisconnectionRequest : Control (code = DISCONNECTION_REQUEST) {
411  destination_cid : 16,
412  source_cid : 16,
413}
414
415packet DisconnectionResponse : Control (code = DISCONNECTION_RESPONSE) {
416  destination_cid : 16,
417  source_cid : 16,
418}
419
420packet EchoRequest : Control (code = ECHO_REQUEST) {
421  _payload_, // Optional and implementation specific
422}
423
424packet EchoResponse : Control (code = ECHO_RESPONSE) {
425  _payload_, // Optional and implementation specific
426}
427
428enum InformationRequestInfoType : 16 {
429  CONNECTIONLESS_MTU = 0x0001,
430  EXTENDED_FEATURES_SUPPORTED = 0x0002,
431  FIXED_CHANNELS_SUPPORTED = 0x0003,
432}
433
434packet InformationRequest : Control (code = INFORMATION_REQUEST) {
435  info_type : InformationRequestInfoType,
436}
437
438enum InformationRequestResult : 16 {
439  SUCCESS = 0x0000,
440  NOT_SUPPORTED = 0x0001,
441}
442
443packet InformationResponse : Control (code = INFORMATION_RESPONSE) {
444  info_type : InformationRequestInfoType,
445  result : InformationRequestResult,
446  _body_,
447}
448
449packet InformationResponseConnectionlessMtu : InformationResponse (info_type = CONNECTIONLESS_MTU) {
450  connectionless_mtu : 16,
451}
452
453packet InformationResponseExtendedFeatures : InformationResponse (info_type = EXTENDED_FEATURES_SUPPORTED) {
454  // ExtendedFeatureMask : 32,
455  flow_control_mode : 1,
456  retransmission_mode : 1,
457  bi_directional_qoS : 1,
458  enhanced_retransmission_mode : 1,
459  streaming_mode : 1,
460  fcs_option : 1,
461  extended_flow_specification_for_br_edr : 1,
462  fixed_channels : 1,
463  extended_window_size : 1,
464  unicast_connectionless_data_reception : 1,
465  enhanced_credit_based_flow_control_mode : 1,
466  _reserved_ : 21,
467}
468
469packet InformationResponseFixedChannels : InformationResponse (info_type = FIXED_CHANNELS_SUPPORTED) {
470  fixed_channels : 64, // bit 0 must be 0, bit 1 must be 1, all others 1 = supported
471}
472
473packet CreateChannelRequest : Control (code = CREATE_CHANNEL_REQUEST) {
474  psm : 16,
475  source_cid : 16,
476  controller_id : 8,
477}
478
479enum CreateChannelResponseResult : 16 {
480  SUCCESS = 0x0000,
481  PENDING = 0x0001,
482  PSM_NOT_SUPPORTED = 0x0002,
483  SECURITY_BLOCK = 0x0003,
484  NO_RESOURCES_AVAILABLE = 0x0004,
485  CONTROLLER_ID_NOT_SUPPORTED = 0x0005,
486  INVALID_CID = 0x0006,
487  SOURCE_CID_ALREADY_ALLOCATED = 0x0007,
488}
489
490enum CreateChannelResponseStatus : 16 {
491  NO_FURTHER_INFORMATION_AVAILABLE = 0x0000,
492  AUTHENTICATION_PENDING = 0x0001,
493  AUTHORIZATION_PENDING = 0x0002,
494}
495
496packet CreateChannelResponse : Control (code = CREATE_CHANNEL_RESPONSE) {
497  destination_cid : 16,
498  source_cid : 16,
499  result : CreateChannelResponseResult,
500  status : CreateChannelResponseStatus,
501}
502
503// AMP Only ?
504packet MoveChannelRequest : Control (code = MOVE_CHANNEL_REQUEST) {
505  initiator_cid : 16,
506  dest_controller_id : 8,
507}
508
509enum MoveChannelResponseResult : 16 {
510  SUCCESS = 0x0000,
511  PENDING = 0x0001,
512  CONTROLLER_ID_NOT_SUPPORTED = 0x0002,
513  NEW_CONTROLLER_ID_IS_SAME = 0x0003,
514  CONFIGURATION_NOT_SUPPORTED = 0x0004,
515  CHANNEL_COLLISION = 0x0005,
516  CHANNEL_NOT_ALLOWED_TO_BE_MOVED = 0x0006,
517}
518
519packet MoveChannelResponse : Control (code = MOVE_CHANNEL_RESPONSE) {
520  initiator_cid : 16,
521  result : MoveChannelResponseResult,
522}
523
524enum MoveChannelConfirmationResult : 16 {
525  SUCCESS = 0x0000,
526  FAILURE = 0x0001,
527}
528
529packet MoveChannelConfirmationRequest : Control (code = MOVE_CHANNEL_CONFIRMATION_REQUEST) {
530  initiator_cid : 16,
531  result : MoveChannelConfirmationResult,
532}
533
534packet MoveChannelConfirmationResponse : Control (code = MOVE_CHANNEL_CONFIRMATION_RESPONSE) {
535  initiator_cid : 16,
536}
537
538// Core 5.2 COC
539
540packet FlowControlCredit : Control (code = FLOW_CONTROL_CREDIT) {
541  cid : 16, // Receiver's destination CID
542  credits : 16,
543}
544
545packet CreditBasedConnectionRequest : Control (code = CREDIT_BASED_CONNECTION_REQUEST) {
546  spsm : 16,
547  mtu : 16,
548  mps : 16,
549  initial_credits : 16,
550  source_cid : 16[],
551}
552
553enum CreditBasedConnectionResponseResult : 16 {
554  SUCCESS = 0x0000,
555  SPSM_NOT_SUPPORTED = 0x0002,
556  SOME_REFUSED_NO_RESOURCES_AVAILABLE = 0x0004,
557  ALL_REFUSED_INSUFFICIENT_AUTHENTICATION = 0x0005,
558  ALL_REFUSED_INSUFFICIENT_AUTHORIZATION = 0x0006,
559  ALL_REFUSED_INSUFFICIENT_ENCRYPTION_KEY_SIZE = 0x0007,
560  ALL_REFUSED_INSUFFICIENT_ENCRYPTION = 0x0008,
561  SOME_REFUSED_INVALID_SOURCE_CID = 0x0009,
562  SOME_REFUSED_SOURCE_CID_ALREADY_ALLOCATED = 0x000A,
563  ALL_REFUSED_UNACCEPTABLE_PARAMETERS = 0x000B,
564  ALL_REFUSED_INVALID_PARAMETERS = 0x000C,
565}
566
567packet CreditBasedConnectionResponse : Control (code = CREDIT_BASED_CONNECTION_RESPONSE) {
568  mtu : 16,
569  mps : 16,
570  initial_credits : 16,
571  result : CreditBasedConnectionResponseResult,
572  destination_cid : 16[],
573}
574
575packet CreditBasedReconfigureRequest : Control (code = CREDIT_BASED_RECONFIGURE_REQUEST) {
576  mtu : 16,
577  mps : 16,
578  destination_cid : 16[],
579}
580
581enum CreditBasedReconfigureResponseResult : 16 {
582  SUCCESS = 0x0000,
583  MTU_NOT_ALLOWED = 0x01,
584  MPS_NOT_ALLOWED = 0x02,
585  INVALID_DESTINATION_CID = 0x03,
586  UNACCEPTABLE_PARAMETERS = 0x04,
587}
588
589packet CreditBasedReconfigureResponse : Control (code = CREDIT_BASED_RECONFIGURE_RESPONSE) {
590  result: CreditBasedReconfigureResponseResult,
591}
592
593enum LeCommandCode : 8 {
594  COMMAND_REJECT = 0x01,
595  DISCONNECTION_REQUEST = 0x06,
596  DISCONNECTION_RESPONSE = 0x07,
597  CONNECTION_PARAMETER_UPDATE_REQUEST = 0x12,
598  CONNECTION_PARAMETER_UPDATE_RESPONSE = 0x13,
599  LE_CREDIT_BASED_CONNECTION_REQUEST = 0x14,
600  LE_CREDIT_BASED_CONNECTION_RESPONSE = 0x15,
601  LE_FLOW_CONTROL_CREDIT = 0x16,
602  CREDIT_BASED_CONNECTION_REQUEST = 0x17,  // Core 5.2 COC
603  CREDIT_BASED_CONNECTION_RESPONSE = 0x18,
604  CREDIT_BASED_RECONFIGURE_REQUEST = 0x19,
605  CREDIT_BASED_RECONFIGURE_RESPONSE = 0x1A,
606}
607
608packet LeControlFrame : BasicFrame (channel_id = 0x0005) {
609  _payload_,
610}
611
612packet LeControl {
613  code : LeCommandCode,
614  identifier : 8, // Must be non-zero
615  _size_(_payload_) : 16,
616  _payload_,
617}
618
619
620packet LeCommandReject : LeControl (code = COMMAND_REJECT) {
621  reason : CommandRejectReason,
622  _payload_,
623}
624
625packet LeCommandRejectNotUnderstood : LeCommandReject (reason = COMMAND_NOT_UNDERSTOOD) {
626}
627
628packet LeCommandRejectMtuExceeded : LeCommandReject (reason = SIGNALING_MTU_EXCEEDED) {
629  actual_mtu : 16,
630}
631
632packet LeCommandRejectInvalidCid : LeCommandReject (reason = INVALID_CID_IN_REQUEST) {
633  local_channel : 16, // Relative to the sender of the CommandReject
634  remote_channel : 16,
635}
636
637packet LeDisconnectionRequest : LeControl (code = DISCONNECTION_REQUEST) {
638  destination_cid : 16,
639  source_cid : 16,
640}
641
642packet LeDisconnectionResponse : LeControl (code = DISCONNECTION_RESPONSE) {
643  destination_cid : 16,
644  source_cid : 16,
645}
646
647packet ConnectionParameterUpdateRequest : LeControl (code = CONNECTION_PARAMETER_UPDATE_REQUEST) {
648  interval_min : 16,
649  interval_max : 16,
650  peripheral_latency : 16,
651  timeout_multiplier : 16,
652}
653
654enum ConnectionParameterUpdateResponseResult : 16 {
655  ACCEPTED = 0,
656  REJECTED = 1,
657}
658
659packet ConnectionParameterUpdateResponse : LeControl (code = CONNECTION_PARAMETER_UPDATE_RESPONSE) {
660  result : ConnectionParameterUpdateResponseResult,
661}
662
663packet LeCreditBasedConnectionRequest : LeControl (code = LE_CREDIT_BASED_CONNECTION_REQUEST) {
664  le_psm : 16, // 0x0001-0x007F Fixed, 0x0080-0x00FF Dynamic
665  source_cid : 16,
666  mtu : 16,
667  mps : 16,
668  initial_credits : 16,
669}
670
671enum LeCreditBasedConnectionResponseResult : 16 {
672  SUCCESS = 0x0000,
673  LE_PSM_NOT_SUPPORTED = 0x0002,
674  NO_RESOURCES_AVAILABLE = 0x0004,
675  INSUFFICIENT_AUTHENTICATION = 0x0005,
676  INSUFFICIENT_AUTHORIZATION = 0x0006,
677  INSUFFICIENT_ENCRYPTION_KEY_SIZE = 0x0007,
678  INSUFFICIENT_ENCRYPTION = 0x0008,
679  INVALID_SOURCE_CID = 0x0009,
680  SOURCE_CID_ALREADY_ALLOCATED = 0x000A,
681  UNACCEPTABLE_PARAMETERS = 0x000B,
682}
683
684packet LeCreditBasedConnectionResponse : LeControl (code = LE_CREDIT_BASED_CONNECTION_RESPONSE) {
685  destination_cid : 16,
686  mtu : 16,
687  mps : 16,
688  initial_credits : 16,
689  result : LeCreditBasedConnectionResponseResult,
690}
691
692packet LeFlowControlCredit : LeControl (code = LE_FLOW_CONTROL_CREDIT) {
693  cid : 16, // Receiver's destination CID
694  credits : 16,
695}
696
697packet LeEnhancedCreditBasedConnectionRequest : LeControl (code = CREDIT_BASED_CONNECTION_REQUEST) {
698  spsm : 16,
699  mtu : 16,
700  mps : 16,
701  initial_credits : 16,
702  source_cid : 16[],
703}
704
705packet LeEnhancedCreditBasedConnectionResponse : LeControl (code = CREDIT_BASED_CONNECTION_RESPONSE) {
706  mtu : 16,
707  mps : 16,
708  initial_credits : 16,
709  result : CreditBasedConnectionResponseResult,
710  destination_cid : 16[],
711}
712
713packet LeEnhancedCreditBasedReconfigureRequest : LeControl (code = CREDIT_BASED_RECONFIGURE_REQUEST) {
714  mtu : 16,
715  mps : 16,
716  destination_cid : 16[],
717}
718
719packet LeEnhancedCreditBasedReconfigureResponse : LeControl (code = CREDIT_BASED_RECONFIGURE_RESPONSE) {
720  result: CreditBasedReconfigureResponseResult,
721}
722