Skip to content

About

Reusable C++/Qt library for network transport, Modbus commands, binary protocol parsing and device abstractions.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

common_lib

Reusable C++/Qt library for hardware-oriented applications, network communication, protocol parsing and device command processing.

Overview

common_lib contains reusable modules used in C++/Qt applications for device communication, network transport, Modbus commands, request/response processing and binary protocol parsing.

Modules

  • network_transport — TCP/serial transport abstractions.
  • modbus — Modbus-related commands and helpers.
  • parsers — binary protocol parsing.
  • requesters — request/response processing.
  • proxy_servers — proxy server components.
  • devices — device-level abstractions.
  • utilities — shared utility functions.
  • algorithm — common algorithms and helpers.

Typical use cases:

  • TCP proxy server between an external client and a hardware device.
  • Serial device communication with request/response processing.
  • UDP/TCP transport layer for telemetry and command exchange.
  • Modbus-based command processing.
  • Binary protocol parsing.
  • Shared device abstractions for multiple Qt services.
  • Telemetry data collection and packet building.

Tech Stack

  • C++
  • Qt Core
  • Qt Network
  • QMake
  • TCP/serial communication
  • Modbus

Architecture

Typical architecture of an application using common_lib:

External client / control system
        ↓
Application service
        ↓
Proxy server / requester
        ↓
Network transport
        ↓
Command / parser layer
        ↓
Hardware device or external service

Used By

This library is used by hardware-oriented C++/Qt services and applications:

  • bks_server — TCP proxy server for hardware device control.
  • Htra_console — console service for spectrum analyzer control, telemetry publishing and command processing.

These projects use common_lib as a shared foundation for transport abstractions, request/response processing, device communication and protocol-related utilities.

Example Usage

A typical service based on common_lib may create a transport object, pass it to a requester and use command objects to communicate with a device.

Conceptual example:

#include <QCoreApplication>

#include "devices/bks_device.h"
#include "requesters/serial_circular_requester.h"
#include "network_transport/abstract_network_transport_factory.h"

int main(int argc, char *argv[])
{
    QCoreApplication app(argc, argv);

    const QString transportConfigPath = "config/transport.example.ini";
    const QString deviceConfigPath = "config/device.example.ini";

    AbstractNetworkTransport *transport =
        AbstractNetworkTransportFactory::getInstance(
            transportConfigPath,
            "Transport"
        );

    auto *locker = new NetworkTransportLocker(
        maxResponseWaitingTime,
        minTransportWritingTimeout
    );

    auto *requester = new SerialCircularRequester(transport, locker);

    auto *device = new BksDevice(
        requester,
        deviceConfigPath,
        "BksDevice"
    );

    Q_UNUSED(device)

    return app.exec();
}

The following snippet is a conceptual example. Exact class names and configuration sections may differ depending on the target device.

About

Reusable C++/Qt library for network transport, Modbus commands, binary protocol parsing and device abstractions.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages