13 #include "CallbackStore.h"
14 #include "mockdata/DriverStationData.h"
20 std::unique_ptr<CallbackStore> RegisterEnabledCallback(
21 NotifyCallback callback,
bool initialNotify) {
22 auto store = std::make_unique<CallbackStore>(
23 -1, callback, &HALSIM_CancelDriverStationEnabledCallback);
24 store->SetUid(HALSIM_RegisterDriverStationEnabledCallback(
25 &CallbackStoreThunk, store.get(), initialNotify));
29 bool GetEnabled()
const {
return HALSIM_GetDriverStationEnabled(); }
31 void SetEnabled(
bool enabled) { HALSIM_SetDriverStationEnabled(enabled); }
33 std::unique_ptr<CallbackStore> RegisterAutonomousCallback(
34 NotifyCallback callback,
bool initialNotify) {
35 auto store = std::make_unique<CallbackStore>(
36 -1, callback, &HALSIM_CancelDriverStationAutonomousCallback);
37 store->SetUid(HALSIM_RegisterDriverStationAutonomousCallback(
38 &CallbackStoreThunk, store.get(), initialNotify));
42 bool GetAutonomous()
const {
return HALSIM_GetDriverStationAutonomous(); }
44 void SetAutonomous(
bool autonomous) {
45 HALSIM_SetDriverStationAutonomous(autonomous);
48 std::unique_ptr<CallbackStore> RegisterTestCallback(NotifyCallback callback,
50 auto store = std::make_unique<CallbackStore>(
51 -1, callback, &HALSIM_CancelDriverStationTestCallback);
52 store->SetUid(HALSIM_RegisterDriverStationTestCallback(
53 &CallbackStoreThunk, store.get(), initialNotify));
57 bool GetTest()
const {
return HALSIM_GetDriverStationTest(); }
59 void SetTest(
bool test) { HALSIM_SetDriverStationTest(test); }
61 std::unique_ptr<CallbackStore> RegisterEStopCallback(NotifyCallback callback,
63 auto store = std::make_unique<CallbackStore>(
64 -1, callback, &HALSIM_CancelDriverStationEStopCallback);
65 store->SetUid(HALSIM_RegisterDriverStationEStopCallback(
66 &CallbackStoreThunk, store.get(), initialNotify));
70 bool GetEStop()
const {
return HALSIM_GetDriverStationEStop(); }
72 void SetEStop(
bool eStop) { HALSIM_SetDriverStationEStop(eStop); }
74 std::unique_ptr<CallbackStore> RegisterFmsAttachedCallback(
75 NotifyCallback callback,
bool initialNotify) {
76 auto store = std::make_unique<CallbackStore>(
77 -1, callback, &HALSIM_CancelDriverStationFmsAttachedCallback);
78 store->SetUid(HALSIM_RegisterDriverStationFmsAttachedCallback(
79 &CallbackStoreThunk, store.get(), initialNotify));
83 bool GetFmsAttached()
const {
return HALSIM_GetDriverStationFmsAttached(); }
85 void SetFmsAttached(
bool fmsAttached) {
86 HALSIM_SetDriverStationFmsAttached(fmsAttached);
89 std::unique_ptr<CallbackStore> RegisterDsAttachedCallback(
90 NotifyCallback callback,
bool initialNotify) {
91 auto store = std::make_unique<CallbackStore>(
92 -1, callback, &HALSIM_CancelDriverStationDsAttachedCallback);
93 store->SetUid(HALSIM_RegisterDriverStationDsAttachedCallback(
94 &CallbackStoreThunk, store.get(), initialNotify));
98 bool GetDsAttached()
const {
return HALSIM_GetDriverStationDsAttached(); }
100 void SetDsAttached(
bool dsAttached) {
101 HALSIM_SetDriverStationDsAttached(dsAttached);
104 void NotifyNewData() { HALSIM_NotifyDriverStationNewData(); }
106 void ResetData() { HALSIM_ResetDriverStationData(); }