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 internally by "listen ( host, port, [opts] )" in 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. Will call "attach ( connectedSocket, [opts] )" in Device::Firmata::IO::NetIO on connect. Returns a Device::Firmata::Platform object on success or undef on error. 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 socket as I/O port, call "probe ( )" in Device::Firmata::Platform and return a Device::Firmata::Platform object. Typically used internally by the "accept ( timeout )" in Device::Firmata::IO::NetIO method.

poll ( timeout )

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

NAME

Device::Firmata::IO::NetIO::Client - I/O operations on TCP/IP client session

METHODS

attach ( connectedSocket, [opts] )

Assign a connected IO::Socket::INET as I/O port and return a Device::Firmata::IO::NetIO::Client object. Typically used internally by "attach ( connectedSocket, [opts] )" in Device::Firmata::IO::NetIO.

data_write ( buffer )

Send a bunch of data to the Firmata device. Returns number of transmitted bytes. 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

"attach ( ioPort )" in Device::Firmata::Platform