mirror of https://github.com/ArduPilot/ardupilot
AP_AIS: Make the char_to_hex method a common method
This commit is contained in:
parent
f08866639e
commit
8743ca226c
|
@ -804,15 +804,4 @@ bool AP_AIS::decode_latest_term()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the numeric value of an ascii hex character
|
|
||||||
int16_t AP_AIS::char_to_hex(char a)
|
|
||||||
{
|
|
||||||
if (a >= 'A' && a <= 'F')
|
|
||||||
return a - 'A' + 10;
|
|
||||||
else if (a >= 'a' && a <= 'f')
|
|
||||||
return a - 'a' + 10;
|
|
||||||
else
|
|
||||||
return a - '0';
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // HAL_AIS_ENABLED
|
#endif // HAL_AIS_ENABLED
|
||||||
|
|
|
@ -123,9 +123,6 @@ private:
|
||||||
// decode each term
|
// decode each term
|
||||||
bool decode_latest_term() WARN_IF_UNUSED;
|
bool decode_latest_term() WARN_IF_UNUSED;
|
||||||
|
|
||||||
// convert from char to hex value for checksum
|
|
||||||
int16_t char_to_hex(char a);
|
|
||||||
|
|
||||||
// varables for decoding NMEA sentence
|
// varables for decoding NMEA sentence
|
||||||
char _term[AIVDM_PAYLOAD_SIZE]; // buffer for the current term within the current sentence
|
char _term[AIVDM_PAYLOAD_SIZE]; // buffer for the current term within the current sentence
|
||||||
uint8_t _term_offset; // offset within the _term buffer where the next character should be placed
|
uint8_t _term_offset; // offset within the _term buffer where the next character should be placed
|
||||||
|
|
Loading…
Reference in New Issue