Re: What's SerialPort can not fire DataReceived event. by Kun-Yi
Kun-Yi
Thu Sep 13 03:50:49 PDT 2007
A bad news is CETK/SerialPort test is pass. what's happened?
On 9 13 , 1 57 , Kun-Yi <kunyi.c...@gmail.com> wrote:
> Dear All,
> currently I confuse due to I using a USB to COM dongle(use FDTI
> chip & driver) on the platform is OK,
> Have anyone know NetCFV2 how to implement the event launch?
> may be I can to check serial driver to meet the requirements.
>
> best regards,
> KunYI
>
> On 9 13 , 1 32 , Kun-Yi <kunyi.c...@gmail.com> wrote:
>
> > Dear All,
> > I check my code can get a serialport.BytesToRead property.
> > But it still not fire DataReceived Event
>
> > // my initial setting
> > serialPort.PortName = "COM1";
> > serialPort.ReceivedBytesThreshold = 1;
> > serialPort.DtrEnable = true;
> > serialPort.RtsEnable = true;
> > serialPort.Handshake = Handshake.None;
> > serialPort.BaudRate = 115200;
> > serialPort.DataBits = 8;
> > serialPort.Parity = Parity.None;
> > serialPort.StopBits = StopBits.One;
> > serialPort.DataReceived = new
> > SerialDataReceivedEventHandler(RxDataEvent);
> > serialPort.Open();
>
> > On 9 13 , 11 26 , Kun-Yi <kunyi.c...@gmail.com> wrote:
>
> > > Dear Dick,
> > > Thank you for your infomation. but my platform has serial
> > > driver code and using API to operation it is fine.
> > > and Using WM5 OS is OK. and when my device is clean boot still cannot
> > > generation a "DataReceived" event.
> > > I guess the event implement method is to create a thread to monitor RX
> > > buffer and to compare "ReceivedByteThreshold" condition. When I to use
> > > ReadExisting() can get Rx date, so I cannot accept the problem due to
> > > serial driver has bugs.
>
> > > BTW if your device just after suspend/resume has the issues. I guess
> > > serial drivers reconfiguration UART GPIO when Power_Down but Power_Up
> > > not to correct restore original setting.
>
> > > BTW again thank you reply the mail.
> > > Best regards,
> > > KunYi
>
> > > On 9 13 , 12 36 , "Dick Grier" <dick_grierNOSPAM@.msn.com> wrote:
>
> > > > Hi,
>
> > > > I have a WinCE 5 Industrial PPC (Psion) that exhibits this problem. Quite a
> > > > bit of testing makes me think that it is a driver/OS image issue, related to
> > > > power-down. If I do a hard reset, and reload all of my software (usually),
> > > > the DataReceived event in generated. However, often when the PPC is
> > > > subsequently powered down and then powered back up, data no longer is
> > > > receive (polling does not work, either). I "think" that the serial driver,
> > > > or something related, enters some (bug) state that causes this.
>
> > > > BTW, the earlier version, WinCE 4.2 did not show this problem. Although the
> > > > vendor has tried to help, nothing has been resolved, so far.
>
> > > > The same issue shows itself with my CFSerialIO dll (see my homepage) and
> > > > with the Serial class from OpenNETCF -- so, I think it is outside my
> > > > control.
>
> > > > BTW, it is possible that there is an issue with your code (as Chris
> > > > mentioned). For example, you should make sure that both DTREnable and
> > > > RTSEnable = True.
>
> > > > Dick
>
> > > > --
> > > > Richard Grier, MVP
> > > > Hard & Software
> > > > Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> > > > Edition,
> > > > ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> > > > 2006.
> > > > Seewww.hardandsoftware.netfordetailsandcontact information.