-
Notifications
You must be signed in to change notification settings - Fork 243
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
[BUG] Binary log msgpack uses non-string map keys #382
Comments
Format with |
@svpcom yes, because of that I proposed to replace the key-value dict with just a list:
or maybe this to save space "rx_ant_stats": [
(
(5805, 1, 20), 1),
(661, -38, -37, -37, 8, 31, 37)
),
(
(5805, 1, 20), 0),
(661, -42, -40, -40, 5, 30, 35)
)
] I looked at official parser yes, but the C API is way too lowlevel and C++ api depends on boost which is quite a serious dependency for just msgpack parser. Can end up using them though. I haven't checked if they work though. At least C one should be able to handle because it is low level. |
@seriyps ok. I can add additional stable JSON API for external programs. Let's discuss it structure |
Well, the data that we have in the binary log should be good enough. Maybe rather use named fields instead of positional like here
to be
Are you thinking about HTTP request API or some kind of event-sourcing? |
I'll prefer to have event-sourcing because HTTP is async and not very suitable for realtime streaming |
But on the python side I can generate any data format (except protobuf or other which requires a lot of external libs). The question what is easy to parse on the c++ client side |
Well, for my goals (to use detailed per-antenna radio stats for OSD) both size-prefixed JSON or msgpack would work just fine, the only issue was that current format uses non-string dict keys. One more thing that I believe might be nice to have in the initial (the one that is now |
ok |
@svpcom thanks! Looks good at a first glance, I'll try to implement the OSD elements based on it and will let you know how it goes. |
Preliminary feedback: generated by this code:
data:
it doesn't really make sense to have separate "key dict" and "val dict". I think they can be merged together:
|
@svpcom yep, seems to work quite well. I'm not using all the values yet, but quite many OpenIPC/PixelPilot_rk#41 I think the way it is now in your branch is good enough. Thanks! |
If no other values are needed then I can merge this branch |
It's good enough, thank you. One minor improvement might be to add a way to map antenna to network interface name, but it is minor. |
@seriyps added |
For clustered mode antenna mapping is in settings |
Describe the bug
I'm not sure if WFB-ng's binary log in msgpack format is considered as part of public interfaces, but I'm working on using it for customized OSD OpenIPC/PixelPilot_rk#18
but got stuck on a fact that some of msgpack parsers can not parse msgpack with non-string map keys.
In Python it also requires
strict_map_key=False
.To Reproduce
When
buf
contains the wfb-ng's binary log, this code will crash because library does not support non-string map keys.Expected behavior
I think in order to make the binary log more compatible with various msgpack parsers, the format should either use maps with string keys or use array, eg
Your setup (please complete the following information):
Additional context
See OpenIPC/PixelPilot_rk#18
Confirm you read
The text was updated successfully, but these errors were encountered: