socat:
模拟串口:
sudo socat -d -d pty,raw,echo=0 pty,raw,echo=0
result:
2023/12/16 10:55:41 socat[31558] N PTY is /dev/pts/5
2023/12/16 10:55:41 socat[31558] N PTY is /dev/pts/6
/dev/pts/5 is rx channel
/dev/pts/6 is tx channel
echo -e “$GPFPD,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1*12\r” > /dev/pts/6
udp发送组播:
printf ‘\x00\x0c\x3b\xa5\x00\x01\x00\x03\x34\x12\x34\x12\x34\x12’ | nc -u -w1 -s 127.0.0.1 -p 12232 -b 224.244.244.245 18888