WPILibC++  2020.3.2
SimDeviceData.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2019 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include "NotifyListener.h"
11 #include "hal/Types.h"
12 #include "hal/Value.h"
13 
14 typedef void (*HALSIM_SimDeviceCallback)(const char* name, void* param,
15  HAL_SimDeviceHandle handle);
16 
17 typedef void (*HALSIM_SimValueCallback)(const char* name, void* param,
18  HAL_SimValueHandle handle,
19  HAL_Bool readonly,
20  const struct HAL_Value* value);
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 int32_t HALSIM_RegisterSimDeviceCreatedCallback(
27  const char* prefix, void* param, HALSIM_SimDeviceCallback callback,
28  HAL_Bool initialNotify);
29 
30 void HALSIM_CancelSimDeviceCreatedCallback(int32_t uid);
31 
32 int32_t HALSIM_RegisterSimDeviceFreedCallback(
33  const char* prefix, void* param, HALSIM_SimDeviceCallback callback);
34 
35 void HALSIM_CancelSimDeviceFreedCallback(int32_t uid);
36 
37 HAL_SimDeviceHandle HALSIM_GetSimDeviceHandle(const char* name);
38 
39 const char* HALSIM_GetSimDeviceName(HAL_SimDeviceHandle handle);
40 
41 HAL_SimDeviceHandle HALSIM_GetSimValueDeviceHandle(HAL_SimValueHandle handle);
42 
43 void HALSIM_EnumerateSimDevices(const char* prefix, void* param,
44  HALSIM_SimDeviceCallback callback);
45 
46 int32_t HALSIM_RegisterSimValueCreatedCallback(HAL_SimDeviceHandle device,
47  void* param,
48  HALSIM_SimValueCallback callback,
49  HAL_Bool initialNotify);
50 
51 void HALSIM_CancelSimValueCreatedCallback(int32_t uid);
52 
53 int32_t HALSIM_RegisterSimValueChangedCallback(HAL_SimValueHandle handle,
54  void* param,
55  HALSIM_SimValueCallback callback,
56  HAL_Bool initialNotify);
57 
58 void HALSIM_CancelSimValueChangedCallback(int32_t uid);
59 
60 HAL_SimValueHandle HALSIM_GetSimValueHandle(HAL_SimDeviceHandle device,
61  const char* name);
62 
63 void HALSIM_EnumerateSimValues(HAL_SimDeviceHandle device, void* param,
64  HALSIM_SimValueCallback callback);
65 
66 const char** HALSIM_GetSimValueEnumOptions(HAL_SimValueHandle handle,
67  int32_t* numOptions);
68 
69 void HALSIM_ResetSimDeviceData(void);
70 
71 #ifdef __cplusplus
72 } // extern "C"
73 #endif
HAL_Value
HAL Entry Value.
Definition: Value.h:23