diff --git a/src/protocols/APRS/APRS.cpp b/src/protocols/APRS/APRS.cpp index 5c54b217..b1f9b5a8 100644 --- a/src/protocols/APRS/APRS.cpp +++ b/src/protocols/APRS/APRS.cpp @@ -24,6 +24,11 @@ int16_t APRSClient::begin(char sym, char* callsign, uint8_t ssid, bool alt) { table = '/'; } + // callsign is only processed for LoRa APRS + if(!callsign) { + return(RADIOLIB_ERR_NONE); + } + if(strlen(callsign) > RADIOLIB_AX25_MAX_CALLSIGN_LEN) { return(RADIOLIB_ERR_INVALID_CALLSIGN); } @@ -43,7 +48,7 @@ int16_t APRSClient::sendPosition(char* destCallsign, uint8_t destSSID, char* lat len += strlen(time); } #if !RADIOLIB_STATIC_ONLY - char* info = new char[len + 1]; + char* info = new char[len + 2]; #else char info[RADIOLIB_STATIC_ARRAY_SIZE]; #endif @@ -71,6 +76,7 @@ int16_t APRSClient::sendPosition(char* destCallsign, uint8_t destSSID, char* lat // send the frame info[len] = '\0'; + RADIOLIB_DEBUG_PROTOCOL_PRINTLN("APRS Info: %s, length = %d", (void*)info, info, (int)len); int16_t state = sendFrame(destCallsign, destSSID, info); #if !RADIOLIB_STATIC_ONLY delete[] info;