multimediacommsengine/tsrc/testdriver/testclient/net/src/CTcBtConnection.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation
       
    15 *
       
    16 */
       
    17 
       
    18 #include <bt_sock.h>
       
    19 
       
    20 #include "CTcBtConnection.h"
       
    21 #include "debuglog.h"
       
    22 
       
    23 /// Protocol family name for Bluetooth RFCOMM
       
    24 _LIT( KTcRFComm, "RFCOMM" );
       
    25 
       
    26 CTcBtConnection::CTcBtConnection()
       
    27 	{
       
    28 	}
       
    29 
       
    30 CTcBtConnection::~CTcBtConnection()
       
    31 	{
       
    32 	}
       
    33 
       
    34 void CTcBtConnection::SetupPortL()
       
    35 	{
       
    36 	LOG( _L("CTcBtConnection::SetupPortL()") );
       
    37 
       
    38 	// Open listening RFCOMM socket
       
    39 	User::LeaveIfError( iListeningSocket.Open( *iSocketServ, KTcRFComm ) );
       
    40 
       
    41 	// Get free RFCOMM port # and store it to iLocalPort
       
    42 	User::LeaveIfError( iListeningSocket.GetOpt( KRFCOMMGetAvailableServerChannel,
       
    43 												 KSolBtRFCOMM,
       
    44 												 iLocalPort ) );
       
    45 
       
    46 	LOG( _L("CTcBtConnection::ConnectL() done") );
       
    47 	}