| 295 | } |
| 296 | |
| 297 | fn set_device_info(&mut self) -> Result<()> { |
| 298 | let tenant = self.tenant.as_ref().unwrap(); |
| 299 | let app = self.application.as_ref().unwrap(); |
| 300 | let dp = self.device_profile.as_ref().unwrap(); |
| 301 | let dev = self.device.as_ref().unwrap(); |
| 302 | |
| 303 | let mut tags = (*app.tags).clone(); |
| 304 | tags.extend((*dp.tags).clone()); |
| 305 | tags.extend((*dev.tags).clone()); |
| 306 | |
| 307 | self.device_info = Some(integration_pb::DeviceInfo { |
| 308 | tenant_id: tenant.id.to_string(), |
| 309 | tenant_name: tenant.name.clone(), |
| 310 | application_id: app.id.to_string(), |
| 311 | application_name: app.name.to_string(), |
| 312 | device_profile_id: dp.id.to_string(), |
| 313 | device_profile_name: dp.name.clone(), |
| 314 | device_name: dev.name.clone(), |
| 315 | device_class_enabled: dev.enabled_class.to_proto().into(), |
| 316 | dev_eui: dev.dev_eui.to_string(), |
| 317 | tags, |
| 318 | }); |
| 319 | Ok(()) |
| 320 | } |
| 321 | |
| 322 | fn set_relay_rx_info(&mut self) -> Result<()> { |
| 323 | let relay_ctx = self.relay_context.as_ref().unwrap(); |