mirror of https://github.com/ArduPilot/ardupilot
AP_ADSB: Fix error snprintf output truncated
AP_ADSB: Change octal squawk code mask to 0x1FFF
This commit is contained in:
parent
d6dca1f6a1
commit
0d964a5502
|
@ -640,7 +640,7 @@ uint8_t AP_ADSB::get_encoded_callsign_null_char()
|
|||
|
||||
// using the above logic, we must always assign the squawk. once we get configured
|
||||
// externally then get_encoded_callsign_null_char() stops getting called
|
||||
snprintf(out_state.cfg.callsign, 5, "%04d", unsigned(out_state.cfg.squawk_octal));
|
||||
snprintf(out_state.cfg.callsign, 5, "%04d", unsigned(out_state.cfg.squawk_octal) & 0x1FFF);
|
||||
memset(&out_state.cfg.callsign[4], 0, 5); // clear remaining 5 chars
|
||||
encoded_null |= 0x40;
|
||||
|
||||
|
|
Loading…
Reference in New Issue