xref: /aosp_15_r20/tools/netsim/rust/proto/src/hci_packet.rs (revision cf78ab8cffb8fc9207af348f23af247fb04370a6)
1 // This file is generated by rust-protobuf 3.2.0. Do not edit
2 // .proto file is parsed by protoc 3.21.12
3 // @generated
4 
5 // https://github.com/rust-lang/rust-clippy/issues/702
6 #![allow(unknown_lints)]
7 #![allow(clippy::all)]
8 
9 #![allow(unused_attributes)]
10 #![cfg_attr(rustfmt, rustfmt::skip)]
11 
12 #![allow(dead_code)]
13 #![allow(missing_docs)]
14 #![allow(non_camel_case_types)]
15 #![allow(non_snake_case)]
16 #![allow(non_upper_case_globals)]
17 #![allow(trivial_casts)]
18 #![allow(unused_results)]
19 #![allow(unused_mut)]
20 
21 //! Generated file from `netsim/hci_packet.proto`
22 
23 /// Generated files are compatible only with the same version
24 /// of protobuf runtime.
25 const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0;
26 
27 #[derive(PartialEq,Clone,Default,Debug)]
28 // @@protoc_insertion_point(message:netsim.packet.HCIPacket)
29 pub struct HCIPacket {
30     // message fields
31     // @@protoc_insertion_point(field:netsim.packet.HCIPacket.packet_type)
32     pub packet_type: ::protobuf::EnumOrUnknown<hcipacket::PacketType>,
33     // @@protoc_insertion_point(field:netsim.packet.HCIPacket.packet)
34     pub packet: ::std::vec::Vec<u8>,
35     // special fields
36     // @@protoc_insertion_point(special_field:netsim.packet.HCIPacket.special_fields)
37     pub special_fields: ::protobuf::SpecialFields,
38 }
39 
40 impl<'a> ::std::default::Default for &'a HCIPacket {
default() -> &'a HCIPacket41     fn default() -> &'a HCIPacket {
42         <HCIPacket as ::protobuf::Message>::default_instance()
43     }
44 }
45 
46 impl HCIPacket {
new() -> HCIPacket47     pub fn new() -> HCIPacket {
48         ::std::default::Default::default()
49     }
50 
generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData51     fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
52         let mut fields = ::std::vec::Vec::with_capacity(2);
53         let mut oneofs = ::std::vec::Vec::with_capacity(0);
54         fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
55             "packet_type",
56             |m: &HCIPacket| { &m.packet_type },
57             |m: &mut HCIPacket| { &mut m.packet_type },
58         ));
59         fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
60             "packet",
61             |m: &HCIPacket| { &m.packet },
62             |m: &mut HCIPacket| { &mut m.packet },
63         ));
64         ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<HCIPacket>(
65             "HCIPacket",
66             fields,
67             oneofs,
68         )
69     }
70 }
71 
72 impl ::protobuf::Message for HCIPacket {
73     const NAME: &'static str = "HCIPacket";
74 
is_initialized(&self) -> bool75     fn is_initialized(&self) -> bool {
76         true
77     }
78 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>79     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
80         while let Some(tag) = is.read_raw_tag_or_eof()? {
81             match tag {
82                 8 => {
83                     self.packet_type = is.read_enum_or_unknown()?;
84                 },
85                 18 => {
86                     self.packet = is.read_bytes()?;
87                 },
88                 tag => {
89                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
90                 },
91             };
92         }
93         ::std::result::Result::Ok(())
94     }
95 
96     // Compute sizes of nested messages
97     #[allow(unused_variables)]
compute_size(&self) -> u6498     fn compute_size(&self) -> u64 {
99         let mut my_size = 0;
100         if self.packet_type != ::protobuf::EnumOrUnknown::new(hcipacket::PacketType::HCI_PACKET_UNSPECIFIED) {
101             my_size += ::protobuf::rt::int32_size(1, self.packet_type.value());
102         }
103         if !self.packet.is_empty() {
104             my_size += ::protobuf::rt::bytes_size(2, &self.packet);
105         }
106         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
107         self.special_fields.cached_size().set(my_size as u32);
108         my_size
109     }
110 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>111     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
112         if self.packet_type != ::protobuf::EnumOrUnknown::new(hcipacket::PacketType::HCI_PACKET_UNSPECIFIED) {
113             os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.packet_type))?;
114         }
115         if !self.packet.is_empty() {
116             os.write_bytes(2, &self.packet)?;
117         }
118         os.write_unknown_fields(self.special_fields.unknown_fields())?;
119         ::std::result::Result::Ok(())
120     }
121 
special_fields(&self) -> &::protobuf::SpecialFields122     fn special_fields(&self) -> &::protobuf::SpecialFields {
123         &self.special_fields
124     }
125 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields126     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
127         &mut self.special_fields
128     }
129 
new() -> HCIPacket130     fn new() -> HCIPacket {
131         HCIPacket::new()
132     }
133 
clear(&mut self)134     fn clear(&mut self) {
135         self.packet_type = ::protobuf::EnumOrUnknown::new(hcipacket::PacketType::HCI_PACKET_UNSPECIFIED);
136         self.packet.clear();
137         self.special_fields.clear();
138     }
139 
default_instance() -> &'static HCIPacket140     fn default_instance() -> &'static HCIPacket {
141         static instance: HCIPacket = HCIPacket {
142             packet_type: ::protobuf::EnumOrUnknown::from_i32(0),
143             packet: ::std::vec::Vec::new(),
144             special_fields: ::protobuf::SpecialFields::new(),
145         };
146         &instance
147     }
148 }
149 
150 impl ::protobuf::MessageFull for HCIPacket {
descriptor() -> ::protobuf::reflect::MessageDescriptor151     fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
152         static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
153         descriptor.get(|| file_descriptor().message_by_package_relative_name("HCIPacket").unwrap()).clone()
154     }
155 }
156 
157 impl ::std::fmt::Display for HCIPacket {
fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result158     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
159         ::protobuf::text_format::fmt(self, f)
160     }
161 }
162 
163 impl ::protobuf::reflect::ProtobufValue for HCIPacket {
164     type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
165 }
166 
167 /// Nested message and enums of message `HCIPacket`
168 pub mod hcipacket {
169     #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
170     // @@protoc_insertion_point(enum:netsim.packet.HCIPacket.PacketType)
171     pub enum PacketType {
172         // @@protoc_insertion_point(enum_value:netsim.packet.HCIPacket.PacketType.HCI_PACKET_UNSPECIFIED)
173         HCI_PACKET_UNSPECIFIED = 0,
174         // @@protoc_insertion_point(enum_value:netsim.packet.HCIPacket.PacketType.COMMAND)
175         COMMAND = 1,
176         // @@protoc_insertion_point(enum_value:netsim.packet.HCIPacket.PacketType.ACL)
177         ACL = 2,
178         // @@protoc_insertion_point(enum_value:netsim.packet.HCIPacket.PacketType.SCO)
179         SCO = 3,
180         // @@protoc_insertion_point(enum_value:netsim.packet.HCIPacket.PacketType.EVENT)
181         EVENT = 4,
182         // @@protoc_insertion_point(enum_value:netsim.packet.HCIPacket.PacketType.ISO)
183         ISO = 5,
184     }
185 
186     impl ::protobuf::Enum for PacketType {
187         const NAME: &'static str = "PacketType";
188 
value(&self) -> i32189         fn value(&self) -> i32 {
190             *self as i32
191         }
192 
from_i32(value: i32) -> ::std::option::Option<PacketType>193         fn from_i32(value: i32) -> ::std::option::Option<PacketType> {
194             match value {
195                 0 => ::std::option::Option::Some(PacketType::HCI_PACKET_UNSPECIFIED),
196                 1 => ::std::option::Option::Some(PacketType::COMMAND),
197                 2 => ::std::option::Option::Some(PacketType::ACL),
198                 3 => ::std::option::Option::Some(PacketType::SCO),
199                 4 => ::std::option::Option::Some(PacketType::EVENT),
200                 5 => ::std::option::Option::Some(PacketType::ISO),
201                 _ => ::std::option::Option::None
202             }
203         }
204 
205         const VALUES: &'static [PacketType] = &[
206             PacketType::HCI_PACKET_UNSPECIFIED,
207             PacketType::COMMAND,
208             PacketType::ACL,
209             PacketType::SCO,
210             PacketType::EVENT,
211             PacketType::ISO,
212         ];
213     }
214 
215     impl ::protobuf::EnumFull for PacketType {
enum_descriptor() -> ::protobuf::reflect::EnumDescriptor216         fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
217             static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
218             descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("HCIPacket.PacketType").unwrap()).clone()
219         }
220 
descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor221         fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
222             let index = *self as usize;
223             Self::enum_descriptor().value_by_index(index)
224         }
225     }
226 
227     impl ::std::default::Default for PacketType {
default() -> Self228         fn default() -> Self {
229             PacketType::HCI_PACKET_UNSPECIFIED
230         }
231     }
232 
233     impl PacketType {
generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData234         pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
235             ::protobuf::reflect::GeneratedEnumDescriptorData::new::<PacketType>("HCIPacket.PacketType")
236         }
237     }
238 }
239 
240 static file_descriptor_proto_data: &'static [u8] = b"\
241     \n\x17netsim/hci_packet.proto\x12\rnetsim.packet\"\xc6\x01\n\tHCIPacket\
242     \x12D\n\x0bpacket_type\x18\x01\x20\x01(\x0e2#.netsim.packet.HCIPacket.Pa\
243     cketTypeR\npacketType\x12\x16\n\x06packet\x18\x02\x20\x01(\x0cR\x06packe\
244     t\"[\n\nPacketType\x12\x1a\n\x16HCI_PACKET_UNSPECIFIED\x10\0\x12\x0b\n\
245     \x07COMMAND\x10\x01\x12\x07\n\x03ACL\x10\x02\x12\x07\n\x03SCO\x10\x03\
246     \x12\t\n\x05EVENT\x10\x04\x12\x07\n\x03ISO\x10\x05BJ\n\x1fcom.android.em\
247     ulation.bluetoothP\x01\xf8\x01\x01\xa2\x02\x03AEB\xaa\x02\x1bAndroid.Emu\
248     lation.Bluetoothb\x06proto3\
249 ";
250 
251 /// `FileDescriptorProto` object which was a source for this generated file
file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto252 fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
253     static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
254     file_descriptor_proto_lazy.get(|| {
255         ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
256     })
257 }
258 
259 /// `FileDescriptor` object which allows dynamic access to files
file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor260 pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
261     static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
262     static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
263     file_descriptor.get(|| {
264         let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
265             let mut deps = ::std::vec::Vec::with_capacity(0);
266             let mut messages = ::std::vec::Vec::with_capacity(1);
267             messages.push(HCIPacket::generated_message_descriptor_data());
268             let mut enums = ::std::vec::Vec::with_capacity(1);
269             enums.push(hcipacket::PacketType::generated_enum_descriptor_data());
270             ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
271                 file_descriptor_proto(),
272                 deps,
273                 messages,
274                 enums,
275             )
276         });
277         ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
278     })
279 }
280