package com.hboxs.serialport.frame;

import com.hboxs.serialport.Command;

/**
 * 命令帧 - 复位
 * 写的num必须偶数字节
 */
public class RstCommandFrame extends CommandFrame {
    /**
     * 构造复位写命令
     * @param address 地址
     *
     */
    public RstCommandFrame(String address) {
        super(Command.CMD_RST, address);
    }

    public static void main(String[] args) {
//        System.out.println(Integer.parseInt("10000001", 2));
//        System.out.println(Integer.parseInt("81", 16));
//        System.out.println("10000001".substring(0, 8));
        CommandFrame commandFrame = new RstCommandFrame("Y0");
        System.out.print("{");
        for (byte b : commandFrame.getFrameData()) {
            System.out.print(Integer.toHexString(b));
            System.out.print(",");
        }
        System.out.println("}");
    }
}
