Modern C++ Library for GSM SMS over Serial
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.
Unified SerialPort API with Win32 and POSIX backends — Windows, Linux, macOS.
7-bit, 8-bit, and UCS-2 encode/decode. Concatenated SMS, UDH, status reports — no MFC or legacy globals.
Initialize, send (AT+CMGS), list (AT+CMGL), delete (AT+CMGD) in PDU mode.
RAII handles, std::error_code, std::span, and clear public headers under include/comettextel/.
Build as DLL/shared library and/or static archive from one CMake tree. find_package ready.
Stable C ABI with bindings for C#, Python, PureBasic, FreeBASIC — plus native C/C++.
One native library, many frontends
Native headers + stable C ABI (c_api.h). Shared/static libs for Windows & Linux.
CometTextel.NET with win-x64 + linux-x64 RID natives. P/Invoke over the C ABI.
Thin ctypes FFI. PDU + modem APIs. Wheels built in CI for Windows and Linux.
Runtime-load DLL samples for PDU encode/decode and modem send/list/delete.
Same C ABI surface — PDU and modem examples with local verify scripts.
Windows/Linux packages, C SDK zips, Python wheels, NuGet nupkg — every push to main.
Open a modem, send a UCS-2 SMS in a few lines
#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;
}
comettextel_send_example COM3 886932000000 886912345678 "Hello"
comettextel_list_example COM3
comettextel_receive_example COM3
CMake 3.28+ · C++23 (MSVC 19.4x+ / GCC 14+ / Clang 18+)
cmake -S . -B build -A x64
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure
find_package(comettextel 1.0 REQUIRED CONFIG)
target_link_libraries(app PRIVATE
comettextel::comettextel)
Getting Started Guide → · Download CI Artifacts or Release packages, then include & link.
Original Win32 COMM / GSM PDU code written as a Visual C++ project.
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 ProEnterprise distribution, custom integration, and dedicated support
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