bluetoothmgmt/bluetoothclientlib/btlib/btsynclinkhelpers.h
changeset 0 29b1cd4cb562
child 22 786b94c6f0a4
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2003-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 // BT Synchronous link active object helpers
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef BTSYNCLINKHELPERS_H
       
    19 #define BTSYNCLINKHELPERS_H
       
    20 
       
    21 #include <bluetooth/btscoparams.h>
       
    22 
       
    23 NONSHARABLE_CLASS(CBTSynchronousLinkBaseband) : public CActive
       
    24 	{
       
    25 public:
       
    26 	static CBTSynchronousLinkBaseband* NewL(CBluetoothSynchronousLink& aParent);
       
    27 	~CBTSynchronousLinkBaseband();
       
    28 	
       
    29 	void CatchEvents();
       
    30 	void PreventPark();
       
    31 	void StopAll();
       
    32 	
       
    33 private:
       
    34 	CBTSynchronousLinkBaseband(CBluetoothSynchronousLink& aParent);
       
    35 	void ConstructL();
       
    36 	void DoCancel();
       
    37 	void RunL();
       
    38 	TInt RunError(TInt aError);
       
    39 	
       
    40 	CBluetoothSynchronousLink&	iParent;
       
    41 	TBTBasebandEvent			iEvent;
       
    42 	};
       
    43 
       
    44 //CBluetoothSynchronousLink Active Objects...
       
    45 NONSHARABLE_CLASS(CBTSynchronousLinkAttacher) : public CActive
       
    46 	{
       
    47 public:
       
    48 	static CBTSynchronousLinkAttacher* NewL(CBluetoothSynchronousLink& aParent, TSCOType aSCOType);
       
    49 	~CBTSynchronousLinkAttacher();
       
    50 
       
    51 	void AttachSCOLink(TBTSockAddr& aSockAddr);
       
    52 
       
    53 
       
    54 private:
       
    55 	CBTSynchronousLinkAttacher(CBluetoothSynchronousLink& aParent, TSCOType aSCOTypes);
       
    56 	void ConstructL();
       
    57 	void DoCancel();
       
    58 	void RunL();
       
    59 	TInt RunError(TInt aError);
       
    60 
       
    61 	CBluetoothSynchronousLink& iParent;
       
    62 	
       
    63 	TSCOType iSCOType;
       
    64 	};
       
    65 
       
    66 
       
    67 NONSHARABLE_CLASS(CBTSynchronousLinkDetacher) : public CActive
       
    68 	{
       
    69 public:
       
    70 	static CBTSynchronousLinkDetacher* NewL(CBluetoothSynchronousLink& aParent, TSCOType aSCOTypes);
       
    71 	~CBTSynchronousLinkDetacher();
       
    72 
       
    73 	void DetachSCOLink(const TDesC8& aDesOut, TDes8& aDesIn);
       
    74 
       
    75 
       
    76 private:
       
    77 	CBTSynchronousLinkDetacher(CBluetoothSynchronousLink& aParent, TSCOType aSCOTypes);
       
    78 	void ConstructL();
       
    79 	void DoCancel();
       
    80 	void RunL();
       
    81 	TInt RunError(TInt aError);
       
    82 
       
    83 	CBluetoothSynchronousLink& iParent;
       
    84 	TBuf8<1> iDummySCOShutdownDescriptor;
       
    85 	
       
    86 	TSCOType iSCOType;
       
    87 	};
       
    88 
       
    89 
       
    90 NONSHARABLE_CLASS(CBTSynchronousLinkAccepter) : public CActive
       
    91 	{
       
    92 public:
       
    93 	static CBTSynchronousLinkAccepter* NewL(CBluetoothSynchronousLink& aParent, TSCOType aSCOType);
       
    94 	~CBTSynchronousLinkAccepter();
       
    95 
       
    96 	void Accept(RSocket& aSocket);
       
    97 
       
    98 
       
    99 private:
       
   100 	CBTSynchronousLinkAccepter(CBluetoothSynchronousLink& aParent, TSCOType aSCOType);
       
   101 	void ConstructL();
       
   102 	void DoCancel();
       
   103 	void RunL();
       
   104 	TInt RunError(TInt aError);
       
   105 
       
   106 	CBluetoothSynchronousLink& iParent;
       
   107 	
       
   108 	TSCOType iSCOType;
       
   109 	};
       
   110 
       
   111 
       
   112 NONSHARABLE_CLASS(CBTSynchronousLinkSender) : public CActive
       
   113 	{
       
   114 public:
       
   115 	static CBTSynchronousLinkSender* NewL(CBluetoothSynchronousLink& aParent, TSCOType aSCOType);
       
   116 	~CBTSynchronousLinkSender();
       
   117 
       
   118 	void SendSCOData(const TDesC8& aSCOData);
       
   119 
       
   120 
       
   121 private:
       
   122 	CBTSynchronousLinkSender(CBluetoothSynchronousLink& aParent, TSCOType aSCOType);
       
   123 	void ConstructL();
       
   124 	void DoCancel();
       
   125 	void RunL();
       
   126 	TInt RunError(TInt aError);
       
   127 
       
   128 	CBluetoothSynchronousLink& iParent;
       
   129 	
       
   130 	TSCOType iSCOType;
       
   131 	};
       
   132 
       
   133 
       
   134 NONSHARABLE_CLASS(CBTSynchronousLinkReceiver) : public CActive
       
   135 	{
       
   136 public:
       
   137 	static CBTSynchronousLinkReceiver* NewL(CBluetoothSynchronousLink& aParent, TSCOType aSCOType);
       
   138 	~CBTSynchronousLinkReceiver();
       
   139 
       
   140 	void ReadSCOData(TDes8& aDesc);
       
   141 
       
   142 
       
   143 private:
       
   144 	CBTSynchronousLinkReceiver(CBluetoothSynchronousLink& aParent, TSCOType aSCOTypes);
       
   145 	void ConstructL();
       
   146 	void DoCancel();
       
   147 	void RunL();
       
   148 	TInt RunError(TInt aError);
       
   149 
       
   150 	CBluetoothSynchronousLink& iParent;
       
   151 	
       
   152 	TSCOType iSCOType;
       
   153 	};
       
   154 
       
   155 #endif