Hi Jiapeng
> How about adding this pn532_net driver to libnfc?
This is a good idea but I find the current driver too specific to UART,
and too specific to one model over UART (this won't work e.g. with an
Arygon ADRA as the serial protocol frame is a bit different)
For this kind of exercise, I believe you can do it with socat.
In the man page, this one is pretty close to what you want to do:
socat PTY,link=$HOME/dev/vmodem0,raw,echo=0,waitslave EXEC:�"ssh
modemserver.us.org socat - /dev/ttyS0,nonblock,raw,echo=0"�
generates a pseudo terminal device (PTY) on the client that can be
reached under the symbolic link $HOME/dev/vmodem0. An application that
expects a serial
line or modem can be configured to use $HOME/dev/vmodem0; its traffic
will be directed to a modemserver via ssh where another socat instance
links it with
/dev/ttyS0.
So by using /dev/vmodem0 as the "serial port" of your board in libnfc
config, libnfc will talk to the board connected to the RPi over /dev/ttyS0
Alternatively you can try something like
socat PTY,link=$HOME/dev/vmodem0,raw,echo=0,waitslave TCP4:myRPi:1234
and on the RPi:
socat TCP4-LISTEN:1234,reuseaddr /dev/ttyS0,nonblock,raw,echo=0"
See the socat manpage, there is a lot of possible tuning in all termios
parameters, baudrate etc/
Phil