sebi2k1 / node-can

NodeJS SocketCAN extension
215 stars 72 forks source link

Added possibility to set BRS flag in SendFD #110

Closed wdim0 closed 1 year ago

wdim0 commented 1 year ago

Hi,

as a continuation of PR #106, I've re-synchronized my fork by latest version of node-can (PR #106 automatically closed), re-implemented the new code according to what was discussed and created this new PR.

Now, the new symbol for bitrate switching is called "fd_brs" and is boolean. If set, the CANFD_BRS (defined in socket can kernel headers) is added to frameFD.flags when transmitting CAN-FD frame in SendFD method. This will allow users of node-can to perform bitrate switching in CAN-FD frames. It's backward compatible. If no "fd_brs" symbol is existing, the frameFD.flags will be of value 0, as hardcoded before.

As discussed with @sebi2k1, this new feature is available in native only for now (proper integration of KCD is separated).

Thank you for possible acceptation of this PR and have a nice day!

Martin

sebi2k1 commented 1 year ago

Thanks Martin. By the way, did you noticed some incompatibilities after we switched to Typescript?

wdim0 commented 1 year ago

Hi Sebi. Sure, I'm happy to contribute. Thanks for the merge! To answer your question: I didn't notice any incompatibilities. All worked ok for me (but bear in mind that I use just the native part, not the KCD).