Skip to content

Commit

Permalink
Yeet (don't forget to use the correct jdk)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Sep 20, 2024
1 parent e898afa commit a4ba343
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ wpi::TimeSyncClient::TimeSyncClient(std::string_view server, int remote_port,
m_serverIP{server},
m_serverPort{remote_port},
m_loopDelay(ping_delay) {
fmt::println("Connecting to server at {}:{}", m_serverIP, m_serverPort);
struct sockaddr_in serverAddr;
uv::NameToAddr(m_serverIP, m_serverPort, &serverAddr);
m_udp->Connect(serverAddr);
Expand Down
13 changes: 9 additions & 4 deletions photon-targeting/src/test/java/net/TimeSyncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import edu.wpi.first.apriltag.jni.AprilTagJNI;
import edu.wpi.first.cscore.CameraServerCvJNI;
import edu.wpi.first.cscore.CameraServerJNI;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.hal.JNIWrapper;
import edu.wpi.first.math.WPIMathJNI;
import edu.wpi.first.net.WPINetJNI;
Expand Down Expand Up @@ -60,18 +61,22 @@ public void smoketest() throws InterruptedException {
assertTrue(false);
}

// var server = new TimeSyncServer(5812);
HAL.initialize(1000, 0);

var server = new TimeSyncServer(5812);
var client = new TimeSyncClient("127.0.0.1", 5812, 1.0);

// server.start();
System.err.println("Waiting: PID=" + ProcessHandle.current().pid());

server.start();
client.start();

for (int i = 0; i < 5; i++) {
Thread.sleep(1000);
// System.out.println(client.getOffset());
System.out.println(client.getOffset());
}

// server.stop();
server.stop();
client.stop();
}
}

0 comments on commit a4ba343

Please sign in to comment.