Commit 7d405d4d6ae5d14f5a17bed22bb4823db7fd7e0b
1 parent
0ebd8f69
1 修改配网逻辑
Showing
2 changed files
with
4 additions
and
3 deletions
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/constants/BlufiConstants.java
| ... | ... | @@ -23,6 +23,7 @@ public final class BlufiConstants { |
| 23 | 23 | // 音箱返回状态 |
| 24 | 24 | public static final String SSID_RECEIVED = "ssid received"; |
| 25 | 25 | public static final String WIFI_LINKING = "WiFi Linking"; |
| 26 | - public static final String WIFI_LINK_OK = "bind success"; | |
| 26 | + public static final String BIND_SUCCESS = "bind success"; | |
| 27 | 27 | public static final String WIFI_LINK_FAIL = "WiFi Link Fail"; |
| 28 | + public static final String BIND_FAIL = "bind faild"; | |
| 28 | 29 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SelectWifiFragmentView.java
| ... | ... | @@ -272,8 +272,8 @@ public class SelectWifiFragmentView implements MvpView { |
| 272 | 272 | } |
| 273 | 273 | try { |
| 274 | 274 | String result = new String(data, "UTF-8"); |
| 275 | -// Log.e(TAG, "onCharacteristicChanged: " + result); | |
| 276 | - if (result.indexOf(BlufiConstants.WIFI_LINK_OK) != -1) { | |
| 275 | + Log.e(TAG, "onCharacteristicChanged: " + result); | |
| 276 | + if (result.indexOf(BlufiConstants.BIND_SUCCESS) != -1||result.indexOf(BlufiConstants.BIND_FAIL) != -1) { | |
| 277 | 277 | isSetNetSuccess = true; |
| 278 | 278 | BleManager.getInstance().stopNotify(bleDevice, BlufiConstants.UUID_WIFI_SERVICE.toString(), BlufiConstants.UUID_NOTIFY_CHARACTERISTIC.toString()); |
| 279 | 279 | BleManager.getInstance().disconnect(bleDevice); | ... | ... |