Browse Source

SITL: LightwareSerial: return 130m when out-of-range-high

gps-1.3.1
Peter Barker 3 years ago committed by Peter Barker
parent
commit
8843c17f9d
  1. 5
      libraries/SITL/SIM_RF_LightWareSerial.cpp

5
libraries/SITL/SIM_RF_LightWareSerial.cpp

@ -50,5 +50,10 @@ void RF_LightWareSerial::update(float range) @@ -50,5 +50,10 @@ void RF_LightWareSerial::update(float range)
uint32_t RF_LightWareSerial::packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen)
{
if (alt_cm > 10000) {
// out-of-range-high
alt_cm = 13000; // from datasheet
}
return snprintf((char*)buffer, buflen, "%0.2f\r", alt_cm / 100.0f); // note tragic lack of snprintf return checking
}

Loading…
Cancel
Save