Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_BAUD_RATE uint = 9600 // 默认波特率 DEFAULT_PARITY Parity = PARITY_NONE // 默认校验位 DEFAULT_DATA_BITS uint8 = 8 // 默认数据位 DEFAULT_STOP_BITS StopBits = STOP_ONE // 默认停止位 )
默认值
Variables ¶
View Source
var ( // ErrBadDataBits is returned if DataBits is not supported. ErrBadDataBits error = errors.New("unsupported serial data bits") // ErrBadStopBits is returned if the specified StopBits setting not supported. ErrBadStopBits error = errors.New("unsupported stop bit setting") // ErrBadParity is returned if the parity is not supported. ErrBadParity error = errors.New("unsupported parity setting") )
Functions ¶
func ValidateNil ¶
func ValidateNil(object interface{}) bool
Types ¶
type Parity ¶
type Parity byte
校验位类型
const ( PARITY_NONE Parity = 'N' // 无校验(NONE): 没有校验位 PARITY_ODD Parity = 'O' // 奇偶校验位-奇校验(ODD): 让传输的数据(包含校验位)中1的个数为奇数;如果传输字节中1的个数是偶数,则校验位为"1",奇数相反. PARITY_EVEN Parity = 'E' // 奇偶校验位-偶校验(EVEN): 让传输的数据(包含校验位)中1的个数为偶数;如果传输字节中1的个数是偶数,则校验位为"0",奇数相反. PARITY_MARK Parity = 'M' // 固定校验位(Stick)-1校验(MARK): 校验位总为1 PARITY_SPACE Parity = 'S' // 固定校验位(Stick)-0校验(SPACE): 校验位总为0 )
校验位常量
Click to show internal directories.
Click to hide internal directories.