mirror of https://bitbucket.org/ausocean/av.git
treatment: modify tags, check err on flag
This commit is contained in:
parent
9329c30928
commit
e5e9c31ffb
|
@ -1,4 +1,4 @@
|
||||||
// +build circleci
|
// +build !pi3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
|
|
@ -69,9 +69,7 @@ const (
|
||||||
const (
|
const (
|
||||||
netSendRetryTime = 5 * time.Second
|
netSendRetryTime = 5 * time.Second
|
||||||
defaultSleepTime = 60 // Seconds
|
defaultSleepTime = 60 // Seconds
|
||||||
profilePath = "rv.prof"
|
|
||||||
pkg = "rv: "
|
pkg = "rv: "
|
||||||
runPreDelay = 20 * time.Second
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Treatment modes.
|
// Treatment modes.
|
||||||
|
@ -92,7 +90,6 @@ func main() {
|
||||||
// Set up the player command with audio file path.
|
// Set up the player command with audio file path.
|
||||||
filePtr := flag.String("path", "", "Path to sound file we wish to play.")
|
filePtr := flag.String("path", "", "Path to sound file we wish to play.")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
cmd := exec.Command(audioCmd, *filePtr)
|
|
||||||
|
|
||||||
// Create lumberjack logger to handle logging to file.
|
// Create lumberjack logger to handle logging to file.
|
||||||
fileLog := &lumberjack.Logger{
|
fileLog := &lumberjack.Logger{
|
||||||
|
@ -109,6 +106,11 @@ func main() {
|
||||||
// lumberjack and netloggers.
|
// lumberjack and netloggers.
|
||||||
log := logger.New(logVerbosity, io.MultiWriter(fileLog, netLog), logSuppress)
|
log := logger.New(logVerbosity, io.MultiWriter(fileLog, netLog), logSuppress)
|
||||||
|
|
||||||
|
if *filePtr == "" {
|
||||||
|
log.Log(logger.Fatal, "no file path provided, check usage")
|
||||||
|
}
|
||||||
|
cmd := exec.Command(audioCmd, *filePtr)
|
||||||
|
|
||||||
// The netsender client will handle communication with netreceiver and GPIO stuff.
|
// The netsender client will handle communication with netreceiver and GPIO stuff.
|
||||||
log.Log(logger.Debug, "initialising netsender client")
|
log.Log(logger.Debug, "initialising netsender client")
|
||||||
ns, err := netsender.New(log, gpio.InitPin, gpio.ReadPin, gpio.WritePin, varMap)
|
ns, err := netsender.New(log, gpio.InitPin, gpio.ReadPin, gpio.WritePin, varMap)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !circleci
|
// +build pi3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
|
Loading…
Reference in New Issue