Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NCP5623B GpsParser ISL29011 libmDot-mbed5 MTS-Serial MMA845x DOGS102 MPL3115A2
Diff: Mode/Mode.cpp
- Revision:
- 12:05435282f899
- Parent:
- 7:a31236c2e75c
--- a/Mode/Mode.cpp Thu Nov 10 22:10:58 2016 +0000 +++ b/Mode/Mode.cpp Tue Oct 09 13:49:30 2018 -0500 @@ -50,7 +50,7 @@ _band(_dot->getFrequencyBand()), _sub_band(_dot->getFrequencySubBand()), _data_rate(mDot::DR0), - _power(2), + _power(20), _next_tx(0), _send_data(false), _gps_available(_gps->gpsDetected()) @@ -89,16 +89,16 @@ // if we had GPS lock, format GPS data if (data.gps_lock) { snprintf(lat_buf, sizeof(lat_buf), "%d %d %d.%03d %c", - abs(data.gps_latitude.degrees), - data.gps_latitude.minutes, - (data.gps_latitude.seconds * 6) / 1000, - (data.gps_latitude.seconds * 6) % 1000, + (int) abs(data.gps_latitude.degrees), + (int) data.gps_latitude.minutes, + (int) (data.gps_latitude.seconds * 6) / 1000, + (int) (data.gps_latitude.seconds * 6) % 1000, (data.gps_latitude.degrees > 0) ? 'N' : 'S'); snprintf(lon_buf, sizeof(lon_buf), "%d %d %d.%03d %c", - abs(data.gps_longitude.degrees), - data.gps_longitude.minutes, - (data.gps_longitude.seconds * 6) / 1000, - (data.gps_longitude.seconds * 6) % 1000, + (int) abs(data.gps_longitude.degrees), + (int) data.gps_longitude.minutes, + (int) (data.gps_longitude.seconds * 6) / 1000, + (int) (data.gps_longitude.seconds * 6) % 1000, (data.gps_longitude.degrees > 0) ? 'E' : 'W'); snprintf(alt_buf, sizeof(alt_buf), "%d", data.gps_altitude); @@ -116,7 +116,7 @@ snprintf(stats_buf, sizeof(stats_buf), "%lu,%ld,%d,%2.1f", data.link.up.gateways, data.link.up.dBm, - abs(data.link.down.rssi), + (int)abs(data.link.down.rssi), down_snr); } @@ -279,7 +279,7 @@ send_data.push_back((data.link.down.snr/10) & 0xFF); // collect GPS data if GPS device detected - if (_gps->gpsDetected() && ((_data_rate != mDot::SF_10) || (_band == mDot::FB_EU868))){ + if (_gps->gpsDetected() && ((_data_rate != lora::SF_10) || (lora::ChannelPlan::IsPlanDynamic(_band)))) { send_data.push_back(0x19); // key for GPS Lock Status satfix = (_gps->getNumSatellites() << 4 ) | (_gps->getFixStatus() & 0x0F ); send_data.push_back(satfix);