[APRS] Fix callsign in non-LoRa mode and buffer size (#1215)
This commit is contained in:
parent
400382b1e7
commit
d9eb90e59b
1 changed files with 7 additions and 1 deletions
|
@ -24,6 +24,11 @@ int16_t APRSClient::begin(char sym, char* callsign, uint8_t ssid, bool alt) {
|
||||||
table = '/';
|
table = '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// callsign is only processed for LoRa APRS
|
||||||
|
if(!callsign) {
|
||||||
|
return(RADIOLIB_ERR_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
if(strlen(callsign) > RADIOLIB_AX25_MAX_CALLSIGN_LEN) {
|
if(strlen(callsign) > RADIOLIB_AX25_MAX_CALLSIGN_LEN) {
|
||||||
return(RADIOLIB_ERR_INVALID_CALLSIGN);
|
return(RADIOLIB_ERR_INVALID_CALLSIGN);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +48,7 @@ int16_t APRSClient::sendPosition(char* destCallsign, uint8_t destSSID, char* lat
|
||||||
len += strlen(time);
|
len += strlen(time);
|
||||||
}
|
}
|
||||||
#if !RADIOLIB_STATIC_ONLY
|
#if !RADIOLIB_STATIC_ONLY
|
||||||
char* info = new char[len + 1];
|
char* info = new char[len + 2];
|
||||||
#else
|
#else
|
||||||
char info[RADIOLIB_STATIC_ARRAY_SIZE];
|
char info[RADIOLIB_STATIC_ARRAY_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
@ -71,6 +76,7 @@ int16_t APRSClient::sendPosition(char* destCallsign, uint8_t destSSID, char* lat
|
||||||
|
|
||||||
// send the frame
|
// send the frame
|
||||||
info[len] = '\0';
|
info[len] = '\0';
|
||||||
|
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("APRS Info: %s, length = %d", (void*)info, info, (int)len);
|
||||||
int16_t state = sendFrame(destCallsign, destSSID, info);
|
int16_t state = sendFrame(destCallsign, destSSID, info);
|
||||||
#if !RADIOLIB_STATIC_ONLY
|
#if !RADIOLIB_STATIC_ONLY
|
||||||
delete[] info;
|
delete[] info;
|
||||||
|
|
Loading…
Add table
Reference in a new issue