From 437f8fb17aab7cfe6241907c2f77b41f9b078c1e Mon Sep 17 00:00:00 2001 From: Tom Early Date: Wed, 5 Jan 2022 07:33:08 -0700 Subject: [PATCH] fix bm connect issues --- reflector/BMProtocol.cpp | 26 +++++++++++++------------- reflector/Main.h | 2 +- reflector/Protocols.cpp | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/reflector/BMProtocol.cpp b/reflector/BMProtocol.cpp index ef954d1..bc29469 100644 --- a/reflector/BMProtocol.cpp +++ b/reflector/BMProtocol.cpp @@ -332,7 +332,7 @@ void CBMProtocol::HandlePeerLinks(void) // send connect packet to re-initiate peer link EncodeConnectPacket(&buffer, (*it).GetModules()); Send(buffer, (*it).GetIp(), XLX_PORT); - std::cout << "Sending connect packet to XLX peer " << (*it).GetCallsign() << " @ " << (*it).GetIp() << " for modules " << (*it).GetModules() << std::endl; + std::cout << "Sending connect packet to BM peer " << (*it).GetCallsign() << " @ " << (*it).GetIp() << " for modules " << (*it).GetModules() << std::endl; } } @@ -520,11 +520,11 @@ void CBMProtocol::EncodeConnectPacket(CBuffer *Buffer, const char *Modules) Buffer->Set(tag, sizeof(tag)); // our callsign Buffer->resize(Buffer->size()+8); - g_Reflector.GetCallsign().GetCallsign(Buffer->data()+1); - // our version - Buffer->Append((uint8_t)VERSION_MAJOR); - Buffer->Append((uint8_t)VERSION_MINOR); - Buffer->Append((uint8_t)VERSION_REVISION); + m_ReflectorCallsign.GetCallsign(Buffer->data()+1); + // our version, fake it + Buffer->Append((uint8_t)2); + Buffer->Append((uint8_t)4); + Buffer->Append((uint8_t)31); // the modules we share Buffer->Append(Modules); Buffer->resize(39); @@ -538,7 +538,7 @@ void CBMProtocol::EncodeDisconnectPacket(CBuffer *Buffer) Buffer->Set(tag, sizeof(tag)); // our callsign Buffer->resize(Buffer->size()+8); - g_Reflector.GetCallsign().GetCallsign(Buffer->data()+1); + m_ReflectorCallsign.GetCallsign(Buffer->data()+1); Buffer->Append((uint8_t)0); } @@ -550,11 +550,11 @@ void CBMProtocol::EncodeConnectAckPacket(CBuffer *Buffer, const char *Modules) Buffer->Set(tag, sizeof(tag)); // our callsign Buffer->resize(Buffer->size()+8); - g_Reflector.GetCallsign().GetCallsign(Buffer->data()+1); - // our version - Buffer->Append((uint8_t)VERSION_MAJOR); - Buffer->Append((uint8_t)VERSION_MINOR); - Buffer->Append((uint8_t)VERSION_REVISION); + m_ReflectorCallsign.GetCallsign(Buffer->data()+1); + // our version, fake it + Buffer->Append((uint8_t)2); + Buffer->Append((uint8_t)4); + Buffer->Append((uint8_t)31); // the modules we share Buffer->Append(Modules); Buffer->resize(39); @@ -568,7 +568,7 @@ void CBMProtocol::EncodeConnectNackPacket(CBuffer *Buffer) Buffer->Set(tag, sizeof(tag)); // our callsign Buffer->resize(Buffer->size()+8); - g_Reflector.GetCallsign().GetCallsign(Buffer->data()+1); + m_ReflectorCallsign.GetCallsign(Buffer->data()+1); Buffer->Append((uint8_t)0); } diff --git a/reflector/Main.h b/reflector/Main.h index 9888aaa..73a6be6 100644 --- a/reflector/Main.h +++ b/reflector/Main.h @@ -77,7 +77,7 @@ // protocols --------------------------------------------------- #ifndef NO_G3 -enum class EProtocol { any, none, dextra, dplus, dcs, xlx, urf, dmrplus, dmrmmdvm, ysf, m17, g3 }; +enum class EProtocol { any, none, dextra, dplus, dcs, bm, urf, dmrplus, dmrmmdvm, ysf, m17, g3 }; #else enum class EProtocol { any, none, dextra, dplus, dcs, bm, urf, dmrplus, dmrmmdvm, ysf, m17 }; #endif diff --git a/reflector/Protocols.cpp b/reflector/Protocols.cpp index e6b5e6b..10649a6 100644 --- a/reflector/Protocols.cpp +++ b/reflector/Protocols.cpp @@ -63,7 +63,7 @@ bool CProtocols::Init(void) return false; m_Protocols.emplace_back(std::unique_ptr(new CBMProtocol)); - if (! m_Protocols.back()->Initialize(nullptr, EProtocol::bm, XLX_PORT, DMR_IPV4, DMR_IPV6)) + if (! m_Protocols.back()->Initialize("XLX", EProtocol::bm, XLX_PORT, DMR_IPV4, DMR_IPV6)) return false; m_Protocols.emplace_back(std::unique_ptr(new CDmrplusProtocol));