RoboidControl-cpp/Sensors/TouchSensor.h
2025-02-24 12:54:06 +01:00

30 lines
1.0 KiB
C++

#pragma once
#include "Thing.h"
namespace RoboidControl {
/// @brief A sensor which can detect touches
class TouchSensor : public Thing {
public:
/// @brief Value which is true when the sensor is touching something, false otherwise
bool touchedSomething = false;
/// @brief Create a touch sensor
TouchSensor(RemoteParticipant* participant);
/// @brief Create a temperature sensor with the given ID
/// @param networkId The network ID of the sensor
/// @param thingId The ID of the thing
// TouchSensor(RemoteParticipant* participant, unsigned char networkId, unsigned char thingId);
/// @brief Function to create a binary message with the temperature
/// @param buffer The byte array for thw binary data
/// @param ix The starting position for writing the binary data
void GenerateBinary(char* bytes, unsigned char* ix) override;
/// @brief Function to extract the temperature received in the binary message
/// @param bytes The binary data
virtual void ProcessBinary(char* bytes) override;
};
} // namespace RoboidControl