#include <XPort.h>
Response format:
Public Member Functions | |
| XPortResponse () | |
| Default no argument constructor. | |
| XPortResponse (unsigned char cmd, unsigned int p1) | |
| Initializing constructor. | |
| void | set (unsigned char cmd, unsigned int param1) |
| Set XPort GPIO response parameters. | |
| int | validate () |
| Validate response parameters. | |
| int | parse (char *response) |
| Populate this XPResponse from a (binary) byte array. | |
| void | show () |
| Format XPort response and print to console. | |
| unsigned char | getCommand () |
| |
| unsigned int | getP1 () |
| |
| char * | toBytes (char *buf) |
| Writes XPort GPIO response bytes to specified buffer. | |
Private Attributes | |
| unsigned char | command |
| GPIO command (see defined constants XPCMD_. | |
| unsigned int | param1 |
| GPIO return value. | |
Friends | |
| ostream & | operator<< (ostream &output, const XPortResponse &n) |
| output stream operator. | |
| XPortResponse::XPortResponse | ( | ) |
Default no argument constructor.
| XPortResponse::XPortResponse | ( | unsigned char | cmd, | |
| unsigned int | p1 | |||
| ) |
Initializing constructor.
Sets XPort GPIO response parameters.
| cmd | Command byte | |
| p1 | control mask |
| void XPortResponse::set | ( | unsigned char | cmd, | |
| unsigned int | p1 | |||
| ) |
Set XPort GPIO response parameters.
| cmd | Command byte | |
| p1 | control mask |
| int XPortResponse::validate | ( | ) |
Validate response parameters.
Performs range checking on all parameters.
| int XPortResponse::parse | ( | char * | response | ) |
Populate this XPResponse from a (binary) byte array.
| response | Byte buffer containing response bytes |
| void XPortResponse::show | ( | ) |
| char * XPortResponse::toBytes | ( | char * | buf | ) |
Writes XPort GPIO response bytes to specified buffer.
| buf | Byte buffer |
| ostream& operator<< | ( | ostream & | output, | |
| const XPortResponse & | n | |||
| ) | [friend] |
output stream operator.
Formats object for output stream insertion
| output | output stream handle | |
| n | XPortResponse object pointer |
unsigned char XPortResponse::command [private] |
GPIO command (see defined constants XPCMD_.
..)
1.5.4