| 1 | package events_stream |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | "io" |
| 6 | |
| 7 | "github.com/bettercap/bettercap/session" |
| 8 | "github.com/evilsocket/islazy/tui" |
| 9 | ) |
| 10 | |
| 11 | func (mod *EventsStream) viewGPSEvent(output io.Writer, e session.Event) { |
| 12 | if e.Tag == "gps.new" { |
| 13 | gps := e.Data.(session.GPS) |
| 14 | |
| 15 | fmt.Fprintf(output, "[%s] [%s] latitude:%f longitude:%f quality:%s satellites:%d altitude:%f\n", |
| 16 | e.Time.Format(mod.timeFormat), |
| 17 | tui.Green(e.Tag), |
| 18 | gps.Latitude, |
| 19 | gps.Longitude, |
| 20 | gps.FixQuality, |
| 21 | gps.NumSatellites, |
| 22 | gps.Altitude) |
| 23 | } |
| 24 | } |