feature: introducing optional canbus Mfg code, fixing canbus provider UniqueNumber logic #1831
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix:
this statement never set
provider.options.uniqueNumber
as if not assigned!provider.options.uniqueNumber
always evaluates tofalse
feature:
introducing new input parameter for
canbus-canboatjs
input provider, adding UI setup fields and comments to set. By default it follow current logic.background for this feature:
B&G MFD displays (eg Triton2) can display information from different NMEA2000 sources. For example to display GPS coordinates need to go to setup menu, select Sources, Navigation position and then select which NMEA2000 device we want to use as a source (SignalK server, Garmin GPS 24xd or any other available in the network). Similar setup need to do for all other parameters e.g. wind, depth, speed etc. There is no such thing as default source, each input source have to be configured.
The problem: after restart SignalK server is treated as a new device and old configured sources pointing to SignalK are displayed as [source is OFFLINE]. Needless to say MFD does not display anything. After comprehensive testing I found that to be able for MFD to recognize SignalK as the same source Serial Number of SignalK device should be the same as previous (in current implementation SignalK set SN to new random number after each start/restart). Also in addition to than Manufacturer (code) should be one of the real ones. Manufacturer code also can be
0
- in this case SignalK device is detected as "internal manufacturer". So if we set SerialNumber and Mfg Code to static and valid values then after restart MFD picks up SignalK source, successfully match it with previously configured and display all parameters.Corresponding changes in canboat repo: canboat/canboatjs#287