|
1 /* |
|
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef BTGPSDEVICEINFOHANDLER_H |
|
22 #define BTGPSDEVICEINFOHANDLER_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include "btgpsdevman.h" |
|
27 #include "BTGPSConnectManagerExt.h" |
|
28 #include <bt_sock.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MBTGPSConnectManagerExt; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * The handler that handles finding bonded BT devices. This class is responsible |
|
37 * to find if the device in device manager is paired. If the device is paired, |
|
38 * KErrNone is returned through MBTGPSConnectManagerExt interface. If it's not |
|
39 * paired or any other failure, KErrNotFound is returned. |
|
40 * |
|
41 */ |
|
42 class CBTGPSDeviceInfoHandler: public CBase, private MBTGPSDevManObserver |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Two-phase construction. |
|
48 */ |
|
49 static CBTGPSDeviceInfoHandler* NewL( |
|
50 MBTGPSConnectManagerExt& aManagerExt); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 virtual ~CBTGPSDeviceInfoHandler(); |
|
56 |
|
57 private: |
|
58 /** |
|
59 * from MBTGPSDevManObserver |
|
60 */ |
|
61 virtual void HandleGetDevicesComplete(TInt aErr, RBTDeviceArray* aDeviceArray); |
|
62 |
|
63 /** |
|
64 * from MBTGPSDevManObserver |
|
65 */ |
|
66 virtual void HandleAddDeviceComplete(TInt aErr); |
|
67 |
|
68 /** |
|
69 * from MBTGPSDevManObserver |
|
70 */ |
|
71 virtual void HandleDeleteDevicesComplete(TInt aErr); |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 * Second phase of the construction |
|
77 */ |
|
78 void ConstructL(); |
|
79 |
|
80 /** |
|
81 * Private constructor |
|
82 * @param aManagerExt Reference to manager ext |
|
83 */ |
|
84 CBTGPSDeviceInfoHandler( |
|
85 MBTGPSConnectManagerExt& aManagerExt); |
|
86 |
|
87 /** |
|
88 * Handler complete static callback function |
|
89 * @param aAny Pointer to this |
|
90 */ |
|
91 static TInt HandlerCompleteCallback(TAny* aAny); |
|
92 |
|
93 /** |
|
94 * Handler complete notify function |
|
95 */ |
|
96 void HandlerCompleteNotify(); |
|
97 |
|
98 private: |
|
99 //Manager Ext |
|
100 MBTGPSConnectManagerExt& iManagerExt; |
|
101 |
|
102 //BT Device Manager |
|
103 CBTGPSDevMan* iBtDevMan; |
|
104 |
|
105 // result array needed when using CBTGPSDevMan |
|
106 RBTDeviceArray* iDeviceArray; |
|
107 |
|
108 //complet idle object |
|
109 CIdle* iIdle; |
|
110 |
|
111 |
|
112 //BT Scoket addr |
|
113 TBTSockAddr iBtSockAddr; |
|
114 |
|
115 //BT address validity |
|
116 TInt iValid; |
|
117 |
|
118 //Operation error code |
|
119 TInt iErrCode; |
|
120 |
|
121 }; |
|
122 #endif |
|
123 |
|
124 // End of File |
|
125 |