summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2017-04-12 15:15:15 -0500
committerJason Reiss <jreiss@multitech.com>2017-04-12 15:15:15 -0500
commit969757837587a34a01dc578707ed10ad2cd4fef1 (patch)
treef294cbc6f492de8e4612bedf72fe2bd7ae9ecb60
parent5a086515cd9dac84a2534af0656b586e7b314bcd (diff)
downloadlora-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.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index 1c39dea..bf6e3e4 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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());