Interface for receiving drive events.
More...
#include <DriveEventListener.h>
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().
◆ ~DriveEventListener()
| virtual DriveEventListener::~DriveEventListener |
( |
| ) |
|
|
virtualdefault |
◆ onDriveComplete()
| virtual void DriveEventListener::onDriveComplete |
( |
std::uint16_t | id | ) |
|
|
virtual |
Called when a drive command completes successfully.
- Parameters
-
| id | Identifier of the drive operation (provided by the caller). |
◆ onDriveError()
Called when a drive operation reports an error.
- Parameters
-
| id | Identifier of the drive operation. |
| side | Which motor side the error occurred on. |
| type | Error classification. |
◆ onDriveStateChange()
Called when the state of a drive operation changes.
- Parameters
-
| driveType | The kind of drive operation. |
| state | New state. |
The documentation for this class was generated from the following file: