Closed yavosh closed 4 years ago
Hi @yavosh, thanks for the interest in the library. What kind of messages are you considering implementing? Is this something like the PMTK (Mediatek) or PGRME (Garmin) proprietary messages? If that's the case, yes, we will review your contribution and eventually merge it.
I also like the idea of having the possibility to extend the library via external plugins or modules, but that would require a more in-depth design session.
No these are proprietary messages we generate ourselves, they don't really fit NMEA in any way otherwise we would be contributing them.
The extensibility suggestion is to replace implementation of func Parse(raw string) (Sentence, error)
from the current switch on type to a map[string]func()
where each existing supported message type would have its constructor added and there can be a method like RegisterParser
which would allow you to add a new message type with its parser.
Should be fairly unobtrusive change.
Your suggestion looks good. If you are willing to put together a draft/prototype we will definitely review it and help with the integration. If not, no worries, we will add it to our backlog.
Being able to register parsers is something I've wanted for a while.
Hey @adrianmo have a look at how it could work https://github.com/adrianmo/go-nmea/pull/75
I would like to extend this lib to support custom message parsing, is this something you would consider merging. We are using this to parse some custom message which are not part of the NMEA standard. The idea is to have a way to register parsers for new message types.