<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 5:58 AM, Bjørn Mork <span dir="ltr"><<a href="mailto:bjorn@mork.no" target="_blank">bjorn@mork.no</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Aleksander Morgado <<a href="mailto:aleksander@aleksander.es">aleksander@aleksander.es</a>> writes:<br>


<br>
> On Thu, Feb 27, 2014 at 12:30 PM, Bjørn Mork <<a href="mailto:bjorn@mork.no">bjorn@mork.no</a>> wrote:<br>
>><br>
>>> [27 Feb 2014, 10:51:39] [Debug] [/dev/cdc-wdm1] Received message (translated)...<br>
>>>>>>>>> Header:<br>
>>>>>>>>>   length      = 48<br>
>>>>>>>>>   type        = command-done (0x80000003)<br>
>>>>>>>>>   transaction = 2<br>
>>>>>>>>> Fragment header:<br>
>>>>>>>>>   total   = 1<br>
>>>>>>>>>   current = 0<br>
>>>>>>>>> Contents:<br>
>>>>>>>>>   status error = 'NoDeviceSupport' (0x00000009)<br>
>>>>>>>>>   service      = 'invalid' (00000000-0000-0000-0000-000000000000)<br>
>>>>>>>>>   cid          = '(null)' (0x00000001)<br>
>><br>
><br>
><br>
> The main problem is that the mbimcli ends up ignoring the status error<br>
> field, retrievable with mbim_message_command_done_get_status_code().<br>
> We should make sure we have no error before parsing the remaining<br>
> contents of the message.<br>
<br>
</div>Yes, you should never touch the InformationBuffer unless the status<br>
field indicates success, except for the messages where an<br>
InformationBuffer is explicitly allowed on errors.  Section 9.4.5 "USE<br>
OF THE STATUS CODES" lists these CIDs with a non-empty InformationBuffer<br>
on error:<br>
<br>
 MBIM_CID_REGISTER_STATE<br>
 MBIM_CID_PACKET_SERVICE<br>
 MBIM_CID_CONNECT<br>
 MBIM_CID_SERVICE_ACTIVATION<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Thanks for pointing that out. There are a few places in mbimcli that don't check the status code in the command-done message before parsing the response. I've submitted a patch to fix that. </div>

<div> </div></div></div></div>