PL::HardwareInterface class

class HardwareInterface : public virtual PL::Lockable

Hardware interface class.

Subclassed by PL::NetworkInterface, PL::Uart

Public Functions

HardwareInterface()

Creates a hardware interface.

virtual esp_err_t Initialize() = 0

Initializes the hardware interface.

Returns:

error code

virtual esp_err_t Enable() = 0

Enables the hardware interface.

Returns:

error code

virtual esp_err_t Disable() = 0

Disables the hardware interface.

Returns:

error code

virtual bool IsEnabled() = 0

Checks if the hardware interface is enabled.

Returns:

true if the hardware interface is enabled

std::string GetName()

Gets the hardware interface name.

Returns:

name

void SetName(const std::string &name)

Sets the hardware interface name.

Parameters:

name

virtual esp_err_t Lock(TickType_t timeout = portMAX_DELAY) = 0

Locks the object.

Parameters:

timeout – timeout in FreeRTOS ticks

Returns:

error code

virtual esp_err_t Unlock() = 0

Unlocks the object.

Returns:

error code

Public Members

Event<HardwareInterface> enabledEvent

hardware interface enabled event

Event<HardwareInterface> disabledEvent

hardware interface disabled event