Esempio n. 1
0
        public static void TemporarySwitchOn(this MTRFXXAdapter adapter, byte channel, UInt16 interval)
        {
            byte b1     = (byte)interval;
            byte b2     = (byte)(interval >> 8);
            var  format = b2 == 0
                ? MTRFXXDataFormat.TemporarySwitchOnOneByte
                : MTRFXXDataFormat.TemporarySwitchOnTwoBytes;

            SendData(adapter, MTRFXXCommand.TemporarySwitchOn, false, channel, null, format, b1, b2);
        }
Esempio n. 2
0
 public static void BindStart(this MTRFXXAdapter adapter, byte channel)
 {
     adapter.SendCommand(MTRFXXMode.RX, MTRFXXAction.StartBinding, channel, MTRFXXCommand.None);
 }
Esempio n. 3
0
        private static void SendData(MTRFXXAdapter adapter, MTRFXXCommand command, bool useFMode, byte channel, UInt32?deviceId, MTRFXXDataFormat format, params byte[] data)
        {
            var ma = GetModeAndAction(useFMode, deviceId);

            adapter.SendCommand(ma.Item1, ma.Item2, channel, command, MTRFXXRepeatCount.NoRepeat, format, data, deviceId ?? 0);
        }
Esempio n. 4
0
 public static void SetBrightnessF(this MTRFXXAdapter adapter, byte channel, byte brightness, UInt32?deviceId = null)
 {
     SendData(adapter, MTRFXXCommand.SetBrightness, true, channel, deviceId, MTRFXXDataFormat.OneByteData, brightness);
 }
Esempio n. 5
0
 public static void SwitchF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null)
 {
     Send(adapter, MTRFXXCommand.Switch, true, channel, deviceId);
 }
Esempio n. 6
0
 public static void Off(this MTRFXXAdapter adapter, byte channel)
 {
     Send(adapter, MTRFXXCommand.Off, false, channel);
 }
Esempio n. 7
0
 public static void ReadState(this MTRFXXAdapter adapter, byte channel)
 {
     throw new NotSupportedException("Not supported in basic mode.");
 }
Esempio n. 8
0
 public static void ClearAllChannels(this MTRFXXAdapter adapter)
 {
     adapter.SendCommand(MTRFXXMode.RX, MTRFXXAction.ClearAllChannels, 0, MTRFXXCommand.None,
                         MTRFXXRepeatCount.NoRepeat, MTRFXXDataFormat.NoData, new byte[] { 170, 85, 170, 85 });
 }
Esempio n. 9
0
 public static void SwitchColorChangingF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null)
 {
     SendData(adapter, MTRFXXCommand.SwitchColorChanging, true, channel, deviceId, MTRFXXDataFormat.LED);
 }
Esempio n. 10
0
 public static void SwitchColorChanging(this MTRFXXAdapter adapter, byte channel)
 {
     SendData(adapter, MTRFXXCommand.SwitchColorChanging, false, channel, null, MTRFXXDataFormat.LED);
 }
Esempio n. 11
0
 public static void SetLedColorF(this MTRFXXAdapter adapter, byte channel, byte valueR, byte valueG, byte valueB, UInt32?deviceId = null)
 {
     SendData(adapter, MTRFXXCommand.SetBrightness, true, channel, deviceId, MTRFXXDataFormat.FourByteData, valueR, valueG, valueB);
 }
Esempio n. 12
0
 public static void SetLedColor(this MTRFXXAdapter adapter, byte channel, byte valueR, byte valueG, byte valueB)
 {
     SendData(adapter, MTRFXXCommand.SetBrightness, false, channel, null, MTRFXXDataFormat.FourByteData, valueR, valueG, valueB);
 }
Esempio n. 13
0
 public static void LoadPresetF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null)
 {
     Send(adapter, MTRFXXCommand.LoadPreset, true, channel, deviceId);
 }
Esempio n. 14
0
 public static void LoadPreset(this MTRFXXAdapter adapter, byte channel)
 {
     Send(adapter, MTRFXXCommand.LoadPreset, false, channel);
 }
Esempio n. 15
0
 public static void BindStop(this MTRFXXAdapter adapter)
 {
     adapter.SendCommand(MTRFXXMode.RX, MTRFXXAction.StopBinding, 0, MTRFXXCommand.None);
 }
Esempio n. 16
0
 public static void ClearChannel(this MTRFXXAdapter adapter, byte channel)
 {
     adapter.SendCommand(MTRFXXMode.RX, MTRFXXAction.ClearChannel, channel, MTRFXXCommand.None);
 }
Esempio n. 17
0
        private static void Send(MTRFXXAdapter adapter, MTRFXXCommand command, bool useFMode, byte channel = 0, UInt32?deviceId = null)
        {
            var ma = GetModeAndAction(useFMode, deviceId);

            adapter.SendCommand(ma.Item1, ma.Item2, channel, command, target: deviceId ?? 0);
        }
Esempio n. 18
0
 public static void ExitServiceMode(this MTRFXXAdapter adapter)
 {
     adapter.SendCommand(MTRFXXMode.Service, MTRFXXAction.SendCommand, 0, MTRFXXCommand.None);
 }
Esempio n. 19
0
 public static void ChangeLedColorSpeed(this MTRFXXAdapter adapter, byte channel)
 {
     SendData(adapter, MTRFXXCommand.ChangeColorSpeed, false, channel, null, MTRFXXDataFormat.LED);
 }
Esempio n. 20
0
 public static void ReadStateF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null)
 {
     SendReadState(adapter, channel);
 }
Esempio n. 21
0
 public static void ChangeLedColorSpeedF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null)
 {
     SendData(adapter, MTRFXXCommand.ChangeColorSpeed, true, channel, deviceId, MTRFXXDataFormat.LED);
 }
Esempio n. 22
0
 public static void Switch(this MTRFXXAdapter adapter, byte channel)
 {
     Send(adapter, MTRFXXCommand.Switch, false, channel);
 }
Esempio n. 23
0
 public static void UnbindF(this MTRFXXAdapter adapter, byte channel)
 {
     Send(adapter, MTRFXXCommand.Unbind, true, channel);
 }
Esempio n. 24
0
 private static void SendReadState(this MTRFXXAdapter adapter, byte channel)
 {
     adapter.SendCommand(MTRFXXMode.TXF, MTRFXXAction.SendCommand, channel, MTRFXXCommand.ReadState);
 }
Esempio n. 25
0
 public static void SetBrightness(this MTRFXXAdapter adapter, byte channel, byte brightness)
 {
     SendData(adapter, MTRFXXCommand.SetBrightness, false, channel, null, MTRFXXDataFormat.OneByteData, brightness);
 }