<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 30, 2014 at 1:04 AM, Aleksander Morgado <span dir="ltr"><<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Thu, May 29, 2014 at 9:15 PM, Greg Suarez <<a href="mailto:gpsuarez2512@gmail.com">gpsuarez2512@gmail.com</a>> wrote:<br>
>> Yes. If we get an indication from the device an there wasn't *any*<br>
>> client configured to receive it, then we should forward it to<br>
>> everyone.<br>
>><br>
><br>
> So now that I've implemented this I've come to realize that there's no way<br>
> to tell the difference between<br>
> "there's no client configured to receive an indication" vs "a client that's<br>
> configured to not receive any indications<br>
> from a service"<br>
><br>
<br>
</div>If I understood it correctly, by default clients will start like this:<br>
* Enabled to receive all indications from standard services (those<br>
defined by MBIM standard).<br>
* Disabled to receive any indication from non-standard services.<br></blockquote><div> </div><div>Yes </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now, the issue is that the configuration of the service subscribe list<br>
is performed by passing a list of these types:<br>
<br>
typedef struct {<br>
MbimUuid device_service_id;<br>
guint32 cids_count;<br>
guint32 *cids;<br>
} MbimEventEntry;<br>
<br>
The client will notify which are the CIDs in a given service for which<br>
it wants to get notifications. The client needs to provide the full<br>
list of CIDs per service; those not provided in the list of CIDs are<br>
to be considered disabled.<br>
<br></blockquote><div>Yes </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, as soon as a client sends<br>
MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST, the modem will<br>
(should) only provide indications for the CIDs listed there. The task<br>
of the proxy, therefore is to track which CIDs were enabled by each<br>
client, and build its own<br>
MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST with the mixed<br>
lists of CIDs from all clients.<br></blockquote><div><br></div><div>Yes, and the proxy also needs to keep all the indications for the standard services enabled because</div><div>when a client connects it expects to receive indications for standard services without having to</div>
<div>send the MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regarding your point, yes, it is tricky. If we have e.g. 3 clients and<br>
all of them used MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST<br>
with an empty list (so that they request not to receive any<br>
notification), and still we get a notification from the device, I<br>
really believe we should still forward it to all clients. Same if we<br>
had 3 clients each with its own list and we get a notification which<br>
is not in any list; we should still forward it to all clients. I'm not<br>
sure whether the proxy should try to 'fix' a wrong behavior of the<br>
modem, if it ever happens. Sure, this logic may never be used if all<br>
modems do it correctly, but not sure. Anyway, I have mixed feelings<br>
about this...</blockquote><div><br></div><div>I was also thinking of the standard services indications since I always have them enabled.</div><div>I guess I could filter out the standard services indications when trying to figure out if the indication is errant</div>
<div>and needs to be forwarded anyways.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So, what I'm suggesting is the following:<br>
<div class=""><br>
> So what I'm doing is if a client has sent the<br>
> MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST<br>
> it will only receive indications from that list.<br>
<br>
</div>Yes, unless there is an indication coming which isn't by default<br>
enabled in any client. If there is an indication not configured by any<br>
client, then it should go to all. Clients need to be prepared to<br>
receive indications they didn't ask for (as in no crash, just ignore<br>
them).<br></blockquote><div><br></div><div>I was more concerned with the wasted cpu cycles than anything else :P </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
> A client will receive all indications if the client has never sent the<br>
> MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST<br>
> command or sends the command with no elements, which clears out the list.<br>
<br>
</div>If the client has never sent the SUBSCRIBE_LIST command, it should<br>
always get the indications for the standard services. If it sends the<br>
command with no elements, shouldn't we assume that it is trying to<br>
disable all indications?</blockquote><div>oh... yeah... whoops :P </div><div><br></div><div>Thanks,</div><div><br></div><div>Greg</div></div></div></div>