|
1 /* |
|
2 * Copyright (c) 2002 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: Btserviceutils API implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "BTServiceAPI.h" |
|
22 #include "BTServiceStarter.h" |
|
23 #include "BTSUDebug.h" |
|
24 |
|
25 // CONSTANTS |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS =============================== |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CBTServiceAPI::CBTServiceAPI |
|
31 // C++ default constructor can NOT contain any code, that |
|
32 // might leave. |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 CBTServiceAPI::CBTServiceAPI() |
|
36 { |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CBTServiceAPI::ConstructL |
|
41 // Symbian 2nd phase constructor can leave. |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 void CBTServiceAPI::ConstructL() |
|
45 { |
|
46 FLOG(_L("[BTSU]\t CBTServiceAPI::ConstructL()")); |
|
47 iStarter = CBTServiceStarter::NewL(); |
|
48 } |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CBTServiceAPI::NewL |
|
52 // Two-phased constructor. |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 EXPORT_C CBTServiceAPI* CBTServiceAPI::NewL() |
|
56 { |
|
57 CBTServiceAPI* self = new( ELeave ) CBTServiceAPI(); |
|
58 CleanupStack::PushL( self ); |
|
59 self->ConstructL(); |
|
60 CleanupStack::Pop(); |
|
61 return self; |
|
62 } |
|
63 |
|
64 // Destructor |
|
65 CBTServiceAPI::~CBTServiceAPI() |
|
66 { |
|
67 FLOG(_L("[BTSU]\t CBTServiceAPI::Destructor()")); |
|
68 if ( iStarter ) |
|
69 { |
|
70 delete iStarter; |
|
71 } |
|
72 FLOG(_L("[BTSU]\t CBTServiceAPI::Destructor() completed")); |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CBTServiceAPI::StartServiceL |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 EXPORT_C void CBTServiceAPI::StartServiceL( TBTServiceType aService, |
|
80 CBTServiceParameterList* aList ) |
|
81 { |
|
82 FLOG(_L("[BTSU]\t CBTServiceAPI::StartServiceL()")); |
|
83 |
|
84 iStarter->StartServiceL( aService, aList ); |
|
85 |
|
86 FLOG(_L("[BTSU]\t CBTServiceAPI::StartServiceL() completed")); |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CBTServiceAPI::StartSynchronousServiceL |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 EXPORT_C void CBTServiceAPI::StartSynchronousServiceL( TBTServiceType aService, |
|
94 CBTServiceParameterList* aList ) |
|
95 { |
|
96 FLOG(_L("[BTSU]\t CBTServiceAPI::StartSynchronousServiceL()")); |
|
97 |
|
98 iStarter->StartServiceL( aService, aList, &iSyncWaiter); |
|
99 |
|
100 |
|
101 FLOG(_L("[BTSU]\t CBTServiceAPI::StartSynchronousServiceL() Wait for completion")) |
|
102 iSyncWaiter.Start(); |
|
103 |
|
104 FLOG(_L("[BTSU]\t CBTServiceAPI::StartSynchronousServiceL() completed")); |
|
105 } |
|
106 |
|
107 // End of File |