From 9e4dd2d84baa8c26df1e4811f904823b8f2dab7a Mon Sep 17 00:00:00 2001 From: keeramis Date: Mon, 29 Jan 2024 07:44:51 -0800 Subject: [PATCH] Add IMEI field to the ICCID control request --- system/src/control/cellular.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system/src/control/cellular.cpp b/system/src/control/cellular.cpp index 5ec6730149..c350283e88 100644 --- a/system/src/control/cellular.cpp +++ b/system/src/control/cellular.cpp @@ -118,10 +118,13 @@ int getIccid(ctrl_request* req) { CHECK_TRUE(ncpClient, SYSTEM_ERROR_UNKNOWN); const NcpClientLock lock(ncpClient); CHECK(ncpClient->on()); - char buf[32] = {}; - CHECK(ncpClient->getIccid(buf, sizeof(buf))); + char bufIccid[32] = {}; + CHECK(ncpClient->getIccid(bufIccid, sizeof(bufIccid))); + char bufImei[32] = {}; + CHECK(ncpClient->getImei(bufImei, sizeof(bufImei))); PB(GetIccidReply) pbRep = {}; - EncodedString eIccid(&pbRep.iccid, buf, strlen(buf)); + EncodedString eIccid(&pbRep.iccid, bufIccid, strlen(bufIccid)); + EncodedString eImei(&pbRep.imei, bufImei, strlen(bufImei)); CHECK(encodeReplyMessage(req, PB(GetIccidReply_fields), &pbRep)); return 0; }