Solved

AT Command

Posted on 2001-08-08
5
273 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi - replicating a form 8 81
can't find the executable in Simulator 1 100
Adoquery sql  left join does not work 25 99
How to Get Images From Server using App Tethering 11 39
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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