57
|
1 |
/*
|
|
2 |
* Copyright (c) 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 |
#include "btxqsspdebugservice.h"
|
|
19 |
#include <btxqserviceapi.h>
|
|
20 |
#include <hbapplication.h>
|
|
21 |
#include <btengdomainpskeys.h>
|
|
22 |
#include <e32property.h>
|
|
23 |
|
|
24 |
|
|
25 |
BtxqSspDebugService::BtxqSspDebugService(QObject* parent)
|
|
26 |
: XQServiceProvider(BluetoothServiceToggleSspDebugMode,parent),
|
|
27 |
mCurrentRequestIndex(0),
|
|
28 |
mError(0)
|
|
29 |
{
|
|
30 |
publishAll();
|
|
31 |
connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
|
|
32 |
}
|
|
33 |
|
|
34 |
BtxqSspDebugService::~BtxqSspDebugService()
|
|
35 |
{
|
|
36 |
|
|
37 |
}
|
|
38 |
|
|
39 |
void BtxqSspDebugService::toggleSspDebugMode()
|
|
40 |
{
|
|
41 |
mCurrentRequestIndex = setCurrentRequestAsync();
|
|
42 |
|
|
43 |
TInt sspDebugMode( EBTSspDebugModeOff );
|
|
44 |
|
|
45 |
// Get current status
|
|
46 |
TInt err = RProperty::Get( KPSUidBluetoothDutMode, KBTSspDebugmode,
|
|
47 |
sspDebugMode );
|
|
48 |
|
|
49 |
if ( !err )
|
|
50 |
{
|
|
51 |
if( sspDebugMode == EBTDutOff )
|
|
52 |
{
|
|
53 |
// The Ssp debug mode is turned off, turn it on.
|
|
54 |
err = RProperty::Set( KPSUidBluetoothDutMode,
|
|
55 |
KBTSspDebugmode,
|
|
56 |
EBTSspDebugModeOn );
|
|
57 |
}
|
|
58 |
else
|
|
59 |
{
|
|
60 |
// The Ssp debug mode is turned on, turn it off.
|
|
61 |
err = RProperty::Set( KPSUidBluetoothDutMode,
|
|
62 |
KBTSspDebugmode,
|
|
63 |
EBTSspDebugModeOff );
|
|
64 |
}
|
|
65 |
}
|
|
66 |
|
|
67 |
mError = err;
|
|
68 |
|
|
69 |
// Complete the service request with error code, if any.
|
|
70 |
QVariant retVal(mError);
|
|
71 |
completeRequest(mCurrentRequestIndex, retVal);
|
|
72 |
}
|