Any special reason set cid=0 as invalid CID

ηŽ‹ι“δΉ‹ lingzangwuhen at gmail.com
Wed Feb 27 06:55:48 UTC 2019


Hey
When I read the MM code, the bearer treat the cid=0 as a invalid CID
confused me.  But I think there may be some special reasons.
In the MM Ver1.10.0 source code, src/mm-broadband-bearer.c

*static guint*
*cid_selection_3gpp_finish (MMBroadbandBearer  *self,*
*                           GAsyncResult       *res,*
*                           GError            **error)*
*{*
*    gssize cid;*

*    /* We return 0 as an invalid CID, not -1 */*
*    cid = g_task_propagate_int (G_TASK (res), error);*
*    return (guint) (cid < 0 ? 0 : cid);*
*}*

As my Intel 7560 module(not in Mbim on Linux),  after set AT+COPS=0 , it
would auto get IP on the cid=0 PDP.
Then the MM logic would treat the cid=0 as invalid, after that MM would
creat a new PDP context with +CGDCONT=1,*,*.
Though it works at the end. But I think it is better to use the auto
connect one that cid=0.
So what are the special reasons for the cid=0 invalid? Or maybe can we use
*#define INVALID_CID G_MAXUINT*
as a invalid cid?

Quincy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20190227/4bf8f171/attachment.html>


More information about the ModemManager-devel mailing list