wxr
2021-07-01 43b0d5870d528f23ecd6aeceb6cfd4325188b46f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//using System;
//using System.Collections.Generic;
//using Shared;
 
//namespace HDL_ON.UI.test
//{
//    public class TestDialog
//    {
//        Dialog dialog;
//        public TestDialog()
//        {
//            dialog = new Dialog();
//        }
 
 
//        public void InitView()
//        {
//            //测试类型
//            //1: 蓝牙测试
//            int testType = 1;
//            var bodyView = new FrameLayout()
//            {
//                BackgroundColor = CSS.CSS_Color.MainBackgroundColor
//            };
//            dialog.AddChidren(bodyView);
 
 
//            var contentView = new VerticalScrolViewLayout()
//            {
//                Y = Application.GetRealHeight(63),
//                BackgroundColor = CSS.CSS_Color.BackgroundColor,
//            };
//            bodyView.AddChidren(contentView);
 
//            //var btn = new Button()
//            //{
//            //    Height = Application.GetRealHeight(60),
//            //    BorderColor = CSS.CSS_Color.AuxiliaryColor2,
//            //    BorderWidth = (uint)Application.GetRealWidth(5),
//            //    TextColor = 0xFF000000,
//            //    TextAlignment =TextAlignment.Center,
//            //    Text = ""
//            //};
//            //contentView.AddChidren(btn);
//            //btn.MouseUpEventHandler = (d, d1) =>
//            //{
//            //};
//            #region 蓝牙测试
//            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);
 
//                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);
 
//                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 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();
//                };
 
 
//            }
//            #endregion
 
 
 
 
 
//            dialog.Show();
//        }
 
//    }
//}