See: Description
| Interface | Description |
|---|---|
| UserActionListener |
An object to be notified when an user action has been received in a protocol message.
|
| Class | Description |
|---|---|
| DecodedControlAction |
An immutable and pure data class that represents an action decoded from a protocol
data message.
|
| NxtARControlProtocol |
A wrapper around the NxtAR robot control protocol for the LejOS operating system.
|
| Enum | Description |
|---|---|
| DecodedControlAction.Action |
All recognized actions.
|
| DecodedControlAction.Motor |
All motor ports and possible combinations without repetitions.
|
This package contains a wrapper library and reference implementation of the NxtAR robot control protocol for the LejOS operating system.
The protocol is based on 2 byte long data messages that encode a set of motor ports, actions on those motors and the speed of the motors. The first byte encodes a set actions and motors, while the second byte contains an integer number representing the speed to set to the enabled motors. The first byte's bits encode the following data (from least significant to most significant bit):
This bits are decoded using the binary masks defined in NxtARControlProtocol.
This mechanism allows to set the state or execute an action on multiple motors simultaneously. The user actions are
executed using callback objects registered with the aforementioned class.
The NxtARControlProtocol class includes methods to
read, decode and execute a protocol message, independently of how those messages are generated. An example
would be messages read from a Bluetooth or USB stream, as well as messages generated by the application
that is using the library.