CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
CallbackHelper.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
9#include <hal/Value.h>
10
11namespace ctre {
12namespace phoenix6 {
13namespace wpiutils {
14
15class CallbackHelper final {
16public:
17 static double GetRawValue(HAL_Value const *value)
18 {
19 switch (value->type)
20 {
21 case HAL_DOUBLE:
22 return value->data.v_double;
23 case HAL_BOOLEAN:
24 return value->data.v_boolean;
25 case HAL_INT:
26 return value->data.v_int;
27 case HAL_LONG:
28 return value->data.v_long;
29 case HAL_ENUM:
30 return value->data.v_enum;
31 default:
32 return 0;
33 }
34 }
35};
36
37} // namespace wpiutils
38} // namespace phoenix6
39} // namespace ctre
Definition CallbackHelper.hpp:15
static double GetRawValue(HAL_Value const *value)
Definition CallbackHelper.hpp:17
Definition motor_constants.h:14