Picture of Wim 4127
Registered 6 years 310 days
Wim 4127 Thursday, 14 May 2020, 02:49 PM
What is the purpose of base parameter in JSON API message function
In the Message function the parameter "word base" (second parameter) is not documented on http://sdk.innovaphone.com/common/interface/json_api.htm#Message . What is it's purpose? It seems to be 0 all the time...
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Thursday, 14 May 2020, 03:02 PM
Re: What is the purpose of base parameter in JSON API message function
Hi Wim,

base is a reference to a certain object or array inside the json_io library.
It's explained inside the json_io doc:
http://sdk.innovaphone.com/common/ilib/json.htm

It's indeed zero if you reference the root object.

Greetings,
Daniel
Picture of Wim 4127
Registered 6 years 310 days
Wim 4127 Thursday, 14 May 2020, 03:23 PM
Re: What is the purpose of base parameter in JSON API message function
I understand and read the documentation on json_io. But, why is it in that function provided as input parameter, and, is this always 0, or can this also have other values when that function is called? That's the part that is not documented and if you provide it as a parameter I assume it can have different values as well... or do I worry too much smile

(try to look at it from a person who doesn't know the internals like you do, and then you question every function)
Picture of Matthias Schertler (innovaphone)
Moderator Registered 12 years 193 days
Matthias Schertler (innovaphone) Monday, 18 May 2020, 05:37 PM
Re: What is the purpose of base parameter in JSON API message function
Hi Wim,

I added the parameter to the documentation. Available in the next SR.


word base

The ID of the base element of the message inside the msg structure. Pass it to the get functions of json_io to read the attributes of the message. Example:
const char * text = msg.get_string(base, "text");

BR

Matthias

← You can define your color theme preference here