feat(examples): add ACF-LIN talker/listener example - #138
Conversation
Add a pair of example applications demonstrating use of the ACF-LIN PDU (IEEE Std. 1722-2016, chapter 9.4.5): - acf-lin-talker: sends a simulated LIN frame once per second over Ethernet (raw TSN) or UDP, carrying a single-byte incrementing counter as payload. Supports NTSCF and TSCF control formats. - acf-lin-listener: receives ACF-LIN packets and prints the LIN bus ID, identifier, message timestamp, and raw payload bytes to stdout. CLI options follow the same conventions as the other examples: -t/--tscf, -u/--udp, -i/--ifname, -d/--dst-addr, -n/--dst-nw-addr (talker); -u/--udp, -i/--ifname, -d/--dst-addr, -p/--udp-port (listener). Both binaries are linked against the existing open1722 and open1722examples libraries. The new subdirectory is wired into the Linux-only block in examples/CMakeLists.txt. Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
|
Hi @SoundMatt Thank you for your pull request and interest in incorporating LIN examples into the Open1722 project. There is apparently LIN support in Linux kernel: https://lwn.net/Articles/916049/. Or one can use https://github.com/lin-bus/linux-lin, analogous to the socketCAN. Currently none of us are actively looking into LIN options in Linux. Would you be interested in this, @SoundMatt? |
Closes #21
Summary
Adds a pair of Linux example applications for the ACF-LIN PDU format (IEEE Std. 1722-2016, chapter 9.4.5):
examples/acf-lin/acf-lin-talker.cexamples/acf-lin/acf-lin-listener.cexamples/acf-lin/CMakeLists.txthello-worldpattern)examples/CMakeLists.txtgains anadd_subdirectory(acf-lin)inside the existing Linux-only block.Design
Since LIN has no standard Linux socket API (unlike SocketCAN for CAN), the talker simulates LIN data — an incrementing single-byte counter — sent periodically. Both tools follow the CLI conventions of the other examples:
Talker options
-t/--tscf— use TSCF instead of NTSCF-u/--udp— use UDP instead of Ethernet-i/--ifname IFNAME— Ethernet interface-d/--dst-addr MACADDR— destination MAC-n/--dst-nw-addr HOST:PORT— UDP destination--lin-bus-id N— LIN bus ID (0-31, default 0)--lin-id N— LIN frame identifier (0-63, default 1)Listener options
-u/--udp,-i/--ifname,-d/--dst-addr,-p/--udp-portTest plan