#include <XPort.h>
The XPort has a serial port and a number of GPIO pins that may be configured as inputs or outputs, active high or low. XPort configuration and control is done via a TCP/IP socket connections. XPortConnection is used to store and manage these TCP/IP socket connections.
Public Member Functions | |
| XPortConnection () | |
| Default no argument constructor. | |
| XPortConnection (char *host, unsigned int gPort, unsigned int sPort, unsigned int dMask, unsigned int dValues, unsigned int lMask, unsigned int lValues) | |
| Initializing constructor. | |
| int | configAll (char *host, unsigned int serialIPPort, unsigned int gpioIPPort, unsigned int dirMask, unsigned int dirValues, unsigned int levelMask, unsigned int levelValues) |
| Configure all connection parameters. | |
| int | configHost (char *hostName) |
| Configure host TCP/IP address. | |
| int | configGPIO (int gpioIPPort, unsigned int dirMask, unsigned int dirValues, unsigned int levelMask, unsigned int levelValues) |
| Configure GPIO connection parameters. | |
| int | configSerial (int serialIPPort) |
| Configure serial TCP/IP port parameters. | |
| void | setsdGPIO (int sd) |
| Set GPIO socket descriptor. | |
| void | setsdSerial (int sd) |
| Set serial socket descriptor. | |
| char * | getHost () |
| |
| unsigned int | getpGPIO () |
| |
| unsigned int | getpSerial () |
| |
| int | getsdGPIO () |
| |
| int | getsdSerial () |
| |
| unsigned int | getDirMask () |
| |
| unsigned int | getDirValues () |
| |
| unsigned int | getLevelMask () |
| |
| unsigned int | getLevelValues () |
| |
Private Attributes | |
| char * | host |
| XPort TCP/IP host name/address string. | |
| int | gpioPort |
| XPort GPIO TCP/IP port. | |
| int | serialPort |
| XPort Serial TCP/IP port. | |
| unsigned int | dirMask |
| XPort GPIO direction control mask. | |
| unsigned int | levelMask |
| XPort GPIO level control mask. | |
| unsigned int | dirValues |
| XPort GPIO direction values (state) mask. | |
| unsigned int | levelValues |
| XPort GPIO level values (state) mask. | |
| int | sdGPIO |
| XPort GPIO TCP/IP socket descriptor. | |
| int | sdSERIAL |
| XPort Serial TCP/IP socket descriptor. | |
Friends | |
| ostream & | operator<< (ostream &output, const XPortConnection &n) |
| output stream operator. | |
| XPortConnection::XPortConnection | ( | ) |
Default no argument constructor.
| XPortConnection::XPortConnection | ( | char * | host, | |
| unsigned int | gpioIPPort, | |||
| unsigned int | serialIPPort, | |||
| unsigned int | dirMask, | |||
| unsigned int | dirValues, | |||
| unsigned int | levelMask, | |||
| unsigned int | levelValues | |||
| ) |
Initializing constructor.
| host | XPort host name | |
| gpioIPPort | TCP/IP port to use for GPIO | |
| serialIPPort | TCP/IP port to use for serial IO | |
| dirMask | GPIO direction pin-select mask | |
| dirValues | GPIO initial direction values mask | |
| levelMask | GPIO level pin-select mask | |
| levelValues | GPIO initial level (state) values mask |
| int XPortConnection::configAll | ( | char * | host, | |
| unsigned int | gpioIPPort, | |||
| unsigned int | serialIPPort, | |||
| unsigned int | dirMask, | |||
| unsigned int | dirValues, | |||
| unsigned int | levelMask, | |||
| unsigned int | levelValues | |||
| ) |
Configure all connection parameters.
| host | XPort host name | |
| gpioIPPort | TCP/IP port to use for GPIO | |
| serialIPPort | TCP/IP port to use for serial IO | |
| dirMask | GPIO direction pin-select mask | |
| dirValues | GPIO initial direction values mask | |
| levelMask | GPIO level pin-select mask | |
| levelValues | GPIO initial level (state) values mask |
| int XPortConnection::configHost | ( | char * | hostName | ) |
| int XPortConnection::configGPIO | ( | int | gPort, | |
| unsigned int | dMask, | |||
| unsigned int | dValues, | |||
| unsigned int | lMask, | |||
| unsigned int | lValues | |||
| ) |
Configure GPIO connection parameters.
| gPort | TCP/IP port to use for GPIO | |
| dMask | GPIO direction pin-select mask | |
| dValues | GPIO initial direction values mask | |
| lMask | GPIO level pin-select mask | |
| lValues | GPIO initial level (state) values mask |
| int XPortConnection::configSerial | ( | int | sPort | ) |
Configure serial TCP/IP port parameters.
| sPort | TCP/IP port to use for serial IO |
| void XPortConnection::setsdGPIO | ( | int | sd | ) |
Set GPIO socket descriptor.
| sd | socket descriptor |
| void XPortConnection::setsdSerial | ( | int | sd | ) |
Set serial socket descriptor.
| sd | socket descriptor |
| ostream& operator<< | ( | ostream & | output, | |
| const XPortConnection & | n | |||
| ) | [friend] |
output stream operator.
Formats object for output stream insertion
| output | output stream handle | |
| n | Field object pointer |
1.5.4