package com.vltgroup.ccTalk.examplePC;

import com.vltgroup.ccTalk.devices.BaseDevice;
import com.vltgroup.ccTalk.devices.BillAcceptor;
import com.vltgroup.ccTalk.devices.BillAcceptorController;
import com.vltgroup.ccTalk.devices.CoinAcceptor;
import com.vltgroup.ccTalk.devices.CoinAcceptorController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AcceptorController implements BillAcceptorController, CoinAcceptorController{
  private static final Logger log = LoggerFactory.getLogger(AcceptorController.class.getName());

  @Override
  public boolean onBillEscrow(BillAcceptor device, long cents) {
    //log.info("{}:{} bill escrow {}",device.info.type, device.info.address.address, cents);
    return true;
  }

  @Override
  public void onBillStacked(BillAcceptor device, long cents) {
    //log.info("{}:{} bill stacked {}",device.info.type, device.info.address.address,cents);
    device.bus.setMasterInhibitStatusAllDevicesSync(false);
  }

  @Override
  public void onHardwareFatal(BillAcceptor device, String message, int eventCounter, int code) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address,message);
  }

  @Override
  public void onFraudAttemt(BillAcceptor device, String message, int eventCounter, int code) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address,message);
  }

  @Override
  public void onStatus(BillAcceptor device, String message, int eventCounter, int code) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address,message);
  }

  @Override
  public void onCoinAccepted(CoinAcceptor device, long cents) {
    //log.info("{}:{} coin accepted {}",device.info.type,device.info.address.address, cents);
    device.bus.setMasterInhibitStatusAllDevicesSync(false);
  }

  @Override
  public void onHardwareFatal(CoinAcceptor device, String message, int eventCounter, int code) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address,message);
  }

  @Override
  public void onFraudAttemt(CoinAcceptor device, String message, int eventCounter, int code) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address,message);
  }

  @Override
  public void onStatus(CoinAcceptor device, String message, int eventCounter, int code) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address,message);
  }

  @Override
  public void onCoinInsertedTooQuikly(CoinAcceptor device, String message, int eventCounter, int code) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address,message);
  }

  @Override
  public void onDeviceNotRespond(BaseDevice device) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address);
  }

  @Override
  public void onDeviceRestored(BaseDevice device) {
    //log.info("{}:{} {}",device.info.type,device.info.address.address);
  }
  
}

@@ -2705,35 +2705,32 @@
 /log.info(%22%7B%7D:%7B%7D
- %7B%7D
 %22,device.info.ty
@@ -2759,24 +2759,24 @@
 .address);%0D%0A
+
   %7D%0D%0A%0D%0A  @Ov
@@ -2849,35 +2849,32 @@
 /log.info(%22%7B%7D:%7B%7D
- %7B%7D
 %22,device.info.ty
@@ -2895,32 +2895,462 @@
 .address.address
+);%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public void onReject(BillAcceptor device, String message, int eventCounter, int code) %7B%0D%0A    //log.info(%22%7B%7D:%7B%7D %7B%7D%22,device.info.type,device.info.address.address,message);%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public void onUnknownEvent(BaseDevice device, int eventCounter, int code1, int code2) %7B%0D%0A    //log.info(%22%7B%7D:%7B%7D counter:%7B%7D code1:%7B%7D code2%7B%7D%22,device.info.type,device.info.address.address,eventCounter, code1, code2
 );%0D%0A  %7D%0D%0A  %0D%0A%7D%0D%0A

fix in examplePC