00001 #ifndef SCAN_LITE_INTERNAL_H
00002 #define SCAN_LITE_INTERNAL_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "scanLite.h"
00018
00019 #define SSCONN "SSCONN"
00020
00021 #define scanDEFAULT_SSMA_SIZE 12400
00022 #define scanOPEN 1000
00023 #define scanCLOSE 1001
00024 #define scanDIRECT 1002
00025
00026
00027
00028
00029 #define rtSCAN_CONFIG_PT "scan config"
00030
00031 #define rtCP_COMM_MODE ".communication mode"
00032 #define rtCP_DEV_TYPE ".device type"
00033 #define rtCP_CONTROL ".control"
00034 #define rtCP_STATUS ".status"
00035
00036 #define rtSD_SI_CNTRL ".scan input control"
00037 #define rtSD_SI_STATUS ".scan input status"
00038 #define rtSD_SI_FAIL_THRSHLD ".failure threshold"
00039 #define rtSD_SCAN_INPUT ".scan input"
00040 #define rtSD_SO_CNTRL ".scan output control"
00041 #define rtSD_SO_STATUS ".scan output status"
00042 #define rtSD_SCAN_OUTPUT ".scan output"
00043 #define rtSD_FAIL_THRSHLD ".dev fail threshold"
00044 #define rtSD_CONFIG_OPT ".config optimization"
00045 #define rtSD_SSMA_UPDATE_LIM ".SSMA update limit"
00046 #define rtSD_DEBUG_LEVEL ".debug level"
00047
00048 #define rtSI_POINT_CONTROL "point control"
00049 #define rtSI_POINT_STATUS "point status"
00050 #define rtSI_POLL_TYPE_MASK "poll type mask"
00051 #define rtSI_ST_BUFFER_SIZE "st buffer size"
00052 #define rtSI_SSMA_OFFSET "SSMA offset"
00053 #define rtSI_NO_OF_ELEMENTS "# of elements"
00054 #define rtSI_RTAP_DE_TYPE "RTAP DE type"
00055 #define rtSI_DEADBAND_TYPE "deadband type"
00056 #define rtSI_DEADBAND "deadband"
00057 #define rtSI_LINK_ADDRESS "link address"
00058 #define rtSI_RESERVED_FLD "reserved1"
00059 #define rtSI_FIRST_FIELD_NO 0
00060 #define rtSI_LAST_FIELD_NO 10
00061
00062 #define rtCP_POLL_TYPES ".poll types"
00063 #define rtCP_PRBX_TYPES ".PRBX types"
00064
00065 #define rtSC_SCAN_TASKS ".scan tasks"
00066 #define rtST_SCAN_TASK_NAME "scan task name"
00067
00068 #define rtE_ST_FUNC_UNSUPPORTED 0x00100011
00069 #define rtE_SS_CONFIG_ERR 0x00200022
00070 #define rtE_ST_TIMEOUT 0x00300033
00071 #define rtE_ST_DCD_ERROR 0x00400044
00072 #define rtE_ST_CTS_ERROR 0x00500055
00073 #define rtE_ST_BAD_CRC 0x00600066
00074
00075
00076
00077
00078 #define rtPOLLED_PRBX 0
00079 #define rtPOLLED_PRBX_SRBX 1
00080 #define rtSRBX 2
00081
00082 #define scanMAX_PLINS_IN_LIST 255
00083
00084 typedef struct
00085 {
00086 ccsNODE node;
00087 msgPROCESSID procId;
00088 rtSsConnection handle;
00089 } scanHANDLE;
00090
00091 typedef struct
00092 {
00093 rtInt8 startDay;
00094 rtInt8 startHour;
00095 rtInt8 startMin;
00096 rtInt8 startSec;
00097 rtUInt8 intervalDays;
00098 rtUInt8 intervalHours;
00099 rtUInt16 intervalMins;
00100 rtUInt32 intervalSecs;
00101 rtUInt16 intervalMSecs;
00102 } rtPTypesRecord;
00103
00104
00105 typedef struct
00106 {
00107 int ssmaSize;
00108 int ssmaOffset;
00109 } scanSSMA;
00110
00111 typedef struct
00112 {
00113 vltUINT32 command;
00114 vltUINT32 counter;
00115 rtSsConnection handle;
00116 } scanTYPE_HDR;
00117
00118 typedef struct
00119 {
00120 msgHEADER msgHeader;
00121 scanTYPE_HDR scanHeader;
00122 char body [msgMAXLEN - sizeof(msgHEADER) - sizeof(scanTYPE_HDR)];
00123 } scanCOMMAND;
00124
00125
00126
00127
00128 void rtCpInitHook (void);
00129 void rtCpShutdownHook (void);
00130 rtInt rtDepMsgHook (rtMsgHeader *message);
00131 void rtPostCntrlHook (void);
00132 void rtPostDirCmdHook (void);
00133 void rtPostInitDvceHook (rtPlin scanDevicePlin);
00134 void rtPostPollHook (void);
00135 void rtPostPollTypeHook (void);
00136 void rtPostPrbxHook (void);
00137 void rtPostPrbxTypeHook (void);
00138 void rtPostReadHook (void);
00139 void rtPostRequestHook (void);
00140 void rtPostWriteHook (void);
00141 void rtPreCntrlHook (void);
00142 void rtPreDirCmdHook (void);
00143 void rtPreInitDvceHook (rtPlin scanDevicePlin);
00144 void rtPrePollHook (void);
00145 void rtPrePollTypeHook (void);
00146 void rtPrePrbxHook (void);
00147 void rtPrePrbxTypeHook (void);
00148 void rtPreReadHook (void);
00149 void rtPreRequestHook (void);
00150 void rtPreWriteHook (void);
00151
00152 rtInt rtRequestCapability (void);
00153 rtInt rtSetCwp (rtPlin plin);
00154 rtInt rtUpdateInputStatus (rtInt record, rtSsState status);
00155 void rtUpdatePlinList (rtPlin plin);
00156 rtInt rtUpdateSsma (rtScanInputRecord *scanRecord, rtUInt8 *buffer, rtUInt32 size,
00157 rtUInt16 recnum);
00158 rtInt rtSetNewStatus (rtScanInputRecord *scanRecord, rtUInt16 recnum,
00159 rtSsState newStatus);
00160 rtInt rtGetSiTableSize (void);
00161 rtInt rtEnableDeviceInput (void);
00162 rtInt rtFailDeviceInput (void);
00163 void rtMoveMemA (void *destination, const void *source, rtUInt32 count);
00164 rtInt rtGetDbCwp (rtDbConnection connection);
00165 rtSsState rtGetScanInputStatus (void);
00166
00167 rtInt32 rtDevPtDisabled (rtPointId *pointId, rtInt scanInputPts);
00168 rtInt32 rtDevPtEnabled (rtPointId *pointId, rtInt scanInputPts);
00169 rtInt32 rtDirectCmd (rtUInt8 *writeCommand, rtUInt16 commandLength,
00170 rtUInt16 timeOut, rtSsDcAction commandAction,
00171 rtUInt8 *replyBuf, rtUInt16 maxReplyBufSize);
00172 void rtDisableCommPort (void);
00173 rtInt32 rtInitDevice (rtPlin scanDevicePlin, rtUInt8 retries, rtUInt16 timeout);
00174 FILE *rtInitCommPort (void);
00175 rtInt32 rtDisableDevice (rtSsCqAction action, rtPlin scanDevicePlin, rtUInt8 retry,
00176 rtUInt16 timeOut);
00177 rtInt32 rtRestartDevice (rtPlin scanDevicePlin, rtUInt8 retry, rtUInt16 timeout,
00178 rtLogical rst_type);
00179
00180
00181 #endif