ms_setstparm( )
Cautions | Errors | Example | See Also
Name: ms_setstparm (devh, param, valuep) Inputs:
Returns: Includes: Category: Mode: Platform: 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.
devh the valid station device handle returned by a call to ms_open( ) param specifies the station level parameter valuep specifies the address of the parameter value. Possible values are: The station power is ON by default. Cautions
- The station device handle is invalid
- The parameter specified is invalid
- The parameter value specified is invalid
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
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation