我阅读了以下链接和其他来源,但没有找到我的问题的答案.
我通过串口与嵌入式设备通信.默认情况下,嵌入式Linux使用此端口作为终端.但我想通过端口传输二进制数据(服务数据包).我的/ etc/inittab文件有一个"getty"调用: console :: respawn:/ sbin/getty 115200 ttyS0
我还有/ etc/passwd文件,其中"admin"用户在登录后启动我的"cli"应用程序: admin:8Mt/Jtxcyg8AY:1000:0:admin:/ tmp:/ tmp/cli
运行程序之前我的默认ttyS0设置是:
~ # stty -a
speed 115200 baud;stty: standard input
line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ^J;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; …Run Code Online (Sandbox Code Playgroud)