6 Windows
, Messages
, SysUtils
, Variants
, Classes
, Graphics
, Controls
, Forms
,
7 Dialogs
, StdCtrls
, Gammu
, ExtCtrls
, ComCtrls
;
24 procedure Button1Click(Sender
: TObject
);
26 { Private declarations }
28 PhoneCallBackPointer
: PPhoneCallBackProc
;
29 SecurityCallBackPointer
: PSecurityCallBackProc
;
30 SMSCallBackPointer
: PSMSCallBackProc
;
32 { Public declarations }
42 //called, when phone is connected or disconnected
43 procedure ChangePhoneState1(x
:integer;ID
:integer;status
:boolean);stdcall;
46 buffer
: array[1..100] of char;
50 error
:=GSM_GetDCT4SimlockNetwork(Form1
.PhoneID
,@buffer
);
51 if (error
<> GE_NONE
) then application
.MessageBox(pchar('Get simlock: error '+inttostr(integer(error
))),'',0);
52 if (error
= GE_NONE
) then
55 Form1
.Edit3
.Text:=buffer
;
58 error
:=GSM_GetModelName(Form1
.PhoneID
,@buffer
);
59 if (error
= GE_NONE
) then Form1
.Edit5
.Text:=buffer
;
60 if (error
<> GE_NONE
) then application
.MessageBox(pchar('Get model: error '+inttostr(integer(error
))),'',0);
62 error
:=GSM_GetIMEI(Form1
.PhoneID
,@buffer
);
63 if (error
<> GE_NONE
) then application
.MessageBox(pchar('Get IMEI: error '+inttostr(integer(error
))),'',0);
64 if (error
= GE_NONE
) then Form1
.Edit2
.Text:=buffer
;
66 error
:=GSM_GetDCT4SecurityCode(Form1
.PhoneID
,@buffer
);
67 if (error
<> GE_NONE
) then application
.MessageBox(pchar('Get security code: error '+inttostr(integer(error
))),'',0);
68 if (error
= GE_NONE
) then Form1
.Edit6
.Text:=buffer
;
70 error
:=GSM_EndConnection(Form1
.PhoneID
);
71 if (error
<> GE_NONE
) then application
.MessageBox(pchar('End connection: error '+inttostr(integer(error
))),'',0);
75 procedure TForm1
.Button1Click(Sender
: TObject
);
80 buffer
: array[1..100] of char;
82 GetMem(Device
,Length(Edit4
.Text) + 1);
83 StrCopy(Device
, PChar(Edit4
.Text));
85 GetMem(Connection
,Length(Edit1
.Text) + 1);
86 StrCopy(Connection
, PChar(Edit1
.Text));
88 PhoneCallBackPointer
:= @ChangePhoneState1
;
89 SecurityCallBackPointer
:= nil;
90 SMSCallBackPointer
:= nil;
92 error
:=GSM_StartConnection(@PhoneID
,Device
,Connection
,'','','',@PhoneCallBackPointer
,@SecurityCallBackPointer
,@SMSCallBackPointer
);
93 if (error
<>GE_NONE
) then application
.MessageBox(pchar('Start: error '+inttostr(integer(error
))),'',0);