#include <XPort.h>
Command format: byte 0 : command byte 1-4 : control mask indicating which GPIO pins to affect byte 5-8 : value mask indicating value to set
Public Member Functions | |
| XPortCommand () | |
| Default no argument constructor. | |
| XPortCommand (unsigned char cmd, unsigned int p1, unsigned int p2) | |
| Initializing constructor. | |
| void | set (unsigned char cmd, unsigned int param1, unsigned int param2) |
| Set XPort GPIO command parameters. | |
| int | validate () |
| Validate command parameters. | |
| int | parse (const char *command) |
| Populate this XPCommand from a (binary) byte array. | |
| void | show () |
| Format XPort command and print to console. | |
| unsigned char | getCommand () |
| |
| unsigned int | getP1 () |
| |
| unsigned int | getP2 () |
| |
| char * | toBytes (char *buf) |
| Writes XPort GPIO command bytes to specified buffer. | |
Private Attributes | |
| unsigned char | command |
| GPIO command. | |
| unsigned int | param1 |
| GPIO control mask. | |
| unsigned int | param2 |
| GPIO value mask. | |
Friends | |
| ostream & | operator<< (ostream &output, const XPortCommand &n) |
| output stream operator. | |
| XPortCommand::XPortCommand | ( | ) |
Default no argument constructor.
| XPortCommand::XPortCommand | ( | unsigned char | cmd, | |
| unsigned int | p1, | |||
| unsigned int | p2 | |||
| ) |
Initializing constructor.
Sets XPort GPIO command parameters.
| cmd | Command byte | |
| p1 | control mask | |
| p2 | value mask |
| void XPortCommand::set | ( | unsigned char | cmd, | |
| unsigned int | p1, | |||
| unsigned int | p2 | |||
| ) |
Set XPort GPIO command parameters.
| cmd | Command byte | |
| p1 | control mask | |
| p2 | value mask |
| int XPortCommand::validate | ( | ) |
Validate command parameters.
Performs range checking on all parameters.
| int XPortCommand::parse | ( | const char * | cmd | ) |
Populate this XPCommand from a (binary) byte array.
| cmd | Byte buffer containing command bytes |
| void XPortCommand::show | ( | ) |
| char * XPortCommand::toBytes | ( | char * | buf | ) |
Writes XPort GPIO command bytes to specified buffer.
| buf | Byte buffer |
| ostream& operator<< | ( | ostream & | output, | |
| const XPortCommand & | n | |||
| ) | [friend] |
output stream operator.
Formats object for output stream insertion
| output | output stream handle | |
| n | XPortCommand object pointer |
1.5.4