Skip to content

Commit

Permalink
process Daly CAN messages if they have the correct receiver and a valid
Browse files Browse the repository at this point in the history
command id but which might not be the requested one
  • Loading branch information
ai-republic committed Dec 26, 2024
1 parent 91bd089 commit 133a0c3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ protected List<ByteBuffer> sendMessage(final Port port, final DalyCommand cmd, f
final byte receiver = (byte) (receiveFrame.getInt(0) >> 8 & 0x000000FF);
final byte command = (byte) (receiveFrame.getInt(0) >> 16 & 0x000000FF);

if (receiver == (byte) 0x40 && command == (byte) cmd.id) {
readBuffers.add(receiveFrame);
framesToBeReceived--;

if (receiver == (byte) 0x40) {
final DalyMessage dalyMsg = convertReceiveFrameToDalyMessage(receiveFrame);

if (dalyMsg != null) {
readBuffers.add(receiveFrame);
framesToBeReceived--;

getMessageHandler().handleMessage(this, dalyMsg);
} else {
LOG.warn("Message could not be interpreted " + Port.printBuffer(receiveFrame));
Expand Down

0 comments on commit 133a0c3

Please sign in to comment.