Remove hard coded reflector module

This commit is contained in:
Doug McLain 2020-11-02 12:20:56 -05:00
parent e5836a4614
commit 7d6140cbe0
3 changed files with 6 additions and 5 deletions

View File

@ -252,6 +252,7 @@ int CDMR2M17::run()
m_callsign = m_conf.getCallsign();
m_m17Ref = m_conf.getM17DstName();
char module = m_m17Ref.c_str()[m_m17Ref.find(' ')+1];
std::string m17_dstAddress = m_conf.getM17DstAddress();
unsigned int m17_dstPort = m_conf.getM17DstPort();
@ -324,7 +325,7 @@ int CDMR2M17::run()
unsigned short m17_cnt = 0;
unsigned char dmr_cnt = 0;
m_m17Network->writeLink();
m_m17Network->writeLink(module);
LogMessage("Starting DMR2M17-%s", VERSION);

View File

@ -71,17 +71,17 @@ bool CM17Network::writePoll()
return m_socket.write(data, 10U, m_address, m_port);
}
bool CM17Network::writeLink()
bool CM17Network::writeLink(char m)
{
unsigned char data[11U];
memcpy(data, "CONN", 4);
memcpy(data+4, m_callsign, 6);
data[10U] = 'A';
data[10U] = m;
if (m_debug)
CUtils::dump(1U, "M17 Network Link Sent", data, 11U);
LogInfo("writeLink add:port == %x, %x", m_address.s_addr, m_port);
//LogInfo("writeLink add:port == %x, %x", m_address.s_addr, m_port);
return m_socket.write(data, 11U, m_address, m_port);
}

View File

@ -33,7 +33,7 @@ public:
bool writeData(const unsigned char* data, unsigned int length);
unsigned int readData(unsigned char* data, unsigned int length);
bool writePoll();
bool writeLink();
bool writeLink(char m);
bool writeUnlink();
void close();
private: