mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-21 06:13:49 +00:00
DMR trunking patches
This commit is contained in:
parent
b5b119fa8e
commit
4ff3bbf766
16 changed files with 696 additions and 55 deletions
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2021,2023,2025 Jonathan Naylor, G4KLX
|
||||
* Copyright (C) 2026 Adrian Musceac, YO8RZZ
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -108,13 +109,39 @@ void CDMRControl::clock()
|
|||
{
|
||||
if (m_network != nullptr) {
|
||||
CDMRData data;
|
||||
bool ret = m_network->read(data);
|
||||
TrunkingCommandParameters command;
|
||||
bool ret = m_network->read(data, command);
|
||||
if (ret) {
|
||||
unsigned int slotNo = data.getSlotNo();
|
||||
switch (slotNo) {
|
||||
case 1U: m_slot1.writeNetwork(data); break;
|
||||
case 2U: m_slot2.writeNetwork(data); break;
|
||||
default: LogError("Invalid slot no %u", slotNo); break;
|
||||
if(m_modem->getDMRTrunking() && command.trunkingParams) {
|
||||
switch(command.commandType) {
|
||||
case DMRCommand::ChannelEnableDisable:
|
||||
{
|
||||
if(command.slot == 1) {
|
||||
if(!m_modem->getControlChannel())
|
||||
m_slot1.enable(command.channelEnable);
|
||||
}
|
||||
else {
|
||||
m_slot2.enable(command.channelEnable);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if(command.slot == 1)
|
||||
m_slot1.setReverseChannelCommand(command.commandType);
|
||||
else
|
||||
m_slot2.setReverseChannelCommand(command.commandType);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
unsigned int slotNo = data.getSlotNo();
|
||||
switch (slotNo) {
|
||||
case 1U: m_slot1.writeNetwork(data); break;
|
||||
case 2U: m_slot2.writeNetwork(data); break;
|
||||
default: LogError("Invalid slot no %u", slotNo); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue