/*
//  Copyright (c) 2001, Reson, Inc. All Rights Reserved.
//
//  Filename:   Exports.h
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    Defines the stanadard sensor interface functions for this DLL.
//
*/

#ifndef EXPORTS_H_INCLUDE
#define EXPORTS_H_INCLUDE

/*
/////////////////////////////////////////////////////////////////////////////
// Externally exported interface function to this DLL.
*/

#ifndef EXPORT_DLL
#ifdef _USRDLL
#define EXPORT_DLL  __declspec( dllexport )
#else
#define EXPORT_DLL
#endif
#endif

extern "C"
{

#include "..\Processinf.h"

    enum ErrorCodes
    {
        ERROR_CODE_FAILURE =  0,
        ERROR_CODE_SUCCESS
    };

    // Interface function pointer definitions.

    typedef     int     ( WINAPI *PFN_STARTUP)          (   SENSORINFO     *pSensorInfo,
                                                            DWORD           dwThreadId,
                                                            UINT            uiDataReadyMessageId,
                                                            UINT            uiReplyReadyMessageId,
                                                            void           *vpfnLog,
                                                            void           *vpCriticalParameters );
                                   
    typedef     int     ( WINAPI *PFN_SHUTDOWN )        (   int             iSensorIndex );
                                   
    typedef     int     ( WINAPI *PFN_IDENTIFY )        (   SENSORINFO     *pSensorInfo,
                                                            int             iSensorIndex );

    typedef     int     ( WINAPI *PFN_LOAD     )        (   BYTE           *pbyData,
                                                            unsigned long  *pulSize,
                                                            unsigned long  *pulTimestamp,
                                                            int             iSensorIndex );

    typedef     int     ( WINAPI *PFN_SENDCOMMAND )     (   int             iSensorIndex,
                                                            int             iClientIndex,
                                                            char           *pszCommand );

    typedef     double  ( WINAPI *PFN_GETMODULEVERSION )(   void );

    typedef     int     ( WINAPI *PFN_RETRIEVESTATUS )  (   BYTE           *pbyData,
                                                            unsigned long  *pulSize,
                                                            unsigned long  *pulTimestamp,
                                                            int            *piClientIndex,
                                                            int             iSensorIndex );

    typedef     int     ( WINAPI *PFN_ROUTEMESSAGE )    (   BYTE           *pbyMessage,
                                                            unsigned long   ulSize,
                                                            unsigned long   ulTimeStamp,
                                                            int             iSocketIndex,
                                                            int             iSensorIndex );

    typedef     int     ( WINAPI *PFN_RESETSENSOR )     (   int             iSensorIndex );

    typedef     int     ( WINAPI *PFN_ISSENSORHEALTHY ) (   int             iSensorIndex );

    /////////////////////////////////
    // Interface function prototypes.

    EXPORT_DLL  int     WINAPI  Startup                 (   SENSORINFO     *pSensorInfo,
                                                            DWORD           dwThreadId,
                                                            UINT            uiDataReadyMessageId,
                                                            UINT            uiReplyReadyMessageId,
                                                            void           *vpfnLog,
                                                            void           *vpCriticalParameters );
    
    EXPORT_DLL  int     WINAPI  Shutdown                (   int             iSensorIndex );
                                                    
    EXPORT_DLL  int     WINAPI  Identify                (   SENSORINFO     *pSensorInfo,
                                                            int             iSensorIndex );
                                                    
    EXPORT_DLL  int     WINAPI  Load                    (   BYTE           *pbyData,
                                                            unsigned long  *pulSize,
                                                            unsigned long  *pulTimestamp,
                                                            int             iSensorIndex );

    EXPORT_DLL  int     WINAPI  SendCommand             (   int             iSensorIndex,
                                                            int             iClientIndex,
                                                            char            *pszCommand );
            
    EXPORT_DLL  double  WINAPI  GetModuleVersion        (   void );

    EXPORT_DLL  int     WINAPI  RetrieveStatus          (   BYTE            *pbyData,
                                                            unsigned long   *pulSize,
                                                            unsigned long   *pulTimestamp,
                                                            int             *piClientIndex,
                                                            int             iSensorIndex );

    EXPORT_DLL  int     WINAPI  RouteMessage            (   BYTE           *pbyMessage,
                                                            unsigned long   ulSize,
                                                            unsigned long   ulTimeStamp,
                                                            int             iSocketIndex,
                                                            int             iSensorIndex );

    EXPORT_DLL  int     WINAPI  ResetSensor             (   int             iSensorIndex );

    EXPORT_DLL  int     WINAPI  IsSensorHealthy         (   int             iSensorIndex );

}

#endif
