-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create an example to demonstrate how to use Application Apecific Management Groups #26
Comments
Hi @nandojve! This is a good question and there is no official answer. Ideally we can work together to develop an approach that works. Upstreaming smp, smpclient + smpmgr would be my preference. If that is not possible due to licensing restrictions or other, then we need another approach. I think that it would be good to start with you stating how it would work in a perfect world. For example, you might like to define them ad-hoc from the command line or by referencing some file? smpmgr is intended as a developer tool, and it is a shortcoming that there is no command for sending/receiving arbitrary data! I also have a few questions to kickoff:
JP |
Hi @JPHutchins , Thank you for prompt answer!
Yes, I understand that and I know the value of keep things up to date in the upstream. I've been mostly contributing to Zephyr since 2019. Unfortunately there are few cases that you can expose core business if you do that and then it became prohibitive.
No private fork. The idea is to use directly your libraries as is.
The issue is that there are specific commands that can not public. Those commands can already be build in Zephyr using an OOT module. Now I want to expose those using MCUmgr, at command line in development phase, and later integrate with other applications. In this case, I consume many of the public and I have my own commands. I was brain storming the idea and realize that on the ideal world it will be nice to have an yaml file that could be read and the private application specific management groups be dynamically create based on that, maybe even the standard ones. The yaml(s) could be passed by command line argument or just read a directory. Those could be joined with the standard ones. []'s CC: @otavio |
Yeah, something like this would be perfect! I won't want to do anything with the standard commands since this sounds like meta-programming and it will break all of the static typing. But, testing with EchoWrite/Response seems a good first step. I know TOML is not so great for nested objects, but at least it's builtin to Python - worth considering vs YAML? Parsing the definition file will, at runtime:
PS: smpmgr interface needs some breaking changes to support BLE + UDP transports. It looks like it will be something like |
@nandojve Can you try pulling https://github.com/intercreate/smpmgr/tree/example/custom-groups to your private fork and modifying it to see how it goes? So far I don't see any issues and it's probably better since writing actual python code gets the type safety vs the YAML def approach. Still, for development purposes, I think that smpmgr should support arbitrary bytes request/response and maybe some convenient syntax for sending an arbitrary request. Maybe
|
Hi @JPHutchins , Nice! I'll try to check this weekend. |
@JPHutchins, I believe that sending a custom request directly from the command line is very useful for the development process. That said, defining the group and the comments using a TOML or a YAML file to describe this would be helpful because it allows for multiple comments definition and more complex object definition and validation. |
I'll plan on adding sending of custom commands ASAP including arbitrary bytes.
I'll need to be careful with header validation. It would return the SMP header and deserialized CBOR. Fortunately the Python syntax is about as declarative as YAML or TOML and less prone to problems due to static type checking: Lines 17 to 96 in e056af0
So I'm not too excited about YAML or TOML. The only advantage I can think of is sending someone the main smpmgr build along with a file that adds the custom behavior. But it seems less error prone to fork smpmgr. |
Hi @JPHutchins , I validate the #27 and that works fine as expected. What do you think about it? |
I think that it is possible, if somewhat complicated by pyinstaller. I'll be looking into it! |
I've been testing the library is I liked a lot. However I struggled to understand how I can use smp + smpclient + smpmgr with my private application specific management groups without upstream the content. I would like to use all the 3 apps or just have a very small app that glue all 3 + application specific management groups.
The text was updated successfully, but these errors were encountered: