|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Buffers.Text;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
@ -10,17 +11,23 @@ using System.Linq;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Markup;
|
|
|
|
|
using System.Xml;
|
|
|
|
|
using GalaSoft.MvvmLight.Command;
|
|
|
|
|
using K4os.Compression.LZ4.Streams.Abstractions;
|
|
|
|
|
using Mesnac.Log;
|
|
|
|
|
using Microsoft.Xaml.Behaviors.Core;
|
|
|
|
|
using Org.BouncyCastle.Utilities.Encoders;
|
|
|
|
|
using TouchSocket.Core;
|
|
|
|
|
using TouchSocket.Sockets;
|
|
|
|
|
using ZstdSharp.Unsafe;
|
|
|
|
|
|
|
|
|
|
namespace SocketExample
|
|
|
|
|
{
|
|
|
|
@ -32,10 +39,15 @@ namespace SocketExample
|
|
|
|
|
|
|
|
|
|
public class PanelItem : INotifyPropertyChanged //实现组件更改的接口
|
|
|
|
|
{
|
|
|
|
|
#region 变量定义
|
|
|
|
|
IPAddress ip;
|
|
|
|
|
int port;
|
|
|
|
|
TcpClient client;
|
|
|
|
|
public string option;//命令选项
|
|
|
|
|
public ICommand SelectionChangedCommand { get; }
|
|
|
|
|
|
|
|
|
|
public ICommand GPOSelectionChangedCommand { get; }
|
|
|
|
|
|
|
|
|
|
private ObservableCollection<TagItem> _tagItems;
|
|
|
|
|
public ObservableCollection<TagItem> TagItems { get => _tagItems; set { _tagItems = value; OnPropertyChanged(); } }
|
|
|
|
|
public string Text { get; set; }//客户端编号
|
|
|
|
@ -80,6 +92,9 @@ namespace SocketExample
|
|
|
|
|
private string _port3writetext;
|
|
|
|
|
private string _port4writetext;//设置读功率1-4
|
|
|
|
|
|
|
|
|
|
private int[] _portComboBox;
|
|
|
|
|
private string[] _gpoComboBox;
|
|
|
|
|
|
|
|
|
|
public string Port1ReadText { get => _port1readtext; set { _port1readtext = value; OnPropertyChanged(); } }
|
|
|
|
|
public string Port2ReadText { get => _port2readtext; set { _port2readtext = value; OnPropertyChanged(); } }
|
|
|
|
|
public string Port3ReadText { get => _port3readtext; set { _port3readtext = value; OnPropertyChanged(); } }
|
|
|
|
@ -89,6 +104,9 @@ namespace SocketExample
|
|
|
|
|
public string Port2WriteText { get => _port2writetext; set { _port2writetext = value; OnPropertyChanged(); } }
|
|
|
|
|
public string Port3WriteText { get => _port3writetext; set { _port3writetext = value; OnPropertyChanged(); } }
|
|
|
|
|
public string Port4WriteText { get => _port4writetext; set { _port4writetext = value; OnPropertyChanged(); } }
|
|
|
|
|
public int[] PortComboBox { get => _portComboBox; set { _portComboBox = value; OnPropertyChanged(); } }
|
|
|
|
|
public string[] GPOComboBox { get => _gpoComboBox;set { _gpoComboBox = value; OnPropertyChanged(); } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string _gpo1;
|
|
|
|
|
private string _gpo2;
|
|
|
|
@ -134,6 +152,10 @@ namespace SocketExample
|
|
|
|
|
|
|
|
|
|
public LinkCommand getpowercomn;//获取功率
|
|
|
|
|
|
|
|
|
|
public LinkCommand powerselectchanged;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public PanelItem(int index)
|
|
|
|
|
{
|
|
|
|
|
Text = $"客户端{index + 1}";
|
|
|
|
@ -144,6 +166,9 @@ namespace SocketExample
|
|
|
|
|
clearcomn = new LinkCommand(Button_clear);//绑定清空按钮的事件
|
|
|
|
|
setpowercomn = new LinkCommand(Button_SetPower);
|
|
|
|
|
getpowercomn = new LinkCommand(Button_GetPower);
|
|
|
|
|
SelectionChangedCommand = new RelayCommand<ComboBox>(ComboBox_SelectChanged);
|
|
|
|
|
GPOSelectionChangedCommand = new RelayCommand<ComboBox>(GPOComboBox_SelectChanged);
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -157,6 +182,9 @@ namespace SocketExample
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//页面初始化
|
|
|
|
|
int[] Powerdatasource = {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};
|
|
|
|
|
string[] GPOdatasource = {"高","低"};
|
|
|
|
|
|
|
|
|
|
MessageText = string.Empty;
|
|
|
|
|
IPtext = "192.168.0.7";//默认IP
|
|
|
|
|
Porttext = "20108";//默认端口
|
|
|
|
@ -166,6 +194,8 @@ namespace SocketExample
|
|
|
|
|
Countinfo = "00";
|
|
|
|
|
EPCASC = "###";
|
|
|
|
|
EPCinfo = "###";
|
|
|
|
|
PortComboBox = Powerdatasource;
|
|
|
|
|
GPOComboBox = GPOdatasource;
|
|
|
|
|
GPO1 = "低";
|
|
|
|
|
GPO2 = "低";
|
|
|
|
|
GPO3 = "低";
|
|
|
|
@ -175,6 +205,8 @@ namespace SocketExample
|
|
|
|
|
GPI3 = "低";
|
|
|
|
|
GPI4 = "低";
|
|
|
|
|
}
|
|
|
|
|
#region 界面功能绑定定义
|
|
|
|
|
public LinkCommand _powerselectchanged { get { return powerselectchanged; } }
|
|
|
|
|
|
|
|
|
|
public LinkCommand _linkcomn { get { return linkcomn; } }
|
|
|
|
|
|
|
|
|
@ -187,7 +219,9 @@ namespace SocketExample
|
|
|
|
|
public LinkCommand _clearcomn { get { return clearcomn; } }
|
|
|
|
|
public LinkCommand _setpowercomn { get { return setpowercomn; } }
|
|
|
|
|
public LinkCommand _getpowercomn { get { return getpowercomn; } }
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region socket事件
|
|
|
|
|
|
|
|
|
|
private Task onSend(ITcpClient client, ReceivedDataEventArgs e)
|
|
|
|
|
{
|
|
|
|
@ -199,18 +233,19 @@ namespace SocketExample
|
|
|
|
|
private Task onRecieved(ITcpClient client, ReceivedDataEventArgs e) //接收事件
|
|
|
|
|
{
|
|
|
|
|
string time = DateTime.Now.ToString();
|
|
|
|
|
string currentTime = time.Substring(10, time.Length-10);
|
|
|
|
|
string currentTime = time.Substring(9, time.Length-9);
|
|
|
|
|
var mes = e.ByteBlock.Span.ToString(Encoding.UTF8);
|
|
|
|
|
byte[] data = e.ByteBlock.Span.ToArray();
|
|
|
|
|
string hexString = BitConverter.ToString(data).Replace("-", " ");
|
|
|
|
|
|
|
|
|
|
Infotext += $"({currentTime})客户端接收到信息:\n{hexString}\n\n";
|
|
|
|
|
|
|
|
|
|
//读取状态
|
|
|
|
|
string readStateString = hexString.Replace(" ", "");//去掉字符串中空格
|
|
|
|
|
string dataLength = readStateString.Substring(4, 2);//获取字符串中内容长度
|
|
|
|
|
string commandState = readStateString.Substring(6, 2);//获取命令
|
|
|
|
|
|
|
|
|
|
if(commandState != "81")
|
|
|
|
|
Infotext += $"({currentTime})客户端接收到信息:\n{hexString}\n\n";
|
|
|
|
|
|
|
|
|
|
int i = Convert.ToInt32(dataLength, 16);
|
|
|
|
|
if (i != 0)
|
|
|
|
|
{
|
|
|
|
@ -318,17 +353,31 @@ namespace SocketExample
|
|
|
|
|
//获取功率信息
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string tempReadstate = "";
|
|
|
|
|
string tempWritestate = "";
|
|
|
|
|
for (int n = 0;n < (Convert.ToInt32(dataLength,16)/5);n++)
|
|
|
|
|
{
|
|
|
|
|
tempReadstate += $"端口{n+1}:{(Convert.ToInt32(readStateString.Substring(12+10*n,4),16)/100).ToString()} ";
|
|
|
|
|
tempWritestate += $"端口{n + 1}:{(Convert.ToInt32(readStateString.Substring(16 + 10 * n, 4), 16) / 100).ToString()} ";
|
|
|
|
|
switch (n)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
Port1ReadText = $"{(Convert.ToInt32(readStateString.Substring(12 + 10 * n, 4), 16) / 100).ToString()}";
|
|
|
|
|
Port1WriteText = $"{(Convert.ToInt32(readStateString.Substring(16 + 10 * n, 4), 16) / 100).ToString()}";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
Port2ReadText = $"{(Convert.ToInt32(readStateString.Substring(12 + 10 * n, 4), 16) / 100).ToString()}";
|
|
|
|
|
Port2WriteText = $"{(Convert.ToInt32(readStateString.Substring(16 + 10 * n, 4), 16) / 100).ToString()}";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
Port3ReadText = $"{(Convert.ToInt32(readStateString.Substring(12 + 10 * n, 4), 16) / 100).ToString()}";
|
|
|
|
|
Port3WriteText = $"{(Convert.ToInt32(readStateString.Substring(16 + 10 * n, 4), 16) / 100).ToString()}";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
Port4ReadText = $"{(Convert.ToInt32(readStateString.Substring(12 + 10 * n, 4), 16) / 100).ToString()}";
|
|
|
|
|
Port4WriteText = $"{(Convert.ToInt32(readStateString.Substring(16 + 10 * n, 4), 16) / 100).ToString()}";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ReadPowerState = tempReadstate;
|
|
|
|
|
WritePowerState = tempWritestate;
|
|
|
|
|
tempReadstate = "";
|
|
|
|
|
tempWritestate = "";
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
@ -409,21 +458,45 @@ namespace SocketExample
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
|
|
|
|
|
data = strToToHexByte("AA 55 00 81 81 0D");//获取GPIO状态
|
|
|
|
|
data = strToToHexByte("AA 55 00 72 72 0D");//获取功率状态
|
|
|
|
|
client.Send(data);
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
|
|
|
|
|
data = strToToHexByte("AA 55 00 72 72 0D");//获取功率状态
|
|
|
|
|
data = strToToHexByte("AA 55 00 81 81 0D");//获取GPIO状态
|
|
|
|
|
client.Send(data);
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
|
|
|
|
|
data = strToToHexByte("AA 55 02 02 03 E8 EB 0D");//获取1000ms内标签信息
|
|
|
|
|
client.Send(data);
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thread GPIOthread = new Thread(new ThreadStart(delegate () { byte[] data = strToToHexByte("AA 55 00 81 81 0D"); client.Send(data); Thread.Sleep(3000); }));
|
|
|
|
|
//GPIOthread.Start();
|
|
|
|
|
return EasyTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 辅助功能
|
|
|
|
|
static void GetGPIOThread(ITcpClient client)
|
|
|
|
|
{
|
|
|
|
|
byte[] data = strToToHexByte("AA 55 00 81 81 0D");//获取GPIO状态
|
|
|
|
|
client.Send(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public byte GetXor(byte[] data,int m)
|
|
|
|
|
{
|
|
|
|
|
byte CheckCode = 0;
|
|
|
|
|
int len = data.Length;
|
|
|
|
|
for (int i = m; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
CheckCode ^= data[i];
|
|
|
|
|
}
|
|
|
|
|
return CheckCode;
|
|
|
|
|
}
|
|
|
|
|
private static byte[] HextoByte(string Temp)
|
|
|
|
|
{
|
|
|
|
|
byte[] Tempbytes = new byte[Temp.Length / 2];//16进制转byte数组
|
|
|
|
@ -459,6 +532,9 @@ namespace SocketExample
|
|
|
|
|
streamWriter.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 动态界面控件功能
|
|
|
|
|
async void Button_Link()//链接按钮的事件
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
@ -502,30 +578,23 @@ namespace SocketExample
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if(_port1readtext == null || _port1writetext == null|| _port2readtext == null || _port2writetext == null || _port3readtext == null || _port3writetext == null || _port4readtext == null || _port4writetext == null)
|
|
|
|
|
if(Port1ReadText == null || Port1WriteText == null|| Port2ReadText == null || Port2WriteText == null || Port3ReadText == null || Port3WriteText == null || Port4ReadText == null || Port4WriteText == null)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("数值不可为空!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string setPowerString = "AA 55 14 42 ";//设置命令开头
|
|
|
|
|
int[] powers = new int[8] {int.Parse(_port1readtext),int.Parse(_port2readtext), int.Parse(_port3readtext), int.Parse(_port4readtext),
|
|
|
|
|
int.Parse(_port1writetext),int.Parse(_port2writetext),int.Parse(_port3writetext),int.Parse(_port4writetext)};
|
|
|
|
|
int[] powers = new int[8] {int.Parse(Port1ReadText),int.Parse(Port2ReadText), int.Parse(Port3ReadText), int.Parse(Port4ReadText),
|
|
|
|
|
int.Parse(Port1WriteText),int.Parse(Port2WriteText),int.Parse(Port3WriteText),int.Parse(Port4WriteText)};
|
|
|
|
|
for (int i = 0; i < powers.Length/2; i++) {
|
|
|
|
|
setPowerString += $"0{i+1} {(powers[i]*100).ToString("X").PadLeft(4,'0').Insert(2," ")} {(powers[i+4] * 100).ToString("X").PadLeft(4, '0').Insert(2, " ")} ";
|
|
|
|
|
}//功率设置时为两位数,乘100后再转换为16进制字符串,再填满左侧保证4位数,最后两位两位隔开
|
|
|
|
|
setPowerString += "52 0D";//命令结尾
|
|
|
|
|
byte[] powerdata = strToToHexByte(setPowerString);
|
|
|
|
|
byte xor = GetXor(powerdata,2);//计算校验位
|
|
|
|
|
setPowerString += Convert.ToString(xor,16) + " 0D";//校验位需转成16进制字符串,命令结尾
|
|
|
|
|
byte[] data = strToToHexByte(setPowerString);
|
|
|
|
|
client.Send(data);
|
|
|
|
|
|
|
|
|
|
byte[] confirmdata1 = strToToHexByte("AA 55 05 5F ");//保存命令
|
|
|
|
|
byte[] confirmdata2 = System.Text.Encoding.UTF8.GetBytes("\"SAVE\" ");
|
|
|
|
|
byte[] confirmdata3 = strToToHexByte("01 5A 0D");
|
|
|
|
|
|
|
|
|
|
byte[] confirmdata = new byte[confirmdata1.Length+ confirmdata2.Length+ confirmdata3.Length];
|
|
|
|
|
confirmdata1.CopyTo(confirmdata,0);
|
|
|
|
|
confirmdata2.CopyTo(confirmdata,confirmdata1.Length);
|
|
|
|
|
confirmdata3.CopyTo(confirmdata,confirmdata1.Length+ confirmdata2.Length);//保存命令拼接
|
|
|
|
|
client.Send(confirmdata);
|
|
|
|
|
Infotext += setPowerString;
|
|
|
|
|
data = strToToHexByte("AA 55 00 72 72 0D");//获取功率
|
|
|
|
|
client.Send(data);
|
|
|
|
|
}
|
|
|
|
@ -538,8 +607,16 @@ namespace SocketExample
|
|
|
|
|
|
|
|
|
|
void Button_GetPower()
|
|
|
|
|
{
|
|
|
|
|
byte[] data = strToToHexByte("AA 55 00 72 72 0D");//获取功率
|
|
|
|
|
client.Send(data);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
byte[] data = strToToHexByte("AA 55 00 72 72 0D");//获取功率
|
|
|
|
|
client.Send(data);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Infotext += ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Button_Click_Send()//发送按钮的事件
|
|
|
|
@ -572,7 +649,108 @@ namespace SocketExample
|
|
|
|
|
void Button_clear()
|
|
|
|
|
{
|
|
|
|
|
Infotext = string.Empty;//清空信息框
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ComboBox_SelectChanged(ComboBox sender)
|
|
|
|
|
{
|
|
|
|
|
string comboxname = sender.Name;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
switch (comboxname)
|
|
|
|
|
{
|
|
|
|
|
case "Port1ReadComboBox":
|
|
|
|
|
Port1ReadText = sender.SelectedItem?.ToString();
|
|
|
|
|
break;
|
|
|
|
|
case "Port2ReadComboBox":
|
|
|
|
|
Port2ReadText = sender.SelectedItem?.ToString();
|
|
|
|
|
break;
|
|
|
|
|
case "Port3ReadComboBox":
|
|
|
|
|
Port3ReadText = sender.SelectedItem?.ToString();
|
|
|
|
|
break;
|
|
|
|
|
case "Port4ReadComboBox":
|
|
|
|
|
Port4ReadText = sender.SelectedItem?.ToString();
|
|
|
|
|
break;
|
|
|
|
|
case "Port1WriteComboBox":
|
|
|
|
|
Port1WriteText = sender.SelectedItem?.ToString();
|
|
|
|
|
break;
|
|
|
|
|
case "Port2WriteComboBox":
|
|
|
|
|
Port2WriteText = sender.SelectedItem?.ToString();
|
|
|
|
|
break;
|
|
|
|
|
case "Port3WriteComboBox":
|
|
|
|
|
Port3WriteText = sender.SelectedItem?.ToString();
|
|
|
|
|
break;
|
|
|
|
|
case "Port4WriteComboBox":
|
|
|
|
|
Port4WriteText = sender.SelectedItem?.ToString();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Infotext += ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GPOComboBox_SelectChanged(ComboBox sender)
|
|
|
|
|
{
|
|
|
|
|
string Order = "AA 55 04 51 ";
|
|
|
|
|
string comboxname = sender.Name;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
switch (comboxname)
|
|
|
|
|
{
|
|
|
|
|
case "GPO1ComboBox":
|
|
|
|
|
GPO1 = sender.SelectedItem?.ToString();
|
|
|
|
|
Order += "01 ";
|
|
|
|
|
break;
|
|
|
|
|
case "GPO2ComboBox":
|
|
|
|
|
GPO2 = sender.SelectedItem?.ToString();
|
|
|
|
|
Order += "02 ";
|
|
|
|
|
break;
|
|
|
|
|
case "GPO3ComboBox":
|
|
|
|
|
GPO3 = sender.SelectedItem?.ToString();
|
|
|
|
|
Order += "03 ";
|
|
|
|
|
break;
|
|
|
|
|
case "GPO4ComboBox":
|
|
|
|
|
GPO4 = sender.SelectedItem?.ToString();
|
|
|
|
|
Order += "04 ";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (sender.SelectedItem?.ToString() == "高")
|
|
|
|
|
Order += "01 ";
|
|
|
|
|
else
|
|
|
|
|
Order += "00 ";
|
|
|
|
|
Order += "00 00 ";
|
|
|
|
|
Order += Convert.ToString(GetXor(strToToHexByte(Order), 2), 16) + " 0D";
|
|
|
|
|
//Infotext += Order+"\n";
|
|
|
|
|
byte[] data = strToToHexByte(Order);
|
|
|
|
|
client.Send(data);
|
|
|
|
|
data = strToToHexByte("AA 55 00 81 81 0D");//获取GPIO状态
|
|
|
|
|
client.Send(data);
|
|
|
|
|
//SaveCommand();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Infotext += ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SaveCommand()
|
|
|
|
|
{
|
|
|
|
|
byte[] confirmdata1 = strToToHexByte("AA 55 05 5F ");//保存命令
|
|
|
|
|
byte[] confirmdata2 = System.Text.Encoding.UTF8.GetBytes("\"SAVE\" ");
|
|
|
|
|
byte[] confirmdata3 = strToToHexByte("01 5A 0D");
|
|
|
|
|
|
|
|
|
|
byte[] confirmdata = new byte[confirmdata1.Length + confirmdata2.Length + confirmdata3.Length];
|
|
|
|
|
confirmdata1.CopyTo(confirmdata, 0);
|
|
|
|
|
confirmdata2.CopyTo(confirmdata, confirmdata1.Length);
|
|
|
|
|
confirmdata3.CopyTo(confirmdata, confirmdata1.Length + confirmdata2.Length);//保存命令拼接
|
|
|
|
|
client.Send(confirmdata);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
//组件属性更改事件
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
@ -851,5 +1029,6 @@ namespace SocketExample
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|