eth32_get_event_handler

int eth32_get_event_handler(eth32 handle, eth32_handler *handler);

Summary

This function retrieves information about the currently installed event handler mechanism for this connection. This is all information that is internal to the API, so this function does not need to retrieve any information from the ETH32 device.

Parameters

  • handle - The value returned by the eth32_open function.

  • handler - Pointer to an eth32_handler structure which will be filled in with the information about the current event handler.

Return Value

This function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes.

Example
eth32 handle;
int result;
eth32_handler evhandler;

// .... Your code that establishes a connection here

// Determine which type of event handler is installed
result=eth32_get_event_handler(handle, &evhandler);
if(result)
{
	// Handle error
}

switch(evhandler.type)
{
	case HANDLER_NONE:
		// No event handler is enabled
		break;
	case HANDLER_CALLBACK:
		// A callback function is set up as an event handler
		break;
	case HANDLER_MESSAGE:
		// A Windows Message event handler is enabled
		break;
}
         
See Also

Event Callback Function, eth32_enable_event, eth32_set_event_handler