-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Question] How to detect or stop broadcast data #1704
Comments
Broadcasting and observing don't really work like "sending an email", but more like repeatedly "speaking into an open phone line" in case somebody is listening. So the broadcaster keeps broadcasting the last value, and the observer keeps observing. But you could add a few lines to wait for a value that isn't the same as before. I think this would achieve what you want? To make the sender explicitly stop sending, you can do |
I see, this explains that 😁. I will do as you suggest then and check for changes in value rather than just picking up what is perceived by the observe statement. Thanks for the input.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: laurensvalk ***@***.***>
Sent: Monday, July 8, 2024 5:29:04 PM
To: pybricks/support ***@***.***>
Cc: StPot3007 ***@***.***>; Author ***@***.***>
Subject: Re: [pybricks/support] [Bug] Observe continues to pick up last broadcast even when nothing is sent (Issue #1704)
Expected behavior
Once an observe instruction receives something it should reset until something new is received (so in the code above value of parameter 'pressed' should reset to 'None'
Broadcasting and observing don't really work like "sending an email", but more like repeatedly "speaking into an open phone line" in case somebody is listening. So the broadcaster keeps broadcasting the last value, and the observer keeps observing.
But you could add a few lines to wait for a value that isn't the same as before. I think this would achieve what you want?
—
Reply to this email directly, view it on GitHub<#1704 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BJQQXPVVKCRXGAWLBRGYZ3TZLKV4BAVCNFSM6AAAAABKRBSWEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJUGQ2DMMZZGE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Describe the bug
Using 2 hubs and one remote, remote1 & hub 1 send a broadcast to hub 2. Observe on hub 2 receives the broadcast from hub 1 and instructions get processed, but instead of then 'resetting' what is being received the observe instruction seems to continue to receive the last information even though nothing further is broadcast from hub1
### Broadcast code:
### Observe code
Expected behavior
Once an observe instruction receives something it should reset until something new is received (so in the code above value of parameter 'pressed' should reset to 'None'
Screenshots
There is a saying that a picture is worth a 1000 words. Screenshots really help to identify and solve problems.
The text was updated successfully, but these errors were encountered: