|
|
|
|
The lu0_term function terminates the LU0 application's session and releases the LU for use by other applications.
int lu0_write (
AP_UINT32 *handle,
int options,
LU0_CALLBACK callback,
void *user
);
The application supplies the following parameters:
The identifier that was returned on the original lu0_init function call for the LU0 session.
Specifies how to terminate the session.
To terminate the session by sending UNBIND to the host (hard termination), set this parameter to zero.
To request UNBIND from the host (soft termination), specify the following value:
To use the synchronous version of lu0_term, specify a NULL pointer.
To use the asynchronous version of lu0_term, specify a pointer to a callback routine within the application. See Synchronous and Asynchronous LU0 Operation for more details.
This parameter is used only for asynchronous calls.
A pointer to an optional user data string supplied by the application; typically used for the application's session identifier. The format of this data is defined by the application; SNAP-IX does not use this data, but returns it unchanged as a parameter to the callback routine when returning information related to this function call. This allows the application to correlate the callback with the original request.
If a callback routine was specified, the function does not block, and returns a value to indicate whether the function was issued successfully. The result of the termination request is then reported using the application's callback routine.
The function returns one of the following values:
The function was issued successfully. The result of the session termination will be reported to the application using the supplied callback routine.
LU0 could not process the function, either because the application supplied parameters that were not valid or because an error occurred within SNAP-IX. The SNAP-IX error log file contains more details of the error. The supplied callback routine will not be called for this function, and the session remains active.
The lu0_term function does not return any parameters.
If the return value from the lu0_term function is LU0_EVENT_IN_PROGRESS, LU0 calls the application's callback routine when the session has been terminated. The parameters supplied to the callback routine are as follows.
The session handle that was returned on the lu0_init function.
The user data that was supplied on the lu0_term function. This allows the application to correlate the callback with the original request.
The event being reported. This is set to LU0_EVENT_TERM_OK .
These parameters are not used in the callback routine for lu0_term.
If a callback routine was not specified, the function blocks until the session has been terminated (or until LU0 detects an error). It then returns with a value indicating whether the session was terminated successfully.
The function returns one of the following values:
The session has been sucessfully terminated. The application cannot issue any further LU0 functions for this session.
LU0 could not process the function, either because the application supplied parameters that were not valid or because an error occurred within SNAP-IX. The SNAP-IX error log file contains more details of the error. The session remains active.
The lu0_term function does not return any parameters.
The application can issue lu0_term while an asynchronous lu0_init is in progress, to cancel the session activation. In particular, it can do this from within the callback routine that reports a BIND received from the host, in order to reject the BIND. See lu0_init for more details.
If an lu0_read or lu0_write is in progress when the application issues lu0_term, it is canceled. The session failure is reported with an event parameter of LU0_EVENT_READ_SESS_FAIL or LU0_EVENT_WRITE_SESS_FAIL.
|
|
|
|
|