package com.example.beijing_daxing.rfid.impl;

import android.content.IntentFilter;
import android.media.MediaPlayer;
import android.util.Log;

import com.example.beijing_daxing.R;
import com.example.beijing_daxing.base.BaseActivity;
import com.example.beijing_daxing.base.MyApplication;
import com.example.beijing_daxing.rfid.RFID;
import com.handheld.uhfr.UHFRManager;
import com.uhf.api.cls.Reader;

public class Device6109 implements RFID {

    private UHFRManager uhfrManager;
    @Override
    public void initRFIDModel() {
        if (uhfrManager==null){
            uhfrManager=UHFRManager.getInstance();
        }
        uhfrManager.asyncStartReading();
    }

    @Override
    public void setPower(int power) {
        Reader.READER_ERR readerErr = uhfrManager.setPower(power, power);
        Log.e("TAG", "setPower:" + readerErr);
    }

    @Override
    public void close() {
        if (uhfrManager==null){
          return;
        }
        uhfrManager.asyncStopReading();
        uhfrManager.close();
        uhfrManager=null;
    }
}
