netcat toolnetcat TCP/IP Swiss army knife
It was re-implemented from scratch for NuttX
Usage is straightforward:
nsh> help ; netcat
Usage: netcat [-l] [destination] [port] [file]
nsh> renew eth0 ; ifconfig
eth0 Link encap:Ethernet HWaddr 52:13:FF:FF:FF:FF at UP
inet addr:192.168.1.42 DRaddr:192.168.1.254 Mask:255.255.255.0
In the following examples, following configuration is used:
As a server on NuttX and Linux's netcat as client
nsh> netcat -l sh> cat /proc/version | netcat 192.168.1.42 31337 Linux ...
Default port is 31337 but it can changed.
nsh> renew eth0 ; ifconfig ; netcat -l log: net: listening on :31337 Linux ...
Start Server on GNU/Linux:
sh> ip addr show && netcat -l 31337
Client side on nuttx, we create
nsh> help ; renew eth0 ; ifconfig nsh> netcat 192.168.1.55 31337 /proc/version
mkfifo /dev/fifo netcat 192.168.1.55 31337 /proc/fifo help > /dev/fifo fxos8700cq > /dev/fifo & fxos8700cq [7:100] netcat 192.168.1.55 31337 /dev/fifo