| | |
| | | import android.view.View; |
| | | import android.widget.Button; |
| | | |
| | | import com.example.agvcontroller.protocol.AgvAction; |
| | | import com.example.agvcontroller.protocol.ForceSwitchAction; |
| | | import com.example.agvcontroller.protocol2.AgvPackage; |
| | | import com.example.agvcontroller.protocol2.PackagePart; |
| | | import com.example.agvcontroller.socket.NettyServerHandler; |
| | |
| | | private Handler handler = new Handler(new Handler.Callback() { |
| | | @Override |
| | | public boolean handleMessage(Message msg) { |
| | | |
| | | |
| | | AgvAction agvAction = new AgvAction<>(ForceSwitchAction.class) |
| | | .setAgvNo("1") |
| | | .setSerialNo("asdsadsadsad") |
| | | .setVal(1) |
| | | .bodySync((action) -> action.setPwd((short) 21)); |
| | | |
| | | |
| | | // 在这里进行打印输出 |
| | | System.out.println("打印输出"); |
| | | if (isDowm) { |
| | | byte[] message2 = new byte[]{0x01, 0x02, 0x03, 0x06}; // 示例消息 |
| | | nettyServerHandler.sendMessageToClient(clientId, message2); // 发送消息到客户端 |
| | | System.out.println(agvAction); |
| | | // byte[] message2 = new byte[]{0x01, 0x02, 0x03, 0x06}; // 示例消息 |
| | | nettyServerHandler.sendMessageToClient(clientId, agvAction); // 发送消息到客户端 |
| | | handler.sendEmptyMessageDelayed(0, 100); |
| | | } |
| | | return false; |