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.
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.
Name
Show or set the human-readable device name.
Identity
Show or generate the device identity public key.
Fields
op: Option<IdentityOp>Phy
Show or set the PHY enable state and LoRa parameters.
Duty
Show duty-cycle usage, or bound it.
Repeater
Show or set the autonomous repeater forwarding policy.
Fields
op: Option<RepeaterOp>Time
Show or set the device’s wall clock and time zone.
Gnss
Show or set the GNSS receiver and what is done with its fixes.
Advert
Show or set what the device announces on its own schedule.
Alert
Show or drive the locate alert: make the radio conspicuous so it can be found.
Pin
Set or clear the persisted BLE pairing PIN.
DevChannel
Device-identity channel keys: the multicast this device’s own node joins.
DevPeer
Device-identity peer public keys.
DevAdmin
Nodes authorized to manage this device over the mesh.
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).
FactoryReset
Erase ALL state including BLE bonds and the pairing PIN, then reboot into a blank factory state.
Manage
Administer another device over the mesh, using the attached radio to reach it.
PeerRepeaters
Ask a repeater which repeaters it knows of, using the attached radio to reach it.
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.
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.
Default
Show, set, or clear the radio this tool reaches for when the command line names none.
Implementations§
Source§impl Command
impl Command
Sourcepub fn needs_device(&self) -> bool
pub fn needs_device(&self) -> bool
Whether this command needs an attached device.
Sourcepub fn mesh_refusal(&self) -> Option<&'static str>
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.
Sourcepub fn validate(&self) -> Result<()>
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.
pub async fn run(self, app: &mut App) -> Result<()>
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommand