mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Fix location simulation C example
This commit is contained in:
@@ -57,7 +57,6 @@ int main(int argc, char **argv) {
|
|||||||
CoreDeviceProxyHandle *core_device = NULL;
|
CoreDeviceProxyHandle *core_device = NULL;
|
||||||
err = core_device_proxy_connect(tcp_provider, &core_device);
|
err = core_device_proxy_connect(tcp_provider, &core_device);
|
||||||
idevice_provider_free(tcp_provider);
|
idevice_provider_free(tcp_provider);
|
||||||
idevice_pairing_file_free(pairing);
|
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
fprintf(stderr, "Failed to connect to CoreDeviceProxy: [%d] %s", err->code,
|
fprintf(stderr, "Failed to connect to CoreDeviceProxy: [%d] %s", err->code,
|
||||||
err->message);
|
err->message);
|
||||||
@@ -79,7 +78,6 @@ int main(int argc, char **argv) {
|
|||||||
// Create TCP adapter and connect to RSD port
|
// Create TCP adapter and connect to RSD port
|
||||||
AdapterHandle *adapter = NULL;
|
AdapterHandle *adapter = NULL;
|
||||||
err = core_device_proxy_create_tcp_adapter(core_device, &adapter);
|
err = core_device_proxy_create_tcp_adapter(core_device, &adapter);
|
||||||
core_device_proxy_free(core_device);
|
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
fprintf(stderr, "Failed to create TCP adapter: [%d] %s", err->code,
|
fprintf(stderr, "Failed to create TCP adapter: [%d] %s", err->code,
|
||||||
err->message);
|
err->message);
|
||||||
|
|||||||
@@ -83,7 +83,11 @@ pub unsafe extern "C" fn remote_server_connect_rsd(
|
|||||||
let handshake_ref = unsafe { &mut (*handshake).0 };
|
let handshake_ref = unsafe { &mut (*handshake).0 };
|
||||||
|
|
||||||
// Connect using the reference
|
// 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 {
|
match res {
|
||||||
|
|||||||
Reference in New Issue
Block a user