Bluetooth Framework C++ Edition

◆ Listen()

int Listen ( const GUID &  Service,
const tstring ServiceName = _T(""),
const unsigned char  Channel = 0,
const bool  Authentication = true,
const bool  Encryption = false 
)

The method starts listening for client connections.

Parameters
ServiceThe Bluetooth Service UUID. If the Channel parameter is zero, the system attempts to use Service to resolve the remote channel corresponding to the service. The service class is a normalized 128-bit GUID, defined by the Bluetooth specification. Common GUIDs are defined by the Bluetooth Assigned Numbers document. Alternatively, a unique GUID may be used for a domain-specific application.
ServiceNameThe option service name.
ChannelThe RFCOMM channel number. If zero the Service UUID will be used.
AuthenticationSpecifies that authentication is required for a connect operation to complete successfully. Setting this option actively initiates authentication during connection establishment, if the two Bluetooth devices were not previously authenticated.
EncryptionThe option enforces encryption to establish a connection. Encryption is only available for authenticated connections.
Returns
If the function succeed the return value is WCL_E_SUCCESS. Otherwise the method returns one of the WCL error codes.

NOTE: BlueSoleil has limited support for Authentication and Encryption.. Also it doe snot support user-defined RFCOMM channel number.