Prosody Framer: API

The following functions are provided by the Prosody Framer API:

API call W Description
sm_framer_create()   Create a Framer
sm_framer_datafeed_connect()   Connect a datafeed to an input of a Framer .
sm_framer_datafeed_disconnect()   Disconnect a datafeed from a Framer.
sm_framer_destroy()   Destroy a Framer
sm_framer_get_datafeed()   Get datafeed from Framer.
sm_framer_get_event()   Get an event object for the Framer
sm_framer_status()   Fetch status info on Framer

This document is also available as separate pages for each function.


Prosody Framer: API: sm_framer_create

Prototype Definition

int sm_framer_create(struct sm_framer_create_parms *createp)

Parameters

*createp
a structure of the following type:
typedef struct sm_framer_create_parms {
	tSMFramerId framer;					/* out */
	tSMModuleId module;					/* in */
} SM_FRAMER_CREATE_PARMS;

Description

Creates a Framer .

Fields

framer
The created framer.
module
A value obtained from sm_open_module() which indicates the module on which the framer is to be created.

Returns

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


Prosody Framer: API: sm_framer_datafeed_connect

Prototype Definition

int sm_framer_datafeed_connect(struct sm_framer_datafeed_connect_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_framer_datafeed_connect_parms {
	tSMDatafeedId data_source;				/* in */
	tSMFramerId framer;					/* in */
	tSM_INT direction;					/* in */
} SM_FRAMER_DATAFEED_CONNECT_PARMS;

Description

Connect a datafeed to one of the inputs of the Framer.

Fields

data_source
The datafeed object to be connected.
framer
The framer to connect the datafeed to.
direction
The input to which the datafeed is to be connected. If direction is 0, then the enframer-side input is connected. If direction is 1, then the deframer-side input is connected.

Returns

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


Prosody Framer: API: sm_framer_datafeed_disconnect

Prototype Definition

int sm_framer_datafeed_disconnect(struct sm_framer_datafeed_disconnect_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_framer_datafeed_disconnect_parms {
	tSMFramerId framer;					/* in */
	tSM_INT direction;					/* in */
} SM_FRAMER_DATAFEED_DISCONNECT_PARMS;

Description

Disconnect a datafeed on one of the inputs of the Framer.

Fields

framer
The framer to disconnect the datafeed from.
direction
The input of the framer to be disconnected. If direction is 0, then the enframer-side input is disconnected. If direction is 1, then the deframer-side input is disconnected.

Returns

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


Prosody Framer: API: sm_framer_destroy

Prototype Definition

int sm_framer_destroy(tSMFramerId framer)

Parameters

framer
The Framer to destroy. Must have been previously created by a call to sm_framer_create() .

Description

Destroys a Framer.

Returns

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


Prosody Framer: API: sm_framer_get_datafeed

Prototype Definition

int sm_framer_get_datafeed(struct sm_framer_datafeed_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_framer_datafeed_parms {
	tSMFramerId framer;					/* in */
	tSM_INT direction;					/* in */
	tSMDatafeedId datafeed;					/* out */
} SM_FRAMER_DATAFEED_PARMS;

Description

Request a datafeed identifier from a Framer . This identifier can subsequently used in a call such as sm_tdmtx_datafeed_connect() or sm_channel_datafeed_connect().

Fields

framer
The framer from which to obtain a datafeed.
direction
The direction of datafeed to fetch. If direction is 0, then the enframer-side datafeed is fetched. If direction is 1, then the deframer-side datafeed is fetched.
datafeed
The datafeed object associated with the Framer .

Returns

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


Prosody Framer: API: sm_framer_get_event

Prototype Definition

int sm_framer_get_event(struct sm_framer_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_framer_event_parms {
	tSMFramerId framer;					/* in */
	tSMEventId event;					/* out */
} SM_FRAMER_EVENT_PARMS;

Description

Returns an event object for the framer that can be waited on using smd_ev_wait() . The event will be signalled when a status change occurs on the framer.

Fields

framer
The framer.
event
The event identifier.

Returns

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


Prosody Framer: API: sm_framer_status

Prototype Definition

int sm_framer_status(struct sm_framer_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_framer_status_parms {
	tSMFramerId framer;					/* in */
	enum kSMFramerStatus {
		kSMFramerStatusRunning,
		kSMFramerStatusStopped,
		kSMFramerStatusNewState,
	} status;						/* out */
	tSM_INT new_state;					/* out */
} SM_FRAMER_STATUS_PARMS;

Description

Returns the status of the Framer.

Fields

framer
The Framer.
status
The status. One of these values:
kSMFramerStatusRunning
The framer is running
kSMFramerStatusStopped
The framer is not running
kSMFramerStatusNewState
The framer has changed state
new_state
The new state of the framer. Only valid when the status field is kSMFramerStatusNewState. If new_state is 0, then the framer is now out of sync. If new_state is 1, then the framer is now in sync.

Returns

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


These functions constitute the Prosody Framer API.