[fpc-pascal] serial.pp - I can't talk to modem

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Jan 2 15:15:33 CET 2008


On 02/01/2008, Michael Van Canneyt <michael at freepascal.org> wrote:
>
> Yes, but it should be
>
> SerSetParams(serialhandle, 2400, 8, NoneParity, 1, [RtsCtsFlowControl]);
>
> No ?


I have no idea!  :-)

OK, I changed the code to the following...  I it should do, is take
the modem off the hook... nothing happens. :-(

-------------------------
  serialhandle := SerOpen('/dev/ttyS0');  // COM1 under Linux
  if serialhandle = -1 then
    writeln('Failed to open port');
  SerSetParams(serialhandle, 2400, 8, NoneParity, 1, [RtsCtsFlowControl]);

  s := 'ATH1' + #13;
  SerWrite(serialhandle, s, Length(s));
-------------------------


> Also, 2400 baud seems very slow ?

That should not be a issue.  All that the code is supposed to do is
dial the phone, nothing else (hence the reason I didn't even bother
with the SerSetParams call in the beginning). The end result should
allow the user to click a button next to a phone number and the modem
dials the number for the user. No other communication happens.
Anyway, I tried 19200 speed as well, but as expected, no change.  This
has been driving me insane for a few days now. Grey hairs popping up
all over the place! :-)


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-pascal mailing list