Kangaroo Library for Arduino
Use reliable Packet Serial to communicate with your Kangaroo.
Public Member Functions | List of all members
KangarooMonitor Class Reference

Makes it easy to track the status of position commands, speed commands, and any other commands that take time to complete. More...

Public Member Functions

KangarooStatus status () const
 
boolean valid () const
 
KangarooMonitor update ()
 
KangarooMonitor update (int32_t timeoutMS)
 
KangarooMonitor update (const KangarooTimeout &timeout)
 
KangarooMonitor wait (int32_t timeoutMS=KANGAROO_INFINITE_TIMEOUT)
 
KangarooMonitor wait (const KangarooTimeout &timeout)
 

Detailed Description

Makes it easy to track the status of position commands, speed commands, and any other commands that take time to complete.

Member Function Documentation

KangarooStatus KangarooMonitor::status ( ) const

Gets the most recently received status.

Returns
A KangarooStatus.
KangarooMonitor KangarooMonitor::update ( )

Updates the status. The channel's command timeout is used.

Returns
The same KangarooMonitor.
KangarooMonitor KangarooMonitor::update ( int32_t  timeoutMS)

Updates the status.

Parameters
timeoutMSThe timeout to use, in milliseconds.
Returns
The same KangarooMonitor.
KangarooMonitor KangarooMonitor::update ( const KangarooTimeout timeout)

Updates the status.

Parameters
timeoutThe timeout object to use.
Returns
The same KangarooMonitor.
boolean KangarooMonitor::valid ( ) const

Gets whether the status is valid. If you keep an old KangarooMonitor object around and issue a new command on the same channel, the old KangarooMonitor will become invalid.

Returns
True if the status is valid.
KangarooMonitor KangarooMonitor::wait ( int32_t  timeoutMS = KANGAROO_INFINITE_TIMEOUT)

Waits until KangarooStatus::done() returns true or the timeout expires.

Parameters
timeoutMSThe timeout to use, in milliseconds.
Returns
The same KangarooMonitor.
KangarooMonitor KangarooMonitor::wait ( const KangarooTimeout timeout)

Waits until KangarooStatus::done() returns true or the timeout object expires.

Parameters
timeoutThe timeout object to use.
Returns
The same KangarooMonitor.