-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBCharacteristic update value may lose due to asynchronous call on main queue #100
Comments
Will investigate. |
FWIW, there are a whole host of changes coming to callback handling when I get the cycles to put them in. |
i hit the same issue,i moved the main queue code to delegate code line:
And then update value is ok. |
YmsCoreBluetooth lib stop updated? |
@jaysonjh Nope, but been put into a longer hiatus than I expected due to work issues. There's a lot I'd like to change given my working with this codebase for some time. In particular, the changes made with respect to this issue is recognizing that YMSCoreBluetooth is trying too hard to push stuff back on the main queue in the delegate methods. Changing the code base to stop doing this will definitely break existing installs and when that happens, then all kinds of design decisions in this framework are open for review. |
Today I have the same problem, solved it just make thead sleep 0.01s. not a good way BUT minimum change. _YMS_PERFORM_ON_MAIN_THREAD(^{
// ......
});
[NSThread sleepForTimeInterval:0.01]; |
when log the data, I found the reason: in main thread, got the data as follow: if in one cycle, received four values, then in main thread, they are same to last value(3d0000), I think the reason is that all the points of characteristic is pointing at last one. |
In the cbperiphral delegate callback, i.e. peripheral:didUpdateValueForCharacteristic:error, you call the notifyCharacteristicHandler:error handler on the main queue, however, the value of CBCharacteristic may have changed by the time main queue come back.
Other call back on the main queue may have same issue. related file is YMSCBPeripheral.m
The text was updated successfully, but these errors were encountered: