Enqueue communication request and wait for reply.

Namespace:  AForge.Robotics.Surveyor
Assembly:  AForge.Robotics.Surveyor (in AForge.Robotics.Surveyor.dll) Version: (


public int SendAndReceive(
	byte[] request,
	byte[] responseBuffer


Type: array< System..::.Byte >[]()[]
Array of bytes (command) to send to SRV-1 Blackfin robot/camera.
Type: array< System..::.Byte >[]()[]
Buffer to read response into.

Return Value

Returns total bytes read into the response buffer.


The method puts specified command into communication queue and waits until the command is sent to SRV-1 Blackfin robot and reply is received.

Note:If SRV-1 responds with more data than response buffer can fit, then the response buffer will take all the data it can store, but the rest of response will be discarded. The only exception is image request - if response buffer is too small to fit image response, then IndexOutOfRangeException exception is thrown. It is user's responsibility to provide response buffer of the correct size. Check definition of the SRV-1 Control Protocol for information about supported commands and responses.


AForge..::.NotConnectedExceptionNot connected to SRV-1.
AForge..::.ConnectionLostExceptionConnection lost or communicaton failure.
System..::.IndexOutOfRangeExceptionResponse buffer is too small.

See Also