CTRE Phoenix 6 C++ 25.0.0-beta-4
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
16{
17public:
18 static double GetRawValue(HAL_Value const *value)
19 {
20 switch (value->type)
21 {
22 case HAL_DOUBLE:
23 return value->data.v_double;
24 case HAL_BOOLEAN:
25 return value->data.v_boolean;
26 case HAL_INT:
27 return value->data.v_int;
28 case HAL_LONG:
29 return value->data.v_long;
30 case HAL_ENUM:
31 return value->data.v_enum;
32 default:
33 return 0;
34 }
35 }
36};
37
38} // namespace wpiutils
39} // namespace phoenix6
40} // namespace ctre
Definition CallbackHelper.hpp:16
static double GetRawValue(HAL_Value const *value)
Definition CallbackHelper.hpp:18
Definition StatusCodes.h:18