コード例 #1
0
        public override IBandSensorReading CreateReading()
        {
            // Change the reading every now and again.
            if (_readingCount++ % 20 == 0)
            {
                State = new FakeBandDeviceContactReading((BandContactState)((int)(State.State + 1) % 2));
            }

            _readingCount++;
            return(State);
        }
コード例 #2
0
 public FakeDeviceContactSensor(BandTypeConstants bandType) :
     base(new List <BandType>
 {
     BandType.Cargo,
     BandType.Envoy
 }, new Dictionary <TimeSpan, SubscriptionType>
 {
     {
         TimeSpan.Zero,
         SubscriptionType.DeviceContact
     }
 }, bandType)
 {
     State = new FakeBandDeviceContactReading(BandContactState.Worn);
 }