diff options
author | Jason Reiss <jreiss@multitech.com> | 2017-04-12 15:15:15 -0500 |
---|---|---|
committer | Jason Reiss <jreiss@multitech.com> | 2017-04-12 15:15:15 -0500 |
commit | 969757837587a34a01dc578707ed10ad2cd4fef1 (patch) | |
tree | f294cbc6f492de8e4612bedf72fe2bd7ae9ecb60 | |
parent | 5a086515cd9dac84a2534af0656b586e7b314bcd (diff) | |
download | lora-query-969757837587a34a01dc578707ed10ad2cd4fef1.tar.gz lora-query-969757837587a34a01dc578707ed10ad2cd4fef1.tar.bz2 lora-query-969757837587a34a01dc578707ed10ad2cd4fef1.zip |
Node List: sequence number and packet counters are uint32 values
-rw-r--r-- | main.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -285,7 +285,7 @@ void printNodeConfig() { line = trim(line); parts = MTS::Text::split(line, " "); - if (configSize == parts.size()) { + if (configSize == (int)parts.size()) { Json::Value jNode(Json::objectValue); int index = 0; jNode[NODE_ADDR] = parts[index++]; @@ -323,19 +323,19 @@ void printNodeList() { line = trim(line); parts = MTS::Text::split(line, " "); - if (nodeSize == parts.size()) { + if (nodeSize == (int)parts.size()) { Json::Value jNode(Json::objectValue); int index = 0; jNode[NODE_ADDR] = parts[index++]; jNode[NODE_DEV_EUI] = parts[index++]; jNode[NODE_CLASS] = parts[index++]; jNode[NODE_JOINED] = parts[index++]; - jNode[NODE_SEQ_NUM] = atoi(parts[index++].c_str()); - jNode[NODE_PKTS_UP] = atoi(parts[index++].c_str()); - jNode[NODE_PKTS_DOWN] = atoi(parts[index++].c_str()); - jNode[NODE_PKTS_1ST] = atoi(parts[index++].c_str()); - jNode[NODE_PKTS_2ND] = atoi(parts[index++].c_str()); - jNode[NODE_DROPPED] = atoi(parts[index++].c_str()); + jNode[NODE_SEQ_NUM] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10); + jNode[NODE_PKTS_UP] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10); + jNode[NODE_PKTS_DOWN] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10); + jNode[NODE_PKTS_1ST] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10); + jNode[NODE_PKTS_2ND] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10); + jNode[NODE_DROPPED] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10); jNode[NODE_RSSI_MIN] = atof(parts[index++].c_str()); jNode[NODE_RSSI_MAX] = atof(parts[index++].c_str()); jNode[NODE_RSSI_AVR] = atof(parts[index++].c_str()); |