mirror of
https://github.com/Genaker/LoraSA.git
synced 2026-03-28 17:42:59 +01:00
Wait for peer before forwarding command
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -1442,6 +1442,8 @@ int16_t sendMessage(RadioComms &c, Message &m);
|
||||
|
||||
void loraSendMessage(Message &m);
|
||||
|
||||
Result<int16_t, Message *> checkRadio(RadioComms &c);
|
||||
|
||||
/*
|
||||
* If m.to is LOOP, the message is directed at this module; enact the message.
|
||||
* If m.to is not LOOP, send the message via the respective interface.
|
||||
@@ -1526,13 +1528,17 @@ void sendMessage(RoutedMessage &m)
|
||||
|
||||
if (m.to == LORA)
|
||||
{
|
||||
if (config.is_host && TxComms != NULL)
|
||||
{
|
||||
checkRadio(*TxComms); // waiting for peer to squak first, so message sending
|
||||
// will land on the receiving cycle
|
||||
}
|
||||
|
||||
loraSendMessage(*m.message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Result<int16_t, Message *> checkRadio(RadioComms &c);
|
||||
|
||||
RoutedMessage checkComms()
|
||||
{
|
||||
RoutedMessage mess;
|
||||
|
||||
Reference in New Issue
Block a user