Make the modules transfer a module protocol version composed of a major, a minor and a patch number.

This commit is contained in:
László Monda
2017-12-15 01:28:13 +01:00
parent c1b887cea8
commit d59ba83d99
3 changed files with 11 additions and 3 deletions

View File

@@ -113,7 +113,7 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
case UhkModulePhase_ProcessModuleProtocolVersion: {
bool isMessageValid = CRC16_IsMessageValid(rxMessage);
if (isMessageValid) {
uhkModuleState->protocolVersion = rxMessage->data[0];
memcpy(&uhkModuleState->moduleProtocolVersion, rxMessage->data, sizeof(version_t));
}
status = kStatus_Uhk_NoTransfer;
*uhkModulePhase = isMessageValid ? UhkModulePhase_RequestModuleId : UhkModulePhase_RequestModuleProtocolVersion;