mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Remove wpiutil and update to the new build system (#210)
This commit is contained in:
committed by
Peter Johnson
parent
f43675e2bd
commit
5df7463663
24
manualTests/native/server.cpp
Normal file
24
manualTests/native/server.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <chrono>
|
||||
#include <cstdio>
|
||||
#include <thread>
|
||||
|
||||
#include "ntcore.h"
|
||||
|
||||
int main() {
|
||||
nt::SetLogger(
|
||||
[](unsigned int level, const char* file, unsigned int line,
|
||||
const char* msg) {
|
||||
std::fputs(msg, stderr);
|
||||
std::fputc('\n', stderr);
|
||||
},
|
||||
0);
|
||||
nt::StartServer("persistent.ini", "", 10000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
nt::SetEntryValue("/foo", nt::Value::MakeDouble(0.5));
|
||||
nt::SetEntryFlags("/foo", NT_PERSISTENT);
|
||||
nt::SetEntryValue("/foo2", nt::Value::MakeDouble(0.5));
|
||||
nt::SetEntryValue("/foo2", nt::Value::MakeDouble(0.7));
|
||||
nt::SetEntryValue("/foo2", nt::Value::MakeDouble(0.6));
|
||||
nt::SetEntryValue("/foo2", nt::Value::MakeDouble(0.5));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
}
|
||||
Reference in New Issue
Block a user