guitarpicva / radcommlink

A Qt client layered above a working installation of PAT for two-way radio message forwarding. See: https://getpat.io or https://github.com/la5nta/pat
1 stars 0 forks source link

Have you consider using Pat's HTTP API? #1

Closed martinhpedersen closed 4 years ago

martinhpedersen commented 5 years ago

Hi Mitch,

Very interesting project your working on here. I haven't had time to compile it yet, but I will hopefully do that soon :)

Have you considered using the HTTP API instead of reading/writing the raw b2f messages, and controlling Pat via the command line interface?

The JSON API exposed over HTTP will probably be more stable, and you would get the benefits from the code I've written to encode/decode B2F messages (including proper charset handling, attachments) etc.

(You could also compile the various packages in github.com/la5nta/wl2k-go as C libraries if you think that would be of value to your project. But I guess that will get very complex.)

Just some thoughts :)

guitarpicva commented 4 years ago

Martin, Raw b2f messages are pretty trivial text processing. Simpler for me than adding yet another API to the mix. I do text processing on steroids in most every project.

Control via ascii or hex commands is also something that is an industry standard in hardware radios/ALE controllers and modems. This is also something I do all day every day, so it makes sense to me.

The only missing commands in my mind for pat are "disconnect" and "abort". I think it would make the pat command set complete and then the user would not have to know the different ways to interrupt the process in the shell, depending on OS in play. In other words, do the SIGINT FOR the user by a standard command. Thus the end user is shielded from any "abnormalities" of the underlying shell. Usually it's just Ctrl+C but one never knows.

My issue with the disconnect/abort process has been that I cannot identify the actual PID for the connection that needs to be shut down. If the pat process which processes the shell commands/interrups knows how to do this, it seems only logical to me to offer those two commands.