|
|
|
@ -40,12 +40,12 @@ import java.util.List;
|
|
|
|
|
import okhttp3.MediaType;
|
|
|
|
|
|
|
|
|
|
public abstract class BaseActivity extends AppCompatActivity {
|
|
|
|
|
public static String url = "http://192.168.137.1:8090/api";
|
|
|
|
|
// public static String url = "http://119.45.202.115:8090/api";
|
|
|
|
|
// public static String url = "http://192.168.137.1:8090/api";
|
|
|
|
|
public static String url = "http://119.45.202.115:8090/api";
|
|
|
|
|
public ProgressDialog dialog;
|
|
|
|
|
public Gson gson;
|
|
|
|
|
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
|
|
|
|
public UHFRManager uhfLongerManager;
|
|
|
|
|
public UHFRManager uhfrManager;
|
|
|
|
|
private MediaPlayer mediaPlayer;
|
|
|
|
|
public MyReceiver myReceiver;
|
|
|
|
|
public Intent broadcastIntent;
|
|
|
|
@ -77,12 +77,11 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void sanEpc() {
|
|
|
|
|
List<Reader.TAGINFO> strings = uhfLongerManager.tagInventoryRealTime();
|
|
|
|
|
// Log.e("TAG", "驱动" + (uhfLongerManager == null));
|
|
|
|
|
uhfrManager.asyncStartReading();
|
|
|
|
|
List<Reader.TAGINFO> strings = uhfrManager.tagInventoryRealTime();
|
|
|
|
|
if (strings == null || strings.isEmpty()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mediaPlayer.start();
|
|
|
|
|
sanRfid(strings);
|
|
|
|
|
}
|
|
|
|
@ -96,10 +95,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initSan() {
|
|
|
|
|
uhfLongerManager = MyApplication.getUhfLongerManager();
|
|
|
|
|
// intentFilter.addAction("android.intent.action.FUN_KEY");
|
|
|
|
|
|
|
|
|
|
uhfLongerManager.asyncStartReading();
|
|
|
|
|
uhfrManager = MyApplication.getUhfLongerManager();
|
|
|
|
|
// intentFilter.addAction("android.intent.action.FUN_KEY");
|
|
|
|
|
|
|
|
|
|
myReceiver = new MyReceiver();
|
|
|
|
|
IntentFilter intentFilter = new IntentFilter();
|
|
|
|
@ -110,10 +108,10 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|
|
|
|
|
|
|
|
|
public void setPower(int power) {
|
|
|
|
|
try {
|
|
|
|
|
Reader.READER_ERR readerErr = uhfLongerManager.setPower(power, power);
|
|
|
|
|
Reader.READER_ERR readerErr = uhfrManager.setPower(power, power);
|
|
|
|
|
Log.e("TAG", "setPower:" + readerErr.name());
|
|
|
|
|
|
|
|
|
|
int[] power1 = uhfLongerManager.getPower();
|
|
|
|
|
int[] power1 = uhfrManager.getPower();
|
|
|
|
|
Log.e("TAG", "readPower:" + power1[0] + "," + power1[1]);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
|
@ -128,7 +126,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected abstract void sanRfid(List<Reader.TAGINFO> epcs);
|
|
|
|
|
public void sanRfid(List<Reader.TAGINFO> epcs){};
|
|
|
|
|
|
|
|
|
|
public static final int CAMERA_PHOTO = 0X02;
|
|
|
|
|
public File outputImage;
|
|
|
|
|