A Grid Connect formatted CAN message (reply).
This is an ASCII formatted version of a CAN message, used by some USB connected CAN interface devices.
This class is used to convert to binary CAN Messages from ASCII Grid Connect messages. See GridConnectMessage for converting to ASCII Grid Connect messages from binary CAN Messages.
Options:
- -extended A boolean flag to indicate if this is an extended protocol message. Readonly and not settable.
- -rtr A boolean flag to indicate if this is a reply exptected message. Readonly and not settable.
- -message A received GridConnectMessage to be converted to a binary CanMessage. Settable only.
- 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