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); }
public static void BindStart(this MTRFXXAdapter adapter, byte channel) { adapter.SendCommand(MTRFXXMode.RX, MTRFXXAction.StartBinding, channel, MTRFXXCommand.None); }
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); }
public static void SetBrightnessF(this MTRFXXAdapter adapter, byte channel, byte brightness, UInt32?deviceId = null) { SendData(adapter, MTRFXXCommand.SetBrightness, true, channel, deviceId, MTRFXXDataFormat.OneByteData, brightness); }
public static void SwitchF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null) { Send(adapter, MTRFXXCommand.Switch, true, channel, deviceId); }
public static void Off(this MTRFXXAdapter adapter, byte channel) { Send(adapter, MTRFXXCommand.Off, false, channel); }
public static void ReadState(this MTRFXXAdapter adapter, byte channel) { throw new NotSupportedException("Not supported in basic mode."); }
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 }); }
public static void SwitchColorChangingF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null) { SendData(adapter, MTRFXXCommand.SwitchColorChanging, true, channel, deviceId, MTRFXXDataFormat.LED); }
public static void SwitchColorChanging(this MTRFXXAdapter adapter, byte channel) { SendData(adapter, MTRFXXCommand.SwitchColorChanging, false, channel, null, MTRFXXDataFormat.LED); }
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); }
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); }
public static void LoadPresetF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null) { Send(adapter, MTRFXXCommand.LoadPreset, true, channel, deviceId); }
public static void LoadPreset(this MTRFXXAdapter adapter, byte channel) { Send(adapter, MTRFXXCommand.LoadPreset, false, channel); }
public static void BindStop(this MTRFXXAdapter adapter) { adapter.SendCommand(MTRFXXMode.RX, MTRFXXAction.StopBinding, 0, MTRFXXCommand.None); }
public static void ClearChannel(this MTRFXXAdapter adapter, byte channel) { adapter.SendCommand(MTRFXXMode.RX, MTRFXXAction.ClearChannel, channel, MTRFXXCommand.None); }
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); }
public static void ExitServiceMode(this MTRFXXAdapter adapter) { adapter.SendCommand(MTRFXXMode.Service, MTRFXXAction.SendCommand, 0, MTRFXXCommand.None); }
public static void ChangeLedColorSpeed(this MTRFXXAdapter adapter, byte channel) { SendData(adapter, MTRFXXCommand.ChangeColorSpeed, false, channel, null, MTRFXXDataFormat.LED); }
public static void ReadStateF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null) { SendReadState(adapter, channel); }
public static void ChangeLedColorSpeedF(this MTRFXXAdapter adapter, byte channel, UInt32?deviceId = null) { SendData(adapter, MTRFXXCommand.ChangeColorSpeed, true, channel, deviceId, MTRFXXDataFormat.LED); }
public static void Switch(this MTRFXXAdapter adapter, byte channel) { Send(adapter, MTRFXXCommand.Switch, false, channel); }
public static void UnbindF(this MTRFXXAdapter adapter, byte channel) { Send(adapter, MTRFXXCommand.Unbind, true, channel); }
private static void SendReadState(this MTRFXXAdapter adapter, byte channel) { adapter.SendCommand(MTRFXXMode.TXF, MTRFXXAction.SendCommand, channel, MTRFXXCommand.ReadState); }
public static void SetBrightness(this MTRFXXAdapter adapter, byte channel, byte brightness) { SendData(adapter, MTRFXXCommand.SetBrightness, false, channel, null, MTRFXXDataFormat.OneByteData, brightness); }