Serial Framework C++ Edition

◆ Connect()

int Connect ( const GUID &  Target,
const GUID &  Who,
const tstring &  Description,
const unsigned short  PacketSize 
)
protected

Connects to an OBEX server.

Parameters
TargetSpecifies the UUID of the desired application. If the Target is not used it must be set to NULL GUID.
WhoCan also be used when it is necessary to identify the client initiating the exchange. If the Who is not used it must be set to NULL GUID.
DescriptionProvides an information about the device or service. If the Description is not used it must be set to an empty string.
PacketSizeThe maximum OBEX packet size. The minimum allowed value is 0x00FF.
Returns
If the function succeed the return value is WCL_E_SUCCESS. Otherwise the method returns one of the WCL error codes.

Target and Who are used to hold a unique identifier, which allows applications to tell whether they are talking to a strict peer, or not. Typically, this is used to enable additional capabilities supplied only by an exact peer.

On full-featured [PC] platforms, multiple OBEX applications may exist concurrently. This leads to the need for the client to be able to uniquely identify which server it wants to handle its request. The server is therefore identified with the OBEX Target header. If necessary, the client can also identify itself, using the OBEX Who header. The following text describes the exact uses of these headers.

To target a specific application with OBEX commands the client must set-up a connection to the application by using the OBEX Target header in a CONNECT request. This type of connection is called a directed connection and provides a virtual binding between the client and server. The Target header should specify the UUID of the desired application. The Who header can also be used when it is necessary to identify the client initiating the exchange. The Who header should be used in cases where the target server application supports different client applications and may care which one it is connecting to. It is unnecessary to send a Who header in the request if its only logical value is the same as the Target header.