Share via


PosPower Class (POS for .NET v1.12 SDK Documentation)

2/27/2008

Defines the programmatic interface for a UPOS power system device.

Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)

Syntax

'Declaration
Public MustInherit Class PosPower
    Inherits PosCommon
public abstract class PosPower : PosCommon
public ref class PosPower abstract : public PosCommon
public abstract class PosPower extends PosCommon
public abstract class PosPower extends PosCommon

Remarks

Capabilities

The PosPower device class has the following capabilities:

  • Supports a command to "shut down" the system.

  • Supports a command to restart the system.

  • Supports a command to "suspend" the system.

  • Supports a command to have the system go to standby.

  • Supports accessing a power-handling mechanism of the underlying operating system and hardware.

  • Informs the application if a power failure has occurred.

  • Informs the application about battery level.

  • Informs the application if the UPS charge state has changed.

  • Informs the application about a high CPU temperature.

  • Informs the application about a stopped CPU fan.

  • Informs the application if an operating-system-dependent enforced shutdown mechanism is processed.

  • Allows the application to shut down the POS terminal, after saving application data locally or transferring application data to a server.

  • Informs the application about an initiated shutdown.

Model

The general model of PosPower is based on the power model of each POS device. The same common properties are used but all states relate to the POS terminal itself and not to a peripheral device.

There are three states of the PosPower device:

  • ONLINE. The POS terminal is turned on and ready for use. This is the "operational" state.

  • OFF. The POS terminal is turned off or detached from the power supply. The POS terminal runs on battery power support. This is the power failure situation.

  • OFFLINE. The POS terminal is turned on, but it is running in a "lower-power-consumption" mode. It may have to be put online by pressing a button or a key or doing something else to wake up the system.

Power reporting occurs only while the device is open and enabled, with power notification tiurned on.

In a power failure situation, when the PosPower device is in the OFF state, the POS terminal is shut down automatically after the last application has closed the PosPower device or when the time specified by EnforcedShutdownDelayTime has elapsed.

A call to the ShutdownPos method always shuts down the POS terminal independent of the system power state.

Support has been added for battery-powered devices. Additional properties report battery levels and power sources and allow for the setting of low and critically low battery levels. The POSPower device also includes the ability to request or respond to a request to enter the Standby and Suspend states. The model does not try to duplicate other power management models such as APM and ACPI, but leaves those implementation details to the provider.  Generally, the Suspend state consumes less power than the Standby state, which in turn consumes less power than the On state.

Device Sharing

PosPower is a shareable device. Its device-sharing rules are as follows:

  • After opening and enabling the device, the application may access all properties and methods and receives status update events.

  • If more than one application has opened and enabled the device, all applications may access its properties and methods. Status update events are raised to all applications.

  • If one application claims the PosPower device, only that application may call the ShutdownPOS method. This feature provides a degree of security in that these methods may effectively be restricted to the main POS application if that application claims the device at startup.

Inheritance Hierarchy

System.Object
   Microsoft.PointOfService.PosDevice
     Microsoft.PointOfService.PosCommon
      Microsoft.PointOfService.PosPower
         Microsoft.PointOfService.BasicServiceObjects.PosPowerBasic

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.

See Also

Reference

PosPower Members
Microsoft.PointOfService Namespace