|
|
@ -200,15 +200,8 @@ void CYCSNetwork::clock(unsigned int ms)
|
|
|
|
if (m_debug)
|
|
|
|
if (m_debug)
|
|
|
|
CUtils::dump(1U, "YCS Network Data Received", buffer, length);
|
|
|
|
CUtils::dump(1U, "YCS Network Data Received", buffer, length);
|
|
|
|
|
|
|
|
|
|
|
|
// Throw away any options messages
|
|
|
|
if (::memcmp(buffer, "YSFP", 4U) == 0) {
|
|
|
|
if (::memcmp(buffer, "YSFO", 4U) == 0)
|
|
|
|
if (m_state == DS_LINKING) {
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Throw away any info messages
|
|
|
|
|
|
|
|
if (::memcmp(buffer, "YSFI", 4U) == 0)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (::memcmp(buffer, "YSFP", 4U) == 0 && m_state == DS_LINKING) {
|
|
|
|
|
|
|
|
LogMessage("Linked to %s", m_name.c_str());
|
|
|
|
LogMessage("Linked to %s", m_name.c_str());
|
|
|
|
|
|
|
|
|
|
|
|
m_state = DS_LINKED;
|
|
|
|
m_state = DS_LINKED;
|
|
|
@ -224,6 +217,12 @@ void CYCSNetwork::clock(unsigned int ms)
|
|
|
|
m_socket.write(m_info, 80U, m_addr, m_addrLen);
|
|
|
|
m_socket.write(m_info, 80U, m_addr, m_addrLen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char len = length;
|
|
|
|
|
|
|
|
m_buffer.addData(&len, 1U);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_buffer.addData(buffer, length);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (::memcmp(buffer, "YSFD", 4U) == 0) {
|
|
|
|
if (::memcmp(buffer, "YSFD", 4U) == 0) {
|
|
|
|
CYSFFICH fich;
|
|
|
|
CYSFFICH fich;
|
|
|
|
bool valid = fich.decode(buffer + 35U);
|
|
|
|
bool valid = fich.decode(buffer + 35U);
|
|
|
@ -234,12 +233,12 @@ void CYCSNetwork::clock(unsigned int ms)
|
|
|
|
unsigned char dgId = fich.getDGId();
|
|
|
|
unsigned char dgId = fich.getDGId();
|
|
|
|
if (dgId != m_dgId)
|
|
|
|
if (dgId != m_dgId)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char len = length;
|
|
|
|
unsigned char len = length;
|
|
|
|
m_buffer.addData(&len, 1U);
|
|
|
|
m_buffer.addData(&len, 1U);
|
|
|
|
|
|
|
|
|
|
|
|
m_buffer.addData(buffer, length);
|
|
|
|
m_buffer.addData(buffer, length);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int CYCSNetwork::read(unsigned int dgid, unsigned char* data)
|
|
|
|
unsigned int CYCSNetwork::read(unsigned int dgid, unsigned char* data)
|
|
|
|