VERY experimental Nintendo Switch 2 emulator
C++
UDS: Clarify comment about the first 4 bytes of the SecureData header.
Subvbc8fe1c2261b
diff --git a/src/core/hle/service/nwm/uds_data.cpp b/src/core/hle/service/nwm/uds_data.cppindex 7e4aec6246..9ba2fdcf11 100644--- a/src/core/hle/service/nwm/uds_data.cpp+++ b/src/core/hle/service/nwm/uds_data.cpp@@ -40,7 +40,9 @@ static std::vector<u8> GenerateSecureDataHeader(u16 data_size, u8 channel, u16 du16 src_node_id, u16 sequence_number) {SecureDataHeader header{};header.protocol_size = data_size + sizeof(SecureDataHeader);- // TODO(Subv): It is likely that the first 4 bytes of this header are actually a decorator for another protocol.+ // Note: This size includes everything except the first 4 bytes of the structure,+ // reinforcing the hypotheses that the first 4 bytes are actually the header of+ // another container protocol.header.securedata_size = data_size + sizeof(SecureDataHeader) - 4;header.is_management = 0; // Frames sent by the emulated application are never UDS management framesheader.data_channel = channel;diff --git a/src/core/hle/service/nwm/uds_data.h b/src/core/hle/service/nwm/uds_data.hindex 0dd46bcb1d..8480ef94bb 100644--- a/src/core/hle/service/nwm/uds_data.h+++ b/src/core/hle/service/nwm/uds_data.h@@ -45,6 +45,8 @@ static_assert(sizeof(LLCHeader) == 8, "LLCHeader has the wrong size");* the source and destination network node ids.*/struct SecureDataHeader {+ // TODO(Subv): It is likely that the first 4 bytes of this header are+ // actually part of another container protocol.u16_be protocol_size;INSERT_PADDING_BYTES(2);u16_be securedata_size;