MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / encode_int16

Function encode_int16

src/ext/makerbot_driver/Encoder/Coding.py:53–59  ·  view source on GitHub ↗

Encode a 16-bit signed integer as a 2-byte string @param number @return byte array of size 2 that represents the integer

(number)

Source from the content-addressed store, hash-verified

51
52
53def encode_int16(number):
54 """
55 Encode a 16-bit signed integer as a 2-byte string
56 @param number
57 @return byte array of size 2 that represents the integer
58 """
59 return struct.pack('<h', number)
60
61
62def encode_uint16(number):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected