Hi, I'm trying to use a serial port at 1200baud, 7N2 with this code sequence:
<snip> fCom := fpOpen('/dev/cuaa0', O_RDWR OR O_NOCTTY );//OR O_NONBLOCK); if (fCom < 0) then begin writeln(stderr, 'Couldn''t open serial port.'); halt(1); end; r := 0; fillchar(tios, sizeof(tios), #0); cfsetispeed(tios, B1200); cfsetospeed(tios, B1200); tios.c_cflag := CREAD or CLOCAL or CS7 or CSTOPB; tios.c_oflag := 0; tios.c_iflag := IGNBRK OR IGNPAR; tios.c_lflag := 0; r := tcsetattr(fCom, TCSANOW, tios); if (r = -1) then begin writeln(stderr, 'tcsetattr failed!'); fpClose(fCom); halt(1); end; </snip> and all I get when running it is: 'tcsetattr failed!'. The rights are okay and running as root does make no difference. The hardware is working, connections are checked okay ... another program doing mostly the same is working as it should. Maybe I have looked at it for too long, where is the problem? TIA, Marc _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal