Summary and explanation for launcher interface

#

Purpose

This document intends to give some background on the launcher interfaces, and sounding states.

godocs

The package under concern contains documentation that should be viewed as a corollary to the output of godoc github.com/NCAR/ACS/structs/launcher.

The housekeeping struct

The best way to understand how a launcher works is that the state of the launcher is maintained in a shared instance of a structs/launcher.Housekeeping structure. Everything from system voltages, currents, launcher bin status, and the structured state of activing a sonde is in a single go-routine safe object. A launcher.Housekeeping embeds several state parameters under a sync.RWMutex, and only exposes accessor functions that allow for settings the status bits.

Sounding State

Aside from the normal status bits of launchers, there is a singular state machine that describes, in exacting detail, what state a sonde is once ‘attached’ to a launcher. There is a single set of controls (manual/lnchrcommon) that step a sonde from being first detected to a fully operating element with a opened recording channel. This is exposed as named steps as SoundingState which has the following named states. The following table is cobbled directly from the source code.

Named State Int Value Description
SsInvalidState 0 NOOP not operating, or invalid state
SsAttemptingToLocateSon 1 Actively attempting to discover sonde”
SsScrapingMetadata 2 Sonde found, metadata being gathered
SsUploadingGpsAiding 3 Uploading GPS Aiding information
SsSondePreinitComplete 4 Sonde is awaiting some callback handlers to propegate.
SsLauncherAwaitingFreq 5 Launcher requires a manually set frequency
SsLauncherAddingJITMetadata 6 Launcher to add alterable configuration field to metadata. Basically this grabs the current state of the alterable config (via /launcher/settings) and uses these values to activate the sonde.
SsUnknownActivationSequence 7 Unknown method to extract required sequence of activation commands - This is usally a deficient configuration, or a missing or malignint sonde metadata.
SsInvalidFrequency 8 Invalid Frequency Selection - out of range (400-406) or is NaN, which is an indication the guidance is invalid
SsStartingChannel 9 Launcher is activating channel - The launcher instance uses the configuration’s StartChannelHandler() to start a channel
SsStartingChannelFailed 10 Channel refused to start, or no channels available
SsActivatingSonde 11 Sending needed activation commands to the sonde
SsActivatingSondeFailed 12 Failed to activate sonde - sonde rejected initialization commands
SsSondeActive 13 Sonde is running. Launcher requires reset in order to continue. Depending on implementation, the launcher may reset this bit manually on launch

Values outside these values are strictly errors. Overall the state is mapped to the following diagram which helps layout the whole initialization process of a sonde:

State

Maintained Devices

Launchers that do not directly use a sonde interface need to initialize a sonde interface card so that system health (eg, the hardware health) can be collected. Caller need not interact with the device, but it must create and maintain it.

Likewise, launchers must also maintain a connection to a GPS aider. This really isn’t an issue since a connection to a GPS module is needed in order to send and receive GPS aiding information