Поделиться через


PowerThermalChannelDataConsumer Class

Definition

Represents a consumer that receives power/thermal channel data and raises events when new data is available.

public ref class PowerThermalChannelDataConsumer sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.System.Power.Thermal.IPowerThermalChannelDataConsumerFactory, 65536, "Windows.System.Power.Thermal.PowerThermalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.System.Power.Thermal.PowerThermalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PowerThermalChannelDataConsumer final : IClosable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.System.Power.Thermal.IPowerThermalChannelDataConsumerFactory), 65536, "Windows.System.Power.Thermal.PowerThermalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.System.Power.Thermal.PowerThermalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PowerThermalChannelDataConsumer : System.IDisposable
function PowerThermalChannelDataConsumer(channelIds)
Public NotInheritable Class PowerThermalChannelDataConsumer
Implements IDisposable
Inheritance
Object Platform::Object IInspectable PowerThermalChannelDataConsumer
Attributes
Implements

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.26100.0)
API contract
Windows.System.Power.Thermal.PowerThermalApiContract (introduced in v1.0)

Remarks

When instantiated with an array of PowerThermalChannelId values, the consumer claims exclusive ownership of the specified output channels; construction fails with HRESULT STG_E_INUSE if any requested channel IDs are already claimed.

The ChannelDataReceived event fires with batches of output channel data (approximately once per second). Handlers receive PowerThermalChannelDataReceivedEventArgs containing the samples.

Constructors

PowerThermalChannelDataConsumer(PowerThermalChannelId[])

Initializes a PowerThermalChannelDataConsumer for the specified channel identifiers.

Properties

BackEndStatus

Gets the backend status of the channel data consumer. Use this property to determine whether the consumer backend is started or stopped.

Methods

Close()

Closes the channel data consumer and releases any resources associated with it.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetChannelConfigurations()

Returns the map of available channel identifiers to their configurations that the consumer can access.

GetChannelIds()

Retrieves the identifiers of the channels available to this consumer.

Start()

Starts the channel data consumer so it begins receiving data for its subscribed channels.

Stop()

Stops the channel data consumer from receiving channel data until restarted.

Events

BackEndStatusChanged

Raised when the backend status of a channel data consumer changes, for example when the backend starts or stops.

ChannelDataReceived

Raised when the channel data consumer receives new power/thermal channel samples; handlers receive event args containing the data.

Applies to