PREV TOC HOME INDEX NEXT


ms_getbrdparm( )


Cautions | Errors | Example | See Also

Name: int ms_getbrdparm (devh, param, valuep)
Inputs:

int devh

  • MSI device handle

unsigned long param

  • device parameter defined name

void *valuep

  • pointer to variable where the parameter value will be placed
Returns:

0 on success

-1 on failure

Includes:

srllib.h

dtilib.h

msilib.h

Category:

Configuration

Mode:

synchronous

Platform:

DI, HDSI, Springware

Description

The ms_getbrdparm( ) function returns board parameters. Each parameter has a symbolic name that is defined in dtilib.h and msilib.h.

Parameter

Description

devh valid device handle returned by a call to ms_open( )
param parameter to be examined; see the ms_setbrdparm( ) function description for details. Note: On DM3 boards, only MSG_RNG is supported for this function.
valuep pointer to the variable where the parameter value will be returned

Cautions

Errors

If this function returns -1 to indicate failure, obtain the reason for the error by calling the SRL standard attribute function ATDV_LASTERR( ) or ATDV_ERRMSGP( ) to retrieve either the error code or a pointer to the error description, respectively.

Refer to the error type tables found in Chapter 5, "Error Codes". Error defines can be found in dtilib.h or msilib.h.

Example

#include <windows.h>          /* For Windows applications only */
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"  
main()
{
   int    devh;               /* MSI/SC board device descriptor */
   int    value;              /* Parameter value */
   int    cadence[8];         /* Ring cadence length and pattern */
   int    cadence_len;        /* Cadence active period length (in bytes) */  
   if ((devh = ms_open("msiB1", 0)) == -1) {
      printf("Error opening msiB1 : errno = %d\n", errno);
      exit(1);
   }  
   /* Determine board type : Ringing or Non-ringing */  
   if (ms_getbrdparm(devh, MSG_RING, (void *)&value)) == -1) {
      printf("Error retrieving board parameter : %s\n ", ATDV_ERRMSGP(devh));
      exit(1);
   }  
   if (value == MS_RNGBRD){
      printf("You have a ringing MSI/SC board\n");
   }
   else
      printf("You have a non-ringing MSI/SC board\n");  
   /* Retrieve the board's ring-cadence pattern */  
   if (ms_getbrdparm(devh, MSG_RNGCAD, (void *)&cadence[0]))== -1) {
      printf("Error retrieving board parameter : %s\n ", ATDV_ERRMSGP(devh));
      exit(1);
   }
   printf("The ring cadence is %d x 250ms long\n", cadence[0]);
   cadence_len = (cadence[0]+7)/8;  
   for (index = 1; index <= cadence_len; index++) {
      printf("Active period cadence pattern is 0x%x\n", cadence[index]);
   }  
   if (ms_close(devh) == -1) {
      printf("Error Closing msiB1 : errno = %d\n", errno);
      exit(1);
   }
   return;
}  

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated January, 2003