using System;
|
namespace Shared.SimpleControl.Phone
|
{
|
public class SendControl
|
{
|
//public SendControl ()
|
//{
|
//}
|
|
/// <summary>
|
/// //2020-02-10 带返回结果的调光控制
|
/// </summary>
|
/// <param name="mLightCommon"></param>
|
/// <param name="sendBytes"></param>
|
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;
|
}
|
|
///// <summary>
|
///// //2020-02-10 带返回结果的修改窗帘状态
|
///// </summary>
|
///// <param name="mCurtainCommon"></param>
|
///// <param name="sendBytes"></param>
|
//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) {
|
|
}
|
}
|
}
|