Package frc.spectrumLib.util
Class Network
java.lang.Object
frc.spectrumLib.util.Network
Reads the robot's own addresses and resolves hostnames to IP addresses. Each lookup retries ten
times, reporting a warning on every failure, before giving up.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns the robot's own IP address, orUNKNOWNif it cannot be resolved.static StringgetIPaddress(String deviceNameAddress) Resolves a hostname or mDNS name such aslimelight.local.static StringReturns the robot's MAC address as uppercase colon-separated hex, orUNKNOWNif it cannot be read.
-
Constructor Details
-
Network
public Network()
-
-
Method Details
-
getMACaddress
Returns the robot's MAC address as uppercase colon-separated hex, orUNKNOWNif it cannot be read. -
getIPaddress
Returns the robot's own IP address, orUNKNOWNif it cannot be resolved. -
getIPaddress
Resolves a hostname or mDNS name such aslimelight.local. ReturnsUNKNOWNif the name never resolves.
-