.portstate Property

Function:

Sets/returns the state of the currently selected I/O port (selection is made through the io.portnum property).

Type:

Byte

Value Range:

0-255. The default value is hardware-dependent.

See Also:

Line/Port Manipulation With Preselection, io.portenabled


Details

Each I/O port groups eight I/O lines. Each bit of this property's byte value corresponds to one "member" I/O line.


Exception Safety

There are a few situations in which an exception may be thrown when getting or setting this property. For more information, see Handling Exceptions.


Getting the Property

Exception

Root Cause(s)

std::invalid_argument

  • The selected I/O port number is invalid.
  • An I/O line number of the selected port number is invalid.

std::system_error

There was an error reading the value of an I/O line of the selected port.


Setting the Property

Exception

Root Cause(s)

std::invalid_argument

  • The selected I/O port number is invalid.
  • An I/O line number of the selected port number is invalid.

std::system_error

The state of an I/O line of the selected port cannot be set because it is currently in use.


.portstate Property

Details

Exception Safety

Getting the Property

Setting the Property