Application Architecture¶
Overview of the CISCO / BushNET Serial Manager application architecture.
Overview¶
The CISCO / BushNET Serial Manager is a Qt6-based GUI application written in C++17. It provides a graphical interface for managing serial console connections to CISCO / BushNET industrial Ethernet switches.
Architecture Diagram¶
┌─────────────────────────────────────────────────────────────────┐
│ MainWindow │
│ ┌─────────────┐ ┌─────────────────┐ ┌─────────────────────┐ │
│ │ Menu Bar │ │ Toolbar │ │ Status Bar │ │
│ └─────────────┘ └─────────────────┘ └─────────────────────┘ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ QTabWidget (Main Tabs) │ │
│ │ │ │
│ │ ┌──────────┐ ┌────────────┐ ┌───────────┐ ┌──────────┐ │ │
│ │ │ Welcome │ │ Terminal │ │ Switch │ │ SNMP │ │ │
│ │ │ Tab │ │ Widget │ │ Panel │ │ Monitor │ │ │
│ │ └──────────┘ └────────────┘ └───────────┘ └──────────┘ │ │
│ │ │ │
│ └──────────────────────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ CredentialsTab │ │
│ │ (Auto-login, Password Management) │ │
│ └──────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ SerialManager │ │ SnmpClient │ │ DeviceConfig │
│ (QSerialPort) │ │ (QUdpSocket) │ │ (QSettings) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Serial Port │ │ UDP/SNMP │
│ /dev/ttyUSB0 │ │ Port 161 │
└─────────────────┘ └─────────────────┘
Key Components¶
MainWindow¶
File: mainwindow.h, mainwindow.cpp
The main application window that orchestrates all UI components and manages the application state.
Responsibilities:
- Main window layout and UI orchestration
- Menu and toolbar management
- Dialog launching and coordination
- Application state management
SerialManager¶
File: serialmanager.h, serialmanager.cpp
Handles all serial port communication with the CISCO / BushNET switch.
Responsibilities:
- Serial port opening/closing
- Data transmission and reception
- Connection state management
- Signal emission for received data
TerminalWidget¶
File: terminalwidget.h, terminalwidget.cpp
A terminal emulator widget with ANSI color support.
Responsibilities:
- Display received serial data
- Parse ANSI escape sequences for colors
- Handle user keyboard input
- Command line editing
CommandHistory¶
File: commandhistory.h, commandhistory.cpp
Manages command history for the terminal.
Responsibilities:
- Store previous commands
- Navigate history (up/down arrow)
- Command persistence
WelcomeTab¶
File: welcometab.h, welcometab.cpp
Welcome landing page displayed when the application starts.
Responsibilities:
- Display product branding and company information
- Show application version and description
- Custom-painted background with Astute Systems branding
CredentialsTab¶
File: credentialstab.h, credentialstab.cpp
Manages switch login credentials with auto-login support.
Responsibilities:
- Store username, password, and enable password
- Remember credentials between sessions
- Auto-login to the switch on connection
- Auto-enter enable mode
SnmpClient¶
File: snmpclient.h, snmpclient.cpp
Pure Qt SNMP client implementing SNMPv1/v2c using BER/ASN.1 encoding over UDP.
Responsibilities:
- SNMP GET, GETNEXT, GETBULK, and WALK operations
- BER/ASN.1 encoding and decoding
- Asynchronous and synchronous operation modes
- Request retry with timeout tracking
- OID-to-name resolution for common MIBs
SnmpMonitorTab¶
File: snmpmonitortab.h, snmpmonitortab.cpp
Real-time SNMP monitoring dashboard with Qt Charts integration.
Responsibilities:
- System information display (hostname, uptime, description)
- CPU utilisation monitoring with time-series charts
- Memory usage tracking with area charts
- Per-interface bandwidth monitoring with line charts
- Environmental monitoring (temperature, PSU, fans)
- Configurable polling intervals
ConnectionDialog¶
File: connectiondialog.h, connectiondialog.cpp
Dialog for configuring serial port connection parameters.
Responsibilities:
- Port selection
- Baud rate configuration
- Data bits, parity, stop bits settings
- Flow control options
SwitchPanelWidget¶
File: switchpanelwidget.h, switchpanelwidget.cpp
Visual representation of the switch front panel.
Responsibilities:
- Display port layout
- Show port status (up/down/disabled)
- Click to configure individual ports
- BushNET connector mapping
DeviceConfig¶
File: deviceconfig.h, deviceconfig.cpp
Handles device profile saving and loading.
Responsibilities:
- Save connection settings
- Load saved profiles
- Configuration file management
Dialog Components¶
Configuration Management¶
| Class | File | Purpose |
|---|---|---|
ConfigBackupDialog |
configbackupdialog.cpp |
Scheduled and manual backup/restore of switch configurations |
ConfigDiffDialog |
configdiffdialog.cpp |
Side-by-side comparison of running vs startup configurations |
ConfigTemplatesDialog |
configtemplatesdialog.cpp |
Reusable configuration template management |
Network Management¶
| Class | File | Purpose |
|---|---|---|
PortConfigDialog |
portconfigdialog.cpp |
Configure individual switch ports |
SwitchSettingsDialog |
switchsettingsdialog.cpp |
Global switch settings |
VlanEditorDialog |
vlaneditordialog.cpp |
VLAN creation, editing, and port assignment |
SpanningTreeDialog |
spanningtreedialog.cpp |
STP mode, priority, and per-port configuration |
SyslogViewerDialog |
syslogviewerdialog.cpp |
View, filter, and export syslog messages |
Security¶
| Class | File | Purpose |
|---|---|---|
AclEditorDialog |
acleditordialog.cpp |
Visual Access Control List builder |
PortSecurityDialog |
portsecuritydialog.cpp |
Port security with sticky MAC and violation modes |
Dot1xDialog |
dot1xdialog.cpp |
802.1X port-based authentication |
SNMP & Monitoring¶
| Class | File | Purpose |
|---|---|---|
SnmpConfigDialog |
snmpconfigdialog.cpp |
Configure SNMP communities, v3 users, and traps |
SnmpMonitorTab |
snmpmonitortab.cpp |
Real-time SNMP dashboard with charts |
System¶
| Class | File | Purpose |
|---|---|---|
FirmwareUpdateDialog |
firmwareupdatedialog.cpp |
Firmware upload via TFTP or USB |
CredentialsTab |
credentialstab.cpp |
Manage stored login credentials |
WelcomeTab |
welcometab.cpp |
Application landing page |
Data Flow¶
Sending Commands (Serial)¶
Receiving Data (Serial)¶
SNMP Monitoring¶
SnmpMonitorTab → SnmpClient → QUdpSocket → UDP Port 161 → CISCO / BushNET
CISCO / BushNET → UDP Response → QUdpSocket → SnmpClient → (signal) → SnmpMonitorTab → Charts
SNMP Configuration (via Serial)¶
Signal/Slot Connections¶
The application uses Qt's signal/slot mechanism for communication:
// SerialManager signals
void dataReceived(const QByteArray &data);
void connectionStateChanged(bool connected);
void errorOccurred(const QString &error);
// SnmpClient signals
void responseReceived(int requestId, const SnmpResponse &response);
void walkCompleted(int requestId, const QList<SnmpVarbind> &results);
void errorOccurred(int requestId, const QString &errorMessage);
// Example connections in MainWindow
connect(m_serialManager, &SerialManager::dataReceived,
m_terminalWidget, &TerminalWidget::appendData);
// SnmpMonitorTab connects directly to SnmpClient
connect(m_snmpClient, &SnmpClient::responseReceived,
this, &SnmpMonitorTab::onResponseReceived);
Configuration Files¶
The application stores settings in:
- Linux:
~/.config/AstuteSystems/IE3300SerialManager.conf
Settings include:
- Last used serial port
- Connection parameters
- Window geometry
- Recent device profiles
Threading Model¶
The application runs on a single thread with Qt's event loop. The QSerialPort class uses asynchronous I/O with signals for data reception. The SnmpClient uses QUdpSocket for asynchronous SNMP communication over UDP. Both avoid the need for separate threads by leveraging Qt's event-driven architecture.
The SnmpMonitorTab uses a QTimer for periodic polling, triggering SNMP requests at configurable intervals. Responses are delivered asynchronously via signals.
Dependencies¶
| Component | Requirement | Purpose |
|---|---|---|
| Qt6::Core | Qt 6.2+ | Core framework |
| Qt6::Gui | Qt 6.2+ | GUI primitives |
| Qt6::Widgets | Qt 6.2+ | Widget toolkit |
| Qt6::SerialPort | Qt 6.2+ | Serial communication |
| Qt6::Network | Qt 6.2+ | UDP sockets for SNMP |
| Qt6::Charts | Qt 6.2+ | Real-time monitoring charts |
Build System¶
The project uses CMake with Qt's AUTOMOC, AUTORCC, and AUTOUIC features:
This automatically generates:
- MOC files for Q_OBJECT classes
- Resource compilation for .qrc files
- UI class generation for .ui files