mirror of
https://github.com/markqvist/Sideband.git
synced 2024-12-24 23:19:28 -05:00
Updated GPS data struct packing. Fixes #58.
This commit is contained in:
parent
bc8dcb82a3
commit
426c9d9617
@ -10,7 +10,7 @@ source.exclude_patterns = app_storage/*,venv/*,Makefile,./Makefil*,requirements,
|
||||
|
||||
version.regex = __version__ = ['"](.*)['"]
|
||||
version.filename = %(source.dir)s/main.py
|
||||
android.numeric_version = 20241020
|
||||
android.numeric_version = 20241213
|
||||
|
||||
requirements = kivy==2.3.0,libbz2,pillow==10.2.0,qrcode==7.3.1,usb4a,usbserial4a,able_recipe,libwebp,libogg,libopus,opusfile,numpy,cryptography,ffpyplayer,codec2,pycodec2,sh,pynacl,typing-extensions
|
||||
|
||||
|
@ -778,9 +778,9 @@ class Location(Sensor):
|
||||
return [
|
||||
struct.pack("!i", int(round(d["latitude"], 6)*1e6)),
|
||||
struct.pack("!i", int(round(d["longitude"], 6)*1e6)),
|
||||
struct.pack("!I", int(round(d["altitude"], 2)*1e2)),
|
||||
struct.pack("!i", int(round(d["altitude"], 2)*1e2)),
|
||||
struct.pack("!I", int(round(d["speed"], 2)*1e2)),
|
||||
struct.pack("!I", int(round(d["bearing"], 2)*1e2)),
|
||||
struct.pack("!i", int(round(d["bearing"], 2)*1e2)),
|
||||
struct.pack("!H", int(round(d["accuracy"], 2)*1e2)),
|
||||
d["last_update"],
|
||||
]
|
||||
@ -796,9 +796,9 @@ class Location(Sensor):
|
||||
return {
|
||||
"latitude": struct.unpack("!i", packed[0])[0]/1e6,
|
||||
"longitude": struct.unpack("!i", packed[1])[0]/1e6,
|
||||
"altitude": struct.unpack("!I", packed[2])[0]/1e2,
|
||||
"altitude": struct.unpack("!i", packed[2])[0]/1e2,
|
||||
"speed": struct.unpack("!I", packed[3])[0]/1e2,
|
||||
"bearing": struct.unpack("!I", packed[4])[0]/1e2,
|
||||
"bearing": struct.unpack("!i", packed[4])[0]/1e2,
|
||||
"accuracy": struct.unpack("!H", packed[5])[0]/1e2,
|
||||
"last_update": packed[6],
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user