PREV TOC HOME INDEX NEXT


ms_close( )


Cautions | Errors | Example | See Also

Name: int ms_close (devh)
Inputs:

int devh

  • MSI device handle
Returns:

0 on success

-1 on failure

Includes:

srllib.h

dtilib.h

msilib.h

Category:

Device Management

Mode:

synchronous

Platform:

DI, HDSI, Springware

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.

Parameter

Description

devh the valid MSI device handle returned by a call to ms_open( )

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 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


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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