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
feat: Add support for AdamHealth Sensor #617
base: master
Are you sure you want to change the base?
Conversation
We... don't actually have a good way to test subscriptions yet. That's a good callout, I should add something for that to Intiface. I'm about to do a release of Buttplug but I'm gonna hold off on bringing this PR in until the next release, 'cause I need to get an IC release out now and there's a couple of things I need to think about in terms of having to hold a subscription to get things like battery. While on its face I think it's ok, that means if someone reads battery info, we start the subscription then it's just going, which could lead to power draw issues. I doubt we'd kill phones this way, it's more of an interesting thing to think about. Just curious, what's the update rate of the sensor? |
No rush to merge, thank you for taking a look! Trying more on this, turns out receiver_count will always have at least 1 for the sender, that's an easy fix. However, the spawned coroutine doesn't have access to &self, and trying to pull the unsubscription logic to a helper function couldn't figure out the lifetime for the BoxFuture. For now I've duplicated the unsubscribe code, but I want to know how to factor it out. How does receiver_count normally work? How would the sender get dropped to reduce the count to 0, since it's moved into that loop? The btle subscription effectively updates the sensor values roughly once a second:
|
I swear I haven't forgotten about this. Gonna get v8 out this week then probably bring this in. |
Tested with Intiface Central's Read Sensor button. This exercises the event stream subscription code path, but I'm not sure how to test the full subscription experience.
I look forward to your feedback! <3