williamr@2
|
1 |
/**
|
williamr@2
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
* TRemoteLinkStatus
|
williamr@2
|
16 |
*
|
williamr@2
|
17 |
*
|
williamr@2
|
18 |
*/
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
/**
|
williamr@2
|
25 |
@file
|
williamr@2
|
26 |
@deprecated Obselete
|
williamr@2
|
27 |
*/
|
williamr@2
|
28 |
|
williamr@2
|
29 |
inline TRemoteLinkStatus::TRemoteLinkStatus()
|
williamr@2
|
30 |
/**
|
williamr@2
|
31 |
C++ constructor
|
williamr@2
|
32 |
*/
|
williamr@2
|
33 |
{ iStatus=EDisabled; iRemoteVersion=0; }
|
williamr@2
|
34 |
|
williamr@2
|
35 |
//////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
36 |
//
|
williamr@2
|
37 |
// RRemoteLink Deprecated methods
|
williamr@2
|
38 |
//
|
williamr@2
|
39 |
//////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
40 |
|
williamr@2
|
41 |
inline TInt RRemoteLink::Enable(TBps aBaud, const TDesC& aPort, const TDesC& aModule, TBool /*aLowPowerMode*/)
|
williamr@2
|
42 |
/**
|
williamr@2
|
43 |
Set up the RRemoteLink configuration parameters and initiate a connection
|
williamr@2
|
44 |
|
williamr@2
|
45 |
@param aBaud The baud rate
|
williamr@2
|
46 |
@param aPort The port number
|
williamr@2
|
47 |
@param aModule The module name
|
williamr@2
|
48 |
@param aLowPowerMode Boolean representing low power mode
|
williamr@2
|
49 |
@return KErrNone on success, standard error code on failure
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
{
|
williamr@2
|
52 |
|
williamr@2
|
53 |
TPlpConfigPkgSerial pkg(aBaud,aPort,aModule);
|
williamr@2
|
54 |
TInt ret = SetConfig(pkg);
|
williamr@2
|
55 |
return ret;
|
williamr@2
|
56 |
}
|
williamr@2
|
57 |
|
williamr@2
|
58 |
inline TInt RRemoteLink::Disable()
|
williamr@2
|
59 |
/**
|
williamr@2
|
60 |
Disable the remote link
|
williamr@2
|
61 |
|
williamr@2
|
62 |
@return KErrNone on success, standard error code on failure
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
{
|
williamr@2
|
65 |
|
williamr@2
|
66 |
TInt ret = Disconnect();
|
williamr@2
|
67 |
return ret;
|
williamr@2
|
68 |
}
|
williamr@2
|
69 |
|
williamr@2
|
70 |
inline TInt RRemoteLink::Config(TBps* aBaud /*=NULL*/, TDesC* aPort /*=NULL*/, TDesC* aModule /*=NULL*/, TBool* /*aLowPowerMode*/)
|
williamr@2
|
71 |
/**
|
williamr@2
|
72 |
Read the current RRemoteLink configuration
|
williamr@2
|
73 |
|
williamr@2
|
74 |
@param aBaud The bard rate
|
williamr@2
|
75 |
@param aPort The port number
|
williamr@2
|
76 |
@param aModule The module name
|
williamr@2
|
77 |
@param aLowPowerMode Boolean representing if low power mode is enabled
|
williamr@2
|
78 |
@return KErrNone on success, standard error code on failure
|
williamr@2
|
79 |
*/
|
williamr@2
|
80 |
{
|
williamr@2
|
81 |
|
williamr@2
|
82 |
TPlpConfigPkgSerial pkg;
|
williamr@2
|
83 |
TInt ret = Config(pkg);
|
williamr@2
|
84 |
if (ret!=KErrNone)
|
williamr@2
|
85 |
return ret;
|
williamr@2
|
86 |
|
williamr@2
|
87 |
if (aBaud)
|
williamr@2
|
88 |
*aBaud = pkg.Baud();
|
williamr@2
|
89 |
if (aPort)
|
williamr@2
|
90 |
*(TDes*)aPort = pkg.PortName();
|
williamr@2
|
91 |
if (aModule)
|
williamr@2
|
92 |
*(TDes*)aModule = pkg.ModuleName();
|
williamr@2
|
93 |
return KErrNone;
|
williamr@2
|
94 |
}
|
williamr@2
|
95 |
|
williamr@2
|
96 |
inline TInt RRemoteLink::LoadLocalServer(TPlpServiceName& aResult, const TDesC& aFileName, const TDesC& aArgs /*=TPtrC()*/, TInt aReserved /*=0*/)
|
williamr@2
|
97 |
/**
|
williamr@2
|
98 |
Load a local server
|
williamr@2
|
99 |
|
williamr@2
|
100 |
@param aResult The service name
|
williamr@2
|
101 |
@param aFileName The file name
|
williamr@2
|
102 |
@param aArgs Arguments
|
williamr@2
|
103 |
@param aReserved The reserved flag
|
williamr@2
|
104 |
@return KErrNone on success, standard error code on failure
|
williamr@2
|
105 |
*///
|
williamr@2
|
106 |
//
|
williamr@2
|
107 |
//
|
williamr@2
|
108 |
{
|
williamr@2
|
109 |
|
williamr@2
|
110 |
TRequestStatus status;
|
williamr@2
|
111 |
LoadLocalServer(status,aResult,aFileName,aArgs,aReserved);
|
williamr@2
|
112 |
User::WaitForRequest(status);
|
williamr@2
|
113 |
return status.Int();
|
williamr@2
|
114 |
}
|
williamr@2
|
115 |
|
williamr@2
|
116 |
inline TInt RRemoteLink::UnloadLocalServer(const TDesC& aFileName)
|
williamr@2
|
117 |
/**
|
williamr@2
|
118 |
Unload the local server
|
williamr@2
|
119 |
|
williamr@2
|
120 |
@param aFileName The local server file name
|
williamr@2
|
121 |
@return KErrNone on success, standard error code on failure
|
williamr@2
|
122 |
*/
|
williamr@2
|
123 |
{
|
williamr@2
|
124 |
|
williamr@2
|
125 |
TRequestStatus status;
|
williamr@2
|
126 |
UnloadLocalServer(status,aFileName);
|
williamr@2
|
127 |
User::WaitForRequest(status);
|
williamr@2
|
128 |
return status.Int();
|
williamr@2
|
129 |
}
|
williamr@2
|
130 |
|
williamr@2
|
131 |
inline TInt RRemoteLink::EnableFileAccess(TBool /*aEnable=ETrue*/)
|
williamr@2
|
132 |
/**
|
williamr@2
|
133 |
Dummy implementation
|
williamr@2
|
134 |
|
williamr@2
|
135 |
@param aEnable Enable file access boolean flag
|
williamr@2
|
136 |
@return KErrNone on success, standard error code on failure
|
williamr@2
|
137 |
*/
|
williamr@2
|
138 |
{
|
williamr@2
|
139 |
|
williamr@2
|
140 |
return KErrNone;
|
williamr@2
|
141 |
}
|
williamr@2
|
142 |
|
williamr@2
|
143 |
inline void RRemoteLink::WaitForConnect(TRequestStatus& aStatus, TRemoteLinkStatusBuf& aBuf)
|
williamr@2
|
144 |
/**
|
williamr@2
|
145 |
Wait for connection to complete
|
williamr@2
|
146 |
|
williamr@2
|
147 |
@param aStatus The request status
|
williamr@2
|
148 |
@param aBuf The remote link status buffer
|
williamr@2
|
149 |
*/
|
williamr@2
|
150 |
{
|
williamr@2
|
151 |
|
williamr@2
|
152 |
Connect(aStatus,aBuf);
|
williamr@2
|
153 |
}
|