API add device diff1 work
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/API-README b/API-README
index 1c2846a..cc8ee9e 100644
--- a/API-README
+++ b/API-README
@@ -362,6 +362,9 @@ Added API commands:
Modified API commands:
Change pool field name 'Diff1 Shares' to 'Diff1 Work'
+ 'devs' - add 'Diff1 Work' to all devices
+ 'gpu|N' - add 'Diff1 Work'
+ 'pga|N' - add 'Diff1 Work'
----------
diff --git a/api.c b/api.c
index affe13c..b4ec40f 100644
--- a/api.c
+++ b/api.c
@@ -1345,6 +1345,7 @@ static void gpustatus(int gpu, bool isjson)
root = api_add_int(root, "Last Share Pool", &last_share_pool, false);
root = api_add_time(root, "Last Share Time", &(cgpu->last_share_pool_time), false);
root = api_add_mhtotal(root, "Total MH", &(cgpu->total_mhashes), false);
+ root = api_add_int(root, "Diff1 Work", &(cgpu->diff1), false);
root = print_data(root, buf, isjson);
strcat(io_buffer, buf);
@@ -1428,6 +1429,7 @@ static void pgastatus(int pga, bool isjson)
root = api_add_time(root, "Last Share Time", &(cgpu->last_share_pool_time), false);
root = api_add_mhtotal(root, "Total MH", &(cgpu->total_mhashes), false);
root = api_add_freq(root, "Frequency", &frequency, false);
+ root = api_add_int(root, "Diff1 Work", &(cgpu->diff1), false);
root = print_data(root, buf, isjson);
strcat(io_buffer, buf);
@@ -1460,6 +1462,7 @@ static void cpustatus(int cpu, bool isjson)
root = api_add_int(root, "Last Share Pool", &last_share_pool, false);
root = api_add_time(root, "Last Share Time", &(cgpu->last_share_pool_time), false);
root = api_add_mhtotal(root, "Total MH", &(cgpu->total_mhashes), false);
+ root = api_add_int(root, "Diff1 Work", &(cgpu->diff1), false);
root = print_data(root, buf, isjson);
strcat(io_buffer, buf);
diff --git a/miner.php b/miner.php
index 9c6f694..8202cb6 100644
--- a/miner.php
+++ b/miner.php
@@ -755,8 +755,12 @@ function fmt($section, $name, $value, $when, $alldata)
case 'SUMMARY.Discarded':
case 'POOL.Discarded':
case 'total.Discarded':
- case 'POOL.Diff1 Shares':
- case 'total.Diff1 Shares':
+ case 'GPU.Diff1 Work':
+ case 'PGA.Diff1 Work':
+ case 'POOL.Diff1 Work':
+ case 'total.Diff1 Work':
+ case 'POOL.Diff1 Shares': // old name
+ case 'total.Diff1 Shares': // old name
$parts = explode('.', $value, 2);
if (count($parts) == 1)
$dec = '';