-
Notifications
You must be signed in to change notification settings - Fork 3
add Antratek and g62 parser #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| points, err = G62Parse(data) | |
| points, err = G62(data) |
|
Thanks. |
No description provided.