QuercusVL Programming Manual
switch(VL_Summary_get_DetectorType(sum))
{
case 1: printf("DT_SPEED\n");
break;
case 2: printf("DT_QUEUE\n");
break;
case 3: printf("DT_PRESENCE\n");
break;
default: break;
}
}
int main(int argc, char *argv[])
{
if(VLLoad()!=0) return -1;
if(!VL_System_Initialize("Central.ini","Central.log",
OnRealTimeInformation,
OnIncidence,
OnSummary,
NULL,
NULL)) return -1;
printf("Press [RETURN] to exit\n");
getchar();
VL_System_Terminate();
VLUnload();
return 0;
}
Parts of the sample code:
include “VLWrapperC.h”
Header files needed to interact with VL from C.
void __stdcall OnRealTimeInformation(int info)
void __stdcall OnIncidence(int inc)
void __stdcall OnSummary(int sum)
Implementation of client code that will run with the events. The functions must have exactly
the same format defined at header file “VLWrapperC.h”, otherwise will fail at compilation time.
If you are not interested in any of the events, you don't need to implement it.
if(VLLoad()!=0) return -1;
Load of VL
library.
if(!VL_System_Initialize("Central.ini","Central.log", OnRealTimeInformation,
OnIncidence, OnSummary, NULL, NULL)) return -1;
System_Initialize is in charge of system initialization, enabling events and setup networking
with units configured at “
Central.ini”
file. “
Central.log
” file will store system logs. As can be
seen, the previously defined functions are passed as parameters of this function, so that they
can be called, when events are launched.
Quercus Technologies
21