|
@@ -190,12 +190,12 @@ public class BleWork {
|
|
|
mSequence = jobSequence.UNINITIALIZED;
|
|
|
mGattcallback = null;
|
|
|
if (mGattcallback != null) {
|
|
|
- EpLog.e("mGattcallback != null");
|
|
|
+ EPLog.e("mGattcallback != null");
|
|
|
}
|
|
|
mGattcallback = new BluetoothGattCallback() {
|
|
|
public void onMtuChanged(BluetoothGatt bluetoothGatt, int i, int i2) {
|
|
|
super.onMtuChanged(bluetoothGatt, i, i2);
|
|
|
- EpLog.m77i("onMtuChanged " + i);
|
|
|
+ EPLog.i("onMtuChanged " + i);
|
|
|
}
|
|
|
|
|
|
public void onDescriptorWrite(BluetoothGatt bluetoothGatt, BluetoothGattDescriptor bluetoothGattDescriptor, int i) {
|
|
@@ -209,37 +209,37 @@ public class BleWork {
|
|
|
}
|
|
|
|
|
|
public void onConnectionStateChange(BluetoothGatt bluetoothGatt, int i, int i2) {
|
|
|
- EpLog.m77i("status = " + i + " newState = " + i2);
|
|
|
+ EPLog.i("status = " + i + " newState = " + i2);
|
|
|
if (i == 0 && i2 == 2) {
|
|
|
- EpLog.m77i("STATE_CONNECTED -- " + BleWork.mSequence);
|
|
|
+ EPLog.i("STATE_CONNECTED -- " + BleWork.mSequence);
|
|
|
BleWork bleWork = BleWork.this;
|
|
|
bleWork.mStatus = i2;
|
|
|
if (bleWork.mConnGatt == null) {
|
|
|
- EpLog.e("mConnGatt NULL !");
|
|
|
+ EPLog.e("mConnGatt NULL !");
|
|
|
}
|
|
|
if (bluetoothGatt == null) {
|
|
|
- EpLog.e("gatt NULL !");
|
|
|
+ EPLog.e("gatt NULL !");
|
|
|
}
|
|
|
BluetoothGatt unused = BleWork.mConnGatt = bluetoothGatt;
|
|
|
BleWork.this.handlerWrite.removeCallbacks((Runnable) null);
|
|
|
BleWork.this.handlerWrite.postDelayed(new Runnable() {
|
|
|
public void run() {
|
|
|
- EpLog.m77i("discoverServices");
|
|
|
+ EPLog.i("discoverServices");
|
|
|
try {
|
|
|
if (!((BluetoothGatt) Objects.requireNonNull(BleWork.mConnGatt)).discoverServices()) {
|
|
|
- EpLog.e("discoverServices error");
|
|
|
+ EPLog.e("discoverServices error");
|
|
|
}
|
|
|
} catch (NullPointerException unused) {
|
|
|
- EpLog.e("mConnGatt NULL !");
|
|
|
+ EPLog.e("mConnGatt NULL !");
|
|
|
}
|
|
|
}
|
|
|
}, 500);
|
|
|
} else if (i != 0 || i2 == 0) {
|
|
|
- EpLog.m77i("STATE_DISCONNECTED " + BleWork.mSequence + " mReconnect = " + BleWork.mReconnect + " mRetry " + BleWork.mRetry);
|
|
|
+ EPLog.i("STATE_DISCONNECTED " + BleWork.mSequence + " mReconnect = " + BleWork.mReconnect + " mRetry " + BleWork.mRetry);
|
|
|
if (!BleWork.mReconnect && BleWork.mSequence == jobSequence.UNINITIALIZED) {
|
|
|
BleWork.this.failedProcessing();
|
|
|
} else if (BleWork.mReconnect || BleWork.mSequence == jobSequence.UNINITIALIZED || BleWork.mSequence == jobSequence.MIB_REBOOT_NW || BleWork.mSequence == jobSequence.DISCONNECTED || BleWork.mSequence == jobSequence.MIB_SET_SSID || BleWork.mSequence == jobSequence.AFTER_SETTING_PASSWORD) {
|
|
|
- EpLog.d("★ stopScan");
|
|
|
+ EPLog.d("★ stopScan");
|
|
|
BleScanWork.getInstace().stopScan();
|
|
|
BleWork bleWork2 = BleWork.this;
|
|
|
bleWork2.mStatus = i2;
|
|
@@ -247,7 +247,7 @@ public class BleWork {
|
|
|
if (BleWork.mSequence == jobSequence.MIB_REBOOT_NW) {
|
|
|
BleWork.this.gattClose();
|
|
|
}
|
|
|
- EpLog.m77i(" BREAK ★ mSequence " + BleWork.mSequence);
|
|
|
+ EPLog.i(" BREAK ★ mSequence " + BleWork.mSequence);
|
|
|
return;
|
|
|
}
|
|
|
BleWork.this.gattClose();
|
|
@@ -260,9 +260,9 @@ public class BleWork {
|
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- EpLog.m82w("retry " + BleWork.mRetry);
|
|
|
+ EPLog.m82w("retry " + BleWork.mRetry);
|
|
|
BleWork.access$508(BleWork.this);
|
|
|
- EpLog.e("init");
|
|
|
+ EPLog.e("init");
|
|
|
boolean unused2 = BleWork.this.init();
|
|
|
return;
|
|
|
}
|
|
@@ -271,20 +271,20 @@ public class BleWork {
|
|
|
BleWork.this.failedProcessing();
|
|
|
}
|
|
|
} else if (i2 == 1) {
|
|
|
- EpLog.m77i("STATE_CONNECTING");
|
|
|
+ EPLog.i("STATE_CONNECTING");
|
|
|
} else if (i2 == 3) {
|
|
|
- EpLog.m77i("STATE_DISCONNECTING");
|
|
|
+ EPLog.i("STATE_DISCONNECTING");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void onServicesDiscovered(BluetoothGatt bluetoothGatt, int i) {
|
|
|
- EpLog.i();
|
|
|
+ EPLog.i();
|
|
|
try {
|
|
|
for (BluetoothGattService next : bluetoothGatt.getServices()) {
|
|
|
if (next != null) {
|
|
|
if (next.getUuid() != null) {
|
|
|
if (BLEUuid.SERVICE_SNMP.equalsIgnoreCase(next.getUuid().toString())) {
|
|
|
- EpLog.m77i("発見!! EPSON SNMP サービス");
|
|
|
+ EPLog.i("発見!! EPSON SNMP サービス");
|
|
|
for (Map.Entry next2 : BLEUuid.GattCharsMap.entrySet()) {
|
|
|
next2.setValue(next.getCharacteristic(UUID.fromString((String) next2.getKey())));
|
|
|
}
|
|
@@ -302,7 +302,7 @@ public class BleWork {
|
|
|
}
|
|
|
}
|
|
|
} catch (BleException e) {
|
|
|
- EpLog.e(e.getMessage());
|
|
|
+ EPLog.e(e.getMessage());
|
|
|
e.printStackTrace();
|
|
|
BleWork.this.failedProcessing();
|
|
|
}
|
|
@@ -310,22 +310,22 @@ public class BleWork {
|
|
|
|
|
|
public void onCharacteristicChanged(BluetoothGatt bluetoothGatt, @NonNull BluetoothGattCharacteristic bluetoothGattCharacteristic) {
|
|
|
super.onCharacteristicChanged(bluetoothGatt, bluetoothGattCharacteristic);
|
|
|
- EpLog.d("onCharacteristicChanged");
|
|
|
+ EPLog.d("onCharacteristicChanged");
|
|
|
if (BLEUuid.CHAR_SNMP_STATUS_STRING.equals(bluetoothGattCharacteristic.getUuid().toString())) {
|
|
|
Short valueOf = Short.valueOf(bluetoothGattCharacteristic.getIntValue(17, 0).shortValue());
|
|
|
String sh = valueOf.toString();
|
|
|
if (valueOf.shortValue() == 0) {
|
|
|
- EpLog.m77i("[Notify]SNMP Status" + sh);
|
|
|
+ EPLog.i("[Notify]SNMP Status" + sh);
|
|
|
BleWork.this.characteristicRead();
|
|
|
return;
|
|
|
}
|
|
|
- EpLog.e("[Notify]SNMP Status" + sh);
|
|
|
+ EPLog.e("[Notify]SNMP Status" + sh);
|
|
|
BleWork.this.failedProcessing();
|
|
|
} else if (BLEUuid.CHAR_SECURITY_TYPE_STRING.equals(bluetoothGattCharacteristic.getUuid().toString())) {
|
|
|
Short valueOf2 = Short.valueOf(bluetoothGattCharacteristic.getIntValue(17, 0).shortValue());
|
|
|
BleWork.this.setSecurityType(valueOf2.shortValue());
|
|
|
String sh2 = valueOf2.toString();
|
|
|
- EpLog.m77i("[Notify]Security Type " + sh2);
|
|
|
+ EPLog.i("[Notify]Security Type " + sh2);
|
|
|
if (valueOf2.shortValue() <= 0) {
|
|
|
BleWork.mSsidLis.clear();
|
|
|
BleWork.this.getSSIDList();
|
|
@@ -334,7 +334,7 @@ public class BleWork {
|
|
|
}
|
|
|
} else {
|
|
|
String sh3 = Short.valueOf(bluetoothGattCharacteristic.getIntValue(17, 0).shortValue()).toString();
|
|
|
- EpLog.e("[Notify]unKnown type" + sh3);
|
|
|
+ EPLog.e("[Notify]unKnown type" + sh3);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -356,7 +356,7 @@ public class BleWork {
|
|
|
java.lang.String r0 = r0.toString()
|
|
|
if (r0 != 0) goto L_0x0011
|
|
|
java.lang.String r7 = "characteristic NULL !!"
|
|
|
- com.epson.mobilephone.common.EpLog.e((java.lang.String) r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.e((java.lang.String) r7)
|
|
|
goto L_0x03a1
|
|
|
L_0x0011:
|
|
|
java.lang.String r0 = r0.toLowerCase()
|
|
@@ -452,7 +452,7 @@ public class BleWork {
|
|
|
boolean r0 = r7.isEmpty()
|
|
|
if (r0 == 0) goto L_0x00c3
|
|
|
java.lang.String r7 = "[Read]SNMP Response :end!"
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
boolean unused = r7.mInSequence = r4
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
@@ -470,7 +470,7 @@ public class BleWork {
|
|
|
r0.append(r1)
|
|
|
r0.append(r7)
|
|
|
java.lang.String r0 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r0)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r0)
|
|
|
com.epson.mobilephone.common.ble.BleWork r0 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
java.util.List r0 = r0.mSsidLis
|
|
|
r0.add(r7)
|
|
@@ -486,7 +486,7 @@ public class BleWork {
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r0 = r0.mSequence
|
|
|
r7.append(r0)
|
|
|
java.lang.String r7 = r7.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
int[] r7 = com.epson.mobilephone.common.ble.BleWork.C10195.$SwitchMap$com$epson$mobilephone$common$ble$BleWork$jobSequence
|
|
|
com.epson.mobilephone.common.ble.BleWork r0 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r0 = r0.mSequence
|
|
@@ -526,7 +526,7 @@ public class BleWork {
|
|
|
r7 = r7[r4]
|
|
|
r0.append(r7)
|
|
|
java.lang.String r7 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r7 = r7.mSequence
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r0 = com.epson.mobilephone.common.ble.BleWork.jobSequence.MIB_SEC_SKIP
|
|
@@ -553,7 +553,7 @@ public class BleWork {
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r0 = r0.mSequence
|
|
|
r7.append(r0)
|
|
|
java.lang.String r7 = r7.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r7 = r7.mSequence
|
|
|
int r7 = r7.ordinal()
|
|
@@ -565,7 +565,7 @@ public class BleWork {
|
|
|
goto L_0x03a1
|
|
|
L_0x0198:
|
|
|
java.lang.String r7 = "[Read]SNMP Response :error "
|
|
|
- com.epson.mobilephone.common.EpLog.e((java.lang.String) r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.e((java.lang.String) r7)
|
|
|
goto L_0x03a1
|
|
|
L_0x019f:
|
|
|
java.lang.StringBuilder r7 = new java.lang.StringBuilder
|
|
@@ -578,7 +578,7 @@ public class BleWork {
|
|
|
int r0 = r0.requestId
|
|
|
r7.append(r0)
|
|
|
java.lang.String r7 = r7.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.d(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.d(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
com.epson.mobilephone.common.escpr.EscprLib r7 = r7.mEscprlib
|
|
|
com.epson.mobilephone.common.ble.BleWork r0 = com.epson.mobilephone.common.ble.BleWork.this
|
|
@@ -597,10 +597,10 @@ public class BleWork {
|
|
|
r0.append(r1)
|
|
|
r0.append(r7)
|
|
|
java.lang.String r0 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r0)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r0)
|
|
|
if (r7 == 0) goto L_0x01fc
|
|
|
java.lang.String r7 = "[Read]SNMP Response :end!"
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
goto L_0x03a1
|
|
|
L_0x01fc:
|
|
|
r6.IncrementSequence()
|
|
@@ -615,7 +615,7 @@ public class BleWork {
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r7 = r7.mSequence
|
|
|
r0.append(r7)
|
|
|
java.lang.String r7 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
r7.setSSIDWork()
|
|
|
goto L_0x03a1
|
|
@@ -629,7 +629,7 @@ public class BleWork {
|
|
|
r0 = r0 ^ r3
|
|
|
if (r0 != 0) goto L_0x0244
|
|
|
java.lang.String r7 = "[Read]SNMP Response :end!"
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
goto L_0x03a1
|
|
|
L_0x0244:
|
|
|
r6.IncrementSequence()
|
|
@@ -644,7 +644,7 @@ public class BleWork {
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r7 = r7.mSequence
|
|
|
r0.append(r7)
|
|
|
java.lang.String r7 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
r7.setSSIDWork()
|
|
|
goto L_0x03a1
|
|
@@ -672,13 +672,13 @@ public class BleWork {
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r7 = r7.mSequence
|
|
|
r0.append(r7)
|
|
|
java.lang.String r7 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
r7.setSSIDWork()
|
|
|
goto L_0x03a1
|
|
|
L_0x02b6:
|
|
|
java.lang.String r7 = "[Read]SNMP Response :failed"
|
|
|
- com.epson.mobilephone.common.EpLog.e((java.lang.String) r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.e((java.lang.String) r7)
|
|
|
goto L_0x03a1
|
|
|
L_0x02bd:
|
|
|
java.lang.Integer r7 = r7.getIntValue(r1, r4)
|
|
@@ -689,7 +689,7 @@ public class BleWork {
|
|
|
r0.append(r1)
|
|
|
r0.append(r7)
|
|
|
java.lang.String r7 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
java.lang.String r7 = r7.mSSID
|
|
|
if (r7 == 0) goto L_0x03a1
|
|
@@ -699,19 +699,19 @@ public class BleWork {
|
|
|
if (r7 != 0) goto L_0x03a1
|
|
|
r6.IncrementSequence()
|
|
|
java.lang.String r7 = " @@ checkSSID @@ "
|
|
|
- com.epson.mobilephone.common.EpLog.d(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.d(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
android.bluetooth.BluetoothGatt r7 = r7.mConnGatt
|
|
|
if (r7 != 0) goto L_0x0302
|
|
|
java.lang.String r7 = "mConnGatt NULL !"
|
|
|
- com.epson.mobilephone.common.EpLog.e((java.lang.String) r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.e((java.lang.String) r7)
|
|
|
L_0x0302:
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
short r7 = r7.getSecurityType()
|
|
|
r0 = 255(0xff, float:3.57E-43)
|
|
|
if (r7 != r0) goto L_0x0328
|
|
|
java.lang.String r7 = " skip "
|
|
|
- com.epson.mobilephone.common.EpLog.d(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.d(r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
com.epson.mobilephone.common.ble.util.BLEUtility$BleWorkCallback r7 = r7.mSequenceCallbackSuccess
|
|
|
if (r7 == 0) goto L_0x03a1
|
|
@@ -736,12 +736,12 @@ public class BleWork {
|
|
|
r1.append(r2)
|
|
|
r1.append(r0)
|
|
|
java.lang.String r0 = r1.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r0)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r0)
|
|
|
short r7 = r7.shortValue()
|
|
|
r0 = 65535(0xffff, float:9.1834E-41)
|
|
|
if (r7 != r0) goto L_0x0367
|
|
|
java.lang.String r7 = "password error !"
|
|
|
- com.epson.mobilephone.common.EpLog.e((java.lang.String) r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.e((java.lang.String) r7)
|
|
|
com.epson.mobilephone.common.ble.BleWork r7 = com.epson.mobilephone.common.ble.BleWork.this
|
|
|
com.epson.mobilephone.common.ble.BleWork$jobSequence r0 = com.epson.mobilephone.common.ble.BleWork.jobSequence.FAILED
|
|
|
r7.mSequence = r0
|
|
@@ -759,7 +759,7 @@ public class BleWork {
|
|
|
r0.append(r1)
|
|
|
r0.append(r7)
|
|
|
java.lang.String r7 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
goto L_0x03a1
|
|
|
L_0x0389:
|
|
|
java.lang.String r7 = r7.getStringValue(r4)
|
|
@@ -769,7 +769,7 @@ public class BleWork {
|
|
|
r0.append(r1)
|
|
|
r0.append(r7)
|
|
|
java.lang.String r7 = r0.toString()
|
|
|
- com.epson.mobilephone.common.EpLog.m77i(r7)
|
|
|
+ com.epson.mobilephone.common.EPLog.i(r7)
|
|
|
L_0x03a1:
|
|
|
return
|
|
|
*/
|
|
@@ -780,7 +780,7 @@ public class BleWork {
|
|
|
int ordinal = BleWork.mSequence.ordinal();
|
|
|
jobSequence[] values = jobSequence.values();
|
|
|
BleWork.mSequence = values[ordinal + 1];
|
|
|
- EpLog.m77i("ΔΔ mSequence = " + BleWork.mSequence);
|
|
|
+ EPLog.i("ΔΔ mSequence = " + BleWork.mSequence);
|
|
|
}
|
|
|
|
|
|
public void onCharacteristicWrite(BluetoothGatt bluetoothGatt, BluetoothGattCharacteristic bluetoothGattCharacteristic, int i) {
|
|
@@ -805,13 +805,13 @@ public class BleWork {
|
|
|
|
|
|
private void notifySet(@NonNull BluetoothGattCharacteristic bluetoothGattCharacteristic) {
|
|
|
if (!BleWork.mConnGatt.setCharacteristicNotification(bluetoothGattCharacteristic, true)) {
|
|
|
- EpLog.e("Notification set ERROR");
|
|
|
+ EPLog.e("Notification set ERROR");
|
|
|
}
|
|
|
BluetoothGattDescriptor descriptor = bluetoothGattCharacteristic.getDescriptor(UUID.fromString(BLEUuid.CLIENT_CHARACTERISTIC_CONFIG));
|
|
|
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
|
|
|
- EpLog.m77i("notify set");
|
|
|
+ EPLog.i("notify set");
|
|
|
if (!BleWork.mConnGatt.writeDescriptor(descriptor)) {
|
|
|
- EpLog.e("Notification write ERROR");
|
|
|
+ EPLog.e("Notification write ERROR");
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -843,7 +843,7 @@ public class BleWork {
|
|
|
@NonNull
|
|
|
public static String getSSID(@NonNull Context context) {
|
|
|
String curSSID = WiFiDirectManager.getCurSSID(context);
|
|
|
- EpLog.m77i("" + curSSID);
|
|
|
+ EPLog.i("" + curSSID);
|
|
|
return (curSSID == null || curSSID.equals("<unknown ssid>")) ? "" : curSSID;
|
|
|
}
|
|
|
|
|
@@ -883,15 +883,15 @@ public class BleWork {
|
|
|
}
|
|
|
|
|
|
public void disconnect(boolean z) {
|
|
|
- EpLog.m77i("mSequence == " + mSequence + ":: " + mStatus);
|
|
|
+ EPLog.i("mSequence == " + mSequence + ":: " + mStatus);
|
|
|
mSequence = z ? jobSequence.DISCONNECTED : mSequence;
|
|
|
if (mConnGatt != null) {
|
|
|
int i = mStatus;
|
|
|
if (!(i == 3 || i == 0)) {
|
|
|
- EpLog.d(" !! mConnGatt disconnect");
|
|
|
+ EPLog.d(" !! mConnGatt disconnect");
|
|
|
mConnGatt.disconnect();
|
|
|
}
|
|
|
- EpLog.d(" !! mConnGatt close " + mSequence + " " + mStatus);
|
|
|
+ EPLog.d(" !! mConnGatt close " + mSequence + " " + mStatus);
|
|
|
mReconnect = false;
|
|
|
if (z) {
|
|
|
gattClose();
|
|
@@ -900,7 +900,7 @@ public class BleWork {
|
|
|
}
|
|
|
|
|
|
private void gattClose() {
|
|
|
- EpLog.d(" !! mConnGatt close");
|
|
|
+ EPLog.d(" !! mConnGatt close");
|
|
|
BluetoothGatt bluetoothGatt = mConnGatt;
|
|
|
if (bluetoothGatt != null) {
|
|
|
bluetoothGatt.close();
|
|
@@ -913,10 +913,10 @@ public class BleWork {
|
|
|
}
|
|
|
|
|
|
public void connect() {
|
|
|
- EpLog.m77i("再接続");
|
|
|
+ EPLog.i("再接続");
|
|
|
mReconnect = true;
|
|
|
mRetry = 0;
|
|
|
- EpLog.e("init");
|
|
|
+ EPLog.e("init");
|
|
|
init();
|
|
|
}
|
|
|
|
|
@@ -930,13 +930,13 @@ public class BleWork {
|
|
|
|
|
|
private void notifySet(@NonNull BluetoothGattCharacteristic bluetoothGattCharacteristic) {
|
|
|
if (!mConnGatt.setCharacteristicNotification(bluetoothGattCharacteristic, true)) {
|
|
|
- EpLog.e("Notification set ERROR");
|
|
|
+ EPLog.e("Notification set ERROR");
|
|
|
}
|
|
|
BluetoothGattDescriptor descriptor = bluetoothGattCharacteristic.getDescriptor(UUID.fromString(BLEUuid.CLIENT_CHARACTERISTIC_CONFIG));
|
|
|
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
|
|
|
- EpLog.m77i("notify set");
|
|
|
+ EPLog.i("notify set");
|
|
|
if (!mConnGatt.writeDescriptor(descriptor)) {
|
|
|
- EpLog.e(" writeDescriptor ERROR");
|
|
|
+ EPLog.e(" writeDescriptor ERROR");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -951,7 +951,7 @@ public class BleWork {
|
|
|
|
|
|
protected void onPreExecute() {
|
|
|
super.onPreExecute();
|
|
|
- EpLog.i();
|
|
|
+ EPLog.i();
|
|
|
try {
|
|
|
Thread.sleep(500);
|
|
|
} catch (InterruptedException e) {
|
|
@@ -959,7 +959,7 @@ public class BleWork {
|
|
|
}
|
|
|
BleWork.this.setNotifyCallback(new BLEUtility.BleWorkCallback() {
|
|
|
public void call(@NonNull Object obj) {
|
|
|
- EpLog.m77i(" -- NotifySetThread call");
|
|
|
+ EPLog.i(" -- NotifySetThread call");
|
|
|
BluetoothGattCharacteristic bluetoothGattCharacteristic = BLEUuid.GattCharsMap.get(BLEUuid.CHAR_SECURITY_TYPE_STRING);
|
|
|
BluetoothGattCharacteristic bluetoothGattCharacteristic2 = BLEUuid.GattCharsMap.get(BLEUuid.CHAR_SNMP_STATUS_STRING);
|
|
|
BluetoothGattDescriptor bluetoothGattDescriptor = (BluetoothGattDescriptor) obj;
|
|
@@ -990,12 +990,12 @@ public class BleWork {
|
|
|
}
|
|
|
}
|
|
|
if (this.stop) {
|
|
|
- EpLog.m77i(" set ended ");
|
|
|
- EpLog.i();
|
|
|
+ EPLog.i(" set ended ");
|
|
|
+ EPLog.i();
|
|
|
return Boolean.valueOf(this.success);
|
|
|
}
|
|
|
}
|
|
|
- EpLog.e(" set failed! ");
|
|
|
+ EPLog.e(" set failed! ");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1011,13 +1011,13 @@ public class BleWork {
|
|
|
BleWork.this.checkPassword();
|
|
|
return;
|
|
|
}
|
|
|
- EpLog.e("setNotify");
|
|
|
+ EPLog.e("setNotify");
|
|
|
BleWork.this.failedProcessing();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void characteristicRead() {
|
|
|
- EpLog.m77i("read " + mSequence);
|
|
|
+ EPLog.i("read " + mSequence);
|
|
|
if (mSequence != jobSequence.MIB_REBOOT_NW) {
|
|
|
final int[] iArr = {0};
|
|
|
handlerRead.postDelayed(new Runnable() {
|
|
@@ -1038,29 +1038,29 @@ public class BleWork {
|
|
|
int i = iArr[0] + 1;
|
|
|
iArr[0] = i;
|
|
|
if (i < 3) {
|
|
|
- EpLog.e("FALSE !! retry " + iArr[0]);
|
|
|
+ EPLog.e("FALSE !! retry " + iArr[0]);
|
|
|
BleWork.this.handlerRead.removeCallbacks((Runnable) null);
|
|
|
BleWork.this.handlerRead.postDelayed(this, (long) (iArr[0] * 500));
|
|
|
return;
|
|
|
}
|
|
|
- EpLog.e("FALSE !!!");
|
|
|
+ EPLog.e("FALSE !!!");
|
|
|
BleWork.this.sequenceError();
|
|
|
return;
|
|
|
}
|
|
|
return;
|
|
|
} catch (NullPointerException unused) {
|
|
|
- EpLog.e("mConnGatt NULL !");
|
|
|
+ EPLog.e("mConnGatt NULL !");
|
|
|
return;
|
|
|
}
|
|
|
case 9:
|
|
|
if (!BleWork.mConnGatt.readCharacteristic(BLEUuid.GattCharsMap.get(BLEUuid.CHAR_PASSWORD_STRING))) {
|
|
|
- EpLog.e("FALSE !! ");
|
|
|
+ EPLog.e("FALSE !! ");
|
|
|
return;
|
|
|
}
|
|
|
return;
|
|
|
case 10:
|
|
|
if (!BleWork.mConnGatt.readCharacteristic(BLEUuid.GattCharsMap.get(BLEUuid.CHAR_VERSION_STRING))) {
|
|
|
- EpLog.e("FALSE !! ");
|
|
|
+ EPLog.e("FALSE !! ");
|
|
|
return;
|
|
|
}
|
|
|
return;
|
|
@@ -1088,7 +1088,7 @@ public class BleWork {
|
|
|
if (mDevice == null) {
|
|
|
mDevice = mSelectItem.getDevice();
|
|
|
if (mDevice == null) {
|
|
|
- EpLog.e("mDevice is null !!!");
|
|
|
+ EPLog.e("mDevice is null !!!");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -1098,17 +1098,17 @@ public class BleWork {
|
|
|
} else {
|
|
|
i = Constants.EDAM_APPLICATIONDATA_ENTRY_LEN_MAX;
|
|
|
}
|
|
|
- EpLog.d("password = " + i);
|
|
|
+ EPLog.d("password = " + i);
|
|
|
mDevicePassword = String.valueOf(i);
|
|
|
if (mConnGatt == null && mStatus == 0) {
|
|
|
- EpLog.m77i("connectGatt");
|
|
|
+ EPLog.i("connectGatt");
|
|
|
mConnGatt = mDevice.connectGatt(mContext, false, mGattcallback);
|
|
|
mStatus = 1;
|
|
|
if (!mReconnect) {
|
|
|
mSequence = jobSequence.UNINITIALIZED;
|
|
|
}
|
|
|
} else if (mConnGatt != null) {
|
|
|
- EpLog.m77i("re-connect and re-discover Services");
|
|
|
+ EPLog.i("re-connect and re-discover Services");
|
|
|
mConnGatt.close();
|
|
|
mConnGatt = mDevice.connectGatt(mContext, false, mGattcallback);
|
|
|
mConnGatt.connect();
|
|
@@ -1117,7 +1117,7 @@ public class BleWork {
|
|
|
mSequence = jobSequence.INITIALIZE;
|
|
|
}
|
|
|
} else {
|
|
|
- EpLog.m77i(" STATE_CONNECTING");
|
|
|
+ EPLog.i(" STATE_CONNECTING");
|
|
|
mConnGatt = mDevice.connectGatt(mContext, false, mGattcallback);
|
|
|
mStatus = 1;
|
|
|
if (!mReconnect) {
|
|
@@ -1135,18 +1135,18 @@ public class BleWork {
|
|
|
setSecurityType(0);
|
|
|
mReconnect = true;
|
|
|
mSSID = getSSID(mContext);
|
|
|
- EpLog.m77i(mSSID);
|
|
|
- EpLog.e("init");
|
|
|
+ EPLog.i(mSSID);
|
|
|
+ EPLog.e("init");
|
|
|
return init();
|
|
|
}
|
|
|
|
|
|
public void checkPassword() {
|
|
|
- EpLog.i();
|
|
|
+ EPLog.i();
|
|
|
String str = mDevicePassword;
|
|
|
if (!str.isEmpty()) {
|
|
|
BluetoothGattCharacteristic bluetoothGattCharacteristic = BLEUuid.GattCharsMap.get(BLEUuid.CHAR_PASSWORD_STRING);
|
|
|
bluetoothGattCharacteristic.setValue(Short.parseShort(str), 18, 0);
|
|
|
- EpLog.m77i("Password write :" + str);
|
|
|
+ EPLog.i("Password write :" + str);
|
|
|
gattWriteCharacter(bluetoothGattCharacteristic);
|
|
|
}
|
|
|
}
|
|
@@ -1157,10 +1157,10 @@ public class BleWork {
|
|
|
handlerWrite.postDelayed(new Runnable() {
|
|
|
public void run() {
|
|
|
if (BleWork.mConnGatt == null) {
|
|
|
- EpLog.e("mConnGatt NULL !");
|
|
|
+ EPLog.e("mConnGatt NULL !");
|
|
|
}
|
|
|
if (bluetoothGattCharacteristic == null) {
|
|
|
- EpLog.e("characteristic NULL !");
|
|
|
+ EPLog.e("characteristic NULL !");
|
|
|
}
|
|
|
try {
|
|
|
if (!((BluetoothGatt) Objects.requireNonNull(BleWork.mConnGatt)).writeCharacteristic(bluetoothGattCharacteristic)) {
|
|
@@ -1168,16 +1168,16 @@ public class BleWork {
|
|
|
int i = iArr[0] + 1;
|
|
|
iArr[0] = i;
|
|
|
if (i <= 3) {
|
|
|
- EpLog.e("writeCharacteristic error ! retry " + iArr[0]);
|
|
|
+ EPLog.e("writeCharacteristic error ! retry " + iArr[0]);
|
|
|
BleWork.this.handlerWrite.removeCallbacks((Runnable) null);
|
|
|
BleWork.this.handlerWrite.postDelayed(this, (long) (iArr[0] * 500));
|
|
|
return;
|
|
|
}
|
|
|
- EpLog.e("writeCharacteristic error !! retry failed !!");
|
|
|
+ EPLog.e("writeCharacteristic error !! retry failed !!");
|
|
|
BleWork.this.failedProcessing();
|
|
|
}
|
|
|
} catch (NullPointerException unused) {
|
|
|
- EpLog.e("mConnGatt NULL !");
|
|
|
+ EPLog.e("mConnGatt NULL !");
|
|
|
}
|
|
|
}
|
|
|
}, 0);
|
|
@@ -1196,7 +1196,7 @@ public class BleWork {
|
|
|
mIndex = b;
|
|
|
int mibGetESSIDList = escprLib.mibGetESSIDList(mIBCommand, b);
|
|
|
if (mibGetESSIDList != 0) {
|
|
|
- EpLog.e("mibGetESSIDList ret = " + mibGetESSIDList);
|
|
|
+ EPLog.e("mibGetESSIDList ret = " + mibGetESSIDList);
|
|
|
return;
|
|
|
}
|
|
|
byte[] bArr = new byte[mMibCommand.commandBlock.bufSize];
|
|
@@ -1215,21 +1215,21 @@ public class BleWork {
|
|
|
byte[] bytes = mSSID.getBytes(Charset.forName("UTF8"));
|
|
|
BluetoothGattCharacteristic bluetoothGattCharacteristic = BLEUuid.GattCharsMap.get(BLEUuid.CHAR_SSID_STRING);
|
|
|
bluetoothGattCharacteristic.setValue(bytes);
|
|
|
- EpLog.m77i("SSID write :" + mSSID);
|
|
|
+ EPLog.i("SSID write :" + mSSID);
|
|
|
gattWriteCharacter(bluetoothGattCharacteristic);
|
|
|
}
|
|
|
|
|
|
public void setSSIDType() {
|
|
|
mSequence = jobSequence.CHECK_SSID;
|
|
|
if (mConnGatt == null) {
|
|
|
- EpLog.e("mConnGatt NULL !");
|
|
|
+ EPLog.e("mConnGatt NULL !");
|
|
|
}
|
|
|
checkSSID();
|
|
|
}
|
|
|
|
|
|
private void startSetSSID() {
|
|
|
int i;
|
|
|
- EpLog.m77i("mSequence = " + mSequence + " mSSID = " + mSSID);
|
|
|
+ EPLog.i("mSequence = " + mSequence + " mSSID = " + mSSID);
|
|
|
mInSequence = false;
|
|
|
String str = "";
|
|
|
String str2 = "";
|
|
@@ -1242,19 +1242,19 @@ public class BleWork {
|
|
|
case MIB_SET_SSID:
|
|
|
str = "epsWlanConfSSID";
|
|
|
str2 = "mibSetSSID";
|
|
|
- EpLog.m77i("mSSID " + mSSID);
|
|
|
+ EPLog.i("mSSID " + mSSID);
|
|
|
if (!mSSID.isEmpty()) {
|
|
|
i = mEscprlib.mibSetSSID(mMibCommand, mSSID);
|
|
|
break;
|
|
|
} else {
|
|
|
- EpLog.m82w("set SSID : empty");
|
|
|
+ EPLog.m82w("set SSID : empty");
|
|
|
return;
|
|
|
}
|
|
|
case MIB_SEC_LOGIN:
|
|
|
str = "epsAdminMibAccessLoginOperation";
|
|
|
str2 = "mibSecLogin ";
|
|
|
if (mEngineID == null) {
|
|
|
- EpLog.e("mEngineID");
|
|
|
+ EPLog.e("mEngineID");
|
|
|
failedProcessing();
|
|
|
}
|
|
|
i = mEscprlib.mibSecLogin(mMibCommand, mEngineID);
|
|
@@ -1263,12 +1263,12 @@ public class BleWork {
|
|
|
str = "epsWlanCommonPassPhrase";
|
|
|
str2 = "mibSecSetPass ";
|
|
|
String str3 = mSSIDPassword;
|
|
|
- EpLog.m77i("mSSIDPassword " + mSSIDPassword);
|
|
|
+ EPLog.i("mSSIDPassword " + mSSIDPassword);
|
|
|
if (str3.isEmpty()) {
|
|
|
- EpLog.m82w("SSIDPassword is empty");
|
|
|
+ EPLog.m82w("SSIDPassword is empty");
|
|
|
}
|
|
|
if (mEngineID == null) {
|
|
|
- EpLog.e("mEngineID");
|
|
|
+ EPLog.e("mEngineID");
|
|
|
failedProcessing();
|
|
|
}
|
|
|
i = mEscprlib.mibSecSetPassword(mMibCommand, mEngineID, str3);
|
|
@@ -1277,7 +1277,7 @@ public class BleWork {
|
|
|
str = "epsAdminMibAccessLogOutOperation";
|
|
|
str2 = "mibSecLogout ";
|
|
|
if (mEngineID == null) {
|
|
|
- EpLog.e("mEngineID");
|
|
|
+ EPLog.e("mEngineID");
|
|
|
failedProcessing();
|
|
|
}
|
|
|
i = mEscprlib.mibSecLogout(mMibCommand, mEngineID);
|
|
@@ -1289,7 +1289,7 @@ public class BleWork {
|
|
|
mSSIDPassword = "";
|
|
|
}
|
|
|
int i2 = mSSIDPassword.isEmpty() ? 0 : 255;
|
|
|
- EpLog.m77i("MIB_SET_SECURITY_TYPE SecurityType = " + i2);
|
|
|
+ EPLog.i("MIB_SET_SECURITY_TYPE SecurityType = " + i2);
|
|
|
int mibSetSecurityType = mEscprlib.mibSetSecurityType(mMibCommand, i2);
|
|
|
if (i2 == 0) {
|
|
|
mSequence = jobSequence.MIB_SEC_SKIP;
|
|
@@ -1306,13 +1306,13 @@ public class BleWork {
|
|
|
break;
|
|
|
}
|
|
|
if (i != 0) {
|
|
|
- EpLog.e(str2 + " ret = " + i);
|
|
|
+ EPLog.e(str2 + " ret = " + i);
|
|
|
sequenceError();
|
|
|
return;
|
|
|
}
|
|
|
byte[] bArr = new byte[mMibCommand.commandBlock.bufSize];
|
|
|
System.arraycopy(mMibCommand.commandBlock.buf, 0, bArr, 0, mMibCommand.commandBlock.bufSize);
|
|
|
- EpLog.m77i("SNMP Request write :" + str + " mSequence " + mSequence);
|
|
|
+ EPLog.i("SNMP Request write :" + str + " mSequence " + mSequence);
|
|
|
BluetoothGattCharacteristic bluetoothGattCharacteristic = BLEUuid.GattCharsMap.get(BLEUuid.CHAR_SNMP_REQUEST_STRING);
|
|
|
bluetoothGattCharacteristic.setValue(bArr);
|
|
|
gattWriteCharacter(bluetoothGattCharacteristic);
|
|
@@ -1325,7 +1325,7 @@ public class BleWork {
|
|
|
private void failedProcessing() {
|
|
|
disconnect();
|
|
|
if (mSequenceCallbackFailed != null) {
|
|
|
- EpLog.e(" " + mSequence);
|
|
|
+ EPLog.e(" " + mSequence);
|
|
|
mSequenceCallbackFailed.call(mSequence);
|
|
|
}
|
|
|
}
|