/common/home/bel/bella/lnx/exports/build/current/all/central-services/cap/intf/asintf.h

00001 #ifndef ASINTF_H
00002 #define ASINTF_H
00003 
00004 #include <stdlib.h>
00005 
00006 #ifdef  __cplusplus
00007 extern "C" {
00008 #endif
00009 
00028 
00032 typedef enum
00033 {
00034   AS_RC_OK=0,
00035   AS_RC_ALARMBUFFER_EMPTY,
00036   AS_RC_NOT_CONNECTED,
00037   AS_RC_ALREADY_CONNECTED,
00038   AS_RC_INVALID_REQUEST,
00039   AS_RC_REQUEST_FAILED,
00040   AS_RC_INVALID_FORMAT,
00041   AS_RC_NO_SEND_HANDLER,
00042   AS_RC_SEND_FAILED,
00043   AS_RC_NO_ALARM,
00044   AS_RC_CONVERT_O2N_ERROR,
00045   AS_RC_I_ERROR_000=100,
00046   AS_RC_I_ERROR_001,
00047   AS_RC_I_ERROR_002,
00048   AS_RC_I_ERROR_003,
00049   AS_RC_I_ERROR_004,
00050   AS_RC_I_ERROR_005,
00051   AS_RC_I_ERROR_006,
00052   AS_RC_I_ERROR_007,
00053   AS_RC_I_ERROR_008,
00054   AS_RC_I_ERROR_009,
00055   AS_RC_I_ERROR_010,
00056   AS_RC_I_ERROR_011,
00057   AS_RC_I_ERROR_012,
00058   AS_RC_I_ERROR_013,
00059   AS_RC_I_ERROR_014,
00060   AS_RC_I_ERROR_015,
00061   AS_RC_I_ERROR_016,
00062   AS_RC_I_ERROR_017,
00063   AS_RC_I_ERROR_018,
00064   AS_RC_I_ERROR_019,
00065   AS_RC_MAX = 0xFFFFFFFF
00066 } as_completion_e;
00067 
00068 //      PARAMETER       NomenLength     = 16
00069 //      PARAMETER       MinExtDataIndex = 0
00070 //      PARAMETER       MaxExtDataIndex = 63
00071 //      PARAMETER       MinAlarmIndex   = 0
00072 //      PARAMETER       MaxAlarmIndex   = 9
00073 
00074 
00075 //      STRUCTURE /Filter_Type/
00076 //              CHARACTER*(NomenLength) Nomen
00077 //              INTEGER*4               StatusSubFilter
00078 //              INTEGER*4               ActiveSubFilter
00079 //              INTEGER*4               MsgSubFilter
00080 //              BYTE                    ConfigSubFilter
00081 //              BYTE                    Align
00082 //              INTEGER*2               AlarmTypeFilter
00083 //      END STRUCTURE
00084 //
00085 //      INTEGER*2        AllAlarmTypes 
00086 //      PARAMETER       (AllAlarmTypes = '07FF'X)
00087 //      INTEGER*4        AllStates 
00088 //      PARAMETER       (AllStates = 'FFFFFFFF'X)
00089 //      INTEGER*4        AllSystemStates 
00090 //      PARAMETER       (AllSystemStates = '000000FF'X)
00091 //      BYTE             AllConfigs 
00092 //      PARAMETER       (AllConfigs = 'FF'X)
00093 //      INTEGER*4        AllMsgs 
00094 //      PARAMETER       (AllMsgs = '0000001F'X)
00095 //      INTEGER*4        AllActives 
00096 //      PARAMETER       (AllActives = 'FFFFFFFF'X)
00097 
00098 
00099 #define AS_MAX_PROC_LEN 16
00100 #define AS_CAP_PACKET_TAG 0xFE
00101 
00102 #define AS_MIN_FILTER_INDEX 0
00103 #define AS_MAX_FILTER_INDEX 9
00104 #define AS_MAX_FILTER 32
00105 
00106 typedef struct
00107 {
00108   char    name[AS_MAX_PROC_LEN];
00109   int32_t statusSubFilter;
00110   int32_t activeSubFilter;
00111   int32_t msgSubFilter;
00112   int8_t  configSubFilter;
00113   int8_t  align;
00114   int16_t alarmTypeFilter;
00115 } as_filter_fortran_t;
00116 
00117 
00118 typedef struct
00119 {
00120   char    name[AS_MAX_PROC_LEN];
00121   int32_t statusSubFilter;
00122   int32_t activeSubFilter;
00123   int32_t msgSubFilter;
00124   int8_t  configSubFilter;
00125   int8_t  align;
00126   int16_t alarmTypeFilter;
00127   void   *pdata;
00128 } as_filter_t;
00129 
00130 typedef struct 
00131 {
00132   int32_t STATES;
00133   int32_t SYSTEM_STATES;
00134   int32_t MSGS;
00135   int32_t ACTIVES;
00136   int16_t ALARMTYPES;
00137   int8_t  CONFIGS;
00138 } as_filter_param_t;
00139 
00140 
00141 extern as_filter_param_t AS_ALL;
00142 
00147 typedef struct as_alarm_s as_alarm_t;
00148 
00154 int as_connect(char *ourname);
00155 
00162 int as_set_filter( as_filter_t *pfilter, int nfilter );
00163 
00168 int as_disconnect(void);
00169 
00173 typedef int ( *AS_HOOK_FCT)(void);
00174 
00180 int as_set_hook( AS_HOOK_FCT alarm_hook );
00181 
00187 int as_read_alarm( as_alarm_t *palarm );
00188 
00194 int as_read_vms_alarm( as_alarm_t *palarm );
00195 
00201 int as_send_alarm( as_alarm_t *palarm );
00202 
00209 int as_send_vms_alarm( as_alarm_t *palarm );
00210 
00214 //-----------------------------------------
00215 // decoding helper functions  to decode buffer 
00216 // filled with alarm 
00217 //-----------------------------------------
00218 
00227 int as_alarmCountDecodeFromBuffer( char *packetBuffer, int *pCount );
00228 
00229 #define AS_OLD_ALARM_VERSION 0
00230 #define AS_NEW_ALARM_VERSION 1
00231 
00242 int as_alarmDecodeFromBuffer( char *packetBuffer, void *pAlarm, int alarmVersion );
00243 
00244 #ifdef  __cplusplus
00245 }
00246 #endif
00247 
00248 
00249 #endif

Generated on 4 Mar 2014 for asintf by  doxygen 1.4.7