public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Indra Antonius Simalango <indra@vlsi.itb.ac.id>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] a question about opening a serial port fax device as a file
Date: Wed, 20 Jul 2005 16:25:00 -0000	[thread overview]
Message-ID: <20050720162457.GF29741@lunn.ch> (raw)
In-Reply-To: <Pine.LNX.4.33.0507201915090.5059-100000@ic.vlsi.itb.ac.id>

On Wed, Jul 20, 2005 at 07:15:36PM +0700, Indra Antonius Simalango wrote:
> 
> deal all,
> 
> Below are my quote snippet. It would open a serial fax device as a TFILE.  
> Returns 0 if OK, 1 if busy, 2 on error. 
> 
> -------------------------------------------------------------------------
> ...
> 
> #define FAXFILE "/dev/ser1"
> 
> typedef struct tfilestruct {
>   int fd ;
>   unsigned char *ip, *iq ;
>   unsigned char ibuf [ IBUFSIZE ] ;
>   unsigned char *ibitorder, *obitorder ;
>   int bytes, pad, lines ;
>   int hwfc ;
>   time_t start ;
>   long mstart ;
>   int rd_state ;
> } TFILE ;
> 
> int ttyopen ( TFILE *f, char *fname, int reverse, int hwfc )
> {
>   int flags, err=0 ;
> 
>   tinit ( f, open ( fname, O_RDWR | O_NONBLOCK | O_NOCTTY ), reverse, hwfc 
> ) ;
> 
>   if ( f->fd < 0 ) {
>     if ( errno == EBUSY ) {
>       err = 1 ; 
>     } else {
>       err = msg ( "ES2can't open serial port %s:", fname ) ;
>     }
>   }
> ...
> --------------------------------------------------------------------------
> 
> I set fname = FAXFILE
> 
> I've done this by posix-eCos programming.This file has successfully  
> compiled and linked. But when it runs, it gives an error return :
> 
> 	:17:20 Error : can't open serial port /dev/ser1: No such entity
> 
> I built my eCos on PC-i386 platform. I've also changed FAXFILE to 
> /dev/ser0, /dev/ttyS0, but still encountered the same error. Did I miss 
> something here?

CYGPKG_IO_SERIAL_DEVICES 

        Andrew

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

  reply	other threads:[~2005-07-20 16:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-20 12:16 Indra Antonius Simalango
2005-07-20 16:25 ` Andrew Lunn [this message]
     [not found]   ` <Pine.LNX.4.33.0507210012050.7169-100000@ic.vlsi.itb.ac.id>
2005-07-20 18:15     ` Andrew Lunn
     [not found]       ` <Pine.LNX.4.33.0507210302040.8135-100000@ic.vlsi.itb.ac.id>
2005-07-20 20:52         ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050720162457.GF29741@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=indra@vlsi.itb.ac.id \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).