[RFC] qmi-message: set qmux sender flag on on responses

Aleksander Morgado aleksander at aleksander.es
Mon Jan 22 10:38:59 UTC 2018


On 22/01/18 10:59, Bjørn Mork wrote:
> Set the sender flag when we generate QMI responses.  Some
> clients might expect it.
> 
> Signed-off-by: Bjørn Mork <bjorn at mork.no>
> ---
> Another RFC patch.  I am doing a bit of git cleaning, and this
> pacth have been stuck in a local test branch for 2+ years.  I
> honestly don't remember what made me write it, but I am pretty
> sure it wasn't just for fun.  Somehow I did hit this issue in
> the wild.  But I cannot figure out how anymore.
> 
> Anyway, sending it to the Internet for permanent storage before
> cleaning out the local branch.  Now it's your problem :-)
> 

I laughed out loud with that one :D

It actually looks good to me, although not sure which client issue you may have had, as this value was ignored by clients receiving this kind of responses (generated by qmi-proxy). Anyway, it's a good cleanup I think, pushed to git master

Thanks!

> 
>  src/libqmi-glib/qmi-message.c       | 3 +++
>  src/libqmi-glib/test/test-message.c | 4 ++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libqmi-glib/qmi-message.c b/src/libqmi-glib/qmi-message.c
> index 42c659696f18..308fc00242ca 100644
> --- a/src/libqmi-glib/qmi-message.c
> +++ b/src/libqmi-glib/qmi-message.c
> @@ -460,6 +460,9 @@ qmi_message_response_new (QmiMessage       *request,
>                                  qmi_message_get_transaction_id (request),
>                                  qmi_message_get_message_id (request));
>  
> +    /* Set sender type flag */
> +    ((struct full_message *)(((GByteArray *)response)->data))->qmux.flags = 0x80;
> +
>      /* Set the response flag */
>      if (message_is_control (request))
>          ((struct full_message *)(((GByteArray *)response)->data))->qmi.control.header.flags |= QMI_CTL_FLAG_RESPONSE;
> diff --git a/src/libqmi-glib/test/test-message.c b/src/libqmi-glib/test/test-message.c
> index cee6838ffad1..973b38397ead 100644
> --- a/src/libqmi-glib/test/test-message.c
> +++ b/src/libqmi-glib/test/test-message.c
> @@ -278,7 +278,7 @@ test_message_new_response_ok (void)
>      static const guint8 expected_buffer [] = {
>          0x01,       /* marker */
>          0x13, 0x00, /* qmux length */
> -        0x00,       /* qmux flags */
> +        0x80,       /* qmux flags */
>          0x02,       /* service: DMS */
>          0x01,       /* client id */
>          0x02,       /* service flags */
> @@ -320,7 +320,7 @@ test_message_new_response_error (void)
>      static const guint8 expected_buffer [] = {
>          0x01,       /* marker */
>          0x13, 0x00, /* qmux length */
> -        0x00,       /* qmux flags */
> +        0x80,       /* qmux flags */
>          0x02,       /* service: DMS */
>          0x01,       /* client id */
>          0x02,       /* service flags */
> 


-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list