Hacker News new | ask | show | jobs
by eternityforest 997 days ago
What would a better protocol look like? Backwards compatibility is pretty nice in a lot of areas.
2 comments

I understand that there were good reasons why it was done. But out-of-band control is so much nicer to work with. One channel for control, one for data.

No parsing of text. No escaping of '+++' to avoid that a '+++ATH' in the data stream closes the connection (I wonder how the download time of a file containing only '+' differs from a file with other characters).

And with increasing mobile network speeds, you really want something like DMA instead of reading individual bytes from a serial interface.

Modern modems have "buffer access mode" for this. When you need to receive data, modem notifies you with a message '+QIURC: "recv",<connection>,<len>', then you send 'AT+QIRD=<conn>,<len>' and you know next <len> bytes are data, without any parsing.
+++ATH in the data stream did not close the connection unless the modem was really stupid, or misconfigured. The actual protocol was:

<pause>+++<pause>ATH<CR>

The pauses, I think 1 second by default, were exactly for this reason. "+++ATH" racing by in a data stream would be transmitted as is.

I think Hayes had a patent on requiring the pause, so competitors' modems sometimes didn't enforce the pause aspect of the design?

Or is that an urban legend of some sort?

Yes, you're looking for US patent 4,549,302:

> Thus, even if the file being transmitted [...] includes occurrences of the escape command string of bits, it is extremely unlikely that any random occurrence of the escape command would occur unintentionally in the environment of the entire escape sequence, that is, the escape command string surrounded by a second of no data on either side.

I don't know what the modern commands look like, but I hope that at least they abolished the in-band signalling so you don't have to do <wait 1 second> +++ <wait 1 second> .
For newest Quectel BG95 LTE Cat M1 you can either use buffer access mode (AT+QIRD for receiving data) or still use that in-band signalling (direct push mode) with +++. You could also use external pin for exiting from that direct mode, but +++ is still available and useable when you don't have any more free pins on your MCU.