ErrorMsg Class

Windows CE 5.0 Not SupportedWindows Embedded NavReady 2009 Supported

10/16/2008

This class represents an error message. This can be either an error message that is received from the MSN Direct receiver, or an error message that will be sent by the host device.

Syntax

class ErrorMsg : public Msg 

Methods

Method Description

ErrorMsg Constructor

Initializes the fields of this class by calling the Init method.

ErrorMsg::GetApplicationErrorCodeString

Converts the current error code to a human-readable string, assuming that the error code is referring to an application-level error.

ErrorMsg::GetApplicationType

Returns the MSN Direct service type.

ErrorMsg::GetBuffer

Returns a pointer to the first byte of this message after the beginning-of-frame.

ErrorMsg::GetBufferWithFrames

Returns a pointer to the first byte of the message, which includes framing.

ErrorMsg::GetErrorCode

Returns the error code of this message.

ErrorMsg::GetProtocolErrorCodeString

Converts the current error code to a human-readable string, assuming that the error code refers to a protocol-level error.

ErrorMsg::GetSize

Returns the size of the message, subtracting framing.

ErrorMsg::GetSizeWithFrames

Determines the size of this type of message by calling RawMessageSize, and then returns the size.

ErrorMsg::GetTransactionId

Returns the transaction ID of this message.

ErrorMsg::Init

Initializes the fields of this class.

ErrorMsg::IsResponse

Returns true if this message is a response message.

ErrorMsg::RawMessageSize

Returns the total size of this message type.

ErrorMsg::SetCRC

Computes the Cyclic Redundancy Check (CRC) value.

ErrorMsg::SetErrorCode

Sets the error code for this message.

ErrorMsg::SetResponse

Sets the last bit of the transaction ID if the IsResponse input parameter is true. This bit denotes that the current message is a response message.

ErrorMsg::SetTransactionId

Sets the transaction ID of this message.

Remarks

This class inherits from the Msg Class.

You must create a subclass of the DBR701 class and override all handlers that handle messages that the application is listening for. The return value of a message is considered an error code, which is also returned to the MSN Direct receiver. Therefore, to inform the receiver that a specific message has an error, you must create an instance of the ErrorMsg class and send it to the receiver.

In the current implementation of the DBR701 class, this class is created by the DBR701 class when an error message is sent from the MSN Direct receiver to the host device. If the incoming message from the receiver is an error, the IsResponse method of the message object will return true, and the MSN Direct service type will be PROTOCOL_ERROR. The DBR701 class typecasts the incoming message object to an ErrorMsg object, determines the type of error it is by calling ErrorMsg::GetErrorCode, and then logs the error if error logging is enabled.

In MSN Direct services for Windows Embedded CE, the host device is the Windows Embedded CE powered device.

Requirements

Header DBRLib.h
Library DBRLib.lib
Windows Embedded CE Windows CE 5.0, Windows Embedded NavReady 2009

See Also

Reference

MSN Direct Services Classes

Other Resources