|
1 // Copyright (c) 2005-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 // |
|
15 |
|
16 #ifndef _VENDORSAP_H |
|
17 #define _VENDORSAP_H |
|
18 |
|
19 #include <es_prot.h> |
|
20 #include <bluetooth/hci/hciframe.h> |
|
21 |
|
22 class CLinkMgrProtocol; |
|
23 |
|
24 NONSHARABLE_CLASS(CVendorSAP) : public CServProviderBase |
|
25 { |
|
26 public: |
|
27 static CVendorSAP* NewL(CLinkMgrProtocol& aProtocol); |
|
28 ~CVendorSAP(); |
|
29 |
|
30 // from SAP |
|
31 virtual void Start(); |
|
32 virtual void LocalName(TSockAddr& anAddr) const ; |
|
33 virtual TInt SetLocalName(TSockAddr& anAddr); |
|
34 virtual void RemName(TSockAddr& anAddr) const ; |
|
35 virtual TInt SetRemName(TSockAddr& anAddr); |
|
36 virtual TInt GetOption(TUint level,TUint name,TDes8& anOption)const ; |
|
37 virtual void Ioctl(TUint level,TUint name,TDes8* anOption); |
|
38 virtual void CancelIoctl(TUint aLevel,TUint aName); |
|
39 virtual TInt SetOption(TUint level,TUint name,const TDesC8 &anOption); |
|
40 virtual void ActiveOpen(); |
|
41 virtual void ActiveOpen(const TDesC8& aConnectionData); |
|
42 virtual TInt PassiveOpen(TUint aQueSize); |
|
43 virtual TInt PassiveOpen(TUint aQueSize,const TDesC8& aConnectionData); |
|
44 virtual void Shutdown(TCloseType option); |
|
45 virtual void Shutdown(TCloseType option,const TDesC8& aDisconnectionData); |
|
46 virtual void AutoBind(); |
|
47 TUint Write(const TDesC8& aDesc,TUint aOptions, TSockAddr* aAddr); |
|
48 void GetData(TDes8& aDesc,TUint options,TSockAddr* anAddr=NULL); |
|
49 |
|
50 // for HCIFacade |
|
51 void VendorCommandCompleteEvent(TInt aErr, const TDesC8* aEvent); |
|
52 void VendorDebugEvent(TInt aErr, const TDesC8* aEvent); |
|
53 //From CServProviderBase |
|
54 TInt SecurityCheck(MProvdSecurityChecker *aSecurityChecker); |
|
55 |
|
56 protected: |
|
57 //Mixin providing security checking, This is not an owned variable. |
|
58 MProvdSecurityChecker* iSecurityChecker; |
|
59 |
|
60 private: |
|
61 CVendorSAP(CLinkMgrProtocol& aProtocol); |
|
62 void NotifyIoctlComplete(TInt aErr, TUint aLevel, TUint aName, const TDesC8* aBuffer); |
|
63 |
|
64 TUint iIoctlName; |
|
65 TUint iIoctlLevel; |
|
66 |
|
67 // struct for queing the events |
|
68 struct TVendorDebugEvent |
|
69 { |
|
70 TBuf8<CHctlCommandFrame::KHCIMaxCommandLength> iEventBuf; // max is per H1 spec |
|
71 TInt iEventError; |
|
72 TDblQueLink iEventLink; |
|
73 }; |
|
74 |
|
75 TDblQue<TVendorDebugEvent> iDebugEventQueue; //queue for vendor specific events |
|
76 CLinkMgrProtocol& iProtocol; |
|
77 |
|
78 |
|
79 TVendorDebugEvent* NewDebugEventData(const TDesC8& aBuf, TInt aError); |
|
80 void TryToCompleteVendorDebugEventIoctl(); |
|
81 }; |
|
82 |
|
83 #endif // _VENDORSAP_H |