comp.lang.ada
 help / color / mirror / Atom feed
* Ada, Com Ports and Modems
@ 2003-03-20 11:21 Les
  2003-03-20 14:31 ` abdel
  2003-03-21  6:51 ` Michael Bode
  0 siblings, 2 replies; 4+ messages in thread
From: Les @ 2003-03-20 11:21 UTC (permalink / raw)


Hi all,

I am a final year student studying at the University of Portsmouth.  I am
trying to get Ada to communicate to my modem with query AT or ATI and get a
response OK back..  I have tried direct_IO and sequential_IO but to no luck.

I have had a look at Stephe's COM port stuff
(http://users.erols.com/leakstan/Stephe/) and it looked like it will be
harder to do than I first thought.  Do I need to go though modem drivers or
can I just send the AT command to the COM port (witch the modem is on) and
get the response back.

I'm not a great programmer (more of a business student) so any help, example
code would be very grateful, and if you can keep it relatively simple I'd
really appreciate it.

Thanks in advance

Les





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada, Com Ports and Modems
  2003-03-20 11:21 Ada, Com Ports and Modems Les
@ 2003-03-20 14:31 ` abdel
  2003-03-20 14:41   ` Jacob Sparre Andersen
  2003-03-21  6:51 ` Michael Bode
  1 sibling, 1 reply; 4+ messages in thread
From: abdel @ 2003-03-20 14:31 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1955 bytes --]


"Les" <les.britten@talk21.com> a �crit dans le message news:
b5c888$na2$1@sparta.btinternet.com...
> Hi all,
>
> I am a final year student studying at the University of Portsmouth.  I am
> trying to get Ada to communicate to my modem with query AT or ATI and get
a
> response OK back..  I have tried direct_IO and sequential_IO but to no
luck.
>
> I have had a look at Stephe's COM port stuff
> (http://users.erols.com/leakstan/Stephe/) and it looked like it will be
> harder to do than I first thought.  Do I need to go though modem drivers
or
> can I just send the AT command to the COM port (witch the modem is on) and
> get the response back.
>
> I'm not a great programmer (more of a business student) so any help,
example
> code would be very grateful, and if you can keep it relatively simple I'd
> really appreciate it.
>
> Thanks in advance
>
> Les
>
>

"Les" <les.britten@talk21.com> a �crit dans le message
news:<b5c888$na2$1@sparta.btinternet.com>...

> Hi all,

>

> I am a final year student studying at the University of Portsmouth. I am

> trying to get Ada to communicate to my modem with query AT or ATI and get
a

> response OK back.. I have tried direct_IO and sequential_IO but to no
luck.

>

> I have had a look at Stephe's COM port stuff

> (http://users.erols.com/leakstan/Stephe/) and it looked like it will be

> harder to do than I first thought. Do I need to go though modem drivers or

> can I just send the AT command to the COM port (witch the modem is on) and

> get the response back.

>

> I'm not a great programmer (more of a business student) so any help,
example

> code would be very grateful, and if you can keep it relatively simple I'd

> really appreciate it.

>

> Thanks in advance

>

> Les

>

Hello

I'm French and in the same case.

It would be very grateful If you have some documentation or other things
about the COM port but for me I have to send and receive information from or
to a modem.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada, Com Ports and Modems
  2003-03-20 14:31 ` abdel
@ 2003-03-20 14:41   ` Jacob Sparre Andersen
  0 siblings, 0 replies; 4+ messages in thread
From: Jacob Sparre Andersen @ 2003-03-20 14:41 UTC (permalink / raw)


Abdel wrote:
> "Les" <les.britten@talk21.com> a �crit dans le message news:

>>I am a final year student studying at the University of Portsmouth.  I am
>>trying to get Ada to communicate to my modem with query AT or ATI and get

> I'm French and in the same case.

You should (assuming that you are working on a Linux system) be able to 
open "/dev/ttyS0" (the primary serial port) as an ordinary file, but I 
can't help you when it comes to specifics of controlling a modem.

Greetings,

Jacob
-- 
�For there are only two reasons why war is made against a
  republic: The one, to become lord over her: the other, the
  fear of being occupied by her.�      -- Niccolo Machiavelli




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada, Com Ports and Modems
  2003-03-20 11:21 Ada, Com Ports and Modems Les
  2003-03-20 14:31 ` abdel
@ 2003-03-21  6:51 ` Michael Bode
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Bode @ 2003-03-21  6:51 UTC (permalink / raw)


"Les" <les.britten@talk21.com> writes:

> I am a final year student studying at the University of Portsmouth.  I am
> trying to get Ada to communicate to my modem with query AT or ATI and get a
> response OK back..  I have tried direct_IO and sequential_IO but to no luck.

You need to use whatever functions your operating system offers for
handling the com port. Then you need Ada bindings for that functions
like these for Win32:

> I have had a look at Stephe's COM port stuff
> (http://users.erols.com/leakstan/Stephe/) 

I've just put up my own serial comm stuff which works for Linux and
Win32: http://home.t-online.de/home/michael_bode/downloads/serial_comm.tgz
It works for me but is not widely tested and reflects my own process
of learning Ada (which means it is not suitable as a textbook example
:-)).

> harder to do than I first thought.  Do I need to go though modem drivers or

If you speak of the usual Hayes comptible modem there is no such thing
as a modem driver. This is a fiction out of Redmond.

> can I just send the AT command to the COM port (witch the modem is on) and
> get the response back.

Exactly. You just need to use the right functions to send these
strings (in Windows and Linux that are the OS file I/O functions). Not
Ada.Text_Io...

> I'm not a great programmer (more of a business student) so any help, example
> code would be very grateful, and if you can keep it relatively simple I'd

Basically:

Open (Port);
Set_Parameters (Port, Baud_Rate, Parity, whatever...); -- if necessary
Write (Port, "ATZ");
Read (Port, Buffer); -- should receive "OK"
...

Close (Port);

-- 
F�r OE User: http://learn.to/quote/
OE users please read http://www.uwasa.fi/~ts/http/quote.html
PGP Key: http://home.t-online.de/home/michael_bode/
Legal Disclaimer: Wer Sarkasmus findet, darf ihn behalten.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-03-21  6:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-20 11:21 Ada, Com Ports and Modems Les
2003-03-20 14:31 ` abdel
2003-03-20 14:41   ` Jacob Sparre Andersen
2003-03-21  6:51 ` Michael Bode

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox