Building BushNET-Tools

This guide explains how to build the CISCO / BushNET Serial Manager application from source.

Prerequisites

Required Packages

Ubuntu/Debian:

sudo apt update
sudo apt install build-essential cmake qt6-base-dev qt6-serialport-dev \
    qt6-charts-dev libqt6network6

Fedora/RHEL:

sudo dnf install cmake gcc-c++ qt6-qtbase-devel qt6-qtserialport-devel \
    qt6-qtcharts-devel

Technology Stack

Component Requirement
Language C++17
Framework Qt 6.2+
Qt Modules Core, Gui, Widgets, SerialPort, Network, Charts
Build System CMake 3.16+
Platform Linux (Ubuntu/Debian, Fedora/RHEL)

Building

Quick Build

# Clone the repository
git clone https://github.com/DefenceX/BushNET-Tools.git
cd BushNET-Tools

# Create build directory
mkdir build && cd build

# Configure with CMake
cmake ..

# Build
make -j$(nproc)

# Run
./bin/IE3300SerialManager

Using the Build Script

Alternatively, use the provided build script:

./build.sh

Project Structure

BushNET-Tools/
├── include/          # Header files (.h)
├── src/              # Source files (.cpp)
├── ui/               # Qt UI files (.ui)
├── resources/        # Qt resource files (.qrc) and icons
├── docs/             # User documentation
├── images/           # Application images
├── build/            # Build output directory
└── CMakeLists.txt    # CMake build configuration

CMake Options

The CMakeLists.txt supports the following options:

# Build in release mode
cmake -DCMAKE_BUILD_TYPE=Release ..

# Build in debug mode
cmake -DCMAKE_BUILD_TYPE=Debug ..

Running the Application

After building, the executable is located at:

build/bin/IE3300SerialManager

Serial Port Access

To access serial ports without root privileges, add your user to the dialout group:

sudo usermod -aG dialout $USER

Log out and back in for the changes to take effect.

Troubleshooting Build Issues

Qt6 Not Found

If CMake cannot find Qt6:

# Install Qt6 development packages
sudo apt install qt6-base-dev qt6-serialport-dev qt6-charts-dev

# Or set Qt6 path manually
cmake -DCMAKE_PREFIX_PATH=/path/to/qt6 ..

Missing SerialPort Module

# Ubuntu/Debian
sudo apt install qt6-serialport-dev

# Fedora/RHEL
sudo dnf install qt6-qtserialport-devel

Missing Charts Module

# Ubuntu/Debian
sudo apt install qt6-charts-dev

# Fedora/RHEL
sudo dnf install qt6-qtcharts-devel

Build Fails with C++17 Errors

Ensure you have a C++17 compatible compiler:

# Check GCC version (need 7+)
gcc --version

# Install newer GCC if needed
sudo apt install g++-11

Packaging

The project includes packaging configuration for Linux:

packaging/
└── linux/
    ├── IE3300SerialManager.desktop
    └── ie3300serialmanager.metainfo.xml

Creating a Debian Package

cd build
cpack -G DEB

Creating an RPM Package

cd build
cpack -G RPM

Development

Adding New Classes

  1. Create header in include/newclass.h
  2. Create source in src/newclass.cpp
  3. Optionally create UI file in ui/newclass.ui
  4. Add files to CMakeLists.txt
  5. Use Q_OBJECT macro if using signals/slots

Code Style

  • Use C++17 features where appropriate
  • Follow Qt coding conventions
  • Use camelCase for functions and variables
  • Use PascalCase for class names
  • Prefix member variables with m_ (e.g., m_serialPort)