
Description | Cautions | Example | Errors | See Also
Name: |
int scx_getbrdparm(devh, parm, valuep) | |
Inputs: |
int devh |
|
|
unsigned char parm |
|
|
void *valuep |
|
Returns: |
0 on success | |
Includes: |
scxlib.h | |
Category: |
Configuration | |
Mode: |
synchronous | |
The scx_getbrdparm( ) function retrieves board parameters. Parameters may be informative, defaults or values previously set by the scx_setbrdparm( ) function. Each parameter has a symbolic name defined in the scxlib.h file.
Parameter |
Description |
devh: |
Specifies the SCX160 SCxbus Adapter device handle. |
parm: |
Specifies the name of the parameter. See Table 12. SCX160 SCxbus Adapter Parameters below for a complete list of parameters. The user selectable parameters, designated by a "W" (write) in the "R/W" (read/write) column, can be set using the scx_setbrdparm( ) function. |
valuep: |
Points to the buffer where the parameter value will be returned. |
Ensure that the valuep buffer is large enough to receive the parameter value, see Table 12. SCX160 SCxbus Adapter Parameters below. This function will fail if an invalid device handle is specified.
Table 12. SCX160 SCxbus Adapter Parameters
Define |
B |
Default |
R/W |
Description |
SCXBP_SCX_CLOCK_MODE |
1 |
Default SCxbus clocking configured at download time. |
R/W |
Specifies clocking for the SCxbus interface of the SCX160 SCxbus Adapter. The SCxbus interface can be set to any of the following:
|
SCXBP_CLOCK_REF |
1 |
Default SCX160 Clock Reference Signal configured at download time. |
R/W |
Specifies source of the SCX160 SCxbus Adapter clock reference signal. The clock source can be any one of the following:
|
SCXBP_FIFO_ERR_THRESH |
4 |
0xFFFFFFFF |
R/W |
Specifies FIFO buffer error threshold that must be exceeded before an alarm is generated:
|
SCXBP_DRIVER_ERR_THRESH |
4 |
0xFFFFFFFF |
R/W |
Specifies SCX160 driver error threshold that must be exceeded before an alarm is generated:
|
SCXBP_SC_CLOCK_MODE |
1 |
Default SCbus clocking configured at download time. |
R/W |
Specifies clocking for SCbus interface of the SCX160 SCxbus Adapter. The SCbus interface can be set to any of the following:
|
SCXBP_SC_MAP |
2 |
SCbus data stream mapping configured at download time. |
R |
The SCbus data stream bitmap. The values are as follows:
|
SCXBP_SCX_MAP |
2 |
SCxbus data stream mapping configured at download time. |
R |
The SCxbus data stream bitmap. The values are as follows:
|
SCXBP_CLK_HISTORY |
1 |
0 |
R |
SCX160 Clock History Bitmask. Upon detection of a SCX160 Clock event, the value of this parameter may be retrieved to determine the specific clock event that was detected. When the SCXST_CLK_RECOVER bit is set in conjunction with another set bit, then the clock with the set bit is recovered. Otherwise, when the SCXST_CLK_RECOVER bit is 0, then any other set bit indicates that the clock with the set bit failed. The value of this parameter is set to 0 after the parameter is read. Possible values may be any combination of the following:
|
SCXBP_CLK_STATE_BYTE |
1 |
0 |
R |
SCX160 Clock State Bitmask. The value of this parameter may be retrieved to determine the current clock state of the SCX160 see (Chapter 4. Clocking). When set, indicates loss of clock. Possible values may be any combination of the following:
|
SCXBP_SCX_FIFO_STAT |
1 |
0 |
R |
SCX160 FIFO Fail Bitmask. Upon detection of a SCX160 FIFO Error, the value of this parameter may be retrieved to determine the specific FIFO error detected. Possible values may be any combination of the following:
|
SCXBP_SCX_BER_STAT |
1 |
0 |
R |
SCX160 Bit-Error-Rate Bitmask. Upon detection of a SCX160 Bus Driver Error, the value of this parameter may be retrieved to determine the specific error detected. Possible values may be any combination of the following:
|
SCXBP_SCX_BER_HISTORY |
4 |
0 |
R |
SCX160 Bit-Error-Rate History Bitmask. Upon detection of an SCX160 Bus Driver Error, the value of this parameter may be retrieved to determine the specific error detected. Possible values may be any combination of the following: The first two bytes provide the SCbus Bus Driver Error bitmap. The values are as follows:
The second two bytes provide the SCxbus Bus Driver Error bitmap. The values are as follows:
|
SCXBP_SC_DR_ERR_CNT |
32 |
none |
R |
SCbus Driver Error Count for each data stream is stored in a 16 bit counter. |
SCXBP_SCX_DR_ERR_CNT |
32 |
none |
R |
SCxbus Driver Error Count for each data stream is stored in a 16 bit counter. |
SCXBP_SC_FIFO_OVER_CNT |
24 |
none |
R |
SCbus FIFO Overflow Error Count. 12 - two byte hourly error count windows:
|
SCXBP_SCX_FIFO_OVER_CNT |
24 |
none |
R |
SCxbus FIFO Overflow Error Count. 12 - two byte hourly error count windows:
|
SCXBP_SC_FIFO_UNDR_CNT |
24 |
none |
R |
SCbus FIFO Underflow Error Count. 12 - two byte hourly error count windows:
|
SCXBP_SCX_FIFO_UNDR_CNT |
24 |
none |
R |
SCxbus FIFO Underflow Error Count. 12 - two byte hourly error count windows:
|
SCXBP_SC_FIFO_SKEW_CNT |
24 |
none |
R |
SCbus FIFO Skew Error Count. 12 - two byte hourly error count windows:
|
SCXBP_SCX_FIFO_SKEW_CNT |
24 |
none |
R |
SCxbus FIFO Skew Error Count. 12 - two byte hourly error count windows:
|
SCXBP_SCX_BOARD_STAT |
1 |
none |
R |
SCX160 Board Status Bitmask. This parameter may be retrieved to determine the current status of the SCX160 board (see Chapter 4. Clocking). Possible values may be any combination of the following: SCXBS_SELF_TEST - SCX160 Board Self Test Results (Bit 1):
SCXBS_DOWNLOAD - SCX160 Board Download State (Bit 2):
SCXBS_RUN_STATE - SCX160 Firmware Run State (Bit 3):
SCXBS_SCX_CLOCK_
|
Legend: |
| |||
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <srllib.h>
#include <scxlib.h>
int devh; /* SCX160 device handle */
unsigned char clock_mode; /* SCxbus Clock Mode */
/* Open SCX160 board */
if ((devh = scx_open("scxB1", 0)) == -1) {
printf("Cannot open board scxB1. errno = %d \n", errno);
exit(1);
}
/* Get the SCxbus clock mode */
if (scx_getbrdparm(devh, SCXBP_SCX_CLOCK_MODE, &clock_mode) == -1) {
printf("ERROR: scx_getbrdparm( ) failed, %s \n", ATDV_ERRMSGP(devh));
exit(1);
}
printf("SCX160 SCxbus clock mode is %s \n",
(clock_mode == SCXCM_MASTER) ? "MASTER" :
((clock_mode == SCXCM_SLAVE) ? "SLAVE" : "FALLBACK MASTER"));
/* Close the SCX160 Board */
scx_close(devh);
If the function returns -1, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code, or you can use the ATDV_ERRMSGP( ) function to obtain a descriptive error message. The error codes returned by ATDV_LASTERR( ) function are listed in Chapter 7. Errors.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation