Skip to main content

Class SimulatedC4001

Create a new simulated C4001 object

Assembly: C4001.dll​
View Source​
Declaration
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​
Declaration
public bool SetSensorMode(C4001.SensorMode mode)
Returns​

System.Boolean: true if the mode was successfully set; otherwise, false.

Parameters​
TypeNameDescription
Meadow.Foundation.Sensors.Motion.C4001.SensorModemodeThe Meadow.Foundation.Sensors.Motion.C4001.SensorMode to apply to the sensor.

GetStatus()​

Retrieves the current status of the sensor.

View Source​
Declaration
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​
Declaration
public byte GetTargetNumber()
Returns​

System.Byte: A byte representing the target number.

GetTargetSpeed()​

Gets the speed of the detected target.

View Source​
Declaration
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​
Declaration
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​
Declaration
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​
Declaration
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​
Declaration
public void StartSimulation(SimulatedC4001.SimulationOptions? options = null)
Parameters​
TypeName
Meadow.Foundation.Sensors.Motion.SimulatedC4001.SimulationOptionsoptions

StopSimulation()​

Stop the simulation and freeze values at their last state.

View Source​
Declaration
public void StopSimulation()

SetStatus(SensorStatus)​

Manually set simulated status.

View Source​
Declaration
public void SetStatus(C4001.SensorStatus status)
Parameters​
TypeName
Meadow.Foundation.Sensors.Motion.C4001.SensorStatusstatus

SetTarget(byte, Speed, Length, uint)​

Manually set target properties for deterministic tests.

View Source​
Declaration
public void SetTarget(byte number, Speed speed, Length range, uint energy)
Parameters​
TypeName
System.Bytenumber
Meadow.Units.Speedspeed
Meadow.Units.Lengthrange
System.UInt32energy

Dispose()​

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

View Source​
Declaration
public void Dispose()

SetDetectionRange(ushort, ushort, ushort)​

Sets the detection range for the sensor.

View Source​
Declaration
public void SetDetectionRange(ushort min, ushort max, ushort trig)
Parameters​
TypeName
System.UInt16min
System.UInt16max
System.UInt16trig

SetTrigSensitivity(byte)​

Sets the trigger sensitivity for the sensor.

View Source​
Declaration
public void SetTrigSensitivity(byte sensitivity)
Parameters​
TypeName
System.Bytesensitivity

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​
Declaration
public void SetKeepSensitivity(byte sensitivity)
Parameters​
TypeName
System.Bytesensitivity

Implements​