黄学彪
2021-01-28 291b8c485ac4095c3c20570602cce9c91d7f45b8
HDL_ON/UI/1-test-/TestDialog.cs
@@ -46,98 +46,98 @@
            //{
            //};
            #region 蓝牙测试
            if (testType == 1)
            {
                var bc = new MyBlufiClient();
            //if (testType == 1)
            //{
            //    var bc = new MyBlufiClient();
                Dictionary<string, string> ids = new Dictionary<string, string>();
                Action<string,string> action = (name,uuid) => {
                    if (!ids.ContainsKey(uuid))
                    {
                        ids.Add(uuid, name);
                    }
                };
                bc.SetBlufiDeviceDelegate(action);
            //    Dictionary<string, string> ids = new Dictionary<string, string>();
            //    Action<string,string> action = (name,uuid) => {
            //        if (!ids.ContainsKey(uuid))
            //        {
            //            ids.Add(uuid, name);
            //        }
            //    };
            //    bc.SetBlufiDeviceDelegate(action);
                var btn5 = new Button()
                {
                    Height = Application.GetRealHeight(60),
                    BorderColor = CSS.CSS_Color.AuxiliaryColor2,
                    BorderWidth = (uint)Application.GetRealWidth(5),
                    TextColor = 0xFF000000,
                    TextAlignment = TextAlignment.Center,
                    Text = "停止搜索"
                };
                contentView.AddChidren(btn5);
                btn5.MouseUpEventHandler = (d, d1) =>
                {
                    bc.StopScanBlufi();
                };
            //    var btn5 = new Button()
            //    {
            //        Height = Application.GetRealHeight(60),
            //        BorderColor = CSS.CSS_Color.AuxiliaryColor2,
            //        BorderWidth = (uint)Application.GetRealWidth(5),
            //        TextColor = 0xFF000000,
            //        TextAlignment = TextAlignment.Center,
            //        Text = "停止搜索"
            //    };
            //    contentView.AddChidren(btn5);
            //    btn5.MouseUpEventHandler = (d, d1) =>
            //    {
            //        bc.StopScanBlufi();
            //    };
                var btn1 = new Button()
                {
                    Height = Application.GetRealHeight(60),
                    BorderColor = CSS.CSS_Color.AuxiliaryColor2,
                    BorderWidth = (uint)Application.GetRealWidth(5),
                    TextColor = 0xFF000000,
                    Text = "搜索蓝牙",
                    TextAlignment = TextAlignment.Center,
                };
                contentView.AddChidren(btn1);
            //    var btn1 = new Button()
            //    {
            //        Height = Application.GetRealHeight(60),
            //        BorderColor = CSS.CSS_Color.AuxiliaryColor2,
            //        BorderWidth = (uint)Application.GetRealWidth(5),
            //        TextColor = 0xFF000000,
            //        Text = "搜索蓝牙",
            //        TextAlignment = TextAlignment.Center,
            //    };
            //    contentView.AddChidren(btn1);
                btn1.MouseUpEventHandler = (d, d1) =>
                {
                    bc.ScanBlufi();
                };
            //    btn1.MouseUpEventHandler = (d, d1) =>
            //    {
            //        bc.ScanBlufi();
            //    };
                var btn2 = new Button()
                {
                    Height = Application.GetRealHeight(60),
                    BorderColor = CSS.CSS_Color.AuxiliaryColor2,
                    BorderWidth = (uint)Application.GetRealWidth(5),
                    TextColor = 0xFF000000,
                    TextAlignment = TextAlignment.Center,
                    Text = "链接蓝牙"
                };
                contentView.AddChidren(btn2);
                btn2.MouseUpEventHandler = (d, d1) =>
                {
                    var blufiId = "1DA9BDF2-F12D-A63A-FC44-C28AE225DA6A";
                    bc.ConnectionBlufi(blufiId);
            //    var btn2 = new Button()
            //    {
            //        Height = Application.GetRealHeight(60),
            //        BorderColor = CSS.CSS_Color.AuxiliaryColor2,
            //        BorderWidth = (uint)Application.GetRealWidth(5),
            //        TextColor = 0xFF000000,
            //        TextAlignment = TextAlignment.Center,
            //        Text = "链接蓝牙"
            //    };
            //    contentView.AddChidren(btn2);
            //    btn2.MouseUpEventHandler = (d, d1) =>
            //    {
            //        var blufiId = "1DA9BDF2-F12D-A63A-FC44-C28AE225DA6A";
            //        bc.ConnectionBlufi(blufiId);
                    
                };
                var btn3 = new Button()
                {
                    Height = Application.GetRealHeight(60),
                    BorderColor = CSS.CSS_Color.AuxiliaryColor2,
                    BorderWidth = (uint)Application.GetRealWidth(5),
                    TextColor = 0xFF000000,
                    TextAlignment = TextAlignment.Center,
                    Text = "发送数据"
                };
                contentView.AddChidren(btn3);
                btn3.MouseUpEventHandler = (d, d1) =>
                {
                    bc.SendMsg("dddlasfjlaskjdflkasjkdfjhaskljdhfklajhf");
                };
            //    };
            //    var btn3 = new Button()
            //    {
            //        Height = Application.GetRealHeight(60),
            //        BorderColor = CSS.CSS_Color.AuxiliaryColor2,
            //        BorderWidth = (uint)Application.GetRealWidth(5),
            //        TextColor = 0xFF000000,
            //        TextAlignment = TextAlignment.Center,
            //        Text = "发送数据"
            //    };
            //    contentView.AddChidren(btn3);
            //    btn3.MouseUpEventHandler = (d, d1) =>
            //    {
            //        bc.SendMsg("dddlasfjlaskjdflkasjkdfjhaskljdhfklajhf");
            //    };
                var btn4 = new Button()
                {
                    Height = Application.GetRealHeight(60),
                    BorderColor = CSS.CSS_Color.AuxiliaryColor2,
                    BorderWidth = (uint)Application.GetRealWidth(5),
                    TextColor = 0xFF000000,
                    TextAlignment = TextAlignment.Center,
                    Text = "断开蓝牙链接"
                };
                contentView.AddChidren(btn4);
                btn4.MouseUpEventHandler = (d, d1) =>
                {
                    bc.CloseConnectionBlufi();
                };
            //    var btn4 = new Button()
            //    {
            //        Height = Application.GetRealHeight(60),
            //        BorderColor = CSS.CSS_Color.AuxiliaryColor2,
            //        BorderWidth = (uint)Application.GetRealWidth(5),
            //        TextColor = 0xFF000000,
            //        TextAlignment = TextAlignment.Center,
            //        Text = "断开蓝牙链接"
            //    };
            //    contentView.AddChidren(btn4);
            //    btn4.MouseUpEventHandler = (d, d1) =>
            //    {
            //        bc.CloseConnectionBlufi();
            //    };
            }
            //}
            #endregion