> Thinking more about it, a specialized rtcanmultisend.c in
> "examples/rtdm/profiles/can" would be nice. Please also provide an
> example input file.

Here is my rtcansendmulti.c:

             https://gist.github.com/dmd/5416474


By default, it operates exactly the same as the current rtcansend (so
this could just replace the existing rtcansend - there's no real
reason to have both).

If a filename option is provided, it ignores any <can-msg> that may be
present on the command line, and instead reads that file line at a
time, treating each line as if it were a command line. The updated
help should explain this:

    Usage: ./rtcansendmulti <can-interface> [Global Options] [<can-msg>]

    Global Options:
      -f, --file=filename   filename to read from, or - for stdin
                            <can-msg> will be ignored if a file is specified
      -L, --loopback=0|1    switch local loopback off or on
      -v, --verbose         be verbose
      -t, --timeout=MS      timeout in ms
      -s, --send            use send instead of sendto
      -h, --help            this help

    Global Options OR any line in file:
      -i, --identifier=ID   CAN Identifier (default = 1)
      -d, --delay=MS        delay in ms (default = 1ms)
      -r  --rtr             send remote request
      -e  --extended        send extended frame
      -l  --loop=COUNT      send message COUNT times
      -c, --count           message count in data[0-3]
      -p, --print=MODULO    print every MODULO message

    filename (or - for stdin) contains lines of the format:
    [Options] [<can-msg>]

    Blank lines are ignored.
    # comments out the remainder of a line.


If an option is given on a particular line in a file, that option
overrides the specified global option for that line only.

For example, I might have a file foo which contains:

# this is a comment
-i 0x601 0x40 0x41 0x60 0x00 #this is another comment
0x40 0x41 0x60 0x00

And I run:
rtcansendmulti rtcan0 -v -i 0x602 -f foo

I will see:
    interface rtcan0
    s=1, ifr_name=rtcan0
    <0x601> [4] 40 41 60 00
    <0x602> [4] 40 41 60 00
    Cleaning up...

Note that the first line was sent to cobid 0x601 (specified on that
line), and the second to globally specified 0x602.

Let me know if you have any questions.

Daniel

_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to