You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifvalue, ok:=m.Option(coap.Observe).([]uint8); ok&&len(value) >=1&&value[0] ==1 {
goperiodicTransmitter(l, a, m)
}
The type assertion gives a false for okay and a wrong value. This causes the if-clause to fail, and so the function periodicTransmitter is never called. I changed the code like this to get it to work:
obss:=fmt.Sprint(m.Option(coap.Observe))
value, err:=strconv.Atoi(obss)
iferr!=nil {
log.Fatalf("Could not convert observe value to int", err)
}
ifvalue==1 {
goperiodicTransmitter(l, a, m)
}