Udostępnij za pośrednictwem


Accelerometer.ReportInterval Property

Definition

Gets or sets the current report interval for the accelerometer.

public:
 property unsigned int ReportInterval { unsigned int get(); void set(unsigned int value); };
uint32_t ReportInterval();

void ReportInterval(uint32_t value);
public uint ReportInterval { get; set; }
var uInt32 = accelerometer.reportInterval;
accelerometer.reportInterval = uInt32;
Public Property ReportInterval As UInteger

Property Value

UInt32

unsigned int

uint32_t

The current report interval, in milliseconds.

Remarks

The report interval is set to a default value that varies based on the sensor driver’s implementation. If your app does not want to use this default value, you should set the report interval to a non-zero value prior to registering an event handler or calling GetCurrentReading. The sensor then attempts to allocate resources to satisfy the application’s requirements while balancing the needs of other apps using the sensor.

Changes to the report interval after an event handler has been registered, or GetCurrentReading has been called, might apply to the delivery of subsequent sensor readings.

Conversely, when an application is finished with the sensor, it should explicitly return the sensor to its default report interval by setting it to zero. This is important for power conservation, especially when using a language that might keep the sensor object active for an indefinite period prior to garbage collection.

The application should consult the MinimumReportInterval property prior to setting the report interval to ensure that the sensor can honor the requested report interval. Setting a value below the minimum supported interval either triggers an exception or has undefined results.

Although the application can set this value to request a particular report interval, the driver determines the actual report interval, based on internal logic. For example, the driver might use the shortest report interval that is requested by any caller.

If the value is set to zero, the driver uses its default report interval. As with requesting a specific interval, the driver might choose a different interval based on other client requests and internal logic.

Applies to