Easyuino  1.2.0
Easyuino::RelayNamed Class Reference

RelayNamed offers the same API of the Relay plus the possibility to associate a string label to the API object. More...

#include <RelayNamed.h>

Inheritance diagram for Easyuino::RelayNamed:
Easyuino::Relay Easyuino::Printable Easyuino::Device

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...
 
- Public Member Functions inherited from Easyuino::Relay
 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
 
- Public Member Functions inherited from Easyuino::Device
 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

- Protected Attributes inherited from Easyuino::Device
bool _isInitialized
 Used to know if the device API is initialized and ready to receive requests.
 

Detailed Description

RelayNamed offers the same API of the Relay plus the possibility to associate a string label to the API object.

See also
Devices Supported: SRD-05VDC-SL-C, Probably any relay because they are very simple devices
Devices Tested: SRD-05VDC-SL-C

Constructor & Destructor Documentation

◆ RelayNamed()

Easyuino::RelayNamed::RelayNamed ( IN uint8_t  arduinoPin,
IN const char *  deviceName 
)

Constructor.

Parameters
arduinoPinArduino pin that is connected with the relay (normal in relay is IN pins)
deviceNameName (identifier) of the device that the relay activates/deactivates

Member Function Documentation

◆ toString()

char* Easyuino::RelayNamed::toString ( ) const
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.


The documentation for this class was generated from the following file: