?
Solved

Mock serial port communication C#

Posted on 2013-12-12
2
Medium Priority
?
1,330 Views
Last Modified: 2014-04-22
I have written a c# application designed to receive and send data to and from a COM port. Unfortunately I am awaiting the arrival of the COM device I need to test this application, so what I am looking for is a way to simulate the COM port.

This should allow me to connect to the 'mock' serial port send messages to it and send messages back. I dont want to use a third party application for this if possible - i.e. if I can write a C# application to acheive this that would be ideal as I would need to customise it very heavily.

Whatever the solution is I am sure it will be a new concept for me so a simple solution with a step by step approach would be appreciated!
0
Comment
Question by:Blowfelt82
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1000 total points
ID: 39715823
Without using a 3rd-party emulator, the closest you can get would be to create a new class that exposes the same properties and methods that the SerialPort class exposes. Once your device arrives, simply swap in the SerialPort class for your mock class.

I think an emulator would be more flexible and easier to set up, but if you want to keep it all in .NET, then I think this would be your only recourse.
0
 

Author Comment

by:Blowfelt82
ID: 39715908
Ok sounds good, do you have a cose sample of how this might be done? Also out of curiosity what third party tool might you recommend?
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
Teach the user how to install ESXi 5.5 and configure the management network System Requirements: ESXi Installation:  Management Network Configuration: Management Network Testing:
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question