The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

Device::Firmata::IO::NetIO - TCP/IP server interface to Firmata device

METHODS

listen ( host, port, [opts] )

Start a TCP server bound to given local address and port for the Firmata device to connect to. Returns a Device::Firmata::IO::NetIO object. Typically called by method listen of Device::Firmata. An implementation example can be found in file examples/example-tcpserver.pl.

accept ( timeout )

Wait until timeout seconds for an Firmata device to connect. Returns a Device::Firmata::Platform object on success or undef. An implementation example can be found in file examples/example-tcpserver.pl.

close ( )

Closes the TCP server socket and disconnects all Firmata devices. An implementation example can be found in file examples/example-tcpserver.pl.

attach ( connectedSocket, [opts] )

Assign a connected IO::Socket::INET as IO port and return a Device::Firmata::Platform object. Typically used internally by the accept() method.

poll ( timeout )

Wait for timeout seconds for data from Firmata devices. If data is received the method poll of Device::Firmata::Platform will be called for processing. An implementation example can be found in file examples/example-tcpserver.pl.

Device::Firmata::IO::NetIO::Client

Implements the low level TCP/IP client socket IO.

METHODS

attach ( connectedSocket, [opts] )

Assign a connected IO::Socket::INET as IO port and return a Device::Firmata::IO::NetIO::Client object. Typically used internally by the attach() method of Device::Firmata::IO::NetIO.

data_write ( buffer )

Send a bunch of data to the Firmata device. Typically used internally by Device::Firmata::Platform.

data_read ( numBytes )

Fetch up to given number of bytes from the client socket. This function is non-blocking. Returns the received data. Typically used internally by Device::Firmata::Platform.

close ( )

Close the TCP client socket to the Firmata device. The listening socket will not be affected. Typically used internally by Device::Firmata::Platform and Device::Firmata::IO::NetIO.

SEE ALSO

"Device::Firmata::listen ( host, port, [opts] )" and "Device::Firmata::Platform::attach ( ioPort )"