summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2020-07-22 08:41:28 -0500
committerJeff Hatch <jhatch@multitech.com>2020-07-22 08:41:28 -0500
commitd2279c048a9dadbedae185da301ae57de7301379 (patch)
tree65739f6c6eef7a12783466a8070ac01a9d55a3f2
parent763a1cf04c356cdd9f7868b0d0f392b9623fafb6 (diff)
parentb53c57a2609b843dd762e10f1afcb587c606f505 (diff)
downloadradio-query-1.0.tar.gz
radio-query-1.0.tar.bz2
radio-query-1.0.zip
Merge branch 'delta-radio-fwu' into 'master' 1.0
Delta Radio Firmware Upgrade support: LEU7 and L4E1 See merge request !9
-rw-r--r--main.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 065de30..0630d44 100644
--- a/main.cpp
+++ b/main.cpp
@@ -48,6 +48,7 @@ const std::string FCODE("code");
const std::string FRSSI("rssi");
const std::string FFIRMWARE("firmware");
const std::string FFIRMWAREBUILD("firmwarebuild");
+const std::string FVENDORFIRMWARE("vendorfirmware");
const std::string FCARRIER("carrier");
const std::string FMDN("mdn");
const std::string FICCID("iccid");
@@ -88,6 +89,7 @@ const uint32_t OPT_FIRMWAREBUILD = 0x00020000;
const uint32_t OPT_SIM_STATUS = 0x00040000;
const uint32_t OPT_RADIO_CODE = 0x00080000;
const uint32_t OPT_SIM_CARRIER_CODE = 0x00100000;
+const uint32_t OPT_VENDORFIRMWARE = 0x00200000;
const uint32_t OPT_SUMMARY_STATIC = 0x01000000;
const uint32_t OPT_SUMMARY_NETWORK = 0x02000000;
@@ -245,6 +247,13 @@ int main(int argc, char** argv) {
writeToCache(FFIRMWAREBUILD, sValue);
printf("%s", sValue.c_str());
}
+ } else if(g_iOptions & OPT_VENDORFIRMWARE) {
+ std::string sValue;
+ result = g_apRadio->getVendorFirmware(sValue);
+ if(result == ICellularRadio::SUCCESS) {
+ writeToCache(FVENDORFIRMWARE, sValue);
+ printf("%s", sValue.c_str());
+ }
} else if(g_iOptions & OPT_IMEI) {
std::string sValue;
result = g_apRadio->getImei(sValue);
@@ -407,6 +416,10 @@ void initializeCache() {
ofile << jData[MTS::IO::ICellularRadio::KEY_FIRMWARE_BUILD].asString();
ofile.close();
+ ofile.open(g_sCache + "/" + FVENDORFIRMWARE);
+ ofile << jData[MTS::IO::ICellularRadio::KEY_VENDOR_FIRMWARE].asString();
+ ofile.close();
+
ofile.open(g_sCache + "/" + FCARRIER);
ofile << jData[MTS::IO::ICellularRadio::KEY_CARRIER].asString();
ofile.close();
@@ -492,6 +505,12 @@ Json::Value getStaticData() {
}
jData[ICellularRadio::KEY_FIRMWARE_BUILD] = sFirmwareBuild;
+ std::string sVendorFirmware(ICellularRadio::VALUE_UNKNOWN);
+ if(g_apRadio->getVendorFirmware(sVendorFirmware) != ICellularRadio::SUCCESS) {
+ printWarning("Radio Vendor Firmware not found");
+ }
+ jData[ICellularRadio::KEY_VENDOR_FIRMWARE] = sVendorFirmware;
+
std::string sCarrier(ICellularRadio::VALUE_UNKNOWN);
if(g_apRadio->getCarrier(sCarrier) != ICellularRadio::SUCCESS) {
printWarning("Radio Carrier not found");
@@ -574,6 +593,7 @@ void parseOptions(int argc, char** argv) {
{ "cachedir", required_argument, 0, 'c' },
{ "firmware", no_argument, &iOption, OPT_FIRMWARE },
{ "firmwarebuild",no_argument, &iOption, OPT_FIRMWAREBUILD },
+ { "vendorfirmware",no_argument, &iOption, OPT_VENDORFIRMWARE },
{ "imei", no_argument, &iOption, OPT_IMEI },
{ "imsi", no_argument, &iOption, OPT_IMSI },
{ "lac", no_argument, &iOption, OPT_LAC },
@@ -686,6 +706,7 @@ void printHelp(const std::string& sApp) {
printf("\tQueries:\n");
printf("\t--firmware\n");
printf("\t--firmwarebuild\n");
+ printf("\t--vendorfirmware\n");
printf("\t--imei\n");
printf("\t--imsi\n");
printf("\t--lac\n");