Solved

AT Command

Posted on 2001-08-08
5
268 Views
Last Modified: 2010-04-06
Does anyone know how to pass parameters from an AT Command?  I need to us AT Command to Pass a File Path and a integer.  I was looking at the LMD Tools and I think I need to use TLMDStarter but I don't know how.

Thanks Mike
0
Comment
Question by:msmouse
5 Comments
 

Expert Comment

by:asi
Comment Utility
Maybe u need AsyncPro from www.turbopower.com
0
 
LVL 3

Expert Comment

by:VSF
Comment Utility
U can send AT commands to modem using CreateFile, WriteFile and ReadFile Functions!
To do so, try the following example:
Add 1-TButton, 1-TEdit, 1-TComboBox, 1-TMemo and 2-TRadioButton

//Add the following code:

var
  Form1: TForm1;
  hCommFile: THandle;
  Status: LongBool;
  NumberWritten: DWORD;
  Buf : array [0..1023] of Byte;
  s : string;


//Add this to the OnClick event of the button:
procedure TForm1.Button1Click(Sender: TObject);
begin
  if (combobox1.text <> '') and
     (edit1.text<>'') then
    begin
      //Open COM Port
      s:=Combobox1.text;
      hCommFile :=
         CreateFile(PChar(s), GENERIC_WRITE,    
         0,   // not shared
         nil, // no security
         OPEN_EXISTING,
         FILE_ATTRIBUTE_NORMAL,
         0);

   // Check if COM port was sucessfully opened
    if hCommFile = INVALID_HANDLE_VALUE then
    begin
      memo1.lines.clear;
      memo1.lines.add(Cannot open selected COM');
      memo1.lines.add('Unable to Dial');
      CloseHandle(hCommFile);
    end
    else begin
      memo1.lines.clear;
      memo1.lines.add('Dialing...');
 
      //Creates the AT String
      if radiobutton1.checked then
        s:='ATDT' //Tone Dialing
      else
        s:='ATDP';  //Pulse Dialing

      s := s + edit1.text + #13#10;                
      memo1.lines.add(s);
 
      //Sends AT String to modem
      NumberWritten:=0;                        
      Status:= WriteFile( hCommFile,PChar(s)[0],
         Length(s), NumberWritten, nil);
 
      memo1.lines.add('Waiting for Answer...');
      MessageDlg('Take the Phone off the hook' +
                 'and click OK to hang up the modem',
                 mtInformation,[mbok], 0);

      //Hang up the modem
      WriteFile(hCommFile,'ATH',5,NumberWritten,nil);

      //Closes the COM Port
      CloseHandle(hCommFile);                    
      memo1.lines.add('Modem Disconnected.'#13#10);
    end;
 end;
end;


Hope this helps!

A implemented sample of the above code can be found at my homepage:
www.victory.hpg.com.br

VSF
UIN:14016999
0
 
LVL 5

Expert Comment

by:Gwena
Comment Utility
listening :-)
0
 
LVL 2

Accepted Solution

by:
egono earned 100 total points
Comment Utility
do you mean the modem AT command, or the NT time scheduler AT?

if you meant the last one - just add the parameters at the end of the command and use double quotes.

example:

at 14.00 /interactive "yourcommand /c:\yourpath\yourfile yourinteger"

If you want to use the LMDStart component then simply use the property Parameters.

good luck
0
 
LVL 1

Author Comment

by:msmouse
Comment Utility
I did mean the NT Time Scheduler.  I checked it out and found that I need to pass the parameters to Paramstr()

Thanks for the Help all
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now