-
Notifications
You must be signed in to change notification settings - Fork 511
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
[Electron/Photon/P1] Increase Device OS API argument lengths #1537
Conversation
…to the number of functions and variables registered. Fixes [CH14711]
This is great @technobly — I especially appreciate the well-documented P/R. Just to confirm, what happens (for example) when you try and register a function with a name above the limit? Will that throw a compile error, or simply just not appear on your function list? Same with variable? What about an event data that exceeds the limit? |
@jme783 Currently that will throw a compile time error for keys over 12, but will throw errors with keys over 64 with the increased limits. The arguments lengths are not checked at compile time since they are typically not statically assertable, but they will truncate to the limits listed above. |
Gotcha makes sense. So I imagine there will need to be a complimentary change in the Device Cloud to raise those limits when checking at compile time? |
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 will approve since structurally it looks fine and a good approach, but I had difficulty seeing some of the changes in the large blocks of code due to whitespace changes.
@m-mcgowan you can tack on |
Problem
Device OS API arguments have limitations that can be increased.
Solution
Cloud API currently still limits to 255, but Device OS can publish 622. Will change Cloud API to accept 622.Done.An additional feature has been added that will return
false
when attempting to register aParticle.variable()
orParticle.function()
that exceeds the memory limits of the describe message (about 800 bytes for the Photon/P1/Electron). This message is a JSON object that describes or lists the "keys" needed. When an error occurs, that Variable or Function will be removed from the list available.Steps to Test
Included test app.
Example App
References
Closes #1467
Completeness