User Manual

17
int fw_des(unsigned char *key,unsigned char *sour,unsigned char *dest,__int16 m)
Description
Encrypt or Decrypt with DES algorithm
Parameters
key:secret key
sour:source of data for encrypt/decrypt
dest:out data after encrypt/decrypt
m:model of encrypt/decrypt,encrypt when m=1;decrypt when m=0
Return Value
0 if successful; otherwise, Nonzero.
Example:
unsigned char szKey[17]=1122334455667788;
unsigned char szSour[17]=99AABBCCDDEEFF00;
unsigned char szDest[17];
st=fw_des(szKey,szSour,szDest,1);// Encrypt
printf(The result of encrypt:%s,szDest);
memset(szSour,0,sizeof(szSour));//Clear szSourand use it to store the
result of decrypt
st = fw_des(szKey,szDest,szSour,0);//Decrypt
printf(The result of decrypt:%s,szSour);
Remark
The three parameters ,key,sour,dest,are all a string,the length of which is
16.and the character of the string are hex model.
2.2 Device Functions
int fw_beep(int icdev,unsigned int _Msec);
Description
Make beep
Parameters
icdev:Value of Device Handle.
unsigned int _Msec:Time of beep,(ms)
Return Value
0 if successful; otherwise, Nonzero.
Example
int st;
st=fw_beep(icdev,10); /*beep 100 ms*/
int fw_getver(int icdev,unsinged char *buff);
Description
Get version of device
Parameters
icdev:Value of Device Handle.
buff:[out]buff for version number