Package org.robovm.libimobiledevice
Class DebugServerClient
java.lang.Object
org.robovm.libimobiledevice.DebugServerClient
- All Implemented Interfaces:
java.lang.AutoCloseable
public class DebugServerClient
extends java.lang.Object
implements java.lang.AutoCloseable
Handles connection with debugserver running on device
-
Field Summary
Fields Modifier and Type Field Description protected DebugServerClientRefref -
Constructor Summary
Constructors Constructor Description DebugServerClient(IDevice device, java.lang.String label)Creates a newDebugServerClientfor the specifiedIDevice.DebugServerClient(IDevice device, LockdowndServiceDescriptorStruct descriptor)Creates a newDebugServerClientfor the specifiedIDevice.DebugServerClient(IDevice device, LockdowndServiceDescriptor descriptor)Creates a newDebugServerClientfor the specifiedIDevice. -
Method Summary
Modifier and Type Method Description protected voidcheckDisposed()voidclose()voiddispose()protected DebugServerClientRefgetRef()intreceive(byte[] buffer, int offset, int count, int timeout)Receives data from the device.intsend(byte[] buffer, int offset, int count)Sends data to the device using connection behind this DebugServerClient.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
ref
-
-
Constructor Details
-
DebugServerClient
Creates a newDebugServerClientfor the specifiedIDevice.- Parameters:
device- the device to create aDebugServerClientfor.label- the label to use for communication. Usually the program name. Passnullto disable sending the label in requests to lockdownd.
-
DebugServerClient
Creates a newDebugServerClientfor the specifiedIDevice.- Parameters:
device- the device to create aDebugServerClientfor.descriptor- LockdownService descriptor of opened DebugServer service
-
DebugServerClient
Creates a newDebugServerClientfor the specifiedIDevice.- Parameters:
device- the device to create aDebugServerClientfor.descriptor- LockdownService descriptor struct of opened DebugServer service
-
-
Method Details
-
getRef
-
checkDisposed
protected final void checkDisposed() -
dispose
public void dispose() -
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable
-
send
public int send(byte[] buffer, int offset, int count)Sends data to the device using connection behind this DebugServerClient.- Parameters:
buffer- the buffer to be sent.offset- the start position inbufferfrom where to get bytes.count- the number of bytes frombufferto send.- Returns:
- the number of bytes actually sent.
-
receive
public int receive(byte[] buffer, int offset, int count, int timeout)Receives data from the device. Returns after the given timeout even if no data has been received.- Parameters:
buffer- the byte array in which to store the received data.offset- the initial position inbufferto store the received bytes.count- the maximum number of bytes to store inbuffer.timeout- timeout in milliseconds after which this method will return even if no data has been received.- Returns:
- the number of bytes received.
-