PREV TOC HOME INDEX NEXT


ms_open( )


Cautions | Errors | Example | See Also

Name: int ms_open (name, oflags)
Inputs:

char *name

  • MSI station or board device name

int oflags

  • open attribute flags
Returns:

device handle

-1 on failure

Includes:

srllib.h

dtilib.h

msilib.h

Category:

Device Management

Mode:

synchronous

Platform:

DI, HDSI, Springware

Description

The ms_open( ) function opens an MSI device and returns a unique handle to identify the device. All subsequent references to the opened device must be made using the device handle.

Note: If a parent process opens a device and enables events, there is no guarantee that the child process will receive a particular event.

Parameter

Description

name points to an ASCIIZ string that contains the name of a valid MSI station or board device The name of the station device should be msiBbCc where:b is the board number (1 based)c is the station number (1 to 24) The name of the board device should be msiBb where:b is the board number (1 based)
oflags reserved for future use. Set this parameter to 0.

Cautions

Errors

The ms_open( ) function does not return errors in the standard return code format. If an error occurred during the ms_open( ) call, a -1 will be returned, and the specific error number will be returned in the errno global variable. If a call to ms_open( ) is successful, the return value will be a handle for the opened device.

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