JSON level 5 responses are hard to check for correctness

From the original Synthetos forum (2011–2025)

Started by moeter on in TinyG Feature Requests. 3 replies, last activity Nov 3, 2014.

#

In JSON mode, responses are not quite as I would assume responses should work. They don't return the line you just sent in the "r:" part, but sometimes a somehow parsed version, with added precision. Let me give you an example:

If you send {"1tr":45}, then the response given is {"r":{"1tr":45.0000},"f":[1,0,11,7676]}, which is, in a way correct. But it makes parsing the answer a major PITA.

Could you fix the responses, so they return EXACTLY what you actually sent, or, second best, give a list of default precisions of these values?

Thanks.

Staff #

Issues like this, which may/ay not be release specific, are better reported on GitHub; makes tracking much more efficient for the developers.

Assuming you are referring to FW438.02, which is still DEV, that would be here:

https://github.com/synthetos/TinyG/issues

Staff #

How are you parsing? Most UI's using JSON are using the native JSON capabilities in JavaScript, Python or whatever. Floats are floats, so it doesn't matter.

There is a list of precisions in the config_app.c file. The table sets what precision the results are returned. There may be a few special cases where the answer may be different in mm mode or inches.

#

Actually I'm not using a "real" JSON parser, because for security reasons I am not allowed to. I am building embedded software, that is controlling TinyG for using it as a more generic robot controlling system.

It's kinda okay what it returns, and the list of precisions is helpful. But I still reckon it suboptimal, as these responses are the only way to actually check for comm errors, and identical strings would make this more straightforward and faster.

And actually I'm using an EDGE build (435.10) where I fixed this issue myself...

This topic is from the original forum (November 2014). Your reply starts a new discussion linked to it.

Reply

Different problem? Ask a new question

Back to TinyG Feature Requests or latest activity.