Hi

I'm developing web interface for a RF transceiver which communicates via serial interface exposed by CDC-ACM. Communication protocol is custom made and consists of structured binary messages.

Basically I need to write command or data message to serial port and read response from port. I also need to implement interpreter for the communication protocol to compile commands and handle responses. Just an example.

When sending command

0x11, 0x00, 0x03

to transceiver, it responds with

0x11, [length byte], 0x03, [payload bytes]

What is OpenWRT way doing it?

a) Should I develop web interface only for persisting configuration in file with help of LuCI CBI and "buttons" for calling external application which handles communications with the device. Of course I need to develop that external application also.
Should I use stdin, stdout and stderr to communicate with external application?

b) Should I implement serial read and write; and data processing in Lua and in luci-application-X package?