1 package utils 2 3 import ( 4 "flag" 5 "fmt" 6 ) 7 8 var ( 9 debug_packetizer = flag.Bool("ge_debug_packetizer", false, "debug mode") 10 ) 11 12 func check_valid(start, escape, stop byte) error { 13 if start == escape { 14 return fmt.Errorf("start byte (0x%02X) must not be identical to escape byte", start) 15 } 16 if stop == escape { 17 return fmt.Errorf("stop byte (0x%02X) must not be identical to escape byte", stop) 18 } 19 return nil 20 } 21