Prosody data communications: API: smdc_tx_status

Prototype Definition

int smdc_tx_status(struct smdc_tx_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct smdc_tx_status_parms {
	tSMChannelId channel;					/* in */
	tSM_INT capacity;					/* out */
	enum kSMDCTxStatus {
		kSMDCTxStatusEmpty,
		kSMDCTxStatusHasCapacity,
		kSMDCTxStatusNoCapacity,
		kSMDCTxStatusUnderrun,
		kSMDCTxStatusFinishing,
		kSMDCTxStatusFinished,
	} status;						/* out */
	tSM_INT flow;						/* out */
} SMDC_TX_STATUS_PARMS;

Description

Report the status of the output half of a channel.

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.
capacity
The currently available capacity (in octets) to buffer more output data. Only valid if the status field reports kSMDCTxStatusHasCapacity.
status
The output status. One of these values:
kSMDCTxStatusEmpty
The transmitter has sent all data and is ready for more. This status is only reported where explicitly stated in the documentation of individual protocols
kSMDCTxStatusHasCapacity
The transmitter has some capacity to buffer more data, but has not yet sent all data previously buffered.
kSMDCTxStatusNoCapacity
The transmitter has no capacity to buffer more data.
kSMDCTxStatusUnderrun
At an inappropriate point the transmitter has run out of data to send.
kSMDCTxStatusFinishing
The application has used the command kSMDCTxCtlFinish but the transmitter has not yet sent all buffered data.
kSMDCTxStatusFinished
The transmitter has finished with data communications. When this status is reported, the channel's output 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_tx_status() will report the error ERR_SM_WRONG_CHANNEL_STATE.
flow
Indicator of whether the transmitter has been stopped by flow control (non-zero) or not (zero).

Returns

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


This function is part of the Prosody data communications API.