public static bool UpdateChannel(Channels channelNumber, UpdateInfo info, bool sendMessage = true) { if (!currentConfig.ContainsKey((int)channelNumber)) { return(false); } currentConfig.Remove((int)channelNumber); currentConfig.Add((int)channelNumber, info); if (sendMessage) { List <UpdateInfo> infos = new List <UpdateInfo>(currentConfig.Values); byte[] cmd = ChannelList.GetUpdateCommand(infos); RehaStimInterface.sendMessage(cmd); } return(true); }