mirror of
https://github.com/oe7drt/YSFClients.git
synced 2026-04-06 06:43:53 +00:00
Update the reflector to accomodate the new YSF protocol.
This commit is contained in:
parent
61ee63da69
commit
1c45e41db8
3 changed files with 74 additions and 53 deletions
|
|
@ -115,19 +115,13 @@ void CNetwork::clock(unsigned int ms)
|
|||
return;
|
||||
}
|
||||
|
||||
// Invalid packet type?
|
||||
if (::memcmp(buffer, "YSFD", 4U) != 0)
|
||||
return;
|
||||
|
||||
// Simulate a poll with the data
|
||||
m_callsign = std::string((char*)(buffer + 4U), YSF_CALLSIGN_LENGTH);
|
||||
m_address = address;
|
||||
m_port = port;
|
||||
|
||||
if (m_debug)
|
||||
CUtils::dump(1U, "YSF Network Data Received", buffer, length);
|
||||
|
||||
m_buffer.addData(buffer, 155U);
|
||||
unsigned char len = length;
|
||||
m_buffer.addData(&len, 1U);
|
||||
|
||||
m_buffer.addData(buffer, length);
|
||||
}
|
||||
|
||||
unsigned int CNetwork::readData(unsigned char* data)
|
||||
|
|
@ -137,9 +131,12 @@ unsigned int CNetwork::readData(unsigned char* data)
|
|||
if (m_buffer.isEmpty())
|
||||
return 0U;
|
||||
|
||||
m_buffer.getData(data, 155U);
|
||||
unsigned char len = 0U;
|
||||
m_buffer.getData(&len, 1U);
|
||||
|
||||
return 155U;
|
||||
m_buffer.getData(data, len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
bool CNetwork::readPoll(std::string& callsign, in_addr& address, unsigned int& port)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue