WPILibC++ 2025.0.0-alpha-1-10-g1ccd8d1
SimDeviceData.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include "hal/Types.h"
8#include "hal/Value.h"
9
10typedef void (*HALSIM_SimDeviceCallback)(const char* name, void* param,
11 HAL_SimDeviceHandle handle);
12
13typedef void (*HALSIM_SimValueCallback)(const char* name, void* param,
14 HAL_SimValueHandle handle,
15 int32_t direction,
16 const struct HAL_Value* value);
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22void HALSIM_SetSimDeviceEnabled(const char* prefix, HAL_Bool enabled);
24
26 const char* prefix, void* param, HALSIM_SimDeviceCallback callback,
27 HAL_Bool initialNotify);
28
30
31int32_t HALSIM_RegisterSimDeviceFreedCallback(const char* prefix, void* param,
33 HAL_Bool initialNotify);
34
36
38
40
42
43void HALSIM_EnumerateSimDevices(const char* prefix, void* param,
45
47 void* param,
49 HAL_Bool initialNotify);
50
52
54 void* param,
56 HAL_Bool initialNotify);
57
59
60/**
61 * Register a callback for HAL_SimValueReset(). The callback is called with the
62 * old value.
63 *
64 * @param handle simulated value handle
65 * @param param parameter for callback
66 * @param callback callback
67 * @param initialNotify ignored (present for consistency)
68 */
70 void* param,
72 HAL_Bool initialNotify);
73
75
77 const char* name);
78
81
83 int32_t* numOptions);
84
86 int32_t* numOptions);
87
89
90#ifdef __cplusplus
91} // extern "C"
92#endif
void(* HALSIM_SimDeviceCallback)(const char *name, void *param, HAL_SimDeviceHandle handle)
Definition: SimDeviceData.h:10
const char * HALSIM_GetSimDeviceName(HAL_SimDeviceHandle handle)
void HALSIM_EnumerateSimValues(HAL_SimDeviceHandle device, void *param, HALSIM_SimValueCallback callback)
void HALSIM_EnumerateSimDevices(const char *prefix, void *param, HALSIM_SimDeviceCallback callback)
void HALSIM_CancelSimDeviceFreedCallback(int32_t uid)
HAL_SimDeviceHandle HALSIM_GetSimDeviceHandle(const char *name)
HAL_SimValueHandle HALSIM_GetSimValueHandle(HAL_SimDeviceHandle device, const char *name)
int32_t HALSIM_RegisterSimDeviceCreatedCallback(const char *prefix, void *param, HALSIM_SimDeviceCallback callback, HAL_Bool initialNotify)
void HALSIM_SetSimDeviceEnabled(const char *prefix, HAL_Bool enabled)
int32_t HALSIM_RegisterSimDeviceFreedCallback(const char *prefix, void *param, HALSIM_SimDeviceCallback callback, HAL_Bool initialNotify)
int32_t HALSIM_RegisterSimValueResetCallback(HAL_SimValueHandle handle, void *param, HALSIM_SimValueCallback callback, HAL_Bool initialNotify)
Register a callback for HAL_SimValueReset().
int32_t HALSIM_RegisterSimValueCreatedCallback(HAL_SimDeviceHandle device, void *param, HALSIM_SimValueCallback callback, HAL_Bool initialNotify)
void HALSIM_CancelSimDeviceCreatedCallback(int32_t uid)
const char ** HALSIM_GetSimValueEnumOptions(HAL_SimValueHandle handle, int32_t *numOptions)
int32_t HALSIM_RegisterSimValueChangedCallback(HAL_SimValueHandle handle, void *param, HALSIM_SimValueCallback callback, HAL_Bool initialNotify)
void HALSIM_ResetSimDeviceData(void)
HAL_Bool HALSIM_IsSimDeviceEnabled(const char *name)
void HALSIM_CancelSimValueChangedCallback(int32_t uid)
void HALSIM_CancelSimValueResetCallback(int32_t uid)
const double * HALSIM_GetSimValueEnumDoubleValues(HAL_SimValueHandle handle, int32_t *numOptions)
void(* HALSIM_SimValueCallback)(const char *name, void *param, HAL_SimValueHandle handle, int32_t direction, const struct HAL_Value *value)
Definition: SimDeviceData.h:13
void HALSIM_CancelSimValueCreatedCallback(int32_t uid)
HAL_SimDeviceHandle HALSIM_GetSimValueDeviceHandle(HAL_SimValueHandle handle)
int32_t HAL_Bool
Definition: Types.h:73
HAL_Handle HAL_SimDeviceHandle
Definition: Types.h:53
HAL_Handle HAL_SimValueHandle
Definition: Types.h:55
constexpr const char * name(const T &)
HAL Entry Value.
Definition: Value.h:20