Exemple #1
0
        public IPAddress GetIPForRadio(RadioID id)
        {
            Radio r = FindRadioByID(id);

            if (r != null && r is IPRadio)
            {
                IPRadio ir = (IPRadio)r;
                return(ir.Endpoint.Address);
            }
            byte[] tmp = new byte[4];
            id.AddToArray(tmp, 0, 4);
            tmp[0] = 12;
            return(new IPAddress(tmp));
        }
Exemple #2
0
 public Radio FindRadioByEndpoint(IPEndPoint ep)
 {
     if (this.master != null && this.master.Endpoint.Equals(ep))
     {
         return(master);
     }
     foreach (Radio r in this.peers)
     {
         IPRadio ir = (IPRadio)r;
         if (ir.Endpoint.Equals(ep))
         {
             return(r);
         }
     }
     //TODO handle remote radios
     return(null);
 }