From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26433 invoked by alias); 20 Jul 2005 12:16:04 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 26364 invoked by uid 22791); 20 Jul 2005 12:15:51 -0000 Received: from mx1.itb.ac.id (HELO mx1.itb.ac.id) (167.205.23.6) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 20 Jul 2005 12:15:51 +0000 Received: from antivirus.itb.ac.id (antivirus.itb.ac.id [167.205.108.137]) by mx1.itb.ac.id (Postfix) with SMTP id 4B875BEC36 for ; Wed, 20 Jul 2005 19:15:33 +0700 (WIT) Received: from vlsi.itb.ac.id (ic.vlsi.ITB.ac.id [167.205.65.54]) by mx1.itb.ac.id (Postfix) with SMTP id 15636BEAA5 for ; Wed, 20 Jul 2005 19:15:33 +0700 (WIT) Received: (qmail 5077 invoked by uid 4061); 20 Jul 2005 12:15:36 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 Jul 2005 12:15:36 -0000 Date: Wed, 20 Jul 2005 12:16:00 -0000 From: Indra Antonius Simalango To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [ECOS] a question about opening a serial port fax device as a file X-SW-Source: 2005-07/txt/msg00199.txt.bz2 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