GPRS - DLL Manual
GPRS - DLL Manual
dll Document
Data structure:
U64t type time is based on GMT time’s second form 1970-01-01 00:00:00 to now, In a word , it is
a Time Interval that measure by the second, most of program language supply API for
transformation
Api Description:
Call Method
1、 Load Library:
Call windows API function LoadLibrary to load this gprsdll.dll.:
HMODULE hDllMudule; //point to the LIB Handle
hDllModule=LoadLibrary(“gprsdll.dll”);
If (hDllModule!=NULL) //check that loading library is successful or not
{
//get function address from library
DSStartService =GetProcAddress(hDllModule,”DSStartService”);
if (DSStartService!=NULL) // check that get address is successful or not
{
if ((*DSStartService)( 5001)!=FALSE)
MessageBox(“start sucessfully”);
Else
MessageBox(“start failed”);
}
}
You can call FreeLibrary to free library,so LoadLibrary and FreeLibrary’s count
must equal.
FreeLibrary(hDllModule); //TRUE-success FALSE-failed
2、 start service:
BOOL (*DSStartService)(u32t); //define a point to point this fucntion
DSStartService=
(BOOL(*)(u32t))GetProcAddress(hDllModule,” DSStartService”);
if (DSStartService!=NULL)
{
(*DSStartService)( 5001);
}
3、 stop service:
BOOL (*DSStopService)(void);
DSStopService=(int (*)(char *))GetProcAddress(hDllModule,” DSStopService”);
If (DSStopService!=NULL)
(*DSStopService)();
4、 read data:
This function must be executed in thread or timer.
BOOL DSGetNextData(DtuDataStruct*, u16t);
DSGetNextData = \
(BOOL(*)(DtuDataStruct*, u16t))GetProcAddress(hDllModule,” DSGetNextData”);
if (DSGetNextData!=Null)
if ((*DSGetNextData)(&dtudata,100)==0)
{
//deal with dutdata
}
5、 send data:
BOOL DSSendData (unsigned char *,u16t,u8t *);
DSSendData= \
(BOOL(*)(DtuInfoStruct*,u16t,u8t*))GetProcAddress(hDllModule,” DSSendData”);
if (DSSendData!=NULL)
{
(*DSSendData)(szPhone, len,buf);
}
6、dtu list:
Have created a dut list in this dll service ,if DSC want to know this List
information,need call API DSGetModemCount、DSGetModemByPosition
for (u32t I=0;I<(* DSGetDtuCount)();I++)
{
(*DSGetModemByPosition)(I,&dtuinfo);
}
7.error information:
Get the last Called API Error report By calling DSGetLastError()function