Discussion:
[PATCH] atmodem: add EUTRAN tech for creg read status
Anirudh Gargi
2018-09-27 11:19:56 UTC
Permalink
Add handling for CREG's status to get the technology type. CREG
notify URC does not need additional handling as 'AcT' is mapped
one-on-one to tech.
---
drivers/atmodem/network-registration.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c
index 0854cd1..789397e 100644
--- a/drivers/atmodem/network-registration.c
+++ b/drivers/atmodem/network-registration.c
@@ -228,6 +228,10 @@ static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
if ((status == 1 || status == 5) && (tech == -1))
tech = nd->tech;

+ /* 6-10 is EUTRAN, with 8 being emergency bearer case */
+ if((status > 5) && (tech == -1))
+ tech = ACCESS_TECHNOLOGY_EUTRAN;
+
cb(&error, status, lac, ci, tech, cbd->data);
}
--
2.7.4
Denis Kenzior
2018-09-27 12:36:15 UTC
Permalink
Hi Anirudh,
Post by Anirudh Gargi
Add handling for CREG's status to get the technology type. CREG
notify URC does not need additional handling as 'AcT' is mapped
one-on-one to tech.
---
drivers/atmodem/network-registration.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c
index 0854cd1..789397e 100644
--- a/drivers/atmodem/network-registration.c
+++ b/drivers/atmodem/network-registration.c
@@ -228,6 +228,10 @@ static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
if ((status == 1 || status == 5) && (tech == -1))
tech = nd->tech;
+ /* 6-10 is EUTRAN, with 8 being emergency bearer case */
+ if((status > 5) && (tech == -1))
No parentheses are needed here. Also I fixed the missing space after
'if' and applied this patch.
Post by Anirudh Gargi
+ tech = ACCESS_TECHNOLOGY_EUTRAN;
+
cb(&error, status, lac, ci, tech, cbd->data);
}
Regards,
-denis

Loading...