libosmo-trx/client: add TRXC client (command queue) API
Add the osmo_trxc_client module: a transport-agnostic generalization of the TRXC command handling logic in osmo-bts-trx (trx_if.c):
* command queue with a single command in flight; * retransmission on response timeout (default: 2 s); * suppression of consecutive duplicate commands; * RSP<->CMD matching, optionally including the parameters; * filtering of duplicate responses caused by retransmissions; * escalation of NACKed critical commands (OSMO_TRXC_F_CRITICAL) to the fatal_error call-back; * TRXD PDU version negotiation (SETFORMAT), incl. the fallback to version 0 for old transceivers rejecting it with 'RSP ERR 1'.
The client neither opens nor owns a socket: the application transmits serialized messages in the tx_msg call-back and feeds received datagrams into osmo_trxc_client_rx(). The response call-back may return N > 0 to request a re-transmission of the same command after N seconds (e.g. POWERON retry, as implemented in osmo-bts-trx).