mirror of https://bitbucket.org/ausocean/av.git
NetReceiver vars updating again. sendTo() now takes a *netsender.Sender.
This commit is contained in:
parent
5ba5327f33
commit
82f58ec996
cmd/revid-cli
|
@ -250,8 +250,6 @@ func main() {
|
|||
l.Log(progName, "Error", err.Error()) // TODO(kortschak): Make this "Fatal" when that exists.
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
vs = ns.GetVarSum()
|
||||
} else {
|
||||
// alternatively, instantiate our own logger
|
||||
config.Logger = smartlogger.New(loggerVerbosity, smartlogger.File, "/var/log/netsender/")
|
||||
|
@ -263,8 +261,8 @@ func main() {
|
|||
|
||||
// loop in NetSender mode
|
||||
for *useNetsender {
|
||||
if err := sendTo(ns); err != nil {
|
||||
config.Logger.Log(progName, "Error", err.Error())
|
||||
if err := sendTo(&ns); err != nil {
|
||||
config.Logger.Log(progName, "Warning", err.Error())
|
||||
time.Sleep(netSendRetryTime)
|
||||
continue
|
||||
}
|
||||
|
@ -273,7 +271,7 @@ func main() {
|
|||
// vars changed
|
||||
vars, err := ns.Vars()
|
||||
if err != nil {
|
||||
config.Logger.Log(progName, "Error", err.Error())
|
||||
config.Logger.Log(progName, "Warning", err.Error())
|
||||
time.Sleep(netSendRetryTime)
|
||||
continue
|
||||
}
|
||||
|
@ -301,15 +299,9 @@ func main() {
|
|||
stopRevid()
|
||||
}
|
||||
|
||||
// sendTo handles NetReceiver configuration and sends requested data to the cloud.
|
||||
func sendTo(ns netsender.Sender) error {
|
||||
if !ns.IsConfigured() {
|
||||
err := ns.Config()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// sendTo implements our main NetSender client and handles NetReceiver configuration
|
||||
// (as distinct from httpSender which just sends video data).
|
||||
func sendTo(ns *netsender.Sender) error {
|
||||
// populate input values, if any
|
||||
inputs := netsender.MakePins(ns.GetConfigParam("ip"))
|
||||
for i, pin := range inputs {
|
||||
|
|
Loading…
Reference in New Issue