Skip to main content

CSINode

Struct CSINode 

Source
pub struct CSINode<'a> { /* private fields */ }
Expand description

Primary orchestration object for CSI collection.

Construct a node with CSINode::new or CSINode::new_central_node, configure optional protocol/rate/traffic frequency, then call run().

Implementations§

Source§

impl<'a> CSINode<'a>

Source

pub fn new( kind: Node, collection_mode: CollectionMode, csi_config: Option<CsiConfiguration>, traffic_freq_hz: Option<u16>, hardware: CSINodeHardware<'a>, ) -> Self

Create a new node with explicit Node kind.

Source

pub fn new_central_node( op_mode: CentralOpMode, collection_mode: CollectionMode, csi_config: Option<CsiConfiguration>, traffic_freq_hz: Option<u16>, hardware: CSINodeHardware<'a>, ) -> Self

Convenience constructor for a central node.

Source

pub fn get_node_type(&self) -> &Node

Get the node type and operation mode.

Source

pub fn get_collection_mode(&self) -> CollectionMode

Get the current collection mode.

Source

pub fn get_central_op_mode(&self) -> Option<&CentralOpMode>

If central, return the active central op mode.

Source

pub fn get_peripheral_op_mode(&self) -> Option<&PeripheralOpMode>

If peripheral, return the active peripheral op mode.

Source

pub fn set_csi_config(&mut self, config: CsiConfiguration)

Update CSI configuration.

Source

pub fn set_station_config(&mut self, config: WifiStationConfig)

Update Wi-Fi Station configuration (only applies to central station mode).

Source

pub fn set_traffic_frequency(&mut self, freq_hz: u16)

Set traffic generation frequency in Hz (ESP-NOW modes).

Source

pub fn set_collection_mode(&mut self, mode: CollectionMode)

Set collection mode for the node.

Source

pub fn set_op_mode(&mut self, mode: Node)

Replace the node kind/mode.

Source

pub fn set_protocol(&mut self, protocol: Protocol)

Set Wi-Fi protocol (overrides default).

Source

pub fn set_rate(&mut self, rate: WifiPhyRate)

Set Wi-Fi PHY data rate for ESP-NOW traffic.

Source

pub async fn run_duration(&mut self, duration: u64, client: &mut CSINodeClient)

Run the node until duration in seconds with internal collection.

This initializes Wi-Fi, configures CSI, and starts mode-specific tasks.

Source

pub async fn run(&mut self)

Run the node until stopped.

This initializes Wi-Fi, configures CSI, and starts mode-specific tasks.

Auto Trait Implementations§

§

impl<'a> Freeze for CSINode<'a>

§

impl<'a> RefUnwindSafe for CSINode<'a>

§

impl<'a> Send for CSINode<'a>

§

impl<'a> Sync for CSINode<'a>

§

impl<'a> Unpin for CSINode<'a>

§

impl<'a> UnsafeUnpin for CSINode<'a>

§

impl<'a> !UnwindSafe for CSINode<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.