Create channel-mute toggle function

This commit is contained in:
ford-jones
2025-09-11 14:16:48 +12:00
parent 1daf5aad1f
commit 9da92626e5
2 changed files with 16 additions and 0 deletions

View File

@@ -343,6 +343,16 @@ void Channels::setChannel(const meshtastic_Channel &c)
old = c; // slam in the new settings/role
}
void Channels::setMute(ChannelIndex chIndex)
{
if (chIndex < channelFile.channels_count) {
meshtastic_Channel *ch = channelFile.channels + chIndex;
ch->settings.mute = !ch->settings.mute;
} else {
LOG_ERROR("Failed to mute. Invalid channel index %d > %d", chIndex, channelFile.channels_count);
};
};
bool Channels::anyMqttEnabled()
{
#if USERPREFS_EVENT_MODE && !MESHTASTIC_EXCLUDE_MQTT