From d870873c250d27c214f49480401208e50a9cc330 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Mon, 3 Oct 2016 13:11:24 -0500 Subject: Update to support AU915 --- Layout/LayoutJoin.cpp | 2 +- Layout/LayoutSemtech.cpp | 18 +++++++++++------- Layout/LayoutSemtechJoin.cpp | 14 +++++++------- Layout/LayoutSurveyGps.cpp | 4 ++-- 4 files changed, 21 insertions(+), 17 deletions(-) (limited to 'Layout') diff --git a/Layout/LayoutJoin.cpp b/Layout/LayoutJoin.cpp index a0ec1ee..fd45d50 100644 --- a/Layout/LayoutJoin.cpp +++ b/Layout/LayoutJoin.cpp @@ -47,7 +47,7 @@ void LayoutJoin::display() { writeLabel(_lId); writeLabel(_lKey); - if (_band == mDot::FB_915) { + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { writeLabel(_lFsb); } writeLabel(_lRate); diff --git a/Layout/LayoutSemtech.cpp b/Layout/LayoutSemtech.cpp index e31d149..28e15cf 100644 --- a/Layout/LayoutSemtech.cpp +++ b/Layout/LayoutSemtech.cpp @@ -69,9 +69,11 @@ void LayoutSemtech::display(bool success, mDot::snr_stats snr, mDot::rssi_stats writeLabel(_lTemp); writeLabel(_lPower); writeLabel(_lPadding); - if (_band == mDot::FB_915) { - writeLabel(_lFSB); + + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { + writeLabel(_lFSB); } + if(success) { size = snprintf(buf, sizeof(buf), "DWN %3d dbm", rssi.last); writeField(_fDownRssi, buf, size); @@ -79,7 +81,9 @@ void LayoutSemtech::display(bool success, mDot::snr_stats snr, mDot::rssi_stats memset(buf, 0, sizeof(buf)); size = snprintf(buf, sizeof(buf), " %2.1f", (float)snr.last / 10.0); writeField(_fDownSnr, buf, size); - } else writeLabel(_lNoLink); + } else { + writeLabel(_lNoLink); + } memset(buf, 0, sizeof(buf)); size = snprintf(buf, sizeof(buf), "%d",dr); @@ -89,10 +93,10 @@ void LayoutSemtech::display(bool success, mDot::snr_stats snr, mDot::rssi_stats size = snprintf(buf, sizeof(buf), "%d",power); writeField(_fPower, buf, size, true); - if (_band == mDot::FB_915) { - memset(buf, 0, sizeof(buf)); - size = snprintf(buf, sizeof(buf), "%d",fsb); - writeField(_fFSB, buf, size, true); + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d",fsb); + writeField(_fFSB, buf, size, true); } memset(buf, 0, sizeof(buf)); diff --git a/Layout/LayoutSemtechJoin.cpp b/Layout/LayoutSemtechJoin.cpp index 7bb7ac0..6b9143d 100644 --- a/Layout/LayoutSemtechJoin.cpp +++ b/Layout/LayoutSemtechJoin.cpp @@ -45,7 +45,7 @@ void LayoutSemtechJoin::display() writeLabel(_lId); writeLabel(_lKey); - if (_band == mDot::FB_915) { + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { writeLabel(_lFsb); } writeLabel(_lRate); @@ -67,12 +67,12 @@ void LayoutSemtechJoin::updateKey(std::string key) void LayoutSemtechJoin::updateFsb(uint8_t band) { - if (_band == mDot::FB_915) { - char buf[8]; - size_t size; - size = snprintf(buf, sizeof(buf), "%u", band); - writeField(_fFsb, buf, size, true); - writeField(_fSubBand, buf, size, true); + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { + char buf[8]; + size_t size; + size = snprintf(buf, sizeof(buf), "%u", band); + writeField(_fFsb, buf, size, true); + writeField(_fSubBand, buf, size, true); } } diff --git a/Layout/LayoutSurveyGps.cpp b/Layout/LayoutSurveyGps.cpp index 2630566..9ef191d 100644 --- a/Layout/LayoutSurveyGps.cpp +++ b/Layout/LayoutSurveyGps.cpp @@ -58,7 +58,7 @@ void LayoutSurveyGps::display(bool success, mDot::snr_stats snr, mDot::rssi_stat writeLabel(_lPower); writeLabel(_lPadding); - if (_band == mDot::FB_915) { + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { writeLabel(_lFSB); } if(success) { @@ -80,7 +80,7 @@ void LayoutSurveyGps::display(bool success, mDot::snr_stats snr, mDot::rssi_stat size = snprintf(buf, sizeof(buf), "%d", power); writeField(_fPower, buf, size, true); - if (_band == mDot::FB_915) { + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { memset(buf, 0, sizeof(buf)); size = snprintf(buf, sizeof(buf), "%d", fsb); writeField(_fFSB, buf, size, true); -- cgit v1.2.3