bettercap/modules/events_stream/events_view_gps.go
2024-08-09 18:19:21 +02:00

25 lines
513 B
Go

package events_stream
import (
"fmt"
"io"
"github.com/bettercap/bettercap/v2/session"
"github.com/evilsocket/islazy/tui"
)
func (mod *EventsStream) viewGPSEvent(output io.Writer, e session.Event) {
if e.Tag == "gps.new" {
gps := e.Data.(session.GPS)
fmt.Fprintf(output, "[%s] [%s] latitude:%f longitude:%f quality:%s satellites:%d altitude:%f\n",
e.Time.Format(mod.timeFormat),
tui.Green(e.Tag),
gps.Latitude,
gps.Longitude,
gps.FixQuality,
gps.NumSatellites,
gps.Altitude)
}
}