<div dir="ltr">Great! Thanks! </div><br><div class="gmail_quote"><div dir="ltr">On Wed, 1 Mar 2017 at 00:53 Aleksander Morgado <<a href="mailto:aleksander@aleksander.es">aleksander@aleksander.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 21/02/17 16:04, Carlo Lobrano wrote:<br class="gmail_msg">
> Added the following configurable values:<br class="gmail_msg">
> - upload datagram protocol<br class="gmail_msg">
> - download datagram protocol<br class="gmail_msg">
> - download datagram max size<br class="gmail_msg">
> - download max datagrams<br class="gmail_msg">
> - endpoint type<br class="gmail_msg">
> - endpoint interface number<br class="gmail_msg">
><br class="gmail_msg">
> According to last GobiNet from CodeAura project, it is necessary to set<br class="gmail_msg">
> the following values to enable multiple data connection through one<br class="gmail_msg">
> controller device:<br class="gmail_msg">
><br class="gmail_msg">
> - upload datagram protocol = QMAP<br class="gmail_msg">
> - download datagram protocol = QMAP<br class="gmail_msg">
> - download datagram max size = 32 (it seems working even without setting it)<br class="gmail_msg">
> - download max datagrams = 32768 (it seems working even without setting it)<br class="gmail_msg">
> - endpoint type = HSUSB (it seems working even without setting it)<br class="gmail_msg">
> - endpoint interface number = this depends on the modem, but it seems working<br class="gmail_msg">
> even without setting it<br class="gmail_msg">
> ---<br class="gmail_msg">
<br class="gmail_msg">
Pushed to git master, along with some additional documentation related<br class="gmail_msg">
fixes.<br class="gmail_msg">
<br class="gmail_msg">
> data/qmi-service-wda.json | 13 ++-<br class="gmail_msg">
> src/libqmi-glib/qmi-enums.h | 20 ++++<br class="gmail_msg">
> src/qmicli/qmicli-helpers.c | 42 ++++++++<br class="gmail_msg">
> src/qmicli/qmicli-helpers.h | 4 +<br class="gmail_msg">
> src/qmicli/qmicli-wda.c | 238 +++++++++++++++++++++++++++++++++++++++++---<br class="gmail_msg">
> 5 files changed, 304 insertions(+), 13 deletions(-)<br class="gmail_msg">
><br class="gmail_msg">
> diff --git a/data/qmi-service-wda.json b/data/qmi-service-wda.json<br class="gmail_msg">
> index d15551d..35e6a9c 100644<br class="gmail_msg">
> --- a/data/qmi-service-wda.json<br class="gmail_msg">
> +++ b/data/qmi-service-wda.json<br class="gmail_msg">
> @@ -83,7 +83,18 @@<br class="gmail_msg">
> "mandatory" : "no",<br class="gmail_msg">
> "type" : "TLV",<br class="gmail_msg">
> "since" : "1.10",<br class="gmail_msg">
> - "format" : "guint32" } ],<br class="gmail_msg">
> + "format" : "guint32" },<br class="gmail_msg">
> + { "name" : "Endpoint Info",<br class="gmail_msg">
> + "id" : "0x17",<br class="gmail_msg">
> + "mandatory" : "no",<br class="gmail_msg">
> + "type" : "TLV",<br class="gmail_msg">
> + "since" : "1.18",<br class="gmail_msg">
> + "format" : "sequence",<br class="gmail_msg">
> + "contents" : [ { "name" : "Endpoint Type",<br class="gmail_msg">
> + "format" : "guint32",<br class="gmail_msg">
> + "public-format" : "QmiDataEndpointType"},<br class="gmail_msg">
> + { "name" : "Interface Number",<br class="gmail_msg">
> + "format" : "guint32"}] }],<br class="gmail_msg">
> "output" : [ { "common-ref" : "Operation Result" },<br class="gmail_msg">
> { "name" : "QoS Format",<br class="gmail_msg">
> "id" : "0x10",<br class="gmail_msg">
> diff --git a/src/libqmi-glib/qmi-enums.h b/src/libqmi-glib/qmi-enums.h<br class="gmail_msg">
> index 083370b..f9ce25e 100644<br class="gmail_msg">
> --- a/src/libqmi-glib/qmi-enums.h<br class="gmail_msg">
> +++ b/src/libqmi-glib/qmi-enums.h<br class="gmail_msg">
> @@ -145,4 +145,24 @@ typedef enum {<br class="gmail_msg">
> * Since: 1.0<br class="gmail_msg">
> */<br class="gmail_msg">
><br class="gmail_msg">
> +/**<br class="gmail_msg">
> + * QmiDataEndpointType:<br class="gmail_msg">
> + * @QMI_DATA_ENDPOINT_TYPE_HSUSB: Data Endpoint Type HSUSB.<br class="gmail_msg">
> + * @QMI_DATA_ENDPOINT_TYPE_UNDEFINED: Data Endpoint Type undefined.<br class="gmail_msg">
> + *<br class="gmail_msg">
> + * Data Endpoint Type.<br class="gmail_msg">
> + *<br class="gmail_msg">
> + * Since: 1.18<br class="gmail_msg">
> + */<br class="gmail_msg">
> +typedef enum { /*< underscore_name=qmi_data_endpoint_type > */<br class="gmail_msg">
> + QMI_DATA_ENDPOINT_TYPE_HSUSB = 0X02,<br class="gmail_msg">
> + QMI_DATA_ENDPOINT_TYPE_UNDEFINED = 0XFF,<br class="gmail_msg">
> +} QmiDataEndpointType;<br class="gmail_msg">
> +<br class="gmail_msg">
> +/**<br class="gmail_msg">
> + * qmi_data_endpoint_type_get_string:<br class="gmail_msg">
> + *<br class="gmail_msg">
> + * Since: 1.18<br class="gmail_msg">
> + */<br class="gmail_msg">
> +<br class="gmail_msg">
> #endif /* _LIBQMI_GLIB_QMI_ENUMS_H_ */<br class="gmail_msg">
> diff --git a/src/qmicli/qmicli-helpers.c b/src/qmicli/qmicli-helpers.c<br class="gmail_msg">
> index 2a2dad2..5827a67 100644<br class="gmail_msg">
> --- a/src/qmicli/qmicli-helpers.c<br class="gmail_msg">
> +++ b/src/qmicli/qmicli-helpers.c<br class="gmail_msg">
> @@ -543,6 +543,48 @@ qmicli_read_link_layer_protocol_from_string (const gchar *str,<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> gboolean<br class="gmail_msg">
> +qmicli_read_data_aggregation_protocol_from_string (const gchar *str,<br class="gmail_msg">
> + QmiWdaDataAggregationProtocol *out)<br class="gmail_msg">
> +{<br class="gmail_msg">
> + GType type;<br class="gmail_msg">
> + GEnumClass *enum_class;<br class="gmail_msg">
> + GEnumValue *enum_value;<br class="gmail_msg">
> +<br class="gmail_msg">
> + type = qmi_wda_data_aggregation_protocol_get_type ();<br class="gmail_msg">
> + enum_class = G_ENUM_CLASS (g_type_class_ref (type));<br class="gmail_msg">
> + enum_value = g_enum_get_value_by_nick (enum_class, str);<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (enum_value)<br class="gmail_msg">
> + *out = (QmiWdaDataAggregationProtocol)enum_value->value;<br class="gmail_msg">
> + else<br class="gmail_msg">
> + g_printerr ("error: invalid data aggregation protocol value given: '%s'\n", str);<br class="gmail_msg">
> +<br class="gmail_msg">
> + g_type_class_unref (enum_class);<br class="gmail_msg">
> + return !!enum_value;<br class="gmail_msg">
> +}<br class="gmail_msg">
> +<br class="gmail_msg">
> +gboolean<br class="gmail_msg">
> +qmicli_read_data_endpoint_type_from_string (const gchar *str,<br class="gmail_msg">
> + QmiDataEndpointType *out)<br class="gmail_msg">
> +{<br class="gmail_msg">
> + GType type;<br class="gmail_msg">
> + GEnumClass *enum_class;<br class="gmail_msg">
> + GEnumValue *enum_value;<br class="gmail_msg">
> +<br class="gmail_msg">
> + type = qmi_data_endpoint_type_get_type ();<br class="gmail_msg">
> + enum_class = G_ENUM_CLASS (g_type_class_ref (type));<br class="gmail_msg">
> + enum_value = g_enum_get_value_by_nick (enum_class, str);<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (enum_value)<br class="gmail_msg">
> + *out = (QmiDataEndpointType)enum_value->value;<br class="gmail_msg">
> + else<br class="gmail_msg">
> + g_printerr ("error: invalid data aggregation protocol value given: '%s'\n", str);<br class="gmail_msg">
> +<br class="gmail_msg">
> + g_type_class_unref (enum_class);<br class="gmail_msg">
> + return !!enum_value;<br class="gmail_msg">
> +}<br class="gmail_msg">
> +<br class="gmail_msg">
> +gboolean<br class="gmail_msg">
> qmicli_read_autoconnect_setting_from_string (const gchar *str,<br class="gmail_msg">
> QmiWdsAutoconnectSetting *out)<br class="gmail_msg">
> {<br class="gmail_msg">
> diff --git a/src/qmicli/qmicli-helpers.h b/src/qmicli/qmicli-helpers.h<br class="gmail_msg">
> index 4a1e087..3ae880b 100644<br class="gmail_msg">
> --- a/src/qmicli/qmicli-helpers.h<br class="gmail_msg">
> +++ b/src/qmicli/qmicli-helpers.h<br class="gmail_msg">
> @@ -59,6 +59,10 @@ gboolean qmicli_read_expected_data_format_from_string (const gchar *str,<br class="gmail_msg">
> QmiDeviceExpectedDataFormat *out);<br class="gmail_msg">
> gboolean qmicli_read_link_layer_protocol_from_string (const gchar *str,<br class="gmail_msg">
> QmiWdaLinkLayerProtocol *out);<br class="gmail_msg">
> +gboolean qmicli_read_data_aggregation_protocol_from_string (const gchar *str,<br class="gmail_msg">
> + QmiWdaDataAggregationProtocol *out);<br class="gmail_msg">
> +gboolean qmicli_read_data_endpoint_type_from_string (const gchar *str,<br class="gmail_msg">
> + QmiDataEndpointType *out);<br class="gmail_msg">
> gboolean qmicli_read_autoconnect_setting_from_string (const gchar *str,<br class="gmail_msg">
> QmiWdsAutoconnectSetting *out);<br class="gmail_msg">
> gboolean qmicli_read_autoconnect_setting_roaming_from_string (const gchar *str,<br class="gmail_msg">
> diff --git a/src/qmicli/qmicli-wda.c b/src/qmicli/qmicli-wda.c<br class="gmail_msg">
> index 1d8f075..9df3d4b 100644<br class="gmail_msg">
> --- a/src/qmicli/qmicli-wda.c<br class="gmail_msg">
> +++ b/src/qmicli/qmicli-wda.c<br class="gmail_msg">
> @@ -33,6 +33,10 @@<br class="gmail_msg">
> #include "qmicli.h"<br class="gmail_msg">
> #include "qmicli-helpers.h"<br class="gmail_msg">
><br class="gmail_msg">
> +#define QMI_WDA_DL_AGGREGATION_PROTOCOL_MAX_DATAGRAMS_UNDEFINED 0xFFFFFFFF<br class="gmail_msg">
> +#define QMI_WDA_DL_AGGREGATION_PROTOCOL_MAX_DATAGRAM_SIZE_UNDEFINED 0xFFFFFFFF<br class="gmail_msg">
> +#define QMI_WDA_ENDPOINT_INTERFACE_NUMBER_UNDEFINED -1<br class="gmail_msg">
> +<br class="gmail_msg">
> /* Context */<br class="gmail_msg">
> typedef struct {<br class="gmail_msg">
> QmiDevice *device;<br class="gmail_msg">
> @@ -49,8 +53,8 @@ static gboolean noop_flag;<br class="gmail_msg">
><br class="gmail_msg">
> static GOptionEntry entries[] = {<br class="gmail_msg">
> { "wda-set-data-format", 0, 0, G_OPTION_ARG_STRING, &set_data_format_str,<br class="gmail_msg">
> - "Set data format",<br class="gmail_msg">
> - "[raw-ip|802-3]"<br class="gmail_msg">
> + "Set data format (allowed keys: link-layer-protocol (802-3|raw-ip), ul-protocol (tlp|qc-ncm|mbim|rndis|qmap), dl-protocol (tlp|qc-ncm|mbim|rndis|qmap), dl-datagrams-max-size, dl-max-datagrams, ep-type (undefined|hsusb), ep-iface-number)",<br class="gmail_msg">
> + "[\"key=value,...\"]"<br class="gmail_msg">
> },<br class="gmail_msg">
> { "wda-get-data-format", 0, 0, G_OPTION_ARG_NONE, &get_data_format_flag,<br class="gmail_msg">
> "Get data format",<br class="gmail_msg">
> @@ -294,29 +298,239 @@ set_data_format_ready (QmiClientWda *client,<br class="gmail_msg">
> operation_shutdown (TRUE);<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> +<br class="gmail_msg">
> +typedef struct {<br class="gmail_msg">
> + QmiWdaLinkLayerProtocol link_layer_protocol;<br class="gmail_msg">
> + QmiWdaDataAggregationProtocol ul_protocol;<br class="gmail_msg">
> + QmiWdaDataAggregationProtocol dl_protocol;<br class="gmail_msg">
> + guint32 dl_datagram_max_size;<br class="gmail_msg">
> + guint32 dl_max_datagrams;<br class="gmail_msg">
> + QmiDataEndpointType endpoint_type;<br class="gmail_msg">
> + guint32 endpoint_iface_number;<br class="gmail_msg">
> +} SetDataFormatProperties;<br class="gmail_msg">
> +<br class="gmail_msg">
> +<br class="gmail_msg">
> +static gboolean<br class="gmail_msg">
> +set_data_format_properties_handle (const gchar *key,<br class="gmail_msg">
> + const gchar *value,<br class="gmail_msg">
> + GError **error,<br class="gmail_msg">
> + gpointer user_data)<br class="gmail_msg">
> +{<br class="gmail_msg">
> + SetDataFormatProperties *props = (SetDataFormatProperties *)user_data;<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (!value || !value[0]) {<br class="gmail_msg">
> + g_set_error (error,<br class="gmail_msg">
> + QMI_CORE_ERROR,<br class="gmail_msg">
> + QMI_CORE_ERROR_FAILED,<br class="gmail_msg">
> + "key '%s' requires a value",<br class="gmail_msg">
> + key);<br class="gmail_msg">
> + return FALSE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (g_ascii_strcasecmp (key, "link-layer-protocol") == 0) {<br class="gmail_msg">
> + if (!qmicli_read_link_layer_protocol_from_string (value, &(props->link_layer_protocol))) {<br class="gmail_msg">
> + g_set_error (error,<br class="gmail_msg">
> + QMI_CORE_ERROR,<br class="gmail_msg">
> + QMI_CORE_ERROR_FAILED,<br class="gmail_msg">
> + "Unrecognized Link Layer Protocol '%s'",<br class="gmail_msg">
> + value);<br class="gmail_msg">
> + return FALSE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + return TRUE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (g_ascii_strcasecmp (key, "ul-protocol") == 0) {<br class="gmail_msg">
> + if (!qmicli_read_data_aggregation_protocol_from_string (value, &(props->ul_protocol))) {<br class="gmail_msg">
> + g_set_error (error,<br class="gmail_msg">
> + QMI_CORE_ERROR,<br class="gmail_msg">
> + QMI_CORE_ERROR_FAILED,<br class="gmail_msg">
> + "Unrecognized Data Aggregation Protocol '%s'",<br class="gmail_msg">
> + value);<br class="gmail_msg">
> + return FALSE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + return TRUE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (g_ascii_strcasecmp (key, "dl-protocol") == 0) {<br class="gmail_msg">
> + if (!qmicli_read_data_aggregation_protocol_from_string (value, &(props->dl_protocol))) {<br class="gmail_msg">
> + g_set_error (error,<br class="gmail_msg">
> + QMI_CORE_ERROR,<br class="gmail_msg">
> + QMI_CORE_ERROR_FAILED,<br class="gmail_msg">
> + "Unrecognized Data Aggregation Protocol '%s'",<br class="gmail_msg">
> + value);<br class="gmail_msg">
> + return FALSE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + return TRUE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (g_ascii_strcasecmp (key, "dl-datagram-max-size") == 0) {<br class="gmail_msg">
> + props->dl_datagram_max_size = atoi(value);<br class="gmail_msg">
> + return TRUE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (g_ascii_strcasecmp (key, "dl-max-datagrams") == 0) {<br class="gmail_msg">
> + props->dl_max_datagrams = atoi(value);<br class="gmail_msg">
> + return TRUE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (g_ascii_strcasecmp (key, "ep-type") == 0) {<br class="gmail_msg">
> + if (!qmicli_read_data_endpoint_type_from_string (value, &(props->endpoint_type))) {<br class="gmail_msg">
> + g_set_error (error,<br class="gmail_msg">
> + QMI_CORE_ERROR,<br class="gmail_msg">
> + QMI_CORE_ERROR_FAILED,<br class="gmail_msg">
> + "Unrecognized Endpoint Type '%s'",<br class="gmail_msg">
> + value);<br class="gmail_msg">
> + return FALSE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + return TRUE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (g_ascii_strcasecmp (key, "ep-iface-number") == 0) {<br class="gmail_msg">
> + props->endpoint_iface_number = atoi(value);<br class="gmail_msg">
> + return TRUE;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + g_set_error (error,<br class="gmail_msg">
> + QMI_CORE_ERROR,<br class="gmail_msg">
> + QMI_CORE_ERROR_FAILED,<br class="gmail_msg">
> + "Unrecognized option '%s'",<br class="gmail_msg">
> + key);<br class="gmail_msg">
> + return FALSE;<br class="gmail_msg">
> +}<br class="gmail_msg">
> +<br class="gmail_msg">
> static QmiMessageWdaSetDataFormatInput *<br class="gmail_msg">
> set_data_format_input_create (const gchar *str)<br class="gmail_msg">
> {<br class="gmail_msg">
> QmiMessageWdaSetDataFormatInput *input = NULL;<br class="gmail_msg">
> - QmiWdaLinkLayerProtocol link_layer_protocol;<br class="gmail_msg">
> + GError *error = NULL;<br class="gmail_msg">
> + SetDataFormatProperties props = {<br class="gmail_msg">
> + .link_layer_protocol = QMI_WDA_LINK_LAYER_PROTOCOL_UNKNOWN,<br class="gmail_msg">
> + .ul_protocol = QMI_WDA_DATA_AGGREGATION_PROTOCOL_DISABLED,<br class="gmail_msg">
> + .dl_protocol = QMI_WDA_DATA_AGGREGATION_PROTOCOL_DISABLED,<br class="gmail_msg">
> + .dl_datagram_max_size = QMI_WDA_DL_AGGREGATION_PROTOCOL_MAX_DATAGRAM_SIZE_UNDEFINED,<br class="gmail_msg">
> + .dl_max_datagrams = QMI_WDA_DL_AGGREGATION_PROTOCOL_MAX_DATAGRAMS_UNDEFINED,<br class="gmail_msg">
> + .endpoint_type = QMI_DATA_ENDPOINT_TYPE_UNDEFINED,<br class="gmail_msg">
> + .endpoint_iface_number = QMI_WDA_ENDPOINT_INTERFACE_NUMBER_UNDEFINED,<br class="gmail_msg">
> + };<br class="gmail_msg">
> +<br class="gmail_msg">
> + input = qmi_message_wda_set_data_format_input_new ();<br class="gmail_msg">
> +<br class="gmail_msg">
> + /* New key=value format */<br class="gmail_msg">
> + if (strchr (str, '=')) {<br class="gmail_msg">
> + if (!qmicli_parse_key_value_string (str,<br class="gmail_msg">
> + &error,<br class="gmail_msg">
> + set_data_format_properties_handle,<br class="gmail_msg">
> + &props)) {<br class="gmail_msg">
> + g_printerr ("error: could not parse input string '%s'\n", error->message);<br class="gmail_msg">
> + g_error_free (error);<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (!qmi_message_wda_set_data_format_input_set_uplink_data_aggregation_protocol (<br class="gmail_msg">
> + input,<br class="gmail_msg">
> + props.ul_protocol,<br class="gmail_msg">
> + &error)) {<br class="gmail_msg">
> + g_printerr ("error: could not set Upload data aggregation protocol '%d': %s\n",<br class="gmail_msg">
> + props.ul_protocol, error->message);<br class="gmail_msg">
> + g_error_free (error);<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (!qmi_message_wda_set_data_format_input_set_downlink_data_aggregation_protocol (<br class="gmail_msg">
> + input,<br class="gmail_msg">
> + props.dl_protocol,<br class="gmail_msg">
> + &error)) {<br class="gmail_msg">
> + g_printerr ("error: could not set Download data aggregation protocol '%d': %s\n",<br class="gmail_msg">
> + props.dl_protocol, error->message);<br class="gmail_msg">
> + g_error_free (error);<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
><br class="gmail_msg">
> - if (qmicli_read_link_layer_protocol_from_string (str, &link_layer_protocol)) {<br class="gmail_msg">
> - GError *error = NULL;<br class="gmail_msg">
> + }<br class="gmail_msg">
><br class="gmail_msg">
> - input = qmi_message_wda_set_data_format_input_new ();<br class="gmail_msg">
> - if (!qmi_message_wda_set_data_format_input_set_link_layer_protocol (<br class="gmail_msg">
> + if (props.dl_datagram_max_size != QMI_WDA_DL_AGGREGATION_PROTOCOL_MAX_DATAGRAM_SIZE_UNDEFINED &&<br class="gmail_msg">
> + !qmi_message_wda_set_data_format_input_set_downlink_data_aggregation_max_size (<br class="gmail_msg">
> input,<br class="gmail_msg">
> - link_layer_protocol,<br class="gmail_msg">
> + props.dl_datagram_max_size,<br class="gmail_msg">
> &error)) {<br class="gmail_msg">
> - g_printerr ("error: couldn't create input data bundle: '%s'\n",<br class="gmail_msg">
> - error->message);<br class="gmail_msg">
> + g_printerr ("error: could not set Download data aggregation max size %d: %s\n",<br class="gmail_msg">
> + props.dl_datagram_max_size, error->message);<br class="gmail_msg">
> g_error_free (error);<br class="gmail_msg">
> - qmi_message_wda_set_data_format_input_unref (input);<br class="gmail_msg">
> - input = NULL;<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> +<br class="gmail_msg">
> }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (props.dl_max_datagrams != QMI_WDA_DL_AGGREGATION_PROTOCOL_MAX_DATAGRAMS_UNDEFINED &&<br class="gmail_msg">
> + !qmi_message_wda_set_data_format_input_set_downlink_data_aggregation_max_datagrams (<br class="gmail_msg">
> + input,<br class="gmail_msg">
> + props.dl_max_datagrams,<br class="gmail_msg">
> + &error)) {<br class="gmail_msg">
> + g_printerr ("error: could not set Download data aggregation max datagrams %d: %s\n",<br class="gmail_msg">
> + props.dl_max_datagrams, error->message);<br class="gmail_msg">
> + g_error_free (error);<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> +<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if ((props.endpoint_type == QMI_DATA_ENDPOINT_TYPE_UNDEFINED) ^<br class="gmail_msg">
> + (props.endpoint_iface_number == QMI_WDA_ENDPOINT_INTERFACE_NUMBER_UNDEFINED)) {<br class="gmail_msg">
> + g_printerr ("error: endpoint type and interface number must be both set or both unset\n");<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (props.endpoint_type != QMI_DATA_ENDPOINT_TYPE_UNDEFINED &&<br class="gmail_msg">
> + !qmi_message_wda_set_data_format_input_set_endpoint_info (<br class="gmail_msg">
> + input,<br class="gmail_msg">
> + props.endpoint_type,<br class="gmail_msg">
> + props.endpoint_iface_number,<br class="gmail_msg">
> + &error)) {<br class="gmail_msg">
> + g_printerr ("error: could not set peripheral endpoint id: %s\n", error->message);<br class="gmail_msg">
> + g_error_free (error);<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> +<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (props.endpoint_iface_number != QMI_WDA_ENDPOINT_INTERFACE_NUMBER_UNDEFINED &&<br class="gmail_msg">
> + !qmi_message_wda_set_data_format_input_set_endpoint_info (<br class="gmail_msg">
> + input,<br class="gmail_msg">
> + QMI_DATA_ENDPOINT_TYPE_HSUSB,<br class="gmail_msg">
> + props.endpoint_iface_number,<br class="gmail_msg">
> + &error)) {<br class="gmail_msg">
> + g_printerr ("error: could not set peripheral endpoint id: %s\n", error->message);<br class="gmail_msg">
> + g_error_free (error);<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> +<br class="gmail_msg">
> + }<br class="gmail_msg">
> + }<br class="gmail_msg">
> + /* Old non key=value format, like this:<br class="gmail_msg">
> + * "[(raw-ip|802-3)]"<br class="gmail_msg">
> + */<br class="gmail_msg">
> + else {<br class="gmail_msg">
> + if (!qmicli_read_link_layer_protocol_from_string (str, &(props.link_layer_protocol))) {<br class="gmail_msg">
> + g_printerr ("Unrecognized Link Layer Protocol '%s'\n", str);<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (props.link_layer_protocol == QMI_WDA_LINK_LAYER_PROTOCOL_UNKNOWN) {<br class="gmail_msg">
> + g_printerr ("error: Link Layer Protocol value is missing\n");<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (!qmi_message_wda_set_data_format_input_set_link_layer_protocol (<br class="gmail_msg">
> + input,<br class="gmail_msg">
> + props.link_layer_protocol,<br class="gmail_msg">
> + &error)) {<br class="gmail_msg">
> + g_printerr ("error: couldn't create input data bundle: '%s'\n",<br class="gmail_msg">
> + error->message);<br class="gmail_msg">
> + g_error_free (error);<br class="gmail_msg">
> + goto error_out;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> return input;<br class="gmail_msg">
> +<br class="gmail_msg">
> +error_out:<br class="gmail_msg">
> + qmi_message_wda_set_data_format_input_unref (input);<br class="gmail_msg">
> + return NULL;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> static void<br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Aleksander<br class="gmail_msg">
<a href="https://aleksander.es" rel="noreferrer" class="gmail_msg" target="_blank">https://aleksander.es</a><br class="gmail_msg">
</blockquote></div>