public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] a question about opening a serial port fax device as a file
@ 2005-07-20 12:16 Indra Antonius Simalango
  2005-07-20 16:25 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Indra Antonius Simalango @ 2005-07-20 12:16 UTC (permalink / raw)
  To: ecos-discuss


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?

-- 
	regards, 	

	IndrA on 18:49, Jul 20

	http://ic.ee.itb.ac.id/~antonius	



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

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

* Re: [ECOS] a question about opening a serial port fax device as a file
  2005-07-20 12:16 [ECOS] a question about opening a serial port fax device as a file Indra Antonius Simalango
@ 2005-07-20 16:25 ` Andrew Lunn
       [not found]   ` <Pine.LNX.4.33.0507210012050.7169-100000@ic.vlsi.itb.ac.id>
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2005-07-20 16:25 UTC (permalink / raw)
  To: Indra Antonius Simalango; +Cc: ecos-discuss

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

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

* Re: [ECOS] a question about opening a serial port fax device as a file
       [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>
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2005-07-20 18:15 UTC (permalink / raw)
  To: Indra Antonius Simalango; +Cc: eCos Disuss

On Thu, Jul 21, 2005 at 12:18:59AM +0700, Indra Antonius Simalango wrote:
> On Wed, 20 Jul 2005, Andrew Lunn wrote:
> 
> > CYGPKG_IO_SERIAL_DEVICES 
>  
> Pardon me, Mr Lunn. Did you mean to add some configuration checks and an 
> include file like these in my files?

Look at the description for that component:

    cdl_component CYGPKG_IO_SERIAL_DEVICES {
        display       "Hardware serial device drivers"
        flavor        bool
        default_value 0
        description   "
            This option enables the hardware device drivers
            for the current platform."
    }


If you don't have it enabled you want get any serial device drivers
compiled.

Googling would of also answered your question since its been asked and
answered many times before......

http://www.spinics.net/lists/ecos/msg21035.html

        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

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

* Re: [ECOS] a question about opening a serial port fax device as a file
       [not found]       ` <Pine.LNX.4.33.0507210302040.8135-100000@ic.vlsi.itb.ac.id>
@ 2005-07-20 20:52         ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2005-07-20 20:52 UTC (permalink / raw)
  To: Indra Antonius Simalango; +Cc: eCos Disuss

On Thu, Jul 21, 2005 at 03:08:19AM +0700, Indra Antonius Simalango wrote:
> Thank you, Mr Lunn. 
> 
> Here is my file eCos.ecc :
> --------------------------------------------------------------------------------
> cdl_component CYGPKG_IO_SERIAL_DEVICES {
>     display "Hardware serial device drivers"
>     Flavor : bool
>     Default value : 0
>     description         "This option enables the hardware device drivers
>                         for the current platform"
> 
>     # Flavor: bool
>     # No user value, uncomment the following line to provide one.
>     # user_value 0
>     # value_source default
>     # Default value: 0
> 
>     # The following properties are affected by this value
>     # option CYGPKG_IO_SERIAL_TESTS
>     #     Calculated:  CYGPKG_IO_SERIAL_DEVICES ? "tests/serial1 
> tests/serial2 tests/serial3 tests/serial4 tests/serial5 tests/tty1 
> tests/tty2 tests/flow1 tests/flow2" : ""
> --------------------------------------------------------------------------------
> 
> After changing this file eCos.ecc. , should I make any 'update' to my 
> package? Or I could only just "save as" the file after changing?

http://ecos.sourceware.org/docs-latest/user-guide/manual-configuration.html

> 
> I've also define FAXDEV = "/dev/serial1" , as mentioned in the last 
> sentences. But I still encountered the same error message :
> 
> 	50:44 Error : can't open serial port /dev/serial1 : No such entity
> 
> Pardon me, did I make any mistake (again) here?

Possibly. Look at the ecos.ecc file and find out the name of the
serial devices for your target. Maybe its called /dev/ser1 not
/dev/serial1.

        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

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

end of thread, other threads:[~2005-07-20 20:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-20 12:16 [ECOS] a question about opening a serial port fax device as a file Indra Antonius Simalango
2005-07-20 16:25 ` Andrew Lunn
     [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

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).