1use 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#[commands(name = Command, trait = CommandRequest, codes = CommandCode)]
13mod imp {
14 use super::*;
15
16 #[derive(Debug, Default, Pack)]
21 #[command(code = 0x0001, reply = ReadManagementVersionInformationReply)]
22 pub struct ReadManagementVersionInformation;
23
24 #[derive(Debug, Unpack, Getters)]
26 #[getset(get = "pub")]
27 pub struct ReadManagementVersionInformationReply {
28 version: u8,
29 revision: u16,
30 }
31
32 #[derive(Debug, Default, Pack)]
37 #[command(code = 0x0002, reply = ReadManagementSupportedCommandsReply)]
38 pub struct ReadManagementSupportedCommands;
39
40 #[derive(Debug, Unpack, Newtype)]
42 pub struct ReadManagementSupportedCommandsReply(super::CommandsEvents);
43
44 #[derive(Debug, Default, Pack)]
49 #[command(code = 0x0003, reply = ReadControllerIndexListReply)]
50 pub struct ReadControllerIndexList;
51
52 #[derive(Debug, Unpack, IterNewtype)]
54 pub struct ReadControllerIndexListReply(Vec<ControllerIndex>);
55
56 #[derive(Debug, Default, Pack)]
61 #[command(code = 0x0004, reply = ReadControllerInformationReply)]
62 pub struct ReadControllerInformation;
63
64 #[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 #[derive(Debug, Pack, Newtype, New)]
83 #[command(code = 0x0005, reply = SetPoweredReply)]
84 pub struct SetPowered(bool);
85
86 #[derive(Debug, Unpack, Newtype)]
88 pub struct SetPoweredReply(super::Settings);
89
90 #[derive(Debug, Pack, New)]
95 #[command(code = 0x0006, reply = SetDiscoverableReply)]
96 pub struct SetDiscoverable {
97 discoverable: super::Discoverable,
98 timeout: u16,
99 }
100
101 #[derive(Debug, Unpack, Newtype)]
103 pub struct SetDiscoverableReply(super::Settings);
104
105 #[derive(Debug, Pack, Newtype, New)]
110 #[command(code = 0x0007, reply = SetConnectableReply)]
111 pub struct SetConnectable(bool);
112
113 #[derive(Debug, Unpack, Newtype)]
115 pub struct SetConnectableReply(super::Settings);
116
117 #[derive(Debug, Pack, Newtype, New)]
122 #[command(code = 0x0008, reply = SetFastConnectableReply)]
123 pub struct SetFastConnectable(bool);
124
125 #[derive(Debug, Unpack, Newtype)]
127 pub struct SetFastConnectableReply(super::Settings);
128
129 #[derive(Debug, Pack, Newtype, New)]
134 #[command(code = 0x0009, reply = SetBondableReply)]
135 pub struct SetBondable(bool);
136
137 #[derive(Debug, Unpack, Newtype)]
139 pub struct SetBondableReply(super::Settings);
140
141 #[derive(Debug, Pack, Newtype, New)]
146 #[command(code = 0x000A, reply = SetLinkSecurityReply)]
147 pub struct SetLinkSecurity(bool);
148
149 #[derive(Debug, Unpack, Newtype)]
151 pub struct SetLinkSecurityReply(super::Settings);
152
153 #[derive(Debug, Pack, Newtype, New)]
158 #[command(code = 0x000B, reply = SetSecureSimplePairingReply)]
159 pub struct SetSecureSimplePairing(bool);
160
161 #[derive(Debug, Unpack, Newtype)]
163 pub struct SetSecureSimplePairingReply(super::Settings);
164
165 #[derive(Debug, Pack, Newtype, New)]
170 #[command(code = 0x000C, reply = SetHighSpeedReply)]
171 pub struct SetHighSpeed(bool);
172
173 #[derive(Debug, Unpack, Newtype)]
175 pub struct SetHighSpeedReply(super::Settings);
176
177 #[derive(Debug, Pack, Newtype, New)]
182 #[command(code = 0x000D, reply = SetLowEnergyReply)]
183 pub struct SetLowEnergy(bool);
184
185 #[derive(Debug, Unpack, Newtype)]
187 pub struct SetLowEnergyReply(super::Settings);
188
189 #[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 #[derive(Debug, Unpack, Newtype)]
202 pub struct SetDeviceClassReply(super::ClassOfDevice);
203
204 #[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 #[derive(Debug, Unpack, Getters)]
217 #[getset(get = "pub")]
218 pub struct SetLocalNameReply {
219 name: super::Name,
220 short_name: super::ShortName,
221 }
222
223 #[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 #[derive(Debug, Unpack, Newtype)]
236 pub struct AddUuidReply(super::ClassOfDevice);
237
238 #[derive(Debug, Pack, Newtype, New)]
243 #[command(code = 0x0011, reply = RemoveUuidReply)]
244 pub struct RemoveUuid(super::Uuid);
245
246 #[derive(Debug, Unpack, Newtype)]
248 pub struct RemoveUuidReply(super::ClassOfDevice);
249
250 #[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 #[derive(Debug, Unpack)]
263 pub struct LoadLinkKeysReply;
264
265 #[derive(Debug, Pack, IterNewtype)]
270 #[command(code = 0x0013, reply = LoadLongTermKeyReply)]
271 pub struct LoadLongTermKey(Vec<super::LongTermKey>);
272
273 #[derive(Debug, Unpack)]
275 pub struct LoadLongTermKeyReply;
276
277 #[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 #[derive(Debug, Unpack, Getters)]
290 #[getset(get = "pub")]
291 pub struct DisconnectReply {
292 address: super::Address,
293 address_type: super::AddressType,
294 }
295
296 #[derive(Debug, Pack)]
301 #[command(code = 0x0015, reply = GetConnectionsReply)]
302 pub struct GetConnections;
303
304 #[derive(Debug, Unpack, IterNewtype)]
306 pub struct GetConnectionsReply(Vec<(super::Address, super::AddressType)>);
307
308 #[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 #[derive(Debug, Unpack, Getters)]
323 #[getset(get = "pub")]
324 pub struct PinCodeReplyReply {
325 address: super::Address,
326 address_type: super::AddressType,
327 }
328
329 #[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 #[derive(Debug, Unpack, Getters)]
342 #[getset(get = "pub")]
343 pub struct PinCodeNegativeReplyReply {
344 address: super::Address,
345 address_type: super::AddressType,
346 }
347
348 #[derive(Debug, Pack, Newtype, New)]
353 #[command(code = 0x0018, reply = SetIoCapabilityReply)]
354 pub struct SetIoCapability(super::IoCapability);
355
356 #[derive(Debug, Unpack)]
358 pub struct SetIoCapabilityReply;
359
360 #[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 #[derive(Debug, Unpack, Getters)]
374 #[getset(get = "pub")]
375 pub struct PairDeviceReply {
376 address: super::Address,
377 address_type: super::AddressType,
378 }
379
380 #[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 #[derive(Debug, Unpack, Getters)]
393 #[getset(get = "pub")]
394 pub struct CancelPairDeviceReply {
395 address: super::Address,
396 address_type: super::AddressType,
397 }
398
399 #[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 #[derive(Debug, Unpack, Getters)]
413 #[getset(get = "pub")]
414 pub struct UnpairDeviceReply {
415 address: super::Address,
416 address_type: super::AddressType,
417 }
418
419 #[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 #[derive(Debug, Unpack, Getters)]
432 #[getset(get = "pub")]
433 pub struct UserConfirmationReplyReply {
434 address: super::Address,
435 address_type: super::AddressType,
436 }
437
438 #[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 #[derive(Debug, Unpack, Getters)]
451 #[getset(get = "pub")]
452 pub struct UserConfirmationNegativeReplyReply {
453 address: super::Address,
454 address_type: super::AddressType,
455 }
456
457 #[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 #[derive(Debug, Unpack, Getters)]
471 #[getset(get = "pub")]
472 pub struct UserPasskeyReplyReply {
473 address: super::Address,
474 address_type: super::AddressType,
475 }
476
477 #[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 #[derive(Debug, Unpack, Getters)]
490 #[getset(get = "pub")]
491 pub struct UserPasskeyNegativeReplyReply {
492 address: super::Address,
493 address_type: super::AddressType,
494 }
495
496 #[derive(Debug, Pack)]
501 #[command(code = 0x0020, reply = ReadLocalOutOfBandDataReply)]
502 pub struct ReadLocalOutOfBandData;
503
504 #[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 #[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 #[derive(Debug, Unpack, Getters)]
531 #[getset(get = "pub")]
532 pub struct AddRemoteOutOfBandDataReply {
533 address: super::Address,
534 address_type: super::AddressType,
535 }
536
537 #[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 #[derive(Debug, Unpack, Getters)]
550 #[getset(get = "pub")]
551 pub struct RemoveRemoteOutOfBandDataReply {
552 address: super::Address,
553 address_type: super::AddressType,
554 }
555
556 #[derive(Debug, Pack, Newtype, New)]
561 #[command(code = 0x0023, reply = StartDiscoveryReply)]
562 pub struct StartDiscovery(super::AddressTypes);
563
564 #[derive(Debug, Unpack, Newtype)]
566 pub struct StartDiscoveryReply(super::AddressTypes);
567
568 #[derive(Debug, Pack, Newtype, New)]
573 #[command(code = 0x0024, reply = StopDiscoveryReply)]
574 pub struct StopDiscovery(super::AddressTypes);
575
576 #[derive(Debug, Unpack, Newtype)]
578 pub struct StopDiscoveryReply(super::AddressTypes);
579
580 #[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 #[derive(Debug, Unpack, Getters)]
594 #[getset(get = "pub")]
595 pub struct ConfirmNameReply {
596 address: super::Address,
597 address_type: super::AddressType,
598 }
599
600 #[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 #[derive(Debug, Unpack, Getters)]
613 #[getset(get = "pub")]
614 pub struct BlockDeviceReply {
615 address: super::Address,
616 address_type: super::AddressType,
617 }
618
619 #[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 #[derive(Debug, Unpack, Getters)]
632 #[getset(get = "pub")]
633 pub struct UnblockDeviceReply {
634 address: super::Address,
635 address_type: super::AddressType,
636 }
637
638 #[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 #[derive(Debug, Unpack)]
653 pub struct SetDeviceIdReply;
654
655 #[derive(Debug, Pack, Newtype, New)]
660 #[command(code = 0x0029, reply = SetAdvertisingReply)]
661 pub struct SetAdvertising(super::Advertising);
662
663 #[derive(Debug, Unpack, Newtype)]
665 pub struct SetAdvertisingReply(super::Settings);
666
667 #[derive(Debug, Pack, Newtype, New)]
672 #[command(code = 0x002A, reply = SetBrEdrReply)]
673 pub struct SetBrEdr(bool);
674
675 #[derive(Debug, Unpack, Newtype)]
677 pub struct SetBrEdrReply(super::Settings);
678
679 #[derive(Debug, Pack, Newtype, New)]
684 #[command(code = 0x002B, reply = SetStaticAddressReply)]
685 pub struct SetStaticAddress(super::Address);
686
687 #[derive(Debug, Unpack, Newtype)]
689 pub struct SetStaticAddressReply(super::Settings);
690
691 #[derive(Debug, Pack, New)]
696 #[command(code = 0x002C, reply = SetScanParametersReply)]
697 pub struct SetScanParameters {
698 interval: u16,
699 window: u16,
700 }
701
702 #[derive(Debug, Unpack)]
704 pub struct SetScanParametersReply;
705
706 #[derive(Debug, Pack, Newtype, New)]
711 #[command(code = 0x002D, reply = SetSecureConnectionsReply)]
712 pub struct SetSecureConnections(super::SecureConnections);
713
714 #[derive(Debug, Unpack, Newtype)]
716 pub struct SetSecureConnectionsReply(super::Settings);
717
718 #[derive(Debug, Pack, Newtype, New)]
723 #[command(code = 0x002E, reply = SetDebugKeysReply)]
724 pub struct SetDebugKeys(super::DebugKeys);
725
726 #[derive(Debug, Unpack, Newtype)]
728 pub struct SetDebugKeysReply(super::Settings);
729
730 #[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 #[derive(Debug, Unpack, Newtype)]
743 pub struct SetPrivacyReply(super::Settings);
744
745 #[derive(Debug, Pack, IterNewtype)]
750 #[command(code = 0x0030, reply = LoadIdentityResolvingKeysReply)]
751 pub struct LoadIdentityResolvingKeys(Vec<super::IdentityResolvingKey>);
752
753 #[derive(Debug, Unpack)]
755 pub struct LoadIdentityResolvingKeysReply;
756
757 #[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 #[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 #[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 #[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 #[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 #[derive(Debug, Unpack, Getters)]
815 #[getset(get = "pub")]
816 pub struct AddDeviceReply {
817 address: super::Address,
818 address_type: super::AddressType,
819 }
820
821 #[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 #[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 #[derive(Debug, Pack, IterNewtype)]
845 #[command(code = 0x0035, reply = LoadConnectionParametersReply)]
846 pub struct LoadConnectionParameters(Vec<super::ConnectionParameter>);
847
848 #[derive(Debug, Unpack)]
850 pub struct LoadConnectionParametersReply;
851
852 #[derive(Debug, Pack)]
857 #[command(code = 0x0036, reply = ReadUnconfiguredControllerIndexListReply)]
858 pub struct ReadUnconfiguredControllerIndexList;
859
860 #[derive(Debug, Unpack, IterNewtype)]
862 pub struct ReadUnconfiguredControllerIndexListReply(Vec<ControllerIndex>);
863
864 #[derive(Debug, Pack)]
869 #[command(code = 0x0037, reply = ReadControllerConfigurationInformationReply)]
870 pub struct ReadControllerConfigurationInformation;
871
872 #[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 #[derive(Debug, Pack, Newtype, New)]
886 #[command(code = 0x0038, reply = SetExternalConfigurationReply)]
887 pub struct SetExternalConfiguration(bool);
888
889 #[derive(Debug, Unpack, Newtype)]
891 pub struct SetExternalConfigurationReply(super::ControllerConfigurationOption);
892
893 #[derive(Debug, Pack, Newtype, New)]
898 #[command(code = 0x0039, reply = SetPublicAddressReply)]
899 pub struct SetPublicAddress(super::Address);
900
901 #[derive(Debug, Unpack, Newtype)]
903 pub struct SetPublicAddressReply(super::ControllerConfigurationOption);
904
905 #[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 #[derive(Debug, Unpack, Newtype)]
919 pub struct StartServiceDiscoveryReply(super::AddressTypes);
920
921 #[derive(Debug, Pack, Newtype, New)]
926 #[command(code = 0x003B, reply = ReadLocalOutOfBandExtendedDataReply)]
927 pub struct ReadLocalOutOfBandExtendedData(super::AddressTypes);
928
929 #[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 #[derive(Debug, Pack)]
942 #[command(code = 0x003C, reply = ReadExtendedControllerIndexListReply)]
943 pub struct ReadExtendedControllerIndexList;
944
945 #[derive(Debug, Unpack, IterNewtype)]
947 pub struct ReadExtendedControllerIndexListReply(
948 Vec<(ControllerIndex, super::ControllerType, super::ControllerBus)>,
949 );
950
951 #[derive(Debug, Pack)]
956 #[command(code = 0x003D, reply = ReadAdvertisingFeatureReply)]
957 pub struct ReadAdvertisingFeature;
958
959 #[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 #[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 #[derive(Debug, Unpack, Newtype)]
986 pub struct AddAdvertisingReply(super::AdvertiseInstance);
987
988 #[derive(Debug, Pack, Newtype, New)]
993 #[command(code = 0x003F, reply = RemoveAdvertisingReply)]
994 pub struct RemoveAdvertising(super::AdvertiseInstance);
995
996 #[derive(Debug, Unpack, Newtype)]
998 pub struct RemoveAdvertisingReply(super::AdvertiseInstance);
999
1000 #[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 #[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 #[derive(Debug, Pack, Newtype, New)]
1026 #[command(code = 0x0041, reply = StartLimitedDiscoveryReply)]
1027 pub struct StartLimitedDiscovery(super::AddressTypes);
1028
1029 #[derive(Debug, Unpack, Newtype)]
1031 pub struct StartLimitedDiscoveryReply(super::AddressTypes);
1032
1033 #[derive(Debug, Pack)]
1038 #[command(code = 0x0042, reply = ReadExtendedControllerInformationReply)]
1039 pub struct ReadExtendedControllerInformation;
1040
1041 #[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 #[derive(Debug, Pack, Newtype, New)]
1058 #[command(code = 0x0043, reply = SetApperanceReply)]
1059 pub struct SetApperance(u16);
1060
1061 #[derive(Debug, Unpack)]
1063 pub struct SetApperanceReply;
1064
1065 #[derive(Debug, Pack)]
1070 pub struct GetPhyConfiguration;
1071
1072 #[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 #[derive(Debug, Pack, Newtype, New)]
1086 #[command(code = 0x0045, reply = SetPhyConfigurationReply)]
1087 pub struct SetPhyConfiguration(super::Phys);
1088
1089 #[derive(Debug, Unpack)]
1091 pub struct SetPhyConfigurationReply;
1092
1093 #[derive(Debug, Pack, IterNewtype)]
1098 #[command(code = 0x0046, reply = LoadBlockedKeysReply)]
1099 pub struct LoadBlockedKeys(Vec<super::BlockedKey>);
1100
1101 #[derive(Debug, Unpack)]
1103 pub struct LoadBlockedKeysReply;
1104
1105 #[derive(Debug, Pack, Newtype, New)]
1110 #[command(code = 0x0047, reply = SetWidbandSpeechReply)]
1111 pub struct SetWidbandSpeech(bool);
1112
1113 #[derive(Debug, Unpack, Newtype)]
1115 pub struct SetWidbandSpeechReply(super::Settings);
1116
1117 #[derive(Debug, Pack)]
1122 #[command(code = 0x0048, reply = ReadSecurityInformationReply)]
1123 pub struct ReadSecurityInformation;
1124
1125 #[derive(Debug, Unpack, Newtype)]
1127 pub struct ReadSecurityInformationReply(super::VariableLengthBytes);
1128
1129 #[derive(Debug, Pack)]
1134 #[command(code = 0x0049, reply = ReadExperimentalFeaturesInformationReply)]
1135 pub struct ReadExperimentalFeaturesInformation;
1136
1137 #[derive(Debug, Unpack, IterNewtype)]
1139 pub struct ReadExperimentalFeaturesInformationReply(Vec<(super::Uuid, super::FeatureFlags)>);
1140
1141 #[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 #[derive(Debug, Unpack, Getters)]
1154 #[getset(get = "pub")]
1155 pub struct SetExperimentalFeatureReply {
1156 uuid: super::Uuid,
1157 flags: super::FeatureFlags,
1158 }
1159
1160 #[derive(Debug, Pack)]
1165 #[command(code = 0x004B, reply = ReadDefaultSystemConfigurationReply)]
1166 pub struct ReadDefaultSystemConfiguration;
1167
1168 #[derive(Debug, Unpack, IterNewtype)]
1170 pub struct ReadDefaultSystemConfigurationReply(
1171 super::Remaining<super::SystemConfigurationParameter>,
1172 );
1173
1174 #[derive(Debug, Pack, IterNewtype)]
1179 #[command(code = 0x004C, reply = SetDefaultSystemConfigurationReply)]
1180 pub struct SetDefaultSystemConfiguration(super::Remaining<super::SystemConfigurationParameter>);
1181
1182 #[derive(Debug, Unpack)]
1184 pub struct SetDefaultSystemConfigurationReply;
1185
1186 #[derive(Debug, Pack)]
1191 #[command(code = 0x004D, reply = ReadDefaultRuntimeConfigurationReply)]
1192 pub struct ReadDefaultRuntimeConfiguration;
1193
1194 #[derive(Debug, Unpack, IterNewtype)]
1196 pub struct ReadDefaultRuntimeConfigurationReply(
1197 super::Remaining<super::RuntimeConfigurationParameter>,
1198 );
1199
1200 #[derive(Debug, Pack, IterNewtype)]
1205 #[command(code = 0x004E, reply = SetDefaultRuntimeConfigurationReply)]
1206 pub struct SetDefaultRuntimeConfiguration(
1207 super::Remaining<super::RuntimeConfigurationParameter>,
1208 );
1209
1210 #[derive(Debug, Unpack)]
1212 pub struct SetDefaultRuntimeConfigurationReply;
1213
1214 #[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 #[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 #[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 #[derive(Debug, Unpack, Getters)]
1249 #[getset(get = "pub")]
1250 pub struct SetDeviceFlagReply {
1251 addrss: super::Address,
1252 address_type: super::AddressType,
1253 }
1254
1255 #[derive(Debug, Pack)]
1260 #[command(code = 0x0051, reply = ReadAdvertisementMonitorFeaturesReply)]
1261 pub struct ReadAdvertisementMonitorFeatures;
1262
1263 #[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 #[derive(Debug, Pack, IterNewtype)]
1279 #[command(code = 0x0052, reply = AddAdvertisementPatternsMonitorReply)]
1280 pub struct AddAdvertisementPatternsMonitor(Vec<super::AdvertisementPattern>);
1281
1282 #[derive(Debug, Unpack, Newtype)]
1284 pub struct AddAdvertisementPatternsMonitorReply(super::AdvertisementMonitorHandle);
1285
1286 #[derive(Debug, Pack, Newtype, New)]
1291 #[command(code = 0x0053, reply = RemoveAdvertisementPatternsMonitorReply)]
1292 pub struct RemoveAdvertisementPatternsMonitor(super::AdvertisementMonitorHandle);
1293
1294 #[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}