4316f15fe70f1e08296c11b9a13fa1d6010fa7de
[apps/agl-service-can-low-level.git] / examples / basic / handlers.cpp
1 #include "can/canread.h"
2
3 using openxc::can::read::publishNumericalMessage;
4
5 void handleSteeringWheelMessage(CanMessage* message,
6         CanSignal* signals, int signalCount, Pipeline* pipeline) {
7     publishNumericalMessage("latitude", 42.0, pipeline);
8 }
9
10 openxc_DynamicField handleInverted(CanSignal* signal, CanSignal* signals,
11         int signalCount, float value, bool* send) {
12     return openxc::payload::wrapNumber(value * -1);
13 }
14
15 void initializeMyStuff() { }
16
17 void initializeOtherStuff() { }
18
19 void myLooper() {
20     // this function will be called once each time through the main loop, after
21     // all CAN message processing has been completed
22 }