ReduxLib C++ 2026.1.2
Loading...
Searching...
No Matches
CanandcolorStatus.h
1// Copyright (c) Bagholders of Redux Robotics and other contributors.
2// This is open source and can be modified and shared under the Mozilla Public License v2.0.
3
4#pragma once
5#include <units/temperature.h>
6#include "redux/sensors/canandcolor/CanandcolorFaults.h"
7
9
10/**
11 * Status packet contents decoded from the Canandcolor.
12 *
13 * Contains active faults, sticky faults, and temperature.
14 */
16 /**
17 * @param activeFaultsRaw active faults bitfield
18 * @param stickyFaultsRaw sticky faults bitfield
19 * @param faultsValid true if value is valid
20 * @param temp temperature (celsius)
21 */
23 uint8_t activeFaultsRaw,
24 uint8_t stickyFaultsRaw,
25 bool faultsValid,
26 units::celsius_t temp
27 ) :
28 activeFaults{activeFaultsRaw, faultsValid},
29 stickyFaults{stickyFaultsRaw, faultsValid},
30 temperature{temp} {};
31
32 /** Active faults (valid if faultsValid is true). */
34 /** Sticky faults (valid if faultsValid is true). */
36 /** Temperature in degrees Celsius. */
37 units::celsius_t temperature;
38};
39
40} // namespace redux::sensors::canandcolor
Definition CanandcolorFaults.h:14
Definition Canandcolor.h:19
Definition CanandcolorStatus.h:15
CanandcolorFaults stickyFaults
Definition CanandcolorStatus.h:35
CanandcolorFaults activeFaults
Definition CanandcolorStatus.h:33
units::celsius_t temperature
Definition CanandcolorStatus.h:37
constexpr CanandcolorStatus(uint8_t activeFaultsRaw, uint8_t stickyFaultsRaw, bool faultsValid, units::celsius_t temp)
Definition CanandcolorStatus.h:22