Solved

AT Command

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

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 112
error 1.1 400 Bad request idhttp delphi 18 277
how to update exe applicatio from internet ? 6 108
Typecasting TBytes to Integer in Delphi XE8 2 67
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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