On 6/25/20 4:29 AM, Jimmy Gysens wrote:
There are manufacturers, like Huawei, returning profile 0 as the
PDP/EPS context ID. Profile 0, however, is the default profile used to
register to the LTE network. It contains manufacturer specific settings and
should not be created by +CGDCONT.
Reference: ETSI TS 127 007: AT command set for User Equipment (UE), section
Yeah, but which version of it ;) I think ETSI versions are lagging a bit behind
3GPP versions and we prefer to use 3GPP 27.007 for historical reasons.
drivers/atmodem/gprs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c
index 58d4eed3..bcf1eaaf 100644
@@ -787,6 +787,13 @@ static void at_cgdcont_test_cb(gboolean ok, GAtResult *result,
if (found == FALSE)
+ * ETSI TS 127 007: profile 0 is manufacturer specific.
+ * Start from PDP/EPS context ID 1.
+ if (min <= 0)
+ min = 1;
g_at_result_next_range can't really return negative numbers. Not sure why we
have it returning gints. So I'd prefer to use min == 0 here.
Otherwise, this looks harmless enough, but I wonder if you're breaking some
drivers doing this since some might report cid=0 as the default bearer being
activated by 'ME PDN ACT' unsolicited result code. Which cid does Huawei report
in this case?