qcdm: fix QCDM packet decapsulation
Rename and document the encapsulate/decapsulate functions, CRC-check the incoming packet, and make callers aware of the difference in how big the decapsulated packet is versus how many bytes they should discard from the buffer (since the decapsulated packet is at least 3 bytes shorter than the incoming packet due to the CRC + framing).
This commit is contained in:
@@ -61,7 +61,7 @@ qcdm_cmd_version_info_new (char *buf, gsize len, GError **error)
|
||||
memset (cmd, 0, sizeof (cmd));
|
||||
cmd->code = DIAG_CMD_VERSION_INFO;
|
||||
|
||||
return dm_prepare_buffer (cmdbuf, sizeof (*cmd), sizeof (cmdbuf), buf, len);
|
||||
return dm_encapsulate_buffer (cmdbuf, sizeof (*cmd), sizeof (cmdbuf), buf, len);
|
||||
}
|
||||
|
||||
QCDMResult *
|
||||
|
Reference in New Issue
Block a user