|
ESPectre SDK 2.8.0-280-gac7af68
Wi-Fi CSI motion sensing for ESP32 firmware
|
Classes | |
| class | BaseDetector |
| Abstract base class for motion detection algorithms. More... | |
| class | ChannelShapeTrajectoryTracker |
| struct | DirectWebSocketRequest |
| struct | DirectWebSocketServiceConfig |
| struct | DirectWebSocketServiceDiagnostics |
| struct | EspectreCommand |
| A parsed control command. More... | |
| struct | EspectreDeviceConfig |
| Device identity and broker settings. More... | |
| struct | EspectreDeviceInfo |
| What the device advertises about itself. More... | |
| struct | EspectreNetworkInfo |
| Link details available to frontends. More... | |
| struct | EspectreOtaStatus |
| Full OTA status: state, the versions involved, and the resolved URLs. More... | |
| class | FilteredTurbulenceRing |
| Fixed-capacity turbulence history with optional Hampel and low-pass filtering. More... | |
| struct | hampel_turbulence_state_t |
| class | HighAccuracyDetector |
| Neural motion detector, using the MLP weights exported by training. More... | |
| class | IDirectWebSocketService |
| Local WebSocket endpoint used by the Native frontend after Wi-Fi is ready. More... | |
| class | IEspectreRuntime |
| The sensing backend behind RuntimeFrontendController. More... | |
| class | IMqttTransport |
| The MQTT client seam. More... | |
| class | IOtaService |
| The firmware-update seam. More... | |
| class | IRuntimeListener |
| Everything the runtime tells your firmware. More... | |
| class | L1DeltaTracker |
| struct | L1DeltaWindow |
| One sliding window of displacements over a caller-owned ring. More... | |
| class | LightweightDetector |
| The default detector: self-calibrating, no training data required. More... | |
| struct | lowpass_filter_state_t |
| struct | MeanVariance |
| struct | MLSeriesScratch |
| struct | MLSeriesStats |
| struct | MLStatNeeds |
| struct | MqttTransportDiagnostics |
| struct | RuntimeCapabilities |
| What a runtime actually offers its frontend. More... | |
| struct | RuntimeConfig |
| Everything the runtime needs to know before setup(). More... | |
| struct | RuntimeDiagnosticsSample |
| Rate and link diagnostics derived from cumulative runtime counters. More... | |
| class | RuntimeDiagnosticsSampler |
| Converts cumulative diagnostics into rates over the interval between reads. More... | |
| struct | RuntimeDiagnosticsSnapshot |
| Low-frequency counters and radio state used by optional diagnostic surfaces. More... | |
| class | RuntimeFrontendController |
| The recommended entry point for firmware embedding ESPectre. More... | |
| struct | RuntimeSnapshot |
| A consistent view of the sensing state at one instant. More... | |
| class | StartupThresholdCalibrator |
| Startup threshold calibrator with a motion-first primary path and an internal quiet-first fallback. More... | |
Typedefs | |
| using | runtime_diagnostic_visitor_t = std::function<void(const char *key, const char *value)> |
| using | SelectedSubcarriers = std::array<uint8_t, HT20_SELECTED_BAND_SIZE> |
| using | hampel_filter_state_t = hampel_turbulence_state_t |
Functions | |
| constexpr const char * | espectre_sdk_version () |
| The SDK version as a string, usable where a macro is not. | |
| constexpr float | runtime_threshold_max (DetectionAlgorithm algorithm) |
| constexpr bool | runtime_detection_algorithm_valid (DetectionAlgorithm algorithm) |
| constexpr bool | runtime_profile_valid (RuntimeProfile profile) |
| constexpr bool | runtime_traffic_mode_valid (RuntimeTrafficMode mode) |
| constexpr bool | runtime_csi_traffic_mode_valid (CsiTrafficMode mode) |
| constexpr bool | runtime_csi_traffic_mode_valid_for_profile (RuntimeProfile profile, CsiTrafficMode mode) |
| constexpr float | runtime_default_threshold (DetectionAlgorithm algorithm) |
| bool | validate_runtime_threshold (float threshold) |
| bool | validate_runtime_threshold_for_algorithm (float threshold, DetectionAlgorithm algorithm) |
| bool | validate_runtime_float (float value, float min_value, float max_value) |
| bool | validate_runtime_uint32 (uint32_t value, uint32_t min_value, uint32_t max_value) |
| bool | validate_runtime_uint8 (uint8_t value, uint8_t min_value, uint8_t max_value) |
| RuntimeConfigError | validate_runtime_config (const RuntimeConfig &config) |
| Validate the complete configuration before creating runtime state. | |
| const char * | runtime_config_error_message (RuntimeConfigError error) |
| Stable diagnostic label for a configuration error. | |
| const char * | runtime_profile_name (RuntimeProfile profile) |
| const char * | wifi_band_policy_name (WifiBandPolicy policy) |
| const char * | traffic_mode_name (RuntimeTrafficMode mode) |
| const char * | csi_traffic_mode_name (CsiTrafficMode mode) |
| bool | csi_traffic_mode_is_sensing_control (CsiTrafficMode mode) |
| CsiTrafficMode | normalize_sensing_csi_traffic_mode (CsiTrafficMode mode) |
| const char * | detection_algorithm_name (DetectionAlgorithm algorithm) |
| const char * | subcarrier_source_name (RuntimeSubcarrierSource source) |
| RuntimeTrafficMode | parse_traffic_mode (const char *mode) |
| CsiTrafficMode | parse_csi_traffic_mode (const char *mode) |
| DetectionAlgorithm | parse_detection_algorithm (const char *algorithm) |
| WifiBandPolicy | parse_wifi_band_policy (const char *policy) |
| RuntimeConfig | make_runtime_sensing_config () |
| void | visit_runtime_diagnostics (const RuntimeConfig &config, const RuntimeSnapshot &snapshot, runtime_diagnostic_visitor_t visitor) |
| bool | parse_direct_websocket_request (const std::string &payload, DirectWebSocketRequest *request, std::string *error=nullptr) |
| bool | direct_websocket_request_to_command (const DirectWebSocketRequest &request, EspectreCommand *command, std::string *error=nullptr) |
| std::string | direct_websocket_success_response (const std::string &id, const std::string &result_json="{}") |
| std::string | direct_websocket_error_response (const std::string &id, const char *code, const char *message) |
| std::string | direct_websocket_event (const char *event, const std::string &data_json) |
| const char * | espectre_firmware_version () |
| The running application's version, as your build system defined it. | |
| RuntimeConfig | make_runtime_sensing_config_from_kconfig () |
| Build a RuntimeConfig from the ESPECTRE_* menuconfig options. | |
| constexpr SelectedSubcarriers | make_default_subcarriers () |
| uint8_t | ht20_bins_with_energy (const int8_t *csi_data, const uint8_t *bins, uint8_t count) |
| Ht20BinLayout | detect_ht20_bin_layout (const int8_t *csi_data, size_t csi_len) |
| Identify which HT20 bin ordering a 64-subcarrier payload uses. | |
| void | rotate_ht20_classic_to_centered (const int8_t *csi_data, int8_t *out) |
| Rotate a classic-order HT20 payload into the centered convention. | |
| float | calculate_spatial_turbulence (const float *magnitudes, const uint8_t *subcarriers, uint8_t num_subcarriers, uint16_t max_subcarrier=64) |
| Calculate spatial turbulence from pre-calculated magnitudes. | |
| uint8_t | extract_subcarrier_amplitudes (const int8_t *csi_data, size_t csi_len, const uint8_t *subcarriers, uint8_t num_subcarriers, float *out, uint8_t out_capacity) |
| Extract subcarrier amplitudes from raw CSI data (I/Q pairs). | |
| uint8_t | extract_packet_subcarrier_amplitudes (const int8_t *csi_data, size_t csi_len, float *out, uint8_t out_capacity) |
| Extract one packet-wide amplitude frame for reuse by multiple feature paths. | |
| uint8_t | fill_packet_subcarrier_energies (const int8_t *csi_data, size_t csi_len, float *out, uint8_t out_capacity) |
| Fill one packet-wide squared-magnitude frame for energy-domain consumers. | |
| void | energies_to_amplitudes_in_place (float *values, uint8_t count) |
| uint8_t | select_subcarrier_amplitudes (const float *packet_amplitudes, uint8_t packet_count, const uint8_t *subcarriers, uint8_t num_subcarriers, float *out, uint8_t out_capacity) |
| Select the configured tones from a packet-wide amplitude frame. | |
| uint8_t | select_adjacent_aggregated_subcarrier_amplitudes (const float *packet_amplitudes, uint8_t packet_count, const uint8_t *subcarriers, uint8_t num_subcarriers, uint8_t width, float *out, uint8_t out_capacity) |
| Select adjacent-bin mean amplitudes from a packet-wide amplitude frame. | |
| uint8_t | extract_adjacent_aggregated_subcarrier_amplitudes (const int8_t *csi_data, size_t csi_len, const uint8_t *subcarriers, uint8_t num_subcarriers, uint8_t width, float *out, uint8_t out_capacity) |
| Extract one mean magnitude per selected tone from adjacent live HT20 bins. | |
| float | calculate_spatial_turbulence_from_amplitudes (const float *amplitudes, uint8_t count) |
| float | calculate_spatial_turbulence_from_csi (const int8_t *csi_data, size_t csi_len, const uint8_t *subcarriers, uint8_t num_subcarriers) |
| Calculate spatial turbulence directly from raw CSI data (I/Q pairs). | |
| void | lowpass_filter_init (lowpass_filter_state_t *state, float cutoff_hz, float sample_rate_hz, bool enabled) |
| float | lowpass_filter_apply (lowpass_filter_state_t *state, float value) |
| void | lowpass_filter_reset (lowpass_filter_state_t *state) |
| void | hampel_turbulence_init (hampel_turbulence_state_t *state, uint8_t window_size, float threshold, bool enabled) |
| float | hampel_filter (const float *window, size_t window_size, float current_value, float threshold) |
| Stateless Hampel decision over a caller-owned window. | |
| float | hampel_filter_turbulence (hampel_turbulence_state_t *state, float turbulence) |
| float | calculate_mean (const float *values, size_t n) |
| Calculate mean of an array. | |
| float | calculate_median_float (float *arr, size_t size) |
| Calculate median of a float array (sorts array in-place). | |
| float | apply_cv_normalization (float std_dev, float mean) |
| Apply gain-invariant normalization to standard deviation. | |
| float | calculate_turbulence_from_variance (float variance, const float *values, size_t count) |
| Calculate turbulence from variance with gain-invariant normalization. | |
| MeanVariance | calculate_mean_variance_two_pass (const float *values, size_t n) |
| Calculate mean and variance in one two-pass sweep (numerically stable). | |
| float | calculate_variance_two_pass (const float *values, size_t n) |
| Calculate variance using the two-pass algorithm. | |
| float | calculate_magnitude (int8_t i, int8_t q) |
| Calculate magnitude (amplitude) from I/Q components. | |
| uint8_t | normalize_amplitude_profile (const float *amplitudes, uint8_t count, float mean, float *out) |
| Write the mean-normalized amplitude profile into out. | |
| uint8_t | normalize_amplitude_profile (const float *amplitudes, uint8_t count, float *out) |
| MLFeatureSource | ml_feature_source (MLFeatureId id) |
| bool | ml_feature_needs_l1_tracker (uint8_t id) |
| bool | ml_feature_needs_channel_shape_trajectory_tracker (uint8_t id) |
| bool | ml_feature_needs_aggregated_turbulence (uint8_t id) |
| float | median_from_sorted (const float *sorted_values, uint16_t count) |
| float | percentile_from_sorted (const float *sorted_values, uint16_t count, float quantile) |
| float | order_statistic_in_place (float *values, uint16_t count, uint16_t index) |
| float | percentile_in_place (float *values, uint16_t count, float quantile) |
| float | calc_autocorrelation (const float *values, uint16_t count, float mean, float variance, uint16_t lag=1) |
| float | calc_zero_crossing_rate (const float *values, uint16_t count, float center) |
| MLStatNeeds | ml_series_needs (const uint8_t *feature_ids, uint8_t num_features, MLFeatureSource wanted) |
| void | compute_ml_series_stats (const float *values, uint16_t count, MLSeriesStats *out, const MLStatNeeds &needs, const MLSeriesScratch &scratch) |
| float | ml_feature_value_from_stats (uint8_t id, const MLSeriesStats &turb, const MLSeriesStats &aggregated_turb, float l1_delta_lag_ratio, float chan_shape_spread_subband, float chan_shape_coherent_innovation_energy, float chan_shape_excess_path, float chan_shape_subband_kendall_lag_excess) |
| Resolve one exported ML feature from precomputed series and tracker stats. | |
| void | extract_ml_features_by_id (const float *turb_buffer, uint16_t turb_count, const float *aggregated_turb_buffer, uint16_t aggregated_turb_count, const uint8_t *feature_ids, uint8_t num_features, float *features_out, const MLSeriesScratch &series_scratch, float l1_delta_lag_ratio, float chan_shape_spread_subband, float chan_shape_coherent_innovation_energy, float chan_shape_excess_path, float chan_shape_subband_kendall_lag_excess) |
| float | motion_participation (const float *energy, uint8_t count) |
| bool | is_valid_threshold (float threshold, float min_threshold, float max_threshold) |
| Validate threshold value against finite/range constraints. | |
| float | clamp_threshold (float threshold, float min_threshold, float max_threshold) |
| Clamp threshold to [min, max] and recover non-finite values. | |
Device identity | |
Resolve, format, and parse the identity a device presents on the wire. | |
| std::string | format_espectre_device_id (uint64_t device_id) |
| Format a device id in its canonical wire form. | |
| bool | parse_espectre_device_id (const std::string &value, uint64_t *device_id) |
| Parse a device id from its wire form. | |
| 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. | |
| uint64_t | espectre_effective_device_id_u64 (const EspectreDeviceConfig &config) |
| The id actually in use. | |
| std::string | espectre_effective_device_id (const EspectreDeviceConfig &config) |
| espectre_effective_device_id_u64() in wire form. | |
| std::string | espectre_effective_device_label (const EspectreDeviceConfig &config) |
| The configured label, or the effective device id when no label is set. | |
| 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. | |
| void | clear_espectre_mqtt_config (EspectreDeviceConfig *config) |
| Erase broker settings while preserving identity, for a config reset. | |
Topics and payloads | |
Build the wire representation from runtime state. Each returns a complete payload ready to hand to a transport. | |
| 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_status_payload (const EspectreDeviceConfig &config, bool online, uint32_t timestamp_ms) |
| Availability payload. | |
| std::string | espectre_info_payload (const EspectreDeviceConfig &config, const EspectreDeviceInfo &info) |
| Device description, supported controls, and optional CSI traffic settings. | |
| std::string | espectre_commands_payload (const EspectreDeviceConfig &config, const EspectreDeviceInfo &info) |
| MQTT command catalog for the current frontend. | |
| 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_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. | |
| std::string | espectre_command_result_payload (const EspectreDeviceConfig &config, const EspectreCommand &command, bool accepted, const char *message) |
| Acknowledge a command, echoing its command_id. | |
| 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. | |
Command parsing | |
Turn received bytes into validated values. | |
| bool | parse_espectre_command (const std::string &payload, EspectreCommand *command, std::string *error) |
| Parse a JSON command payload from the MQTT command topic. | |
| 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. | |
| bool | espectre_ota_channel_accepted (const std::string &channel) |
| Whether channel is a published OTA channel name. | |
| 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. | |
| bool | parse_espectre_config_command (const std::string &command, EspectreDeviceConfig *config, std::string *error) |
| Parse a legacy ASCII SET_DEVICE_CONFIG: command. | |
| 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. | |
Variables | |
| constexpr const char *const | RUNTIME_TRAFFIC_GENERATOR_MODE_DNS_NAME = "dns" |
| constexpr const char *const | RUNTIME_TRAFFIC_GENERATOR_MODE_PING_NAME = "ping" |
| constexpr const char *const | RUNTIME_TRAFFIC_GENERATOR_MODE_DEFAULT_NAME = "ping" |
| constexpr const char *const | RUNTIME_CSI_TRAFFIC_MODE_INTERNAL_NAME = "internal" |
| constexpr const char *const | RUNTIME_CSI_TRAFFIC_MODE_EXTERNAL_NAME = "external" |
| constexpr const char *const | RUNTIME_CSI_TRAFFIC_MODE_PACING_NAME = "pacing" |
| constexpr const char *const | RUNTIME_CSI_TRAFFIC_MODE_DISABLED_NAME = "disabled" |
| constexpr const char *const | RUNTIME_CSI_TRAFFIC_MODE_DEFAULT_NAME = "internal" |
| constexpr const char *const | RUNTIME_DETECTION_ALGORITHM_LIGHTWEIGHT_NAME = "lightweight" |
| constexpr const char *const | RUNTIME_DETECTION_ALGORITHM_HIGH_ACCURACY_NAME = "high_accuracy" |
| constexpr const char *const | RUNTIME_DETECTION_ALGORITHM_DEFAULT_NAME = "lightweight" |
| constexpr float | RUNTIME_THRESHOLD_MIN = 0.0f |
| constexpr float | RUNTIME_THRESHOLD_MAX = 1.0f |
| constexpr float | RUNTIME_HIGH_ACCURACY_THRESHOLD_MAX = 1.0f |
| constexpr float | RUNTIME_SEGMENTATION_THRESHOLD_DEFAULT = LIGHTWEIGHT_DEFAULT_THRESHOLD |
| constexpr uint32_t | RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_MIN = 1000U |
| constexpr uint32_t | RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_MAX = 2000U |
| constexpr uint32_t | RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_DEFAULT = 1000U |
| constexpr uint32_t | RUNTIME_CSI_TARGET_PPS_MIN = 1U |
| constexpr uint32_t | RUNTIME_CSI_TARGET_PPS_MAX = 500U |
| constexpr uint32_t | RUNTIME_CSI_TARGET_PPS_DEFAULT = 100U |
| constexpr uint32_t | RUNTIME_PUBLISH_INTERVAL_MS_MIN = 100 |
| constexpr uint32_t | RUNTIME_PUBLISH_INTERVAL_MS_MAX = 60000 |
| constexpr uint32_t | RUNTIME_PUBLISH_INTERVAL_MS_DEFAULT = 1000 |
| constexpr uint32_t | RUNTIME_EVALUATION_INTERVAL_MS_MIN = 10 |
| constexpr uint32_t | RUNTIME_EVALUATION_INTERVAL_MS_MAX = 10000 |
| constexpr uint32_t | RUNTIME_EVALUATION_INTERVAL_MS_DEFAULT = 250 |
| constexpr uint8_t | RUNTIME_MOTION_HITS_MIN = 1 |
| constexpr uint8_t | RUNTIME_MOTION_HITS_MAX = 20 |
| constexpr uint8_t | RUNTIME_MOTION_ON_HITS_DEFAULT = 4 |
| constexpr uint8_t | RUNTIME_MOTION_OFF_HITS_DEFAULT = 3 |
| constexpr bool | RUNTIME_LOWPASS_ENABLED_DEFAULT = false |
| constexpr float | RUNTIME_LOWPASS_CUTOFF_MIN = 5.0f |
| constexpr float | RUNTIME_LOWPASS_CUTOFF_MAX = 20.0f |
| constexpr float | RUNTIME_LOWPASS_CUTOFF_DEFAULT = 11.0f |
| constexpr bool | RUNTIME_HAMPEL_ENABLED_DEFAULT = true |
| constexpr uint8_t | RUNTIME_HAMPEL_WINDOW_MIN = 3 |
| constexpr uint8_t | RUNTIME_HAMPEL_WINDOW_MAX = 11 |
| constexpr uint8_t | RUNTIME_HAMPEL_WINDOW_DEFAULT = 7 |
| constexpr float | RUNTIME_HAMPEL_THRESHOLD_MIN = 1.0f |
| constexpr float | RUNTIME_HAMPEL_THRESHOLD_MAX = 10.0f |
| constexpr float | RUNTIME_HAMPEL_THRESHOLD_DEFAULT = 5.0f |
| constexpr uint16_t | RUNTIME_STREAM_COLLECTOR_PORT_DEFAULT = 5001 |
| constexpr uint16_t | RUNTIME_NETWORK_PORT_MIN = 1U |
| constexpr uint16_t | RUNTIME_NETWORK_PORT_MAX = UINT16_MAX |
| constexpr uint32_t | RUNTIME_STREAM_LOG_INTERVAL_MS_MIN = 100U |
| constexpr uint32_t | RUNTIME_STREAM_LOG_INTERVAL_MS_MAX = 60000U |
| constexpr uint32_t | RUNTIME_STREAM_LOG_INTERVAL_MS_DEFAULT = 1000 |
| constexpr uint8_t | RUNTIME_STREAM_TX_BATCH_RECORDS_MIN = 1U |
| constexpr uint8_t | RUNTIME_STREAM_TX_BATCH_RECORDS_MAX = 7U |
| constexpr uint8_t | RUNTIME_STREAM_TX_BATCH_RECORDS_DEFAULT = 4 |
| constexpr uint16_t | RUNTIME_CSI_TRAFFIC_UDP_PORT_DEFAULT = 5555 |
| constexpr const char *const | RUNTIME_CSI_TRAFFIC_MULTICAST_GROUP_DEFAULT = "239.255.0.1" |
| constexpr size_t | RUNTIME_CSI_TRAFFIC_EXPECTED_PAYLOAD_MAX = 16U |
| constexpr const char * | ESPECTRE_PROTOCOL_VERSION = "1.0" |
| Protocol version reported in payloads. | |
| constexpr const char * | ESPECTRE_TOPIC_PREFIX = "espectre/v1/devices" |
| Default MQTT topic root. | |
| constexpr const char * | ESPECTRE_OTA_CHANNEL_RELEASE = "release" |
| Official tagged GitHub Release OTA channel. | |
| constexpr const char * | ESPECTRE_OTA_CHANNEL_PREVIEW = "preview" |
| Rolling main OTA channel. | |
| constexpr const char * | ESPECTRE_OTA_CHANNEL_DEVELOP = "develop" |
| Rolling develop OTA channel. | |
| constexpr const char * | ESPECTRE_OTA_RELEASE_TAG_PREVIEW = "snapshot" |
| GitHub Releases tag for the preview OTA channel. | |
| constexpr const char * | ESPECTRE_OTA_RELEASE_TAG_DEVELOP = "snapshot-dev" |
| GitHub Releases tag for the develop OTA channel. | |
| constexpr uint64_t | ESPECTRE_DEFAULT_DEVICE_ID = 0U |
| Sentinel meaning "use the runtime-generated device id". | |
| constexpr const char * | ESPECTRE_DEFAULT_DEVICE_LABEL = "" |
| Empty label, meaning the device id is used as the display name. | |
| constexpr const char * | ESPECTRE_DIRECT_WEBSOCKET_ENDPOINT = "/espectre/v1/ws" |
| constexpr const char * | ESPECTRE_DIRECT_WEBSOCKET_SUBPROTOCOL = "espectre.v1" |
| constexpr unsigned | ESPECTRE_DIRECT_ENVELOPE_VERSION = 1U |
| constexpr size_t | ESPECTRE_DIRECT_MAX_FRAME_SIZE = 4096U |
| constexpr size_t | ESPECTRE_DIRECT_MAX_REQUEST_ID_SIZE = 64U |
| constexpr size_t | ESPECTRE_DIRECT_MAX_METHOD_SIZE = 64U |
| constexpr float | LIGHTWEIGHT_DEFAULT_THRESHOLD = 0.6621854538596202f |
| constexpr float | LIGHTWEIGHT_MIN_THRESHOLD = 0.0f |
| constexpr float | LIGHTWEIGHT_MAX_THRESHOLD = 1.0f |
| constexpr float | LIGHTWEIGHT_STARTUP_THRESHOLD_FACTOR = 1.0f |
| constexpr float | HIGH_ACCURACY_DEFAULT_THRESHOLD = 0.5f |
| constexpr float | HIGH_ACCURACY_MIN_THRESHOLD = 0.0f |
| constexpr float | HIGH_ACCURACY_MAX_THRESHOLD = 1.0f |
| constexpr float | HIGH_ACCURACY_METRIC_SCALE = 1.0f |
| constexpr float | LOWPASS_CUTOFF_DEFAULT = 11.0f |
| constexpr float | LOWPASS_CUTOFF_MIN = 5.0f |
| constexpr float | LOWPASS_CUTOFF_MAX = 20.0f |
| constexpr float | LOWPASS_SAMPLE_RATE = 100.0f |
| constexpr uint8_t | HAMPEL_TURBULENCE_WINDOW_MIN = 3U |
| constexpr uint8_t | HAMPEL_TURBULENCE_WINDOW_MAX = 11U |
| constexpr uint8_t | HAMPEL_TURBULENCE_WINDOW_DEFAULT = 7U |
| constexpr float | HAMPEL_TURBULENCE_THRESHOLD_DEFAULT = 5.0f |
| constexpr uint16_t | HT20_NUM_SUBCARRIERS = 64U |
| constexpr uint16_t | HT20_CSI_LEN = 128U |
| constexpr uint16_t | HT20_CSI_LEN_DOUBLE = 256U |
| constexpr uint16_t | HT20_CSI_LEN_SHORT = 114U |
| constexpr uint16_t | HT20_CSI_LEN_SHORT_DOUBLE = 228U |
| constexpr uint8_t | HT20_CSI_LEN_SHORT_LEFT_PAD = 8U |
| constexpr uint8_t | HT20_GUARD_BAND_LOW = 4U |
| constexpr uint8_t | HT20_GUARD_BAND_HIGH = 60U |
| constexpr uint8_t | HT20_DC_SUBCARRIER = 32U |
| constexpr uint8_t | HT20_SELECTED_BAND_SIZE = 12U |
| constexpr uint8_t | DEFAULT_SUBCARRIERS [HT20_SELECTED_BAND_SIZE] |
| constexpr float | LIGHTWEIGHT_AUTOCORR_CENTER = 0.3919344866784947f |
| constexpr float | LIGHTWEIGHT_AUTOCORR_SCALE = 0.3798648330757351f |
| constexpr float | LIGHTWEIGHT_AUTOCORR_WEIGHT = 5.083034533668216f |
| constexpr float | LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_CENTER = 0.24612139211074338f |
| constexpr float | LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_SCALE = 0.20056599613462603f |
| constexpr float | LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_WEIGHT = 4.997501915217463f |
| constexpr float | LIGHTWEIGHT_INTERCEPT = 1.0776769868761f |
| constexpr float | LIGHTWEIGHT_TRAIN_IDLE_Q95_LOGIT = -2.253902812716911f |
| constexpr float | LIGHTWEIGHT_STARTUP_QUANTILE = 0.95f |
| constexpr float | LIGHTWEIGHT_STARTUP_STRENGTH = 0.5f |
| constexpr uint8_t | LIGHTWEIGHT_STARTUP_SAMPLE_LIMIT = 64U |
| constexpr uint8_t | LIGHTWEIGHT_SETTLE_BLOCKS = 12U |
| constexpr uint8_t | LIGHTWEIGHT_SETTLE_BLOCK_EVALUATIONS = 20U |
| constexpr float | LIGHTWEIGHT_SETTLE_MARGIN_LOGITS = 2.7f |
| constexpr uint8_t | HT20_CLASSIC_ONLY_NULL_BINS [] = {29, 30, 31, 33, 34, 35} |
| constexpr uint8_t | HT20_CENTERED_ONLY_NULL_BINS [] = {1, 2, 3, 61, 62, 63} |
| constexpr uint32_t | DETECTOR_WINDOW_SIZE_MS_MIN = 1000U |
| constexpr uint32_t | DETECTOR_WINDOW_SIZE_MS_MAX = 2000U |
| constexpr uint32_t | DETECTOR_WINDOW_SIZE_MS_DEFAULT = 1000U |
| constexpr uint16_t | DETECTOR_DEFAULT_WINDOW_SIZE = 100 |
| constexpr uint16_t | DETECTOR_MIN_WINDOW_SIZE = 1 |
| constexpr uint16_t | DETECTOR_MAX_WINDOW_SIZE = 1000 |
| constexpr uint16_t | CALIBRATION_NUM_WINDOWS = 10 |
| constexpr uint16_t | CALIBRATION_DEFAULT_BUFFER_SIZE |
| constexpr uint32_t | EVALUATION_INTERVAL_US = 250000U |
| constexpr uint32_t | L1_DELTA_LAG_US = 100000U |
| constexpr uint32_t | TURB_AUTOCORR_LAG_US = 10000U |
| constexpr uint16_t | DETECTOR_L1_DELTA_LAG_DEFAULT = 10U |
| constexpr uint16_t | DETECTOR_AUTOCORR_LAG_DEFAULT = 1U |
| constexpr uint16_t | L1_DELTA_LAG_MAX = 32 |
| constexpr uint32_t | MIN_PLAUSIBLE_PACKET_INTERVAL_US = 200U |
| constexpr float | MAD_SCALE_FACTOR = 1.4826f |
| constexpr uint8_t | L1_DELTA_LAG = 10 |
| constexpr float | L1_DELTA_STARTUP_THRESHOLD_FACTOR = 1.1f |
| constexpr uint8_t | TURB_IQR_AGGREGATION_WIDTH = 5U |
| constexpr uint8_t | HT20_LIVE_BAND_SIZE = 56U |
| constexpr std::array< uint8_t, HT20_LIVE_BAND_SIZE > | HT20_LIVE_BINS |
| constexpr uint8_t | CHANNEL_SHAPE_SUBBAND_COUNT = 8U |
| constexpr uint8_t | CHANNEL_SHAPE_SUBBAND_SIZE |
| constexpr uint32_t | CHANNEL_SHAPE_BIN_US = 80000U |
| constexpr uint32_t | CHANNEL_SHAPE_WINDOW_US = 1000000U |
| constexpr uint8_t | CHANNEL_SHAPE_WINDOW_BINS |
| constexpr uint8_t | CHANNEL_SHAPE_MAX_PROFILES_PER_BIN = L1_DELTA_LAG_MAX |
| constexpr float | CHANNEL_SHAPE_KENDALL_RELATIVE_DEADBAND = 0.02f |
| constexpr uint8_t | CHANNEL_SHAPE_KENDALL_MIN_COMPARABLE_PAIRS = 8U |
| constexpr std::array< std::array< float, CHANNEL_SHAPE_SUBBAND_COUNT >, CHANNEL_SHAPE_SUBBAND_COUNT > | CHANNEL_SHAPE_DCT |
| constexpr float | SEGMENTATION_DEFAULT_THRESHOLD = 1.0f |
| constexpr float | SEGMENTATION_MIN_THRESHOLD = 1e-9f |
| constexpr float | SEGMENTATION_MAX_THRESHOLD = 10.0f |
| constexpr float | DEFAULT_ADAPTIVE_FACTOR = 1.3f |
| constexpr uint8_t | STARTUP_GATE_CHUNKS = 6 |
| constexpr float | STARTUP_GATE_SPREAD_RATIO = 1.10f |
| constexpr float | STARTUP_GATE_ANCHOR_RATIO = 1.5f |
| constexpr uint8_t | STARTUP_MOTION_CHUNK_SIZE = 25 |
| constexpr uint8_t | STARTUP_MOTION_MIN_QUIET_CHUNKS = 2 |
| constexpr uint8_t | STARTUP_MOTION_CONFIRM_CHUNKS = 2 |
| constexpr uint8_t | STARTUP_POST_MOTION_QUIET_CHUNKS = 2 |
| constexpr float | STARTUP_QUIET_STABILITY_RATIO = 1.20f |
| constexpr float | STARTUP_MOTION_TRIGGER_RATIO = 1.80f |
| constexpr float | STARTUP_QUIET_RETURN_RATIO = 1.25f |
| constexpr float | STARTUP_MOTION_GAP_RATIO = 1.35f |
| constexpr float | STARTUP_NO_MOTION_FALLBACK_MARGIN = 1.03f |
| constexpr uint8_t | STARTUP_MOTION_MAX_LEVELS = 40 |
| using espectre::runtime_diagnostic_visitor_t = std::function<void(const char *key, const char *value)> |
Definition at line 104 of file runtime_diagnostics.h.
| using espectre::SelectedSubcarriers = std::array<uint8_t, HT20_SELECTED_BAND_SIZE> |
Definition at line 32 of file csi_types.h.
|
strong |
Wi-Fi band selection requested by the embedding frontend.
Definition at line 34 of file runtime_interface.h.
|
strong |
How the runtime chose the subcarriers it measures on.
| Enumerator | |
|---|---|
| FIXED_DEFAULT | The fixed band validated for the shipped detectors. Currently the only mode. |
Definition at line 21 of file runtime_snapshot.h.
|
strong |
Which detector runs.
See docs/ALGORITHMS.md for how they differ.
| Enumerator | |
|---|---|
| LIGHTWEIGHT | Lightweight feature fusion. Self-calibrates, and needs no training data. Default. |
| HIGH_ACCURACY | High-accuracy neural detector using the trained weights in core/ml_weights.h. |
Definition at line 38 of file runtime_sensing_schema.h.
|
strong |
Which runtime backend the controller builds.
Definition at line 46 of file runtime_sensing_schema.h.
|
strong |
Which packet the internal generator sends to solicit CSI from the AP.
| Enumerator | |
|---|---|
| DNS | DNS queries. Useful where ICMP is filtered. |
| PING | ICMP echo. Default. |
Definition at line 59 of file runtime_sensing_schema.h.
|
strong |
Machine-readable reason a RuntimeConfig cannot be applied.
Definition at line 17 of file runtime_config_utils.h.
|
strong |
Where the CSI-bearing traffic comes from.
CSI is only produced when packets actually arrive, so something has to keep the link busy. This picks who does it.
Definition at line 21 of file csi_traffic_types.h.
|
strong |
OTA progress, as reported to clients.
A check runs IDLE -> CHECKING -> UPDATE_AVAILABLE or UP_TO_DATE. An update continues DOWNLOADING -> APPLYING -> REBOOT_SCHEDULED. ERROR is terminal for the attempt and carries the reason in EspectreOtaStatus::message.
| Enumerator | |
|---|---|
| IDLE | |
| CHECKING | |
| UPDATE_AVAILABLE | |
| UP_TO_DATE | |
| DOWNLOADING | |
| APPLYING | |
| REBOOT_SCHEDULED | |
| ERROR | |
Definition at line 216 of file espectre_protocol.h.
|
strong |
|
strong |
| Enumerator | |
|---|---|
| UNKNOWN | |
| CENTERED | |
| CLASSIC | |
Definition at line 48 of file csi_format.h.
| enum espectre::MLFeatureId : uint8_t |
Definition at line 31 of file csi_features.h.
|
strong |
| Enumerator | |
|---|---|
| TURBULENCE_SERIES | |
| AGGREGATED_TURBULENCE_SERIES | |
| L1_TRACKER | |
| CHANNEL_SHAPE_TRAJECTORY_TRACKER | |
Definition at line 45 of file csi_features.h.
|
constexpr |
The SDK version as a string, usable where a macro is not.
Definition at line 69 of file espectre_sdk_version.h.
|
constexpr |
Definition at line 134 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 139 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 144 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 148 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 152 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 157 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 165 of file runtime_sensing_schema.h.
| bool espectre::validate_runtime_threshold | ( | float | threshold | ) |
| bool espectre::validate_runtime_threshold_for_algorithm | ( | float | threshold, |
| DetectionAlgorithm | algorithm ) |
| bool espectre::validate_runtime_float | ( | float | value, |
| float | min_value, | ||
| float | max_value ) |
| bool espectre::validate_runtime_uint32 | ( | uint32_t | value, |
| uint32_t | min_value, | ||
| uint32_t | max_value ) |
| bool espectre::validate_runtime_uint8 | ( | uint8_t | value, |
| uint8_t | min_value, | ||
| uint8_t | max_value ) |
| RuntimeConfigError espectre::validate_runtime_config | ( | const RuntimeConfig & | config | ) |
Validate the complete configuration before creating runtime state.
| const char * espectre::runtime_config_error_message | ( | RuntimeConfigError | error | ) |
Stable diagnostic label for a configuration error.
Never returns nullptr.
| const char * espectre::runtime_profile_name | ( | RuntimeProfile | profile | ) |
| const char * espectre::wifi_band_policy_name | ( | WifiBandPolicy | policy | ) |
| const char * espectre::traffic_mode_name | ( | RuntimeTrafficMode | mode | ) |
| const char * espectre::csi_traffic_mode_name | ( | CsiTrafficMode | mode | ) |
| bool espectre::csi_traffic_mode_is_sensing_control | ( | CsiTrafficMode | mode | ) |
| CsiTrafficMode espectre::normalize_sensing_csi_traffic_mode | ( | CsiTrafficMode | mode | ) |
| const char * espectre::detection_algorithm_name | ( | DetectionAlgorithm | algorithm | ) |
| const char * espectre::subcarrier_source_name | ( | RuntimeSubcarrierSource | source | ) |
| RuntimeTrafficMode espectre::parse_traffic_mode | ( | const char * | mode | ) |
| CsiTrafficMode espectre::parse_csi_traffic_mode | ( | const char * | mode | ) |
| DetectionAlgorithm espectre::parse_detection_algorithm | ( | const char * | algorithm | ) |
| WifiBandPolicy espectre::parse_wifi_band_policy | ( | const char * | policy | ) |
| RuntimeConfig espectre::make_runtime_sensing_config | ( | ) |
| void espectre::visit_runtime_diagnostics | ( | const RuntimeConfig & | config, |
| const RuntimeSnapshot & | snapshot, | ||
| runtime_diagnostic_visitor_t | visitor ) |
| std::string espectre::format_espectre_device_id | ( | uint64_t | device_id | ) |
Format a device id in its canonical wire form.
| bool espectre::parse_espectre_device_id | ( | const std::string & | value, |
| uint64_t * | device_id ) |
Parse a device id from its wire form.
| value | Formatted device id, as produced by format_espectre_device_id(). |
| device_id | Written only when parsing succeeds. |
| uint64_t espectre::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::espectre_device_name | ( | uint64_t | device_id, |
| const char * | chip = nullptr ) |
Conventional device name derived from the immutable device identifier.
| uint64_t espectre::espectre_effective_device_id_u64 | ( | const EspectreDeviceConfig & | config | ) |
The id actually in use.
Frontend startup replaces the zero sentinel.
| std::string espectre::espectre_effective_device_id | ( | const EspectreDeviceConfig & | config | ) |
espectre_effective_device_id_u64() in wire form.
| std::string espectre::espectre_effective_device_label | ( | const EspectreDeviceConfig & | config | ) |
The configured label, or the effective device id when no label is set.
| EspectreDeviceInfo espectre::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.
Takes the detector from snapshot, and default_frontend / default_chip where the caller left the field empty, so each frontend only states what is genuinely its own.
| info | What the frontend knows about itself. |
| snapshot | Source of the detector name. May be nullptr when no snapshot exists yet. |
| supports_ota | Whether this frontend exposes firmware updates. |
| default_frontend | Frontend name used when info.frontend is empty. |
| default_chip | Chip name used when info.chip is empty. |
| void espectre::clear_espectre_mqtt_config | ( | EspectreDeviceConfig * | config | ) |
Erase broker settings while preserving identity, for a config reset.
| std::string espectre::espectre_topic | ( | const EspectreDeviceConfig & | config, |
| const char * | suffix ) |
Build a full topic from this device's prefix and a trailing segment.
| std::string espectre::espectre_status_payload | ( | const EspectreDeviceConfig & | config, |
| bool | online, | ||
| uint32_t | timestamp_ms ) |
Availability payload.
Publish it retained so late subscribers see it.
| std::string espectre::espectre_info_payload | ( | const EspectreDeviceConfig & | config, |
| const EspectreDeviceInfo & | info ) |
Device description, supported controls, and optional CSI traffic settings.
Publish retained on connect.
| std::string espectre::espectre_commands_payload | ( | const EspectreDeviceConfig & | config, |
| const EspectreDeviceInfo & | info ) |
MQTT command catalog for the current frontend.
Published on commands/catalog in response to commands. The list is derived from the same supports_* flags carried by info.
| std::string espectre::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.
The payload behind every motion update.
| std::string espectre::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.
diagnostics carries CSI and link rates from RuntimeDiagnosticsSampler. Pass nullptr only for a frontend that does not expose extended diagnostics.
| std::string espectre::espectre_command_result_payload | ( | const EspectreDeviceConfig & | config, |
| const EspectreCommand & | command, | ||
| bool | accepted, | ||
| const char * | message ) |
Acknowledge a command, echoing its command_id.
Publish one for every command you parse, accepted or not; clients correlate on the id and otherwise cannot tell rejection from packet loss.
| std::string espectre::espectre_ota_status_payload | ( | const EspectreDeviceConfig & | config, |
| const EspectreOtaStatus & | status, | ||
| uint32_t | timestamp_ms ) |
OTA progress payload, for each IOtaService status callback worth publishing.
| bool espectre::parse_espectre_command | ( | const std::string & | payload, |
| EspectreCommand * | command, | ||
| std::string * | error ) |
Parse a JSON command payload from the MQTT command topic.
| payload | Raw message body as received. |
| command | Populated only on success. Check the has_* flags to see which fields the peer actually sent. |
| error | Receives a human-readable reason on failure. May be nullptr. |
| bool espectre::parse_espectre_command_request | ( | const std::string & | command_id, |
| const std::string & | command_name, | ||
| const std::string & | params_json, | ||
| EspectreCommand * | command, | ||
| std::string * | error ) |
Parse a transport-neutral command name plus a JSON parameter object.
Direct WebSocket uses the request envelope id and method as the first two arguments. MQTT uses parse_espectre_command() for its flat payload.
| bool espectre::espectre_ota_channel_accepted | ( | const std::string & | channel | ) |
Whether channel is a published OTA channel name.
Accepted values are release, preview, and develop. Empty is not accepted here; omit the field to keep the firmware default.
| std::string espectre::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.
release uses /releases/latest/download/. preview uses tag ESPECTRE_OTA_RELEASE_TAG_PREVIEW (snapshot). develop uses tag ESPECTRE_OTA_RELEASE_TAG_DEVELOP (snapshot-dev).
| bool espectre::parse_espectre_config_command | ( | const std::string & | command, |
| EspectreDeviceConfig * | config, | ||
| std::string * | error ) |
Parse a legacy ASCII SET_DEVICE_CONFIG: command.
Carries one key=value pair, applied in place. A rejected command writes nothing.
| command | Full command string, including the SET_DEVICE_CONFIG: prefix. |
| config | Updated in place on success. |
| error | Receives a human-readable reason on failure. May be nullptr. |
| bool espectre::parse_espectre_mqtt_config_command | ( | const std::string & | command, |
| EspectreDeviceConfig * | config, | ||
| std::string * | error ) |
Parse a SET_MQTT_CONFIG: command, carrying the broker settings.
Fields are applied as they are read, so a command rejected part-way through leaves config partially updated. Pass a copy and commit only on success. host and port are required; the rest keep their previous values.
| bool espectre::parse_direct_websocket_request | ( | const std::string & | payload, |
| DirectWebSocketRequest * | request, | ||
| std::string * | error = nullptr ) |
| bool espectre::direct_websocket_request_to_command | ( | const DirectWebSocketRequest & | request, |
| EspectreCommand * | command, | ||
| std::string * | error = nullptr ) |
| std::string espectre::direct_websocket_success_response | ( | const std::string & | id, |
| const std::string & | result_json = "{}" ) |
| std::string espectre::direct_websocket_error_response | ( | const std::string & | id, |
| const char * | code, | ||
| const char * | message ) |
| std::string espectre::direct_websocket_event | ( | const char * | event, |
| const std::string & | data_json ) |
| const char * espectre::espectre_firmware_version | ( | ) |
The running application's version, as your build system defined it.
Resolved from APP_PROJECT_VER when set, otherwise from the ESP-IDF application descriptor, and "unknown" on a host build. In an SDK integration this is your product version, not ESPectre's: it is what the ESPectre Protocol reports as firmware_version and what OTA compares against. For the version of the ESPectre sources you compiled against, use ESPECTRE_SDK_VERSION_STRING from espectre_sdk_version.h.
| RuntimeConfig espectre::make_runtime_sensing_config_from_kconfig | ( | ) |
Build a RuntimeConfig from the ESPECTRE_* menuconfig options.
This is the ergonomic path on ESP-IDF: expose the sensing settings in menuconfig, call this at boot, and override only the fields your product computes at runtime.
Every value is range-checked against the schema in runtime_sensing_schema.h. An out-of-range or unparseable option falls back to the documented default and logs a warning rather than failing the boot, so a bad sdkconfig degrades instead of bricking the device.
Options absent from the build, for instance when the SDK Kconfig is not sourced, compile to their defaults. Fields with no Kconfig option, such as device_id and the stream settings, keep their RuntimeConfig defaults.
|
constexpr |
Definition at line 34 of file csi_types.h.
|
inline |
Definition at line 54 of file csi_format.h.
|
inline |
Identify which HT20 bin ordering a 64-subcarrier payload uses.
Requires positive evidence in both directions: one guard set must be entirely null and the other entirely populated. Absence of energy alone is not enough, because a sparse or degenerate payload is null under both conventions.
| csi_data | Raw CSI payload (interleaved I/Q pairs) |
| csi_len | Payload length in bytes (must be HT20_CSI_LEN) |
Definition at line 76 of file csi_format.h.
|
inline |
Rotate a classic-order HT20 payload into the centered convention.
Rotating by half the FFT size is its own inverse, so one swap of the payload halves maps 0~31, -32~-1 onto -32~+31.
| csi_data | Source payload of HT20_CSI_LEN bytes |
| out | Destination buffer of HT20_CSI_LEN bytes (must not alias the source) |
Definition at line 106 of file csi_format.h.
|
inline |
Calculate spatial turbulence from pre-calculated magnitudes.
Spatial turbulence is the standard deviation of magnitudes across selected subcarriers. It measures the spatial variability of the Wi-Fi channel - higher values indicate motion/disturbance.
| magnitudes | Array of magnitude values (one per subcarrier) |
| subcarriers | Array of selected subcarrier indices |
| num_subcarriers | Number of selected subcarriers (max 12) |
| max_subcarrier | Maximum valid subcarrier index (default: 64 for HT20) |
Definition at line 128 of file csi_format.h.
|
inline |
Extract subcarrier amplitudes from raw CSI data (I/Q pairs).
Mirrors the Python SegmentationContext._fill_amplitude_buffer helper.
| csi_data | Raw CSI data (interleaved I/Q pairs, Espressif format) |
| csi_len | Length of CSI data in bytes |
| subcarriers | Array of selected subcarrier indices |
| num_subcarriers | Number of selected subcarriers |
| out | Output amplitude buffer |
| out_capacity | Capacity of the output buffer |
Definition at line 167 of file csi_format.h.
|
inline |
Extract one packet-wide amplitude frame for reuse by multiple feature paths.
Definition at line 194 of file csi_format.h.
|
inline |
Fill one packet-wide squared-magnitude frame for energy-domain consumers.
Definition at line 208 of file csi_format.h.
|
inline |
Definition at line 223 of file csi_format.h.
|
inline |
Select the configured tones from a packet-wide amplitude frame.
Definition at line 229 of file csi_format.h.
|
inline |
Select adjacent-bin mean amplitudes from a packet-wide amplitude frame.
Definition at line 244 of file csi_format.h.
|
inline |
Extract one mean magnitude per selected tone from adjacent live HT20 bins.
Windows are clamped to bins 4..60 and skip the DC null at bin 32. This is the production counterpart of SegmentationContext._fill_adjacent_aggregated_amplitude_buffer.
Definition at line 281 of file csi_format.h.
|
inline |
Definition at line 328 of file csi_format.h.
|
inline |
Calculate spatial turbulence directly from raw CSI data (I/Q pairs).
This is a convenience wrapper that calculates magnitudes internally before computing spatial turbulence.
HT20 only: 64 subcarriers, 128 bytes CSI data.
| csi_data | Raw CSI data (interleaved I/Q pairs) |
| csi_len | Length of CSI data in bytes (expected: 128 for HT20) |
| subcarriers | Array of selected subcarrier indices |
| num_subcarriers | Number of selected subcarriers (max 12) |
Definition at line 351 of file csi_format.h.
| void espectre::lowpass_filter_init | ( | lowpass_filter_state_t * | state, |
| float | cutoff_hz, | ||
| float | sample_rate_hz, | ||
| bool | enabled ) |
| float espectre::lowpass_filter_apply | ( | lowpass_filter_state_t * | state, |
| float | value ) |
| void espectre::lowpass_filter_reset | ( | lowpass_filter_state_t * | state | ) |
| void espectre::hampel_turbulence_init | ( | hampel_turbulence_state_t * | state, |
| uint8_t | window_size, | ||
| float | threshold, | ||
| bool | enabled ) |
| float espectre::hampel_filter | ( | const float * | window, |
| size_t | window_size, | ||
| float | current_value, | ||
| float | threshold ) |
Stateless Hampel decision over a caller-owned window.
Shared numeric core: hampel_filter_turbulence() pushes into its ring and then defers here, so the outlier rule exists in exactly one place. The scratch is two stack arrays bounded by HAMPEL_TURBULENCE_WINDOW_MAX (11 floats each), which is small enough for the CSI callback stack.
| float espectre::hampel_filter_turbulence | ( | hampel_turbulence_state_t * | state, |
| float | turbulence ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Calculate mean and variance in one two-pass sweep (numerically stable).
Two-pass algorithm: variance = sum((x - mean)^2) / n More stable than single-pass E[X²] - E[X]² for float32 arithmetic.
The single definition matters beyond DRY. Both detectors feed these values into a threshold comparison, and the C++/Python parity gate requires the two runtimes to decide identically, so the accumulation order has to be fixed in exactly one place. Three hand-rolled copies of these loops used to exist.
| values | Array of float values |
| n | Number of values |
|
inline |
|
inline |
|
inline |
Write the mean-normalized amplitude profile into out.
Shared numeric core for the C++ L1-delta tracker. The MicroPython tracker performs the same normalization directly in its packet loop.
| amplitudes | Input amplitude values |
| count | Number of input values |
| mean | Precomputed arithmetic mean of the input values |
| out | Output buffer (at least count elements) |
|
inline |
|
inline |
Definition at line 52 of file csi_features.h.
|
inline |
Definition at line 75 of file csi_features.h.
|
inline |
Definition at line 81 of file csi_features.h.
|
inline |
Definition at line 86 of file csi_features.h.
|
inline |
Definition at line 91 of file csi_features.h.
|
inline |
Definition at line 99 of file csi_features.h.
|
inline |
Definition at line 110 of file csi_features.h.
|
inline |
Definition at line 116 of file csi_features.h.
|
inline |
Definition at line 129 of file csi_features.h.
|
inline |
Definition at line 150 of file csi_features.h.
|
inline |
Definition at line 207 of file csi_features.h.
|
inline |
Definition at line 238 of file csi_features.h.
|
inline |
Resolve one exported ML feature from precomputed series and tracker stats.
| id | Exported MLFeatureId value to resolve. |
| turb | Statistics for the packet-level turbulence series. |
| aggregated_turb | Statistics for the aggregated turbulence series. |
| l1_delta_lag_ratio | Preprocessed tracker metric for ML_FEAT_L1_DELTA_LAG_RATIO. Deliberately without a default: the no-motion value of the ratio is 1.0, so a forgotten argument would read as a plausible measurement rather than as an error. The Python extractor raises for the same reason; here the compiler does it. |
| chan_shape_spread_subband | Current physical-time subband spread. |
| chan_shape_coherent_innovation_energy | Current coherent innovation energy from the channel-shape trajectory tracker. |
| chan_shape_excess_path | Current channel-shape excess-path metric. |
| chan_shape_subband_kendall_lag_excess | Current guarded Kendall lag-excess of the same eight-subband trajectory. |
Definition at line 318 of file csi_features.h.
|
inline |
Definition at line 342 of file csi_features.h.
|
inline |
Definition at line 54 of file ml_feature_trackers.h.
|
inline |
Validate threshold value against finite/range constraints.
Definition at line 42 of file threshold.h.
|
inline |
Clamp threshold to [min, max] and recover non-finite values.
Definition at line 51 of file threshold.h.
|
constexpr |
Definition at line 66 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 67 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 68 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 70 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 71 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 72 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 73 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 74 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 76 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 77 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 78 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 80 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 81 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 82 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 83 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 85 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 86 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 87 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 89 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 92 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 93 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 95 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 96 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 97 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 98 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 99 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 100 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 102 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 103 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 104 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 105 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 107 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 108 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 109 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 110 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 112 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 113 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 114 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 115 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 116 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 117 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 118 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 120 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 121 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 122 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 123 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 124 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 125 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 126 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 127 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 128 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 130 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 131 of file runtime_sensing_schema.h.
|
constexpr |
Definition at line 132 of file runtime_sensing_schema.h.
|
inlineconstexpr |
Protocol version reported in payloads.
Bumped on a wire-format change.
Definition at line 44 of file espectre_protocol.h.
|
inlineconstexpr |
Default MQTT topic root.
Override per device with EspectreDeviceConfig::topic_prefix.
Definition at line 46 of file espectre_protocol.h.
|
inlineconstexpr |
Official tagged GitHub Release OTA channel.
Definition at line 48 of file espectre_protocol.h.
|
inlineconstexpr |
Rolling main OTA channel.
Fetches GitHub Releases tag snapshot.
Definition at line 50 of file espectre_protocol.h.
|
inlineconstexpr |
Rolling develop OTA channel.
Fetches GitHub Releases tag snapshot-dev.
Definition at line 52 of file espectre_protocol.h.
|
inlineconstexpr |
GitHub Releases tag for the preview OTA channel.
Distinct from branch main.
Definition at line 54 of file espectre_protocol.h.
|
inlineconstexpr |
GitHub Releases tag for the develop OTA channel.
Distinct from branch develop.
Definition at line 56 of file espectre_protocol.h.
|
inlineconstexpr |
Sentinel meaning "use the runtime-generated device id".
Definition at line 58 of file espectre_protocol.h.
|
inlineconstexpr |
Empty label, meaning the device id is used as the display name.
Definition at line 60 of file espectre_protocol.h.
|
inlineconstexpr |
Definition at line 20 of file direct_websocket_protocol.h.
|
inlineconstexpr |
Definition at line 21 of file direct_websocket_protocol.h.
|
inlineconstexpr |
Definition at line 22 of file direct_websocket_protocol.h.
|
inlineconstexpr |
Definition at line 23 of file direct_websocket_protocol.h.
|
inlineconstexpr |
Definition at line 24 of file direct_websocket_protocol.h.
|
inlineconstexpr |
Definition at line 25 of file direct_websocket_protocol.h.
|
constexpr |
Definition at line 21 of file detector_types.h.
|
constexpr |
Definition at line 22 of file detector_types.h.
|
constexpr |
Definition at line 23 of file detector_types.h.
|
constexpr |
Definition at line 24 of file detector_types.h.
|
constexpr |
Definition at line 26 of file detector_types.h.
|
constexpr |
Definition at line 27 of file detector_types.h.
|
constexpr |
Definition at line 28 of file detector_types.h.
|
constexpr |
Definition at line 29 of file detector_types.h.
|
constexpr |
Definition at line 16 of file filter_config.h.
|
constexpr |
Definition at line 17 of file filter_config.h.
|
constexpr |
Definition at line 18 of file filter_config.h.
|
constexpr |
Definition at line 19 of file filter_config.h.
|
constexpr |
Definition at line 21 of file filter_config.h.
|
constexpr |
Definition at line 22 of file filter_config.h.
|
constexpr |
Definition at line 23 of file filter_config.h.
|
constexpr |
Definition at line 24 of file filter_config.h.
|
constexpr |
Definition at line 18 of file csi_types.h.
|
constexpr |
Definition at line 19 of file csi_types.h.
|
constexpr |
Definition at line 20 of file csi_types.h.
|
constexpr |
Definition at line 21 of file csi_types.h.
|
constexpr |
Definition at line 22 of file csi_types.h.
|
constexpr |
Definition at line 23 of file csi_types.h.
|
constexpr |
Definition at line 24 of file csi_types.h.
|
constexpr |
Definition at line 25 of file csi_types.h.
|
constexpr |
Definition at line 26 of file csi_types.h.
|
constexpr |
Definition at line 27 of file csi_types.h.
|
constexpr |
Definition at line 29 of file csi_types.h.
|
constexpr |
Definition at line 25 of file lightweight_detector.h.
|
constexpr |
Definition at line 26 of file lightweight_detector.h.
|
constexpr |
Definition at line 27 of file lightweight_detector.h.
|
constexpr |
Definition at line 28 of file lightweight_detector.h.
|
constexpr |
Definition at line 29 of file lightweight_detector.h.
|
constexpr |
Definition at line 30 of file lightweight_detector.h.
|
constexpr |
Definition at line 31 of file lightweight_detector.h.
|
constexpr |
Definition at line 33 of file lightweight_detector.h.
|
constexpr |
Definition at line 34 of file lightweight_detector.h.
|
constexpr |
Definition at line 35 of file lightweight_detector.h.
|
constexpr |
Definition at line 36 of file lightweight_detector.h.
|
constexpr |
Definition at line 44 of file lightweight_detector.h.
|
constexpr |
Definition at line 45 of file lightweight_detector.h.
|
constexpr |
Definition at line 46 of file lightweight_detector.h.
|
constexpr |
Definition at line 45 of file csi_format.h.
|
constexpr |
Definition at line 46 of file csi_format.h.
|
constexpr |
Definition at line 18 of file detector_limits.h.
|
constexpr |
Definition at line 19 of file detector_limits.h.
|
constexpr |
Definition at line 20 of file detector_limits.h.
|
constexpr |
Definition at line 21 of file detector_limits.h.
|
constexpr |
Definition at line 24 of file detector_limits.h.
|
constexpr |
Definition at line 28 of file detector_limits.h.
|
constexpr |
Definition at line 30 of file detector_limits.h.
|
constexpr |
Definition at line 31 of file detector_limits.h.
|
constexpr |
Definition at line 38 of file detector_limits.h.
|
constexpr |
Definition at line 39 of file detector_limits.h.
|
constexpr |
Definition at line 40 of file detector_limits.h.
|
constexpr |
Definition at line 41 of file detector_limits.h.
|
constexpr |
Definition at line 42 of file detector_limits.h.
|
constexpr |
Definition at line 53 of file detector_limits.h.
|
constexpr |
Definition at line 59 of file detector_limits.h.
|
constexpr |
Definition at line 25 of file csi_features.h.
|
constexpr |
Definition at line 26 of file csi_features.h.
|
constexpr |
Definition at line 27 of file csi_features.h.
|
constexpr |
Definition at line 24 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 25 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 30 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 31 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 33 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 34 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 35 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 38 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 39 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 40 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 43 of file ml_feature_trackers.h.
|
constexpr |
Definition at line 34 of file threshold.h.
|
constexpr |
Definition at line 36 of file threshold.h.
|
constexpr |
Definition at line 37 of file threshold.h.
|
constexpr |
Definition at line 65 of file threshold.h.
|
constexpr |
Definition at line 69 of file threshold.h.
|
constexpr |
Definition at line 70 of file threshold.h.
|
constexpr |
Definition at line 71 of file threshold.h.
|
constexpr |
Definition at line 72 of file threshold.h.
|
constexpr |
Definition at line 73 of file threshold.h.
|
constexpr |
Definition at line 74 of file threshold.h.
|
constexpr |
Definition at line 75 of file threshold.h.
|
constexpr |
Definition at line 76 of file threshold.h.
|
constexpr |
Definition at line 77 of file threshold.h.
|
constexpr |
Definition at line 78 of file threshold.h.
|
constexpr |
Definition at line 79 of file threshold.h.
|
constexpr |
Definition at line 80 of file threshold.h.
|
constexpr |
Definition at line 81 of file threshold.h.