Skip to content

Commit

Permalink
Update pySVS.py
Browse files Browse the repository at this point in the history
  • Loading branch information
logon84 authored Dec 8, 2023
1 parent d1a253c commit 5906347
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pySVS.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def svs_decode(frame):
if attrib != "UNKNOWN":
#Validate received values
if SVS_PARAMS[attrib]["limits_type"] == 2:
value = str(O_RAW_DATA)[2:len(str(O_RAW_DATA))-1].rstrip(str(b'\x00'))
value = O_RAW_DATA.decode("utf-8").rstrip('\x00')
check = True
else:
mask = 0 if O_B_ENDIAN_DATA[offset] < 0xf000 else 0xFFFF
Expand All @@ -340,7 +340,7 @@ def svs_decode(frame):
elif SVS_PARAMS[attrib]["limits_type"] == 0:
check = max(SVS_PARAMS[attrib]["limits"]) >= value >= min(SVS_PARAMS[attrib]["limits"])
if check:
O_VALIDATED_VALUES[attrib] = value
O_VALIDATED_VALUES[attrib] = int(value) if ".0" in str(value) else value
#read PADDING
O_PADDING = "0x" + bytes2hexstr(frame[len(frame) - bytes_left_in_frame:len(frame)-2]) if(len(bytes2hexstr(frame[len(frame) - bytes_left_in_frame:len(frame)-2])) > 0) else ""

Expand Down Expand Up @@ -375,7 +375,7 @@ def svs_decode(frame):
return output

def bytes2hexstr(bytes_input):
return str(hexlify(bytes_input)).replace("\'","")[1:]
return hexlify(bytes_input).decode("utf-8")

################### End SVS Frame Routines ###################

Expand Down Expand Up @@ -629,7 +629,7 @@ def show_usage():
return

if __name__ == "__main__":
VERSION = "v3.3 Beta"
VERSION = "v3.31 Beta"
dev="hci0"
if len(sys.argv[1:]) > 0:
GUI = 0
Expand Down

0 comments on commit 5906347

Please sign in to comment.