2 ms·
Thanks, that's helpful. I've toying with porting some code I wrote (in Java) to access an embedded GSM modem over the serial port to Go as a learning exercise,
by jrabone 14y ago
Thanks, that's helpful. I've toying with porting some code I wrote (in Java) to access an embedded GSM modem over the serial port to Go as a learning exercise, hence thinking about the "right" way to handle the underlying read/write semantics.
What you say is exactly the class of problems I've previously encountered when, for example, you're trying to send an SMS via AT commands and the modem does something asynchronously (eg. RING indicator, or a periodic signal quality report), and you lose track of who's supposed to get the trailing "OK". Very tedious. In Java I implemented the equivalent of a bidi channel with some timeout tricks for buffering up entire response lines, but it wasn't much fun.