beautypg.com

Sensoray 2410 API User Manual

Page 25

background image

Sensoray 24xx Programming Guide

21

Model 2410 Digital I/O Module

case

CAPMSG_ONESHOT:

printf( "one-shot cap enabled: %04x %04x %04x\n", val[2], val[1], val[0] );

break

;

case

CAPMSG_DISABLE:

printf( "cap disabled: %04x %04x %04x\n", val[2], val[1], val[0] );

break

;

case

CAPMSG_EVENT:

if

( val[0] | val[1] | val[2] )

printf( "captured events: %04x %04x %04x\n", val[2], val[1], val[0] );

else

printf( "time-out -- no events captured" );

break

;

case

CAPMSG_ERROR:

printf( "connection closed unexpectedly\n" );

break

;

default

:

printf( "unknown error\n" );

break

;

}
}

6.4.4 s2410_AsyncCapEnd()

Function:

Terminate asynchronous notification messages.

Prototype:

BOOL s2410_AsyncCapEnd( HEVCAP hevcap, u32 &err );

Returns:

True if the operation was successful, otherwise False is returned and

err

will contain the associated error code.

Notes:

This function instructs the asynchronous event notification system to terminate operations. In response, the
application’s callback function will be called one final time, with message type

CAPMSG_DETACH

, to inform the

application that the notification system has shut down.

s2410_AsyncCapEnd()

should only be called if asynchronous event notifications have been enabled by a previous

call to

s2410_AsyncCapBegin()

.

Example:

// Shut down the asynchronous event notification system.

u32 err = ERR_NONE;

if

( !s2410_AsyncCapEnd( hevcap, &err ) )

printf( "Error: %s\n", s24xx_ErrorText(err) );

Argument

Description

hevcap

Handle to async event notification system obtained from

s24xx_AsyncCapBegin()

.

err

Pointer to error code. See Section 4.3.1 for details.