Solved

AT Command

Posted on 2001-08-08
5
272 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
ID: 6363640
Maybe u need AsyncPro from www.turbopower.com
0
 
LVL 3

Expert Comment

by:VSF
ID: 6363834
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
ID: 6364612
listening :-)
0
 
LVL 2

Accepted Solution

by:
egono earned 100 total points
ID: 6364714
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
ID: 6366749
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 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