266 const uint8_t *mac,
size_t mac_len);
293 const char *default_frontend,
294 const char *default_chip =
nullptr);
323 uint32_t timestamp_ms,
325 const char *frontend);
334 uint32_t timestamp_ms,
336 float free_memory_kb,
348 const char *message);
352 uint32_t timestamp_ms);
379 const std::string &command_name,
380 const std::string ¶ms_json,
constexpr const char * ESPECTRE_DEFAULT_DEVICE_LABEL
Empty label, meaning the device id is used as the display name.
std::string espectre_status_payload(const EspectreDeviceConfig &config, bool online, uint32_t timestamp_ms)
Availability payload.
constexpr const char * ESPECTRE_TOPIC_PREFIX
Default MQTT topic root.
constexpr const char * ESPECTRE_PROTOCOL_VERSION
Protocol version reported in payloads.
std::string espectre_topic(const EspectreDeviceConfig &config, const char *suffix)
Build a full topic from this device's prefix and a trailing segment.
std::string espectre_commands_payload(const EspectreDeviceConfig &config, const EspectreDeviceInfo &info)
MQTT command catalog for the current frontend.
std::string espectre_command_result_payload(const EspectreDeviceConfig &config, const EspectreCommand &command, bool accepted, const char *message)
Acknowledge a command, echoing its command_id.
bool parse_espectre_device_id(const std::string &value, uint64_t *device_id)
Parse a device id from its wire form.
constexpr const char * ESPECTRE_OTA_CHANNEL_DEVELOP
Rolling develop OTA channel.
bool parse_espectre_config_command(const std::string &command, EspectreDeviceConfig *config, std::string *error)
Parse a legacy ASCII SET_DEVICE_CONFIG: command.
std::string espectre_stats_payload(const EspectreDeviceConfig &config, const RuntimeSnapshot &snapshot, uint32_t timestamp_ms, uint32_t uptime_s, float free_memory_kb, float loop_time_ms, const RuntimeDiagnosticsSample *diagnostics=nullptr)
Health counters plus optional rate and link diagnostics.
EspectreOtaState
OTA progress, as reported to clients.
std::string espectre_telemetry_payload(const EspectreDeviceConfig &config, const RuntimeSnapshot &snapshot, uint32_t timestamp_ms, uint32_t uptime_s, const char *frontend)
Motion state, metric, and threshold.
std::string espectre_effective_device_id(const EspectreDeviceConfig &config)
espectre_effective_device_id_u64() in wire form.
std::string espectre_info_payload(const EspectreDeviceConfig &config, const EspectreDeviceInfo &info)
Device description, supported controls, and optional CSI traffic settings.
constexpr uint64_t ESPECTRE_DEFAULT_DEVICE_ID
Sentinel meaning "use the runtime-generated device id".
bool parse_espectre_mqtt_config_command(const std::string &command, EspectreDeviceConfig *config, std::string *error)
Parse a SET_MQTT_CONFIG: command, carrying the broker settings.
uint64_t espectre_effective_device_id_u64(const EspectreDeviceConfig &config)
The id actually in use.
bool parse_espectre_command(const std::string &payload, EspectreCommand *command, std::string *error)
Parse a JSON command payload from the MQTT command topic.
constexpr const char * ESPECTRE_OTA_CHANNEL_PREVIEW
Rolling main OTA channel.
bool espectre_ota_channel_accepted(const std::string &channel)
Whether channel is a published OTA channel name.
constexpr const char * ESPECTRE_OTA_RELEASE_TAG_PREVIEW
GitHub Releases tag for the preview OTA channel.
bool parse_espectre_command_request(const std::string &command_id, const std::string &command_name, const std::string ¶ms_json, EspectreCommand *command, std::string *error)
Parse a transport-neutral command name plus a JSON parameter object.
std::string espectre_ota_manifest_url(const char *frontend, const char *chip, const std::string &channel)
Built-in GitHub Releases manifest URL for a frontend, chip, and channel.
void clear_espectre_mqtt_config(EspectreDeviceConfig *config)
Erase broker settings while preserving identity, for a config reset.
std::string espectre_ota_status_payload(const EspectreDeviceConfig &config, const EspectreOtaStatus &status, uint32_t timestamp_ms)
OTA progress payload, for each IOtaService status callback worth publishing.
std::string espectre_effective_device_label(const EspectreDeviceConfig &config)
The configured label, or the effective device id when no label is set.
uint64_t espectre_device_id_from_mac(const uint8_t *mac, size_t mac_len)
Pack the first six MAC bytes into the historical numeric representation.
std::string espectre_device_name(uint64_t device_id, const char *chip=nullptr)
Conventional device name derived from the immutable device identifier.
std::string format_espectre_device_id(uint64_t device_id)
Format a device id in its canonical wire form.
constexpr const char * ESPECTRE_OTA_CHANNEL_RELEASE
Official tagged GitHub Release OTA channel.
constexpr const char * ESPECTRE_OTA_RELEASE_TAG_DEVELOP
GitHub Releases tag for the develop OTA channel.
EspectreDeviceInfo normalize_protocol_device_info(const EspectreDeviceInfo &info, const RuntimeSnapshot *snapshot, bool supports_ota, const char *default_frontend, const char *default_chip=nullptr)
Fill in the parts of a device info block the frontend did not set.
A parsed control command.
std::string wifi_band_policy
std::string traffic_generator_mode
bool has_csi_traffic_mode
std::string mqtt_password
std::string device_label
User-facing label requested by set_device_label; empty clears it.
std::string mqtt_username
std::string csi_traffic_mode
std::string mqtt_topic_prefix
bool has_traffic_generator_mode
std::string ota_channel
OTA release channel for ota_check and ota_start: "release", "preview", or "develop".
bool has_device_label
Whether the command carried a valid string-valued device_label.
bool has_mqtt_topic_prefix
std::string wifi_password
bool has_wifi_band_policy
std::string command_id
Correlation id echoed in the result payload.
std::string command
Command verb, for example "set_threshold" or "recalibrate".
Device identity and broker settings.
std::string mqtt_host
Broker hostname or IP.
uint64_t device_id
Stable device identity.
std::string mqtt_username
Broker credentials.
std::string device_label
Human-readable name.
std::string topic_prefix
Topic root.
std::string mqtt_password
What the device advertises about itself.
std::string traffic_mode
Internal traffic generator mode, such as "ping" or "dns".
bool supports_runtime_detector
std::string firmware_version
Application version, normally espectre_firmware_version().
bool supports_device_config
MQTT set_device_label is honored and persists the user-facing label.
uint32_t evaluation_interval_ms
Detector evaluation cadence, in milliseconds.
EspectreNetworkInfo network
uint32_t publish_interval_ms
Status-log and diagnostics heartbeat, in milliseconds.
bool supports_manual_recalibration
std::string frontend
Frontend name, for example "native", "matter", or your own.
uint32_t csi_target_pps
Internal traffic generator and temporal-grid target rate, in packets per second.
bool supports_runtime_motion_hits
bool supports_traffic_control
std::string chip
Chip target, normally CONFIG_IDF_TARGET.
bool supports_runtime_threshold
std::string csi_traffic_mode
CSI traffic ownership mode: "internal", "external", or "disabled".
std::string detector
Active detector.
Link details available to frontends.
uint8_t channel
Wi-Fi channel in use.
Full OTA status: state, the versions involved, and the resolved URLs.
std::string current_version
std::string target_version
std::string channel
Resolved OTA channel for the current attempt.
std::string default_channel
Build-time OTA channel used when a command omits its channel.
Rate and link diagnostics derived from cumulative runtime counters.
A consistent view of the sensing state at one instant.