Skip to content

Commit

Permalink
Merge branch 'develop' into 243-plaintext-inserter
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 authored Dec 20, 2024
2 parents e6dcbc0 + c14b3ea commit 48abee4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 1 addition & 6 deletions scylla-server/src/controllers/car_command_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,12 @@ pub struct ConfigRequest {
pub async fn send_config_command(
Path(key): Path<String>,
Query(data_query): Query<ConfigRequest>,
Extension(client): Extension<Option<Arc<AsyncClient>>>,
Extension(client): Extension<Arc<AsyncClient>>,
) -> Result<(), ScyllaError> {
info!(
"Sending car config with key: {}, and values: {:?}",
key, data_query.data
);
// disable scylla if not prod, as there will be None mqtt client
let Some(client) = client else {
warn!("Cannot use config endpoint in dev mode!");
return Ok(());
};

// the protobuf calypso converts into CAN
let mut payload = CommandData::new();
Expand Down
6 changes: 2 additions & 4 deletions scylla-server/src/mqtt_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,9 @@ impl MqttProcessor {
return None;
};

// get the node and datatype from the topic extracted at the beginning
// get the node from the topic extracted at the beginning
let node = split.0;

let data_type = String::from(topic);

// extract the unix time
// levels of time priority
// - A: The time packaged in the protobuf, to microsecond precision
Expand Down Expand Up @@ -301,7 +299,7 @@ impl MqttProcessor {

Some(ClientData {
run_id: crate::RUN_ID.load(Ordering::Relaxed),
name: data_type,
name: topic.to_string(),
unit: data.unit,
values: data.values,
timestamp: unix_clean,
Expand Down

0 comments on commit 48abee4

Please sign in to comment.