btmgmt_packet/
command.rs

1//! mgmt API commands
2use derive_new::new as New;
3use getset::Getters;
4
5use btmgmt_packet_helper::commands;
6use btmgmt_packet_helper::pack::{Pack, Unpack};
7
8use super::*;
9pub use imp::*;
10
11// Management API Command
12#[commands(name = Command, trait = CommandRequest, codes = CommandCode)]
13mod imp {
14    use super::*;
15
16    /// Read Management Version Information Command
17    ///
18    /// see [bluez
19    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
20    #[derive(Debug, Default, Pack)]
21    #[command(code = 0x0001, reply = ReadManagementVersionInformationReply)]
22    pub struct ReadManagementVersionInformation;
23
24    /// Reply for [`ReadManagementVersionInformation`]
25    #[derive(Debug, Unpack, Getters)]
26    #[getset(get = "pub")]
27    pub struct ReadManagementVersionInformationReply {
28        version: u8,
29        revision: u16,
30    }
31
32    /// Read Management Supported Commands Command
33    ///
34    /// see [bluez
35    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
36    #[derive(Debug, Default, Pack)]
37    #[command(code = 0x0002, reply = ReadManagementSupportedCommandsReply)]
38    pub struct ReadManagementSupportedCommands;
39
40    /// Reply for [`ReadManagementSupportedCommands`]
41    #[derive(Debug, Unpack, Newtype)]
42    pub struct ReadManagementSupportedCommandsReply(super::CommandsEvents);
43
44    /// Read Controller Index List Command
45    ///
46    /// see [bluez
47    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
48    #[derive(Debug, Default, Pack)]
49    #[command(code = 0x0003, reply = ReadControllerIndexListReply)]
50    pub struct ReadControllerIndexList;
51
52    /// Reply for [`ReadControllerIndexList`]
53    #[derive(Debug, Unpack, IterNewtype)]
54    pub struct ReadControllerIndexListReply(Vec<ControllerIndex>);
55
56    /// Read Controller Information Command
57    ///
58    /// see [bluez
59    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
60    #[derive(Debug, Default, Pack)]
61    #[command(code = 0x0004, reply = ReadControllerInformationReply)]
62    pub struct ReadControllerInformation;
63
64    /// Reply for [`ReadControllerInformation`]
65    #[derive(Debug, Unpack, Getters)]
66    #[getset(get = "pub")]
67    pub struct ReadControllerInformationReply {
68        address: super::Address,
69        bluetooth_version: u8,
70        manufacturer: u16,
71        supported_settings: super::Settings,
72        current_settings: super::Settings,
73        class_of_device: super::ClassOfDevice,
74        name: super::Name,
75        short_name: super::ShortName,
76    }
77
78    /// Set Powered Command
79    ///
80    /// see [bluez
81    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
82    #[derive(Debug, Pack, Newtype, New)]
83    #[command(code = 0x0005, reply = SetPoweredReply)]
84    pub struct SetPowered(bool);
85
86    /// Reply for [`SetPowered`]
87    #[derive(Debug, Unpack, Newtype)]
88    pub struct SetPoweredReply(super::Settings);
89
90    /// Set Discoverable Command
91    ///
92    /// see [bluez
93    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
94    #[derive(Debug, Pack, New)]
95    #[command(code = 0x0006, reply = SetDiscoverableReply)]
96    pub struct SetDiscoverable {
97        discoverable: super::Discoverable,
98        timeout: u16,
99    }
100
101    /// Reply for [`SetDiscoverable`]
102    #[derive(Debug, Unpack, Newtype)]
103    pub struct SetDiscoverableReply(super::Settings);
104
105    /// Set Connectable Command
106    ///
107    /// see [bluez
108    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
109    #[derive(Debug, Pack, Newtype, New)]
110    #[command(code = 0x0007, reply = SetConnectableReply)]
111    pub struct SetConnectable(bool);
112
113    /// Reply for [`SetConnectable`]
114    #[derive(Debug, Unpack, Newtype)]
115    pub struct SetConnectableReply(super::Settings);
116
117    /// Set Fast Connectable Command
118    ///
119    /// see [bluez
120    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
121    #[derive(Debug, Pack, Newtype, New)]
122    #[command(code = 0x0008, reply = SetFastConnectableReply)]
123    pub struct SetFastConnectable(bool);
124
125    /// Reply for [`SetFastConnectable`]
126    #[derive(Debug, Unpack, Newtype)]
127    pub struct SetFastConnectableReply(super::Settings);
128
129    /// Set Bondable Command
130    ///
131    /// see [bluez
132    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
133    #[derive(Debug, Pack, Newtype, New)]
134    #[command(code = 0x0009, reply = SetBondableReply)]
135    pub struct SetBondable(bool);
136
137    /// Reply for [`SetBondable`]
138    #[derive(Debug, Unpack, Newtype)]
139    pub struct SetBondableReply(super::Settings);
140
141    /// Set Link Security Command
142    ///
143    /// see [bluez
144    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
145    #[derive(Debug, Pack, Newtype, New)]
146    #[command(code = 0x000A, reply = SetLinkSecurityReply)]
147    pub struct SetLinkSecurity(bool);
148
149    /// Reply for [`SetLinkSecurity`]
150    #[derive(Debug, Unpack, Newtype)]
151    pub struct SetLinkSecurityReply(super::Settings);
152
153    /// Set Secure Simple Pairing Command
154    ///
155    /// see [bluez
156    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
157    #[derive(Debug, Pack, Newtype, New)]
158    #[command(code = 0x000B, reply = SetSecureSimplePairingReply)]
159    pub struct SetSecureSimplePairing(bool);
160
161    /// Reply for [`SetSecureSimplePairing`]
162    #[derive(Debug, Unpack, Newtype)]
163    pub struct SetSecureSimplePairingReply(super::Settings);
164
165    /// Set High Speed Command
166    ///
167    /// see [bluez
168    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
169    #[derive(Debug, Pack, Newtype, New)]
170    #[command(code = 0x000C, reply = SetHighSpeedReply)]
171    pub struct SetHighSpeed(bool);
172
173    /// Reply for [`SetHighSpeed`]
174    #[derive(Debug, Unpack, Newtype)]
175    pub struct SetHighSpeedReply(super::Settings);
176
177    /// Set Low Energy Command
178    ///
179    /// see [bluez
180    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
181    #[derive(Debug, Pack, Newtype, New)]
182    #[command(code = 0x000D, reply = SetLowEnergyReply)]
183    pub struct SetLowEnergy(bool);
184
185    /// Reply for [`SetLowEnergy`]
186    #[derive(Debug, Unpack, Newtype)]
187    pub struct SetLowEnergyReply(super::Settings);
188
189    /// Set Device Class Command
190    ///
191    /// see [bluez
192    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
193    #[derive(Debug, Pack, New)]
194    #[command(code = 0x000E, reply = SetDeviceClassReply)]
195    pub struct SetDeviceClass {
196        major_class: u8,
197        minor_class: u8,
198    }
199
200    /// Reply for [`SetDeviceClass`]
201    #[derive(Debug, Unpack, Newtype)]
202    pub struct SetDeviceClassReply(super::ClassOfDevice);
203
204    /// Set Local Name Command
205    ///
206    /// see [bluez
207    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
208    #[derive(Debug, Pack, New)]
209    #[command(code = 0x000F, reply = SetLocalNameReply)]
210    pub struct SetLocalName {
211        name: super::Name,
212        short_name: super::ShortName,
213    }
214
215    /// Reply for [`SetLocalName`]
216    #[derive(Debug, Unpack, Getters)]
217    #[getset(get = "pub")]
218    pub struct SetLocalNameReply {
219        name: super::Name,
220        short_name: super::ShortName,
221    }
222
223    /// Add UUID Command
224    ///
225    /// see [bluez
226    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
227    #[derive(Debug, Pack, New)]
228    #[command(code = 0x0010, reply = AddUuidReply)]
229    pub struct AddUuid {
230        uuid: super::Uuid,
231        svc_hint: u8,
232    }
233
234    /// Reply for [`AddUuid`]
235    #[derive(Debug, Unpack, Newtype)]
236    pub struct AddUuidReply(super::ClassOfDevice);
237
238    /// Remove UUID Command
239    ///
240    /// see [bluez
241    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
242    #[derive(Debug, Pack, Newtype, New)]
243    #[command(code = 0x0011, reply = RemoveUuidReply)]
244    pub struct RemoveUuid(super::Uuid);
245
246    /// Reply for [`RemoveUuid`]
247    #[derive(Debug, Unpack, Newtype)]
248    pub struct RemoveUuidReply(super::ClassOfDevice);
249
250    /// Load Link Keys Command
251    ///
252    /// see [bluez
253    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
254    #[derive(Debug, Pack, New)]
255    #[command(code = 0x0012, reply = LoadLinkKeysReply)]
256    pub struct LoadLinkKeys {
257        debug_keys: bool,
258        keys: Vec<super::LinkKey>,
259    }
260
261    /// Reply for [`LoadLinkKeys`]
262    #[derive(Debug, Unpack)]
263    pub struct LoadLinkKeysReply;
264
265    /// Load Long Term Keys Command
266    ///
267    /// see [bluez
268    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
269    #[derive(Debug, Pack, IterNewtype)]
270    #[command(code = 0x0013, reply = LoadLongTermKeyReply)]
271    pub struct LoadLongTermKey(Vec<super::LongTermKey>);
272
273    /// Reply for [`LoadLongTermKey`]
274    #[derive(Debug, Unpack)]
275    pub struct LoadLongTermKeyReply;
276
277    /// Disconnect Command
278    ///
279    /// see [bluez
280    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
281    #[derive(Debug, Pack, New)]
282    #[command(code = 0x0014, reply = DisconnectReply)]
283    pub struct Disconnect {
284        address: super::Address,
285        address_type: super::AddressType,
286    }
287
288    /// Reply for [`Disconnect`]
289    #[derive(Debug, Unpack, Getters)]
290    #[getset(get = "pub")]
291    pub struct DisconnectReply {
292        address: super::Address,
293        address_type: super::AddressType,
294    }
295
296    /// Get Connections Command
297    ///
298    /// see [bluez
299    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
300    #[derive(Debug, Pack)]
301    #[command(code = 0x0015, reply = GetConnectionsReply)]
302    pub struct GetConnections;
303
304    /// Reply for [`GetConnections`]
305    #[derive(Debug, Unpack, IterNewtype)]
306    pub struct GetConnectionsReply(Vec<(super::Address, super::AddressType)>);
307
308    /// PIN Code Reply Command
309    ///
310    /// see [bluez
311    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
312    #[derive(Debug, Pack, New)]
313    #[command(code = 0x0016, reply = PinCodeReplyReply)]
314    pub struct PinCodeReply {
315        address: super::Address,
316        address_type: super::AddressType,
317        pin_length: u8,
318        pin_code: [u8; 16],
319    }
320
321    /// Reply for [`PinCodeReply`]
322    #[derive(Debug, Unpack, Getters)]
323    #[getset(get = "pub")]
324    pub struct PinCodeReplyReply {
325        address: super::Address,
326        address_type: super::AddressType,
327    }
328
329    /// PIN Code Negative Reply Command
330    ///
331    /// see [bluez
332    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
333    #[derive(Debug, Pack, New)]
334    #[command(code = 0x0017, reply = PinCodeNegativeReplyReply)]
335    pub struct PinCodeNegativeReply {
336        address: super::Address,
337        address_type: super::AddressType,
338    }
339
340    /// Reply for [`PinCodeNegativeReply`]
341    #[derive(Debug, Unpack, Getters)]
342    #[getset(get = "pub")]
343    pub struct PinCodeNegativeReplyReply {
344        address: super::Address,
345        address_type: super::AddressType,
346    }
347
348    /// Set IO Capability Command
349    ///
350    /// see [bluez
351    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
352    #[derive(Debug, Pack, Newtype, New)]
353    #[command(code = 0x0018, reply = SetIoCapabilityReply)]
354    pub struct SetIoCapability(super::IoCapability);
355
356    /// Reply for [`SetIoCapability`]
357    #[derive(Debug, Unpack)]
358    pub struct SetIoCapabilityReply;
359
360    /// Read Management Version Information Command
361    ///
362    /// see [bluez
363    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
364    #[derive(Debug, Pack, New)]
365    #[command(code = 0x0019, reply = PairDeviceReply)]
366    pub struct PairDevice {
367        address: super::Address,
368        address_type: super::AddressType,
369        io_capability: super::IoCapability,
370    }
371
372    /// Reply for [`PairDevice`]
373    #[derive(Debug, Unpack, Getters)]
374    #[getset(get = "pub")]
375    pub struct PairDeviceReply {
376        address: super::Address,
377        address_type: super::AddressType,
378    }
379
380    /// Cancel Pair Device Command
381    ///
382    /// see [bluez
383    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
384    #[derive(Debug, Pack, New)]
385    #[command(code = 0x001A, reply = CancelPairDeviceReply)]
386    pub struct CancelPairDevice {
387        address: super::Address,
388        address_type: super::AddressType,
389    }
390
391    /// Reply for [`CancelPairDevice`]
392    #[derive(Debug, Unpack, Getters)]
393    #[getset(get = "pub")]
394    pub struct CancelPairDeviceReply {
395        address: super::Address,
396        address_type: super::AddressType,
397    }
398
399    /// Unpair Device Command
400    ///
401    /// see [bluez
402    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
403    #[derive(Debug, Pack, New)]
404    #[command(code = 0x001B, reply = UnpairDeviceReply)]
405    pub struct UnpairDevice {
406        address: super::Address,
407        address_type: super::AddressType,
408        disconnect: bool,
409    }
410
411    /// Reply for [`UnpairDevice`]
412    #[derive(Debug, Unpack, Getters)]
413    #[getset(get = "pub")]
414    pub struct UnpairDeviceReply {
415        address: super::Address,
416        address_type: super::AddressType,
417    }
418
419    /// User Confirmation Reply Command
420    ///
421    /// see [bluez
422    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
423    #[derive(Debug, Pack, New)]
424    #[command(code = 0x001C, reply = UserConfirmationReplyReply)]
425    pub struct UserConfirmationReply {
426        address: super::Address,
427        address_type: super::AddressType,
428    }
429
430    /// Reply for [`UserConfirmationReply`]
431    #[derive(Debug, Unpack, Getters)]
432    #[getset(get = "pub")]
433    pub struct UserConfirmationReplyReply {
434        address: super::Address,
435        address_type: super::AddressType,
436    }
437
438    /// User Confirmation Negative Reply Command
439    ///
440    /// see [bluez
441    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
442    #[derive(Debug, Pack, New)]
443    #[command(code = 0x001D, reply = UserConfirmationNegativeReplyReply)]
444    pub struct UserConfirmationNegativeReply {
445        address: super::Address,
446        address_type: super::AddressType,
447    }
448
449    /// Reply for [`UserConfirmationNegativeReply`]
450    #[derive(Debug, Unpack, Getters)]
451    #[getset(get = "pub")]
452    pub struct UserConfirmationNegativeReplyReply {
453        address: super::Address,
454        address_type: super::AddressType,
455    }
456
457    /// User Passkey Reply Command
458    ///
459    /// see [bluez
460    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
461    #[derive(Debug, Pack, New)]
462    #[command(code = 0x001E, reply = UserPasskeyReplyReply)]
463    pub struct UserPasskeyReply {
464        address: super::Address,
465        address_type: super::AddressType,
466        passkey: u32,
467    }
468
469    /// Reply for [`UserPasskeyReply`]
470    #[derive(Debug, Unpack, Getters)]
471    #[getset(get = "pub")]
472    pub struct UserPasskeyReplyReply {
473        address: super::Address,
474        address_type: super::AddressType,
475    }
476
477    /// User Passkey Negative Reply Command
478    ///
479    /// see [bluez
480    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
481    #[derive(Debug, Pack, New)]
482    #[command(code = 0x001F, reply = UserPasskeyNegativeReplyReply)]
483    pub struct UserPasskeyNegativeReply {
484        address: super::Address,
485        address_type: super::AddressType,
486    }
487
488    /// Reply for [`UserPasskeyNegativeReply`]
489    #[derive(Debug, Unpack, Getters)]
490    #[getset(get = "pub")]
491    pub struct UserPasskeyNegativeReplyReply {
492        address: super::Address,
493        address_type: super::AddressType,
494    }
495
496    /// Read Local Out Of Band Data Command
497    ///
498    /// see [bluez
499    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
500    #[derive(Debug, Pack)]
501    #[command(code = 0x0020, reply = ReadLocalOutOfBandDataReply)]
502    pub struct ReadLocalOutOfBandData;
503
504    /// Reply for [`ReadLocalOutOfBandData`]
505    #[derive(Debug, Unpack, Getters)]
506    #[getset(get = "pub")]
507    pub struct ReadLocalOutOfBandDataReply {
508        hash192: [u8; 16],
509        randomizer192: [u8; 16],
510        hash256: Option<[u8; 16]>,
511        randomizer256: Option<[u8; 16]>,
512    }
513
514    /// Add Remote Out Of Band Data Command
515    ///
516    /// see [bluez
517    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
518    #[derive(Debug, Pack, New)]
519    #[command(code = 0x0021, reply = AddRemoteOutOfBandDataReply)]
520    pub struct AddRemoteOutOfBandData {
521        address: super::Address,
522        address_type: super::AddressType,
523        hash192: [u8; 16],
524        randomizer192: [u8; 16],
525        hash256: Option<[u8; 16]>,
526        randomizer256: Option<[u8; 16]>,
527    }
528
529    /// Reply for [`AddRemoteOutOfBandData`]
530    #[derive(Debug, Unpack, Getters)]
531    #[getset(get = "pub")]
532    pub struct AddRemoteOutOfBandDataReply {
533        address: super::Address,
534        address_type: super::AddressType,
535    }
536
537    /// Remove Remote Out Of Band Data Command
538    ///
539    /// see [bluez
540    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
541    #[derive(Debug, Pack, New)]
542    #[command(code = 0x0022, reply = RemoveRemoteOutOfBandDataReply)]
543    pub struct RemoveRemoteOutOfBandData {
544        address: super::Address,
545        address_type: super::AddressType,
546    }
547
548    /// Reply for [`RemoveRemoteOutOfBandData`]
549    #[derive(Debug, Unpack, Getters)]
550    #[getset(get = "pub")]
551    pub struct RemoveRemoteOutOfBandDataReply {
552        address: super::Address,
553        address_type: super::AddressType,
554    }
555
556    /// Start Discovery Command
557    ///
558    /// see [bluez
559    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
560    #[derive(Debug, Pack, Newtype, New)]
561    #[command(code = 0x0023, reply = StartDiscoveryReply)]
562    pub struct StartDiscovery(super::AddressTypes);
563
564    /// Reply for [`StartDiscovery`]
565    #[derive(Debug, Unpack, Newtype)]
566    pub struct StartDiscoveryReply(super::AddressTypes);
567
568    /// Stop Discovery Command
569    ///
570    /// see [bluez
571    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
572    #[derive(Debug, Pack, Newtype, New)]
573    #[command(code = 0x0024, reply = StopDiscoveryReply)]
574    pub struct StopDiscovery(super::AddressTypes);
575
576    /// Reply for [`StopDiscovery`]
577    #[derive(Debug, Unpack, Newtype)]
578    pub struct StopDiscoveryReply(super::AddressTypes);
579
580    /// Confirm Name Command
581    ///
582    /// see [bluez
583    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
584    #[derive(Debug, Pack, New)]
585    #[command(code = 0x0025, reply = ConfirmNameReply)]
586    pub struct ConfirmName {
587        address: super::Address,
588        address_type: super::AddressType,
589        name_known: bool,
590    }
591
592    /// Reply for [`ConfirmName`]
593    #[derive(Debug, Unpack, Getters)]
594    #[getset(get = "pub")]
595    pub struct ConfirmNameReply {
596        address: super::Address,
597        address_type: super::AddressType,
598    }
599
600    /// Block Device Command
601    ///
602    /// see [bluez
603    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
604    #[derive(Debug, Pack, New)]
605    #[command(code = 0x0026, reply = BlockDeviceReply)]
606    pub struct BlockDevice {
607        address: super::Address,
608        address_type: super::AddressType,
609    }
610
611    /// Reply for [`BlockDevice`]
612    #[derive(Debug, Unpack, Getters)]
613    #[getset(get = "pub")]
614    pub struct BlockDeviceReply {
615        address: super::Address,
616        address_type: super::AddressType,
617    }
618
619    /// Unblock Device Command
620    ///
621    /// see [bluez
622    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
623    #[derive(Debug, Pack, New)]
624    #[command(code = 0x0027, reply = UnblockDeviceReply)]
625    pub struct UnblockDevice {
626        address: super::Address,
627        address_type: super::AddressType,
628    }
629
630    /// Reply for [`UnblockDevice`]
631    #[derive(Debug, Unpack, Getters)]
632    #[getset(get = "pub")]
633    pub struct UnblockDeviceReply {
634        address: super::Address,
635        address_type: super::AddressType,
636    }
637
638    /// Set Device ID Command
639    ///
640    /// see [bluez
641    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
642    #[derive(Debug, Pack)]
643    #[command(code = 0x0028, reply = SetDeviceIdReply)]
644    pub struct SetDeviceId {
645        pub source: super::DeviceIdSource,
646        pub vendor: u16,
647        pub product: u16,
648        pub version: u16,
649    }
650
651    /// Reply for [`SetDeviceId`]
652    #[derive(Debug, Unpack)]
653    pub struct SetDeviceIdReply;
654
655    /// Set Advertising Command
656    ///
657    /// see [bluez
658    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
659    #[derive(Debug, Pack, Newtype, New)]
660    #[command(code = 0x0029, reply = SetAdvertisingReply)]
661    pub struct SetAdvertising(super::Advertising);
662
663    /// Reply for [`SetAdvertising`]
664    #[derive(Debug, Unpack, Newtype)]
665    pub struct SetAdvertisingReply(super::Settings);
666
667    /// Set BR/EDR Command
668    ///
669    /// see [bluez
670    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
671    #[derive(Debug, Pack, Newtype, New)]
672    #[command(code = 0x002A, reply = SetBrEdrReply)]
673    pub struct SetBrEdr(bool);
674
675    /// Reply for [`SetBrEdr`]
676    #[derive(Debug, Unpack, Newtype)]
677    pub struct SetBrEdrReply(super::Settings);
678
679    /// Read Management Version Information Command
680    ///
681    /// see [bluez
682    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
683    #[derive(Debug, Pack, Newtype, New)]
684    #[command(code = 0x002B, reply = SetStaticAddressReply)]
685    pub struct SetStaticAddress(super::Address);
686
687    /// Reply for [`SetStaticAddress`]
688    #[derive(Debug, Unpack, Newtype)]
689    pub struct SetStaticAddressReply(super::Settings);
690
691    /// Set Scan Parameters Command
692    ///
693    /// see [bluez
694    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
695    #[derive(Debug, Pack, New)]
696    #[command(code = 0x002C, reply = SetScanParametersReply)]
697    pub struct SetScanParameters {
698        interval: u16,
699        window: u16,
700    }
701
702    /// Reply for [`SetScanParameters`]
703    #[derive(Debug, Unpack)]
704    pub struct SetScanParametersReply;
705
706    /// Set Secure Connections Command
707    ///
708    /// see [bluez
709    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
710    #[derive(Debug, Pack, Newtype, New)]
711    #[command(code = 0x002D, reply = SetSecureConnectionsReply)]
712    pub struct SetSecureConnections(super::SecureConnections);
713
714    /// Reply for [`SetSecureConnections`]
715    #[derive(Debug, Unpack, Newtype)]
716    pub struct SetSecureConnectionsReply(super::Settings);
717
718    /// Set Debug Keys Command
719    ///
720    /// see [bluez
721    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
722    #[derive(Debug, Pack, Newtype, New)]
723    #[command(code = 0x002E, reply = SetDebugKeysReply)]
724    pub struct SetDebugKeys(super::DebugKeys);
725
726    /// Reply for [`SetDebugKeys`]
727    #[derive(Debug, Unpack, Newtype)]
728    pub struct SetDebugKeysReply(super::Settings);
729
730    /// Set Privacy Command
731    ///
732    /// see [bluez
733    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
734    #[derive(Debug, Pack, New)]
735    #[command(code = 0x002F, reply = SetPrivacyReply)]
736    pub struct SetPrivacy {
737        privacy: super::Privacy,
738        identity_resolving_key: [u8; 16],
739    }
740
741    /// Reply for [`SetPrivacy`]
742    #[derive(Debug, Unpack, Newtype)]
743    pub struct SetPrivacyReply(super::Settings);
744
745    /// Load Identity Resolving Keys Command
746    ///
747    /// see [bluez
748    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
749    #[derive(Debug, Pack, IterNewtype)]
750    #[command(code = 0x0030, reply = LoadIdentityResolvingKeysReply)]
751    pub struct LoadIdentityResolvingKeys(Vec<super::IdentityResolvingKey>);
752
753    /// Reply for [`LoadIdentityResolvingKeys`]
754    #[derive(Debug, Unpack)]
755    pub struct LoadIdentityResolvingKeysReply;
756
757    /// Get Connection Information Command
758    ///
759    /// see [bluez
760    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
761    #[derive(Debug, Pack, New)]
762    #[command(code = 0x0031, reply = GetConnectionInformationReply)]
763    pub struct GetConnectionInformation {
764        address: super::Address,
765        address_type: super::AddressType,
766    }
767
768    /// Reply for [`GetConnectionInformation`]
769    #[derive(Debug, Unpack, Getters)]
770    #[getset(get = "pub")]
771    pub struct GetConnectionInformationReply {
772        address: super::Address,
773        address_type: super::AddressType,
774        rssi: u8,
775        tx_power: u8,
776        max_tx_power: u8,
777    }
778
779    /// Get Clock Information Command
780    ///
781    /// see [bluez
782    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
783    #[derive(Debug, Pack, New)]
784    #[command(code = 0x0032, reply = GetClockInformationReply)]
785    pub struct GetClockInformation {
786        address: super::Address,
787        address_type: super::AddressType,
788    }
789
790    /// Reply for [`GetClockInformation`]
791    #[derive(Debug, Unpack, Getters)]
792    #[getset(get = "pub")]
793    pub struct GetClockInformationReply {
794        address: super::Address,
795        address_type: super::AddressType,
796        local_clock: u32,
797        piconet_clock: u32,
798        accuracy: u16,
799    }
800
801    /// Add Device Command
802    ///
803    /// see [bluez
804    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
805    #[derive(Debug, Pack, New)]
806    #[command(code = 0x0033, reply = AddDeviceReply)]
807    pub struct AddDevice {
808        address: super::Address,
809        address_type: super::AddressType,
810        action: super::Action,
811    }
812
813    /// Reply for [`AddDevice`]
814    #[derive(Debug, Unpack, Getters)]
815    #[getset(get = "pub")]
816    pub struct AddDeviceReply {
817        address: super::Address,
818        address_type: super::AddressType,
819    }
820
821    /// Remove Device Command
822    ///
823    /// see [bluez
824    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
825    #[derive(Debug, Pack, New)]
826    #[command(code = 0x0034, reply = RemoveDeviceReply)]
827    pub struct RemoveDevice {
828        address: super::Address,
829        address_type: super::AddressType,
830    }
831
832    /// Reply for [`RemoveDevice`]
833    #[derive(Debug, Unpack, Getters)]
834    #[getset(get = "pub")]
835    pub struct RemoveDeviceReply {
836        pub address: super::Address,
837        pub address_type: super::AddressType,
838    }
839
840    /// Load Connection Parameters Command
841    ///
842    /// see [bluez
843    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
844    #[derive(Debug, Pack, IterNewtype)]
845    #[command(code = 0x0035, reply = LoadConnectionParametersReply)]
846    pub struct LoadConnectionParameters(Vec<super::ConnectionParameter>);
847
848    /// Reply for [`LoadConnectionParameters`]
849    #[derive(Debug, Unpack)]
850    pub struct LoadConnectionParametersReply;
851
852    /// Read Unconfigured Controller Index List Command
853    ///
854    /// see [bluez
855    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
856    #[derive(Debug, Pack)]
857    #[command(code = 0x0036, reply = ReadUnconfiguredControllerIndexListReply)]
858    pub struct ReadUnconfiguredControllerIndexList;
859
860    /// Reply for [`ReadUnconfiguredControllerIndexList`]
861    #[derive(Debug, Unpack, IterNewtype)]
862    pub struct ReadUnconfiguredControllerIndexListReply(Vec<ControllerIndex>);
863
864    /// Read Controller Configuration Information Command
865    ///
866    /// see [bluez
867    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
868    #[derive(Debug, Pack)]
869    #[command(code = 0x0037, reply = ReadControllerConfigurationInformationReply)]
870    pub struct ReadControllerConfigurationInformation;
871
872    /// Reply for [`ReadControllerConfigurationInformation`]
873    #[derive(Debug, Unpack, Getters)]
874    #[getset(get = "pub")]
875    pub struct ReadControllerConfigurationInformationReply {
876        manufacture: u16,
877        supported_options: super::ControllerConfigurationOption,
878        missing_options: super::ControllerConfigurationOption,
879    }
880
881    /// Set External Configuration Command
882    ///
883    /// see [bluez
884    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
885    #[derive(Debug, Pack, Newtype, New)]
886    #[command(code = 0x0038, reply = SetExternalConfigurationReply)]
887    pub struct SetExternalConfiguration(bool);
888
889    /// Reply for [`SetExternalConfiguration`]
890    #[derive(Debug, Unpack, Newtype)]
891    pub struct SetExternalConfigurationReply(super::ControllerConfigurationOption);
892
893    /// Set Public Address Command
894    ///
895    /// see [bluez
896    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
897    #[derive(Debug, Pack, Newtype, New)]
898    #[command(code = 0x0039, reply = SetPublicAddressReply)]
899    pub struct SetPublicAddress(super::Address);
900
901    /// Reply for [`SetPublicAddress`]
902    #[derive(Debug, Unpack, Newtype)]
903    pub struct SetPublicAddressReply(super::ControllerConfigurationOption);
904
905    /// Start Service Discovery Command
906    ///
907    /// see [bluez
908    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
909    #[derive(Debug, Pack, New)]
910    #[command(code = 0x003A, reply = StartServiceDiscoveryReply)]
911    pub struct StartServiceDiscovery {
912        address_type: super::AddressTypes,
913        rssi_threshold: u8,
914        uuids: Vec<super::Uuid>,
915    }
916
917    /// Reply for [`StartServiceDiscovery`]
918    #[derive(Debug, Unpack, Newtype)]
919    pub struct StartServiceDiscoveryReply(super::AddressTypes);
920
921    /// Read Local Out Of Band Extended Data Command
922    ///
923    /// see [bluez
924    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
925    #[derive(Debug, Pack, Newtype, New)]
926    #[command(code = 0x003B, reply = ReadLocalOutOfBandExtendedDataReply)]
927    pub struct ReadLocalOutOfBandExtendedData(super::AddressTypes);
928
929    /// Reply for [`ReadLocalOutOfBandExtendedData`]
930    #[derive(Debug, Unpack, Getters)]
931    #[getset(get = "pub")]
932    pub struct ReadLocalOutOfBandExtendedDataReply {
933        address_type: super::AddressTypes,
934        eir_data: super::VariableLengthBytes,
935    }
936
937    /// Read Management Version Information Command
938    ///
939    /// see [bluez
940    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
941    #[derive(Debug, Pack)]
942    #[command(code = 0x003C, reply = ReadExtendedControllerIndexListReply)]
943    pub struct ReadExtendedControllerIndexList;
944
945    /// Reply for [`ReadExtendedControllerIndexList`]
946    #[derive(Debug, Unpack, IterNewtype)]
947    pub struct ReadExtendedControllerIndexListReply(
948        Vec<(ControllerIndex, super::ControllerType, super::ControllerBus)>,
949    );
950
951    /// Read Advertising Features Command
952    ///
953    /// see [bluez
954    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
955    #[derive(Debug, Pack)]
956    #[command(code = 0x003D, reply = ReadAdvertisingFeatureReply)]
957    pub struct ReadAdvertisingFeature;
958
959    /// Reply for [`ReadAdvertisingFeature`]
960    #[derive(Debug, Unpack, Getters)]
961    #[getset(get = "pub")]
962    pub struct ReadAdvertisingFeatureReply {
963        supported_flags: super::AdvertisingFlag,
964        max_adv_data_len: u8,
965        max_scan_resp_len: u8,
966        max_instances: u8,
967        instances: super::AdvertiseInstances,
968    }
969
970    /// Add Advertising Command
971    ///
972    /// see [bluez
973    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
974    #[derive(Debug, Pack, New)]
975    #[command(code = 0x003E, reply = AddAdvertisingReply)]
976    pub struct AddAdvertising {
977        instance: super::AdvertiseInstance,
978        flags: super::AdvertisingFlag,
979        duration: u16,
980        timeout: u16,
981        adv_data_scan_resp: super::AdvDataScanResp,
982    }
983
984    /// Reply for [`AddAdvertising`]
985    #[derive(Debug, Unpack, Newtype)]
986    pub struct AddAdvertisingReply(super::AdvertiseInstance);
987
988    /// Remove Advertising Command
989    ///
990    /// see [bluez
991    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
992    #[derive(Debug, Pack, Newtype, New)]
993    #[command(code = 0x003F, reply = RemoveAdvertisingReply)]
994    pub struct RemoveAdvertising(super::AdvertiseInstance);
995
996    /// Reply for [`RemoveAdvertising`]
997    #[derive(Debug, Unpack, Newtype)]
998    pub struct RemoveAdvertisingReply(super::AdvertiseInstance);
999
1000    /// Get Advertising Size Information Command
1001    ///
1002    /// see [bluez
1003    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1004    #[derive(Debug, Pack, New)]
1005    #[command(code = 0x0040, reply = GetAdvertisingSizeInformationReply)]
1006    pub struct GetAdvertisingSizeInformation {
1007        instance: super::AdvertiseInstance,
1008        flags: super::AdvertisingFlag,
1009    }
1010
1011    /// Reply for [`GetAdvertisingSizeInformation`]
1012    #[derive(Debug, Unpack, Getters)]
1013    #[getset(get = "pub")]
1014    pub struct GetAdvertisingSizeInformationReply {
1015        instance: super::AdvertiseInstance,
1016        flags: super::AdvertisingFlag,
1017        max_adv_data_len: u8,
1018        max_scan_resp_len: u8,
1019    }
1020
1021    /// Start Limited Discovery Command
1022    ///
1023    /// see [bluez
1024    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1025    #[derive(Debug, Pack, Newtype, New)]
1026    #[command(code = 0x0041, reply = StartLimitedDiscoveryReply)]
1027    pub struct StartLimitedDiscovery(super::AddressTypes);
1028
1029    /// Reply for [`StartLimitedDiscovery`]
1030    #[derive(Debug, Unpack, Newtype)]
1031    pub struct StartLimitedDiscoveryReply(super::AddressTypes);
1032
1033    /// Read Extended Controller Information Command
1034    ///
1035    /// see [bluez
1036    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1037    #[derive(Debug, Pack)]
1038    #[command(code = 0x0042, reply = ReadExtendedControllerInformationReply)]
1039    pub struct ReadExtendedControllerInformation;
1040
1041    /// Reply for [`ReadExtendedControllerInformation`]
1042    #[derive(Debug, Unpack, Getters)]
1043    #[getset(get = "pub")]
1044    pub struct ReadExtendedControllerInformationReply {
1045        address: super::Address,
1046        bluetooth_version: u8,
1047        manufacturer: u16,
1048        supported_settings: super::Settings,
1049        current_settings: super::Settings,
1050        eir_data: super::VariableLengthBytes,
1051    }
1052
1053    /// Set Appearance Command
1054    ///
1055    /// see [bluez
1056    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1057    #[derive(Debug, Pack, Newtype, New)]
1058    #[command(code = 0x0043, reply = SetApperanceReply)]
1059    pub struct SetApperance(u16);
1060
1061    /// Reply for [`SetApperance`]
1062    #[derive(Debug, Unpack)]
1063    pub struct SetApperanceReply;
1064
1065    /// Get PHY Configuration Command
1066    ///
1067    /// see [bluez
1068    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1069    #[derive(Debug, Pack)]
1070    pub struct GetPhyConfiguration;
1071
1072    /// Reply for [`GetPhyConfiguration`]
1073    #[derive(Debug, Unpack, Getters)]
1074    #[getset(get = "pub")]
1075    pub struct GetPhyConfigurationReply {
1076        supported_phys: super::Phys,
1077        configurable_phys: super::Phys,
1078        selected_phys: super::Phys,
1079    }
1080
1081    /// Set PHY Configuration Command
1082    ///
1083    /// see [bluez
1084    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1085    #[derive(Debug, Pack, Newtype, New)]
1086    #[command(code = 0x0045, reply = SetPhyConfigurationReply)]
1087    pub struct SetPhyConfiguration(super::Phys);
1088
1089    /// Reply for [`SetPhyConfiguration`]
1090    #[derive(Debug, Unpack)]
1091    pub struct SetPhyConfigurationReply;
1092
1093    /// Load Blocked Keys Command
1094    ///
1095    /// see [bluez
1096    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1097    #[derive(Debug, Pack, IterNewtype)]
1098    #[command(code = 0x0046, reply = LoadBlockedKeysReply)]
1099    pub struct LoadBlockedKeys(Vec<super::BlockedKey>);
1100
1101    /// Reply for [`LoadBlockedKeys`]
1102    #[derive(Debug, Unpack)]
1103    pub struct LoadBlockedKeysReply;
1104
1105    /// Set Wideband Speech Command
1106    ///
1107    /// see [bluez
1108    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1109    #[derive(Debug, Pack, Newtype, New)]
1110    #[command(code = 0x0047, reply = SetWidbandSpeechReply)]
1111    pub struct SetWidbandSpeech(bool);
1112
1113    /// Reply for [`SetWidbandSpeech`]
1114    #[derive(Debug, Unpack, Newtype)]
1115    pub struct SetWidbandSpeechReply(super::Settings);
1116
1117    /// Read Security Information Command
1118    ///
1119    /// see [bluez
1120    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1121    #[derive(Debug, Pack)]
1122    #[command(code = 0x0048, reply = ReadSecurityInformationReply)]
1123    pub struct ReadSecurityInformation;
1124
1125    /// Reply for [`ReadSecurityInformation`]
1126    #[derive(Debug, Unpack, Newtype)]
1127    pub struct ReadSecurityInformationReply(super::VariableLengthBytes);
1128
1129    /// Read Experimental Features Information Command
1130    ///
1131    /// see [bluez
1132    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1133    #[derive(Debug, Pack)]
1134    #[command(code = 0x0049, reply = ReadExperimentalFeaturesInformationReply)]
1135    pub struct ReadExperimentalFeaturesInformation;
1136
1137    /// Reply for [`ReadExperimentalFeaturesInformation`]
1138    #[derive(Debug, Unpack, IterNewtype)]
1139    pub struct ReadExperimentalFeaturesInformationReply(Vec<(super::Uuid, super::FeatureFlags)>);
1140
1141    /// Set Experimental Feature Command
1142    ///
1143    /// see [bluez
1144    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1145    #[derive(Debug, Pack, New)]
1146    #[command(code = 0x004A, reply = SetExperimentalFeatureReply)]
1147    pub struct SetExperimentalFeature {
1148        uuid: super::Uuid,
1149        action: super::FeatureAction,
1150    }
1151
1152    /// Reply for [`SetExperimentalFeature`]
1153    #[derive(Debug, Unpack, Getters)]
1154    #[getset(get = "pub")]
1155    pub struct SetExperimentalFeatureReply {
1156        uuid: super::Uuid,
1157        flags: super::FeatureFlags,
1158    }
1159
1160    /// Read Default System Configuration Command
1161    ///
1162    /// see [bluez
1163    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1164    #[derive(Debug, Pack)]
1165    #[command(code = 0x004B, reply = ReadDefaultSystemConfigurationReply)]
1166    pub struct ReadDefaultSystemConfiguration;
1167
1168    /// Reply for [`ReadDefaultSystemConfiguration`]
1169    #[derive(Debug, Unpack, IterNewtype)]
1170    pub struct ReadDefaultSystemConfigurationReply(
1171        super::Remaining<super::SystemConfigurationParameter>,
1172    );
1173
1174    /// Set Default System Configuration Command
1175    ///
1176    /// see [bluez
1177    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1178    #[derive(Debug, Pack, IterNewtype)]
1179    #[command(code = 0x004C, reply = SetDefaultSystemConfigurationReply)]
1180    pub struct SetDefaultSystemConfiguration(super::Remaining<super::SystemConfigurationParameter>);
1181
1182    /// Reply for [`SetDefaultSystemConfiguration`]
1183    #[derive(Debug, Unpack)]
1184    pub struct SetDefaultSystemConfigurationReply;
1185
1186    /// Read Default Runtime Configuration Command
1187    ///
1188    /// see [bluez
1189    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1190    #[derive(Debug, Pack)]
1191    #[command(code = 0x004D, reply = ReadDefaultRuntimeConfigurationReply)]
1192    pub struct ReadDefaultRuntimeConfiguration;
1193
1194    /// Reply for [`ReadDefaultRuntimeConfiguration`]
1195    #[derive(Debug, Unpack, IterNewtype)]
1196    pub struct ReadDefaultRuntimeConfigurationReply(
1197        super::Remaining<super::RuntimeConfigurationParameter>,
1198    );
1199
1200    /// Read Management Version Information Command
1201    ///
1202    /// see [bluez
1203    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1204    #[derive(Debug, Pack, IterNewtype)]
1205    #[command(code = 0x004E, reply = SetDefaultRuntimeConfigurationReply)]
1206    pub struct SetDefaultRuntimeConfiguration(
1207        super::Remaining<super::RuntimeConfigurationParameter>,
1208    );
1209
1210    /// Reply for [`SetDefaultRuntimeConfiguration`]
1211    #[derive(Debug, Unpack)]
1212    pub struct SetDefaultRuntimeConfigurationReply;
1213
1214    /// Get Device Flags Command
1215    ///
1216    /// see [bluez
1217    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1218    #[derive(Debug, Pack, New)]
1219    #[command(code = 0x004F, reply = GetDeviceFlagReply)]
1220    pub struct GetDeviceFlag {
1221        addrss: super::Address,
1222        address_type: super::AddressType,
1223    }
1224
1225    /// Reply for [`GetDeviceFlag`]
1226    #[derive(Debug, Unpack, Getters)]
1227    #[getset(get = "pub")]
1228    pub struct GetDeviceFlagReply {
1229        addrss: super::Address,
1230        address_type: super::AddressType,
1231        supported_flags: super::DeviceFlags,
1232        current_flags: super::DeviceFlags,
1233    }
1234
1235    /// Set Device Flags Command
1236    ///
1237    /// see [bluez
1238    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1239    #[derive(Debug, Pack, New)]
1240    #[command(code = 0x0050, reply = SetDeviceFlagReply)]
1241    pub struct SetDeviceFlag {
1242        addrss: super::Address,
1243        address_type: super::AddressType,
1244        current_flags: super::DeviceFlags,
1245    }
1246
1247    /// Reply for [`SetDeviceFlag`]
1248    #[derive(Debug, Unpack, Getters)]
1249    #[getset(get = "pub")]
1250    pub struct SetDeviceFlagReply {
1251        addrss: super::Address,
1252        address_type: super::AddressType,
1253    }
1254
1255    /// Read Advertisement Monitor Features Command
1256    ///
1257    /// see [bluez
1258    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1259    #[derive(Debug, Pack)]
1260    #[command(code = 0x0051, reply = ReadAdvertisementMonitorFeaturesReply)]
1261    pub struct ReadAdvertisementMonitorFeatures;
1262
1263    /// Reply for [`ReadAdvertisementMonitorFeatures`]
1264    #[derive(Debug, Unpack, Getters)]
1265    #[getset(get = "pub")]
1266    pub struct ReadAdvertisementMonitorFeaturesReply {
1267        supported_features: super::AdvertisementMonitorFeatures,
1268        enabled_features: super::AdvertisementMonitorFeatures,
1269        max_num_handle: u16,
1270        max_num_pattern: u8,
1271        handles: Vec<super::AdvertisementMonitorHandle>,
1272    }
1273
1274    /// Add Advertisement Patterns Monitor Command
1275    ///
1276    /// see [bluez
1277    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1278    #[derive(Debug, Pack, IterNewtype)]
1279    #[command(code = 0x0052, reply = AddAdvertisementPatternsMonitorReply)]
1280    pub struct AddAdvertisementPatternsMonitor(Vec<super::AdvertisementPattern>);
1281
1282    /// Reply for [`AddAdvertisementPatternsMonitor`]
1283    #[derive(Debug, Unpack, Newtype)]
1284    pub struct AddAdvertisementPatternsMonitorReply(super::AdvertisementMonitorHandle);
1285
1286    /// Remove Advertisement Monitor Command
1287    ///
1288    /// see [bluez
1289    /// docs/mgmt-api.txt](https://git.kernel.org/pub/scm/bluetooth/bluez.git/plain/doc/mgmt-api.txt)
1290    #[derive(Debug, Pack, Newtype, New)]
1291    #[command(code = 0x0053, reply = RemoveAdvertisementPatternsMonitorReply)]
1292    pub struct RemoveAdvertisementPatternsMonitor(super::AdvertisementMonitorHandle);
1293
1294    /// Reply for [`RemoveAdvertisementPatternsMonitor`]
1295    #[derive(Debug, Unpack, Newtype)]
1296    pub struct RemoveAdvertisementPatternsMonitorReply(super::AdvertisementMonitorHandle);
1297}
1298
1299#[doc(hidden)]
1300pub fn pack_command<W>(
1301    index: &ControllerIndex,
1302    command: &Command,
1303    write: &mut W,
1304) -> pack::Result<()>
1305where
1306    W: io::Write,
1307{
1308    use smallvec::SmallVec;
1309
1310    let mut buf = SmallVec::<[u8; 64]>::new();
1311    command.pack_inner(&mut buf)?;
1312
1313    command.code().pack(write)?;
1314    index.pack(write)?;
1315    (buf.len() as u16).pack(write)?;
1316    write.write_all(&buf)?;
1317
1318    Ok(())
1319}