pub struct App {
pub session: Option<Session>,
pub prefs: Prefs,
pub interactive: bool,
pub trace: bool,
pub no_save: bool,
pub baud: u32,
pub discovery: Discovery,
pub last_scan: Vec<Found>,
pub mesh: Option<MeshHome>,
}Expand description
Everything a command may need beyond the device itself: the attachment, the settings, and the difference between a shell and a one-shot invocation.
Fields§
§session: Option<Session>§prefs: Prefs§interactive: boolTrue in the shell, where a question can be asked and a failure returns to a prompt.
trace: bool§no_save: bool§baud: u32§discovery: DiscoveryHow a bare connect resolves a scan — --pick at launch keeps
asking for the rest of the shell session.
last_scan: Vec<Found>The last ble-scan listing, so connect <N> can refer to it.
mesh: Option<MeshHome>What a mesh session borrowed, while one is open. Present exactly
when session reaches its device over the air.
Implementations§
Source§impl App
impl App
pub fn session(&mut self) -> Result<&mut Session>
pub fn device(&mut self) -> Result<&mut UlcpDevice<SessionLink>>
pub fn target_is_ble(&self) -> bool
Sourcepub async fn detach(&mut self) -> Option<String>
pub async fn detach(&mut self) -> Option<String>
Drop the attachment, returning what it was called. Dropping the link is what reverts session-scoped device state.
Ending a mesh session drops its device handle first, which is what closes the link and lets the driver wind down and hand the borrowed radio back — so the caller is left attached to the local radio again rather than to nothing.
pub fn rename(&mut self, label: String)
Sourcepub fn for_extcap(session: Session, prefs: Prefs, baud: u32) -> Self
pub fn for_extcap(session: Session, prefs: Prefs, baud: u32) -> Self
An attached, non-interactive app for the Wireshark extcap interface.
interactive is false in both its senses here: there is no
prompt to return to, and nobody to answer a question. That is
also what lets a dropped BLE link be recovered underneath a
running capture.
pub async fn attach(&mut self, target: Target) -> Result<()>
Sourcepub async fn reconnect(&mut self) -> Result<()>
pub async fn reconnect(&mut self) -> Result<()>
Open a fresh link to the same radio, keeping the capture tap so a recovered capture stays one file.