C# Class SharpAdbClient.AdbSocket

Implements a client for the Android Debug Bridge client-server protocol. Using the client, you can send messages to and receive messages from the Android Debug Bridge.

The AdbSocket class implements the raw messaging protocol; that is, sending and receiving messages. For interacting with the services the Android Debug Bridge exposes, use the AdbClient.

For more information about the protocol that is implemented here, see chapter II Protocol Details, section 1. Client <->Server protocol at .

Inheritance: IAdbSocket, IDisposable
ファイルを表示 Open project: ArduPilot/MissionPlanner

Public Methods

Method Description
AdbSocket ( EndPoint endPoint ) : Exceptions

Initializes a new instance of the AdbSocket class.

AdbSocket ( ITcpSocket socket ) : Exceptions

Initializes a new instance of the AdbSocket class.

Close ( ) : void
Dispose ( ) : void

Releases all resources used by the current instance of the AdbSocket class.

GetShellStream ( ) : Stream
IsOkay ( byte reply ) : bool

Determines whether the specified reply is okay.

Read ( byte data ) : void
Read ( byte data, int length ) : void
ReadAdbResponse ( ) : SharpAdbClient.AdbResponse
ReadString ( ) : string
ReadSyncLength ( ) : int
ReadSyncResponse ( ) : SyncCommand
ReadSyncString ( int length ) : string
Reconnect ( ) : void
Send ( byte data, int length ) : void
SendAdbRequest ( string request ) : void
SendSyncRequest ( SyncCommand command, int length ) : void
SendSyncRequest ( SyncCommand command, string path ) : void
SendSyncRequest ( SyncCommand command, string path, int permissions ) : void

Protected Methods

Method Description
ReadAdbResponseInner ( ) : SharpAdbClient.AdbResponse

Reads the response from ADB after a command.

ReplyToString ( byte reply ) : string

Converts an ADB reply to a string.

Write ( byte data ) : bool

Write until all data in "data" is written or the connection fails or times out.

This uses the default time out value.

Method Details

AdbSocket() public method

Initializes a new instance of the AdbSocket class.
public AdbSocket ( EndPoint endPoint ) : Exceptions
endPoint System.Net.EndPoint /// The at which the Android Debug Bridge is listening /// for clients. ///
return Exceptions

AdbSocket() public method

Initializes a new instance of the AdbSocket class.
public AdbSocket ( ITcpSocket socket ) : Exceptions
socket ITcpSocket /// The at which the Android Debug Bridge is listening /// for clients. ///
return Exceptions

Close() public method

public Close ( ) : void
return void

Dispose() public method

Releases all resources used by the current instance of the AdbSocket class.
public Dispose ( ) : void
return void

GetShellStream() public method

public GetShellStream ( ) : Stream
return Stream

IsOkay() public static method

Determines whether the specified reply is okay.
public static IsOkay ( byte reply ) : bool
reply byte The reply.
return bool

Read() public method

public Read ( byte data ) : void
data byte
return void

Read() public method

public Read ( byte data, int length ) : void
data byte
length int
return void

ReadAdbResponse() public method

public ReadAdbResponse ( ) : SharpAdbClient.AdbResponse
return SharpAdbClient.AdbResponse

ReadAdbResponseInner() protected method

Reads the response from ADB after a command.
protected ReadAdbResponseInner ( ) : SharpAdbClient.AdbResponse
return SharpAdbClient.AdbResponse

ReadString() public method

public ReadString ( ) : string
return string

ReadSyncLength() public method

public ReadSyncLength ( ) : int
return int

ReadSyncResponse() public method

public ReadSyncResponse ( ) : SyncCommand
return SyncCommand

ReadSyncString() public method

public ReadSyncString ( int length ) : string
length int
return string

Reconnect() public method

public Reconnect ( ) : void
return void

ReplyToString() protected method

Converts an ADB reply to a string.
protected ReplyToString ( byte reply ) : string
reply byte /// A array that represents the ADB reply. ///
return string

Send() public method

public Send ( byte data, int length ) : void
data byte
length int
return void

SendAdbRequest() public method

public SendAdbRequest ( string request ) : void
request string
return void

SendSyncRequest() public method

public SendSyncRequest ( SyncCommand command, int length ) : void
command SyncCommand
length int
return void

SendSyncRequest() public method

public SendSyncRequest ( SyncCommand command, string path ) : void
command SyncCommand
path string
return void

SendSyncRequest() public method

public SendSyncRequest ( SyncCommand command, string path, int permissions ) : void
command SyncCommand
path string
permissions int
return void

Write() protected method

Write until all data in "data" is written or the connection fails or times out.
This uses the default time out value.
protected Write ( byte data ) : bool
data byte The data to send.
return bool