/packages/modules/Bluetooth/system/gd/packet/parser/fields/ |
D | packet_field.cc | 43 int PacketField::GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size) const { in GenBounds() argument 45 if ((start_offset.empty() && size.empty()) || (start_offset.empty() && end_offset.empty()) || in GenBounds() 47 …ERROR(this) << "GenBounds called without enough information. " << start_offset << end_offset << si… in GenBounds() 50 if (start_offset.bits() % 8 != 0 || end_offset.bits() % 8 != 0) { in GenBounds() 51 …< "Can not find the bounds of a field at a non byte-aligned offset." << start_offset << end_offset; in GenBounds() 54 if (!start_offset.empty()) { in GenBounds() 55 s << "size_t field_begin = (" << start_offset << ") / 8;"; in GenBounds() 109 std::ostream&, Size start_offset, Size end_offset, Size size) const { in GetRustBitOffset() argument 111 if ((start_offset.empty() && size.empty()) || (start_offset.empty() && end_offset.empty()) || in GetRustBitOffset() 114 << start_offset << end_offset << size; in GetRustBitOffset() [all …]
|
D | scalar_field.cc | 52 int ScalarField::GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size) const { in GenBounds() argument 55 if (!start_offset.empty()) { in GenBounds() 57 num_leading_bits = start_offset.bits() % 8; in GenBounds() 58 s << "auto " << GetName() << "_it = to_bound + (" << start_offset << ") / 8;"; in GenBounds() 99 void ScalarField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 103 int num_leading_bits = GenBounds(s, start_offset, end_offset, GetSize()); in GenGetter() 148 std::ostream&, Size start_offset, Size end_offset, Size size) const { in GetRustBitOffset() argument 151 if (!start_offset.empty()) { in GetRustBitOffset() 153 num_leading_bits = start_offset.bits() % 8; in GetRustBitOffset() 163 void ScalarField::GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string pa… in GenRustGetter() argument [all …]
|
D | vector_field.cc | 153 void VectorField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 159 int num_leading_bits = GenBounds(s, start_offset, end_offset, GetSize()); in GenGetter() 257 void VectorField::GenBoundsCheck(std::ostream& s, Size start_offset, Size, std::string parent_name)… in GenBoundsCheck() argument 263 s << "let want_ = " << start_offset.bytes() << " + (" << size_field_->GetName() << " as usize)"; in GenBoundsCheck() 283 …s << "let want_ = " << start_offset.bytes() << " + ((" << size_field_->GetName() << " as usize) * " in GenBoundsCheck() 293 …s << "let rem_ = (bytes.len() - " << start_offset.bytes() << ") % " << element_size.bytes() << ";"; in GenBoundsCheck() 304 void VectorField::GenRustGetter(std::ostream& s, Size start_offset, Size, std::string) const { in GenRustGetter() argument 312 s << "bytes[" << start_offset.bytes() << "..]"; in GenRustGetter() 314 s << "bytes[" << start_offset.bytes() << ".." << start_offset.bytes() << " + (("; in GenRustGetter() 317 s << "bytes[" << start_offset.bytes() << "..("; in GenRustGetter() [all …]
|
D | custom_field_fixed_size.cc | 38 int CustomFieldFixedSize::GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size)… in GenBounds() argument 39 if (!start_offset.empty()) { in GenBounds() 41 s << "auto " << GetName() << "_it = to_bound + (" << start_offset << ") / 8;"; in GenBounds() 80 void CustomFieldFixedSize::GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::… in GenRustGetter() argument 82 int num_leading_bits = GetRustBitOffset(s, start_offset, end_offset, GetSize()); in GenRustGetter() 90 s << "let " << GetName() << " = bytes[" << start_offset.bytes() << ".."; in GenRustGetter() 91 s << start_offset.bytes() + size.bytes() << "].try_into()"; in GenRustGetter() 95 void CustomFieldFixedSize::GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const… in GenRustWriter() argument 97 int num_leading_bits = GetRustBitOffset(s, start_offset, end_offset, GetSize()); in GenRustWriter() 106 …s << "buffer[" << start_offset.bytes() << ".." << start_offset.bytes() + GetSize().bytes() << "].c… in GenRustWriter()
|
D | payload_field.cc | 65 void PayloadField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 70 GenBounds(s, start_offset, end_offset, GetSize()); in GenGetter() 78 GenBounds(s, start_offset, end_offset, GetSize()); in GenGetter() 120 void PayloadField::GenBoundsCheck(std::ostream& s, Size start_offset, Size, std::string parent_name… in GenBoundsCheck() argument 122 s << "let want_ = " << start_offset.bytes() << " + (" << size_field_->GetName() << " as usize)"; in GenBoundsCheck() 142 void PayloadField::GenRustGetter(std::ostream& s, Size start_offset, Size, std::string) const { in GenRustGetter() argument 145 s << "bytes[" << start_offset.bytes() << "..].into();"; in GenRustGetter() 147 s << "bytes[" << start_offset.bytes() << "..("; in GenRustGetter() 148 s << start_offset.bytes() << " + " << size_field_->GetName() << " as usize)].into();"; in GenRustGetter()
|
D | struct_field.cc | 53 void StructField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 58 int num_leading_bits = GenBounds(s, start_offset, end_offset, GetSize()); in GenGetter() 99 void StructField::GenRustGetter(std::ostream& s, Size start_offset, Size, std::string) const { in GenRustGetter() argument 101 s << GetRustDataType() << "::parse(&bytes[" << start_offset.bytes() << ".."; in GenRustGetter() 102 s << start_offset.bytes() + GetSize().bytes() << "])?;"; in GenRustGetter() 105 void StructField::GenRustWriter(std::ostream& s, Size start_offset, Size) const { in GenRustWriter() argument 106 s << "let " << GetName() << " = &mut buffer[" << start_offset.bytes(); in GenRustWriter() 107 s << ".." << start_offset.bytes() + GetSize().bytes() << "];"; in GenRustWriter()
|
D | array_field.cc | 115 void ArrayField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 121 int num_leading_bits = GenBounds(s, start_offset, end_offset, GetSize()); in GenGetter() 203 void ArrayField::GenRustGetter(std::ostream& s, Size start_offset, Size, std::string) const { in GenRustGetter() argument 205 s << "bytes[" << start_offset.bytes() << ".."; in GenRustGetter() 206 s << start_offset.bytes() + GetSize().bytes() << "].try_into()"; in GenRustGetter() 210 void ArrayField::GenRustWriter(std::ostream& s, Size start_offset, Size) const { in GenRustWriter() argument 211 s << "&buffer[" << start_offset.bytes() << ".." << start_offset.bytes() + GetSize().bytes() in GenRustWriter()
|
D | packet_field.h | 54 virtual int GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size) const; 63 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const = 0; 125 std::ostream& s, Size start_offset, Size end_offset, Size size) const; 127 …virtual void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const… 129 virtual void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const = 0; 131 virtual void GenBoundsCheck(std::ostream& s, Size start_offset, Size, std::string) const;
|
D | count_field.cc | 29 void CountField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 31 ScalarField::GenGetter(s, start_offset, end_offset); in GenGetter() 61 void CountField::GenRustWriter(std::ostream& s, Size start_offset, Size) const { in GenRustWriter() argument 62 s << "buffer[" << start_offset.bytes() << ".."; in GenRustWriter() 63 s << start_offset.bytes() + GetSize().bytes() << "].copy_from_slice(&"; in GenRustWriter()
|
D | scalar_field.h | 34 …virtual int GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size) const overri… 40 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 58 virtual int GetRustBitOffset(std::ostream& s, Size start_offset, 61 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 63 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | fixed_scalar_field.cc | 41 void FixedScalarField::GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const { in GenRustWriter() argument 43 FixedField::GenRustWriter(s, start_offset, end_offset); in GenRustWriter() 47 std::ostream& s, Size start_offset, Size end_offset, std::string parent_name) const { in GenRustGetter() argument 48 FixedField::GenRustGetter(s, start_offset, end_offset, parent_name); in GenRustGetter()
|
D | struct_field.h | 40 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 56 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 58 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override; 60 …void GenBoundsCheck(std::ostream& s, Size start_offset, Size end_offset, std::string) const overri…
|
D | vector_field.h | 46 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 74 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 76 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override; 78 …void GenBoundsCheck(std::ostream& s, Size start_offset, Size end_offset, std::string parent_name) …
|
D | custom_field_fixed_size.h | 32 …virtual int GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size) const overri… 46 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 48 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | checksum_field.h | 37 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 51 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 53 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | padding_field.h | 42 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 56 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 58 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | custom_field.h | 40 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 58 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 60 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | checksum_start_field.h | 40 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 58 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 60 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | payload_field.h | 41 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 61 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 63 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | array_field.h | 45 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 69 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string parent_name) c… 71 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | fixed_scalar_field.h | 42 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 44 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | fixed_field.cc | 25 void FixedField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 27 ScalarField::GenGetter(s, start_offset, end_offset); in GenGetter()
|
D | count_field.h | 33 virtual void GenGetter(std::ostream& s, Size start_offset, Size end_offset) const override; 47 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|
D | size_field.cc | 29 void SizeField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 31 ScalarField::GenGetter(s, start_offset, end_offset); in GenGetter()
|
D | reserved_field.h | 52 …void GenRustGetter(std::ostream& s, Size start_offset, Size end_offset, std::string) const overrid… 54 void GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const override;
|