Article View: borland.public.cppbuilder.nativeapi
Article #4554Serial comm problem
From: Bogdan
Date: Sun, 08 Jan 2006 18:23
Date: Sun, 08 Jan 2006 18:23
38 lines
2216 bytes
2216 bytes
Hello, I'm trying to communicate between 2 PCs using a serial cable(null modem). I've written a dll where I export the functions I need to initialize, read/write and shutdown a serial port.The problem is that I only tested it on a single PC, by connecting a cable between the 2 COM ports.When i tried the app between 2 different PC-s it didn' t work anymore. I suspect I do something wrong with the DCB structure used to set up the port, but i don't know what.This is the code used to init the DCB : ZeroMemory(&PortDCB,sizeof(DCB)); PortDCB.DCBlength = sizeof(DCB); GetCommState(COMPort,&PortDCB); PortDCB.fOutxCtsFlow = FALSE; PortDCB.fOutxDsrFlow = FALSE; PortDCB.fDtrControl = DTR_CONTROL_DISABLE; PortDCB.fRtsControl = RTS_CONTROL_DISABLE; PortDCB.fOutX = TRUE;//FALSE; PortDCB.fInX = TRUE;//FALSE; //PortDCB.fDsrSensitivity = FALSE; //PortDCB.fTXContinueOnXoff = TRUE; //PortDCB.fErrorChar = FALSE; //PortDCB.fNull = FALSE; //PortDCB.fAbortOnError = FALSE; PortDCB.BaudRate = Speed; PortDCB.fBinary = TRUE; PortDCB.fParity = TRUE; PortDCB.ByteSize = 8; PortDCB.Parity = NOPARITY; PortDCB.StopBits = ONESTOPBIT; Bogdan
Technical Details
Message-ID:
<43c15835$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b5848264f1b0dfff,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Bogdan" <boprea@xnet.ro> From: "Bogdan" <boprea@xnet.ro> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Serial comm problem Date: Sun, 8 Jan 2006 20:23:59 +0200 Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 85.186.237.190 Message-ID: <43c15835$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1136744501 85.186.237.190 (8 Jan 2006 10:21:41 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail