Make the slave check message integrity and only process if it's valid.

This commit is contained in:
László Monda
2017-10-01 22:05:20 +02:00
parent 1b1111e9da
commit 6edf4113a4

View File

@@ -35,6 +35,11 @@ void SetResponseByte(uint8_t response)
void SlaveRxHandler(void)
{
if (!CRC16_IsMessageValid(&RxMessage)) {
TxMessage.length = 0;
return;
}
uint8_t commandId = RxMessage.data[0];
switch (commandId) {
case SlaveCommand_SetTestLed: