Skip to content

Commit

Permalink
Set actual field lengths.
Browse files Browse the repository at this point in the history
  • Loading branch information
bemasher committed Jan 8, 2015
1 parent 86a2abf commit dbb4227
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scm/scm.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ func (p Parser) Parse(indices []int) (msgs []parse.Message) {
continue
}

ertid, _ := strconv.ParseUint(data.Bits[21:23]+data.Bits[56:80], 2, 32)
erttype, _ := strconv.ParseUint(data.Bits[26:30], 2, 8)
tamperphy, _ := strconv.ParseUint(data.Bits[24:26], 2, 8)
tamperenc, _ := strconv.ParseUint(data.Bits[30:32], 2, 8)
consumption, _ := strconv.ParseUint(data.Bits[32:56], 2, 32)
ertid, _ := strconv.ParseUint(data.Bits[21:23]+data.Bits[56:80], 2, 26)
erttype, _ := strconv.ParseUint(data.Bits[26:30], 2, 4)
tamperphy, _ := strconv.ParseUint(data.Bits[24:26], 2, 2)
tamperenc, _ := strconv.ParseUint(data.Bits[30:32], 2, 2)
consumption, _ := strconv.ParseUint(data.Bits[32:56], 2, 24)
checksum, _ := strconv.ParseUint(data.Bits[80:96], 2, 16)

var scm SCM
Expand Down

0 comments on commit dbb4227

Please sign in to comment.