Skip to content

YahyaSerag/SerialCommunicationApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

SerialCommunicationApp

.. Overview: The Serial Communication App is a Windows Presentation Foundation (WPF) application built on the .NET Framework 4.8. Its primary purpose is to facilitate serial communication between a computer and external devices through COM ports. This documentation aims to guide users, developers, and contributors through the application's features, usage, and customization.

Features:

• COM Port Selection:

The application dynamically detects available COM ports and populates the dropdown menu accordingly. Users can manually enter the baud rate for the selected COM port.

• Connectivity:

The "Connect" button establishes a connection to the selected COM port with the specified baud rate. If a connection is successful, a confirmation message is displayed.

• Hexadecimal Message Handling:

Users can send and receive hexadecimal messages in real-time. Sent and received messages are displayed in their respective textboxes. The app processes user-entered messages as hexadecimal.

• Error Handling:

Proper error handling is implemented for scenarios such as unavailable COM ports, invalid baud rates, or failed message transmissions. Error messages are displayed to users for better troubleshooting.

• Clear Functionality:

The "Clear" button resets the content of the "Received Messages" Text Box.

• Real-Time Display:

The "Received Messages" Text Box is updated in real-time as new messages arrive

Architecture:

The Serial Communication App follows a standard WPF (Windows Presentation Foundation) architecture, utilizing the MVVM (Model - View - ViewModel) pattern. This pattern helps separate concerns and improve the maintainability of the application.

Components:

1.View (MainWindow.xaml): • Defines the user interface elements using XAML. • Responsible for presenting data to the user.

2.ViewModel (MainWindow.xaml.cs): • Contains the application's logic and state. • Communicates between the View and the Model. • Handles user interactions, events, and data binding.

3.Model (SerialPort, ObservableCollection): • Manages the underlying data and business logic. • Handles serial port communication (reading, writing). • Maintains the collection of received messages.

Usage:

• Connecting to a COM Port:

  1. Open the application.
  2. Choose the desired COM port from the dropdown menu.
  3. Enter the baud rate in the corresponding textbox.
  4. Click the "Connect" button.

• Sending Hexadecimal Messages:

  1. Enter the hexadecimal message in the "Send" Text Box.
  2. Click the "Send" button to transmit the message.

Real-Time Display:

The "Received Messages" Text Box displays both sent and received messages in real-time.

Conclusion:

The Serial Communication App adopts a simple yet effective architecture, leveraging the strengths of WPF and MVVM. It separates concerns, making the codebase modular and maintainable. The code structure aligns with the standard practices of WPF application development

Releases

No releases published

Packages

No packages published

Languages