class CSuplMessageBase : public CBase |
CSuplMessageBase is an abstract class providing a base definition for SUPL messages either received or constructed for sending. Concrete classes derived from this class represent each of the supported SUPL message types, and provide methods for accessing and setting their member parameters.
When building outgoing messages, the constructor must be called with aIsOutgoingMessage set to ETrue. This results in the internal data members necessary for building and encoding an outgoing message.
For received messages, the SUPL ASN1 Decoder object (see csuplasn1decoder.h) calls SetDecodedData() , passing the decoded data structures (ownership is passed immediately on entrance to this method). Note that these data structures are defined by compilation of the SUPL definition using a third party ASN1 compiler and therefore do not conform to standard Symbian naming conventions.
Types encapsulating common parts for operation within the SUPL Protocol Module are described in file suplmessagecommon.h
Public Member Functions | |
---|---|
~CSuplMessageBase () | |
IMPORT_C TInt | EncodeToL ( TPtr8 &) |
IMPORT_C TInt | GetSessionId ( CSuplSessionId &) |
IMPORT_C TInt | GetVersion ( CSuplVersion &) |
IMPORT_C void | LogMessageContent () |
IMPORT_C CSuplMessageBase::TSuplMessageType | MessageType () |
void | SetDecodedData ( ASN1T_ULP_PDU *, ASN1C_ULP_PDU *) |
IMPORT_C TInt | SetSessionId ( CSuplSessionId &) |
IMPORT_C void | SetVersion ( CSuplVersion &) |
Protected Member Functions | |
---|---|
CSuplMessageBase ( TSuplMessageType , TBool ) | |
void | ConstructL () |
TInt | EncodeAltitude (const TReal32 &) |
void | LeaveIfAllocErrorL () |
TInt | PopulateLocationId (const CSuplLocationId &, ASN1T_LocationId &) |
TInt | PopulatePosition (const TPositionInfoBase &, ASN1T_Position &) |
TInt | PopulateSetCapabilities (const TLbsNetPosCapabilities &, ASN1T_SETCapabilities &) |
TInt | PopulateVelocity (const TCourse &, ASN1T_Velocity &) |
TInt | ProcessAsn1Error ( TInt ) |
TInt | Uncertainty (const TReal32 &) |
TInt | UncertaintyAltitude (const TReal32 &) |
Private Member Functions | |
---|---|
CSuplMessageBase (const CSuplMessageBase &) | |
CSuplMessageBase & | operator= (const CSuplMessageBase &) |
Public Member Enumerations | |
---|---|
enum |
_TSuplMessageType
{
ESuplInit = 0, ESuplStart , ESuplResponse , ESuplPosInit , ESuplPos , ESuplEnd , ESuplAuthReq , ESuplAuthResp , ESuplMessageLimit } |
Public Member Type Definitions | |
---|---|
typedef | TUint32 TSuplMessageType |
Protected Attributes | |
---|---|
ASN1C_ULP_PDU * | iControl |
ASN1T_ULP_PDU * | iData |
ASN1PEREncodeBuffer * | iEncodeBuffer |
TBool | iIsOutgoingMessage |
TSuplMessageType | iSuplMessageType |
TBuf8 < 13 > | iUtcTime |
CSuplMessageBase | ( | TSuplMessageType | aType, |
TBool | aIsOutgoingMessage | ||
) | [protected] |
Default constructor
TSuplMessageType aType | |
TBool aIsOutgoingMessage |
CSuplMessageBase | ( | const CSuplMessageBase & | ) | [private] |
Prohibit copy constructor
const CSuplMessageBase & |
void | ConstructL | ( | ) | [protected] |
second stage constructor
Second stage constructor
Outgoing messages: constructs the data encapsulation and control objects. Incoming message: no action
TInt | EncodeAltitude | ( | const TReal32 & | aAltitude | ) | [protected] |
const TReal32 & aAltitude | - altitude in meters |
IMPORT_C TInt | EncodeToL | ( | TPtr8 & | aBuf | ) |
Encode a populated outgoing message
Encode a populated outgoing message to the specified buffer.
TPtr8 & aBuf | buffer pointer |
IMPORT_C TInt | GetSessionId | ( | CSuplSessionId & | aSessionId | ) |
Populates aSessionId with the SUPL Session ID (for received messages)
Populates aSessionId with the SUPL Session ID
CSuplSessionId & aSessionId | on return, populated with session ID of received SUPL message |
IMPORT_C TInt | GetVersion | ( | CSuplVersion & | aVersion | ) |
Populates aVersion with the SUPL version (for received messages)
Populates aVersion with the SUPL version
CSuplVersion & aVersion | on return, populated with version of received SUPL message |
void | LeaveIfAllocErrorL | ( | ) | [protected] |
checks for memory allocation failure and leaves
Calls User::Leave(<error code>) if a memory allocation has failed.
IMPORT_C void | LogMessageContent | ( | ) |
Prints the content of the data structure to the logger
IMPORT_C CSuplMessageBase::TSuplMessageType | MessageType | ( | ) |
Methods for accessing content of decoded received messages Returns the message type
Returns the message type
TInt | PopulateLocationId | ( | const CSuplLocationId & | aLocSource, |
ASN1T_LocationId & | aLocTarget | |||
) | [protected] |
Populates the data container specifying the content of the LOCATION ID componenet according to the passed LBS location details.
const CSuplLocationId & aLocSource | LocationID Source |
ASN1T_LocationId & aLocTarget | outgoing LocationID data object |
TInt | PopulatePosition | ( | const TPositionInfoBase & | aPosSource, |
ASN1T_Position & | aPosTarget | |||
) | [protected] |
Populates the outgoing position element, used in POS INIT and END messages.
Timestamp is encoded in UTC format YYMMDDhhmmssZ
Latitude is encoded as an integer N (0..2^23-1) from the actual latitude X in degrees, where N <= 2^23 * X/90 < N+1
Longitude is encoded as an integer N (-2^23..2^23-1) from the actual longitude X in degrees, where N <= 2^24 * X/360 < N+1
Horizontal Uncertainty is encoded as per 3GPP GAD, ie describing an ellipse with semi-major and semi-minor axis measurements and orientation. With only one value for horizontal accuracy available, the circle described is encoded as an ellipse with semi-major = semi-minor axis and 0 degree orientation. The uncertainty is encoded to 7 bits, thus: r = C( (1+x)^k - 1 ) where r = distance in meters, C = 10, x = 0.1 and K is the encoded constant.
Confidence information is not available in this implementation and is omitted
Altitude, if data is available, is encoded as a 15 bit binary encoded number.
Altitude uncertainty is encoded as a distance above or below the WGS84 ellipsoid, using the same formula as for horizontal uncertainty, but where C = 45, x = 0.025. Encoded value K is limited to 7 bits.
If the passed TPositionInfoBase object is a TPositionCourseInfo , then the optional velocity element is populated with data from the course info object. Velocity information is encoded as per 3GPP TS 23.032, and the "horizontal velocity with uncertainty" format is used.
const TPositionInfoBase & aPosSource | Position source data from LBS |
ASN1T_Position & aPosTarget | outgoing Position message data object |
TInt | PopulateSetCapabilities | ( | const TLbsNetPosCapabilities & | aCapsSource, |
ASN1T_SETCapabilities & | aCapsTarget | |||
) | [protected] |
methods for outgoing SUPL parameters common to multiple messages
Populates the data container specifying the content of the SET CAPABILITIES componenet according to the passed LBS capabilities.
Note that the Preferred Method parameter is set to the method identified LAST in the array of capable methods. It is acceptable if this method is repeated elsewhere in the passed array.
const TLbsNetPosCapabilities & aCapsSource | Capabilities Source |
ASN1T_SETCapabilities & aCapsTarget | outgoing capabilities data object |
TInt | PopulateVelocity | ( | const TCourse & | aCourse, |
ASN1T_Velocity & | aVelTarget | |||
) | [protected] |
const TCourse & aCourse | |
ASN1T_Velocity & aVelTarget |
TInt | ProcessAsn1Error | ( | TInt | aError | ) | [protected] |
translates ASN1 run-time errors
Translates error codes returned by the ASN1 runtime library to distinguish from Symbian global error codes.
Errors are simply translated to positive error codes. They maintain their meaning as described in rtxErrCodes.h and asn1ErrCodes.h.
Exceptions: RTERR_NOMEM is translated to global error code KErrNoMemory
rtxErrCodes.h asn1ErrCodes.h
TInt aError |
void | SetDecodedData | ( | ASN1T_ULP_PDU * | aData, |
ASN1C_ULP_PDU * | aControl | |||
) |
Assign decoded ASN1 data. (for received messages) Not intended for DLL export
Assign decoded ASN1 data, for received messages. Takes ownership of passed objects.
ASN1T_ULP_PDU * aData | data structure containing decoded message parameters |
ASN1C_ULP_PDU * aControl | control structure associated with decoded data structure. |
IMPORT_C TInt | SetSessionId | ( | CSuplSessionId & | aSessionId | ) |
CSuplSessionId & aSessionId | session identifier |
IMPORT_C void | SetVersion | ( | CSuplVersion & | aVersion | ) |
Methods for populating common parameters for outgoing messages Set the SUPL version used (for outgoing messages)
Set the SUPL version used
CSuplVersion & aVersion | SUPL version in use |
TInt | Uncertainty | ( | const TReal32 & | aDistance | ) | [protected] |
common calculation methods
Converts a minumum accuracy value in meters to an uncertainty value K as described in 3GPP 23.032 (Universal Geographical Area Description) section 6.2.
r = C((1+x)^K - 1)
where r = distance in meters C = 10 x = 0.1 K = uncertainty value
hence K = ln(r/C + 1) / ln(1.1)
const TReal32 & aDistance | - distance measurement in meters |
TInt | UncertaintyAltitude | ( | const TReal32 & | aDistance | ) | [protected] |
Converts a minumum accuracy value in meters to an uncertainty altitude value K as described in 3GPP 23.032 (Universal Geographical Area Description) section 6.4.
r = C((1+x)^K - 1)
where r = distance in meters C = 45 x = 0.1 K = uncertainty value
hence K = ln(r/C + 1) / ln(1.1)
const TReal32 & aDistance | - altitude accuracy in meters |
CSuplMessageBase & | operator= | ( | const CSuplMessageBase & | ) | [private] |
Prohibit assigment operator
const CSuplMessageBase & |
ESuplInit = 0 | |
ESuplStart | |
ESuplResponse | |
ESuplPosInit | |
ESuplPos | |
ESuplEnd | |
ESuplAuthReq | |
ESuplAuthResp | |
ESuplMessageLimit |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.