Easyuino
1.2.0
|
RelayNamed offers the same API of the Relay plus the possibility to associate a string label to the API object. More...
#include <RelayNamed.h>
Public Member Functions | |
RelayNamed (IN uint8_t arduinoPin, IN const char *deviceName) | |
Constructor. More... | |
char * | toString () const |
Used to return a string representation of the object state. More... | |
![]() | |
Relay (IN uint8_t arduinoPin) | |
Constructor. More... | |
~Relay () | |
Destructor. | |
bool | begin () |
Used to put the device ready to receive requests. More... | |
bool | begin (IN bool isNormallyClosed, IN uint8_t normallyClosedPinLevel) |
Used to initialize the relay API depending on how the relay will be connected. More... | |
void | end () |
Used to stop the device API. More... | |
void | turnOn () |
Turns on the device that is connected to the relay (depends on how the begin(bool,uint8_t) was called) | |
void | turnOff () |
Turns off the device that is connected to the relay (depends on how the begin(bool,uint8_t) was called) | |
bool | isOn () const |
![]() | |
Device () | |
Constructor called by every sub-classes. | |
~Device () | |
Destroy all the resources associated with the device. | |
bool | isInitialized () const |
Verify is the device is initialized and ready to use. More... | |
Additional Inherited Members | |
![]() | |
bool | _isInitialized |
Used to know if the device API is initialized and ready to receive requests. | |
RelayNamed offers the same API of the Relay plus the possibility to associate a string label to the API object.
Easyuino::RelayNamed::RelayNamed | ( | IN uint8_t | arduinoPin, |
IN const char * | deviceName | ||
) |
Constructor.
arduinoPin | Arduino pin that is connected with the relay (normal in relay is IN pins) |
deviceName | Name (identifier) of the device that the relay activates/deactivates |
|
virtual |
Used to return a string representation of the object state.
IMPORTANT: It is mandatory to free the returned pointer in order to have no memory leaks.
Implements Easyuino::Printable.