mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
OP-932 Adds working one-way mode to the OPLink radio connection. In this mode, packets will only flow from the ground side (coordinator modem) to the flight side modem.
This commit is contained in:
parent
774a74884a
commit
fc0328a3cd
@ -2013,8 +2013,18 @@ static portTickType rfm22_coordinatorTime(struct pios_rfm22b_dev *rfm22b_dev, po
|
||||
static bool rfm22_timeToSend(struct pios_rfm22b_dev *rfm22b_dev)
|
||||
{
|
||||
portTickType time = rfm22_coordinatorTime(rfm22b_dev, xTaskGetTickCount());
|
||||
bool is_coordinator = rfm22_isCoordinator(rfm22b_dev);
|
||||
|
||||
if (!rfm22_isCoordinator(rfm22b_dev)) {
|
||||
// If this is a one-way link, only the coordinator can send.
|
||||
if (rfm22b_dev->one_way_link) {
|
||||
if (is_coordinator) {
|
||||
return ((time -1) % (rfm22b_dev->packet_period)) == 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_coordinator) {
|
||||
time += rfm22b_dev->packet_period - 1;
|
||||
} else {
|
||||
time -= 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user