diff --git a/examples/arduino_mkr_wifi_1010/arduino_mkr_wifi_1010.ino b/examples/arduino_mkr_wifi_1010/arduino_mkr_wifi_1010.ino index 64e3965..c3b615f 100644 --- a/examples/arduino_mkr_wifi_1010/arduino_mkr_wifi_1010.ino +++ b/examples/arduino_mkr_wifi_1010/arduino_mkr_wifi_1010.ino @@ -113,6 +113,15 @@ void setup() Serial.println("Setting CAN filters failed!"); while (1); } + + // As a final step check that the hash returned by the node + // is the same as the hash stored by the Tinymovr library. + // This is crucial to prevent potential mismatches in commands. + if (tinymovr.get_protocol_hash() != avlos_proto_hash) + { + Serial.println("Wrong device spec!"); + while (1); + } } /* diff --git a/examples/esp32_mcp2551/esp32_mcp2551.ino b/examples/esp32_mcp2551/esp32_mcp2551.ino index 21fde51..bd258c5 100644 --- a/examples/esp32_mcp2551/esp32_mcp2551.ino +++ b/examples/esp32_mcp2551/esp32_mcp2551.ino @@ -113,6 +113,15 @@ void setup() Serial.println("Setting CAN filters failed!"); while (1); } + + // As a final step check that the hash returned by the node + // is the same as the hash stored by the Tinymovr library. + // This is crucial to prevent potential mismatches in commands. + if (tinymovr.get_protocol_hash() != avlos_proto_hash) + { + Serial.println("Wrong device spec!"); + while (1); + } } /*