mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-30 02:31:40 +00:00
Add message UUID and type names to hash and message defintion (#1409)
This commit is contained in:
@@ -85,7 +85,9 @@ class Packet:
|
||||
for _ in range(numBytes):
|
||||
intList.append(self._getNextByteAsInt())
|
||||
|
||||
# Interpret the bytes as a floating point number
|
||||
# Interpret the bytes as the requested type.
|
||||
# Note due to NT's byte order assumptions,
|
||||
# we have to flip the order of intList
|
||||
value = struct.unpack(unpackFormat, bytes(intList))[0]
|
||||
|
||||
return value
|
||||
@@ -96,7 +98,7 @@ class Packet:
|
||||
*
|
||||
* @return A decoded byte from the packet.
|
||||
"""
|
||||
return self._decodeGeneric(">b", 1)
|
||||
return self._decodeGeneric("<b", 1)
|
||||
|
||||
def decode16(self) -> int:
|
||||
"""
|
||||
@@ -104,7 +106,7 @@ class Packet:
|
||||
*
|
||||
* @return A decoded short from the packet.
|
||||
"""
|
||||
return self._decodeGeneric(">h", 2)
|
||||
return self._decodeGeneric("<h", 2)
|
||||
|
||||
def decodeInt(self) -> int:
|
||||
"""
|
||||
@@ -112,7 +114,7 @@ class Packet:
|
||||
*
|
||||
* @return A decoded int from the packet.
|
||||
"""
|
||||
return self._decodeGeneric(">l", 4)
|
||||
return self._decodeGeneric("<l", 4)
|
||||
|
||||
def decodeFloat(self) -> float:
|
||||
"""
|
||||
@@ -120,7 +122,7 @@ class Packet:
|
||||
*
|
||||
* @return A decoded float from the packet.
|
||||
"""
|
||||
return self._decodeGeneric(">f", 4)
|
||||
return self._decodeGeneric("<f", 4)
|
||||
|
||||
def decodeLong(self) -> int:
|
||||
"""
|
||||
@@ -128,7 +130,7 @@ class Packet:
|
||||
*
|
||||
* @return A decoded int64 from the packet.
|
||||
"""
|
||||
return self._decodeGeneric(">q", 8)
|
||||
return self._decodeGeneric("<q", 8)
|
||||
|
||||
def decodeDouble(self) -> float:
|
||||
"""
|
||||
@@ -136,7 +138,7 @@ class Packet:
|
||||
*
|
||||
* @return A decoded double from the packet.
|
||||
"""
|
||||
return self._decodeGeneric(">d", 8)
|
||||
return self._decodeGeneric("<d", 8)
|
||||
|
||||
def decodeBoolean(self) -> bool:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user