4 Configuration and Operation
30
#include "pack.h" /* Prototypes for rpackbytes */
#include "ss7_inc.h" /* Message & module definitions */
/*
* Macro to generate the value for use in the rsp_req field of the
* message header in order to request a confirmation message:
*/
#define RESPONSE(module) (((unsigned short) 1) << ((module) & 0x0f))
/*
* Function to drive an SCbus / CT bus timeslot
* onto a timeslot on a PCM port:
*/
int listen_to_scbus(board_id, liu_id, timeslot, sc_channel)
int board_id; /* board_id (0, 1, 2 ...) */
int liu_id; /* PCM port id (*/
int timeslot; /* Timeslot on the PCM port (1 .. 31) */
int sc_channel; /* SCbus / CT bus channel number */
{
MSG *m;
u8 *pptr;
/*
* Allocate a message (and fill in type, id, rsp_req & len):
*/
if ((m = getm(MVD_MSG_SC_LISTEN, 0, RESPONSE(OUR_MOD_ID), MVDML_SCLIS))
!= 0)
{
pptr = get_param(m);
memset(pptr, 0, m->len);
/*
* Enter the parameters in machine independent format:
*/
rpackbytes(pptr, MVDMO_SCLIS_liu_id, (u32)liu_id, MVDMS_SCLIS_liu_id);
rpackbytes(pptr, MVDMO_SCLIS_timeslot, (u32)timeslot,
MVDMS_SCLIS_timeslot);
rpackbytes(pptr, MVDMO_SCLIS_sc_channel, (u32)sc_channel,
MVDMS_SCLIS_sc_channel);
m->hdr.dst = MVD_TASK_ID;