#include <FakeDigitalDevice.hpp>
Public Member Functions | |
virtual bool | checkBit (unsigned int n) const |
virtual unsigned int | checkSequence (unsigned int start_bit, unsigned int stop_bit) const |
FakeDigitalDevice (unsigned int channels=32) | |
virtual bool | isOff (unsigned int bit=0) const |
virtual bool | isOn (unsigned int bit=0) const |
virtual unsigned int | nbOfInputs () const |
virtual unsigned int | nbOfOutputs () const |
virtual bool | readBit (unsigned int bit=0) const |
virtual unsigned int | readSequence (unsigned int start_bit, unsigned int stop_bit) const |
virtual void | setBit (unsigned int bit, bool value) |
virtual void | setSequence (unsigned int start_bit, unsigned int stop_bit, unsigned int value) |
virtual void | switchOff (unsigned int n) |
virtual void | switchOn (unsigned int n) |
Public Attributes | |
std::vector< bool > | mchannels |
A Fake (Simulated) Digital Input/Output Device which replicates the inputs on its outputs.
Definition at line 42 of file FakeDigitalDevice.hpp.
RTT::FakeDigitalDevice::FakeDigitalDevice | ( | unsigned int | channels = 32 | ) | [inline] |
Definition at line 49 of file FakeDigitalDevice.hpp.
virtual bool RTT::FakeDigitalDevice::checkBit | ( | unsigned int | n | ) | const [inline, virtual] |
Returns the status of bit n, starting from zero.
Implements RTT::dev::DigitalOutInterface.
Definition at line 80 of file FakeDigitalDevice.hpp.
virtual unsigned int RTT::FakeDigitalDevice::checkSequence | ( | unsigned int | start_bit, |
unsigned int | stop_bit | ||
) | const [inline, virtual] |
Returns the sequence of bits between start_bit and stop_bit inclusive, where start_bit occurs at position zero in the returned result.
Implements RTT::dev::DigitalOutInterface.
Definition at line 88 of file FakeDigitalDevice.hpp.
virtual bool RTT::FakeDigitalDevice::isOff | ( | unsigned int | bit = 0 | ) | const [inline, virtual] |
Inspect if a certain bit is on.
bit | The bit to check, starting from zero. |
Implements RTT::dev::DigitalInInterface.
Definition at line 114 of file FakeDigitalDevice.hpp.
virtual bool RTT::FakeDigitalDevice::isOn | ( | unsigned int | bit = 0 | ) | const [inline, virtual] |
Inspect if a certain bit is on.
bit | The bit to check, starting from zero. |
Implements RTT::dev::DigitalInInterface.
Definition at line 107 of file FakeDigitalDevice.hpp.
virtual unsigned int RTT::FakeDigitalDevice::nbOfInputs | ( | ) | const [inline, virtual] |
Returns the number of bits that can be read for digital input.
Implements RTT::dev::DigitalInInterface.
Definition at line 102 of file FakeDigitalDevice.hpp.
virtual unsigned int RTT::FakeDigitalDevice::nbOfOutputs | ( | ) | const [inline, virtual] |
Query the number of outputs of this card
Implements RTT::dev::DigitalOutInterface.
Definition at line 97 of file FakeDigitalDevice.hpp.
virtual bool RTT::FakeDigitalDevice::readBit | ( | unsigned int | bit = 0 | ) | const [inline, virtual] |
Inspect a bit.
bit | The bit to check, starting from zero. |
Implements RTT::dev::DigitalInInterface.
Definition at line 121 of file FakeDigitalDevice.hpp.
virtual unsigned int RTT::FakeDigitalDevice::readSequence | ( | unsigned int | start_bit, |
unsigned int | stop_bit | ||
) | const [inline, virtual] |
Inspect a sequence of bits.
start_bit | The first bit to check. |
stop_bit | The last bit (inclusive) to check. |
Implements RTT::dev::DigitalInInterface.
Definition at line 128 of file FakeDigitalDevice.hpp.
virtual void RTT::FakeDigitalDevice::setBit | ( | unsigned int | bit, |
bool | value | ||
) | [inline, virtual] |
Sets the n'th output to value
Implements RTT::dev::DigitalOutInterface.
Definition at line 67 of file FakeDigitalDevice.hpp.
virtual void RTT::FakeDigitalDevice::setSequence | ( | unsigned int | start_bit, |
unsigned int | stop_bit, | ||
unsigned int | value | ||
) | [inline, virtual] |
Sets a sequence of bits to pattern value between start_bit and stop_bit inclusive. For example, setSequence(3, 3, 1) is equivalent to setBit(3, 1).
Implements RTT::dev::DigitalOutInterface.
Definition at line 73 of file FakeDigitalDevice.hpp.
virtual void RTT::FakeDigitalDevice::switchOff | ( | unsigned int | n | ) | [inline, virtual] |
Sets the n'th output off
n | The number of the output to be switched off. The first output is number 0. |
Implements RTT::dev::DigitalOutInterface.
Definition at line 61 of file FakeDigitalDevice.hpp.
virtual void RTT::FakeDigitalDevice::switchOn | ( | unsigned int | n | ) | [inline, virtual] |
Sets the n'th output on
n | The number of the output to be switched on. The first output is number 0. |
Implements RTT::dev::DigitalOutInterface.
Definition at line 55 of file FakeDigitalDevice.hpp.
std::vector<bool> RTT::FakeDigitalDevice::mchannels |
Definition at line 47 of file FakeDigitalDevice.hpp.