public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] port opening and createfile
@ 2002-05-30 21:43 paul thomas
  2002-05-31  3:31 ` Nick Garnett
  0 siblings, 1 reply; 2+ messages in thread
From: paul thomas @ 2002-05-30 21:43 UTC (permalink / raw)
  To: ecos-discuss

Hi,

i'm trying to write a program to open the COM1 port and write data to
it.iused the function cyg_io_lookup().i tried specifying the device name in
many ways..
cyg_io_lookup("/dev/serial0",handle)
cyg_io_lookup("/dev/Ser0",handle)
cyg_io_lookup("/dev/ttyS0",handle)
cyg_io_lookup("COM1",handle)

cyg_io_lookup("//./COM1",handle)

but i cudn't open the port.Error -2 is shown..
Can anybody help me...

Also is there any function in eCos equiivalent to CREATEFILE()..CAn anybody
help me in this regard too...

Thanking in advance..
Paul.




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

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

* Re: [ECOS] port opening and createfile
  2002-05-30 21:43 [ECOS] port opening and createfile paul thomas
@ 2002-05-31  3:31 ` Nick Garnett
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Garnett @ 2002-05-31  3:31 UTC (permalink / raw)
  To: paul thomas; +Cc: ecos-discuss

"paul thomas" <paulthomas520@hotmail.com> writes:

> Hi,
> 
> i'm trying to write a program to open the COM1 port and write data to
> it.iused the function cyg_io_lookup().i tried specifying the device name in
> many ways..
> cyg_io_lookup("/dev/serial0",handle)
> cyg_io_lookup("/dev/Ser0",handle)
> cyg_io_lookup("/dev/ttyS0",handle)
> cyg_io_lookup("COM1",handle)
> 
> cyg_io_lookup("//./COM1",handle)
> 
> but i cudn't open the port.Error -2 is shown..
> Can anybody help me...

You nearly got it right. Most serial devices are named "/dev/ser0",
and so on. To check which name the specific device you want to use
has, look in the CDL file for the serial driver you are using. It is
the value of CYGDAT_IO_SERIAL_<architecture>_<platform>_SERIAL0_NAME.

> 
> Also is there any function in eCos equiivalent to CREATEFILE()..CAn anybody
> help me in this regard too...
> 

If you have the RAM file system installed, you can use the standard
libc/POSIX/UNIX/Linux fopen(), open() or creat() functions. We don't
currently have any support for disk based filesystems.

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

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

end of thread, other threads:[~2002-05-31 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-30 21:43 [ECOS] port opening and createfile paul thomas
2002-05-31  3:31 ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).