MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / set_device_mode

Method set_device_mode

chirpstack/src/uplink/join.rs:870–882  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

868 }
869
870 async fn set_device_mode(&mut self) -> Result<()> {
871 let dp = self.device_profile.as_ref().unwrap();
872 let d = self.device.as_mut().unwrap();
873
874 // LoRaWAN 1.1 devices send a mac-command when changing to Class-C.
875 if dp.supports_class_c && dp.mac_version.to_string().starts_with("1.0") {
876 d.enabled_class = DeviceClass::C;
877 } else {
878 d.enabled_class = DeviceClass::A;
879 }
880
881 Ok(())
882 }
883
884 async fn update_device(&mut self) -> Result<()> {
885 trace!("Updating device");

Callers 2

_handleMethod · 0.80
_handle_relayedMethod · 0.80

Calls 3

unwrapMethod · 0.80
as_refMethod · 0.80
to_stringMethod · 0.80

Tested by

no test coverage detected