Using SCBus mode with DM3 boards requires special function calls (_Ex functions). The CP SCBus API bypasses the dispatcher by accessing a file and communicating directly with the driver. These _Ex functions "remap" the existing CP/ScBus API function calls to redirect the SC Bus back to the Dispatcher.
GDK developers must recomplile their applications after using the _Ex functions.
I. Call the gl_listen function prior to submitting a queue record (Qrec) using GFQANSWER_IMMEDIATELY or GFQDIAL_SEND. This eliminates error code 3830 (GX0_NODIAL or no dial tone detected prior to dialing).
II. Use the gl_unlisten function call to free the ScBus timeslot when the line is disconnected. Please note that gl_listen and gl_unlisten will always return a --1 (not in the sample provided, but in the original file included in the install).
The _Ex functions are available under \fax\gl_scbus.cpp. These five macros should be defined in your header file before they can be remapped to the appropriate function:
#define gl_getxmitslot gl_getxmitslotEx #define gl_listen gl_listenEx #define gl_unlisten gl_unlistenEx #define gl_scenter gl_scenterEx #define gl_scexit gl_scexitEx
The following is an example of a header file defining the _Ex functions:
// Gammalink Header files
#ifdef __cplusplus
extern "C" {
#endif
#include "gamma.h"
#include "gfdboard.h"
#include "gfq.h"
#include "gfqpath.h"
#include "genra.h"
#include "gfxevent.h"
#include "gfqctl.h"
#include "gfdmsg.h"
#include "gfdipc.h" // <--- contain gfdRemoteFunction definition
#include "gfdstatu.h"
#include "gfxstate.h"
#include "gfsc.h" // <--- contain the original gl_listen,...
#ifdef __cplusplus
};
#endif
The following is the gl_scbus.ccp source code:
#define GFDLISTEN GFDBASE+100
#define GFDUNLISTEN GFDBASE+101
#define GFDGETTIMESLOT GFDBASE+102
#define GFDSCENTER GFDBASE+103
#define GFDSCEXIT GFDBASE+104
#define gl_getxmitslot gl_getxmitslotEx
#define gl_listen gl_listenEx
#define gl_unlisten gl_unlistenEx
#define gl_scenter gl_scenterEx
#define gl_scexit gl_scexitEx
int gl_getxmitslotEx( int chan, SC_TSINFO* tsinfop )
{
int status,result;
status=gfdRemoteRequest(0,chan,GFDGETTIMESLOT,0,0,NULL,0,&result);
if (status)
{
tsinfop->sc_tsarrayp[0] = 0;
return -1;
} else {
tsinfop->sc_tsarrayp[0] = result;
return 0;
}
}
int gl_listenEx( int chan, SC_TSINFO* tsinfop )
{
int status,result;
int timeslot = tsinfop->sc_tsarrayp[0];
status=gfdRemoteRequest(0,chan,GFDLISTEN, timeslot,timeslot,NULL,0,&result);
if (status)
{
return -1;
} else {
return 0;
}
}
int gl_unlistenEx(int chan)
{
int status,result;
status=gfdRemoteRequest(0,chan,GFDUNLISTEN, 0,0,NULL,0,&result);
if (status)
{
return -1;
} else {
return 0;
}
}
int gl_scenterEx(void)
{
int status,result;
status=gfdRemoteRequest(0,0,GFDSCENTER, 0, 0,NULL,0,&result);
if (status || result)
{
return -1;
}
return 0;
}
int gl_scexitEx(void)
{
int status,result;
status=gfdRemoteRequest(0,0,GFDSCEXIT, 0, 0,NULL,0,&result);
if (status || result)
{
return -1;
}
return 0;
}
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation