Skip to content

Commit 58f2f28

Browse files
committed
update
1 parent 5d09b53 commit 58f2f28

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/src/main/java/com/espressif/esptouch/android/v2/EspTouch2Activity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,16 @@ private void check() {
193193
}
194194

195195
private EspProvisioningRequest genRequest() {
196-
mBinding.aesKeyEdit.setError(null);
197-
mBinding.customDataEdit.setError(null);
196+
mBinding.aesKeyLayout.setError(null);
197+
mBinding.customDataLayout.setError(null);
198198

199199
CharSequence aesKeyChars = mBinding.aesKeyEdit.getText();
200200
byte[] aesKey = null;
201201
if (aesKeyChars != null && aesKeyChars.length() > 0) {
202202
aesKey = aesKeyChars.toString().getBytes();
203203
}
204204
if (aesKey != null && aesKey.length != 16) {
205-
mBinding.aesKeyEdit.setError(getString(R.string.esptouch2_aes_key_error));
205+
mBinding.aesKeyLayout.setError(getString(R.string.esptouch2_aes_key_error));
206206
return null;
207207
}
208208

@@ -223,7 +223,7 @@ private EspProvisioningRequest genRequest() {
223223
}
224224
int customDataMaxLen = EspProvisioningRequest.RESERVED_LENGTH_MAX;
225225
if (customData != null && customData.length > customDataMaxLen) {
226-
mBinding.customDataEdit.setError(getString(R.string.esptouch2_custom_data_error, customDataMaxLen));
226+
mBinding.customDataLayout.setError(getString(R.string.esptouch2_custom_data_error, customDataMaxLen));
227227
return null;
228228
}
229229

esptouch-v2/src/main/java/com/espressif/iot/esptouch2/provision/EspProvisioningParams.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EspProvisioningParams {
2424

2525
private final List<byte[]> mDataPacketList;
2626

27-
private int mAppPortMark;
27+
private final int mAppPortMark;
2828
private byte[] mPassword;
2929
private byte[] mSsid;
3030
private byte[] mReservedData;
@@ -78,7 +78,7 @@ private void parse(EspProvisioningRequest request) {
7878

7979
mWillEncrypt = request.aesKey != null && (mPassword.length > 0 || mReservedData.length > 0);
8080
mAesKey = mWillEncrypt ? request.aesKey : EMPTY_DATA;
81-
mSecurityVer = request.securityVer;
81+
mSecurityVer = request.securityVer & 0b11;
8282

8383
mPasswordEncode = checkCharEncode(mPassword);
8484
mReservedEncode = checkCharEncode(mReservedData);

0 commit comments

Comments
 (0)