Changes based on debugging.

This commit is contained in:
Jonathan Naylor
2016-01-25 22:36:16 +00:00
parent 3f76ade5c4
commit 8860b72e6c
4 changed files with 20 additions and 4 deletions

View File

@@ -234,15 +234,15 @@ void CDMRSlot::writeModem(unsigned char *data)
writeNetwork(data, DT_CSBK, FLCO_USER_USER, csbk.getSrcId(), csbk.getDstId()); writeNetwork(data, DT_CSBK, FLCO_USER_USER, csbk.getSrcId(), csbk.getDstId());
writeQueue(data); writeQueue(data);
LogMessage("DMR Slot %u, received RF CSBK from %u to %u", m_slotNo, csbk.getSrcId(), csbk.getDstId());
} }
break; break;
default: default:
LogWarning("DMR Slot %u, unhandled CSBK type - 0x%02X", m_slotNo, csbko); LogWarning("DMR Slot %u, unhandled RF CSBK type - 0x%02X", m_slotNo, csbko);
break; break;
} }
LogMessage("DMR Slot %u, received CSBK", m_slotNo);
} else { } else {
// Regenerate the Slot Type // Regenerate the Slot Type
slotType.getData(data + 2U); slotType.getData(data + 2U);

View File

@@ -29,7 +29,7 @@
const unsigned int BUFFER_LENGTH = 100U; const unsigned int BUFFER_LENGTH = 100U;
CDStarNetwork::CDStarNetwork(const std::string& gatewayAddress, unsigned int gatewayPort, unsigned int localPort, bool debug) : CDStarNetwork::CDStarNetwork(const std::string& gatewayAddress, unsigned int gatewayPort, unsigned int localPort, bool debug) :
m_socket("", localPort), m_socket(localPort),
m_address(), m_address(),
m_port(gatewayPort), m_port(gatewayPort),
m_debug(debug), m_debug(debug),

View File

@@ -43,6 +43,21 @@ m_fd(-1)
#endif #endif
} }
CUDPSocket::CUDPSocket(unsigned int port) :
m_address(),
m_port(port),
m_fd(-1)
{
assert(port > 0U);
#if defined(_WIN32) || defined(_WIN64)
WSAData data;
int wsaRet = ::WSAStartup(MAKEWORD(2, 2), &data);
if (wsaRet != 0)
LogError("Error from WSAStartup");
#endif
}
CUDPSocket::CUDPSocket() : CUDPSocket::CUDPSocket() :
m_address(), m_address(),
m_port(0U), m_port(0U),

View File

@@ -37,6 +37,7 @@
class CUDPSocket { class CUDPSocket {
public: public:
CUDPSocket(const std::string& address, unsigned int port); CUDPSocket(const std::string& address, unsigned int port);
CUDPSocket(unsigned int port);
CUDPSocket(); CUDPSocket();
~CUDPSocket(); ~CUDPSocket();