🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #17106

Re: Reading From Serial Port

#17106
From: Yilmaz
Date: Wed, 09 Apr 2003 12:56
43 lines
2303 bytes
Thanks Steve

changing char *outbuffer;  to char outbuffer[2] has worked...

Thanks a lot

"Steve" <steve_alettoANTI@SPAMhotmail.com> wrote in message
news:3e94086a$1@newsgroups.borland.com...
> > I am able to write out data to the serial port which has a
> twisted cable
> > attached. However, I am unable to read any data in...
>
> Maybe I haven't understood correctly your problem, but
> there's something strange in your code. What is the problem
> exactly? How can you say you don't receive any data?
>
> Have you tried the following values instead of yours?
>
> SerialPort.CommTimeOuts.ReadIntervalTimeout = MAXWORD;
> SerialPort.CommTimeOuts.ReadTotalTimeoutMultiplier = 0;
> SerialPort.CommTimeOuts.ReadTotalTimeoutConstant = 0;
> SerialPort.CommTimeOuts.WriteTotalTimeoutMultiplier = 0;
> SerialPort.CommTimeOuts.WriteTotalTimeoutConstant = 0;
>
> >
> inread=ReadFile(SerialPort.hComm,outbuffer,1,&dwBytesRead,NU
> LL);
>
> If I'm not wrong outbuffer is not allocated. Are you sure
> this line is correct? Have you tried to define outbuffer as
> "char outbuffer[2]" (the same for inbuffer, as well)?
>
> HTH,
>
> Steve.
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.467 / Virus Database: 266 - Release Date: 01/04/2003
Technical Details
Message-ID: <3e94188c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e93d88d@newsgroups.borland.com> <3e94086a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,c1814f9ecc8efe9a
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-09 06:04:15 PST
Reply-To: "Yilmaz" <y.gul@herts.ac.uk>
From: "Yilmaz" <y.gul@herts.ac.uk>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e93d88d@newsgroups.borland.com> <3e94086a$1@newsgroups.borland.com>
Subject: Re: Reading From Serial Port
Date: Wed, 9 Apr 2003 13:56:42 +0100
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 217.37.52.217
Message-ID: <3e94188c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1049893004 217.37.52.217 (9 Apr 2003 05:56:44 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail