diff options
author | Andrii Pientsov <andrii.pientsov@globallogic.com> | 2020-07-16 17:54:27 +0300 |
---|---|---|
committer | Andrii Pientsov <andrii.pientsov@globallogic.com> | 2020-07-16 17:54:27 +0300 |
commit | 9dd6162772c7c60d6739202040e4b07e0342862c (patch) | |
tree | 65739f6c6eef7a12783466a8070ac01a9d55a3f2 | |
parent | 763a1cf04c356cdd9f7868b0d0f392b9623fafb6 (diff) | |
download | radio-query-9dd6162772c7c60d6739202040e4b07e0342862c.tar.gz radio-query-9dd6162772c7c60d6739202040e4b07e0342862c.tar.bz2 radio-query-9dd6162772c7c60d6739202040e4b07e0342862c.zip |
Add vendor firmware version
-rw-r--r-- | main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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"); |