Added GetTime. Added independent internet port. Debugged internet connection.
This commit is contained in:
@ -42,14 +42,14 @@ checkLoop:
|
||||
}
|
||||
st.GotResponses = true
|
||||
|
||||
g.logger.Println("NMEA check:", s)
|
||||
// g.logger.Println("NMEA check:", s)
|
||||
values := strings.Split(s, ",")
|
||||
if len(values[0]) != 6 {
|
||||
return StatusNil, fmt.Errorf("nmea invalid sentence: %s", s)
|
||||
}
|
||||
switch values[0][3:] { // Switch by content
|
||||
case "GSV": // Any satelites
|
||||
g.logger.Println("check GSV")
|
||||
// g.logger.Println("check GSV")
|
||||
// Check len
|
||||
if len(values) < 17 {
|
||||
g.logger.Println("GSV too small values")
|
||||
@ -83,7 +83,7 @@ checkLoop:
|
||||
}
|
||||
st.FoundSatelitesCount = satCount
|
||||
case "GSA": // Active satelites
|
||||
g.logger.Println("check GSA")
|
||||
// g.logger.Println("check GSA")
|
||||
|
||||
// Check len
|
||||
if len(values) < 17 {
|
||||
@ -107,7 +107,7 @@ checkLoop:
|
||||
}
|
||||
st.ActiveSatelitesCount = max(st.ActiveSatelitesCount, count)
|
||||
case "RMC": // Minimum GPS data
|
||||
g.logger.Println("check RMC")
|
||||
// g.logger.Println("check RMC")
|
||||
// Check len
|
||||
if len(values) < 12 {
|
||||
g.logger.Println("RMC too small values")
|
||||
@ -125,7 +125,7 @@ checkLoop:
|
||||
st.IsValidData = true
|
||||
}
|
||||
case "GST":
|
||||
g.logger.Println("check GST")
|
||||
// g.logger.Println("check GST")
|
||||
// Check len
|
||||
if len(values) < 8 {
|
||||
g.logger.Println("GST too small values")
|
||||
|
Reference in New Issue
Block a user