MCPcopy Index your code
hub / github.com/eclipse-paho/paho.mqtt.embedded-c

github.com/eclipse-paho/paho.mqtt.embedded-c @v1.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.0 ↗ · + Follow
505 symbols 1,271 edges 56 files 63 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Eclipse Paho MQTT C/C++ client for Embedded platforms

This repository contains the source code for the Eclipse Paho MQTT C/C++ client library for Embedded platorms.

It is dual licensed under the EPL and EDL (see about.html and notice.html for more details). You can choose which of these licenses you want to use the code under. The EDL allows you to embed the code into your application, and distribute your application in binary or source form without contributing any of your code, or any changes you make back to Paho. See the EDL for the exact conditions.

There are three sub-projects:

  1. MQTTPacket - simple de/serialization of MQTT packets, plus helper functions
  2. MQTTClient - high(er) level C++ client, plus
  3. MQTTClient-C - high(er) level C client (pretty much a clone of the C++ client)

The MQTTPacket directory contains the lowest level C library with the smallest requirements. This supplies simple serialization and deserialization routines. They serve as a base for the higher level libraries, but can also be used on their own It is mainly up to you to write and read to and from the network.

The MQTTClient directory contains the next level C++ library. This networking code is contained in separate classes so that you can plugin the network of your choice. Currently there are implementations for Linux, Arduino and mbed. ARM mbed was the first platform for which this was written, where the conventional language choice is C++, which explains the language choice. I have written a starter Porting Guide.

The MQTTClient-C directory contains a C equivalent of MQTTClient, for those platforms where C++ is not supported or the convention. As far as possible it is a direct translation from MQTTClient.

Build requirements / compilation

CMake builds for the various packages have been introduced, along with Travis-CI configuration for automated build & testing. The basic method of building on Linux is:

mkdir build.paho
cd build.paho
cmake ..
make

The travis-build.sh file has the full build and test sequence for Linux.

Usage and API

See the samples directories for examples of intended use. Doxygen config files for each package are available in the doc directory.

Runtime tracing

The MQTTClient API has debug tracing for MQTT packets sent and received - turn this on by setting the MQTT_DEBUG preprocessor definition.

Reporting bugs

This project uses GitHub Issues here: github.com/eclipse/paho.mqtt.embedded-c/issues to track ongoing development and issues.

More information

Discussion of the Paho clients takes place on the Eclipse Mattermost Paho channel and the Eclipse paho-dev mailing list.

General questions about the MQTT protocol are discussed in the MQTT Google Group.

More information is available via the MQTT community.

Core symbols most depended-on inside this repo

connect
called by 23
MQTTClient/src/MQTTClient.h
disconnect
called by 21
MQTTClient/src/MQTTClient.h
MessageType
called by 16
test/MQTTV3112.py
writeChar
called by 16
MQTTPacket/src/MQTTPacket.c
sendPacket
called by 16
MQTTClient-C/src/MQTTClient.c
unpack
called by 15
test/MQTTV3112.py
transport_sendPacketBuffer
called by 15
MQTTPacket/samples/transport.c
readInt16
called by 13
test/MQTTV3112.py

Shape

Function 247
Method 147
Class 95
Enum 16

Languages

C47%
C++32%
Python21%

Modules by API surface

test/MQTTV3112.py100 symbols
MQTTClient/src/MQTTClient.h38 symbols
MQTTClient-C/test/test1.c26 symbols
MQTTClient-C/src/MQTTClient.c25 symbols
MQTTClient/test/test1.cpp24 symbols
MQTTPacket/test/test1.c21 symbols
MQTTClient/samples/linux/main.cpp20 symbols
MQTTPacket/src/MQTTPacket.c18 symbols
MQTTClient/src/linux/linux.cpp17 symbols
MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c16 symbols
MQTTClient-C/src/linux/MQTTLinux.c14 symbols
MQTTPacket/samples/baremetalserial/ping_nb.c12 symbols

For agents

$ claude mcp add paho.mqtt.embedded-c \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page