diff --git a/config.example.yml b/config.example.yml index 3e2175bc..d5f8fc4a 100644 --- a/config.example.yml +++ b/config.example.yml @@ -123,7 +123,10 @@ system: channelNo: 1 dmrNetId: 1 voiceChNo: - - 1 + - channelNo: 1 + rconAddress: 127.0.0.1 + rconPort: 9990 + rconPassword: "PASSWORD" colorCode: 1 nac: 293 # txNAC: 293 diff --git a/host/Host.cpp b/host/Host.cpp index a7d499bd..5afdbef3 100644 --- a/host/Host.cpp +++ b/host/Host.cpp @@ -1868,8 +1868,16 @@ bool Host::readParams() } yaml::Node& voiceChList = rfssConfig["voiceChNo"]; + + if (voiceChList.size() == 0U) { + ::LogError(LOG_HOST, "No voice channel list defined!"); + return false; + } + for (size_t i = 0; i < voiceChList.size(); i++) { - uint32_t chNo = (uint32_t)::strtoul(voiceChList[i].as("1").c_str(), NULL, 16); + yaml::Node& channel = voiceChList[i]; + + uint32_t chNo = (uint32_t)::strtoul(channel["channelNo"].as("1").c_str(), NULL, 16); if (chNo == 0U) { // clamp to 1 chNo = 1U; } @@ -1877,6 +1885,14 @@ bool Host::readParams() chNo = 4095U; } + std::string rconAddress = channel["rconAddress"].as("127.0.0.1"); + uint16_t rconPort = (uint16_t)channel["rconPort"].as(RCON_DEFAULT_PORT); + std::string rconPassword = channel["rconPassword"].as(); + + ::LogInfoEx(LOG_HOST, "Voice Channel Id %u Channel No $%04X RCON Adddress %s:%u", m_channelId, chNo, rconAddress.c_str(), rconPort); + + // TODO handle storing RCON data for voice channels + m_voiceChNo.push_back(chNo); }