GetConfigurationVariableString

Declaration

Delphi

function GetConfigurationVariableString(Name: ShortString; var LenOfData: Integer): Pointer;

C/C++

SOPAD_API LPVOID SOPAD_GetConfigurationVariableString(char*  Name, int* LenOfData);

ActiveX

HRESULT GetConfigurationVariableString([in] BSTR* Name, [out, retval] BSTR* Result);

Description

Get the Value for a specific Device system Variable

Arguments

Name: String;

e.g.  "so.pad.security.open.event.cache"   (note: returns the open state cache from Device)


LenOfData: Integer

Lenght of the result Value (Lenght of the Data content)


Return value

This function return a Pointer to the Data structure. This data can be casted to a struct vor interpretation.

e.g. result = "010000000E0001341C09060C03150001F39664000E0001341C09060C0315"


Example


struct code sample
c/c++

struct TSOPadSecurityOpenEventCache{

  Int32 version;

  Int16 unKnownData1;  

  byte  EType;

  byte  Seconds;

  byte  minutes;

byte    hours;

byte    dayOfWeek;

byte month;

byte year;    //+2000

byte EOpenDetectorType;

//additional data

Byte OEADT_TIME;

Int32 SRtcEventStamp;

}

int dataLen = 0;

TSOPadSecurityOpenEventCache *eCach;

void*  dataPTR = GetConfigurationVariableString("so.pad.security.open.event.cache", &dataLen);

if(dataLen>= sizeof(TSOPadSecurityOpenEventCache)){

   /* struct pointer cast of void pointer*/

   eCach = (struct TSOPadSecurityOpenEventCache *)dataPTR;

}

Delphi

type

   TSOPadSecurityOpenEventCache = record

    version : DWORD;

    dataLength: WORD;

    EType: Byte;

    Seconds: Byte;

    minutes: Byte;

    hours       : Byte;

    dayOfWeek: Byte;

    month: Byte;

    year: Byte;    //+2000

    EOpenDetectorType: Byte;


  //additional data

  OEADT_TIME   : Byte;

  SRtcEventStamp: DWORD;

end;


var dataLen : integer = 0;

var dataPTR :  POINTER = 0;

var eCach : TSOPadSecurityOpenEventCache;

dataPTR = GetConfigurationVariableString('so.pad.security.open.event.cache', dataLen);

if(dataPTR<> nil)){

 /* struct pointer cast of void pointer*/

   eCach =TSOPadSecurityOpenEventCache(dataPTR)

}

C#