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

Function handle_firmware

chirpstack/src/cmd/import_device_profiles.rs:214–232  ·  view source on GitHub ↗
(dir: &Path, device: &Device, firmware: &DeviceFirmware)

Source from the content-addressed store, hash-verified

212}
213
214async fn handle_firmware(dir: &Path, device: &Device, firmware: &DeviceFirmware) -> Result<()> {
215 let codec = if let Some(codec) = &firmware.codec {
216 let codec_path = dir.join("codecs").join(codec);
217 info!(path = ?codec_path, "Reading codec file");
218
219 Some(fs::read_to_string(codec_path)?)
220 } else {
221 None
222 };
223
224 for profile in &firmware.profiles {
225 let span = span!(Level::INFO, "", profile = %profile);
226 handle_profile(dir, device, firmware, &codec, profile)
227 .instrument(span)
228 .await?;
229 }
230
231 Ok(())
232}
233
234async fn handle_profile(
235 dir: &Path,

Callers 1

handle_deviceFunction · 0.85

Calls 1

handle_profileFunction · 0.85

Tested by

no test coverage detected