summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <Jeff.Hatch@multitech.com>2018-05-02 14:48:13 -0500
committerJeff Hatch <Jeff.Hatch@multitech.com>2018-05-02 14:48:13 -0500
commit42d1de550cbf1ec4700bc21974b876b53009b8da (patch)
tree9b236b0c05c69c06cb8d46a7bd09efdf6199ff64
parentee1a8a554ea8a182bfdbbc5d04d4ca8814cde410 (diff)
downloadradio-query-0.6.tar.gz
radio-query-0.6.tar.bz2
radio-query-0.6.zip
Add support for getting the firmware build version in addition to the firmware version running on the radio0.6
-rw-r--r--main.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/main.cpp b/main.cpp
index 1ea2e7b..4b447df 100644
--- a/main.cpp
+++ b/main.cpp
@@ -46,6 +46,7 @@ const std::string FTYPE("type");
const std::string FCODE("code");
const std::string FRSSI("rssi");
const std::string FFIRMWARE("firmware");
+const std::string FFIRMWAREBUILD("firmwarebuild");
const std::string FCARRIER("carrier");
const std::string FMDN("mdn");
const std::string FICCID("iccid");
@@ -82,6 +83,7 @@ const uint32_t OPT_CARRIER = 0x00002000;
const uint32_t OPT_DATETIME = 0x00004000;
const uint32_t OPT_ACTIVEFIRMWARE = 0x00008000;
const uint32_t OPT_LOCATION = 0x00010000;
+const uint32_t OPT_FIRMWAREBUILD = 0x00020000;
const uint32_t OPT_SUMMARY_STATIC = 0x01000000;
const uint32_t OPT_SUMMARY_NETWORK = 0x02000000;
@@ -223,6 +225,13 @@ int main(int argc, char** argv) {
writeToCache(FFIRMWARE, sValue);
printf("%s", sValue.c_str());
}
+ } else if(g_iOptions & OPT_FIRMWAREBUILD) {
+ std::string sValue;
+ result = g_apRadio->getFirmwareBuild(sValue);
+ if(result == CellularRadio::SUCCESS) {
+ writeToCache(FFIRMWAREBUILD, sValue);
+ printf("%s", sValue.c_str());
+ }
} else if(g_iOptions & OPT_IMEI) {
std::string sValue;
result = g_apRadio->getImei(sValue);
@@ -345,6 +354,10 @@ void initializeCache() {
ofile << jData[MTS::IO::CellularRadio::KEY_FIRMWARE].asString();
ofile.close();
+ ofile.open(g_sCache + "/" + FFIRMWAREBUILD);
+ ofile << jData[MTS::IO::CellularRadio::KEY_FIRMWARE_BUILD].asString();
+ ofile.close();
+
ofile.open(g_sCache + "/" + FCARRIER);
ofile << jData[MTS::IO::CellularRadio::KEY_CARRIER].asString();
ofile.close();
@@ -424,6 +437,12 @@ Json::Value getStaticData() {
}
jData[CellularRadio::KEY_FIRMWARE] = sFirmware;
+ std::string sFirmwareBuild(CellularRadio::VALUE_UNKNOWN);
+ if(g_apRadio->getFirmwareBuild(sFirmwareBuild) != CellularRadio::SUCCESS) {
+ printWarning("Radio Firmware Build not found");
+ }
+ jData[CellularRadio::KEY_FIRMWARE_BUILD] = sFirmwareBuild;
+
std::string sCarrier(CellularRadio::VALUE_UNKNOWN);
if(g_apRadio->getCarrier(sCarrier) != CellularRadio::SUCCESS) {
printWarning("Radio Carrier not found");
@@ -491,6 +510,7 @@ void parseOptions(int argc, char** argv) {
{ "init", optional_argument, 0, 'i' },
{ "cachedir", required_argument, 0, 'c' },
{ "firmware", no_argument, &iOption, OPT_FIRMWARE },
+ { "firmwarebuild",no_argument, &iOption, OPT_FIRMWAREBUILD },
{ "imei", no_argument, &iOption, OPT_IMEI },
{ "imsi", no_argument, &iOption, OPT_IMSI },
{ "lac", no_argument, &iOption, OPT_LAC },
@@ -597,6 +617,7 @@ void printHelp(const std::string& sApp) {
printf("\n");
printf("\tQueries:\n");
printf("\t--firmware\n");
+ printf("\t--firmwarebuild\n");
printf("\t--imei\n");
printf("\t--imsi\n");
printf("\t--lac\n");
@@ -613,9 +634,9 @@ void printHelp(const std::string& sApp) {
printf("\t--type\n");
printf("\t--carrier\n");
printf("\t--datetime\n");
- //Applicable for LTE910-NA1 dual FW images only
- //printf("\t--active-firmware\n");
+ // Applicable for LTE910-NA1 dual FW images only
+ // printf("\t--active-firmware\n");
printf("\n");
printf("\tSupported Radios:\n");
- printf("\t\tHE910, GE910, DE910, CE910\n");
+ printf("\t\tHE910, GE910, DE910, CE910, LE910, ME910\n");
}