Command

Enum Command 

Source
pub enum Command {
Show 35 variants Info(InfoArgs), Get { keys: Vec<PropArg>, hex: bool, }, Illuminance, Set { key: PropArg, value: String, hex: bool, }, Name { name: Option<String>, }, Identity { op: Option<IdentityOp>, }, Phy { op: Option<PhyOp>, }, Duty { op: Option<DutyOp>, }, Repeater { op: Option<RepeaterOp>, }, Time { op: Option<TimeOp>, }, Gnss { op: Option<GnssOp>, }, Advert { op: Option<AdvertOp>, }, Alert { op: Option<AlertOp>, }, Pin { value: PinArg, }, DevChannel { op: Option<TableOp>, }, DevPeer { op: Option<TableOp>, }, DevAdmin { op: Option<TableOp>, }, Save, Restore, Clear, Reset, Reboot, Ble { op: BleOp, }, FactoryReset { yes: bool, }, Manage { target: KeyArg, op: ManageOp, }, PeerRepeaters { target: KeyArg, }, Ping(PingArgs), Discover(DiscoverArgs), Send(SendArgs), Listen(ListenArgs), Routes { op: Option<RoutesOp>, }, AdminKey, Capture(CaptureArgs), BleScan { timeout: u64, }, Default { op: Option<DefaultOp>, },
}

Variants§

§

Info(InfoArgs)

Report what the device says about itself, whole or by topic. Changes nothing.

§

Get

Read properties by name or number.

Names are the spec mnemonics without their prefix (phy-freq, dev-name); numbers are decimal or 0x-prefixed. Several are read in one exchange where the device supports it.

Fields

§keys: Vec<PropArg>
§hex: bool

Print values as raw octets rather than reading them.

§

Illuminance

Take one ambient light reading.

§

Set

Write one property by name or number.

The value is written the way get reads it back: on/off for a switch, a decimal number for a count, an address for a key. A property whose shape is a structure takes hex.

Fields

§value: String
§hex: bool

Print the stored value as raw octets.

§

Name

Show or set the human-readable device name.

Fields

§

Identity

Show or generate the device identity public key.

Fields

§

Phy

Show or set the PHY enable state and LoRa parameters.

Fields

§

Duty

Show duty-cycle usage, or bound it.

Fields

§

Repeater

Show or set the autonomous repeater forwarding policy.

Fields

§

Time

Show or set the device’s wall clock and time zone.

Fields

§

Gnss

Show or set the GNSS receiver and what is done with its fixes.

Fields

§

Advert

Show or set what the device announces on its own schedule.

Fields

§

Alert

Show or drive the locate alert: make the radio conspicuous so it can be found.

Fields

§

Pin

Set or clear the persisted BLE pairing PIN.

Fields

§value: PinArg
§

DevChannel

Device-identity channel keys: the multicast this device’s own node joins.

Fields

§

DevPeer

Device-identity peer public keys.

Fields

§

DevAdmin

Nodes authorized to manage this device over the mesh.

Fields

§

Save

Persist live state across reboots (CMD_SAVE).

§

Restore

Revert live state to the saved snapshot.

§

Clear

Erase persisted state; live state keeps running.

§

Reset

Protocol reset (CMD_RST): state returns to its post-reset values, restoring any saved snapshot. The MCU does not reboot.

§

Reboot

Restart the device (CMD_REBOOT): a power cycle that keeps everything the device has persisted.

§

Ble

Manage the device’s Bluetooth bonds (CAP_BLE).

Fields

§

FactoryReset

Erase ALL state including BLE bonds and the pairing PIN, then reboot into a blank factory state.

Fields

§yes: bool

Confirm the wipe. Required outside the REPL, which asks.

§

Manage

Administer another device over the mesh, using the attached radio to reach it.

Fields

§target: KeyArg

The device to manage, as its node public key.

§

PeerRepeaters

Ask a repeater which repeaters it knows of, using the attached radio to reach it.

Fields

§target: KeyArg

The repeater to ask, as its node public key.

§

Ping(PingArgs)

Measure the path to another node: reachability, round-trip time, hops, and signal. Needs no authorization from the far end.

§

Discover(DiscoverArgs)

Find out which nodes are within reach of this radio.

Asks every node in earshot to identify itself, then listens for the answers and for whatever advertises itself unprompted.

§

Send(SendArgs)

Send a text message to a node, as this tool’s own identity.

§

Listen(ListenArgs)

Print text messages addressed to this tool, until interrupted.

§

Routes

Show or forget the routes this tool has learned to other nodes.

Learned from replies and remembered between invocations, so a script does not re-flood the mesh for a path it was told a second ago. Needs no radio.

Fields

§

AdminKey

Show the administrator identity this tool manages devices with.

§

Capture(CaptureArgs)

Listen on the device’s radio, decoding frames and optionally writing a Wireshark-compatible capture.

§

BleScan

List nearby ULCP radios over BLE without connecting.

This finds radios to attach this tool to. discover is the one that finds nodes out on the mesh.

Fields

§timeout: u64

Seconds to listen.

§

Default

Show, set, or clear the radio this tool reaches for when the command line names none.

Fields

Implementations§

Source§

impl Command

Source

pub fn needs_device(&self) -> bool

Whether this command needs an attached device.

Source

pub fn mesh_refusal(&self) -> Option<&'static str>

Why this command cannot run against a device reached over the mesh, if it cannot.

Most of the tool works unchanged over a mesh session: the handle is an ordinary one and the properties behind it are the same. The exceptions are the commands that need something the Node Management binding does not carry, and the ones that would want the radio this session has already borrowed. Refusing them here beats letting each fail in its own way somewhere over the air.

Source

pub fn validate(&self) -> Result<()>

Check whatever clap’s grammar cannot — combinations of flags — before a device is opened.

Connecting takes seconds over BLE and disturbs a radio that was minding its own business; an argument mistake should cost neither.

Source

pub async fn run(self, app: &mut App) -> Result<()>

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
Source§

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