ms_close( )
Cautions | Errors | Example | See Also
Name: int ms_close (devh) Inputs: Returns: Includes: Category: Mode: Platform: Description
The ms_close( ) function closes the MSI device previously opened by the calling process and ms_open( ). The devices are either MSI boards or stations. The ms_close( ) function releases the handle and breaks the link between the calling process and the device.
devh the valid MSI device handle returned by a call to ms_open( ) Cautions
- This function fails if the device handle is invalid.
- The ms_close( ) function affects only the link between the calling process and the device. Other processes are unaffected by ms_close( ).
- If event notification is active for the device to be closed, call the SRL sr_dishdlr( ) function prior to calling ms_close( ).
- A call to ms_close( ) does not affect the configuration of the MSI.
- Devices should never be closed using close( ).
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 bddev; /* Board device descriptor variable */ /* Open board 1 device */ if ( ( bddev = ms_open( "msiB1", 0 ) ) == -1 ) { printf( "Cannot open board msiB1. errno = %d\n", errno ); exit( 1 ); } /* * Continue processing * . * . * . */ /* Done processing - close device */ if ( ms_close( bddev ) == -1 ) { printf( "Cannot close board msiB1. errno = %d", errno ); } }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation