68#define OSMO_TRXC_F_CRITICAL (1 << 0)
70#define OSMO_TRXC_F_MATCH_PARAMS (1 << 1)
74 const char *cmd,
const char *fmt, ...);
86 uint8_t ver_use,
void *cb_data);
105 unsigned int freq_khz,
112 unsigned int freq_khz,
Definition: trxc_client.c:60
int log_cat
Definition: trxc_client.c:65
void * priv
Definition: trxc_client.c:63
A single de-/serialized TRXC message.
Definition: trxc.h:32
TRXC (control) protocol and clock indications: I/O-free message codec.
#define OSMO_TRXC_CMD_POWERON
Definition: trxc.h:48
#define OSMO_TRXC_CMD_TXTUNE
Definition: trxc.h:51
#define OSMO_TRXC_CMD_POWEROFF
Definition: trxc.h:49
#define OSMO_TRXC_CMD_RXTUNE
Definition: trxc.h:50
int osmo_trxc_client_set_name(struct osmo_trxc_client *client, const char *fmt,...)
Set the name (log prefix) of the given instance, e.g.
Definition: trxc_client.c:189
void osmo_trxc_client_set_fatal_error_cb(struct osmo_trxc_client *client, osmo_trxc_client_fatal_error_cb *cb)
set the fatal_error call-back (optional; default: log)
Definition: trxc_client.c:182
#define OSMO_TRXC_F_CRITICAL
escalate to the fatal_error call-back on NACK
Definition: trxc_client.h:68
void osmo_trxc_setformat_cb(struct osmo_trxc_client *client, uint8_t ver_use, void *cb_data)
TRXD PDU version negotiation result call-back.
Definition: trxc_client.h:85
int osmo_trxc_client_rsp_cb(struct osmo_trxc_client *client, const struct osmo_trxc_msg *rsp, void *cb_data)
Response call-back, invoked when a response to a command is received.
Definition: trxc_client.h:28
void osmo_trxc_client_set_log_cat(struct osmo_trxc_client *client, int log_cat)
Set the logging category (e.g.
Definition: trxc_client.c:207
int osmo_trxc_client_rx_msg(struct osmo_trxc_client *client, const struct osmo_trxc_msg *rsp)
Feed a received (parsed) response message into the engine.
Definition: trxc_client.c:380
int osmo_trxc_client_send_cmd(struct osmo_trxc_client *client, uint32_t flags, osmo_trxc_client_rsp_cb *cb, void *cb_data, const char *cmd, const char *fmt,...)
Enqueue a new command for transmission.
Definition: trxc_client.c:250
static int osmo_trxc_client_rxtune(struct osmo_trxc_client *client, unsigned int freq_khz, osmo_trxc_client_rsp_cb *cb, void *cb_data)
Definition: trxc_client.h:104
static int osmo_trxc_client_poweron(struct osmo_trxc_client *client, osmo_trxc_client_rsp_cb *cb, void *cb_data)
Definition: trxc_client.h:92
static int osmo_trxc_client_poweroff(struct osmo_trxc_client *client, osmo_trxc_client_rsp_cb *cb, void *cb_data)
Definition: trxc_client.h:98
void osmo_trxc_client_set_tx_msg_cb(struct osmo_trxc_client *client, osmo_trxc_client_tx_msg_cb *cb)
set the tx_msg call-back (mandatory before the first command is sent)
Definition: trxc_client.c:175
void osmo_trxc_client_fatal_error_cb(struct osmo_trxc_client *client, const struct osmo_trxc_msg *rsp)
Fatal error call-back, invoked when a critical command definitively fails (optional; default: log),...
Definition: trxc_client.h:49
int osmo_trxc_client_rx(struct osmo_trxc_client *client, const char *buf, size_t len)
Feed a datagram received on the ctrl socket into the engine.
Definition: trxc_client.c:479
void osmo_trxc_client_set_priv(struct osmo_trxc_client *client, void *priv)
Set the application-private data.
Definition: trxc_client.c:163
static int osmo_trxc_client_txtune(struct osmo_trxc_client *client, unsigned int freq_khz, osmo_trxc_client_rsp_cb *cb, void *cb_data)
Definition: trxc_client.h:111
void osmo_trxc_client_set_max_retrans(struct osmo_trxc_client *client, unsigned int n)
Set the maximum number of retransmissions of a command (default: 0).
Definition: trxc_client.c:229
void * osmo_trxc_client_get_priv(const struct osmo_trxc_client *client)
Obtain the application-private data.
Definition: trxc_client.c:169
void osmo_trxc_client_flush(struct osmo_trxc_client *client)
Flush (drop) all pending commands.
Definition: trxc_client.c:307
int osmo_trxc_client_negotiate_format(struct osmo_trxc_client *client, uint8_t ver_max, osmo_trxc_setformat_cb *cb, void *cb_data)
Negotiate the TRXD PDU version with the transceiver (SETFORMAT).
Definition: trxc_client.c:550
int osmo_trxc_client_set_retrans(struct osmo_trxc_client *client, unsigned int sec)
Set the retransmit timeout in seconds (default: 2).
Definition: trxc_client.c:216
struct osmo_trxc_client * osmo_trxc_client_alloc(void *ctx)
Allocate a TRXC client instance.
Definition: trxc_client.c:133
void osmo_trxc_client_free(struct osmo_trxc_client *client)
Free the given TRXC client instance (flushes the command queue).
Definition: trxc_client.c:153
int osmo_trxc_client_tx_msg_cb(struct osmo_trxc_client *client, const struct osmo_trxc_msg *msg)
Transmit call-back, invoked to emit a parsed TRXC message (mandatory, see osmo_trxc_client_set_tx_msg...
Definition: trxc_client.h:40