bthci/hci2implementations/hctls/usb_original/hctl/public/hctlusboriginalcli.h
changeset 27 83036355c0f3
equal deleted inserted replaced
4:28479eeba3fb 27:83036355c0f3
       
     1 // Copyright (c) 2007-2010 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 // 
       
    15 
       
    16 /**
       
    17 @file
       
    18 @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef HCTLUSBORIGINALCLI_H
       
    22 #define HCTLUSBORIGINALCLI_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <hctlusboriginalipc.h>
       
    26 
       
    27 NONSHARABLE_CLASS(RHCTLUsbOriginal) : public RSessionBase
       
    28 	{
       
    29 public:
       
    30 	inline RHCTLUsbOriginal();
       
    31 
       
    32 	inline TInt Connect();
       
    33 	inline void Close();
       
    34 
       
    35 	inline TInt DeviceAttached(TUint32 aAclToken, TUint32 aScoToken);
       
    36 	inline void DeviceDetached();
       
    37 
       
    38 private:
       
    39 	TAny* iExtension;
       
    40 	};
       
    41 
       
    42 
       
    43 inline RHCTLUsbOriginal::RHCTLUsbOriginal()
       
    44 	: iExtension(NULL)
       
    45 	{}
       
    46 
       
    47 inline TInt RHCTLUsbOriginal::Connect()
       
    48 	{
       
    49 	// We don't want to start the server - that is a function of loading the bluetooth
       
    50 	// stack.  Instead we just want to try and connect and report on whether we succeeded.
       
    51 	return CreateSession(
       
    52 						KHCTLUsbOrginalSrvName,
       
    53 						TVersion(
       
    54 							KHCTLUsbOriginalSrvMajorVersionNumber,
       
    55 							KHCTLUsbOriginalSrvMinorVersionNumber,
       
    56 							KHCTLUsbOriginalSrvBuildNumber
       
    57 							)
       
    58 						);
       
    59 	}
       
    60 
       
    61 inline void RHCTLUsbOriginal::Close()
       
    62 	{
       
    63 	RSessionBase::Close();
       
    64 	}
       
    65 
       
    66 inline TInt RHCTLUsbOriginal::DeviceAttached(TUint32 aAclToken, TUint32 aScoToken)
       
    67 	{
       
    68 	return SendReceive(EFunctionAttached, TIpcArgs(aAclToken, aScoToken));
       
    69 	}
       
    70 
       
    71 inline void RHCTLUsbOriginal::DeviceDetached()
       
    72 	{
       
    73 	Send(EFunctionDetached);
       
    74 	}
       
    75 
       
    76 #endif // HCTLUSBORIGINALCLI_H