Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4e304e1 authored by Qasim Javed's avatar Qasim Javed Committed by Gerrit Code Review
Browse files

Merge "rusty-gd: Add missing GAP data types and fix EIR length"

parents bec5baf6 38921f3f
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -22,10 +22,38 @@ enum GapDataType : 8 {
  COMPLETE_LOCAL_NAME = 0x09,
  TX_POWER_LEVEL = 0x0A,
  CLASS_OF_DEVICE = 0x0D,
  SIMPLE_PAIRING_HASH_C = 0x0E,
  SIMPLE_PAIRING_RANDOMIZER_R = 0x0F,
  DEVICE_ID = 0x10,
  SECURITY_MANAGER_OOB_FLAGS = 0x11,
  SLAVE_CONNECTION_INTERVAL_RANGE = 0x12,
  LIST_16BIT_SERVICE_SOLICITATION_UUIDS = 0x14,
  LIST_128BIT_SERVICE_SOLICITATION_UUIDS = 0x15,
  SERVICE_DATA_16_BIT_UUIDS = 0x16,
  PUBLIC_TARGET_ADDRESS = 0x17,
  RANDOM_TARGET_ADDRESS = 0x18,
  APPEARANCE = 0x19,
  ADVERTISING_INTERVAL = 0x1A,
  LE_BLUETOOTH_DEVICE_ADDRESS = 0x1B,
  LE_ROLE = 0x1C,
  SIMPLE_PAIRING_HASH_C_256 = 0x1D,
  SIMPLE_PAIRING_RANDOMIZER_R_256 = 0x1E,
  LIST_32BIT_SERVICE_SOLICITATION_UUIDS = 0x1F,
  SERVICE_DATA_32_BIT_UUIDS = 0x20,
  SERVICE_DATA_128_BIT_UUIDS = 0x21,
  LE_SECURE_CONNECTIONS_CONFIRMATION_VALUE = 0x22,
  LE_SECURE_CONNECTIONS_RANDOM_VALUE = 0x23,
  URI = 0x24,
  INDOOR_POSITIONING = 0x25,
  TRANSPORT_DISCOVERY_DATA = 0x26,
  LE_SUPPORTED_FEATURES = 0x27,
  CHANNEL_MAP_UPDATE_INDICATION = 0x28,
  MESH_PB_ADV = 0x29,
  MESH_MESSAGE = 0x2A,
  MESH_BEACON = 0x2B,
  BIG_INFO = 0x2C,
  BROADCAST_CODE = 0x2D,
  THREE_D_INFORMATION_DATA = 0x3D,
  MANUFACTURER_SPECIFIC_DATA = 0xFF,
}

@@ -4817,6 +4845,10 @@ packet ExtendedInquiryResult : Event (event_code = EXTENDED_INQUIRY_RESULT) {
  _reserved_ : 1,
  rssi : 8,
  extended_inquiry_response : GapData[],
  // Extended inquiry Result is always 255 bytes long
  // padded with zeroes as necessary
  // Refer to BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C Section 8 on page 1340
  _padding_[255],
}

packet EncryptionKeyRefreshComplete : Event (event_code = ENCRYPTION_KEY_REFRESH_COMPLETE){
+3 −0
Original line number Diff line number Diff line
@@ -133,6 +133,9 @@ bool PacketField::GenRustNameAndType(std::ostream& s) const {

void PacketField::GenBoundsCheck(std::ostream& s, Size start_offset, Size, std::string context) const {
  Size size = GetSize();
  if (size.bits() < 8) {
    return;
  }
  s << "if bytes.len() < " << start_offset.bytes() + size.bytes() << " {";
  s << " return Err(Error::InvalidLengthError{";
  s << "    obj: \"" << context << "\".to_string(),";