Skip to content

Commit

Permalink
Merge pull request #501 from helium/rg/dump-iot-valid-packet-reports
Browse files Browse the repository at this point in the history
Add support to dump IotValidPacket reports
  • Loading branch information
madninja authored Apr 29, 2023
2 parents 45fecbb + 5877d6f commit 77ca5c7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions file_store/src/cli/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ use crate::{
cli::print_json,
file_source,
heartbeat::{CellHeartbeat, CellHeartbeatIngestReport},
iot_packet::IotValidPacket,
speedtest::{CellSpeedtest, CellSpeedtestIngestReport},
traits::MsgDecode,
FileType, Result, Settings,
};
use base64::Engine;
use csv::Writer;
use futures::stream::StreamExt;
use helium_crypto::PublicKey;
Expand Down Expand Up @@ -173,6 +176,16 @@ impl Cmd {
"token_type": manifest.token_type(),
}))?;
}
FileType::IotValidPacket => {
let manifest = IotValidPacket::decode(msg)?;
print_json(&json!({
"payload_size": manifest.payload_size,
"gateway": PublicKey::try_from(manifest.gateway)?,
"payload_hash": base64::engine::general_purpose::STANDARD.encode(manifest.payload_hash),
"num_dcs": manifest.num_dcs,
"packet_timestamp": manifest.packet_timestamp,
}))?;
}
_ => (),
}
}
Expand Down

0 comments on commit 77ca5c7

Please sign in to comment.