Code to support this blog post (see here for a quick introduction).
This repository includes a development container configuration for VS Code. To use it:
- Install VS Code
- Install the Dev Containers extension
- Clone this repository
- Open the repository folder in VS Code
- When prompted, click "Reopen in Container" (or press F1, type "Dev Containers: Reopen in Container" and press Enter)
This will provide you with a development environment including all necessary tools for building and testing the project.
Before building this project, ensure you have the following dependencies installed:
- Rust toolchain (stable)
- CMake (3.1 or higher)
- C++ compiler with C++17 (or above) support
- Eclipse Paho MQTT C Client Library
brew install cmake
brew install paho-mqtt
sudo apt update
sudo apt install build-essential cmake libssl-dev
sudo apt install libpaho-mqtt-dev
sudo yay -S paho-mqtt-c-git
For other Linux distributions, please use the appropriate package manager.
This project uses Cargo with a custom build script (build.rs
) to handle the C++ dependencies.
# Clone the repository
git clone https://github.com/jsulmont/rs-polar-mqtt
cd rs-polar-mqtt
# Build the project
cargo build
There are currently 3 examples which you should be able to run with crgo as usual:
cargo run --example mosquito_org
Note that mosquito_org
will only work if test.mosquitto.org
listen to port 1883
(it's sometime down).
nope ... 😈
Platform | Status |
---|---|
macOS | ✅ |
Linux | ✅ |