-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
now i have a ble device , the twin propertyName is on-off , as it's name ,it control the sensor on-off ,the question is that it's property is write,so i can't read it's value ,but the twin has the desire and report value,so how can i get the report value?
in the code about the func inittwin ,after the func setVisitor finish,it begin to judge whether the property is notify or read ,and then send the report value.but the property is write ,so i can't get the report value.
the code is from device.go
if (c.Property&ble.CharNotify) != 0 && c.CCCD != nil {
wg.Add(1)
go func() {
if err := twinData.BleClient.Client.Subscribe(c, false, twinData.notificationHandler()); err != nil {
klog.Errorf("Subscribe error: %v", err)
wg.Done()
}
}()
} else if (c.Property & ble.CharRead) != 0 { // // read data actively
timer := mappercommon.Timer{Function: twinData.Run, Duration: collectCycle, Times: 0}
wg.Add(1)
go func() {
defer wg.Done()
timer.Start()
}()
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels