using System; namespace Shared.SimpleControl.Phone { public class SendControl { //public SendControl () //{ //} /// /// //2020-02-10 带返回结果的调光控制 /// /// /// public static void SendControlSetSingleLight (Common mLightCommon, byte [] sendBytes) { MainPage.Loading.Start ("Sending..."); System.Threading.Tasks.Task.Run (() => { byte [] returnBytes = Control.ControlBytesSendHasReturn (Command.SetSingleLight, mLightCommon.SubnetID, mLightCommon.DeviceID, sendBytes); Application.RunOnMainThread (() => { if (returnBytes == null) { new Alert ("", mLightCommon.Name + ErrorCode.ControlFailure, "Close").Show (); } MainPage.Loading.Hide (); }); }); } public static int GetSendBrightness (bool IsSelected) { return IsSelected ? 0 : 100; } ///// ///// //2020-02-10 带返回结果的修改窗帘状态 ///// ///// ///// //public static void SendControlUpdataCurtain (Common mCurtainCommon, byte [] sendBytes) //{ // MainPage.Loading.Start ("Sending..."); // System.Threading.Tasks.Task.Run (() => { // byte [] returnBytes = Control.ControlBytesSendHasReturn (Command.UpdataCurtainModelStutas, mCurtainCommon.SubnetID, mCurtainCommon.DeviceID, sendBytes); // Application.RunOnMainThread (() => { // if (returnBytes == null) { // new Alert ("", mCurtainCommon.Name + ErrorCode.ControlFailure, "Close").Show (); // } // MainPage.Loading.Hide (); // }); // }); //} public static void CheckIfShowError(byte [] mReturnBytes) { } } }