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

Commit

Permalink
Merge pull request #18 from awong1900/dev_UI_prove
Browse files Browse the repository at this point in the history
Fixed: internal ota error
  • Loading branch information
awong1900 committed Nov 7, 2015
2 parents 9602c3e + 6a71f9d commit 43eb578
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion android/app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<orderEntry type="library" exported="" name="support-v13-23.1.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.2.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.2.0" level="project" />
</component>
</module>
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "cc.seeed.iot.ap"
minSdkVersion 16
targetSdkVersion 23
versionCode 2
versionName "1.3"
versionCode 3
versionName "1.4"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import cc.seeed.iot.datastruct.User;
import cc.seeed.iot.udp.ConfigUdpSocket;
import cc.seeed.iot.ui_main.MainScreenActivity;
import cc.seeed.iot.ui_smartconfig.GoReadyActivity;
import cc.seeed.iot.util.Common;
import cc.seeed.iot.webapi.IotApi;
import cc.seeed.iot.webapi.IotService;
Expand Down Expand Up @@ -113,10 +112,18 @@ public void onClick(View v) {
//APCFG: ssid\tpassword\tkey\tsn\t
// String cmd_connect = "APCFG: " + ssid + "\t" + password + "\t" +
// node_key + "\t" + node_sn + "\t";
String ota_server = ((MyApplication) getApplication()).getServerUrl().split("/")[2];
String exchange_server = ((MyApplication) getApplication()).getExchangeServerUrl().split("/")[2];
String ota_server = ((MyApplication) getApplication()).getServerUrl();
String exchange_server = ((MyApplication) getApplication()).getExchangeServerUrl();

if (ota_server.equals(Common.OTA_CHINA_URL)) {
ota_server = Common.OTA_CHINA_IP;
exchange_server = Common.OTA_CHINA_IP;
} else if (ota_server.equals(Common.OTA_INTERNATIONAL_URL)) {
ota_server = Common.OTA_INTERNATIONAL_IP;
exchange_server = Common.OTA_INTERNATIONAL_IP;
}
String cmd_connect = "APCFG: " + ssid + "\t" + password + "\t" +
node_key + "\t" + node_sn + "\t" + ota_server + "\t" + exchange_server +"\t";
node_key + "\t" + node_sn + "\t" + ota_server + "\t" + exchange_server + "\t";

Log.i(TAG, "cmd_connect: " + cmd_connect);
Log.i(TAG, "ip: " + AP_IP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ public void onClick(View v) {
if (mSwitchAreaView.getText().toString().equals(getString(R.string.setup_switch_international))) {
mSwitchAreaView.setText(R.string.setup_switch_china);
((MyApplication) getActivity().getApplication()).setServerUrl(Common.OTA_INTERNATIONAL_URL);
((MyApplication) getActivity().getApplication()).setExchangeServerUrl(Common.OTA_INTERNATIONAL_URL);
} else {
mSwitchAreaView.setText(R.string.setup_switch_international);
((MyApplication) getActivity().getApplication()).setServerUrl(Common.OTA_CHINA_URL);
((MyApplication) getActivity().getApplication()).setExchangeServerUrl(Common.OTA_CHINA_URL);
}
}
});
Expand Down
9 changes: 7 additions & 2 deletions android/app/src/main/java/cc/seeed/iot/util/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
* Created by tenwong on 15/10/20.
*/
public class Common {
public static String OTA_CHINA_URL = "https://120.25.216.117/v1";
public static String OTA_INTERNATIONAL_URL = "https://iot.seeed.cc/v1";
public static String OTA_CHINA_URL = "https://cn.iot.seeed.cc/v1"; //120.25.216.117
public static String OTA_INTERNATIONAL_URL = "https://iot.seeed.cc/v1";//45.79.4.239

public static String OTA_CHINA_IP = "120.25.216.117";
public static String OTA_INTERNATIONAL_IP = "45.79.4.239";


}

0 comments on commit 43eb578

Please sign in to comment.