本文整理汇总了Python中listener.Listener.getGpsInfo方法的典型用法代码示例。如果您正苦于以下问题:Python Listener.getGpsInfo方法的具体用法?Python Listener.getGpsInfo怎么用?Python Listener.getGpsInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类listener.Listener
的用法示例。
在下文中一共展示了Listener.getGpsInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from listener import Listener [as 别名]
# 或者: from listener.Listener import getGpsInfo [as 别名]
listener.initCapturing(60)
listener.initGetTimeFromGPS(600)
# listen for commands via SMS
thread.start_new_thread( listener.listenForCommands, () )
listener.sendSMS("Device is up and listening")
# main loop
while True:
time.sleep(4)
temperatureExternal= listener.getTemperatureExternal()
temperatureInternal = listener.getTemperatureInternal()
gpsInfo, coords, height = listener.getGpsInfo()
networkInfo = listener.getNetworkInfo(sendSMS=False)
listener.logAllRecords(temperatureExternal, temperatureInternal, gpsInfo, coords, height, networkInfo)
time.sleep(240)
except Exception as e:
print e
try:
with open("/root/logs/messages.log", "a") as myfile:
s = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
s += " " + "main-loop" + " " + str(e) + "\n"
myfile.write(s)
except Exception as e: