/// <summary> /// Display the netowrk information for a a specified network interface on the Debug console. /// </summary> /// <param name="net">Network interface to decode and display the information for.</param> private static void ListNetworkInfo(NetworkInterface net) { try { switch (net.NetworkInterfaceType) { case (NetworkInterfaceType.Ethernet): Debug.Print("Found Ethernet Interface"); break; case (NetworkInterfaceType.Wireless80211): Debug.Print("Found 802.11 WiFi Interface"); break; case (NetworkInterfaceType.Unknown): Debug.Print("Found Unknown Interface"); break; } Debug.Print("MAC Address: " + DebugInformation.Hexadecimal(net.PhysicalAddress)); Debug.Print("DHCP enabled: " + net.IsDhcpEnabled.ToString()); Debug.Print("Dynamic DNS enabled: " + net.IsDynamicDnsEnabled.ToString()); Debug.Print("IP Address: " + net.IPAddress.ToString()); Debug.Print("Subnet Mask: " + net.SubnetMask.ToString()); Debug.Print("Gateway: " + net.GatewayAddress.ToString()); if (net is Wireless80211) { var wifi = net as Wireless80211; Debug.Print("SSID:" + wifi.Ssid.ToString()); } } catch (Exception e) { Debug.Print("ListNetworkInfo exception: " + e.Message); } }
/// <summary> /// GPS message ready for processing. /// </summary> /// <remarks> /// Unknown message types will be discarded. /// </remarks> /// <param name="line">GPS text for processing.</param> private void GpsOnLineReceived(object sender, string line) { Console.WriteLine($"GpsOnLineR - {line}"); if (line.Length > 0) { var checksumLocation = line.LastIndexOf('*'); if (checksumLocation > 0) { var checksumDigits = line.Substring(checksumLocation + 1); var actualData = line.Substring(0, checksumLocation); if (DebugInformation.Hexadecimal(Checksum.XOR(actualData.Substring(1))) == ("0x" + checksumDigits)) { var elements = actualData.Split(','); if (elements.Length > 0) { var decoder = (NMEADecoder)decoders[elements[0]]; if (decoder != null) { decoder.Process(elements); } } } } } }
private void RfidReaderOnTagRead(object sender, RfidReadResult e) { if (e.Status == RfidValidationStatus.Ok) { Console.WriteLine($"From event - Tag value is {DebugInformation.Hexadecimal(e.RfidTag)}"); return; } Console.WriteLine($"From event - Error {e.Status}"); }
public void OnNext(byte[] value) { Console.WriteLine($"From IObserver - Tag value is {DebugInformation.Hexadecimal(value)}"); }