-
Notifications
You must be signed in to change notification settings - Fork 101
added osc bundle support #452
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
Conversation
The only wireless-enabled Pico I have access to is also a 2W, so I'm not overly concerned. The number of EuroPi users who have Pico W boards is probably fairly small. If there are performance issues with that specific board we can address them in a separate fix. Looking at the OSC documentation, I don't think it should be difficult to modify your code to use the full recursive definition, which would allow bundles of bundles. Unlikely to be used by many people, but it's part of the specification, so it feels reasonable to include if it's simple to implement. |
chrisib
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kicked the CI to check the code. Files in the firmware directory have more-strict coding standards than the contrib directory. Looks like the linter caught some formatting issues.
If you can get those cleaned up and implement the data validation I think this is probably in a good state to get merged.
| address_end = data.index(b"\0", 1) | ||
| address = data[0:address_end].decode("utf-8") | ||
| if address == "#bundle": | ||
| data = data[address_end+9:] # position to 1st element length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should still be some bounds-checking here; if a corrupt packet gets received there's a chance that the processing could run into an out-of-bounds error.
Something as simple as
while len(data) > 0:
try:
elem_length = int.from_bytes(data[0:4], "big")
...
except IndexError:
# either the length got corrupted, or the packet was partially dropped
# either way, just process what we can and move on
passshould be enough to prevent the code from crashing & handling the received data as best as it can in the event there's bad data coming in.
Hello,
I've added support for single level osc bundles so we can control the Europi with trowaSoft vcvrack's module.
My module is using a Pico 2 W, so I have no idea if it's working correctly on other versions.
Cheers !