mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
20 lines
641 B
C++
20 lines
641 B
C++
// Copyright (c) FIRST and other WPILib contributors.
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
#include "glass/networktables/NetworkTablesHelper.h"
|
|
|
|
using namespace glass;
|
|
|
|
NetworkTablesHelper::NetworkTablesHelper(NT_Inst inst)
|
|
: m_inst{inst}, m_poller{nt::CreateEntryListenerPoller(inst)} {}
|
|
|
|
NetworkTablesHelper::~NetworkTablesHelper() {
|
|
nt::DestroyEntryListenerPoller(m_poller);
|
|
}
|
|
|
|
bool NetworkTablesHelper::IsConnected() const {
|
|
return nt::GetNetworkMode(m_inst) == NT_NET_MODE_SERVER ||
|
|
nt::IsConnected(m_inst);
|
|
}
|