port is 16-bit

pull/1/head
Tom Early 3 years ago
parent d40bb4f94b
commit afa30d7c8e

@ -73,6 +73,7 @@ public:
// get
const CCallsign &GetReflectorCallsign(void)const { return m_ReflectorCallsign; }
uint16_t GetPort(void) const { return m_Port; }
// task
void Thread(void);
@ -135,7 +136,7 @@ protected:
CCallsign m_ReflectorCallsign;
// data
uint8_t m_Port;
uint16_t m_Port;
// debug
CTimer m_DebugTimer;
};

@ -275,16 +275,19 @@ void CReflector::RouterThread(const char ThisModule)
m_Protocols.Lock();
for ( auto it=m_Protocols.begin(); it!=m_Protocols.end(); it++ )
{
// make a copy! after the Push(tmp), tmp will be nullptr!
auto tmp = packet;
// if packet is header, update RPT2 according to protocol
if ( packet->IsDvHeader() )
if ( tmp->IsDvHeader() )
{
// get our callsign
CCallsign csRPT = (*it)->GetReflectorCallsign();
csRPT.SetCSModule(ThisModule);
(dynamic_cast<CDvHeaderPacket *>(packet.get()))->SetRpt2Callsign(csRPT);
std::cout << "For protocol on port " << (*it)->GetPort() << ", Rpt2Callsign is " << csRPT << std::endl;
(dynamic_cast<CDvHeaderPacket *>(tmp.get()))->SetRpt2Callsign(csRPT);
}
// make a copy! after the Push(tmp), tmp will be nullptr!
auto tmp = packet;
(*it)->Push(tmp);
}
m_Protocols.Unlock();

Loading…
Cancel
Save

Powered by TurnKey Linux.