1use crate::param::macros::param;
2use crate::param::{BdAddr, ConnHandle};
3
4param! {
5 bitfield PacketType[2] {
6 (1, shall_not_be_used_2dh1, set_shall_not_be_used_2dh1);
8 (2, shall_not_be_used_3dh1, set_shall_not_be_used_3dh1);
9 (4, dh1_may_be_used, set_dh1_may_be_used);
11 (5, hv1_may_be_used, set_hv1_may_be_used);
13 (6, hv2_may_be_used, set_hv2_may_be_used);
14 (7, hv3_may_be_used, set_hv3_may_be_used);
15 (8, shall_not_be_used_2dh3, set_shall_not_be_used_2dh3);
17 (9, shall_not_be_used_3dh3, set_shall_not_be_used_3dh3);
18 (10, dm3_may_be_used, set_dm3_may_be_used);
19 (11, dh3_may_be_used, set_dh3_may_be_used);
20 (12, shall_not_be_used_2dh5, set_shall_not_be_used_2dh5);
21 (13, shall_not_be_used_3dh5, set_shall_not_be_used_3dh5);
22 (14, dm5_may_be_used, set_dm5_may_be_used);
23 (15, dh5_may_be_used, set_dh5_may_be_used);
24 }
25}
26
27param! {
28 bitfield SyncPacketType[2]{
29 (0, hv1_may_be_used, set_hv1_may_be_used);
31 (1, hv2_may_be_used, set_hv2_may_be_used);
32 (2, hv3_may_be_used, set_hv3_may_be_used);
33 (3, ev3_may_be_used, set_ev3_may_be_used);
35 (4, ev4_may_be_used, set_ev4_may_be_used);
36 (5, ev5_may_be_used, set_ev5_may_be_used);
37 (6, shall_not_be_used_2ev3, set_shall_not_be_used_2ev3);
39 (7, shall_not_be_used_3ev3, set_shall_not_be_used_3ev3);
40 (8, shall_not_be_used_2ev5, set_shall_not_be_used_2ev5);
41 (9, shall_not_be_used_3ev5, set_shall_not_be_used_3ev5);
42 }
44}
45
46param! {
47 bitfield ClockOffset[2] {
48 (0, clock_offset_0, set_clock_offset_0);
50 (1, clock_offset_1, set_clock_offset_1);
51 (2, clock_offset_2, set_clock_offset_2);
52 (3, clock_offset_3, set_clock_offset_3);
53 (4, clock_offset_4, set_clock_offset_4);
54 (5, clock_offset_5, set_clock_offset_5);
55 (6, clock_offset_6, set_clock_offset_6);
56 (7, clock_offset_7, set_clock_offset_7);
57 (8, clock_offset_8, set_clock_offset_8);
58 (9, clock_offset_9, set_clock_offset_9);
59 (10, clock_offset_10, set_clock_offset_10);
60 (11, clock_offset_11, set_clock_offset_11);
61 (12, clock_offset_12, set_clock_offset_12);
62 (13, clock_offset_13, set_clock_offset_13);
63 (14, clock_offset_14, set_clock_offset_14);
64 (15, clock_offset_valid_flag, set_clock_offset_valid_flag);
66 }
67}
68
69param! {
70 bitfield VoiceSetting[2]{
71 (0, air_coding_format_0, set_air_coding_format_0);
73 (1, air_coding_format_1, set_air_coding_format_1);
74 (2, linear_pcm_bit_position_0, set_linear_pcm_bit_position_0);
76 (3, linear_pcm_bit_position_1, set_linear_pcm_bit_position_1);
77 (4, linear_pcm_bit_position_2, set_linear_pcm_bit_position_2);
78 (5, input_sample_size, set_input_sample_size);
80 (6, input_data_format_0, set_input_data_format_0);
82 (7, input_data_format_1, set_input_data_format_1);
83 (8, input_coding_format_0, set_input_coding_format_0);
85 (9, input_coding_format_1, set_input_coding_format_1);
86 }
88}
89
90param! {
91 enum PageScanRepetitionMode{
92 R0 = 0x00,
94 R1 = 0x01,
96 R2 = 0x02,
98 }
100}
101
102param! {
103 enum AllowRoleSwitch{
104 NotAllowed = 0x00,
107 Allowed = 0x01,
110 }
112}
113
114param! {
115 enum ConnectionLinkType {
116 Sco = 0x00,
118 Acl = 0x01,
120 EnhancedSco = 0x02,
122 }
124}
125
126param! {
127 enum LinkKeyType {
128 CombinationKey = 0x00,
130 DebugCombinationKey = 0x03,
132 UnauthenticatedCombinationKeyP192 = 0x04,
134 AuthenticatedCombinationKeyP192 = 0x05,
136 ChangedCombinationKey = 0x06,
138 UnauthenticatedCombinationKeyP256 = 0x07,
140 AuthenticatedCombinationKeyP256 = 0x08,
142 }
144}
145
146param! {
147 enum IoCapability{
148 DisplayOnly = 0x00,
150 DisplayYesNo = 0x01,
152 KeyboardOnly = 0x02,
154 NoInputNoOutput = 0x03,
156 }
158}
159
160param! {
161 enum OobDataPresent {
162 NotPresent = 0x00,
164 P192Present = 0x01,
166 P256Present = 0x02,
168 P192AndP256Present = 0x03,
170 }
172}
173
174param! {
175 enum AuthenticationRequirements {
176 MitmNotRequiredNoBonding = 0x00,
178 MitmRequiredNoBonding = 0x01,
180 MitmNotRequiredDedicatedBonding = 0x02,
182 MitmRequiredDedicatedBonding = 0x03,
184 MitmNotRequiredGeneralBonding = 0x04,
186 MitmRequiredGeneralBonding = 0x05,
188 }
190}
191
192param! {
193 enum Role {
194 Central = 0x00,
196 Peripheral = 0x01,
198 }
199}
200
201param! {
202 enum RejectReason {
203 LimitedResources = 0x0D,
205 SecurityReasons = 0x0E,
207 UnacceptableBdAddr = 0x0F,
209 }
210}
211
212param! {
213 enum KeyFlag{
214 SemiPermanent = 0x00,
216 Temporary = 0x01,
218 }
219}
220
221param! {
222 enum RetransmissionEffort{
223 NoRetransmissions = 0x00,
225 OptimizePowerConsumption = 0x01,
227 OptimizeLinkQuality = 0x02,
229 DontCare = 0xFF,
231 }
233}
234
235param! {
236 enum ServiceType{
237 NoTraffic = 0x00,
239 BestEffort = 0x01,
241 Guaranteed = 0x02,
243 }
245}
246
247param! {
248 enum Mode {
249 Active = 0x00,
251 Hold = 0x01,
253 Sniff = 0x02,
255 }
257}
258
259param! {
260 enum MaxSlots {
261 OneSlot = 0x01,
263 ThreeSlots = 0x03,
265 FiveSlots = 0x05,
267 }
269}
270
271param! {
272 enum FlowDirection {
273 Outgoing = 0x00,
275 Incoming = 0x01,
277 }
279}
280
281param! {
282 enum KeypressNotificationType {
283 PasskeyEntryStarted = 0x00,
285 PasskeyDigitEntered = 0x01,
287 PasskeyDigitErased = 0x02,
289 PasskeyCleared = 0x03,
291 PasskeyEntryCompleted = 0x04,
293 }
295}
296
297param! {
298 enum ClockType {
299 Local = 0x00,
301 Piconet = 0x01,
303 }
305}
306
307param! {
308 enum EncryptionEnabledLevel {
309 Off = 0x00,
311 OnE0OrAesCcm = 0x01,
313 OnAesCcm = 0x02,
315 }
317}
318
319param! {
320 struct EnhancedSetupSynchronousConnectionParams {
322 handle: ConnHandle,
323 transmit_bandwidth: u32,
324 receive_bandwidth: u32,
325 transmit_coding_format: [u8; 5],
326 receive_coding_format: [u8; 5],
327 transmit_codec_frame_size: u16,
328 receive_codec_frame_size: u16,
329 input_bandwidth: u32,
330 output_bandwidth: u32,
331 input_coding_format: [u8; 5],
332 output_coding_format: [u8; 5],
333 input_coded_data_size: u16,
334 output_coded_data_size: u16,
335 input_pcm_data_format: u8,
336 output_pcm_data_format: u8,
337 input_pcm_sample_payload_msb_position: u8,
338 output_pcm_sample_payload_msb_position: u8,
339 input_data_path: u8,
340 output_data_path: u8,
341 input_transport_unit_size: u8,
342 output_transport_unit_size: u8,
343 max_latency: u16,
344 packet_type: SyncPacketType,
345 retransmission_effort: RetransmissionEffort,
346 }
347}
348
349param! {
350 struct EnhancedAcceptSynchronousConnectionRequestParams {
352 bd_addr: BdAddr,
353 transmit_bandwidth: u32,
354 receive_bandwidth: u32,
355 transmit_coding_format: [u8; 5],
356 receive_coding_format: [u8; 5],
357 transmit_codec_frame_size: u16,
358 receive_codec_frame_size: u16,
359 input_bandwidth: u32,
360 output_bandwidth: u32,
361 input_coding_format: [u8; 5],
362 output_coding_format: [u8; 5],
363 input_coded_data_size: u16,
364 output_coded_data_size: u16,
365 input_pcm_data_format: u8,
366 output_pcm_data_format: u8,
367 input_pcm_sample_payload_msb_position: u8,
368 output_pcm_sample_payload_msb_position: u8,
369 input_data_path: u8,
370 output_data_path: u8,
371 input_transport_unit_size: u8,
372 output_transport_unit_size: u8,
373 max_latency: u16,
374 packet_type: SyncPacketType,
375 retransmission_effort: RetransmissionEffort,
376 }
377}