Hello,

I m writing the Diagnostic code for testing serial communication for
the emulator.
My system is having only two physical ports, COM1 and COM2.

I have checked the application using the virtual serial ports. i m
getting nothing on the hyper terminal after running the application on
the emulator.

I followed the steps like :

1 Open Virtual Serial Port control app and
add a virtual port pair COM4<->COM5.
2. Open emulator's settings dialog and map:
"Serial Port 1" to None.
"Serial Port 2" to COM4.
3. Open Hyper terminal app and attach to COM5/38400/8/N/1.
4. In eVC start a new "WCE Application" project, choose
"A simple Windows CE Application" as template.
5. Add the following code to your WinMain function:
---------------------------------------------------------------------------

HANDLE hDev;
DCB dcb;
DWORD dwWritten;
hDev = CreateFile(TEXT("COM1:"), GENERIC_WRITE, 0, NULL, OPEN_EXISTING,

FILE_ATTRIBUTE_NORMAL, NULL);
if (hDev != INVALID_HANDLE_VALUE)
{
ZeroMemory(&dcb, sizeof(dcb));
dcb.DCBlength = sizeof(dcb);
dcb.BaudRate = CBR_38400;
dcb.Parity = NOPARITY;
dcb.ByteSize = 8;
dcb.StopBits = ONESTOPBIT;
SetCommState(hDev, &dcb);
WriteFile(hDev, "Hello World !!!\r\n", 17, &dwWritten, NULL);
CloseHandle(hDev);
}
---------------------------------------------------------------------------

Please guide me..

Thanks

Re: serial communication on the emulator. by voidcoder

voidcoder
Thu Sep 28 02:19:22 CDT 2006


Have a look on CETK, standard interfaces like serial
etc can be tested without an additional line of code.
The following tests would be enough in your case:

- Serial Driver Test
- Serial Communication Test


On Thu, 28 Sep 2006 09:02:33 +0200, <nutty.sawant@gmail.com> wrote:

> Hello,
>
> I m writing the Diagnostic code for testing serial communication for
> the emulator.
> My system is having only two physical ports, COM1 and COM2.
>
> I have checked the application using the virtual serial ports. i m
> getting nothing on the hyper terminal after running the application on=

> the emulator.
>
> I followed the steps like :
>
> 1 Open Virtual Serial Port control app and
> add a virtual port pair COM4<->COM5.
> 2. Open emulator's settings dialog and map:
> "Serial Port 1" to None.
> "Serial Port 2" to COM4.
> 3. Open Hyper terminal app and attach to COM5/38400/8/N/1.
> 4. In eVC start a new "WCE Application" project, choose
> "A simple Windows CE Application" as template.
> 5. Add the following code to your WinMain function:
> ----------------------------------------------------------------------=
-----
>
> HANDLE hDev;
> DCB dcb;
> DWORD dwWritten;
> hDev =3D CreateFile(TEXT("COM1:"), GENERIC_WRITE, 0, NULL, OPEN_EXISTI=
NG,
>
> FILE_ATTRIBUTE_NORMAL, NULL);
> if (hDev !=3D INVALID_HANDLE_VALUE)
> {
> ZeroMemory(&dcb, sizeof(dcb));
> dcb.DCBlength =3D sizeof(dcb);
> dcb.BaudRate =3D CBR_38400;
> dcb.Parity =3D NOPARITY;
> dcb.ByteSize =3D 8;
> dcb.StopBits =3D ONESTOPBIT;
> SetCommState(hDev, &dcb);
> WriteFile(hDev, "Hello World !!!\r\n", 17, &dwWritten, NULL);
> CloseHandle(hDev);
> }
> ----------------------------------------------------------------------=
-----
>
> Please guide me..
>
> Thanks
>
>


Re: serial communication on the emulator. by nutty

nutty
Thu Sep 28 23:07:30 CDT 2006


voidcoder wrote:

> Have a look on CETK, standard interfaces like serial
> etc can be tested without an additional line of code.
> The following tests would be enough in your case:
>
> - Serial Driver Test
> - Serial Communication Test
>
>
> On Thu, 28 Sep 2006 09:02:33 +0200, <nutty.sawant@gmail.com> wrote:
>
> > Hello,
> >
> > I m writing the Diagnostic code for testing serial communication for
> > the emulator.
> > My system is having only two physical ports, COM1 and COM2.
> >
> > I have checked the application using the virtual serial ports. i m
> > getting nothing on the hyper terminal after running the application on
> > the emulator.
> >
> > I followed the steps like