private void radioSelectSwitch(object sender, RoutedEventArgs e) { RadioCommand update = new RadioCommand(); update.radio = this.radioId; update.cmdType = RadioCommand.CmdType.SELECT; sendUDPUpdate(update); }
private void radioFrequencyText_Click(object sender, MouseButtonEventArgs e) { RadioCommand update = new RadioCommand(); update.radio = this.radioId; update.cmdType = RadioCommand.CmdType.SELECT; sendUDPUpdate(update); }
private void sendFrequencyChange(double frequency) { RadioCommand update = new RadioCommand(); update.freq = frequency; update.radio = this.radioId; update.cmdType = RadioCommand.CmdType.FREQUENCY; sendUDPUpdate(update); }
private void radioVolume_DragCompleted(object sender, RoutedEventArgs e) { RadioCommand update = new RadioCommand(); update.radio = this.radioId; update.volume = ((float)radioVolume.Value) / 100.0f; update.cmdType = RadioCommand.CmdType.VOLUME; sendUDPUpdate(update); this.dragging = false; }
private void sendUDPUpdate(RadioCommand update) { //only send update if the aircraft doesnt have its own radio system, i.e FC3 if (lastUpdate != null && !lastUpdate.hasRadio) { byte[] bytes = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(update) + "\n"); //multicast send("239.255.50.10", 5060, bytes); //unicast send("127.0.0.1", 5061, bytes); } }
private void SendUDPCommand(RadioCommand.CmdType type) { RadioCommand update = new RadioCommand(); update.freq = 1; update.volume = 1; update.radio = 0; update.cmdType = type; byte[] bytes = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(update) + "\n"); //multicast Send("239.255.50.10", 5060, bytes); //unicast Send("127.0.0.1", 5061, bytes); }
private void sendUDPUpdate(RadioCommand update) { //only send update if the aircraft doesnt have its own radio system, i.e FC3 if (lastUpdate!=null && !lastUpdate.hasRadio) { byte[] bytes = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(update) + "\n"); //multicast send("239.255.50.10", 5060, bytes); //unicast send("127.0.0.1", 5061, bytes); } }