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]
Other format: [Raw text]

Re: Using the second serial port on ARM-E7T


Jacques Ehrlich wrote:
> 
> >I tried something like :
> > fp = fopen("/dev/ser0", "rw");
> > ...
> > fprintf(fp, "hello\n");
> > ...
> >
> > without success.
> 
> Finally, it works !
> The error was :
> fp = fopen("/dev/ser0", "rw")
> 
> To be ok you must open two different "files":
> out = fopen("/dev/ser0", "w")
> in = fopen("/dev/ser0", "r")

Actually that shouldn't be required. But you saying this has made me notice
what the problem is: it shouldn't be "rw", it should be "r+" to open for
reading and writing.

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

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


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