Class SimulatedC4001
Create a new simulated C4001 object
Assembly: C4001.dll
View Source
public class SimulatedC4001 : IC4001, ISensor, IDisposable
Implements:
Meadow.Foundation.Sensors.Motion.IC4001, Meadow.Peripherals.Sensors.ISensor, System.IDisposable
Methods
SetSensorMode(SensorMode)
Sets the sensor's operating mode (e.g., normal, low-power, or test mode).
View Source
public bool SetSensorMode(C4001.SensorMode mode)
Returns
System.Boolean: true if the mode was successfully set; otherwise, false.
Parameters
| Type | Name | Description |
|---|---|---|
| Meadow.Foundation.Sensors.Motion.C4001.SensorMode | mode | The Meadow.Foundation.Sensors.Motion.C4001.SensorMode to apply to the sensor. |
GetStatus()
Retrieves the current status of the sensor.
View Source
public C4001.SensorStatus GetStatus()
Returns
Meadow.Foundation.Sensors.Motion.C4001.SensorStatus: The current Meadow.Foundation.Sensors.Motion.C4001.SensorStatus indicating sensor readiness or errors.
GetTargetNumber()
Retrieves the ID or number of the current detected target.
View Source
public byte GetTargetNumber()
Returns
System.Byte: A byte representing the target number.
GetTargetSpeed()
Gets the speed of the detected target.
View Source
public Speed GetTargetSpeed()
Returns
Meadow.Units.Speed: A Meadow.Units.Speed value representing the target's speed in meters per second.
GetTargetRange()
Gets the range (distance) to the detected target.
View Source
public Length GetTargetRange()
Returns
Meadow.Units.Length: A Meadow.Units.Length value representing the target's range in meters.
GetTargetEnergy()
Gets the energy level or strength of the detected target signal.
View Source
public uint GetTargetEnergy()
Returns
System.UInt32: An unsigned integer representing the target's energy level.
IsMotionDetected()
Indicates whether motion is currently detected by the sensor.
View Source
public bool IsMotionDetected()
Returns
System.Boolean: true if motion is detected; otherwise, false.
StartSimulation(SimulationOptions?)
Start the approach/away simulation. Calling again restarts it with new options.
View Source
public void StartSimulation(SimulatedC4001.SimulationOptions? options = null)
Parameters
| Type | Name |
|---|---|
| Meadow.Foundation.Sensors.Motion.SimulatedC4001.SimulationOptions | options |
StopSimulation()
Stop the simulation and freeze values at their last state.
View Source
public void StopSimulation()
SetStatus(SensorStatus)
Manually set simulated status.
View Source
public void SetStatus(C4001.SensorStatus status)
Parameters
| Type | Name |
|---|---|
| Meadow.Foundation.Sensors.Motion.C4001.SensorStatus | status |
SetTarget(byte, Speed, Length, uint)
Manually set target properties for deterministic tests.
View Source
public void SetTarget(byte number, Speed speed, Length range, uint energy)
Parameters
| Type | Name |
|---|---|
System.Byte | number |
Meadow.Units.Speed | speed |
Meadow.Units.Length | range |
System.UInt32 | energy |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
public void Dispose()
SetDetectionRange(ushort, ushort, ushort)
Sets the detection range for the sensor.
View Source
public void SetDetectionRange(ushort min, ushort max, ushort trig)
Parameters
| Type | Name |
|---|---|
System.UInt16 | min |
System.UInt16 | max |
System.UInt16 | trig |
SetTrigSensitivity(byte)
Sets the trigger sensitivity for the sensor.
View Source
public void SetTrigSensitivity(byte sensitivity)
Parameters
| Type | Name |
|---|---|
System.Byte | sensitivity |
SetKeepSensitivity(byte)
Sets the keep sensitivity for the sensor, which determines the sensor's ability to maintain detection of a target once triggered.
View Source
public void SetKeepSensitivity(byte sensitivity)
Parameters
| Type | Name |
|---|---|
System.Byte | sensitivity |
Implements
- Meadow.Foundation.Sensors.Motion.IC4001
Meadow.Peripherals.Sensors.ISensorSystem.IDisposable