Skip to content

Commit

Permalink
Bug fix use unsigned int for struct.pack
Browse files Browse the repository at this point in the history
  • Loading branch information
Koseng committed May 31, 2021
1 parent d009330 commit 4399fbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mobiflight_variable_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def initialize_client_data_areas(self):
# simconnect library callback
def client_data_callback_handler(self, client_data):
if client_data.dwDefineID in self.sim_vars:
data_bytes = struct.pack("i", client_data.dwData[0])
data_bytes = struct.pack("I", client_data.dwData[0])
float_data = struct.unpack('<f', data_bytes)[0] # unpack delivers a tuple -> [0]
self.sim_vars[client_data.dwDefineID].float_value = round(float_data, 5)
logging.debug("client_data_callback_handler %s", self.sim_vars[client_data.dwDefineID])
Expand Down

0 comments on commit 4399fbc

Please sign in to comment.