PREV TOC HOME INDEX NEXT


ATMS_STATINFO( )


Cautions | Errors | Example | See Also

Name: long ATMS_STATINFO (devh, statinfop)
Inputs:

int devh

  • MSI board device handle

char * statinfop

  • pointer to four bytes containing station information
Returns:

station information on success

-1 on failure

Includes:

srllib.h

dtilib.h

msilib.h

Category:

Extended Attribute

Mode:

synchronous

Platform:

DI, HDSI, Springware

Description

The ATMS_STATINFO( ) function returns information about the board running the MSI software. This information includes the number and location of the stations on the board. The application is responsible for allocating the space (4 bytes) for the station information buffer.

Parameter

Description

devh the valid MSI board device handle returned by a call to ms_open( )
statinfop pointer to four bytes. When the function returns, the first byte contains the total number of stations on the board. For DM3 boards (DI and HDSI), byte 2 is fixed at 1 and bytes 3 and 4 are fixed at -1 (0xFF). For MSI boards, bytes 2, 3, and 4 indicate the status of the baseboard and two daughterboards, respectively.

Cautions

This function fails if an invalid device handle is specified. If no stations are present on the module, 0xFF is returned.

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"  
int i;
int  devh;                   /* Board device handle */
unsigned char statinfo[4];  
/* Open board 1, device */
if ((devh = ms_open("msiB1",0)) == -1) {
    printf( "Cannot open MSI B1, errno=%d", errno);
    exit(1);
}  
/*
 * Continue processing
 */125  
/* Get board Ids and number of stations */
if ((ATMS_STATINFO(devh,statinfo)== -1){
    printf("Error getting station info\n");
    /* Close device and exit */
}  
printf("Number of stations = %d\n",statinfo[0]);  
for (i=0;i<4;i++){
   switch (statinfo[i]){
   case 0x01:
        printf("Board #%d present\n",i);
        break;
   case 0xff:
        printf("Board #%d not present\n",i);
        break;
   default:
        printf("Invalid module number %d\n",i);
        break;
   }
}  
/*
 * Continue Processing
 */  
 /* Done processing - close device */
if (ms_close(devh) == -1) {
    printf("Cannot close device msiB1. errno = %d", errno);
    exit(1);
}  

See Also

None.


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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