mirror of
https://github.com/nostar/urfd.git
synced 2026-11-08 04:19:39 +00:00
port is 16-bit
This commit is contained in:
1 parent
d40bb4f94b
commit
afa30d7c8e
2 files changed
+9
-5
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user