1
0
Fork 0

Merge pull request #293 from W0CHP/master

master
Jonathan Naylor 2 years ago committed by GitHub
commit 20096333dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -368,17 +368,21 @@ void CAPRSWriter::sendIdFrameMobile()
::sprintf(lon, "%08.2lf", longitude); ::sprintf(lon, "%08.2lf", longitude);
std::string server = m_callsign; std::string server = m_callsign;
std::string symbol = m_symbol;
size_t pos = server.find_first_of('-'); size_t pos = server.find_first_of('-');
if (pos == std::string::npos) if (pos == std::string::npos)
server.append("-S"); server.append("-S");
else else
server.append("S"); server.append("S");
if (symbol.empty())
symbol.append("D&");
char output[500U]; char output[500U];
::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%cD%s%c&", ::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%c%c%s%c%c",
m_callsign.c_str(), server.c_str(), m_callsign.c_str(), server.c_str(),
lat, (rawLatitude < 0.0F) ? 'S' : 'N', lat, (rawLatitude < 0.0F) ? 'S' : 'N', symbol[0],
lon, (rawLongitude < 0.0F) ? 'W' : 'E'); lon, (rawLongitude < 0.0F) ? 'W' : 'E', symbol[1]);
if (bearingSet && velocitySet) if (bearingSet && velocitySet)
::sprintf(output + ::strlen(output), "%03.0f/%03.0f", rawBearing, rawVelocity * 0.539957F); ::sprintf(output + ::strlen(output), "%03.0f/%03.0f", rawBearing, rawVelocity * 0.539957F);

@ -368,17 +368,21 @@ void CAPRSWriter::sendIdFrameMobile()
::sprintf(lon, "%08.2lf", longitude); ::sprintf(lon, "%08.2lf", longitude);
std::string server = m_callsign; std::string server = m_callsign;
std::string symbol = m_symbol;
size_t pos = server.find_first_of('-'); size_t pos = server.find_first_of('-');
if (pos == std::string::npos) if (pos == std::string::npos)
server.append("-S"); server.append("-S");
else else
server.append("S"); server.append("S");
if (symbol.empty())
symbol.append("D&");
char output[500U]; char output[500U];
::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%cD%s%c&", ::sprintf(output, "%s>APDG03,TCPIP*,qAC,%s:!%s%c%c%s%c%c",
m_callsign.c_str(), server.c_str(), m_callsign.c_str(), server.c_str(),
lat, (rawLatitude < 0.0F) ? 'S' : 'N', lat, (rawLatitude < 0.0F) ? 'S' : 'N', symbol[0],
lon, (rawLongitude < 0.0F) ? 'W' : 'E'); lon, (rawLongitude < 0.0F) ? 'W' : 'E', symbol[1]);
if (bearingSet && velocitySet) if (bearingSet && velocitySet)
::sprintf(output + ::strlen(output), "%03.0f/%03.0f", rawBearing, rawVelocity * 0.539957F); ::sprintf(output + ::strlen(output), "%03.0f/%03.0f", rawBearing, rawVelocity * 0.539957F);

Loading…
Cancel
Save