Skip to content

Commit

Permalink
bug调整
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheedon committed Jan 6, 2021
1 parent 487dfd2 commit e9f9055
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/com/yanhangtec/app/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.yanhangtec.sensorlibrary.listener.InitializeListener;

public class MainActivity extends AppCompatActivity
implements InitializeListener, OnDebugListener,OnCardReaderListener {
implements InitializeListener, OnDebugListener, OnCardReaderListener {

private CardReaderCenter readerCenter;

Expand All @@ -22,7 +22,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

SensorFactory.init(SensorConstant.TYPE_RFID, this);
SensorFactory.init(SensorConstant.TYPE_RS485, SensorConstant.PORT, 9600, this);

readerCenter = SensorFactory.getCardReaderCenter();
readerCenter.bindDebug(this);
Expand All @@ -37,7 +37,7 @@ public void OnInitializeComplete() {

@Override
public int onSensorType() {
return SensorConstant.TYPE_RFID;
return SensorConstant.TYPE_RS485;
}

@Override
Expand All @@ -47,7 +47,7 @@ public String onPort() {

@Override
public int onBaudRate() {
return 115200;
return 9600;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions sensorlibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ public void onDataNotAvailable(String message) {

@Override
public void onTimeBack(Long aLong) {
long nowTimer = System.currentTimeMillis();
if (nowTimer - lastTime >= 1500) {
long nowTime = System.currentTimeMillis();
if (nowTime - lastTime >= 1500) {
lastTime = nowTime;
RSHelper.setAutoReadCard(voidCallback);
noticeRFIDIsNormal(false);
}
Expand Down

0 comments on commit e9f9055

Please sign in to comment.