diff --git a/include/networktables/NetworkTable.h b/include/networktables/NetworkTable.h index 70f164f1d3..37181ee22c 100644 --- a/include/networktables/NetworkTable.h +++ b/include/networktables/NetworkTable.h @@ -40,20 +40,20 @@ class NetworkTable : public ITable { /** * set that network tables should be a client - * This must be called before initalize or GetTable + * This must be called before initialize or GetTable */ static void SetClientMode(); /** * set that network tables should be a server - * This must be called before initalize or GetTable + * This must be called before initialize or GetTable */ static void SetServerMode(); /** - * set the team the robot is configured for (this will set the ip address that + * set the team the robot is configured for (this will set the mdns address that * network tables will connect to in client mode) - * This must be called before initalize or GetTable + * This must be called before initialize or GetTable * @param team the team number */ static void SetTeam(int team); diff --git a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTable.java b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTable.java index 78c8b3b867..23bd6e3dbe 100644 --- a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTable.java +++ b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTable.java @@ -60,7 +60,7 @@ public class NetworkTable implements ITable, IRemote { /** * set that network tables should be a server - * This must be called before initalize or getTable + * This must be called before initialize or getTable */ public synchronized static void setServerMode() { if (!client) @@ -71,7 +71,7 @@ public class NetworkTable implements ITable, IRemote { /** * set that network tables should be a client - * This must be called before initalize or getTable + * This must be called before initialize or getTable */ public synchronized static void setClientMode() { if (client) @@ -81,13 +81,13 @@ public class NetworkTable implements ITable, IRemote { } /** - * set the team the robot is configured for (this will set the ip address that + * set the team the robot is configured for (this will set the mdns address that * network tables will connect to in client mode) - * This must be called before initalize or getTable + * This must be called before initialize or getTable * @param team the team number */ public synchronized static void setTeam(int team) { - setIPAddress("10." + (team / 100) + "." + (team % 100) + ".2"); + setIPAddress("roboRIO-" + team + "-FRC.local"); } /** diff --git a/src/networktables/NetworkTable.cpp b/src/networktables/NetworkTable.cpp index f452992446..7a1e6114f2 100644 --- a/src/networktables/NetworkTable.cpp +++ b/src/networktables/NetworkTable.cpp @@ -41,9 +41,9 @@ void NetworkTable::SetServerMode() { s_client = false; } void NetworkTable::SetTeam(int team) { char tmp[30]; #ifdef _MSC_VER - sprintf_s(tmp, "%d.%d.%d.%d\n", 10, team / 100, team % 100, 2); + sprintf_s(tmp, "roboRIO-%d-FRC.local\n", team); #else - std::snprintf(tmp, 30, "%d.%d.%d.%d\n", 10, team / 100, team % 100, 2); + std::snprintf(tmp, 30, "roboRIO-%d-FRC.local\n",team); #endif SetIPAddress(tmp); }