Roboid Control for C++
Loading...
Searching...
No Matches
DigitalSensor.h
1#pragma once
2
3#include "Thing.h"
4
5namespace RoboidControl {
6
8class DigitalSensor : public Thing {
9 public:
16 DigitalSensor(Participant* owner, unsigned char thingId = 0);
21 DigitalSensor(Thing* parent, unsigned char thingId = 0);
22
24 bool state = 0;
25
29 int GenerateBinary(char* bytes, unsigned char* ix) override;
33 virtual void ProcessBinary(char* bytes) override;
34};
35
36} // namespace RoboidControl
A digital (on/off, 1/0, true/false) sensor.
Definition DigitalSensor.h:8
DigitalSensor()
Create a digital sensor without communication abilities.
Definition DigitalSensor.cpp:5
virtual void ProcessBinary(char *bytes) override
Function used to process binary data received for this digital sensor.
Definition DigitalSensor.cpp:18
int GenerateBinary(char *bytes, unsigned char *ix) override
Function used to generate binary data for this digital sensor.
Definition DigitalSensor.cpp:13
bool state
The sigital state.
Definition DigitalSensor.h:24
A participant is a device which manages things. It can communicate with other participant to synchron...
Definition Participant.h:52
A thing is the primitive building block.
Definition Thing.h:20
Participant * owner
The participant managing this thing.
Definition Thing.h:74