1
0
mirror of https://github.com/eclipse/paho.mqtt.cpp.git synced 2025-05-09 11:21:24 +08:00

Spell checking

This commit is contained in:
fpagliughi 2024-06-16 14:07:10 -04:00
parent cb9da43934
commit c15a1e7b31
18 changed files with 60 additions and 64 deletions

View File

@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [#491](https://github.com/eclipse/paho.mqtt.cpp/pull/491) add topic_matcher.h to install
- [#485](https://github.com/eclipse/paho.mqtt.cpp/pull/485) export dependencies
- [#484](https://github.com/eclipse/paho.mqtt.cpp/pull/484) add token::get_message
- [#480](https://github.com/eclipse/paho.mqtt.cpp/issues/480) Fixed Paho C version in 'install_paho_mqtt_c.sh' script.
- [#466](https://github.com/eclipse/paho.mqtt.cpp/pull/466) Iterable string collection
- [#416](https://github.com/eclipse/paho.mqtt.cpp/issues/416) Removed FindPahoMqttC.cmake. Using Paho C package directly.
@ -54,10 +55,10 @@ Fixed Issues and Pull Requests:
- [#343](https://github.com/eclipse/paho.mqtt.cpp/issues/343) async_client::try_consume_message_until taking single parameter fails to compile
- [#445](https://github.com/eclipse/paho.mqtt.cpp/pull/445) Update properties when moving/copying connect options.
- [#325]() Cache connect options in client to keep memory valid for callbacks like SSL on_error()
- [#325](https://github.com/eclipse/paho.mqtt.cpp/issues/325) Cache connect options in client to keep memory valid for callbacks like SSL on_error()
- [#361](https://github.com/eclipse/paho.mqtt.cpp/issues/361) Added missing LICENSE file to conform to GitHub conventions.
- [#304](https://github.com/eclipse/paho.mqtt.cpp/issues/304) Missing create_options::DFLT_C_STRUCT symbol when linking with MSVC.
- [#429] (https://github.com/eclipse/paho.mqtt.cpp/issues/411) Remove declaration of connect_options::to_string() with missing implementation.
- [#429](https://github.com/eclipse/paho.mqtt.cpp/issues/429) Remove declaration of connect_options::to_string() with missing implementation.
- [#411](https://github.com/eclipse/paho.mqtt.cpp/issues/411) Missing virtual keyword for some client methods
- [#444](https://github.com/eclipse/paho.mqtt.cpp/issues/444) Unit tests to check that connect options builder sets properties.
- [#313](https://github.com/eclipse/paho.mqtt.cpp/issues/313) Get unit tests building on Windows. Needed to get rid of make_unique<> for Windows
@ -126,7 +127,7 @@ This release was primarily to add MQTT v5 support and server responses.
- Properties can also be obtained from server responses to requests such as from a _connect_ call. These are available in the `token` objects when they complete.
- The client object tracks the desired MQTT version that the app requested and/or is currently connected at. Internally this is now required by the `response_options` the need to distinguish between pre-v5 and post-v5 callback functions.
- MQTT v5 reason codes for requests are available via `token` objects when they complete. They are also available in `exception` objects that are thrown by tokens.
- Support for subscibe options, like no local subscriptions, etc.
- Support for subscribe options, like no local subscriptions, etc.
- Sample applications were added showing how to do basic Remote Procedure Calls (RPC's) with MQTT v5 using the *RESPONSE_TOPIC* and *CORRELATION_DATA* properties. These are *rpc_math_cli* and *rpc_math_srvr* in the _src/samples_ directory.
- A sample "chat" application was added, showing how to use subscribe options, such as "no local".
- More descriptive error messages (PR #154), integrated into the `mqtt::exception` class. MQTT v5 reason codes are also included in the exceptions when an error occurs.

View File

@ -18,7 +18,7 @@ The Paho C++ library attempts to follow the naming conventions of the C++ standa
- Class names are lower snake case: *classes_like_this*
- Function names are lower snake case: *functions_like_this*
- Variable names are lower camel case: *varsLikeThis*
- Class memeber are lower camel case with a trailing underscore: *memVarsLikeThis_*
- Class members are lower camel case with a trailing underscore: *memVarsLikeThis_*
- Constants are all caps: *CONSTANTS_LIKE_THIS*
## Format Conventions

View File

@ -36,7 +36,7 @@ To keep up with the latest announcements for this project, or to ask questions:
### What's New in v1.4.0
The v1.4 release is primarily concerned with reorganizing the sources and fixing a number of CMake build issues, particulary to get the Paho C submodule build working with the existing C library, fix transient deendencies, and get the Windows DLL (maybe, finally) working properly.
The v1.4 release is primarily concerned with reorganizing the sources and fixing a number of CMake build issues, particularly to get the Paho C submodule build working with the existing C library, fix transient dependencies, and get the Windows DLL (maybe, finally) working properly.
- Ability to build the Paho C library automatically (now working)
- Reworked the CMake build so that 'PAHO_WITH_MQTT_C' option properly compiles the existing Paho C v1.3.13
@ -44,20 +44,15 @@ The v1.4 release is primarily concerned with reorganizing the sources and fixing
- Reorganized the source tree:
- Moved header files to top-level 'include/' directory.
- Moved 'src/sampless/' to top-level and renamed 'examples/'
- Removed the ob
- Fixed and optimized 'topic_matcher' trie collection
- Added some missing Eclipse/Paho legal documents to the repo.
- [#498](https://github.com/eclipse/paho.mqtt.cpp/issues/416) Overloaded property constructor to also take a uint32_t
- [#491](https://github.com/eclipse/paho.mqtt.cpp/pull/491) add topic_matcher.h to install
- [#485](https://github.com/eclipse/paho.mqtt.cpp/pull/485) export dependencies
- [#484](https://github.com/eclipse/paho.mqtt.cpp/pull/484) add token::get_message
- [#466](https://github.com/eclipse/paho.mqtt.cpp/pull/466) Iterable string collection
- [#416](https://github.com/eclipse/paho.mqtt.cpp/issues/416) Removed FindPahoMqttC.cmake. Using Paho C package directly.
For a full list of updates see the [CHANGELOG](https://github.com/eclipse/paho.mqtt.cpp/blob/master/CHANGELOG.md)
## Coming Next
The next minor release, v1.5, will upgrade the library to C++17 and start adding features the the newer C++ versions support, like an API that uses `std::variant<>`, `std::option<>`, `constexpr`, and so on.
The next release, v1.5, will upgrade the library to C++17 and start adding features the the newer C++ version supports, like an API that uses `std::variant<>`, `std::option<>`, `constexpr`, and so on.
## Contributing
@ -73,7 +68,7 @@ Contributions to this project are gladly welcomed and appreciated Before submitt
_CMake_ is a cross-platform build system suitable for Unix and non-Unix platforms such as Microsoft Windows. It is now the only supported build system.
The Paho C++ library requires the Paho C library, v1.3.13 or greater, to be built and installed first. More information below.
The Paho C++ library requires the Paho C library, v1.3.13 or greater, to be built and installed. That can be done before building this library, or it can be done here using the CMake `PAHO_WITH_MQTT_C` build option.
CMake allows for options to direct the build. The following are specific to Paho C++:
@ -102,10 +97,10 @@ The build process currently supports a number of Unix and Linux flavors. The bui
On Debian based systems this would mean that the following packages have to be installed:
```
$ sudo apt-get install build-essential gcc make cmake cmake-gui cmake-curses-gui
$ sudo apt-get install build-essential gcc make cmake
```
If you will be using secure sockets (and you probably should):
If you will be using secure sockets (and you probably should if you're sending messages across a public netwok):
```
$ sudo apt-get install libssl-dev
@ -117,17 +112,17 @@ Building the documentation requires doxygen and optionally graphviz to be instal
$ sudo apt-get install doxygen graphviz
```
Unit tests are being built using _Catch2_.
Unit tests are built using _Catch2_.
_Catch2_ can be found here: [Catch2](https://github.com/catchorg/Catch2). You must download and install _Catch2_ to build and run the unit tests locally.
#### Building the Paho C library
Before building the C++ library, first, build and install the Paho C library, if not already present. Note, this version of the C++ library requires Paho C v1.3.13 or greater.
The Paho C library can be built automatically when building this library by enabling the CMake build option, `PAHO_WITH_MQTT_C`. That will build and install the Paho C library from a Git submodule, using a known-good version, and the proper build configuration for the C++ library.
As of C++ v1.3.0, the recommended version of the Paho C library is included in the repo as a submodule. This can be built together with the C++ library all at the same time, which simplifies the overall build of the packages.
If you want to manually specify the build configuration of the Paho C library or use a different version, then it must be built and installed before building this library. Note, this version of the C++ library requires Paho C v1.3.13 or greater.
But, if you want to build the Paho C library manually, it can be done as follows:
To download and build the Paho C library:
```
$ git clone https://github.com/eclipse/paho.mqtt.c.git
@ -161,7 +156,7 @@ $ git clone https://github.com/eclipse/paho.mqtt.cpp
$ cd paho.mqtt.cpp
$ cmake -Bbuild -H. -DPAHO_WITH_MQTT_C=ON -DPAHO_BUILD_STATIC=ON \
-DPAHO_BUILD_DOCUMENTATION=ON -DPAHO_BUILD_SAMPLES=ON
-DPAHO_BUILD_DOCUMENTATION=ON -DPAHO_BUILD_EXAMPLES=ON
$ sudo cmake --build build/ --target install
$ sudo ldconfig
```
@ -194,11 +189,11 @@ $ (cd build && cpack)
### Windows
On Windows systems CMake creates Visual Studio project files for use with MSVC. Currently, other compilers like _clang_ or _MinGW_ are not directly supported.
On Windows, CMake creates Visual Studio project files for use with MSVC. Currently, other compilers like _clang_ or _MinGW_ are not directly supported.
#### Using Paho C++ as a Windows DLL
The project can be built as a static library or shared DLL on Windows. If using it as a DLL in your application, yuo should define the macro `PAHO_MQTTPP_IMPORTS` before including any Paho C++ include files. Preferably, make it a global definition in the application's build file, like in CMake:
The project can be built as a static library or shared DLL on Windows. If using it as a DLL in your application, you should define the macro `PAHO_MQTTPP_IMPORTS` before including any Paho C++ include files. Preferably, make it a global definition in the application's build file, like in CMake:
target_compile_definitions(myapp PUBLIC PAHO_MQTTPP_IMPORTS)

View File

@ -15,7 +15,7 @@
//
/*******************************************************************************
* Copyright (c) 2013-2023 Frank Pagliughi <fpagliughi@mindspring.com>
* Copyright (c) 2013-2024 Frank Pagliughi <fpagliughi@mindspring.com>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
@ -40,7 +40,7 @@
#include "mqtt/async_client.h"
const std::string SERVER_ADDRESS("mqtt://localhost:1883");
const std::string CLIENT_ID("paho_cpp_async_subcribe");
const std::string CLIENT_ID("paho_cpp_async_subscribe");
const std::string TOPIC("hello");
const int QOS = 1;

View File

@ -127,7 +127,7 @@ int main(int argc, char* argv[])
return 1;
}
// Let eveyone know that a new user joined the conversation.
// Let everyone know that a new user joined the conversation.
topic.publish("<<" + chatUser + " joined the group>>");
@ -141,7 +141,7 @@ int main(int argc, char* argv[])
topic.publish(usrMsg);
}
// Let eveyone know that the user left the conversation.
// Let everyone know that the user left the conversation.
topic.publish("<<" + chatUser + " left the group>>")->wait();

View File

@ -13,7 +13,7 @@
//
// Note that this is a fairly contrived example, and it could be done much
// more easily in a single thread. It is meant to demonstrate how you can
// share a client amonst threads if and when that's a proper thing to do.
// share a client amongst threads if and when that's a proper thing to do.
//
// At this time, there is a single callback or consumer queue for all
// incoming messages, so you would typically only have one thead receiving

View File

@ -72,11 +72,11 @@ int main(int argc, char* argv[])
cout << "OK (" << connRsp.get_server_uri() << ")" << endl;
// Since we gave an empty client ID, the server should create a
// unique one for us and send it back as ASSIGNED_CLIENT_IDENTIFER
// unique one for us and send it back as ASSIGNED_CLIENT_IDENTIFIER
// in the connect properties.
string clientId = get<string>(connRsp.get_properties(),
mqtt::property::ASSIGNED_CLIENT_IDENTIFER);
mqtt::property::ASSIGNED_CLIENT_IDENTIFIER);
// So now we can create a unique RPC response topic using
// the assigned (unique) client ID.

View File

@ -50,7 +50,7 @@ constexpr auto RESPONSE_TOPIC = mqtt::property::RESPONSE_TOPIC;
constexpr auto CORRELATION_DATA = mqtt::property::CORRELATION_DATA;
// --------------------------------------------------------------------------
// Simple function to manually reconect a client.
// Simple function to manually reconnect a client.
bool try_reconnect(mqtt::client& cli)
{

View File

@ -10,7 +10,7 @@
// - Using a persistent (non-clean) session
// - Subscribing to multiple topics
// - Receiving messages through the queueing consumer API
// - Recieving and acting upon commands via MQTT topics
// - Receiving and acting upon commands via MQTT topics
// - Auto reconnect
// - Updating auto-reconnect data
//

View File

@ -10,7 +10,7 @@
// - Using a persistent (non-clean) session
// - Subscribing to multiple topics
// - Receiving messages through the queueing consumer API
// - Recieving and acting upon commands via MQTT topics
// - Receiving and acting upon commands via MQTT topics
// - Auto reconnect
// - Updating auto-reconnect data
//

View File

@ -160,7 +160,7 @@ public:
int main(int argc, char* argv[])
{
std::cout << "Initialzing..." << std::endl;
std::cout << "Initializing..." << std::endl;
sample_mem_persistence persist;
mqtt::client client(SERVER_ADDRESS, CLIENT_ID, &persist);

View File

@ -85,12 +85,12 @@ namespace mqtt {
* @li @em "wss:// - A secure websocket connection using SSL/TLS.
*
* The secure connection types assume that the library was built with
* OpenSSL support, otherwise requesting a secure conection will result in
* OpenSSL support, otherwise requesting a secure connection will result in
* an error.
*
* The communication methods of this class - `connect()`, `publish()`,
* `subscribe()`, etc. - are all asynchronous. They create the request for
* the server, but return imediately, before a response is received back
* the server, but return immediately, before a response is received back
* from the server.
*
* These methods return a `Token` to the caller which is akin to a C++
@ -114,11 +114,11 @@ public:
/** Handler type for registering an individual message callback */
using message_handler = std::function<void(const_message_ptr)>;
/** Handler type for when a connecion is made or lost */
/** Handler type for when a connection is made or lost */
using connection_handler = std::function<void(const string& cause)>;
/** Handler type for when a disconnect packet is received */
using disconnected_handler = std::function<void(const properties&, ReasonCode)>;
/** Handler for updaing connection data before an auto-reconnect. */
/** Handler for updating connection data before an auto-reconnect. */
using update_connection_handler = std::function<bool(connect_data&)>;
private:

View File

@ -6,7 +6,7 @@
/////////////////////////////////////////////////////////////////////////////
/*******************************************************************************
* Copyright (c) 2017 Frank Pagliughi <fpagliughi@mindspring.com>
* Copyright (c) 2017-2024 Frank Pagliughi <fpagliughi@mindspring.com>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
@ -220,8 +220,8 @@ public:
bool is_null() const { return !data_; }
/**
* Determines if the buffer is empty.
* @return @em true if the buffer is empty or thr reference is null, @em
* false if the buffer contains data.
* @return @em true if the buffer is empty or the reference is null,
* @em false if the buffer contains data.
*/
bool empty() const { return !data_ || data_->empty(); }
/**
@ -285,7 +285,7 @@ std::ostream& operator<<(std::ostream& os, const buffer_ref<T>& buf) {
/////////////////////////////////////////////////////////////////////////////
/**
* A refernce to a text buffer.
* A reference to a text buffer.
*/
using string_ref = buffer_ref<char>;

View File

@ -68,7 +68,7 @@ public:
CORRELATION_DATA = 9,
SUBSCRIPTION_IDENTIFIER = 11,
SESSION_EXPIRY_INTERVAL = 17,
ASSIGNED_CLIENT_IDENTIFER = 18,
ASSIGNED_CLIENT_IDENTIFIER = 18,
SERVER_KEEP_ALIVE = 19,
AUTHENTICATION_METHOD = 21,
AUTHENTICATION_DATA = 22,

View File

@ -6,7 +6,7 @@
/////////////////////////////////////////////////////////////////////////////
/*******************************************************************************
* Copyright (c) 2017 Frank Pagliughi <fpagliughi@mindspring.com>
* Copyright (c) 2017-2024 Frank Pagliughi <fpagliughi@mindspring.com>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
@ -188,23 +188,23 @@ public:
*/
string_collection& operator=(string_collection&& coll) =default;
/**
* Gets a const iterator to the begining of the collecion.
* @return A const iterator to the begining of the collecion.
* Gets a const iterator to the beginning of the collection.
* @return A const iterator to the beginning of the collection.
*/
const_iterator begin() const { return coll_.begin(); }
/**
* Gets a const iterator to the end of the collecion.
* @return A const iterator to the end of the collecion.
* Gets a const iterator to the end of the collection.
* @return A const iterator to the end of the collection.
*/
const_iterator end() const { return coll_.end(); }
/**
* Gets a const iterator to the begining of the collecion.
* @return A const iterator to the begining of the collecion.
* Gets a const iterator to the beginning of the collection.
* @return A const iterator to the beginning of the collection.
*/
const_iterator cbegin() const { return coll_.cbegin(); }
/**
* Gets a const iterator to the end of the collecion.
* @return A const iterator to the end of the collecion.
* Gets a const iterator to the end of the collection.
* @return A const iterator to the end of the collection.
*/
const_iterator cend() const { return coll_.cend(); }
/**

View File

@ -83,7 +83,7 @@ namespace mqtt {
*
* To test against a single filter, see
* [`TopicFilter`](crate::TopicFilter). This collection is more commonly
* used when there are a nuber of filters and each needs to be associated
* used when there are a number of filters and each needs to be associated
* with a particular action or piece of data. Note, however, that a single
* incoming topic could match against several items in the collection. For
* example, the topic:
@ -101,7 +101,7 @@ namespace mqtt {
*
* Thus, the collection gives an iterator for the items matching a topic.
*
* A common use for this would be to store callbacks to proces incoming
* A common use for this would be to store callbacks to process incoming
* messages based on topics.
*
* This code was adapted from the Eclipse Python `MQTTMatcher` class:

View File

@ -51,7 +51,7 @@ class will_options
public:
/** The default QoS for the LWT, if unspecified */
PAHO_MQTTPP_EXPORT static const int DFLT_QOS; // =0;
/** The defalut retained flag for LWT, if unspecified */
/** The default retained flag for LWT, if unspecified */
PAHO_MQTTPP_EXPORT static const bool DFLT_RETAINED; // =false;
private:

View File

@ -178,7 +178,7 @@ void token::on_failure(MQTTAsync_failureData* rsp)
msgId_ = rsp->token;
rc_ = rsp->code;
// HACK: For backward compatability with v3 connections
// HACK: For backward compatibility with v3 connections
reasonCode_ = ReasonCode(MQTTPP_V3_CODE);
if (rsp->message)