A template for an Anolis device provider in C++, built on the C++ provider SDK. It runs as is: each configured device is a simulated heater, so it needs no hardware. Replace the heater with your device and keep the rest.
What it gives you, all passing in CI:
- A provider that passes the anolis-protocol conformance harness at level 2. The only skips are the two call-deadline tests, until the C++ SDK supports deadlines (anolis-provider-sdk#71).
- A statically linked binary for linux x86_64 and arm64, built with vcpkg.
- A release workflow that publishes what
install.shand the Workbench read, so a machine profile can pin your repository from any GitHub account.
CI and release depend on nothing of anolishq's beyond public releases, so the
same workflows run in your account.
anolis-provider-hello-cpp
is the evidence: a provider generated from this template on a personal account,
renamed with scripts/rename.sh and released as
v0.1.0
with nothing else changed. If the build or release path here changes, generate
it again the same way.
-
Click Use this template and create your repository.
-
Rename it to your provider's kind, which must use
a-z,0-9and-and start with a letter:scripts/rename.sh bme280-lab # binary: anolis-provider-bme280-lab -
Change
.github/CODEOWNERSto your account, and this README to describe your provider. -
Replace the heater in
src/provider.cppwith your device: its config, its signals and functions, andread,callandstop. The provider guide covers each. The SDK checks every call's arguments against the declaredArgSpecs, socallchecks only what anArgSpeccannot express. -
Keep
config/conformance.yamlrunnable without hardware (a mock mode), so the harness and CI can drive your provider anywhere. -
Build and test. You need vcpkg with
VCPKG_ROOTset, CMake, Ninja, a C++20 compiler,pkg-configand Python 3:just build # the first build compiles protobuf through vcpkg just test # the conformance harness against the build
-
Release: set
VERSIONinproject()inCMakeLists.txt, then push a matching tag (v0.1.0).
heater has a first-order thermal model. Its temperature approaches
ambient_c plus max_rise_c times the power level, with a 60 s time
constant, and it counts the energy it draws at rated_w.
| Signal | Type | |
|---|---|---|
temperature |
double, degC | |
power |
double, 0 to 1 | |
energy |
double, J | read on request only |
| Function | Category | |
|---|---|---|
set_power(power: 0..1) |
ACTUATE | 0 is the safe state, so the runtime can stop it |
reset_energy() |
CONFIG | returns the energy count it cleared |
The provider turns every heater off when it exits, however the session ends.
This template is never released itself; a provider made from it is, under its own name. Pin that release in a machine profile, from whichever account holds it:
components:
providers:
bme280-lab:
repo: <your-account>/anolis-provider-bme280-lab
version: "0.1.0"Apache-2.0.