mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -10,7 +10,7 @@
|
||||
#include "wpi/util/Logger.hpp"
|
||||
#include "wpi/util/print.hpp"
|
||||
|
||||
namespace uv = wpi::uv;
|
||||
namespace uv = wpi::net::uv;
|
||||
|
||||
static void logfunc(unsigned int level, const char* file, unsigned int line,
|
||||
const char* msg) {
|
||||
@@ -18,15 +18,15 @@ static void logfunc(unsigned int level, const char* file, unsigned int line,
|
||||
}
|
||||
|
||||
int main() {
|
||||
wpi::Logger logger{logfunc, 0};
|
||||
wpi::util::Logger logger{logfunc, 0};
|
||||
|
||||
// Kick off the event loop on a separate thread
|
||||
wpi::EventLoopRunner loop;
|
||||
std::shared_ptr<wpi::DsClient> client;
|
||||
wpi::net::EventLoopRunner loop;
|
||||
std::shared_ptr<wpi::net::DsClient> client;
|
||||
loop.ExecAsync([&](uv::Loop& loop) {
|
||||
client = wpi::DsClient::Create(loop, logger);
|
||||
client = wpi::net::DsClient::Create(loop, logger);
|
||||
client->setIp.connect(
|
||||
[](std::string_view ip) { wpi::print("got IP: {}\n", ip); });
|
||||
[](std::string_view ip) { wpi::util::print("got IP: {}\n", ip); });
|
||||
client->clearIp.connect([] { std::fputs("cleared IP\n", stdout); });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user