ATMS_TSSGBIT( )
Cautions | Errors | Example | See Also
Name: long ATMS_TSSGBIT (devh) Inputs: Returns: Includes: Category: Mode: Platform: Description
The ATMS_TSSGBIT( ) function retrieves the current station hook status.
devh the MSI station device handle returned by a call to ms_open( ) The returned bitmask represents the following:
- MS_ONHOOK
- MSI station is on-hook
- MS_OFFHOOK
- MSI station is off-hook
These equates are defined in msilib.h.
Cautions
This function fails if an invalid device handle is specified.
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" /* Basic error handler */ do_error( devh, funcname ) int devh; char *funcname; { int errorval = ATDV_LASTERR( devh ); printf( "Error while calling function %s.\n", funcname ); printf( "Error value = %d.", errorval ); printf( "\n" ); } main() { int tsdev; /* Station device descriptor variable */ long tsbits; /* Time slot signaling bits */ /* * Open board 1 channel 1 device */ if ( ( tsdev = ms_open( "msiB1C1", 0 ) ) == -1 ) { printf( "Cannot open station msiB1C1. errno = %d", errno ); exit( 1 ); } /* * Get station signaling bits */ tsbits = ATMS_TSSGBIT( tsdev ); if ( tsbits == -1 ) { do_error( tsdev, "ATMS_TSSGBIT()" ); exit( 1 ); } switch(tsbits) { case MS_ONHOOK: /* continue processing (on-hook) */ break; case MS_OFFHOOK: /* continue processing (off-hook) */ break; default: printf("undefined parameter value = %d\n", tsbits); break; } /* * Continue processing * . * . * . */ /* Done processing - close device. */ if ( ms_close( tsdev ) == -1 ) { printf( "Cannot close station msiB1C1. errno = %d", errno ); } }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation