bluetoothmgmt/bluetoothclientlib/btlib/l2sock.cpp
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Implements the TL2CAPSockAddr to TSockAddr munging
       
    15 // This is because all ESOCK functions that take a TSockAddr will only
       
    16 // pass sizeof(TSockAddr) bytes through.
       
    17 // 
       
    18 //
       
    19 
       
    20 #include <bt_sock.h>
       
    21 
       
    22 EXPORT_C TL2CAPSockAddr::TL2CAPSockAddr()
       
    23 /** Constructor
       
    24 */
       
    25 	{
       
    26 	}
       
    27 
       
    28 EXPORT_C TL2CAPSockAddr::TL2CAPSockAddr(const TSockAddr &aAddr)
       
    29 	: TBTSockAddr(aAddr)
       
    30 /** Construct from a BT address.
       
    31 @param aAddr BT address used to populate the object.
       
    32 */
       
    33 	{
       
    34 	}
       
    35 
       
    36 EXPORT_C TL2CAPSockAddr& TL2CAPSockAddr::Cast(const TSockAddr &aAddr)
       
    37 	{
       
    38 	return *((TL2CAPSockAddr *)&aAddr);
       
    39 	}
       
    40 
       
    41 EXPORT_C TUint16 TL2CAPSockAddr::Port() const
       
    42 	{
       
    43 	return static_cast<TUint16>(TSockAddr::Port());
       
    44 	}
       
    45 
       
    46 EXPORT_C void TL2CAPSockAddr::SetPort(const TUint16 aHomePort)
       
    47 	{
       
    48 	TSockAddr::SetPort(aHomePort);
       
    49 	}
       
    50 
       
    51 // EOF