Tiny · Elegant · Practical

CometTextel

Modern C++ Library for GSM SMS over Serial

C++23 CMake GSM 03.40 PDU Serial / AT C ABI · .NET · Python MIT License

Concise and lightweight. Send and receive short messages through a GSM modem with a clean serial abstraction, full PDU encode/decode, and AT-command helpers — ready as shared or static library.

Key Features

Cross-Platform Serial

Unified SerialPort API with Win32 and POSIX backends — Windows, Linux, macOS.

GSM PDU Codec

7-bit, 8-bit, and UCS-2 encode/decode. Concatenated SMS, UDH, status reports — no MFC or legacy globals.

Modem Helpers

Initialize, send (AT+CMGS), list (AT+CMGL), delete (AT+CMGD) in PDU mode.

Modern C++23

RAII handles, std::error_code, std::span, and clear public headers under include/comettextel/.

Shared & Static

Build as DLL/shared library and/or static archive from one CMake tree. find_package ready.

Multi-Language

Stable C ABI with bindings for C#, Python, PureBasic, FreeBASIC — plus native C/C++.

Language Bindings & Packages

One native library, many frontends

C / C++

Native headers + stable C ABI (c_api.h). Shared/static libs for Windows & Linux.

.NET / NuGet

CometTextel.NET with win-x64 + linux-x64 RID natives. P/Invoke over the C ABI.

Python

Thin ctypes FFI. PDU + modem APIs. Wheels built in CI for Windows and Linux.

PureBasic

Runtime-load DLL samples for PDU encode/decode and modem send/list/delete.

FreeBASIC

Same C ABI surface — PDU and modem examples with local verify scripts.

CI Artifacts

Windows/Linux packages, C SDK zips, Python wheels, NuGet nupkg — every push to main.

API Example

Open a modem, send a UCS-2 SMS in a few lines

main.cpp C++23
#include "comettextel/comettextel.hpp"
#include <iostream>

int main()
{
    comettextel::GsmModem modem;
    comettextel::SerialConfig config;
    config.baud_rate = 115200;

    if (const auto ec = modem.open_and_init("COM3", config); ec) {
        std::cerr << "open/init failed: " << ec.message() << '\n';
        return 1;
    }

    comettextel::Message message;
    message.service_center = "886932000000";
    message.peer_address   = "886912345678";
    message.coding         = comettextel::DataCoding::Ucs2;
    message.user_data      = "Hello from CometTextel";

    if (const auto ec = modem.send_message(message); ec) {
        std::cerr << "send failed: " << ec.message() << '\n';
        return 2;
    }
    return 0;
}
Send
comettextel_send_example COM3 886932000000 886912345678 "Hello"
List / Receive
comettextel_list_example COM3
comettextel_receive_example COM3

Build & Integrate

CMake 3.28+ · C++23 (MSVC 19.4x+ / GCC 14+ / Clang 18+)

Build

cmake -S . -B build -A x64
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure

Consumer (find_package)

find_package(comettextel 1.0 REQUIRED CONFIG)
target_link_libraries(app PRIVATE
    comettextel::comettextel)
Shared / Static
Examples
Unit Tests
C ABI
Doxygen
NuGet / Wheels

Getting Started Guide →  ·  Download CI Artifacts or Release packages, then include & link.

Project History

2014

Original Win32 COMM / GSM PDU code written as a Visual C++ project.

2026

Rewritten as a modern C++23 CMake library with cross-platform serial support and renamed to CometTextel. Multi-language SDKs, concat SMS, status reports, and CI packages follow.

Official Commercial Partner

KJPro Technology — Textel Pro

Enterprise distribution, custom integration, and dedicated support

Send SMS from Your Code

Clone the repo, link the library, and talk to any PDU-mode GSM modem — in C++, C#, Python, or BASIC.

Requires a GSM modem / USB dongle that speaks AT commands in PDU mode