| | |
| | | // 更新发送是否成功的信息 |
| | | SendDatas.ReceiveBytes(command, subnetID, deviceID, usefulBytes); |
| | | //2019-8-20 增加目标子网号设备号判断 |
| | | if ((desSubnetID == 0xFF && desSubnetID == 0xFF) |
| | | || (desSubnetID == Crc.localSubnetID && desSubnetID == Crc.localDeviceID)) { |
| | | /*if ((desSubnetID == 0xFF && desSubnetID == 0xFF) |
| | | || (desSubnetID == Crc.localSubnetID && desSubnetID == Crc.localDeviceID)) {*/ |
| | | //参数 |
| | | UdpDataBean udpDataBean = new UdpDataBean(); |
| | | udpDataBean.sourceSubnetID = subnetID; |
| | |
| | | udpDataBean.desSubnetID = desSubnetID; |
| | | udpDataBean.desDeviceID = desDeviceID; |
| | | udpDataBean.command = command; |
| | | |
| | | udpDataBean.addBytes = usefulBytes; |
| | | HDLSerialPortCore.HandleInsideData(udpDataBean); |
| | | |
| | | } |
| | | |
| | | } |
| | | }; |
| | |
| | | int desSubnetID = tempBytes[9] & 0xFF; |
| | | int desDeviceID = tempBytes[10] & 0xFF; |
| | | //如果不是发给自己的数据或者不是广播的数据,不处理 |
| | | if (desSubnetID != Global.subnetID || desDeviceID != Global.deviceID) { |
| | | /*if (desSubnetID != Global.subnetID || desDeviceID != Global.deviceID) { |
| | | if (desSubnetID != 0xFF || desDeviceID != 0xFF) { |
| | | Log.d("串口->回复", "过滤掉=={目标子网:" + desSubnetID + ",目标设备:" + desDeviceID + "}"); |
| | | continue; |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | byte[] usefulBytes = new byte[(tempBytes[2] & 0xFF) - 11]; |
| | | // 复制附加数据 |