Board index » delphi » Send AT-commands to the modem?

Send AT-commands to the modem?

How do I send AT-commands to the modem from my program programmed
with Turbo Pascal 7.0?  A brief example would have been fine!

--
Later,
Tore Aursand (tor...@sn.no)

 

Re:Send AT-commands to the modem?


Quote
Tore Aursand (tor...@sn.no) wrote:

: How do I send AT-commands to the modem from my program programmed
: with Turbo Pascal 7.0?  A brief example would have been fine!

You can use soething like this :

var best                : tekst;

begin
assign(best,'COM1');
rewrite(best);

write(best,'ATZ');
...
close(best);
end.

David Philips.

Re:Send AT-commands to the modem?


Quote
Tore Aursand wrote:

> How do I send AT-commands to the modem from my program programmed
> with Turbo Pascal 7.0?  A brief example would have been fine!

Send the ASCII characters AT.... to COM1, COM2 etc where your modem is
connected.

Example:

procedure SendToSerial(b : byte);

begin
  .
  .
  .   { I think you know how to use int $14 to communicate with serial }
  .
  .
end;

Procedure SendCommand(s : string);

var
  b  : byte;

begin
  for b := 1 to length(s) do sendtoserial(ord(s[b]))
end;

Other Threads