|
1 // Copyright (c) 2004-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 // This deals with all the signalling packets that are global to the L2CAP entity. |
|
15 // i.e., Echo Request / Response, Information Request / Response |
|
16 // |
|
17 // |
|
18 |
|
19 #ifndef L2CAPLINKSIGNALHANDLER_H |
|
20 #define L2CAPLINKSIGNALHANDLER_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 |
|
25 #include "l2capSignalHandler.h" |
|
26 #include "l2capEntityConfig.h" |
|
27 |
|
28 |
|
29 class TL2CAPEntityConfig; |
|
30 class CL2CAPProtocol; |
|
31 class MEchoResponseHandler; |
|
32 |
|
33 NONSHARABLE_CLASS(CL2CapLinkSignalHandler) : public CL2CapSignalHandler |
|
34 { |
|
35 public: |
|
36 static CL2CapLinkSignalHandler* NewL(CL2CAPMux* aMuxer); |
|
37 ~CL2CapLinkSignalHandler(); |
|
38 |
|
39 virtual TInt ConstructInformationRequest(TInfoType aInfoType); |
|
40 TInt ConstructEchoRequest(const TDes8* aData, MEchoResponseHandler& aEchoResponseHandler); |
|
41 void DeregisterOutstandingEchoRequests(MEchoResponseHandler& aEchoResponseHandler); |
|
42 |
|
43 void Error(TInt aErrorCode, MSocketNotify::TOperationBitmasks aErrorAction); |
|
44 void LinkUp(); |
|
45 |
|
46 void CommandResponseFailure(HL2CapCommand* aCommand); |
|
47 |
|
48 inline TUint16 SigMTU() const; |
|
49 inline TL2CAPEntityConfig& PeerEntityConfig(); //const; |
|
50 |
|
51 private: |
|
52 void ConstructL(); |
|
53 |
|
54 CL2CapLinkSignalHandler(CL2CAPMux* aMuxer); |
|
55 TBool HandleConnectionRequest(HConnectionRequest* aConnectionRequest); |
|
56 TBool HandleEchoResponse(HEchoResponse* aEchoResponse); |
|
57 TBool HandleEchoRequest(HEchoRequest* aEchoRequest); |
|
58 TBool HandleInformationRequest(HInformationRequest* aInformationRequest); |
|
59 TBool HandleInformationResponse(HInformationResponse* aInformationResponse); |
|
60 TBool HandleCommandReject(HCommandReject* aCommandReject); |
|
61 TBool HandleInvalidCommand(HInvalidCommand* aInvalidCommand); |
|
62 |
|
63 // Un-handled SAP signal handler commands. |
|
64 TBool HandleConnectionResponse(HConnectionResponse* aConnectionResponse); |
|
65 TBool HandleConfigureRequest(HConfigureRequest* aConfigRequest); |
|
66 TBool HandleConfigureResponse(HConfigureResponse* aConfigResponse); |
|
67 TBool HandleDisconnectRequest(HDisconnectRequest* aDisconnectRequest); |
|
68 TBool HandleDisconnectResponse(HDisconnectResponse* aDisconnectResponse); |
|
69 |
|
70 void PendingCommandsDrained(); |
|
71 |
|
72 private: |
|
73 TL2CAPEntityConfig iPeerL2CapEntityConfig; |
|
74 |
|
75 TUint16 iSigMTU; |
|
76 }; |
|
77 |
|
78 inline TUint16 CL2CapLinkSignalHandler::SigMTU() const |
|
79 { |
|
80 return iSigMTU; |
|
81 } |
|
82 |
|
83 TL2CAPEntityConfig& CL2CapLinkSignalHandler::PeerEntityConfig() //const |
|
84 { |
|
85 return iPeerL2CapEntityConfig; |
|
86 } |
|
87 |
|
88 |
|
89 #endif |