diff --git a/config.ini b/config.ini index c423635..f2be6c3 100644 --- a/config.ini +++ b/config.ini @@ -14,10 +14,10 @@ port_rx = 9001 # # IP Address of Headpat Device - device_ips = 192.168.1.151 192.168.1.157 192.168.1.153 + device_ips = GIGGLE.TECH.DEVICE.IP # # Unity Proximity parameter[s] - proximity_parameters_multi = proximity_01 proximity_02 proximity_03 + proximity_parameters_multi = proximity_01 # max_speed_parameter = max_speed # diff --git a/giggletech-router/src/giggletech_osc.rs b/giggletech-router/src/giggletech_osc.rs index f09071b..65d8c9f 100644 --- a/giggletech-router/src/giggletech_osc.rs +++ b/giggletech-router/src/giggletech_osc.rs @@ -7,6 +7,7 @@ use async_osc::{ OscSocket, Result}; // OSC Address Setup const TX_OSC_MOTOR_ADDRESS: &str = "/avatar/parameters/motor"; +const TX_OSC_GIGGLESPARK: &str = "/motor"; //const TX_OSC_LED_ADDRESS_2: &str = "/avatar/parameters/led"; pub(crate) fn create_socket_address(host: &str, port: &str) -> String { @@ -38,5 +39,6 @@ pub(crate) async fn send_data(device_ip: &str, value: i32) -> Result<()> { let tx_socket = setup_tx_socket(tx_socket_address.clone()).await?; tx_socket.connect(tx_socket_address).await?; tx_socket.send((TX_OSC_MOTOR_ADDRESS, (value,))).await?; + tx_socket.send((TX_OSC_GIGGLESPARK, (value,))).await?; Ok(()) } \ No newline at end of file diff --git a/giggletech-router/src/osc_timeout.rs b/giggletech-router/src/osc_timeout.rs index 920ad03..fc108ad 100644 --- a/giggletech-router/src/osc_timeout.rs +++ b/giggletech-router/src/osc_timeout.rs @@ -18,6 +18,7 @@ pub async fn osc_timeout(device_ip: &str, timeout: u64) -> Result<()> { let elapsed_time = Instant::now().duration_since(*DEVICE_LAST_SIGNAL_TIME.lock().unwrap().get(device_ip).unwrap_or(&Instant::now())); //println!("Device Ip {} Elapsed Time {:?}", device_ip, elapsed_time); if elapsed_time >= Duration::from_secs(timeout) { + //println!("Timeout"); giggletech_osc::send_data(device_ip, 0i32).await?; let mut device_last_signal_times = DEVICE_LAST_SIGNAL_TIME.lock().unwrap(); device_last_signal_times.insert(device_ip.to_string(), Instant::now());