On Wed, 2019-02-27 at 14:55 +0800, 王道之 wrote: > 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
Older versions of the ETSI 27.007 spec specified the minimum PDP context number as 1. But at least v11+ says: "The range of permitted values (minimum value = 1 or if the initial PDP context is supported (see subclause 10.1.0), minimum value = 0) is returned by the test form of the command." MM didn't get updated to account for that. So there is no special reason except history, and that can change :) Dan > *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 > _______________________________________________ > ModemManager-devel mailing list > ModemManager-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel _______________________________________________ ModemManager-devel mailing list ModemManager-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel