Skip to content

Commit

Permalink
Add IMEI field to the ICCID control request
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Feb 6, 2024
1 parent 3a1170c commit 9e4dd2d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions system/src/control/cellular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9e4dd2d

Please sign in to comment.