Skip to content

Commit

Permalink
update nunavut_support
Browse files Browse the repository at this point in the history
  • Loading branch information
coderkalyan committed Feb 21, 2022
1 parent 1ac5c0c commit ca2de39
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/nunavut/lang/py/support/nunavut_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
import pydsdl



if sys.byteorder != "little": # pragma: no cover
raise RuntimeError(
"BIG-ENDIAN PLATFORMS ARE NOT YET SUPPORTED. "
"The current serialization code assumes that the native byte order is little-endian. Since UAVCAN uses "
"little-endian byte order in its serialized data representations, this assumption allows us to bypass data "
"transformation in many cases, resulting in zero-cost serialization and deserialization. "
"Big-endian platforms are unable to take advantage of that, requiring byte swapping for multi-byte entities; "
"fortunately, nowadays such platforms are uncommon. If you need to use this library on a big-endian platform, "
"please implement the missing code and submit a pull request to the upstream, then remove this exception."
)


Byte = numpy.uint8
"""
We must use uint8 instead of ubyte because uint8 is platform-invariant whereas (u)byte is platform-dependent.
Expand Down

0 comments on commit ca2de39

Please sign in to comment.