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

Method set_device_info

chirpstack/src/uplink/join_sns.rs:171–194  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

169 }
170
171 fn set_device_info(&mut self) -> Result<()> {
172 let tenant = self.tenant.as_ref().unwrap();
173 let app = self.application.as_ref().unwrap();
174 let dp = self.device_profile.as_ref().unwrap();
175 let dev = self.device.as_ref().unwrap();
176
177 let mut tags = (*app.tags).clone();
178 tags.extend((*dp.tags).clone());
179 tags.extend((*dev.tags).clone());
180
181 self.device_info = Some(integration_pb::DeviceInfo {
182 tenant_id: tenant.id.to_string(),
183 tenant_name: tenant.name.clone(),
184 application_id: app.id.to_string(),
185 application_name: app.name.to_string(),
186 device_profile_id: dp.id.to_string(),
187 device_profile_name: dp.name.clone(),
188 device_name: dev.name.clone(),
189 device_class_enabled: dev.enabled_class.to_proto().into(),
190 dev_eui: dev.dev_eui.to_string(),
191 tags,
192 });
193 Ok(())
194 }
195
196 fn abort_on_device_is_disabled(&self) -> Result<()> {
197 if self.device.as_ref().unwrap().is_disabled {

Callers 1

_start_prMethod · 0.45

Calls 5

unwrapMethod · 0.80
as_refMethod · 0.80
to_stringMethod · 0.80
to_protoMethod · 0.80
intoMethod · 0.45

Tested by

no test coverage detected