Share via


PowerThermalChannelDataProducer Class

Definition

Represents a producer that publishes power/thermal channel data to consumers.

public ref class PowerThermalChannelDataProducer sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.System.Power.Thermal.IPowerThermalChannelDataProducerFactory, 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 PowerThermalChannelDataProducer final : IClosable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.System.Power.Thermal.IPowerThermalChannelDataProducerFactory), 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 PowerThermalChannelDataProducer : System.IDisposable
function PowerThermalChannelDataProducer(channelIds)
Public NotInheritable Class PowerThermalChannelDataProducer
Implements IDisposable
Inheritance
Object Platform::Object IInspectable PowerThermalChannelDataProducer
Attributes
Implements

Windows requirements

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

Remarks

Constructing PowerThermalChannelDataProducer with an array of PowerThermalChannelId claims exclusive ownership of the specified input channels. Construction fails with HRESULT STG_E_INUSE if any requested channel IDs are already claimed.

In a typical usage scenario, create a producer for the desired channel IDs, call GetChannelConfigurations to obtain per-channel configuration, then call Start and use PublishInputChannelData to supply samples. Producer instances are intended to be long‑lived.

Calling PublishInputChannelData for a disabled channel will re‑enable that channel; use DisableChannel to prevent publishing until explicitly re‑enabled. Passing an invalid channel identifier to PublishInputChannelData results in HRESULT_INVALID_ARGUMENT.

The BackEndStatus property and BackEndStatusChanged event indicate whether the MPTF backend is Started or Stopped; clients should stop publishing while the backend is Stopped.

Constructors

Name Description
PowerThermalChannelDataProducer(PowerThermalChannelId[])

Initializes a PowerThermalChannelDataProducer for the specified channel identifiers.

Properties

Name Description
BackEndStatus

Gets the backend status of the channel data producer, indicating whether the producer backend is started or stopped.

Methods

Name Description
Close()

Closes the channel data producer and releases any resources it holds.

DisableChannel(PowerThermalChannelId)

Disables the specified input channel so its value is not used by power/thermal algorithms that depend on it

Dispose()

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

GetChannelConfigurations()

Returns the set of channel configurations the producer supports or exposes.

GetChannelIds()

Retrieves the identifiers of channels the producer can publish to.

PublishInputChannelData(PowerThermalChannelData[])

Publishes one or more channel data samples to the producer's configured channels.

Start()

Starts the producer so it begins accepting and publishing channel data.

Stop()

Stops the producer from publishing channel data until it is started again.

Events

Name Description
BackEndStatusChanged

Raised when the backend status of a channel data producer changes, such as when the backend starts or stops.

Applies to