diff --git a/cmd/kd6ctl/main.go b/cmd/kd6ctl/main.go index ed4ba8f..5574c21 100644 --- a/cmd/kd6ctl/main.go +++ b/cmd/kd6ctl/main.go @@ -362,6 +362,7 @@ func main() { // cis.ReadRegister("GC") cis.ReadRegister("TP") cis.ReadRegisterWithVal("TP", "A0") + cis.ReadRegisterWithVal("SI", "C0") return nil }, diff --git a/kd6rmx.go b/kd6rmx.go index eaf72a8..f3acecc 100644 --- a/kd6rmx.go +++ b/kd6rmx.go @@ -989,6 +989,18 @@ func parseTestPattern(short_res, val string) error { return nil } +func parseName(short_res, result, val string) error { + prod_num_p2 := result[4:6] + prod_num_p1 := result[6:8] + id := result[8:10] + m := result[10:12] + y := result[12:14] + + sn := y + m + id + prod_num_p1 + prod_num_p2 + fmt.Printf("(SN: %s)\n", sn) + return nil +} + func (cis Sensor) ReadRegisterWithVal(register, val string) error { result, err := cis.SendCommand(register, val) if err != nil { @@ -1034,7 +1046,8 @@ func (cis Sensor) ReadRegisterWithVal(register, val string) error { return parseWhiteCorr(short_res) case "TP": parseTestPattern(short_res, val) - + case "SI": + return parseName(short_res, result, val) default: fmt.Printf("(default)") }