PowerStatusMsg Class

Windows CE 5.0 Not SupportedWindows Embedded NavReady 2009 Supported

10/16/2008

This class represents a power-status message.

Syntax

class PowerStatusMsg : public Msg 

Methods

Method Description

PowerStatusMsg Constructor

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

PowerStatusMsg::GetApplicationType

Returns the MSN Direct service type for this power-status message.

PowerStatusMsg::GetBatteryStatus

Returns the most significant four bits of the internal PowerStatus field in this power-status message. These bits represent the battery status data.

PowerStatusMsg::GetBuffer

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

PowerStatusMsg::GetBufferWithFrames

Returns a pointer to the first byte of this power-status message, including the bytes used for framing.

PowerStatusMsg::GetPowerStatusString

Returns the current power status, which includes both power-supply status and battery status, in a human-readable string.

PowerStatusMsg::GetPowerSupply

Returns the least significant bits of the internal PowerStatus field in this power-status message. These bits represent the power-supply data.

PowerStatusMsg::GetSize

Returns the size of this power-status message, subtracting the bytes used for framing.

PowerStatusMsg::GetSizeWithFrames

Returns the size of this power-status message by calling RawMessageSize.

PowerStatusMsg::GetTransactionId

Returns the transaction ID of this power-status message.

PowerStatusMsg::Init

Initializes the fields of this class.

PowerStatusMsg::IsResponse

Returns true if this power-status message is a response message.

PowerStatusMsg::RawMessageSize

Returns the size of this power-status message.

PowerStatusMsg::SetApplicationType

Sets the MSN Direct service type for this power-status message.

PowerStatusMsg::SetCRC

Computes the Cyclic Redundancy Check (CRC) value for this power-status message.

PowerStatusMsg::SetErrorCode

Sets the error code for this power-status message.

PowerStatusMsg::SetPowerStatus

Sets the power status, which includes both power-supply status and battery status, for this power-status message.

PowerStatusMsg::SetResponse

Sets the last bit of the transaction ID to indicate whether this power-status message is a response message.

PowerStatusMsg::SetTransactionId

Sets the transaction ID for this power-status message.

Remarks

This class inherits from Msg Class.

This message can be sent by either the MSN Direct receiver or the host device to query power status. When this message is sent by the receiver, the MSN Direct application must query the actual power status of the Windows Embedded NavReady powered device in order to fill in the fields of this message.

If the MSN Direct service type is POWER_STATUS, then the incoming message from the MSN Direct receiver is a power-status message returned as a PowerStatusMsg object instance on a ProcessInMessageFromReceiver call. The MsgFromReceiver::GetApplicationType method must be called to verify for errors. In case of an error, the GetApplicationType method will return PROTOCOL_ERROR. Otherwise, the GetApplicationType method will return POWER_STATUS. In this case, the messageFromReceiver parameter must be typecast to PowerStatusMsg and processed accordingly.

The MSN Direct sample application handles this message by supplying values of "External Power" and "Fully Charged" each time this message is received from the MSN Direct receiver.

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