串行类中的字节大小属性定义为用于该连接的数据位数。如果我启用奇校验,它是否将定义的数据位之一转换为表示奇偶校验?或者它只是在开始位和停止位之间添加另一个位?
import serial
# Define a serial instance with 8 databits and no parity
my_com = serial.serial(bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE)
# My rs232 frame would now look something like:
[ START_BIT, DB0, DB1, DB2, DB3, DB4, DB5, DB6, DB7, STOP_BIT ]
# Change the parity settings
my_com.parity = serial.PARITY_ODD
# Do my frames now look like this
[ START_BIT, DB0, DB1, DB2, DB3, DB4, DB5, DB6, DB7, PARITY, STOP_BIT ]
# or do they look like this?
[ START_BIT, DB0, DB1, DB2, DB3, DB4, DB5, DB6, PARITY, STOP_BIT ]
任何帮助将不胜感激。谢谢