1 // This file is generated by rust-protobuf 2.28.0. Do not edit
2 // @generated
3
4 // https://github.com/rust-lang/rust-clippy/issues/702
5 #![allow(unknown_lints)]
6 #![allow(clippy::all)]
7
8 #![allow(unused_attributes)]
9 #![cfg_attr(rustfmt, rustfmt::skip)]
10
11 #![allow(box_pointers)]
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_imports)]
19 #![allow(unused_results)]
20 //! Generated file from `hci_packet.proto`
21
22 /// Generated files are compatible only with the same version
23 /// of protobuf runtime.
24 // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0;
25
26 #[derive(PartialEq,Clone,Default)]
27 #[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
28 pub struct HCIPacket {
29 // message fields
30 pub field_type: HCIPacket_PacketType,
31 pub packet: ::std::vec::Vec<u8>,
32 // special fields
33 #[cfg_attr(feature = "with-serde", serde(skip))]
34 pub unknown_fields: ::protobuf::UnknownFields,
35 #[cfg_attr(feature = "with-serde", serde(skip))]
36 pub cached_size: ::protobuf::CachedSize,
37 }
38
39 impl<'a> ::std::default::Default for &'a HCIPacket {
default() -> &'a HCIPacket40 fn default() -> &'a HCIPacket {
41 <HCIPacket as ::protobuf::Message>::default_instance()
42 }
43 }
44
45 impl HCIPacket {
new() -> HCIPacket46 pub fn new() -> HCIPacket {
47 ::std::default::Default::default()
48 }
49
50 // .netsim.packet.HCIPacket.PacketType type = 1;
51
52
get_field_type(&self) -> HCIPacket_PacketType53 pub fn get_field_type(&self) -> HCIPacket_PacketType {
54 self.field_type
55 }
clear_field_type(&mut self)56 pub fn clear_field_type(&mut self) {
57 self.field_type = HCIPacket_PacketType::PACKET_TYPE_UNSPECIFIED;
58 }
59
60 // Param is passed by value, moved
set_field_type(&mut self, v: HCIPacket_PacketType)61 pub fn set_field_type(&mut self, v: HCIPacket_PacketType) {
62 self.field_type = v;
63 }
64
65 // bytes packet = 2;
66
67
get_packet(&self) -> &[u8]68 pub fn get_packet(&self) -> &[u8] {
69 &self.packet
70 }
clear_packet(&mut self)71 pub fn clear_packet(&mut self) {
72 self.packet.clear();
73 }
74
75 // Param is passed by value, moved
set_packet(&mut self, v: ::std::vec::Vec<u8>)76 pub fn set_packet(&mut self, v: ::std::vec::Vec<u8>) {
77 self.packet = v;
78 }
79
80 // Mutable pointer to the field.
81 // If field is not initialized, it is initialized with default value first.
mut_packet(&mut self) -> &mut ::std::vec::Vec<u8>82 pub fn mut_packet(&mut self) -> &mut ::std::vec::Vec<u8> {
83 &mut self.packet
84 }
85
86 // Take field
take_packet(&mut self) -> ::std::vec::Vec<u8>87 pub fn take_packet(&mut self) -> ::std::vec::Vec<u8> {
88 ::std::mem::replace(&mut self.packet, ::std::vec::Vec::new())
89 }
90 }
91
92 impl ::protobuf::Message for HCIPacket {
is_initialized(&self) -> bool93 fn is_initialized(&self) -> bool {
94 true
95 }
96
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()>97 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
98 while !is.eof()? {
99 let (field_number, wire_type) = is.read_tag_unpack()?;
100 match field_number {
101 1 => {
102 ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.field_type, 1, &mut self.unknown_fields)?
103 },
104 2 => {
105 ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.packet)?;
106 },
107 _ => {
108 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
109 },
110 };
111 }
112 ::std::result::Result::Ok(())
113 }
114
115 // Compute sizes of nested messages
116 #[allow(unused_variables)]
compute_size(&self) -> u32117 fn compute_size(&self) -> u32 {
118 let mut my_size = 0;
119 if self.field_type != HCIPacket_PacketType::PACKET_TYPE_UNSPECIFIED {
120 my_size += ::protobuf::rt::enum_size(1, self.field_type);
121 }
122 if !self.packet.is_empty() {
123 my_size += ::protobuf::rt::bytes_size(2, &self.packet);
124 }
125 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
126 self.cached_size.set(my_size);
127 my_size
128 }
129
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()>130 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
131 if self.field_type != HCIPacket_PacketType::PACKET_TYPE_UNSPECIFIED {
132 os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.field_type))?;
133 }
134 if !self.packet.is_empty() {
135 os.write_bytes(2, &self.packet)?;
136 }
137 os.write_unknown_fields(self.get_unknown_fields())?;
138 ::std::result::Result::Ok(())
139 }
140
get_cached_size(&self) -> u32141 fn get_cached_size(&self) -> u32 {
142 self.cached_size.get()
143 }
144
get_unknown_fields(&self) -> &::protobuf::UnknownFields145 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
146 &self.unknown_fields
147 }
148
mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields149 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
150 &mut self.unknown_fields
151 }
152
as_any(&self) -> &dyn (::std::any::Any)153 fn as_any(&self) -> &dyn (::std::any::Any) {
154 self as &dyn (::std::any::Any)
155 }
as_any_mut(&mut self) -> &mut dyn (::std::any::Any)156 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
157 self as &mut dyn (::std::any::Any)
158 }
into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)>159 fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
160 self
161 }
162
descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor163 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
164 Self::descriptor_static()
165 }
166
new() -> HCIPacket167 fn new() -> HCIPacket {
168 HCIPacket::new()
169 }
170
descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor171 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
172 static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
173 descriptor.get(|| {
174 let mut fields = ::std::vec::Vec::new();
175 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<HCIPacket_PacketType>>(
176 "type",
177 |m: &HCIPacket| { &m.field_type },
178 |m: &mut HCIPacket| { &mut m.field_type },
179 ));
180 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
181 "packet",
182 |m: &HCIPacket| { &m.packet },
183 |m: &mut HCIPacket| { &mut m.packet },
184 ));
185 ::protobuf::reflect::MessageDescriptor::new_pb_name::<HCIPacket>(
186 "HCIPacket",
187 fields,
188 file_descriptor_proto()
189 )
190 })
191 }
192
default_instance() -> &'static HCIPacket193 fn default_instance() -> &'static HCIPacket {
194 static instance: ::protobuf::rt::LazyV2<HCIPacket> = ::protobuf::rt::LazyV2::INIT;
195 instance.get(HCIPacket::new)
196 }
197 }
198
199 impl ::protobuf::Clear for HCIPacket {
clear(&mut self)200 fn clear(&mut self) {
201 self.field_type = HCIPacket_PacketType::PACKET_TYPE_UNSPECIFIED;
202 self.packet.clear();
203 self.unknown_fields.clear();
204 }
205 }
206
207 impl ::std::fmt::Debug for HCIPacket {
fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result208 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
209 ::protobuf::text_format::fmt(self, f)
210 }
211 }
212
213 impl ::protobuf::reflect::ProtobufValue for HCIPacket {
as_ref(&self) -> ::protobuf::reflect::ReflectValueRef214 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
215 ::protobuf::reflect::ReflectValueRef::Message(self)
216 }
217 }
218
219 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
220 #[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
221 pub enum HCIPacket_PacketType {
222 PACKET_TYPE_UNSPECIFIED = 0,
223 PACKET_TYPE_HCI_COMMAND = 1,
224 PACKET_TYPE_ACL = 2,
225 PACKET_TYPE_SCO = 3,
226 PACKET_TYPE_EVENT = 4,
227 PACKET_TYPE_ISO = 5,
228 }
229
230 impl ::protobuf::ProtobufEnum for HCIPacket_PacketType {
value(&self) -> i32231 fn value(&self) -> i32 {
232 *self as i32
233 }
234
from_i32(value: i32) -> ::std::option::Option<HCIPacket_PacketType>235 fn from_i32(value: i32) -> ::std::option::Option<HCIPacket_PacketType> {
236 match value {
237 0 => ::std::option::Option::Some(HCIPacket_PacketType::PACKET_TYPE_UNSPECIFIED),
238 1 => ::std::option::Option::Some(HCIPacket_PacketType::PACKET_TYPE_HCI_COMMAND),
239 2 => ::std::option::Option::Some(HCIPacket_PacketType::PACKET_TYPE_ACL),
240 3 => ::std::option::Option::Some(HCIPacket_PacketType::PACKET_TYPE_SCO),
241 4 => ::std::option::Option::Some(HCIPacket_PacketType::PACKET_TYPE_EVENT),
242 5 => ::std::option::Option::Some(HCIPacket_PacketType::PACKET_TYPE_ISO),
243 _ => ::std::option::Option::None
244 }
245 }
246
values() -> &'static [Self]247 fn values() -> &'static [Self] {
248 static values: &'static [HCIPacket_PacketType] = &[
249 HCIPacket_PacketType::PACKET_TYPE_UNSPECIFIED,
250 HCIPacket_PacketType::PACKET_TYPE_HCI_COMMAND,
251 HCIPacket_PacketType::PACKET_TYPE_ACL,
252 HCIPacket_PacketType::PACKET_TYPE_SCO,
253 HCIPacket_PacketType::PACKET_TYPE_EVENT,
254 HCIPacket_PacketType::PACKET_TYPE_ISO,
255 ];
256 values
257 }
258
enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor259 fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
260 static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
261 descriptor.get(|| {
262 ::protobuf::reflect::EnumDescriptor::new_pb_name::<HCIPacket_PacketType>("HCIPacket.PacketType", file_descriptor_proto())
263 })
264 }
265 }
266
267 impl ::std::marker::Copy for HCIPacket_PacketType {
268 }
269
270 impl ::std::default::Default for HCIPacket_PacketType {
default() -> Self271 fn default() -> Self {
272 HCIPacket_PacketType::PACKET_TYPE_UNSPECIFIED
273 }
274 }
275
276 impl ::protobuf::reflect::ProtobufValue for HCIPacket_PacketType {
as_ref(&self) -> ::protobuf::reflect::ReflectValueRef277 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
278 ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
279 }
280 }
281
282 static file_descriptor_proto_data: &'static [u8] = b"\
283 \n\x10hci_packet.proto\x12\rnetsim.packet\"\xfb\x01\n\tHCIPacket\x127\n\
284 \x04type\x18\x01\x20\x01(\x0e2#.netsim.packet.HCIPacket.PacketTypeR\x04t\
285 ype\x12\x16\n\x06packet\x18\x02\x20\x01(\x0cR\x06packet\"\x9c\x01\n\nPac\
286 ketType\x12\x1b\n\x17PACKET_TYPE_UNSPECIFIED\x10\0\x12\x1b\n\x17PACKET_T\
287 YPE_HCI_COMMAND\x10\x01\x12\x13\n\x0fPACKET_TYPE_ACL\x10\x02\x12\x13\n\
288 \x0fPACKET_TYPE_SCO\x10\x03\x12\x15\n\x11PACKET_TYPE_EVENT\x10\x04\x12\
289 \x13\n\x0fPACKET_TYPE_ISO\x10\x05BJ\n\x1fcom.android.emulation.bluetooth\
290 P\x01\xf8\x01\x01\xa2\x02\x03AEB\xaa\x02\x1bAndroid.Emulation.Bluetoothb\
291 \x06proto3\
292 ";
293
294 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
295
parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto296 fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
297 ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
298 }
299
file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto300 pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
301 file_descriptor_proto_lazy.get(|| {
302 parse_descriptor_proto()
303 })
304 }
305