Device::Firmata::IO::NetIO - TCP/IP server interface to Firmata device
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.
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.
undef
Closes the TCP server socket and disconnects all Firmata devices. An implementation example can be found in file examples/example-tcpserver.pl.
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.
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.
Device::Firmata::IO::NetIO::Client - I/O operations on TCP/IP client session
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.
Send a bunch of data to the Firmata device. Returns number of transmitted bytes. Typically used internally by Device::Firmata::Platform.
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 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.
"attach ( ioPort )" in Device::Firmata::Platform
To install Device::Firmata, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Firmata
CPAN shell
perl -MCPAN -e shell install Device::Firmata
For more information on module installation, please visit the detailed CPAN module installation guide.