Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop using node #258

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(split.1);

// 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
Loading