mirror of
https://github.com/soypat/lora.git
synced 2026-08-13 15:03:39 +00:00
add tests for power management
This commit is contained in:
@@ -51,6 +51,8 @@ func main() {
|
||||
// This blocks forever reading messages received.
|
||||
ctx := context.Background()
|
||||
for {
|
||||
value, err := dev.ReadTemperature()
|
||||
println("temperature:", value, err)
|
||||
time.Sleep(10 * time.Second)
|
||||
err = dev.RxContinuous(ctx, func(r io.Reader) (_ error) {
|
||||
n, err := r.Read(rx[:])
|
||||
@@ -60,6 +62,7 @@ func main() {
|
||||
println("received LoRa:", string(rx[:n]))
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
println(err.Error())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user