diff --git a/cmd/rv/main.go b/cmd/rv/main.go index 965cd7b1..031381b2 100644 --- a/cmd/rv/main.go +++ b/cmd/rv/main.go @@ -11,6 +11,7 @@ AUTHORS Jack Richardson Trek Hopton Scott Barnard + Russell Stanley LICENSE Copyright (C) 2020 the Australian Ocean Lab (AusOcean) @@ -103,14 +104,15 @@ const ( profilePath = "rv.prof" pkg = "rv: " runPreDelay = 20 * time.Second + turbidity ) // Software define pin values. // See https://netreceiver.appspot.com/help, External Pin Assignments. const ( - bitratePin = "X36" + bitratePin = "X36" saturationPin = "X38" - contrastPin = "X39" + contrastPin = "X39" ) // This is set to true if the 'profile' build tag is provided on build. @@ -122,6 +124,18 @@ type turbidityProbe struct { // TODO(Russell): complete this implementation of Write. func (tp *turbidityProbe) Write(p []byte) (int, error) { + + ticker := time.NewTicker(500 * time.Millisecond) + + go func() { + for { + select { + case <-ticker.C: + + // Implementation here + } + } + }() return len(p), nil } @@ -156,7 +170,7 @@ func main() { var ( rv *revid.Revid - p *turbidityProbe + p *turbidityProbe ) log.Log(logger.Debug, "initialising netsender client") @@ -171,9 +185,9 @@ func main() { log.Log(logger.Fatal, pkg+"could not initialise revid", "error", err.Error()) } - err = rv.SetProbe(p) + err = rv.SetProbe(p) if err != nil { - log.Log(logger.Error, pkg+"could not set probe","error",err.Error()) + log.Log(logger.Error, pkg+"could not set probe", "error", err.Error()) } // NB: Problems were encountered with communicating with RTSP inputs. When trying to