The following software code demonstrates how you can determine the Global Call protocol version you are running.
#include <gclib.h>
#include <gcerr.h>
#include <srllib.h>
int main()
{
LINEDEV ldev;
GC_PARM parm;
int retcode;
METAEVENT metaevent;
parm.paddress = NULL;
int mode;
#ifdef _WIN32
mode = SR_STASYNC|SR_POLLMODE;
#else
mode = SR__POLLMODE;
#endif
if (sr_setparm(SRL_DEVICE, SR_MODELTYPE, &mode) == -1)
{
// Error processing
}
gc_Start(NULL);
retcode = gc_Open(&ldev,":P_na_an_io:V_dxxxB1C1", 0);
if (retcode != GC_SUCCESS)
{
// Error processing
}
sr_waitevt(50);
retcode = gc_GetMetaEvent(&metaevent);
if (retcode != GC_SUCCESS)
{
// Error processing
}
if (metaevent.flags & GCME_GC_EVENT)
{
if (metaevent.evttype == GCEV_UNBLOCKED)
{
if (gc_GetParm(ldev, GCPR_PROTVER, &parm) ==
GC_SUCCESS)
{
printf("The protocol version: %s\n", parm.paddress);
}
else
{
// Error processing
int gc_error;
int cclibid;
long cc_error;
char* gc_msg;
char* cc_msg;
gc_ErrorValue(&gc_error, &cclibid, &cc_error);
gc_ResultMsg(LIBID_GC, (long)gc_error, &gc_msg);
gc_ResultMsg(cclibid, cc_error, &cc_msg);
printf("gc_GetParm(GCPR_PROTVER) failed! GC(0x%lx) -
%s; CC(0x%lx) - %s\n",
gc_error, gc_msg, cc_error, cc_msg);
return (gc_error);
}
}
}
gc_Close(ldev);
gc_Stop();
return(0);
}
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation