diff --git a/AdcProtocol.go b/AdcProtocol.go index e079df9..a19c3ed 100644 --- a/AdcProtocol.go +++ b/AdcProtocol.go @@ -78,6 +78,7 @@ func (this *AdcProtocol) ProcessCommand(msg string) { } this.hc.processEvent(HubEvent{EventType: EVENT_DEBUG_MESSAGE, Message: msg}) + parts := strings.Split(msg, " ") switch parts[0] { @@ -298,8 +299,8 @@ func (this *AdcProtocol) ProcessCommand(msg string) { */ data_base32 := parts[1] - if len(data_base32)%5 != 0 { - data_base32 += strings.Repeat("=", 6-(len(data_base32)%5)) + if len(data_base32)%8 != 0 { + data_base32 += strings.Repeat("=", 8-(len(data_base32)%8)) } data_raw, err := base32.StdEncoding.DecodeString(data_base32)