PREV TOC HOME INDEX NEXT


ms_setstparm( )


Cautions | Errors | Example | See Also

Name: ms_setstparm (devh, param, valuep)
Inputs:

int devh

  • MSI station device handle

unsigned char param

  • parameter name

void *valuep

  • pointer to parameter value
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_setstparm( ) function changes the MSI station level parameters, specifically the MSSP_STPWR parameter can be used to turn station power (loop current) on or off.

Parameter

Description

devh the valid station device handle returned by a call to ms_open( )
param specifies the station level parameter
  • MSSP_STPWR
    station power status
valuep specifies the address of the parameter value. Possible values are:
  • MS_PWROFF
    power down station. Selecting this value turns off the loop current to the specified station.
  • MS_PWRON
    power up station. Selecting this value turns on the loop current to the specified station.
The station power is ON by default.

Cautions

This function fails when:

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 station device descriptor */
   int        value;       /* Parameter value */  
   if ((devh = ms_open("msiB1C1", 0)) == -1) {
      printf("Error opening msiB1C1 : errno = %d\n", errno);
      exit(1);
   }  
   /* Power off the station */
   value = MS_PWROFF;
   if (ms_setstparm(devh, MSSP_STPWR, (void *)&value)) == -1) {
      printf("Error setting board parameter : %s\n", ATDV_ERRMSGP(devh));
      exit(1);
   }  
   if (ms_close(devh) == -1) {
      printf("Error Closing msiB1C1 : errno = %d\n", errno);
      exit(1);
   }
}  

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