mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-04 22:17:38 +00: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:
parent
f58ef17eb7
commit
86fb3b6944
5 changed files with 29 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue