mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-22 08:05:49 +08:00
New option SendFrameType so one can send transparent data also to the modem serial port.
If set, one then has to specify the frame type (0x80 for modem serial of 0x90 for transparent data) as first byte af the message.
This commit is contained in:
@@ -315,15 +315,18 @@ int CMMDVMHost::run()
|
||||
unsigned int transparentPort = 0U;
|
||||
CUDPSocket* transparentSocket = NULL;
|
||||
|
||||
unsigned int sendFrameType = 0U;
|
||||
if (m_conf.getTransparentEnabled()) {
|
||||
std::string remoteAddress = m_conf.getTransparentRemoteAddress();
|
||||
unsigned int remotePort = m_conf.getTransparentRemotePort();
|
||||
unsigned int localPort = m_conf.getTransparentLocalPort();
|
||||
sendFrameType = m_conf.getTransparentSendFrameType();
|
||||
|
||||
LogInfo("Transparent Data");
|
||||
LogInfo(" Remote Address: %s", remoteAddress.c_str());
|
||||
LogInfo(" Remote Port: %u", remotePort);
|
||||
LogInfo(" Local Port: %u", localPort);
|
||||
LogInfo(" Send Frame Type: %u", sendFrameType);
|
||||
|
||||
transparentAddress = CUDPSocket::lookup(remoteAddress);
|
||||
transparentPort = remotePort;
|
||||
@@ -884,7 +887,7 @@ int CMMDVMHost::run()
|
||||
unsigned int port = 0U;
|
||||
len = transparentSocket->read(data, 200U, address, port);
|
||||
if (len > 0U)
|
||||
m_modem->writeTransparentData(data, len);
|
||||
m_modem->writeTransparentData(data, len, sendFrameType);
|
||||
}
|
||||
|
||||
unsigned int ms = stopWatch.elapsed();
|
||||
|
||||
Reference in New Issue
Block a user