
Description | Cautions | Example | Errors | See Also
Name: |
int cc_GetVer(linedev, majorp, minorp) | |
Inputs: |
LINEDEV linedev |
|
int *majorp |
| |
int *minorp |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Optional call handling | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_GetVer( ) function retrieves the firmware version number associated with the specified line device handle. The firmware version number consists of two parts: the major version number and the minor version number.
Parameter |
Description |
linedev: |
The specified line device handle. |
majorp: |
Pointer to the space prepared to receive the major firmware version number. |
minorp: |
Pointer to the space prepared to receive the minor firmware version number. |
None
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
void main()
{
short devhdl; /* device handle for D channel */
int majnum; /* major version number */
int minnum; /* minor version number */
.
.
.
if ( cc_Open(devhdl,"dtiB1", 0 ) < 0 )
printf("Error opening device: errno = %d\n", errno);
/*
* Use cc_GetVer() to get the version values.
*/
if ( cc_GetVer(devhdl,&majnum,&minnum) < 0 )
procdevfail(devhdl);
else
printf("Major version number 0x%x, minor version number 0x%x\n"
,majnum,minnum);
/* continue the program. */
.
.
.
.
.
if ( cc_Close(devhdl) < 0 )
printf("Error closing device, errno = %d\n", errno);
}
int callfail(CRN crn)
{
LINEDEV ld;
cc_CRN2LineDev(crn,&ld);
procdevfail(ld);
}
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;
reason = cc_CauseValue(handle);
cc_ResultMsg(handle,reason,&msg);
printf("reason = %x - %s\n",reason,msg);
}
If the function returns < 0 to indicate failure, use the cc_CauseValue( ) function to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be used to interpret the reason code. Error codes are defined in the files ccerr.h, isdnerr.h, and isdncmd.h.
Typically, a < 0 return code for the cc_GetVer( ) function indicates that the function reference (the device handle) is not valid for the function call.
None
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation