Red Bird Racing VCU v2
 
Loading...
Searching...
No Matches
Telemetry.hpp
Go to the documentation of this file.
1/**
2 * @file Telemetry.hpp
3 * @author Planeson, Red Bird Racing
4 * @brief Declaration of the Telemetry class for sending telemetry data over CAN bus
5 * @version 1.0
6 * @date 2026-01-26
7 * @see Telemetry.cpp
8 * @dir lib/Telemetry @brief The Telemetry library contains the Telemetry class for managing telemetry data transmission over CAN bus, including grabbing and sending telemetry frames in fixed order based on scheduling logic.
9 */
10
11#ifndef TELEMETRY_HPP
12#define TELEMETRY_HPP
13
14#include "CarState.hpp"
15
16// ignore -Wpedantic warnings for mcp2515.h
17#pragma GCC diagnostic push
18#pragma GCC diagnostic ignored "-Wpedantic"
19#include <mcp2515.h>
20#pragma GCC diagnostic pop
21
22/**
23 * @brief Telemetry class for managing telemetry data transmission over CAN bus
24 * Grabs and sends telemetry frames in fixed order based on scheduling logic
25 */
27{
28public:
29 Telemetry(MCP2515 &mcp2515_, CarState &car_);
30 void sendPedal();
31 void sendMotor();
32 void sendBms();
33
34private:
35 MCP2515 &mcp2515; /**< Reference to MCP2515 for sending CAN messages */
36 CarState &car; /**< Reference to CarState */
37};
38#endif // TELEMETRY_HPP
Definition of the CarState structure representing the state of the car.
Telemetry class for managing telemetry data transmission over CAN bus Grabs and sends telemetry frame...
Definition: Telemetry.hpp:27
void sendMotor()
Internal helper to get and send the motor telemetry frame.
Definition: Telemetry.cpp:34
CarState & car
Definition: Telemetry.hpp:36
void sendPedal()
Internal helper to get and send the Pedal telemetry frame.
Definition: Telemetry.cpp:25
void sendBms()
Internal helper to get and send the BMS telemetry frame.
Definition: Telemetry.cpp:43
MCP2515 & mcp2515
Definition: Telemetry.hpp:35
Represents the state of the car. Holds telemetry data and status, used as central data sharing struct...
Definition: CarState.hpp:158