check if msg received

This commit is contained in:
Sam Perry 2022-12-23 13:20:26 -05:00
parent 579c15cc95
commit d9edd16d7a

View file

@ -11,17 +11,17 @@ void setup() {
void loop() { void loop() {
twai_message_t rx_frame; twai_message_t rx_frame;
ESP32Can.CANReadFrame(&rx_frame); if (ESP32CAN_OK == ESP32Can.CANReadFrame(&rx_frame)) { /* CAN message received*/
Serial.print(rx_frame.identifier, HEX);
Serial.print(" ");
Serial.print(rx_frame.data_length_code);
for (int i=0; i<rx_frame.data_length_code; i++) {
Serial.print(rx_frame.data[i], HEX);
}
Serial.print(rx_frame.identifier, HEX); Serial.println();
Serial.print(" ");
Serial.print(rx_frame.data_length_code);
for (int i=0; i<rx_frame.data_length_code; i++) {
Serial.print(rx_frame.data[i], HEX);
} }
Serial.println();
delay(1000); delay(1000);
} }