Solved

AT Command

Posted on 2001-08-08
5
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

623 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