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


import net.northking.cctp.upperComputer.driver.ios.command.data.AppBatteryData;
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 AppBatteryDataListener extends AsyncPacketListener {

    private final Logger logger = LoggerFactory.getLogger(AppBatteryDataListener.class);

    private final AppBatteryData appBatteryData = new AppBatteryData();

    public AppBatteryDataListener() {
        super(1);
    }

    public AppBatteryData getAppBatteryData() {
        return appBatteryData;
    }

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