|
@@ -63,8 +63,10 @@ func restartGnssService(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
func gnssStatusHandler(w http.ResponseWriter, r *http.Request) {
|
|
func gnssStatusHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
var pos struct {
|
|
var pos struct {
|
|
|
- Lat string `json:"lat"`
|
|
|
|
|
- Lon string `json:"lon"`
|
|
|
|
|
|
|
+ Lat string `json:"lat"`
|
|
|
|
|
+ Lon string `json:"lon"`
|
|
|
|
|
+ InUse string `json:"inuse"`
|
|
|
|
|
+ InView string `json:"inview"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
callErr := callRPCResult(r.Context(), 7002, "core.getPositionInfo", nil, &pos)
|
|
callErr := callRPCResult(r.Context(), 7002, "core.getPositionInfo", nil, &pos)
|
|
@@ -72,6 +74,8 @@ func gnssStatusHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
status := noValue
|
|
status := noValue
|
|
|
lat := noValue
|
|
lat := noValue
|
|
|
lon := noValue
|
|
lon := noValue
|
|
|
|
|
+ inuse := noValue
|
|
|
|
|
+ inview := noValue
|
|
|
|
|
|
|
|
if callErr == nil {
|
|
if callErr == nil {
|
|
|
status = "🟢正常"
|
|
status = "🟢正常"
|
|
@@ -81,6 +85,12 @@ func gnssStatusHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
if pos.Lon != "" {
|
|
if pos.Lon != "" {
|
|
|
lon = pos.Lon
|
|
lon = pos.Lon
|
|
|
}
|
|
}
|
|
|
|
|
+ if pos.InUse != "" {
|
|
|
|
|
+ inuse = pos.InUse
|
|
|
|
|
+ }
|
|
|
|
|
+ if pos.InView != "" {
|
|
|
|
|
+ inview = pos.InView
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
|
@@ -88,5 +98,7 @@ func gnssStatusHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
"var1": status,
|
|
"var1": status,
|
|
|
"var2": lat,
|
|
"var2": lat,
|
|
|
"var3": lon,
|
|
"var3": lon,
|
|
|
|
|
+ "var5": inuse,
|
|
|
|
|
+ "var6": inview,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|