MCPcopy Create free account
hub / github.com/distributed/sers / Valid

Method Valid

sers.go:73–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71}
72
73func (m Mode) Valid() bool {
74 if m.Baudrate < 0 {
75 return false
76 }
77 if m.DataBits < 5 || m.DataBits > 8 {
78 return false
79 }
80 if !(m.Parity == N || m.Parity == O || m.Parity == E) {
81 return false
82 }
83 if !(m.Stopbits == 1 || m.Stopbits == 2) {
84 return false
85 }
86 if !(m.Handshake == NO_HANDSHAKE || m.Handshake == RTSCTS_HANDSHAKE) {
87 return false
88 }
89
90 return true
91}
92
93func (m Mode) String() string {
94 if !m.Valid() {

Callers 1

StringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected