Index: DialityCoreCanProtocol.py =================================================================== diff -u -r92b40e700a1d5689f1e5bef79e01e5a793937799 -raad702e781289fac6ea772855905467b66ce35b3 --- DialityCoreCanProtocol.py (.../DialityCoreCanProtocol.py) (revision 92b40e700a1d5689f1e5bef79e01e5a793937799) +++ DialityCoreCanProtocol.py (.../DialityCoreCanProtocol.py) (revision aad702e781289fac6ea772855905467b66ce35b3) @@ -67,7 +67,7 @@ build a message using channel_id and dialin message /return channel_id: integer with channel id /return message: array of int with message - :return: dictionary with channel_id and message keys + \return: dictionary with channel_id and message keys """ if message is None: message = [] @@ -82,7 +82,7 @@ /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 + \return dictionary with channel_id and 8-byte padded message """ if payload is None: @@ -125,7 +125,7 @@ """ returns the calculated crc from a message list /return message_list: is a list of integer numbers containing the message - :return: integer containing a unsigned byte + \return: integer containing a unsigned byte """ crc = 0 for byte in message_list: @@ -140,7 +140,7 @@ returns a packet padded with zeros that guarantees that the packet is a multiple of 8 bytes. /return message: packet that may or may not be multiple of 8 bytes - :return: packet that is 8-byte multiple + \return: packet that is 8-byte multiple """ message_length = len(message) @@ -160,9 +160,9 @@ """ gets the CRC in message - /return message: Dialin complete message with CRC + \param message: Dialin complete message with CRC - :return: CRC in message + \return: CRC in message """ crc_index = DenaliMessage.PAYLOAD_START_INDEX + DenaliMessage.getPayloadLength(message) @@ -174,7 +174,7 @@ """ verifies message CRC equals calculated message CRC - :return: TRUE if CRC matches, FALSE otherwise + \return: TRUE if CRC matches, FALSE otherwise """ if message is None: @@ -193,8 +193,8 @@ """ returns request ID from message - /return message: dictionary with channel_id and message keys - :return: integer with channel id + \param message: dictionary with channel_id and message keys + \return: integer with channel id """ @@ -205,9 +205,9 @@ """ returns request ID from packet - /return message: complete Diality Packet + \param message: complete Diality Packet - :return: integer with request ID + \return: integer with request ID """ msg_id_array = message['message'][DenaliMessage.MSG_ID_INDEX: @@ -219,17 +219,17 @@ def getPayloadLength(message): """ returns payload length from message - /return message: dictionary with channel_id and message keys - :return: a unsigned payload length + \param message: dictionary with channel_id and message keys + \return: a unsigned payload length """ return message['message'][DenaliMessage.PAYLOAD_LENGTH_INDEX] @staticmethod def getPayload(message): """ returns payload array from message - /return message: dictionary with channel_id and message keys - :return: a payload array if exist + \param message: dictionary with channel_id and message keys + \return: a payload array if exist """ payload_length = DenaliMessage.getPayloadLength(message) @@ -243,9 +243,9 @@ def getTotalPackets(message, is_array=True): """ returns the number of packets needed to transmit Denali Message - /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 + \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: number of packets """ the_message = message if is_array else message['message'] @@ -290,9 +290,9 @@ message = obj.push(msg3), return the packet which is the concatenation of msg1, msg2 and msg3 - /return can_message: an 8 byte message needed to build a diality message. + \param can_message: an 8 byte message needed to build a diality message. - :returns object + \returns object """ self.__message = can_message @@ -303,11 +303,11 @@ """ push appends the can_message to the current packet. - /return can_message: 8-byte message + \param can_message: 8-byte message - /return first_packet: True if it is the first packet received + \param first_packet: True if it is the first packet received - :return: None if the packet is not completed, otherwise returns the complete packet + \return: None if the packet is not completed, otherwise returns the complete packet """ if first_packet: self.__message = can_message @@ -334,9 +334,9 @@ """ DenaliCanMessenger constructor - /return can_interface - string containing the can interface, e.g., 'can0" + \param can_interface - string containing the can interface, e.g., 'can0" - :returns DialityCanMessenger object + \returns DialityCanMessenger object """ self.__bus = can.interfaces.socketcan.SocketcanBus(channel=can_interface) @@ -471,9 +471,9 @@ assign a function with packet parameter to an sync request id, e.g., def function(packet). - /return channel_id: can channel number where messages are received - /return message_id: Diality request ID in message - /return function: function reference + \param channel_id: can channel number where messages are received + \param message_id: Diality request ID in message + \param function: function reference """ # if the channel_id exist, we just update the dictionary for the channel_id @@ -488,10 +488,10 @@ """ sends can_packet to channel_id. - /return built_message: message built using DialinMessage class - /return time_out: time it will wait for a response in seconds + \param built_message: message built using DialinMessage class + \param time_out: time it will wait for a response in seconds - :returns: Diality Packet, it it times out it returns None + \returns: Diality Packet, it it times out it returns None """ channel_id = DenaliMessage.getChannelID(built_message)