• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 基于鸿蒙LiteOS-M内核平台的Paho MQTT库
2
3原始的 Paho MQTT源码:https://github.com/eclipse/paho.mqtt.embedded-c
4
5鸿蒙系统相关移植文件:MQTTClient-C\src\liteOS\MQTTLiteOS.c
6
7# Eclipse Paho MQTT C/C++ client for Embedded platforms
8
9This repository contains the source code for the [Eclipse Paho](http://eclipse.org/paho) MQTT C/C++ client library for Embedded platorms.
10
11It 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.
12
13There are three sub-projects:
14
151. MQTTPacket - simple de/serialization of MQTT packets, plus helper functions
162. MQTTClient - high(er) level C++ client, plus
173. MQTTClient-C - high(er) level C client (pretty much a clone of the C++ client)
18
19The *MQTTPacket* directory contains the lowest level C library with the smallest requirements.  This supplies simple serialization
20and deserialization routines.  They serve as a base for the higher level libraries, but can also be used on their own
21It is mainly up to you to write and read to and from the network.
22
23The *MQTTClient* directory contains the next level C++ library.  This networking code is contained in separate classes so that you can plugin the
24network of your choice.  Currently there are implementations for Linux, Arduino and mbed.  ARM mbed was the first platform for which this was written,
25where the conventional language choice is C++, which explains the language choice.  I have written a starter [Porting Guide](http://modelbasedtesting.co.uk/2014/08/25/porting-a-paho-embedded-c-client/).
26
27The *MQTTClient-C* directory contains a C equivalent of MQTTClient, for those platforms where C++ is not supported or the convention.  As far
28as possible it is a direct translation from *MQTTClient*.
29
30## Build requirements / compilation
31
32CMake builds for the various packages have been introduced, along with Travis-CI configuration for automated build & testing.  The basic
33method of building on Linux is:
34
35```
36mkdir build.paho
37cd build.paho
38cmake ..
39make
40```
41
42The travis-build.sh file has the full build and test sequence for Linux.
43
44
45## Usage and API
46
47See the samples directories for examples of intended use.  Doxygen config files for each package are available in the doc directory.
48
49## Runtime tracing
50
51The *MQTTClient* API has debug tracing for MQTT packets sent and received - turn this on by setting the MQTT_DEBUG preprocessor definition.
52
53
54## Reporting bugs
55
56This project uses GitHub Issues here: [github.com/eclipse/paho.mqtt.embedded-c/issues](https://github.com/eclipse/paho.mqtt.embedded-c/issues) to track ongoing development and issues.
57
58## More information
59
60Discussion of the Paho clients takes place on the [Eclipse Mattermost Paho channel](https://mattermost.eclipse.org/eclipse/channels/paho) and the [Eclipse paho-dev mailing list](https://dev.eclipse.org/mailman/listinfo/paho-dev).
61
62More information is available via the [MQTT community](http://mqtt.org).
63