Hi All
Ive build a CanBus interface using a nano and a small canbus shiled. Its connected to my bmw bench setup (cas, jbr, kombi and cic).
I have it all working using Cory Fowler CanBus libs.
Ive modded for my needs and build a defs file, so i can simulate, backlights, date/time, fuel etc.
All is working I can read and write from the same nano and shild.
There is a lot of CanBus traffic so i would like to filter so i dont see the known types (like the wakeup 0x130) messages.
So read from Canbus buffer in the main loop
CAN0.readMsgBuf(&rxId, &len, rxBuf); // Read data: len = data length, buf = data byte(s)
I can print out the Standard ID
Serial.print(rxId,HEX);Serial.print(" "); Serial.println(rxId);
And get 130 or 306(non HEX) printed to monitor.
However when i try to find it for filtering
if (rxId.HEX == "130" || rxId == "304"){
Serial.println("Wake up found");
} else {
Serial.println("Wake up not found");
}
It never finds 130, everything goes to not found, even though im actally printing the code to the monitor??
Ive been looking at this for hours and cant get it working, anyone have any ideas?
Also, id like to have a run once in the main program loop, as some comands like setting the time only need to run once, is there an easy way to do this?
Thanks in advance.
John
Canbus.txt (3.28 KB)