What does the “opost” stty flag do?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

What does the “opost” stty flag do?

1,096 次查看
okwaj
Contributor III
Hi, I am working on an imx6UL .
 
I can communicate with a device over UART with the following command in the linux shell:
 

 

echo "abcd" > /dev/ttymxc6

 

I am using this UART for RS485 communication. The communication works well on the linux shell but when I use pymodbus, it creates a Serial that deactivates the"opost" flag to ttymxc6 for unknown reasons.

Without using pymodbus (and so pyserial):

 

root@user:~# stty -F /dev/ttymxc6
speed 9600 baud; line = 0;
-brkint -imaxbel

 

After using pymodbus:

 

root@user:~# stty -F /dev/ttymxc6
speed 9600 baud; line = 0;
min = 0; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

 

It is annoying because I have to add :

 

os.system("stty -F /dev/ttymxc6 opost")

 

In my code to make it work and this takes around 11ms which is pretty long for my application...


What does the opost flag do on IMX6UL ?

0 项奖励
1 回复

1,085 次查看
nxf54947
NXP Employee
NXP Employee

Hi  @okwaj,

I believe a similar question was answered at https://unix.stackexchange.com/questions/402874/what-does-the-opost-stty-flag-do

Regards,

Ruben

0 项奖励