#NEWLINE# def value_to_bytes( self , obj , value , default_endianness = DEFAULT_ENDIANNESS ) : #NEWLINE# #INDENT# '\n        Converts the given value to an appropriately encoded string of bytes that represents it.\n\n        :param obj: The parent :class:`.PebblePacket` of this field\n        :type obj: .PebblePacket\n        :param value: The python value to serialise.\n        :param default_endianness: The default endianness of the value. Used if ``endianness`` was not passed to the\n                                   :class:`Field` constructor.\n        :type default_endianness: str\n        :return: The serialised value\n        :rtype: bytes\n        ' #NEWLINE# return struct . pack ( ( str ( ( self . endianness or default_endianness ) ) + self . struct_format ) , value )