Skip to content

Commit

Permalink
SDO datalength should be the bytes that does NOT contain data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Petersen committed Oct 5, 2021
1 parent 8c9d130 commit c722814
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdo/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (download Download) Do(bus *can.Bus) error {

// If valid "n" indicates the number of bytes in d that do not contain data. Hence 4 -
bytes := []byte{
byte(ClientIntiateDownload | e | s | ((4 - (int(n) << 2)) & TransferMaskSize)),
byte(ClientIntiateDownload | e | s | (((4 - int(n)) << 2) & TransferMaskSize)),
download.ObjectIndex.Index.B0, download.ObjectIndex.Index.B1,
download.ObjectIndex.SubIndex,
}
Expand Down

0 comments on commit c722814

Please sign in to comment.