Remove wpiutil and update to the new build system (#210)

This commit is contained in:
Thad House
2017-08-03 14:14:40 -07:00
committed by Peter Johnson
parent f43675e2bd
commit 5df7463663
168 changed files with 670 additions and 16084 deletions

View File

@@ -0,0 +1,25 @@
#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::StartClient("127.0.0.1", 10000);
std::this_thread::sleep_for(std::chrono::seconds(2));
auto foo = nt::GetEntryValue("/foo");
if (foo && foo->IsDouble()) printf("Got foo: %g\n", foo->GetDouble());
nt::SetEntryValue("/bar", nt::Value::MakeBoolean(false));
nt::SetEntryFlags("/bar", NT_PERSISTENT);
nt::SetEntryValue("/bar2", nt::Value::MakeBoolean(true));
nt::SetEntryValue("/bar2", nt::Value::MakeBoolean(false));
nt::SetEntryValue("/bar2", nt::Value::MakeBoolean(true));
std::this_thread::sleep_for(std::chrono::seconds(10));
}