NprRuntime class final
#include <npr/runtime/runtime.hpp>
NPR runtime orchestrator singleton.
Runtime owns only common queue boundaries, PHY orchestration, and shared diagnostics. Role-specific connection/admission/allocation state lives in the selected MAC engine implementation.
Public types
- struct Impl
Public static functions
- static auto instance() -> NprRuntime&
- Returns process-wide singleton instance.
Public functions
- auto active_profile() const -> const RadioProfile*
- Active radio profile selected at init time.
- auto dequeue_ipv4_downlink(uint8_t* out, size_t out_capacity, size_t* out_size) -> bool
- Dequeues one fully reassembled downlink IPv4 packet.
- auto diagnostics() -> NprDiagnostics&
- Diagnostics counter object shared by MAC/PHY.
- auto diagnostics_snapshot(NprDiagnosticsSnapshot* out) const -> bool
- Copies current diagnostics snapshot.
- auto enqueue_ipv4_uplink(const uint8_t* packet, size_t packet_size) -> bool
- Enqueues one host IPv4 packet for uplink segmentation/transmit.
-
auto init(npr::
cfg:: NprConfigSection& config, const Si4463Hal& radio_hal) -> bool - Initializes NPR stack for provided NPR config section and bound radio HAL pins/bus.
- auto link_connected() const -> bool
- Returns current link state reported by active MAC role.
- auto network_config_snapshot(NprNetworkConfig* out) const -> bool
- Copies current role-specific network configuration snapshot.
- void radio_worker()
- Executes one worker-loop iteration (RX capture, MAC planning, TX execution).
-
void set_pool_manager(prf::
net:: pool:: Ipv4PoolManager* pool_manager) - Injects optional pool manager used by master role for committed IP allocations.
-
void set_pool_source_sink(prf::
net:: pool:: IPoolSourceSink* pool_source_sink) - Injects optional source/sink used by slave role to publish learned IPv4 pools.
-
void set_task_heartbeat_sink(prf::
system:: ITaskHeartbeatSink* task_heartbeat_sink, prf:: system:: TaskHealthTaskId task_id) - Injects optional heartbeat sink used by watchdog health gating.
- auto who_cache_snapshot(SignalingWhoEntry* out_entries, size_t max_entries, uint64_t* out_now_us) const -> size_t
- Copies active WHO/neighbor cache entries and current runtime time base.
Function documentation
bool npr:: rf:: NprRuntime:: dequeue_ipv4_downlink(uint8_t* out,
size_t out_capacity,
size_t* out_size)
Dequeues one fully reassembled downlink IPv4 packet.
| Returns | true when packet was dequeued. |
|---|
bool npr:: rf:: NprRuntime:: enqueue_ipv4_uplink(const uint8_t* packet,
size_t packet_size)
Enqueues one host IPv4 packet for uplink segmentation/transmit.
| Returns | true when enqueued, false when queue is full/invalid args. |
|---|
bool npr:: rf:: NprRuntime:: init(npr:: cfg:: NprConfigSection& config,
const Si4463Hal& radio_hal)
Initializes NPR stack for provided NPR config section and bound radio HAL pins/bus.
| Returns | true when runtime is initialized and ready for radio_. |
|---|
bool npr:: rf:: NprRuntime:: network_config_snapshot(NprNetworkConfig* out) const
Copies current role-specific network configuration snapshot.
| Parameters | |
|---|---|
| out | Output config pointer. |
| Returns | true when snapshot was available. |
With current slave implementation this is CONNECT_ACK-derived NPR-side addressing learned from master. Runtime forwards the snapshot but does not own or interpret the role-specific state internally.
size_t npr:: rf:: NprRuntime:: who_cache_snapshot(SignalingWhoEntry* out_entries,
size_t max_entries,
uint64_t* out_now_us) const
Copies active WHO/neighbor cache entries and current runtime time base.
This is an observability API shared by all NPR roles. It intentionally exposes a role-neutral snapshot rather than role-specific MAC internals.