/*
 ******************************************************************************
 *  Copyright 1998 DeltaLink bv. All Rights Reserved.
 ******************************************************************************
 *
 * File: sapi_ev.c
 *
 * This module contains the events function for the sapi driver.
 *
 */
#ifdef WIN32

#define NOMSG             /* typedef MSG and associated routines */
#define _OLE2_H_          /* no ole */

#include  <windows.h>
#include  <process.h>

#undef ERROR

#endif


#include  <stdlib.h>
#include  <string.h>
#include  <stdio.h>
#include  <stdarg.h>


#include  <flib.h>						 /* FactoryLink definitions */
#include  <fl_utils.h>
#include  <g_utils.h>

#include  <imx.h>              /* Mailbox Communication Interface definitions */
#include  <imx_mt.h>           /* Mailbox Communication Interface definitions */
#include  <imx_fmt.h>          /* Mailbox Communication Interface definitions */

#include  <protocol.h>				 /*  DeltaLink SAPI definitions */
#include  <sapi_s7.h>					 /*  Siemens SAPI definitions   */
#include  <sapi.h>						 /*  DeltaLink SAPI definitions */


/*-----------------------------------------------------------------------------
 * FUNCTION: void  imx_event( IMXDS *ds )
 *
 * PURPOSE :  This function is not used
 *
 -----------------------------------------------------------------------------*/
int imx_event( IMXDS *ds )
{
  return GOOD;
}

/*-----------------------------------------------------------------------------
 * FUNCTION: disable_fnc
 *
 * PURPOSE: Set or reset the disable flag on the device of a specific function.
 -----------------------------------------------------------------------------*/
int disable_fnc( void *flag, VAL value)
{
  char * disable = ( char * )flag;

  /* set the value of the disable flag */

  disable[ INTERNAL ] = ( char)value.dig;
  disable[ USER     ] = ( char)value.dig;

  debug_log( &Task_win, "DBG_DISABLE", 5, (int)value.dig);

  return 0;
}


/*-----------------------------------------------------------------------------
 * FUNCTION: cyclic_read
 *
 * PURPOSE: Start or stop the cyclic read functionality
 -----------------------------------------------------------------------------*/
int cyclic_read( void *ds, VAL cyclic_rate )
{
  DS_INFO *ds_info = ( DS_INFO * )ds;


  cyclic_read_task( &Task_win, ds_info, cyclic_rate );

  return 0;
} //cyclic_read


/*-----------------------------------------------------------------------------
 * FUNCTION: set_board
 *
 * PURPOSE: Set the board for the depending devices
 -----------------------------------------------------------------------------*/
int set_board( void *flag, VAL value)
{

  return 0;
} //set_board


