From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,856bbc914c544442 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-20 22:58:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Michael Bode Newsgroups: comp.lang.ada Subject: Re: Ada, Com Ports and Modems Date: 21 Mar 2003 07:51:53 +0100 Organization: T-Online Sender: mb@320025674319-0001.dialin.t-online.de Message-ID: <87wuitciuu.fsf@320025674319-0001.dialin.t-online.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1048229848 03 7637 Lz-sEF3SSkaurw 030321 06:57:28 X-Complaints-To: abuse@t-online.com X-ID: Xv+UrqZGweDWDef+VNp2eCeKwm5u4ONMxfVUwrmwhvGlLi5hspmI67 X-message-flag: IMPORTANT MESSAGE -- PLEASE READ IMMEDIATELY!!! X-Accepted-File-Formats: ASCII, .rtf, .ps, .pdf - *NO* MS Office files User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:35583 Date: 2003-03-21T07:51:53+01:00 List-Id: "Les" 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.