mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-07 23:43:51 +00:00
Add support for passthrough of serial data from MQTT to the spare serial port on an MMDVM modem/hotspot.
This commit is contained in:
parent
1afe34f514
commit
3c48b8f61b
11 changed files with 59 additions and 126 deletions
|
|
@ -1191,6 +1191,10 @@ int CMMDVMHost::run()
|
|||
m_modem->writeTransparentData(data, len);
|
||||
}
|
||||
|
||||
len = m_modem->readSerialData(data);
|
||||
if (len > 0U)
|
||||
m_mqtt->publish("display", data, len);
|
||||
|
||||
unsigned int ms = stopWatch.elapsed();
|
||||
stopWatch.start();
|
||||
|
||||
|
|
@ -2784,6 +2788,13 @@ void CMMDVMHost::writeJSONMessage(const std::string& message)
|
|||
WriteJSON("MMDVM", json);
|
||||
}
|
||||
|
||||
void CMMDVMHost::writeSerial(const std::string& message)
|
||||
{
|
||||
assert(m_modem != NULL);
|
||||
|
||||
m_modem->writeSerialData((unsigned char*)message.c_str(), message.length());
|
||||
}
|
||||
|
||||
void CMMDVMHost::onCommand(const std::string& command)
|
||||
{
|
||||
assert(host != NULL);
|
||||
|
|
@ -2793,5 +2804,8 @@ void CMMDVMHost::onCommand(const std::string& command)
|
|||
|
||||
void CMMDVMHost::onDisplay(const std::string& message)
|
||||
{
|
||||
assert(host != NULL);
|
||||
|
||||
host->writeSerial(message);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue