Skip to content

Commit

Permalink
fix: socketcan devices not negotiating a new address when there is a …
Browse files Browse the repository at this point in the history
…conflict (#268)
  • Loading branch information
sbender9 authored May 28, 2024
1 parent e9b666b commit e8ef256
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/canbus.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ CanbusStream.prototype.connect = function() {
this.lastDataReceived = Date.now()
}

if ( that.candevice && that.candevice.cansend && pgn.src == that.candevice.address ) {
//always send address claims through
if ( pgn.pgn != 60928 && that.candevice && that.candevice.cansend && pgn.src == that.candevice.address ) {
return
}

Expand Down
5 changes: 1 addition & 4 deletions lib/candevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ function handleISORequest(device, n2kMsg) {
sendProductInformation(device)
break;
case 60928: // ISO address claim request
//sendAddressClaim(device)
let ac = JSON.parse(JSON.stringify(device.addressClaim))
ac.dst = n2kMsg.src
sendPGN(device, ac)
sendPGN(device, device.addressClaim)
break;
case 126464:
sendPGNList(device)
Expand Down

0 comments on commit e8ef256

Please sign in to comment.