Documentation ¶
Index ¶
- Constants
- Variables
- func CloseConnection()
- func Generate() error
- func GetSerialOutputFile() *os.File
- func IsConnected() bool
- func IsGeneratorStarted() bool
- func IsReplayPaused() bool
- func IsReplayStarted() bool
- func ListAvailablePorts() []string
- func LoadFile(csvFile string) error
- func OpenConnection(port string) (err error)
- func PauseReplay()
- func Replay(reader io.Reader) error
- func ReplayTimeSinceT0() time.Duration
- func ResumeReplay()
- func SetActuator(item state.Item, val bool, callback func())
- func SetSerialOutputFile(path string, overwrite bool) error
- func Shutdown()
- func StopGenerator()
- func StopReplay()
- type Mode
Constants ¶
View Source
const DefaultOutputDir = "./output"
Variables ¶
View Source
var ( ReplaySpeed = 1.0 OnReplayError func(error) )
Public variables
View Source
var ErrNotARegularFile = errors.New("file must be a regular file")
View Source
var ErrOutputChangedWhileRunning = errors.New("cannot change output file while running")
View Source
var ErrReplayRunning = errors.New("replay is running")
View Source
var ErrSerialConnectionOpened = errors.New("serial connection opened")
View Source
var (
OnSerialError func(error)
)
Functions ¶
func CloseConnection ¶
func CloseConnection()
CloseConnection closes the connection to the serial port. It will NOT panic if there's no opened connection.
func GetSerialOutputFile ¶
func IsConnected ¶
func IsConnected() bool
IsConnected returns whether a serial connection is open or not.
func IsGeneratorStarted ¶
func IsGeneratorStarted() bool
func IsReplayPaused ¶
func IsReplayPaused() bool
func IsReplayStarted ¶
func IsReplayStarted() bool
func ListAvailablePorts ¶
func ListAvailablePorts() []string
ListAvailablePorts lists all available serial ports.
See serial.GetPortsList
func OpenConnection ¶
OpenConnection opens a connection to the specified port and starts listenning for incoming data.
func PauseReplay ¶
func PauseReplay()
func ReplayTimeSinceT0 ¶
func ResumeReplay ¶
func ResumeReplay()
func SetActuator ¶
func SetSerialOutputFile ¶
func StopGenerator ¶
func StopGenerator()
func StopReplay ¶
func StopReplay()
Types ¶
Click to show internal directories.
Click to hide internal directories.