idryer-core — 庫文檔¶
idryer-core — C++ library (Arduino/PlatformIO) for ESP32-based iDryer devices. Manages WiFi, MQTT, the cloud state machine, and command routing. The product implements only device-specific behaviour.
This is documentation for the library, not for any specific product.
Product documentation is located in docs/ru/.
Quick start¶
Three things you implement:
- Implement
IProfile— five methods (config, info, loop). - Assemble
main.cpp— static objects, pass dependencies through constructors. - Register
handleCommand— a single handler for MQTT and optionally for the local WS.
Three things the library does:
- Manages WiFi → provisioning → the MQTT session.
- Routes incoming commands to your
handleCommand(exceptping, which is handled internally). - Calls your
IProfilemethods at the right moments.
What you can leave untouched:
ArduinoWifiManager,ArduinoCredentialStore, and otherArduino*classes — use as-is, no subclassing needed.CloudStateMachine— create it and pass it toIdryerRuntime; it manages itself from there.ActionDispatcher— compatibility fallback for invoke/set; for a new product, command handling goes throughsetCommandHandler(), not throughActionDispatcher.
Practical guide: 09-add-product/01-add-new-product.md
Working examples: examples/
部分¶
| Section | Description |
|---|---|
| 01-overview/01-what-is-idryer-core | Library purpose, what it does not do, who uses it |
| 01-overview/02-module-map | Table of all modules: purpose, optionality |
| 02-getting-started | Short onramp for a new developer: what to wire up, flash, and expect |
| 05-architecture/01-composition-root | How the product assembles the stack: object creation order, main.cpp pattern |
| 05-architecture/02-library-vs-product-boundary | What lives in the library, what lives in the product |
| 05-architecture/03-data-flow | Data flow in a running device: incoming commands, outgoing messages, connections |
| 06-mqtt/01-mqtt-client | MqttClient class: constructor, connection, publishing |
| 06-mqtt/02-topics-and-messages | All MQTT topics: strings, payloads, retained, QoS |
| 04-runtime/01-idryer-runtime | IdryerRuntime: what it coordinates, which commands it handles |
| 05-uart/01-uart-layer | UART bridge for dual-MCU devices |
| 06-integrations/01-integrations-overview | Bambu, Home Assistant, Moonraker: setup, limitations |
| 07-platform-arduino/01-arduino-platform | Arduino implementations of device interfaces |
| 08-profiles-and-products/01-profiles-model | IProfile interface, callbacks, LedStripProfile example |
| 09-contracts/01-mqtt-contract | mqtt_contract.yaml: purpose and rules for modification |
| 10-how-to-add-product/01-add-new-product | Checklist for building a new product on top of idryer-core |
| 10-troubleshooting | Common issues: WiFi, provisioning, MQTT, commands, LocalAccess |
| 04-patterns/01-add-sensor | How to add a sensor (data source) and publish its readings |
| 04-patterns/02-add-peripheral | How to add a peripheral and receive commands |
| 04-patterns/03-add-transport | How to add a parallel transport (BLE, HTTP, custom) |
| 04-patterns/04-data-flow | Applied recipes for passing data between sensors / peripherals / profile / publishers |