1 #include "configuration.hpp"
2 #include "can/can-decoder.hpp"
5 // >>>>> handlers.cpp >>>>>
6 #include "can/canread.h"
8 using openxc::can::read::publishNumericalMessage;
10 void handleSteeringWheelMessage(CanMessage* message,
11 CanSignal* signals, int signalCount, Pipeline* pipeline) {
12 publishNumericalMessage("latitude", 42.0, pipeline);
15 openxc_DynamicField handleInverted(CanSignal* signal, CanSignal* signals,
16 int signalCount, float value, bool* send) {
17 return openxc::payload::wrapNumber(value * -1);
20 void initializeMyStuff() { }
22 void initializeOtherStuff() { }
25 // this function will be called once each time through the main loop, after
26 // all CAN message processing has been completed
29 // <<<<< handlers.cpp <<<<<
31 configuration_t::configuration_t()
32 : can_message_set_{0, "example", 2, 2, 7, 1, 3}
33 , can_message_definition_
36 can_message_definition_t(0, "can0", 0x128, can_message_format_t::STANDARD, frequency_clock_t(0.00000f), true),
37 can_message_definition_t(0, "can0", 0x813, can_message_format_t::STANDARD, frequency_clock_t(0.00000f), true)
53 frequency_clock_t(15.0000f),
73 frequency_clock_t(0.00000f),
99 frequency_clock_t(0.00000f),
105 handleUnsignedSteeringWheelAngle,
112 "steering_wheel_angle_error",
119 frequency_clock_t(0.00000f),
132 "steering_angle_sign",
139 frequency_clock_t(0.00000f),
161 frequency_clock_t(0.00000f),
167 handleUnsignedSteeringWheelAngle,
181 frequency_clock_t(0.00000f),
187 decoder_t::ignoreDecoder,
193 //, obd2_signals_{/*...*/}