This code sample is named TTY. It demonstrates how to open, configure, and close, a serial communications port, and perform read/write operations for a TTY terminal emulation application.
- Serial Communications (Core OS Services)
- CloseHandle function
- COMMTIMEOUTS structure
- CreateFile function
- CreateThread function
- DCB structure
- EscapeCommFunction function
- GetCommModemStatus function
- GetCommState function
- GetCommTimeouts function
- GetLastError function
- MessageBox function
- SetCommMask function
- SetCommState function
- WaitCommEvent function
To run the code sample
Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32\Tty\``Tty.sln
Microsoft Visual Studio 2005 launches and loads the solution.
Build the solution (Ctrl+Shift+B).
Deploy the solution (F5).
On the desktop, open a hyper-terminal, choose "Com1" or "Com2" and the baud rate (for example, 9600).If you connected the mobile device with the desktop through serial connection by using "com1", then choose "com2". Otherwise, choose "com1".
Connect the mobile device to the desktop through the chosen com port.
To use the application
- Launch the TTY application on the mobile device.
- Type letters on the hyper-terminal and you'll see them appear in the TTY application window (and vice versa).
The mobile device must have an available COM port, and it should be connected through the COM port to the desktop.
Pocket PC SDK: Windows Mobile 5.0 Pocket PC SDK.
Smartphone SDK: Windows Mobile 5.0 Smartphone SDK.
Development Environment: Visual Studio 2005.
ActiveSync: Version 4.0.
Send Feedback on this topic to the authors