function definitions

Aleksander Morgado aleksander at aleksander.es
Tue Feb 11 03:41:05 PST 2014


>
> Thanks for the explanation. I still have lots questions about the function
> definition in JSON database file. Take the function
> "qmi_client_nas_get_system_info_finish()" as example
>
> 1. How is this function generated? I mean which section of the JSON database
> defines this function call.
>

Look at the definition of "Get System Info" in /data/qmi-service-nas.json.

That definition  has an "output" variable which is a dictionary
containing the possible TLVs that may be available in a "Get System
Info" response. The code generator will take that list of possible
TLVs and generate methods to get the values from a
QmiMessageNasGetSystemInfoOutput object which is generated when the
response is parsed by libqmi. E.g. you will have a
qmi_message_nas_get_system_info_output_get_sim_reject_info() method to
read the contents of the optional "SIM Reject Info" TLV. The
QmiMessageNasGetSystemInfoOutput is the result you'll get in
qmi_client_nas_get_system_info_finish().

If the QMI message had "input" in addition to "output", you would also
see APIs to manage the contents of the input TLVs passed in the QMI
request. You would be in charge of creating an "Input" bundle object
(e.g. QmiMessageNasConfigSignalInfoInput for the "Config Signal Info"
message), set the corresponding TLVs through the provided APIs (e.g.
qmi_message_nas_config_signal_info_input_set_rscp_threshold()) and
then include that input bundle in the client call (e.g.
qmi_client_nas_config_signal_info()).

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list