-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: gps.new event now reports GPS data changes as they occur (fixes #…
…878)
- Loading branch information
1 parent
8310209
commit 8c00207
Showing
4 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package events_stream | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
|
||
"github.com/bettercap/bettercap/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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters