Skip to content

Conversation

@tudorikas
Copy link

No description provided.

Copy link
Member

@krasi-georgiev krasi-georgiev left a 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

Comment on lines 388 to 390
if val, ok := data.Object["speedKmph"]; ok {
dataParsed.Attr["speedKmph"] = fmt.Sprintf("%v", val.(float64))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
}

Copy link
Member

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.

Comment on lines 368 to 373
// 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
}
Copy link
Member

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?

tudorikas and others added 10 commits November 14, 2022 22:36
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
points, err = G62Parse(data)
points, err = G62(data)

@krasi-georgiev
Copy link
Member

krasi-georgiev commented Nov 15, 2022

Thanks.
Last thing is to add a test for Antratek and G62 functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants