def value_to_bytes(self, obj, value, default_endianness=DEFAULT_ENDIANNESS):
        return struct.pack(str(self.endianness or default_endianness) + self.struct_format, value)
Converts the given value to an appropriately encoded string of bytes that represents it.
dataset/ETHPy150Open pebble/libpebble2/libpebble2/protocol/base/types.py/Field.value_to_bytes