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

Interface for receiving arm events. More...

#include <ArmEventListener.h>

Public Member Functions

virtual ~ArmEventListener ()=default
virtual void onArmComplete (uint16_t id, ArmSide side)
 Called when an arm command completes successfully.
virtual void onArmError (uint16_t id, ArmSide side, ArmErrorType errorType)
 Called when an arm command ends with an error.
virtual void onArmStateChange (ArmSide side, ArmState state)
 Called when the arm state changes.
virtual void onArmMovement (ArmSide side, float degreeChange)
 Called to report incremental motion events.

Detailed Description

Interface for receiving arm events.

Implement this interface and register it using ArmEvent::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 (not the caller thread). Keep handlers fast and avoid blocking.
The listener object must remain valid until it is removed via ArmEvent::RemoveListener().

Constructor & Destructor Documentation

◆ ~ArmEventListener()

virtual ArmEventListener::~ArmEventListener ( )
virtualdefault

Member Function Documentation

◆ onArmComplete()

virtual void ArmEventListener::onArmComplete ( uint16_t id,
ArmSide side )
virtual

Called when an arm command completes successfully.

Parameters
idCommand identifier passed to ArmControl::setAngle().
sideArm side for which the command completed.

◆ onArmError()

virtual void ArmEventListener::onArmError ( uint16_t id,
ArmSide side,
ArmErrorType errorType )
virtual

Called when an arm command ends with an error.

Parameters
idCommand identifier passed to ArmControl::setAngle().
sideArm side on which the error occurred.
errorTypeCategory of error.

◆ onArmMovement()

virtual void ArmEventListener::onArmMovement ( ArmSide side,
float degreeChange )
virtual

Called to report incremental motion events.

This is commonly used for “movement happened” notifications even when there is no active RUNNING command.

Parameters
sideArm side that moved.
degreeChangeSigned delta angle (degrees) since last notification.

◆ onArmStateChange()

virtual void ArmEventListener::onArmStateChange ( ArmSide side,
ArmState state )
virtual

Called when the arm state changes.

Parameters
sideArm side that changed state.
stateNew state.

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