A robot telemetry parser can receive exactly the intended two bytes and still report the wrong number. Preserving the bytes establishes transport integrity at that boundary; interpreting their order, sign, and physical scale requires a field definition.

These choices are independent. Swapping byte significance changes the integer. Reinterpreting the same bit pattern as signed changes its numerical domain. Applying a unit scale changes the reported physical quantity without changing the stored integer.

The following field is an original hypothetical protocol example. No robot packet capture, production decoder, or language library is executed.

Begin with two known byte positions

Assume the receiver has already identified a field of exactly two bytes at known offsets. In increasing offset order, the hexadecimal bytes are FF 9C. Each hexadecimal pair represents one eight-bit byte.

The field boundary is held fixed throughout. The example does not infer where an application record begins, reconstruct partial reads, or decide whether a message is fresh. It asks what these already isolated bytes mean under explicit alternatives.

Let the first byte have decimal value 255 and the second have value 156. There is no negative byte value in this initial ledger: they are simply two octets carrying bit patterns.

Choose byte significance

Under a big-endian unsigned sixteen-bit interpretation, the first byte contributes the higher eight bits. The value is 255 times 256 plus 156, or 65,436. Its hexadecimal word is FF9C.

Under a little-endian unsigned interpretation, the first byte contributes the lower eight bits. The value is 255 plus 156 times 256, or 40,191. The resulting hexadecimal word is 9CFF.

The byte sequence in memory has not changed. The rule assigning significance to positions has changed. Both calculations use the same two received bytes without corruption or loss.

Python's official struct documentation distinguishes explicit big-endian and little-endian formats from native layout. Its integer documentation likewise defines byte order for int.from_bytes. Those interfaces make the interpretation a declared parameter rather than a property that can be discovered from these two bytes alone.

Choose the signed representation

Now specify two's-complement signed sixteen-bit integers. Start from the unsigned word value U after deciding byte order. If U is at least 32,768, the signed value is U − 65,536. Otherwise it remains U.

For the big-endian word, 65,436 − 65,536 = −100. For the little-endian word, 40,191 − 65,536 = −25,345. Both words have their most significant bit set, so both require that subtraction under the declared signed interpretation.

This subtraction does not swap bytes. It changes how a fixed-width bit pattern maps to an integer. Byte order and signedness consequently cannot repair one another by accident as a general decoding rule.

The signed sixteen-bit range is −32,768 through 32,767. The unsigned range is zero through 65,535. A field intended to represent a negative quantity needs a defined representation; a receiver cannot choose one merely because a decoded number looks more plausible.

Assign an engineering-unit scale

Invent a protocol rule that this field is big-endian, signed two's complement, with one count representing 0.01 degree and zero additive offset. The correctly decoded value −100 then represents −1 degree.

Retaining that scale while mistakenly using the little-endian signed value gives −253.45 degrees. Retaining big-endian order but treating the field as unsigned gives 654.36 degrees. The errors originate before the unit conversion.

Changing the scale to 0.001 degree per count would instead make the correctly decoded −100 represent −0.1 degree. That scale is a different protocol contract, not a consequence of the same hexadecimal word.

For a more general field, write physical_value = scale times integer_value plus offset, with units attached to both scale and offset. If an invented revision uses an offset of 10 degrees with the original scale, −100 counts maps to 9 degrees. The integer decoding remains unchanged.

These angles have no defined robot joint, coordinate reference, or rotation convention. They demonstrate field interpretation only. Their values are not motion commands or permitted operating ranges.

Width and extension remain part of the contract

Suppose the signed sixteen-bit result −100 is widened to a signed thirty-two-bit representation while preserving its value. Sign extension gives the bit pattern FFFFFF9C in the usual two's-complement notation.

Zero-extending the original unsigned word instead gives 0000FF9C, which represents positive 65,436. Merely storing the word in a wider container does not establish that its signed meaning was preserved.

The field also occupies two bytes in this example, even if a receiving program uses a larger native integer type. Declaring a sixteen-bit wire format and choosing an in-memory storage type are separate decisions.

Python's struct documentation identifies h and H as signed and unsigned two-byte formats under standard-size prefixes. It also documents that native layout can involve platform-dependent sizing and padding. An interchange record therefore needs explicit offsets and layout instead of assuming that a native structure dump has the intended wire representation.

Keep sample evidence with the schema

A useful decoder review pairs the schema with independently worked examples. For the invented field, FF 9C should produce −100 counts and −1 degree under the stated rule. A second word 00 64 should produce +100 counts and +1 degree.

The second word is deliberately asymmetric in byte order: reversing its significance yields 25,600 counts. A field containing only 00 00 would be a poor sole check because both byte orders produce the same integer.

Even matching such examples does not prove the sender used the correct physical units or measurement reference. It does establish whether the tested interpretations agree with the declared byte-level contract.

Preserving raw bytes, schema revision, field width, byte order, signed representation, scale, and offset makes later interpretation traceable. The same payload can then be explained without treating a plausible-looking engineering value as evidence that every earlier decision was correct.

Sources checked October 23, 2026

Python 3.14 documentation, struct, Byte Order, Size, and Alignment and Format Characters:

https://docs.python.org/3.14/library/struct.html

Python 3.14 documentation, Built-in Types, int.from_bytes:

https://docs.python.org/3.14/builtins/stdtypes.html

All field bytes, scales, offsets, and decoding calculations are original hypothetical examples. No decoder was run against a robot.

Illustration note: The accompanying site-library robot beside a laptop is a concept illustration. It is not a telemetry capture or evidence of a verified protocol implementation.