A Grid Connect formatted CAN message.
This is an ASCII formatted version of a CAN message, used by some USB connected CAN interface devices.
This class is used to convert from binary CAN Messages to ASCII Grid Connect messages. See GridConnectReply for converting from ASCII Grid Connect messages to binary CAN Messages.
Options:
- -canmessage A binary CANMessage to be converted to a Grid Connect message. A write only option.
- -extended A boolean flag to indicate if this is an extended protocol message. Default no.
- -rtr A boolean flag to indicate if this is a reply exptected message. Default no.
- Additional methods defined using the macros AbstractMessage and AbstractMRMessage include:
- getElement {n} – Get the nth data element.
- getNumDataElements {} – Get the number of data elements.
- setElement {n v} – Set the nth data element.
- setOpCode {i} – Set the opcode (byte 0).
- getOpCode {} – Get the opcode (byte 0).
- getOpCodeHex {} – Get the opcode (byte 0) in hex.
- setNeededMode {pMode} – Set the needed mode.
- getNeededMode {} – Get the needed mode.
- replyExpected {} – Returns reply expected flag.
- isBinary {} – Returns binary flag.
- setBinary {b} – Set the binary flag.
- setTimeout {t} – Set the timeout.
- getTimeout {} – Get the timeout.
- setRetries {i} – Set the number of retries.
- getRetries {} – Get the number of retries.
- addIntAsThree {val offset} – Insert an integer as three decimal digits (with leading 0s).
- addIntAsTwoHex {val offset} – Insert an integer as two hexadecimal digits (with leading 0s).
- addIntAsThreeHex {val offset} – Insert an integer as three hexadecimal digits (with leading 0s).
- addIntAsFourHex {val offset} – Insert an integer as four hexadecimal digits (with leading 0s).
- setNumDataElements {n} – Set the number of data bytes.
- toString {} – Return the data object as a string.
- And these (private) instance variables:
- _dataChars {}
- _nDataChars 0
- mNeededMode 0
- _isBinary false
- mTimeout 0
- mRetries 0
- And these (private) static variables:
- SHORT_TIMEOUT 2000
- LONG_TIMEOUT 60000