Index: DialityCoreCanProtocol.py =================================================================== diff -u -r939a86a215a1a244e493c6455292d921a77698e3 -r92b40e700a1d5689f1e5bef79e01e5a793937799 --- DialityCoreCanProtocol.py (.../DialityCoreCanProtocol.py) (revision 939a86a215a1a244e493c6455292d921a77698e3) +++ DialityCoreCanProtocol.py (.../DialityCoreCanProtocol.py) (revision 92b40e700a1d5689f1e5bef79e01e5a793937799) @@ -65,8 +65,8 @@ def buildBasicMessage(channel_id=0, message=None): """ build a message using channel_id and dialin message - :param channel_id: integer with channel id - :param message: array of int with message + /return channel_id: integer with channel id + /return message: array of int with message :return: dictionary with channel_id and message keys """ if message is None: @@ -78,9 +78,9 @@ """ buildPacket builds a Diality Packet - :param channel_id: is an integer with channel ID - :param message_id: is an integer indicating request ID - :param payload: list with payload. It does not include length + /return channel_id: is an integer with channel ID + /return message_id: is an integer indicating request ID + /return payload: list with payload. It does not include length :return dictionary with channel_id and 8-byte padded message """ @@ -124,7 +124,7 @@ def crc8(message_list): """ returns the calculated crc from a message list - :param message_list: is a list of integer numbers containing the message + /return message_list: is a list of integer numbers containing the message :return: integer containing a unsigned byte """ crc = 0 @@ -138,7 +138,7 @@ def __padMessageWithZeros(message): """ returns a packet padded with zeros that guarantees that the packet is a multiple of 8 bytes. - :param message: packet that may or may not be multiple of 8 bytes + /return message: packet that may or may not be multiple of 8 bytes :return: packet that is 8-byte multiple @@ -160,7 +160,7 @@ """ gets the CRC in message - :param message: Dialin complete message with CRC + /return message: Dialin complete message with CRC :return: CRC in message """ @@ -193,7 +193,7 @@ """ returns request ID from message - :param message: dictionary with channel_id and message keys + /return message: dictionary with channel_id and message keys :return: integer with channel id """ @@ -205,7 +205,7 @@ """ returns request ID from packet - :param message: complete Diality Packet + /return message: complete Diality Packet :return: integer with request ID @@ -219,7 +219,7 @@ def getPayloadLength(message): """ returns payload length from message - :param message: dictionary with channel_id and message keys + /return message: dictionary with channel_id and message keys :return: a unsigned payload length """ return message['message'][DenaliMessage.PAYLOAD_LENGTH_INDEX] @@ -228,7 +228,7 @@ def getPayload(message): """ returns payload array from message - :param message: dictionary with channel_id and message keys + /return message: dictionary with channel_id and message keys :return: a payload array if exist """ @@ -243,8 +243,8 @@ def getTotalPackets(message, is_array=True): """ returns the number of packets needed to transmit Denali Message - :param message: dictionary with channel_id and message keys or raw message - :param is_array: True if message is an array and not a dictionary + /return message: dictionary with channel_id and message keys or raw message + /return is_array: True if message is an array and not a dictionary :return: number of packets """ the_message = message if is_array else message['message'] @@ -290,7 +290,7 @@ message = obj.push(msg3), return the packet which is the concatenation of msg1, msg2 and msg3 - :param can_message: an 8 byte message needed to build a diality message. + /return can_message: an 8 byte message needed to build a diality message. :returns object @@ -303,9 +303,9 @@ """ push appends the can_message to the current packet. - :param can_message: 8-byte message + /return can_message: 8-byte message - :param first_packet: True if it is the first packet received + /return first_packet: True if it is the first packet received :return: None if the packet is not completed, otherwise returns the complete packet """ @@ -334,7 +334,7 @@ """ DenaliCanMessenger constructor - :param can_interface - string containing the can interface, e.g., 'can0" + /return can_interface - string containing the can interface, e.g., 'can0" :returns DialityCanMessenger object @@ -471,9 +471,9 @@ assign a function with packet parameter to an sync request id, e.g., def function(packet). - :param channel_id: can channel number where messages are received - :param message_id: Diality request ID in message - :param function: function reference + /return channel_id: can channel number where messages are received + /return message_id: Diality request ID in message + /return function: function reference """ # if the channel_id exist, we just update the dictionary for the channel_id @@ -488,8 +488,8 @@ """ sends can_packet to channel_id. - :param built_message: message built using DialinMessage class - :param time_out: time it will wait for a response in seconds + /return built_message: message built using DialinMessage class + /return time_out: time it will wait for a response in seconds :returns: Diality Packet, it it times out it returns None """