CSuplMessageBase Class Reference

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

Inherits from

Public Member Functions
~CSuplMessageBase()
IMPORT_C TIntEncodeToL(TPtr8 &)
IMPORT_C TIntGetSessionId(CSuplSessionId &)
IMPORT_C TIntGetVersion(CSuplVersion &)
IMPORT_C voidLogMessageContent()
IMPORT_C CSuplMessageBase::TSuplMessageTypeMessageType()
voidSetDecodedData(ASN1T_ULP_PDU *, ASN1C_ULP_PDU *)
IMPORT_C TIntSetSessionId(CSuplSessionId &)
IMPORT_C voidSetVersion(CSuplVersion &)
Protected Member Functions
CSuplMessageBase(TSuplMessageType, TBool)
voidConstructL()
TInt EncodeAltitude(const TReal32 &)
voidLeaveIfAllocErrorL()
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 &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
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

Constructor & Destructor Documentation

CSuplMessageBase(TSuplMessageType, TBool)

CSuplMessageBase(TSuplMessageTypeaType,
TBoolaIsOutgoingMessage
)[protected]

Default constructor

Parameters

TSuplMessageType aType
TBool aIsOutgoingMessage

CSuplMessageBase(const CSuplMessageBase &)

CSuplMessageBase(const CSuplMessageBase &)[private]

Prohibit copy constructor

Parameters

const CSuplMessageBase &

~CSuplMessageBase()

~CSuplMessageBase()[virtual]

Destructor

Member Functions Documentation

ConstructL()

voidConstructL()[protected]

second stage constructor

Second stage constructor

Outgoing messages: constructs the data encapsulation and control objects. Incoming message: no action

EncodeAltitude(const TReal32 &)

TInt EncodeAltitude(const TReal32 &aAltitude)[protected]

EncodeAltitude()

Converts an value for altiutude to an 15 bit binary coded number N

Parameters

const TReal32 & aAltitude- altitude in meters

EncodeToL(TPtr8 &)

IMPORT_C TIntEncodeToL(TPtr8 &aBuf)

Encode a populated outgoing message

EncodeToL()

Encode a populated outgoing message to the specified buffer.

Parameters

TPtr8 & aBufbuffer pointer

GetSessionId(CSuplSessionId &)

IMPORT_C TIntGetSessionId(CSuplSessionId &aSessionId)

Populates aSessionId with the SUPL Session ID (for received messages)

GetSessionId()

Populates aSessionId with the SUPL Session ID

Parameters

CSuplSessionId & aSessionIdon return, populated with session ID of received SUPL message

GetVersion(CSuplVersion &)

IMPORT_C TIntGetVersion(CSuplVersion &aVersion)

Populates aVersion with the SUPL version (for received messages)

GetVersion()

Populates aVersion with the SUPL version

Parameters

CSuplVersion & aVersionon return, populated with version of received SUPL message

LeaveIfAllocErrorL()

voidLeaveIfAllocErrorL()[protected]

checks for memory allocation failure and leaves

LeaveIfAllocErrorL()

Calls User::Leave(<error code>) if a memory allocation has failed.

LogMessageContent()

IMPORT_C voidLogMessageContent()

Prints the content of the data structure to the logger

MessageType()

IMPORT_C CSuplMessageBase::TSuplMessageTypeMessageType()

Methods for accessing content of decoded received messages Returns the message type

MessageType()

Returns the message type

PopulateLocationId(const CSuplLocationId &, ASN1T_LocationId &)

TInt PopulateLocationId(const CSuplLocationId &aLocSource,
ASN1T_LocationId &aLocTarget
)[protected]

PopulateLocationId()

Populates the data container specifying the content of the LOCATION ID componenet according to the passed LBS location details.

Parameters

const CSuplLocationId & aLocSourceLocationID Source
ASN1T_LocationId & aLocTargetoutgoing LocationID data object

PopulatePosition(const TPositionInfoBase &, ASN1T_Position &)

TInt PopulatePosition(const TPositionInfoBase &aPosSource,
ASN1T_Position &aPosTarget
)[protected]

PopulatePosition()

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.

Parameters

const TPositionInfoBase & aPosSourcePosition source data from LBS
ASN1T_Position & aPosTargetoutgoing Position message data object

PopulateSetCapabilities(const TLbsNetPosCapabilities &, ASN1T_SETCapabilities &)

TInt PopulateSetCapabilities(const TLbsNetPosCapabilities &aCapsSource,
ASN1T_SETCapabilities &aCapsTarget
)[protected]

methods for outgoing SUPL parameters common to multiple messages

PopulateSetCapabilities()

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.

Parameters

const TLbsNetPosCapabilities & aCapsSourceCapabilities Source
ASN1T_SETCapabilities & aCapsTargetoutgoing capabilities data object

PopulateVelocity(const TCourse &, ASN1T_Velocity &)

TInt PopulateVelocity(const TCourse &aCourse,
ASN1T_Velocity &aVelTarget
)[protected]

Parameters

const TCourse & aCourse
ASN1T_Velocity & aVelTarget

ProcessAsn1Error(TInt)

TInt ProcessAsn1Error(TIntaError)[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

Parameters

TInt aError

SetDecodedData(ASN1T_ULP_PDU *, ASN1C_ULP_PDU *)

voidSetDecodedData(ASN1T_ULP_PDU *aData,
ASN1C_ULP_PDU *aControl
)

Assign decoded ASN1 data. (for received messages) Not intended for DLL export

SetDecodedData()

Assign decoded ASN1 data, for received messages. Takes ownership of passed objects.

Parameters

ASN1T_ULP_PDU * aDatadata structure containing decoded message parameters
ASN1C_ULP_PDU * aControlcontrol structure associated with decoded data structure.

SetSessionId(CSuplSessionId &)

IMPORT_C TIntSetSessionId(CSuplSessionId &aSessionId)

Set the SUPL Session ID (for outgoing messages)

SetSessionId()

Set the SUPL Session ID

Parameters

CSuplSessionId & aSessionIdsession identifier

SetVersion(CSuplVersion &)

IMPORT_C voidSetVersion(CSuplVersion &aVersion)

Methods for populating common parameters for outgoing messages Set the SUPL version used (for outgoing messages)

SetVersion()

Set the SUPL version used

Parameters

CSuplVersion & aVersionSUPL version in use

Uncertainty(const TReal32 &)

TInt Uncertainty(const TReal32 &aDistance)[protected]

common calculation methods

Uncertainty()

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)

Parameters

const TReal32 & aDistance- distance measurement in meters

UncertaintyAltitude(const TReal32 &)

TInt UncertaintyAltitude(const TReal32 &aDistance)[protected]

UncertaintyAltitude()

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)

Parameters

const TReal32 & aDistance- altitude accuracy in meters

operator=(const CSuplMessageBase &)

CSuplMessageBase &operator=(const CSuplMessageBase &)[private]

Prohibit assigment operator

Parameters

const CSuplMessageBase &

Member Enumerations Documentation

Enum _TSuplMessageType

Enumerators

ESuplInit = 0
ESuplStart
ESuplResponse
ESuplPosInit
ESuplPos
ESuplEnd
ESuplAuthReq
ESuplAuthResp
ESuplMessageLimit

Member Type Definitions Documentation

Typedef TSuplMessageType

typedef TUint32 TSuplMessageType

TSuplMessageType typedef

Member Data Documentation

ASN1C_ULP_PDU * iControl

ASN1C_ULP_PDU *iControl[protected]

ASN1T_ULP_PDU * iData

ASN1T_ULP_PDU *iData[protected]

ASN1PEREncodeBuffer * iEncodeBuffer

ASN1PEREncodeBuffer *iEncodeBuffer[protected]

TBool iIsOutgoingMessage

TBool iIsOutgoingMessage[protected]

TSuplMessageType iSuplMessageType

TSuplMessageType iSuplMessageType[protected]

TBuf8< 13 > iUtcTime

TBuf8< 13 >iUtcTime[protected]