networkprotocolmodules/common/suplrrlpasn1/inc/suplmessagecommon.h
changeset 57 3267d9ea3e98
parent 48 81c9bee26a45
child 61 a2244af7b395
equal deleted inserted replaced
48:81c9bee26a45 57:3267d9ea3e98
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalTechnology
       
    19  
       
    20 */
       
    21 #ifndef LBS_SUPL_MESSAGE_COMMON_H
       
    22 #define LBS_SUPL_MESSAGE_COMMON_H
       
    23 
       
    24 #include <e32base.h>
       
    25 	
       
    26 /**
       
    27 Enumeration for Status Code parameter.
       
    28 This is used to report errors in the SUPL END message status code parameter.
       
    29 
       
    30 @internalTechnology
       
    31 */
       
    32 typedef TUint32 TSuplStatusCode;
       
    33 	
       
    34 enum _TSuplStatusCode
       
    35 	{
       
    36 	ESuplStatusUnspecified = 0, 
       
    37 	ESuplStatusSystemFailure = 1, 
       
    38 	ESuplStatusUnexpectedMessage = 2, 
       
    39 	ESuplStatusProtocolError = 3,
       
    40 	ESuplStatusDataMissing = 4, 
       
    41 	ESuplStatusUnexpectedDataValue = 5, 
       
    42 	ESuplStatusPosMethodFailure = 6,
       
    43 	ESuplStatusPosMethodMismatch = 7, 
       
    44 	ESuplStatusPosProtocolMismatch = 8, 
       
    45 	ESuplStatusTargetSETnotReachable = 9,
       
    46 	ESuplStatusVersionNotSupported = 10, 
       
    47 	ESuplStatusResourceShortage = 11, 
       
    48 	ESuplStatusInvalidSessionId = 12,
       
    49 	ESuplStatusNonProxyModeNotSupported = 13, 
       
    50 	ESuplStatusProxyModeNotSupported = 14,
       
    51 	ESuplStatusPositioningNotPermitted = 15, 
       
    52 	ESuplStatusAuthNetFailure = 16, 
       
    53 	ESuplStatusAuthSuplinitFailure = 17, 
       
    54 	ESuplStatusConsentDeniedByUser = 100,
       
    55 	ESuplStatusConsentGrantedByUser = 101
       
    56 	};
       
    57 
       
    58 
       
    59 typedef TUint32 TSuplSlpAddressType;
       
    60 enum _TSuplSlpAddressType
       
    61 	{
       
    62 	ESuplSlpAddressTypeIp = 0,
       
    63 	ESuplSlpAddressTypeFqdn,
       
    64 	
       
    65 	ESuplSlpAddressTypeLimit
       
    66 	};
       
    67 
       
    68 typedef TUint32 TSuplIpAddressType;
       
    69 enum _TSuplIpAddressType
       
    70 	{
       
    71 	ESuplIpAddressTypeV4 = 0,
       
    72 	ESuplIpAddressTypeV6,
       
    73 	
       
    74 	ESuplIpAddressTypeLimit
       
    75 	};
       
    76 
       
    77 typedef TUint32 TSuplSetIdType;
       
    78 enum _TSuplSetIdType
       
    79 	{	
       
    80   	ESuplSetIdTypeMsisdn,
       
    81   	ESuplSetIdTypeMdn,
       
    82   	ESuplSetIdTypeMin,
       
    83   	ESuplSetIdTypeImsi,
       
    84   	ESuplSetIdTypeNai,
       
    85   	ESuplSetIdTypeIPAddress		
       
    86 	};
       
    87 
       
    88 
       
    89 /**
       
    90  * Supl Message IPAddress
       
    91  */
       
    92 NONSHARABLE_CLASS(CSuplIpAddress) : public CBase
       
    93 	{
       
    94 public:
       
    95 	IMPORT_C static CSuplIpAddress* NewL();
       
    96 	IMPORT_C static CSuplIpAddress* NewLC();
       
    97 	IMPORT_C ~CSuplIpAddress();
       
    98 	IMPORT_C TBool operator==(const CSuplIpAddress& other) const;
       
    99 	
       
   100 private:
       
   101 	CSuplIpAddress();
       
   102 	void ConstructL();
       
   103 		
       
   104 public:	
       
   105 	TSuplIpAddressType iIpAddressType;
       
   106 	TBuf8<16> iIpAddress;	
       
   107 	};
       
   108 
       
   109 /**
       
   110  * Supl Message FQDN
       
   111  */
       
   112 NONSHARABLE_CLASS(CSuplFqdn) : public CBase
       
   113 	{
       
   114 public:
       
   115 	IMPORT_C static CSuplFqdn* NewL();
       
   116 	IMPORT_C ~CSuplFqdn();
       
   117 	IMPORT_C TBool operator==(const CSuplFqdn& other) const;
       
   118 	
       
   119 private:
       
   120 	CSuplFqdn();
       
   121 	void ConstructL();
       
   122 		
       
   123 public:	
       
   124 	TBuf8<256> iFqdn;	
       
   125 	};
       
   126 
       
   127 
       
   128 /**
       
   129  * Supl Message Slp address
       
   130  */
       
   131 NONSHARABLE_CLASS(CSuplSlpAddress) : public CBase
       
   132 	{
       
   133 public:
       
   134 	IMPORT_C static CSuplSlpAddress* NewL();
       
   135 	IMPORT_C ~CSuplSlpAddress();
       
   136 	IMPORT_C TBool operator==(const CSuplSlpAddress& other) const;
       
   137 	
       
   138 private:
       
   139 	CSuplSlpAddress();
       
   140 	void ConstructL();
       
   141 
       
   142 public:
       
   143 	TSuplSlpAddressType iSlpAddressType;
       
   144 	CSuplIpAddress* iIpAddress;	
       
   145 	CSuplFqdn* iFqdn;
       
   146 	};
       
   147 	
       
   148 /**
       
   149  * Supl Message SessionId
       
   150  */
       
   151 NONSHARABLE_CLASS(CSuplSlpSessionId) : public CBase
       
   152 	{
       
   153 public:
       
   154 	IMPORT_C static CSuplSlpSessionId* NewL();
       
   155 	IMPORT_C ~CSuplSlpSessionId();
       
   156 	IMPORT_C TBool operator==(const CSuplSlpSessionId& other) const;
       
   157 	
       
   158 private:	
       
   159 	void ConstructL();
       
   160 	void ConstructL(const CSuplSlpSessionId* aSlpSessionId);
       
   161 	
       
   162 public:
       
   163 	TBuf8<4> iSessionId;
       
   164 	CSuplSlpAddress* iSlpAddress;
       
   165 	};
       
   166 
       
   167 	
       
   168 /**
       
   169  * Supl Message SetId
       
   170  */
       
   171 NONSHARABLE_CLASS(CSuplSetId) : public CBase
       
   172 	{
       
   173 public:
       
   174 	IMPORT_C static CSuplSetId* NewL();
       
   175 	IMPORT_C ~CSuplSetId();
       
   176 	IMPORT_C TBool operator==(const CSuplSetId& other) const;
       
   177 	
       
   178 private:	
       
   179 	CSuplSetId();
       
   180 	void ConstructL();
       
   181 	
       
   182 public:	
       
   183 	TSuplSetIdType iSetIdType;
       
   184 	CSuplIpAddress* iIpAddress;
       
   185 	TBuf8<16> iSetId;
       
   186 	};
       
   187 
       
   188 /**
       
   189  * Supl Message SessionId
       
   190  */	
       
   191 NONSHARABLE_CLASS(CSuplSetSessionId) : public CBase
       
   192 	{
       
   193 public:
       
   194 	IMPORT_C static CSuplSetSessionId* NewL();
       
   195 	IMPORT_C ~CSuplSetSessionId();
       
   196 	IMPORT_C TBool operator==(const CSuplSetSessionId& other) const;
       
   197 	
       
   198 private:
       
   199 	CSuplSetSessionId();
       
   200 	void ConstructL();
       
   201 	
       
   202 public:
       
   203 	TUint16 iSessionId;
       
   204 	CSuplSetId* iSetId;
       
   205 	};
       
   206 
       
   207 /**
       
   208  * Supl Message SessionId
       
   209  */
       
   210 NONSHARABLE_CLASS(CSuplSessionId) : public CBase
       
   211 	{
       
   212 public:
       
   213 	IMPORT_C static CSuplSessionId* NewL();	
       
   214 	IMPORT_C static CSuplSessionId* NewLC();	
       
   215 	IMPORT_C ~CSuplSessionId();
       
   216 	IMPORT_C TBool operator==(const CSuplSessionId& other) const;	
       
   217 	
       
   218 private:
       
   219 	CSuplSessionId();
       
   220 	void ConstructL();
       
   221 
       
   222 public:
       
   223 	TBool iSetSessionIdPresent;
       
   224 	TBool iSlpSessionIdPresent;
       
   225 	CSuplSetSessionId* iSetSessionId;
       
   226 	CSuplSlpSessionId* iSlpSessionId;
       
   227 	};
       
   228 
       
   229 
       
   230 /**
       
   231  * Supl Message Version
       
   232  */
       
   233 NONSHARABLE_CLASS(CSuplVersion) : public CBase
       
   234 	{
       
   235 public:
       
   236 	IMPORT_C static CSuplVersion* NewL();
       
   237 	IMPORT_C ~CSuplVersion();
       
   238 	IMPORT_C TBool operator==(const CSuplVersion& other) const;
       
   239 	
       
   240 private:
       
   241 	CSuplVersion();
       
   242 	void ConstructL();
       
   243 	
       
   244 public:
       
   245 	TInt iMaj;
       
   246 	TInt iMin;
       
   247 	TInt iServind;
       
   248 	}; 
       
   249 
       
   250 /**
       
   251  * NMR Element for GSM Cell Info
       
   252  */
       
   253 NONSHARABLE_CLASS(TSuplGsmNmrElement)
       
   254 	{
       
   255 public:
       
   256 	TInt iARFCN; // (0..1023)
       
   257 	TInt iBSIC;  // (0..63)
       
   258 	TInt iRxLev; // (0..63)
       
   259 	};
       
   260 
       
   261 
       
   262 /**
       
   263  * Supl GSM Cell Info
       
   264  */
       
   265 NONSHARABLE_CLASS(CSuplGsmCellInfo) : public CBase
       
   266 	{
       
   267 public:
       
   268 	IMPORT_C static CSuplGsmCellInfo* NewL();
       
   269 	IMPORT_C ~CSuplGsmCellInfo();
       
   270 	
       
   271 private:
       
   272 	CSuplGsmCellInfo();
       
   273 	void ConstructL();
       
   274 		
       
   275 public:	
       
   276 	TInt iRefMCC;        //  (0..999),   -- Mobile Country Code
       
   277 	TInt iRefMNC;        //  (0..999),   -- Mobile Network Code
       
   278 	TInt iRefLAC;        //  (0..65535), -- Location area code
       
   279 	TInt iRefCI;         //  (0..65535), -- Cell identity
       
   280 	TInt iNMR;     		 //  indicates number of NMR elements (0..15)
       
   281 	TSuplGsmNmrElement iNmrElements[15]; // optional
       
   282 	TInt iTA;            //  (0..255) OPTIONAL, --Timing Advance
       
   283 	};
       
   284 
       
   285 
       
   286 /**
       
   287  * Supl CDMA Cell Info
       
   288  */
       
   289 NONSHARABLE_CLASS(CSuplCdmaCellInfo) : public CBase
       
   290 	{
       
   291 public:
       
   292 	IMPORT_C static CSuplCdmaCellInfo* NewL();
       
   293 	IMPORT_C ~CSuplCdmaCellInfo();
       
   294 	
       
   295 private:
       
   296 	CSuplCdmaCellInfo();
       
   297 	void ConstructL();
       
   298 		
       
   299 public:	
       
   300 	TInt iRefNID; 		 // (0..65535),  -- Network Id
       
   301 	TInt iRefSID;	 	 // (0..32767),  -- System Id
       
   302 	TInt iRefBASEID;     // (0..65535),  -- Base Station Id
       
   303 	TInt iRefBASELAT;    // (0..4194303),-- Base Station Latitude
       
   304 	TInt iReBASELONG;    // (0..8388607),-- Base Station Longitude
       
   305 	TInt iRefREFPN;      // (0..511),    -- Base Station PN Code
       
   306 	TInt iRefWeekNumber; // (0..65535),  -- GPS Week Number
       
   307 	TInt iRefSeconds;    // (0..4194303) -- GPS Seconds
       
   308 	};
       
   309 
       
   310 /**
       
   311  * Supl WCDMA Cell Info
       
   312  */
       
   313 NONSHARABLE_CLASS(CSuplWcdmaCellInfo) : public CBase
       
   314 	{
       
   315 public:
       
   316 	IMPORT_C static CSuplWcdmaCellInfo* NewL();
       
   317 	IMPORT_C ~CSuplWcdmaCellInfo();
       
   318 	
       
   319 private:
       
   320 	CSuplWcdmaCellInfo();
       
   321 	void ConstructL();
       
   322 		
       
   323 public:	
       
   324 	TInt iRefMCC;         // (0..999), -- Mobile Country Code
       
   325 	TInt iRefMNC;         // (0..999), -- Mobile Network Code
       
   326 	TInt iRefUC;          // (0..268435455), -- Cell identity
       
   327 	// iRrequencyInfo          FrequencyInfo OPTIONAL,
       
   328 	// TUint16 iPrimaryScramblingCode  // (0..511) OPTIONAL,
       
   329 	// CSuplMeasureResultsList iMeasuredResultsList   // OPTIONAL,
       
   330 	};
       
   331 
       
   332 /**
       
   333  * Supl Location Type
       
   334  */
       
   335 typedef TUint32 TSuplLocationType;
       
   336 enum _TSuplLocationType
       
   337 	{
       
   338 	ESuplLocationTypeGsm,
       
   339 	ESuplLocationTypeCdma,
       
   340 	ESuplLocationTypeWcdma,
       
   341 	ESuplLocationTypeLimit
       
   342 	};
       
   343 	
       
   344 /**
       
   345  * Supl Location Status
       
   346  */
       
   347 typedef TUint32 TSuplLocationStatus;
       
   348 enum _TSuplLocationStatus 
       
   349 	{
       
   350 	ESuplLocStatusStale,
       
   351 	ESuplLocStatusCurrent,
       
   352 	ESuplLocStatusUnknown
       
   353 	};
       
   354 
       
   355 /**
       
   356  * Supl Location ID
       
   357  */
       
   358 NONSHARABLE_CLASS(CSuplLocationId) : public CBase
       
   359 	{
       
   360 public:
       
   361 	IMPORT_C static CSuplLocationId* NewL(TSuplLocationType aType);
       
   362 	IMPORT_C ~CSuplLocationId();
       
   363 	
       
   364 private:
       
   365 	CSuplLocationId(TSuplLocationType aType);
       
   366 	void ConstructL();
       
   367 		
       
   368 public:	
       
   369 	TSuplLocationType   iType;
       
   370 	TSuplLocationStatus iStatus;
       
   371 
       
   372 	CSuplGsmCellInfo*   iGsmCellInfo;
       
   373 	CSuplCdmaCellInfo*  iCdmaCellInfo;
       
   374 	CSuplWcdmaCellInfo* iWcdmaCellInfo;
       
   375 	};
       
   376 
       
   377 
       
   378 #endif // LBS_SUPL_MESSAGE_COMMON_H
       
   379 
       
   380 
       
   381