clarification of CAN interface commands

Comments

3 comments

  • Official comment
    Jeremy Wood

    Please refer to our updated documentation of `canSend` and `canMatch`, as well as new CAN interaction examples:

    Comment actions Permalink
  • Nick Vandehey

    As a followup on this, I've been able to get this  set command to execute:

    - command: canCfg CAN0 500000
    - command: operator "canSEND"
    - command: canSend CAN0 1 12

    But I'm generally confused of what the '12' represents in the data field of the canbus dataframe.
    Is it two ascii characters, '1' and '2'?  Is it interpreted as the 12(decimal)? Or Hex 0x12?

    Also for reference, I believe the following commands all experienced parsing errors in my exploration to try to get something to be sent.

    - command: canSend CAN0 1 50 4C
    - command: canSend CAN0 1 50 4C 12 45
    - command: canSend CAN0 1 50 1234
    0
    Comment actions Permalink
  • Jeremy Wood

    Thanks for pointing this out! We're updating our CAN command documentation to cover this, and include some examples.

    The piece we didn't explain in the docs is that the msgID and payload bytes can be specified as integer, hex, or binary, using the appropriate prefix. Here are some examples:

    # Integers
    - command: canSend CAN0 566 1 23 45
    # Hex
    - command: canSend CAN0 0x123 0x00 0x01 0x02 0x03
    # Binary
    - command: canSend CAN0 0b101001 0b11100 0b00001
    0
    Comment actions Permalink

Please sign in to leave a comment.