public override string ToString() { switch (length) { case 0: return("Broadcast"); case 1: return(uintMACaddress.ToString()); case 6: return(ipMACaddress.ToString()); default: throw new Exception("m0516-Illegal MAC length"); // return "Illegal MAC address"; } }
public override string ToString() { switch (length) { case 0: return("Broadcast"); case 1: return(uintMACaddress.ToString()); case 6: return(ipMACaddress.ToString()); default: BACnetLibraryCL.Panic("Illegal MAC length"); return("Illegal MAC address"); } }
public override string ToString() { if (directlyConnected) { // then the address should be displayed as the IP address. return("[" + MACaddress.ipMACaddress.ToString() + "]"); } else { switch (MACaddress.mat) { case BACnetMACaddress.MACaddrType.None: return("[Local Broadcast (should not see this - logic above)]"); case BACnetMACaddress.MACaddrType.Single: return("[" + networkNumber.ToString() + "/" + MACaddress.uintMACaddress.ToString() + "] @ " + viaIPEP.ToString()); case BACnetMACaddress.MACaddrType.IPEP: // extract the IP address return("[" + networkNumber.ToString() + "/" + MACaddress.ipMACaddress.ToString() + "] @ " + viaIPEP.ToString()); case BACnetMACaddress.MACaddrType.ByteArray: // extract the IP address string ts = "["; for (int i = 0; i < MACaddress.length; i++) { ts += String.Format("{0:x,2} ", MACaddress.byteMACaddr[i]); } return(ts + "] @ " + viaIPEP.ToString()); default: // todo // ("Implement MAC addresses of other lengths"); return("[m0140-Unimplemented MAC display]"); } } }