Prosody data communications: API: smdc_rx_status

Prototype Definition

int smdc_rx_status(struct smdc_rx_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct smdc_rx_status_parms {
	tSMChannelId channel;					/* in */
	tSM_INT available_octets;				/* out */
	enum kSMDCRxStatus {
		kSMDCRxStatusEmpty,
		kSMDCRxStatusData,
		kSMDCRxStatusOverrun,
		kSMDCRxStatusCarrier,
		kSMDCRxStatusFinished,
		kSMDCRxStatusSigMetric,
	} status;						/* out */
	tSM_INT flow;						/* out */
	union {
		struct {
			tSM_INT carrier;			/* out */
		} carrier;					/* out */
		struct {
			tSM_INT metric;				/* out */
		} metric;					/* out */
	} u;							/* out */
} SMDC_RX_STATUS_PARMS;

Description

Reports the status of a channel whose input half has been configured for data communications.

See also the document Prosody Data Communcations Protocols and Encodings for details of behaviour specific to individual protocols and encodings.

Fields

channel
The data communication channel.
available_octets
The amount of data currently buffered in this channel. Only valid if the status field reports kSMDCRxStatusData.
status
The receiver status. One of these values:
kSMDCRxStatusEmpty
No data is available for reading.
kSMDCRxStatusData
Some data is available for reading.
kSMDCRxStatusOverrun
Data has been lost because the buffer has overflowed.
kSMDCRxStatusCarrier
The input half has begun or stopped receiving a meaningful signal.
kSMDCRxStatusFinished
The receiver has finished with data communications. When this status is reported, the channel's input half reverts to the idle state that it was in before smdc_channel_config() was used. Therefore it can be re-configured or used for another purpose and a subsequent call to smdc_rx_status() will report the error ERR_SM_WRONG_CHANNEL_STATE.
kSMDCRxStatusSigMetric
The receiver is reporting a measurement relating to received signal prior to receiver termination. This status only occurs if receiver has been configured to report this metric.
flow
Indicator of whether the receiver has stopped incoming data by using flow control (non-zero) or not (zero).
u
Additional information specifying the current status
carrier
This field is only valid if the status is kSMDCRxStatusCarrier
carrier
The current carrier status: zero=off, non-zero=on.
metric
This field is only valid if the status is kSMDCRxStatusSigMetric
metric
A measure of received signal.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody data communications API.