package com.fusi24.entryPermitScanner.util;

import com.fusi24.entryPermitScanner.config.Constant;

import java.io.File;
import java.io.FileWriter;

public class PowerUtil {
  public static void power(String id, Boolean isSerialPort2) {
    try {
      FileWriter localFileWriterOn;
      if (isSerialPort2){
        localFileWriterOn = new FileWriter(new File(Constant.PATHNAME_SP2));
      } else {
        localFileWriterOn = new FileWriter(new File(Constant.PATHNAME_SP3));
      }
      localFileWriterOn.write(id);
      localFileWriterOn.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}
