开源软件名称(OpenSource Name):eclipse/paho.mqtt.c开源软件地址(OpenSource Url):https://github.com/eclipse/paho.mqtt.c开源编程语言(OpenSource Language):C 86.9%开源软件介绍(OpenSource Introduction):Eclipse Paho C Client Library for the MQTT ProtocolThis repository contains the source code for the Eclipse Paho MQTT C client library. This code builds libraries which enable applications to connect to an MQTT broker to publish messages, and to subscribe to topics and receive published messages. Synchronous and various asynchronous programming models are supported. Information About MQTT
LibrariesThe Paho C client comprises four variant libraries, shared or static:
Which Paho C API to use, with some history, for context Usage and APIDetailed API documentation is available online. It is also available by building the Doxygen docs in the Samples are available in the Doxygen docs and also in
Some potentially useful blog posts:
Various MQTT and MQTT-SN talks I've given. Runtime tracingA number of environment variables control runtime tracing of the C library. Tracing is switched on using The verbosity of the output is controlled using the The variable
Reporting bugsPlease open issues in the Github project: https://github.com/eclipse/paho.mqtt.c/issues. More informationDiscussion of the Paho clients takes place on the Eclipse paho-dev mailing list. General questions about the MQTT protocol are discussed in the MQTT Google Group. There is more information available via the MQTT community site. Build instructions for GNU MakeEnsure the OpenSSL development package is installed. Then from the client library base directory run:
This will build and install the libraries. To uninstall:
To build the documentation requires doxygen and optionally graphviz.
The provided GNU Makefile is intended to perform all build steps in the Options that are passed to the compiler/linker can be specified by typical Unix build variables:
Build requirements / compilation using CMakeThe build process currently supports a number of Linux "flavors" including ARM and s390, OS X, AIX and Solaris as well as the Windows operating system. The build process requires the following tools:
On Debian based systems this would mean that the following packages have to be installed:
Also, in order to build a debian package from the source code, the following packages have to be installed
Ninja can be downloaded from its github project page in the "releases" section. Optionally it is possible to build binaries with SSL support. This requires the OpenSSL libraries and includes to be available. E. g. on Debian:
The documentation requires doxygen and optionally graphviz:
Before compiling, determine the value of some variables in order to configure features, library locations, and other options:
Using these variables CMake can be used to generate your Ninja or Make files. Using CMake, building out-of-source is the default. Therefore it is recommended to invoke all build commands inside your chosen build directory but outside of the source tree. An example build session targeting the build platform could look like this:
Invoking cmake and specifying build options can also be performed using cmake-gui or ccmake (see https://cmake.org/runningcmake/). For example:
To compile/link the binaries and to generate packages, simply invoke Debug buildsDebug builds can be performed by defining the value of the
Running the testsTest code is available in the After ensuring a MQTT broker is available, it is possible to execute the tests by starting the proxy and running
Cross compilationCross compilation using CMake is performed by using so called "toolchain files" (see: http://www.vtk.org/Wiki/CMake_Cross_Compiling). The path to the toolchain file can be specified by using CMake's For your convenience toolchain files for the following platforms can be found in the
The provided toolchain files assume that required compilers/linkers are to be found in the environment, i. e. the PATH-Variable of your user or system. If you prefer, you can also specify the absolute location of your compilers in the toolchain files. Example invocation for the Raspberry Pi:
Compilers for the Raspberry Pi can be obtained from e. g. Linaro (see: http://releases.linaro.org/15.06/components/toolchain/binaries/4.8/arm-linux-gnueabihf/). This example assumes that OpenSSL-libraries and includes have been installed in the Example invocation for Windows 64 bit:
In this case the libraries and executable are not linked against OpenSSL Libraries. Cross compilers for the Windows platform can be installed on Debian like systems like this:
Microsoft WindowsCalling conventionAs is normal for C programs on Windows, the calling convention is __cdecl. See the Microsoft documentation here: https://docs.microsoft.com/en-us/cpp/cpp/cdecl?view=vs-2019 If you call this library from another language, you may need to take this into account. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论