Can now connect to Omikron :C

Some util
This commit is contained in:
Alex Emmet 2025-08-31 14:44:56 +02:00
commit 8637be0a08
9 changed files with 391 additions and 78 deletions

View file

@ -1,8 +1,12 @@
use std::time::Duration;
use json::{self, JsonValue};
use tokio::time::sleep;
use uuid::Uuid;
mod data;
mod omikron;
mod util;
mod users;
use crate::omikron::omikronConnection::{OmikronConnection};
use crate::data::communication::{CommunicationValue, LogLevel, LogValue, CommunicationType, DataTypes};
@ -12,5 +16,17 @@ fn main() {
let omikron = OmikronConnection::new();
rt.block_on(async {
omikron.connect().await;
omikron.send_message(
CommunicationValue::new(
CommunicationType::Identification
)
.add_data(DataTypes::UserIds, json::JsonValue::String(Uuid::new_v4().to_string()))
.add_data(DataTypes::IotaId, json::JsonValue::String(Uuid::new_v4().to_string()))
.to_json()
.to_string()
.as_mut()
).await;
omikron.close().await;
});
}