Merge pull request #1042 from reynico/better-error-message-gps

plugins/gps: add some logging around the gps off exception
This commit is contained in:
Simone Margaritelli
2022-08-02 12:50:31 +02:00
committed by GitHub

View File

@ -32,11 +32,13 @@ class GPS(plugins.Plugin):
try: try:
agent.run("gps off") agent.run("gps off")
except Exception: except Exception:
logging.info(f"bettercap gps module was already off")
pass pass
agent.run(f"set gps.device {self.options['device']}") agent.run(f"set gps.device {self.options['device']}")
agent.run(f"set gps.baudrate {self.options['speed']}") agent.run(f"set gps.baudrate {self.options['speed']}")
agent.run("gps on") agent.run("gps on")
logging.info(f"bettercap gps module enabled on {self.options['device']}")
self.running = True self.running = True
else: else:
logging.warning("no GPS detected") logging.warning("no GPS detected")