Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Termie: A Simple RS232 Terminal

0.00/5 (No votes)
13 Oct 2008 1  
Termie opens a serial port and allows you to communicate with it in a chat-like interface.
Termie/termie.jpg

Introduction

Termie opens a serial port and logs data received to a window. It is useful for embedded software development. It can also send data so it is actually a RS232 terminal with a chat-like interface.

An embedded system is a special-purpose computer such as a Wii, MP3 player, or cell phone. To develop for such a system, you need a development "kit" which allows you to download software and debug. Communication between your PC and the embedded system is often a serial cable (RS-232).

In my case, I get output from the embedded system (a game console) via an RS-232 cable. So if I want to see my printfs, I need a program that will display anything that comes in the COM port on my PC.

Background

Termie is an open source clone of Termite from ITB CompuPhase.

What I liked about Termite is that it is simple and fast. Hyperterminal is clunky. I wanted something similar to Termite that was open source. Writing it in C# turned out to be easy; a weekend project. Once done, I can add new features as needed and get great suggestions here!

Settings

Settings are stored in an INI file in the application startup folder:

Termie/termie2.jpg

Features

  • Multiple select, select all, and copy to the clipboard
  • Hex Output (not in Termite)
  • Output filter (not in Termite)
  • Partial line output (so you can see "..." one dot at a time)
  • Click status to close/open with current port settings
  • Toggle Scrolling button
  • Send File button
  • Color coded lines (green=received, blue=sent)
  • Send escape sequences (\n, \x7f)
  • Send history

Using the Code

System.IO.Ports has a SerialPort class that does everything we want. I wrapped it in a singleton class with delegates for status and data events.

History

  • February-2008: Original submission
  • March-2008: Added clipboard, output filter, hex output, monospace font, and all settings
  • May-2008: Added read thread, partial output, color coding, and "send file"
  • October-2008: Fixed thread bug, added history and escape sequences to send (\n, \x7f), and upgraded project files to Visual C# 2008 Express

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here