Doly C++ SDK v1.00
Loading...
Searching...
No Matches
DriveEventListener Class Reference

Interface for receiving drive events. More...

#include <DriveEventListener.h>

Public Member Functions

virtual ~DriveEventListener ()=default
virtual void onDriveComplete (std::uint16_t id)
 Called when a drive command completes successfully.
virtual void onDriveError (std::uint16_t id, DriveMotorSide side, DriveErrorType type)
 Called when a drive operation reports an error.
virtual void onDriveStateChange (DriveType driveType, DriveState state)
 Called when the state of a drive operation changes.

Detailed Description

Interface for receiving drive events.

Implement this interface and register it using DriveEvent::AddListener().

Note
Default implementations are no-ops, so you may override only what you need.
Warning
Callbacks are typically invoked from an internal worker/event thread. Keep handlers fast and avoid blocking.
The listener object must remain valid until it is removed via DriveEvent::RemoveListener().

Constructor & Destructor Documentation

◆ ~DriveEventListener()

virtual DriveEventListener::~DriveEventListener ( )
virtualdefault

Member Function Documentation

◆ onDriveComplete()

virtual void DriveEventListener::onDriveComplete ( std::uint16_t id)
virtual

Called when a drive command completes successfully.

Parameters
idIdentifier of the drive operation (provided by the caller).

◆ onDriveError()

virtual void DriveEventListener::onDriveError ( std::uint16_t id,
DriveMotorSide side,
DriveErrorType type )
virtual

Called when a drive operation reports an error.

Parameters
idIdentifier of the drive operation.
sideWhich motor side the error occurred on.
typeError classification.

◆ onDriveStateChange()

virtual void DriveEventListener::onDriveStateChange ( DriveType driveType,
DriveState state )
virtual

Called when the state of a drive operation changes.

Parameters
driveTypeThe kind of drive operation.
stateNew state.

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