@@ -317,17 +317,31 @@ class HostApplication {
317317 [[nodiscard]] stdx::expected<void , std::string>
318318 subscribe_state (std::string_view host_id);
319319
320+ /* *
321+ * @brief Lightweight snapshot of node state (scalars only, no maps).
322+ *
323+ * Returned by value from get_node_state() so callers don't hold references
324+ * into mutex-protected data. Use get_metric_name() for alias resolution.
325+ */
326+ struct NodeStateSnapshot {
327+ bool is_online{false };
328+ uint64_t last_seq{255 };
329+ uint64_t bd_seq{0 };
330+ uint64_t birth_timestamp{0 };
331+ bool birth_received{false };
332+ };
333+
320334 /* *
321335 * @brief Gets the current state of a specific edge node.
322336 *
323337 * @param group_id The group ID
324338 * @param edge_node_id The edge node ID to query
325339 *
326- * @return NodeState if the node has been seen, std::nullopt otherwise
340+ * @return NodeStateSnapshot if the node has been seen, std::nullopt otherwise
327341 *
328342 * @note Useful for monitoring node online/offline status and bdSeq.
329343 */
330- [[nodiscard]] std::optional<std::reference_wrapper< const NodeState> >
344+ [[nodiscard]] std::optional<NodeStateSnapshot >
331345 get_node_state (std::string_view group_id, std::string_view edge_node_id) const ;
332346
333347 /* *
@@ -341,16 +355,15 @@ class HostApplication {
341355 * @param device_id The device ID (empty string for node-level metrics)
342356 * @param alias The metric alias to resolve
343357 *
344- * @return A string_view to the metric name if found, std::nullopt otherwise
358+ * @return The metric name if found, std::nullopt otherwise
345359 *
346360 * @note Returns std::nullopt if the node/device hasn't sent a birth message yet,
347361 * or if the alias is not found in the birth message.
348362 */
349- [[nodiscard]] std::optional<std::string_view>
350- get_metric_name (std::string_view group_id,
351- std::string_view edge_node_id,
352- std::string_view device_id,
353- uint64_t alias) const ;
363+ [[nodiscard]] std::optional<std::string> get_metric_name (std::string_view group_id,
364+ std::string_view edge_node_id,
365+ std::string_view device_id,
366+ uint64_t alias) const ;
354367
355368 /* *
356369 * @brief Publishes a STATE birth message to indicate Host Application is online.
@@ -420,7 +433,8 @@ class HostApplication {
420433 * @param payload PayloadBuilder containing command metrics (e.g., "Node
421434 * Control/Rebirth")
422435 *
423- * @return void on success, error message on failure
436+ * @return void on success, error message on failure (fire-and-forget QoS 0,
437+ * only reports local send errors)
424438 *
425439 * @note Common Node Control commands:
426440 * - "Node Control/Rebirth" (bool): Request node to republish NBIRTH
@@ -451,7 +465,8 @@ class HostApplication {
451465 * @param target_device_id The target device identifier
452466 * @param payload PayloadBuilder containing command metrics
453467 *
454- * @return void on success, error message on failure
468+ * @return void on success, error message on failure (fire-and-forget QoS 0,
469+ * only reports local send errors)
455470 *
456471 * @par Example Usage
457472 * @code
0 commit comments