package net.northking.cctp.upperComputer.driver.ios.command.listener;

import net.northking.cctp.upperComputer.driver.ios.command.data.ScreenInfoData;
import net.northking.cctp.upperComputer.driver.ios.packet.AsyncPacketListener;
import net.northking.cctp.upperComputer.driver.ios.packet.ICommandPacket;
import net.northking.cctp.upperComputer.driver.ios.packet.PacketTransfer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class ScreenInfoDataListener extends AsyncPacketListener {

    private final Logger logger = LoggerFactory.getLogger(ScreenInfoDataListener.class);
    private final ScreenInfoData screenInfoData = new ScreenInfoData();

    public ScreenInfoDataListener() {
        super(2);
    }

    public ScreenInfoData getScreenInfoData() {
        return screenInfoData;
    }

    @Override
    public void handle(PacketTransfer transfer, ICommandPacket packet) {
        packet.fillICommandData(screenInfoData);
        logger.debug(screenInfoData.toString());
    }
}
