完成 handehuoe驱动更新
parent
6d2031f1a4
commit
3aab607a3f
@ -1,10 +0,0 @@
|
||||
package com.example.beijing_daxing.rfid;
|
||||
|
||||
public interface RFID {
|
||||
void initRFIDModel();
|
||||
void setPower(int power);
|
||||
void sanRFID();
|
||||
void close();
|
||||
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package com.example.beijing_daxing.rfid.impl;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.beijing_daxing.rfid.RFID;
|
||||
import com.handheld.uhfr.UHFRManager;
|
||||
import com.uhf.api.cls.Reader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Device6109 implements RFID {
|
||||
|
||||
private UHFRManager uhfrManager;
|
||||
private EpcDataInterface epcDataInterface;
|
||||
|
||||
public Device6109(EpcDataInterface epcDataInterface) {
|
||||
this.epcDataInterface = epcDataInterface;
|
||||
}
|
||||
|
||||
public Device6109() {
|
||||
}
|
||||
|
||||
@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 sanRFID() {
|
||||
List<Reader.TAGINFO> data = uhfrManager.tagInventoryRealTime();
|
||||
if (data == null || data.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
epcDataInterface.epcData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (uhfrManager == null) {
|
||||
return;
|
||||
}
|
||||
uhfrManager.asyncStopReading();
|
||||
uhfrManager.close();
|
||||
uhfrManager = null;
|
||||
}
|
||||
|
||||
|
||||
public interface EpcDataInterface {
|
||||
void epcData(List<Reader.TAGINFO> data);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue