Make the slave check message integrity and only process if it's valid.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user