Documentation ¶
Overview ¶
This is the core of a number of applications. It contains functionality to read from an input file (typically either a text file or a serial line connected to a device which is sending NTRIP messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppCore ¶
type AppCore struct { Config *jsonconfig.Config Channels []chan rtcm.Message }
func (*AppCore) HandleMessages ¶
HandleMessages repeatedly searches for and reads the input file(s) specified in the config, converts the data to RTCM messages and sends them to the message channel. If input is provided indefinitely, it will run until the calling application is shut down.
It's assumed that the input files are the device names of a device that is sending data on a serial connection and will do so indefinitely. If the device is connecting on a serial USB connection and connectivity is lost and then restored, the device name this time will be different from the one use last time. The config should specify all the possible device file names. If the device is connected using an RS/232 serial line then the config just needs to specify one name, the name of that device.
func (*AppCore) HandleMessagesUntilEOF ¶
HandleMessagesUntilEOF takes the given reader, creates a file handler and runs it.
Whenever it receives a message from the handler, it sends a copy to each of the AppCore's channels. It's assumed that something is listening to each channel and doing something with the messages, for example writing them to a log file.
In production the value returned is always 0 (continue). In test the returned value may be 1 (stop). If a caller that would normally run indefinitely receives a stop return, it should stop. This is to allow unit testing of processes that would normally never terminate.