I have seen this code at the bottom of arduino examples. I am unsure of how to go about editing this portion of code. Notice commented out it says little Endian. How would one go about changing this to Big Endian?
void SendCANFrameToSerial(unsigned long canFrameId, const byte* frameData)
{
// the 4 byte identifier at the beginning of each CAN frame
// this is required for RealDash to 'catch-up' on ongoing stream of CAN frames
const byte serialBlockTag[4] = { 0x44, 0x33, 0x22, 0x11 };
Serial1.write(serialBlockTag, 4);
// the CAN frame id number (as 32bit little endian value)
Serial1.write((const byte*)&canFrameId, 4);
// CAN frame payload
Serial1.write(frameData, 8);
}
Currently what i’m using:
void SendCANFramesToSerial(unsigned long canFrameId, const byte* frameData)
{
// the 4 byte identifier at the beginning of each CAN frame
// this is required for RealDash to 'catch-up' on ongoing stream of CAN frames
const unsigned long serialBlockTag = 0x11223344;
Serial.write((const byte*)&serialBlockTag, 4);
// the CAN frame id number
Serial.write((const byte*)&canFrameId, 4);
// CAN frame payload
Serial.write(frameData, 8);
}