|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Retrieves accessory information from Bluetooth Accessory Server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BTACCINFOREQUESTER_H |
|
20 #define BTACCINFOREQUESTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <AsyCmdTypes.h> |
|
25 #include <bt_sock.h> |
|
26 #include "BTAccClient.h" |
|
27 #include "BTAccInfo.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class TAccInfo; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 class MBTAccInfoNotifier |
|
34 { |
|
35 public: |
|
36 virtual void GetBTAccInfoCompletedL(TInt aErr, const TASYBTAccInfo& aAccInfo) = 0; |
|
37 }; |
|
38 |
|
39 /** |
|
40 * Active object to fetch Acc Info from BTAccClient. |
|
41 * |
|
42 * @lib BTAccInfo.dll |
|
43 * @since Series 60 3.1 |
|
44 */ |
|
45 class CBTAccInfoRequester : public CActive |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 * @param aNotifier A reference used for call-back to BTAccInfoCmdHandler class |
|
52 * @return The created object. |
|
53 */ |
|
54 static CBTAccInfoRequester* NewL(MBTAccInfoNotifier& aNotifier); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CBTAccInfoRequester(); |
|
60 |
|
61 public: // New functions |
|
62 |
|
63 /** |
|
64 * Gets the info of a BT audio accessory |
|
65 * @since Series 60 3.1 |
|
66 * @param TBTDevAddr bluetooth device of the accessory |
|
67 * whose information is required |
|
68 */ |
|
69 void GetBTAccInfoL(const TBTDevAddr& aAddr); |
|
70 |
|
71 protected: // Functions from base classes |
|
72 |
|
73 /** |
|
74 * From CActive Handles an active object's request completion event. |
|
75 */ |
|
76 void RunL(); |
|
77 |
|
78 void DoCancel(); |
|
79 |
|
80 private: |
|
81 |
|
82 /** |
|
83 * C++ default constructor. |
|
84 * @param aNotifier A reference used for call-back to BTAccInfoCmdHandler class |
|
85 */ |
|
86 CBTAccInfoRequester(MBTAccInfoNotifier& aNotifier); |
|
87 |
|
88 private: // Data |
|
89 |
|
90 MBTAccInfoNotifier& iNotifier; // Store a reference to get a call-back to BTAccInfoCmdHandler class |
|
91 RBTAccClient iBTAccClient; // Call BT Acc Server component to retrieve information of an accessory |
|
92 |
|
93 TAccInfo iAccInfo; |
|
94 TPckg<TAccInfo> iAccInfoPckg; |
|
95 }; |
|
96 |
|
97 #endif // BTACCINFOREQUESTER_H |
|
98 |
|
99 // End of File |