|
|
Subscribe / Log in / New account

IR decoding with BPF

IR decoding with BPF

Posted Jul 10, 2018 15:39 UTC (Tue) by chris.sykes (subscriber, #54374)
In reply to: IR decoding with BPF by dgm
Parent article: IR decoding with BPF

I suspect support for Modbus TCP, which uses length prefixed framing, was added first, with RTU coming later, and they kept the "how many bytes am I still waiting for" code in the common layer.

It's difficult to do RTU frame timing properly from user-space, without RT scheduling; and you really want control over the RX FIFO interrupt thresholds in the UART as well.

I've often thought making Modbus RTU serial line discipline, that exposed a socket API (like socketCAN), would make an interesting project, but so far, haven't found the time...


to post comments

IR decoding with BPF

Posted Jul 11, 2018 7:22 UTC (Wed) by shiftee (subscriber, #110711) [Link] (1 responses)

So do you think BPF could be modified (in theory at least) to read Modbus RTU packets and somehow provide them to user space as length prefixed frames?

IR decoding with BPF

Posted Jul 11, 2018 9:44 UTC (Wed) by Darkmere (subscriber, #53695) [Link]

Probably. One of the interesting use cases for that is a system where you have multiple speeds on the same physical network.

With rs485 you then want to decode traffic in multiple speeds at once to find out which traffic is modbus RTU and which is some other traffic.
(It’s common enough to have Mbus at 2400 bps and modbus at 9600 and 19200. And no. It ain’t pretty)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds