Does it ever get reset?
What if there are multiple conversations on the same port (4992)
Do these help distinguish sessions?
Is this covered anywhere?
The sequence number on the command (like C1|slice c freq=....) is supplied by the client and is echoed back by the radio in the R response. The sequence number is solely for the benefit of the client to be able to match commands and responses... critical in a multi-threaded client.
Most clients increment the sequence number monotonically but the radio doesn't check. For example, if you are manually sending api commands via telent, there is nothing to stop you using the same serial number for every command - like 1!
Each connection to the radio on port 4992 is identified by TCP using TWO port numbers - 4992 which is the port on the radio and some system supplied port number on the client. The same client can open multiple connections to the radio and each one is unique - its the combination of the port number PAIR that identifies the conversatio - aka a TCP stream.
Serial numbers for commands are only relevant with a single stream - you could have two commands issued with the same serial number on different streams and the radio will have no problems.
Hope this helps.
and I get the proper reply: Received *** R1|0|
But status after comes with an S2
It works, just confused with the numbering. This is in the same program session.
BTW, what is a type M response? as in: Received *** M10000001|Client connected from IP 192.168.x.x
Status messages have the form S<handle>| where the <handle> identifies which client initiated the command that caused the status update. When you connect to the radio you always get the following sequence back...
The first is the version of the API supported by the radio to which you are connected. The second is the <handle> the radio has assigned to this client connection. Each connection will have a unique handle. This way you can distinguish between general radio status updates (sent with handle 0) and the specific handle. Sometimes you will get a status message resulting from a change you made - then the handle will the one assigned above - this way you can choose what to do with status messages resulting from changes you made (I generally ignore them as I already know the answer!).
The M response is just a message. As a client you can choose what to do with them - SmartSDR displays a little pop up window in the lower right of the screen. I don't know the significance of the number associated with the M - I suspect its bit fields relating to radio subsystem but this is a semi-educated wild assed guess on my part.