//Connect the radio on the network public void ConnectRadio(IARadio radio) { if (!radioNetwork.Contains(radio)) { radioNetwork.Add(radio); } }
public void BeginCommunication(IARadio inputRadio, IAInformation information, Channels channel) { //Add the radio to the online radio. There's only one online radio per channel. onlineRadio.Add(inputRadio); //Begin the message reception on all connected radio on this channel foreach (IARadio radio in radioNetwork) { if (radio.channel == channel && !IsRadioOnline(radio)) { radio.BeginMessageReception(information); } } StartCoroutine(ProcessCommunication(channel, information.length)); }
//Disconnect the radio from the network public void DisconnectRadio(IARadio radio) { radioNetwork.Remove(radio); }
public bool IsRadioOnline(IARadio radio) { return(onlineRadio.Contains(radio)); }