From e6656326a821dc3069fca57f736883594be61d7b Mon Sep 17 00:00:00 2001 From: Thad House Date: Thu, 9 Feb 2017 00:55:01 -0800 Subject: [PATCH] Adds field IP to round robin list (#187) With how many more coprocessors are being added, this is probably needed to make the field crew sane. --- .../wpi/first/wpilibj/networktables/NetworkTable.java | 3 ++- src/networktables/NetworkTable.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTable.java b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTable.java index ce28be62de..05ef54b636 100644 --- a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTable.java +++ b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTable.java @@ -90,11 +90,12 @@ public class NetworkTable implements ITable, IRemote { * @param team the team number */ public synchronized static void setTeam(int team) { - String[] addresses = new String[4]; + String[] addresses = new String[5]; addresses[0] = "10." + (int)(team / 100) + "." + (int)(team % 100) + ".2"; addresses[1] = "172.22.11.2"; addresses[2] = "roboRIO-" + team + "-FRC.local"; addresses[3] = "roboRIO-" + team + "-FRC.lan"; + addresses[4] = "roboRIO-" + team + "-FRC.frc-field.local"; setIPAddress(addresses); } diff --git a/src/networktables/NetworkTable.cpp b/src/networktables/NetworkTable.cpp index 5a689e9311..63d83cf042 100644 --- a/src/networktables/NetworkTable.cpp +++ b/src/networktables/NetworkTable.cpp @@ -43,7 +43,7 @@ void NetworkTable::SetClientMode() { s_client = true; } void NetworkTable::SetServerMode() { s_client = false; } void NetworkTable::SetTeam(int team) { - std::pair servers[4]; + std::pair servers[5]; // 10.te.am.2 llvm::SmallString<32> fixed; @@ -73,6 +73,14 @@ void NetworkTable::SetTeam(int team) { servers[3] = std::make_pair(oss.str(), s_port); } + // roboRIO--FRC.frc-field.local + llvm::SmallString<64> field_local; + { + llvm::raw_svector_ostream oss{field_local}; + oss << "roboRIO-" << team << "-FRC.frc-field.local"; + servers[4] = std::make_pair(oss.str(), s_port); + } + nt::SetServer(servers); }