Skip to content

Commit

Permalink
Slight change to GVRET driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Collin Kidder committed Sep 5, 2024
1 parent 7205db0 commit 9ed478f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions connections/gvretserial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,19 +252,19 @@ bool GVRetSerial::piSendFrame(const CANFrame& frame)
ID = frame.frameId();
if (frame.hasExtendedFrameFormat()) ID |= 1u << 31;

buffer[0] = (char)0xF1; //start of a command over serial
buffer[1] = 0; //command ID for sending a CANBUS frame
buffer[2] = (char)(ID & 0xFF); //four bytes of ID LSB first
buffer[3] = (char)(ID >> 8);
buffer[4] = (char)(ID >> 16);
buffer[5] = (char)(ID >> 24);
buffer[6] = (char)((frame.bus) & 3);
buffer[7] = (char)frame.payload().length();
buffer.append((char)0xF1); //start of a command over serial
buffer.append((char)0); //command ID for sending a CANBUS frame
buffer.append((char)(ID & 0xFF)); //four bytes of ID LSB first
buffer.append((char)(ID >> 8));
buffer.append((char)(ID >> 16));
buffer.append((char)(ID >> 24));
buffer.append( (char)((frame.bus) & 3) );
buffer.append( (char)frame.payload().length() );
for (c = 0; c < frame.payload().length(); c++)
{
buffer[8 + c] = frame.payload()[c];
buffer.append(frame.payload()[c]);
}
buffer[8 + frame.payload().length()] = 0;
buffer.append((char)0);

sendToSerial(buffer);

Expand Down

0 comments on commit 9ed478f

Please sign in to comment.