Low-Level C++ SDK  v1.2.0
Loading...
Searching...
No Matches
WeArtAnalogSensorData.h
Go to the documentation of this file.
1
5#pragma once
6
7#include "WeArtCommon.h"
9#include "WeArtMessages.h"
10#include <queue>
11
12
14{
15public:
19 WeArtAnalogSensorData(HandSide handSide, ActuationPoint actuationPoint);
20
22 struct Sample {
24 std::uint64_t timestamp;
27 };
28
32
35 void AddSampleCallback(std::function<void(Sample)> callback);
36
38 void OnMessageReceived(WeArtMessage* msg) override;
39
40private:
41 HandSide handSide;
42 ActuationPoint actuationPoint;
43
44 Sample lastSample;
45 std::vector<std::function<void(Sample)>> callbacks;
46};
47
HandSide
Definition: WeArtCommon.h:17
Definition: WeArtAnalogSensorData.h:14
Sample GetLastSample()
Get the last sample received.
Definition: WeArtAnalogSensorData.cpp:16
void AddSampleCallback(std::function< void(Sample)> callback)
Adds a callback called whenever a new sample is received.
Definition: WeArtAnalogSensorData.cpp:20
void OnMessageReceived(WeArtMessage *msg) override
Callback called when an accepted message is received.
Definition: WeArtAnalogSensorData.cpp:24
Message Listener basic interface.
Definition: WeArtMessageListener.h:9
Definition: WeArtCommon.h:130
Sensor data sample.
Definition: WeArtAnalogSensorData.h:22
AnalogSensorRawData data
Sampled sensor data.
Definition: WeArtAnalogSensorData.h:26
std::uint64_t timestamp
Timestamp when the sample was created (in milliseconds unix epoch time)
Definition: WeArtAnalogSensorData.h:24