diff --git a/control_character.go b/control_character.go index f998c40..28dedda 100644 --- a/control_character.go +++ b/control_character.go @@ -2,11 +2,18 @@ package feragstring import "fmt" +// ControlCharacterSet is a struct for the control character +// field in the FERAG messages that support control characters +// (Route Info, Production Drop). +// Supports currently only "D" (Don't Produce) and "T" (Bundles +// to Secondary Exit). type ControlCharacterSet struct { DontProduce bool BundlesToSecondaryExit bool } +// NewControlCharacterSet instantiates a new Control Character Set +// struct and returns a pointer to it. func NewControlCharacterSet() *ControlCharacterSet { cc := ControlCharacterSet{ DontProduce: false, @@ -15,14 +22,18 @@ func NewControlCharacterSet() *ControlCharacterSet { return &cc } +// SetDontProduce sets the "don't produce" flag (D) func (cc *ControlCharacterSet) SetDontProduce() { cc.DontProduce = true } +// SetBundlesToSecondaryExit sets the "bundles to secondary exit" flag (T) func (cc *ControlCharacterSet) SetBundlesToSecondaryExit() { cc.BundlesToSecondaryExit = true } +// GetControlCharactersMessage returns the formatted FERAG string for +// the control character set. func (cc *ControlCharacterSet) GetControlCharactersMessage() string { var ccCount int var ccString string