Conversation
There was a problem hiding this comment.
Lets we also add as a comment above the name of the tag parse function a link to a doc that shows the tag message formats or if we can't put a link can add the a shortened version that explains the mesage format. This will save us time later if we need to refactor something in the functions and need to know how the incoming message looks like.
actualy instead of this lets add a device_test.go and add an actual test for G62Parse and Antratek
| if val, ok := data.Object["speedKmph"]; ok { | ||
| dataParsed.Attr["speedKmph"] = fmt.Sprintf("%v", val.(float64)) | ||
| } |
There was a problem hiding this comment.
| if val, ok := data.Object["speedKmph"]; ok { | |
| dataParsed.Attr["speedKmph"] = fmt.Sprintf("%v", val.(float64)) | |
| } | |
| if val, ok := data.Object["speedKmph"]; ok { | |
| dataParsed.Speed = fmt.Sprintf("%v", val.(float64)) | |
| dataParsed.Motion = true | |
| } |
instead of this should add it to dataParsed.Speed and then in the Parse function can change it to
if point.Motion && point.Speed == 0 {
point.Speed = self.Speed(point.ID)
}
There was a problem hiding this comment.
I don't see any code changes here.
| // Port 12 status messages contain only lat/lon. | ||
| hdop, ok := data.Object["hdop"] | ||
| if !ok { | ||
| log.Printf("data object doesn't contain hdop so setting to 0") | ||
| hdop = 0.0 | ||
| } |
There was a problem hiding this comment.
do these new trackers actually send hdop messages?
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Co-authored-by: Krasimir Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
| case "irnas": | ||
| points, err = Irnas(data) | ||
| case "Second": | ||
| points, err = G62Parse(data) |
There was a problem hiding this comment.
| points, err = G62Parse(data) | |
| points, err = G62(data) |
|
Thanks. |
No description provided.