Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 43eb578

Browse files
committed
Merge pull request #18 from awong1900/dev_UI_prove
Fixed: internal ota error
2 parents 9602c3e + 6a71f9d commit 43eb578

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

android/app/app.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<orderEntry type="library" exported="" name="support-v13-23.1.0" level="project" />
117117
<orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
118118
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
119-
<orderEntry type="library" exported="" name="okio-1.2.0" level="project" />
120119
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
120+
<orderEntry type="library" exported="" name="okio-1.2.0" level="project" />
121121
</component>
122122
</module>

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "cc.seeed.iot.ap"
88
minSdkVersion 16
99
targetSdkVersion 23
10-
versionCode 2
11-
versionName "1.3"
10+
versionCode 3
11+
versionName "1.4"
1212
}
1313
buildTypes {
1414
release {

android/app/src/main/java/cc/seeed/iot/ui_ap_config/ApConnectActivity.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import cc.seeed.iot.datastruct.User;
3131
import cc.seeed.iot.udp.ConfigUdpSocket;
3232
import cc.seeed.iot.ui_main.MainScreenActivity;
33-
import cc.seeed.iot.ui_smartconfig.GoReadyActivity;
3433
import cc.seeed.iot.util.Common;
3534
import cc.seeed.iot.webapi.IotApi;
3635
import cc.seeed.iot.webapi.IotService;
@@ -113,10 +112,18 @@ public void onClick(View v) {
113112
//APCFG: ssid\tpassword\tkey\tsn\t
114113
// String cmd_connect = "APCFG: " + ssid + "\t" + password + "\t" +
115114
// node_key + "\t" + node_sn + "\t";
116-
String ota_server = ((MyApplication) getApplication()).getServerUrl().split("/")[2];
117-
String exchange_server = ((MyApplication) getApplication()).getExchangeServerUrl().split("/")[2];
115+
String ota_server = ((MyApplication) getApplication()).getServerUrl();
116+
String exchange_server = ((MyApplication) getApplication()).getExchangeServerUrl();
117+
118+
if (ota_server.equals(Common.OTA_CHINA_URL)) {
119+
ota_server = Common.OTA_CHINA_IP;
120+
exchange_server = Common.OTA_CHINA_IP;
121+
} else if (ota_server.equals(Common.OTA_INTERNATIONAL_URL)) {
122+
ota_server = Common.OTA_INTERNATIONAL_IP;
123+
exchange_server = Common.OTA_INTERNATIONAL_IP;
124+
}
118125
String cmd_connect = "APCFG: " + ssid + "\t" + password + "\t" +
119-
node_key + "\t" + node_sn + "\t" + ota_server + "\t" + exchange_server +"\t";
126+
node_key + "\t" + node_sn + "\t" + ota_server + "\t" + exchange_server + "\t";
120127

121128
Log.i(TAG, "cmd_connect: " + cmd_connect);
122129
Log.i(TAG, "ip: " + AP_IP);

android/app/src/main/java/cc/seeed/iot/ui_login/SignInDialogFragment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ public void onClick(View v) {
122122
if (mSwitchAreaView.getText().toString().equals(getString(R.string.setup_switch_international))) {
123123
mSwitchAreaView.setText(R.string.setup_switch_china);
124124
((MyApplication) getActivity().getApplication()).setServerUrl(Common.OTA_INTERNATIONAL_URL);
125+
((MyApplication) getActivity().getApplication()).setExchangeServerUrl(Common.OTA_INTERNATIONAL_URL);
125126
} else {
126127
mSwitchAreaView.setText(R.string.setup_switch_international);
127128
((MyApplication) getActivity().getApplication()).setServerUrl(Common.OTA_CHINA_URL);
129+
((MyApplication) getActivity().getApplication()).setExchangeServerUrl(Common.OTA_CHINA_URL);
128130
}
129131
}
130132
});

android/app/src/main/java/cc/seeed/iot/util/Common.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
* Created by tenwong on 15/10/20.
55
*/
66
public class Common {
7-
public static String OTA_CHINA_URL = "https://120.25.216.117/v1";
8-
public static String OTA_INTERNATIONAL_URL = "https://iot.seeed.cc/v1";
7+
public static String OTA_CHINA_URL = "https://cn.iot.seeed.cc/v1"; //120.25.216.117
8+
public static String OTA_INTERNATIONAL_URL = "https://iot.seeed.cc/v1";//45.79.4.239
9+
10+
public static String OTA_CHINA_IP = "120.25.216.117";
11+
public static String OTA_INTERNATIONAL_IP = "45.79.4.239";
12+
13+
914
}

0 commit comments

Comments
 (0)