New file |
| | |
| | | package com.example.agvcontroller.protocol; |
| | | |
| | | |
| | | import com.example.agvcontroller.socket.RadixTools; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * Created by vincent on 2023/3/15 |
| | | */ |
| | | public class AGV_F0_UP implements IMessageBody, Serializable { |
| | | |
| | | private static final long serialVersionUID = -5588066188890649095L; |
| | | |
| | | @Override |
| | | public byte[] writeToBytes() { |
| | | return new byte[0]; |
| | | } |
| | | |
| | | @Override |
| | | public void readFromBytes(byte[] bytes) { |
| | | // password |
| | | this.password = RadixTools.bytesToHexStr(Utils.sliceWithReverse(bytes, 0, 4)); |
| | | // type |
| | | this.type = Utils.sliceWithReverse(bytes, 4, 1)[0]; |
| | | |
| | | this.battery = Utils.sliceWithReverse(bytes, 32, 1)[0]; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String getSerialNo() { |
| | | return ""; |
| | | } |
| | | |
| | | private String password; |
| | | |
| | | private byte type; |
| | | |
| | | private int battery; |
| | | |
| | | public int getBattery() { |
| | | return battery; |
| | | } |
| | | } |
| | | |