Class FileRelayNativeMethods
Inheritance
Inherited Members
Namespace: iMobileDevice.FileRelay
Assembly: iMobileDevice-net.dll
Syntax
public class FileRelayNativeMethods
Methods
file_relay_client_free(IntPtr)
Disconnects a file_relay client from the device and frees up the file_relay client data.
Declaration
public static FileRelayError file_relay_client_free(IntPtr client)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | client | The file_relay client to disconnect and free. |
Returns
Type | Description |
---|---|
FileRelayError | FILE_RELAY_E_SUCCESS on success, FILE_RELAY_E_INVALID_ARG when one of client or client->parent is invalid, or FILE_RELAY_E_UNKNOWN_ERROR when the was an error freeing the parent property_list_service client. |
file_relay_client_new(iDeviceHandle, LockdownServiceDescriptorHandle, out FileRelayClientHandle)
Connects to the file_relay service on the specified device.
Declaration
public static FileRelayError file_relay_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out FileRelayClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
LockdownServiceDescriptorHandle | service | The service descriptor returned by lockdownd_start_service. |
FileRelayClientHandle | client | Reference that will point to a newly allocated file_relay_client_t upon successful return. |
Returns
Type | Description |
---|---|
FileRelayError | FILE_RELAY_E_SUCCESS on success, FILE_RELAY_E_INVALID_ARG when one of the parameters is invalid, or FILE_RELAY_E_MUX_ERROR when the connection failed. |
file_relay_client_start_service(iDeviceHandle, out FileRelayClientHandle, String)
Starts a new file_relay service on the specified device and connects to it.
Declaration
public static FileRelayError file_relay_client_start_service(iDeviceHandle device, out FileRelayClientHandle client, string label)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
FileRelayClientHandle | client | Pointer that will point to a newly allocated file_relay_client_t upon successful return. Must be freed using file_relay_client_free() after use. |
System.String | label | The label to use for communication. Usually the program name. Pass NULL to disable sending the label in requests to lockdownd. |
Returns
Type | Description |
---|---|
FileRelayError | FILE_RELAY_E_SUCCESS on success, or an FILE_RELAY_E_* error code otherwise. |
file_relay_request_sources(FileRelayClientHandle, out IntPtr, out iDeviceConnectionHandle)
Request data for the given sources.
Declaration
public static FileRelayError file_relay_request_sources(FileRelayClientHandle client, out IntPtr sources, out iDeviceConnectionHandle connection)
Parameters
Type | Name | Description |
---|---|---|
FileRelayClientHandle | client | The connected file_relay client. |
System.IntPtr | sources | A NULL-terminated list of sources to retrieve. Valid sources are:
|
iDeviceConnectionHandle | connection | The connection that has to be used for receiving the data using idevice_connection_receive(). The connection will be closed automatically by the device, but use file_relay_client_free() to clean up properly. |
Returns
Type | Description |
---|---|
FileRelayError | FILE_RELAY_E_SUCCESS on succes, FILE_RELAY_E_INVALID_ARG when one or more parameters are invalid, FILE_RELAY_E_MUX_ERROR if a communication error occurs, FILE_RELAY_E_PLIST_ERROR when the received result is NULL or is not a valid plist, FILE_RELAY_E_INVALID_SOURCE if one or more sources are invalid, FILE_RELAY_E_STAGING_EMPTY if no data is available for the given sources, or FILE_RELAY_E_UNKNOWN_ERROR otherwise. |
Remarks
WARNING: Don't call this function without reading the data afterwards. A directory mobile_file_relay.XXXX used for creating the archive will remain in the /tmp directory otherwise.
file_relay_request_sources(FileRelayClientHandle, out String, out iDeviceConnectionHandle)
Declaration
public static FileRelayError file_relay_request_sources(FileRelayClientHandle client, out string sources, out iDeviceConnectionHandle connection)
Parameters
Type | Name | Description |
---|---|---|
FileRelayClientHandle | client | |
System.String | sources | |
iDeviceConnectionHandle | connection |
Returns
Type | Description |
---|---|
FileRelayError |
file_relay_request_sources_timeout(FileRelayClientHandle, out IntPtr, out iDeviceConnectionHandle, UInt32)
Request data for the given sources. Calls file_relay_request_sources_timeout() with a timeout of 60000 milliseconds (60 seconds).
Declaration
public static FileRelayError file_relay_request_sources_timeout(FileRelayClientHandle client, out IntPtr sources, out iDeviceConnectionHandle connection, uint timeout)
Parameters
Type | Name | Description |
---|---|---|
FileRelayClientHandle | client | The connected file_relay client. |
System.IntPtr | sources | A NULL-terminated list of sources to retrieve. Valid sources are:
|
iDeviceConnectionHandle | connection | The connection that has to be used for receiving the data using idevice_connection_receive(). The connection will be closed automatically by the device, but use file_relay_client_free() to clean up properly. |
System.UInt32 | timeout |
Returns
Type | Description |
---|---|
FileRelayError | FILE_RELAY_E_SUCCESS on succes, FILE_RELAY_E_INVALID_ARG when one or more parameters are invalid, FILE_RELAY_E_MUX_ERROR if a communication error occurs, FILE_RELAY_E_PLIST_ERROR when the received result is NULL or is not a valid plist, FILE_RELAY_E_INVALID_SOURCE if one or more sources are invalid, FILE_RELAY_E_STAGING_EMPTY if no data is available for the given sources, or FILE_RELAY_E_UNKNOWN_ERROR otherwise. |
Remarks
WARNING: Don't call this function without reading the data afterwards. A directory mobile_file_relay.XXXX used for creating the archive will remain in the /tmp directory otherwise.
file_relay_request_sources_timeout(FileRelayClientHandle, out String, out iDeviceConnectionHandle, UInt32)
Declaration
public static FileRelayError file_relay_request_sources_timeout(FileRelayClientHandle client, out string sources, out iDeviceConnectionHandle connection, uint timeout)
Parameters
Type | Name | Description |
---|---|---|
FileRelayClientHandle | client | |
System.String | sources | |
iDeviceConnectionHandle | connection | |
System.UInt32 | timeout |
Returns
Type | Description |
---|---|
FileRelayError |