From 2d9259f99679e850b9d7774e85f982e833c6943b Mon Sep 17 00:00:00 2001 From: Jackson Coxson Date: Thu, 26 Jun 2025 11:49:52 -0600 Subject: [PATCH] Fix location simulation C example --- ffi/examples/location_simulation.c | 2 -- ffi/src/remote_server.rs | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ffi/examples/location_simulation.c b/ffi/examples/location_simulation.c index e281cc0..e664f6d 100644 --- a/ffi/examples/location_simulation.c +++ b/ffi/examples/location_simulation.c @@ -57,7 +57,6 @@ int main(int argc, char **argv) { CoreDeviceProxyHandle *core_device = NULL; err = core_device_proxy_connect(tcp_provider, &core_device); idevice_provider_free(tcp_provider); - idevice_pairing_file_free(pairing); if (err != NULL) { fprintf(stderr, "Failed to connect to CoreDeviceProxy: [%d] %s", err->code, err->message); @@ -79,7 +78,6 @@ int main(int argc, char **argv) { // Create TCP adapter and connect to RSD port AdapterHandle *adapter = NULL; err = core_device_proxy_create_tcp_adapter(core_device, &adapter); - core_device_proxy_free(core_device); if (err != NULL) { fprintf(stderr, "Failed to create TCP adapter: [%d] %s", err->code, err->message); diff --git a/ffi/src/remote_server.rs b/ffi/src/remote_server.rs index 236c131..0646d11 100644 --- a/ffi/src/remote_server.rs +++ b/ffi/src/remote_server.rs @@ -83,7 +83,11 @@ pub unsafe extern "C" fn remote_server_connect_rsd( let handshake_ref = unsafe { &mut (*handshake).0 }; // Connect using the reference - RemoteServerClient::connect_rsd(provider_ref, handshake_ref).await + let mut rs_client = + RemoteServerClient::connect_rsd(provider_ref, handshake_ref).await?; + // TODO: remove this when we can read from the remote server, or rethink the Rust API + rs_client.read_message(0).await?; + Ok(rs_client) }); match res {