33
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2007 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: BIP Utils interface for BIP proactive commands.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef MSATBIPUTILS_H
|
|
21 |
#define MSATBIPUTILS_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <e32std.h>
|
|
25 |
#include <etelsat.h>
|
|
26 |
|
|
27 |
// CLASS DECLARATION
|
|
28 |
class MSatBIPDataChannel;
|
|
29 |
class MSatApnHandler;
|
|
30 |
|
|
31 |
// CONSTANTS
|
|
32 |
// These constants are used by BIP related objects
|
|
33 |
// Used in terminal responses and DataAvailable envelope
|
|
34 |
const TInt KSatBIPMoreThanMaxSize = 0xFF;
|
|
35 |
|
|
36 |
// The minimum size of receive buffer is 1500 bytes.
|
|
37 |
const TInt KSatBIPMinReceiveBufferSize = 0x5DC;
|
|
38 |
|
|
39 |
// Maximum buffer size from SIM in OpenChannel command is 1500.
|
|
40 |
const TInt KSatBIPMaxBufferSize = 0x5DC;
|
|
41 |
|
|
42 |
// Maximum size of one ReceiveCommand TerminalResponse
|
|
43 |
const TInt KSatBIPMaxResponseSize = 0xED;
|
|
44 |
|
|
45 |
/**
|
|
46 |
* BIP Utils interface. Provides functionality to
|
|
47 |
* BIP proactive command handlers.
|
|
48 |
*
|
|
49 |
* @lib SatEngine
|
|
50 |
* @since Series 60 3.0
|
|
51 |
*/
|
|
52 |
class MSatBIPUtils
|
|
53 |
{
|
|
54 |
public: // Enums
|
|
55 |
|
|
56 |
// These values can be used straigth in TerminalResponses
|
|
57 |
// additional info with KBearerIndepProtocolError
|
|
58 |
enum TSatBIPErrors
|
|
59 |
{
|
|
60 |
ESatBIPSuccess = 0x00,
|
|
61 |
ESatBIPNoChannelAvail = 0x01,
|
|
62 |
ESatBIPChannelClosed = 0x02,
|
|
63 |
ESatBIPChannelIdNotValid = 0x03,
|
|
64 |
ESatBIPReqBufSizeNotAvail = 0x04,
|
|
65 |
ESatBIPSecurityError = 0x05,
|
|
66 |
ESatBIPTransportLevelNotAvailable = 0x06,
|
|
67 |
ESatBIPRemoteDeviceNotReachable = 0x07,
|
|
68 |
ESatBIPServiceError = 0x08,
|
|
69 |
ESatBIPServiceIdUnknown = 0x09
|
|
70 |
};
|
|
71 |
|
|
72 |
// This comes with OpenChannel command to identify the type
|
|
73 |
// of bearer in the data channel.
|
|
74 |
enum TSatBearerType
|
|
75 |
{
|
|
76 |
ESatDefault, /* Default bearer type */
|
|
77 |
ESatGPRS, /* GPRS */
|
|
78 |
ESatCSD /* CSD, Not supported */
|
|
79 |
};
|
|
80 |
|
|
81 |
// Defines the possible channel IDs. The values should be the same as are in
|
|
82 |
// etelsat.h and these values can be used in functions.
|
|
83 |
enum TSatChannelId
|
|
84 |
{
|
|
85 |
ESatNoChannel = 0x00,
|
|
86 |
ESatChannel1 = 0x01,
|
|
87 |
ESatChannel2 = 0x02,
|
|
88 |
ESatChannel3 = 0x03,
|
|
89 |
ESatChannel4 = 0x04,
|
|
90 |
ESatChannel5 = 0x05,
|
|
91 |
ESatChannel6 = 0x06,
|
|
92 |
ESatChannel7 = 0x07
|
|
93 |
};
|
|
94 |
|
|
95 |
// Supported status informations
|
|
96 |
enum TSatChannelStatus
|
|
97 |
{
|
|
98 |
ESatNoFurtherInformation = 0x00,
|
|
99 |
ESatLinkDropped = 0x05
|
|
100 |
};
|
|
101 |
|
|
102 |
protected: // Constructors and destructor
|
|
103 |
|
|
104 |
/**
|
|
105 |
* C++ default constructor.
|
|
106 |
*/
|
|
107 |
MSatBIPUtils() {};
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Destructor.
|
|
111 |
*/
|
|
112 |
virtual ~MSatBIPUtils() {};
|
|
113 |
|
|
114 |
public: // New functions
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Creates new data channel and returns reference to it.
|
|
118 |
* @param aBearerType identifies the type of data channel to create.
|
|
119 |
* @param TSatBIPError code indicating the execution status.
|
|
120 |
* @return Pointer to created data channel
|
|
121 |
*/
|
|
122 |
virtual MSatBIPDataChannel* CreateChannelL(
|
|
123 |
const TSatBearerType aBearerType,
|
|
124 |
TInt& aErrCode ) = 0;
|
|
125 |
|
|
126 |
/**
|
|
127 |
* Request to close specified data channel.
|
|
128 |
* @param aChannelId Identifies the channel to be closed.
|
|
129 |
* @return TSatBIPError code indicating the execution status.
|
|
130 |
*/
|
|
131 |
virtual TInt CloseChannel( const TInt aChannelId ) = 0;
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Request to open new data channel
|
|
135 |
* @param aChannelId Identifies the channel.
|
|
136 |
* @param aErrCode TSatBIPError code indicating the execution status.
|
|
137 |
* @return Pointer to requested data channel
|
|
138 |
*/
|
|
139 |
virtual MSatBIPDataChannel* DataChannel( const TInt aChannelId,
|
|
140 |
TInt& aErrCode ) = 0;
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Request to close specified data channel.
|
|
144 |
* @return Array containing all available data channels.
|
|
145 |
*/
|
|
146 |
virtual CArrayPtrFlat<MSatBIPDataChannel>* DataChannels() = 0;
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Generates channel status object from given parameters to
|
|
150 |
* used in terminal responses.
|
|
151 |
* @param aChannelId Data channel identifier.
|
|
152 |
* @param aStatus Data channel's status.
|
|
153 |
* @return channel status object that can be put into terminal responses.
|
|
154 |
*/
|
|
155 |
virtual RSat::TChannelStatus GenerateChannelStatusL(
|
|
156 |
const TInt aChannelId, TInt aStatus ) = 0;
|
|
157 |
|
|
158 |
/**
|
|
159 |
* Reference to APN handler
|
|
160 |
* @return Interface reference to CSatApnHandler
|
|
161 |
*/
|
|
162 |
virtual MSatApnHandler& ApnHandler() = 0;
|
|
163 |
|
|
164 |
/**
|
|
165 |
* Status of the PDP Context
|
|
166 |
* @return ETrue, if there is active PDP Context
|
|
167 |
*/
|
|
168 |
virtual TBool IsContextActive() = 0;
|
|
169 |
|
|
170 |
private:
|
|
171 |
|
|
172 |
// Prohibit copy constructor if not deriving from CBase.
|
|
173 |
MSatBIPUtils( const MSatBIPUtils& );
|
|
174 |
|
|
175 |
// Prohibit assigment operator if not deriving from CBase.
|
|
176 |
MSatBIPUtils& operator=( const MSatBIPUtils& );
|
|
177 |
};
|
|
178 |
|
|
179 |
#endif // MSATBIPUTILS_H
|
|
180 |
|
|
181 |
// End of File
|