This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with termios: tcgetattr


Franck MAMALET FT-R&D DIH/OCF wrote:
> 
> Hi,
> 
> I'm trying to port a Linux program,  on eCos and I have some trouble with
> termios function:  tcgetattr.
> This program is opening a serial driver with open('/dev/ser2",.....)
> which seems to be OK.
> To configure the terminal, it calls   tcgetattr(fd, &t), but generates an
> error "tcgetattr wrong argument"
> 
> I had a look to functions called by tcgetattr :
> tcgetattr (fildes=3, termios_p=0x4f738) at
> //e/ecos/REDHAT~1/eCos/packages/io/serial/current/src/common/termios.c:160
> 
>     calls
>         ret = fp->f_ops->fo_getinfo( fp, CYG_IO_GET_CONFIG_TERMIOS,
> termios_p,  len);
>     which for a device is mapped to
>         dev_fo_getinfo (fp=0x4d3e8, key=1024, buf=0x4f738, len=40)
>      and this function calls (devfs.cxx l452)
>          err = cyg_io_get_config( (cyg_io_handle_t)fp->f_data, key, buf,
> &ll );
>      then this function calls    (iosys.c l257)
>         t->handlers->get_config(handle, key, buf, len);
>     which is mapped for a serial device to
>         serial_get_config (handle=0x3f12c, key=1024, xbuf=0x4f6fc,
> len=0x4f738)
> 
> It seems that the problem is about the "key", because serial_get_config
> only tests CYG_IO_GET_CONFIG_SERIAL_xxx which differ from
> CYG_IO_GET_CONFIG_TERMIOS, and so generates an error.

It should have gone to termios_get_config in
io/serial/curent/src/common/termiostty.c

Did you enable CYGPKG_IO_SERIAL_TERMIOS_TERMIOS2 in your configuration?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]