diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index a22a959..0000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/app/.lock-waf_darwin_build b/app/.lock-waf_darwin_build
index 169f48a..d17b671 100644
--- a/app/.lock-waf_darwin_build
+++ b/app/.lock-waf_darwin_build
@@ -1,5 +1,5 @@
argv = ['/Users/dan/pebble-dev/PebbleSDK-2.0.2/Pebble/waf', 'configure', 'build']
-environ = {'TERM_SESSION_ID': '0E771BB8-6D47-41B3-A896-1B67A6BC492D', 'SSH_AUTH_SOCK': '/tmp/launch-mBweRR/Listeners', 'PYTHONPATH': '/Users/dan/pebble-dev/PebbleSDK-current/bin/../.env/lib/python2.7/site-packages', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'TERM_PROGRAM_VERSION': '326', 'SHELL': '/bin/bash', 'LOGNAME': 'dan', 'USER': 'dan', 'HOME': '/Users/dan', 'PATH': '/Users/dan/pebble-dev/PebbleSDK-2.0.2/arm-cs-tools/bin:/Users/dan/pebble-dev/PebbleSDK-current/bin:/Applications/Android Studio.app/sdk/tools/:/Applications/Android Studio.app/sdk/platform-tools/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin', 'DISPLAY': '/tmp/launch-FHtlTI/org.macosforge.xquartz:0', 'TMPDIR': '/var/folders/5l/h8wjt5t52cs2n6h7zcd3kw040000gn/T/', 'TERM_PROGRAM': 'Apple_Terminal', 'LANG': 'en_GB.UTF-8', 'TERM': 'xterm-256color', 'Apple_PubSub_Socket_Render': '/tmp/launch-BrNYWU/Render', 'VERSIONER_PYTHON_VERSION': '2.7', 'SHLVL': '2', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0', 'PWD': '/Users/dan/Workspace/minewatch/app', '_': '/Users/dan/pebble-dev/PebbleSDK-2.0.2/Pebble/waf', '__CHECKFIX1436934': '1', 'PEBBLE_PHONE': '192.168.1.147'}
+environ = {'TERM_SESSION_ID': '3CD8238C-58C7-4290-8ACF-B40F29CAA6DF', 'SSH_AUTH_SOCK': '/tmp/launch-6iGfhV/Listeners', 'PYTHONPATH': '/Users/dan/pebble-dev/PebbleSDK-current/bin/../.env/lib/python2.7/site-packages', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'TERM_PROGRAM_VERSION': '326', 'SHELL': '/bin/bash', 'LOGNAME': 'dan', 'USER': 'dan', 'HOME': '/Users/dan', 'PATH': '/Users/dan/pebble-dev/PebbleSDK-2.0.2/arm-cs-tools/bin:/Users/dan/pebble-dev/PebbleSDK-current/bin:/Applications/Android Studio.app/sdk/tools/:/Applications/Android Studio.app/sdk/platform-tools/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin', 'DISPLAY': '/tmp/launch-oMwao1/org.macosforge.xquartz:0', 'TMPDIR': '/var/folders/5l/h8wjt5t52cs2n6h7zcd3kw040000gn/T/', 'TERM_PROGRAM': 'Apple_Terminal', 'LANG': 'en_GB.UTF-8', 'TERM': 'xterm-256color', 'Apple_PubSub_Socket_Render': '/tmp/launch-YAZ4GK/Render', 'VERSIONER_PYTHON_VERSION': '2.7', 'SHLVL': '2', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0', 'PWD': '/Users/dan/Workspace/minewatch/app', '_': '/Users/dan/pebble-dev/PebbleSDK-2.0.2/Pebble/waf', 'JAVA_HOME': '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home', '__CHECKFIX1436934': '1', 'PEBBLE_PHONE': '192.168.1.147'}
files = ['/Users/dan/Workspace/minewatch/app/wscript']
hash = 4672844372416070989
options = {'files': '', 'jobs': 4, 'verbose': 0, 'nocache': False, 'progress_bar': 0, 'timestamp': None, 'distcheck_args': None, 'top': '', 'destdir': '', 'keep': 0, 'zones': '', 'debug': False, 'prefix': '/usr/local/', 'download': False, 'force': False, 'targets': '', 'out': ''}
diff --git a/app/appinfo.json b/app/appinfo.json
index ee52f64..78fd6b3 100644
--- a/app/appinfo.json
+++ b/app/appinfo.json
@@ -3,13 +3,14 @@
"shortName": "MineWatch",
"longName": "MineWatch",
"companyName": "Daniel Head",
- "versionCode": 2,
- "versionLabel": "1.0.1",
+ "versionCode": 3,
+ "versionLabel": "1.0.2",
"watchapp": {
"watchface": true
},
"capabilities": [ "configurable" ],
"appKeys": {
+ "version":0,
"response":1,
"update":2,
"dark":3,
diff --git a/app/src/js/pebble-js-app.js b/app/src/js/pebble-js-app.js
index 1750404..d3c4f09 100644
--- a/app/src/js/pebble-js-app.js
+++ b/app/src/js/pebble-js-app.js
@@ -1,4 +1,6 @@
var config = {
+ "jsversion":"1.0.2",
+ "pblversion":(localStorage.getItem("pblversion") || ""),
"dark":((localStorage.getItem("dark") == "true")?true:false),
"notify":((localStorage.getItem("notify") == "true")?true:false),
"flick":((localStorage.getItem("flick") == "true")?true:false),
@@ -35,13 +37,7 @@ var sendResponseWithUpdate = function(obj) {
return;
}
var req = new XMLHttpRequest();
- req.timeout = 30000;
- req.ontimeout = function() {
- if(!obj) obj = {};
- obj["response"] = "TIMEOUT";
- Pebble.sendAppMessage(obj);
- }
- req.onload = function(e) {
+ req.onreadystatechange = function() {
if (req.readyState == 4) {
if(req.status == 200) {
var response = JSON.parse(req.responseText);
@@ -78,13 +74,15 @@ var sendResponseWithUpdate = function(obj) {
obj["response"] = "InvAPI";
Pebble.sendAppMessage(obj);
}
- } else {
- if(!obj) obj = {};
- obj["response"] = "TIMEOUT";
- Pebble.sendAppMessage(obj);
}
}
req.open('GET', "https://mining.bitcoin.cz/accounts/profile/json/" + config.apikey, true);
+ req.timeout = 30000;
+ req.ontimeout = function() {
+ if(!obj) obj = {};
+ obj["response"] = "TIMEOUT";
+ Pebble.sendAppMessage(obj);
+ }
req.send(null);
}
var getSettings = function() {
@@ -101,6 +99,10 @@ Pebble.addEventListener("ready", function(e) {
});
Pebble.addEventListener("appmessage", function(e) {
+ if(e.payload.version) {
+ config.pblversion = e.payload.version;
+ localStorage.setItem("pblversion",e.payload.version);
+ }
sendResponseWithUpdate();
});
Pebble.addEventListener("showConfiguration", function(e) {
diff --git a/app/src/minewatch.c b/app/src/minewatch.c
index 46562a9..80e621e 100644
--- a/app/src/minewatch.c
+++ b/app/src/minewatch.c
@@ -4,6 +4,7 @@
static Window *window;
static GFont font_xs, font_s, font_m, font_l;
static InverterLayer *inverter_layer;
+static char *version_number = "1.0.2";
//TIME/DATE
static TextLayer *time_layer;
@@ -13,7 +14,7 @@ static char date_text[] = "00 Xxxxxxxxx";
//REFRESH ICON
static AppTimer *timeout_timer;
-static int timeout_length = 15000; //ms
+//static int timeout_length = 65000; //ms
static BitmapLayer *refresh_layer;
static GBitmap *refresh_icon;
@@ -59,6 +60,7 @@ static int progress_width = 0;
//KEYS
enum {
+ VERSION = 0x0,
RESPONSE = 0x1,
UPDATE = 0x2,
DARK = 0x3,
@@ -100,8 +102,8 @@ static void fetch_msg(void) {
//Make sure we don't request more than once per min (be nice to Mr Slush)
if(current_min == last_update_min) return;
last_update_min = current_min;
- Tuplet fetch_tuple = TupletInteger(0x0, 1);
- timeout_timer = app_timer_register(timeout_length,timeout_callback, NULL);
+
+ //timeout_timer = app_timer_register(timeout_length,timeout_callback, NULL);
show_refresh(true);
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
@@ -109,11 +111,11 @@ static void fetch_msg(void) {
if (iter == NULL) {
return;
}
-
- dict_write_tuplet(iter, &fetch_tuple);
+ dict_write_cstring(iter, VERSION, version_number);
dict_write_end(iter);
- app_message_outbox_send();
+ uint32_t appMsgResp = app_message_outbox_send();
+ if(appMsgResp != APP_MSG_OK) show_refresh(false);
}
static void handle_flick(AccelAxisType axis, int32_t direction) {
@@ -258,7 +260,7 @@ static void in_received_handler(DictionaryIterator *iter, void *context) {
layer_set_hidden(btc_parent_layer,false);
strcpy(last_update_text,time_text);
}
- app_timer_cancel(timeout_timer);
+ //app_timer_cancel(timeout_timer);
if(strcmp(response_tuple->value->cstring,"TIMEOUT")!=0) layer_set_hidden(bitmap_layer_get_layer(refresh_layer),true);
}
}
@@ -483,7 +485,7 @@ static void init(void) {
bluetooth_connection_service_subscribe(handle_bluetooth);
tick_timer_service_subscribe(MINUTE_UNIT, handle_minute_tick);
if(flick) enable_flick(true);
- timeout_timer = app_timer_register(timeout_length,timeout_callback, NULL);
+ //timeout_timer = app_timer_register(timeout_length,timeout_callback, NULL);
}
static void deinit(void) {
diff --git a/httpdocs/.idea/workspace.xml b/httpdocs/.idea/workspace.xml
index fba3dd3..5acb1d1 100644
--- a/httpdocs/.idea/workspace.xml
+++ b/httpdocs/.idea/workspace.xml
@@ -27,11 +27,11 @@
Please report any bugs and submit feature requests to me@danielhead.com.
Support for other mining pools can be accomodated upon request.
-Like this watchface? Bitcoin donations, no matter how small are appreciated. My bitcoin address is: 1CCsuAXhEbLiL2a43x1yxuhk5F6hEt1EBQ
\ No newline at end of file +Like this watchface? Bitcoin donations, no matter how small are appreciated. My bitcoin address is: 1CCsuAXhEbLiL2a43x1yxuhk5F6hEt1EBQ
+For further support and feedback, please visit danielhead.com/minewatch
+App version: / JS version:
\ No newline at end of file diff --git a/httpdocs/config.src/build.sh b/httpdocs/config.src/build.sh old mode 100644 new mode 100755 index 550f40c..97155d7 --- a/httpdocs/config.src/build.sh +++ b/httpdocs/config.src/build.sh @@ -1,6 +1,6 @@ #!/bin/bash scss -t compressed main.scss main.css -java -jar /home/dan/.local/share/gcc/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS main.js > main-min.js +java -jar /Users/dan/.local/share/gcc/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS main.js > main-min.js touch index.html echo '' > index.html echo '' >> index.html diff --git a/httpdocs/config.src/index.html b/httpdocs/config.src/index.html index 224fffd..1bb7f25 100644 --- a/httpdocs/config.src/index.html +++ b/httpdocs/config.src/index.html @@ -3,14 +3,15 @@Please report any bugs and submit feature requests to me@danielhead.com.
Support for other mining pools can be accomodated upon request.
-Like this watchface? Bitcoin donations, no matter how small are appreciated. My bitcoin address is: 1CCsuAXhEbLiL2a43x1yxuhk5F6hEt1EBQ
+Like this watchface? Bitcoin donations, no matter how small are appreciated. My bitcoin address is: 1CCsuAXhEbLiL2a43x1yxuhk5F6hEt1EBQ
+For further support and feedback, please visit danielhead.com/minewatch
+App version: / JS version: