Browse Source

API add device diff1 work

nfactor-troky
Kano 12 years ago
parent
commit
93555e271a
  1. 3
      API-README
  2. 3
      api.c
  3. 8
      miner.php

3
API-README

@ -362,6 +362,9 @@ Added API commands:
Modified API commands: Modified API commands:
Change pool field name 'Diff1 Shares' to 'Diff1 Work' 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'
---------- ----------

3
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_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_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_mhtotal(root, "Total MH", &(cgpu->total_mhashes), false);
root = api_add_int(root, "Diff1 Work", &(cgpu->diff1), false);
root = print_data(root, buf, isjson); root = print_data(root, buf, isjson);
strcat(io_buffer, buf); 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_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_mhtotal(root, "Total MH", &(cgpu->total_mhashes), false);
root = api_add_freq(root, "Frequency", &frequency, 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); root = print_data(root, buf, isjson);
strcat(io_buffer, buf); 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_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_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_mhtotal(root, "Total MH", &(cgpu->total_mhashes), false);
root = api_add_int(root, "Diff1 Work", &(cgpu->diff1), false);
root = print_data(root, buf, isjson); root = print_data(root, buf, isjson);
strcat(io_buffer, buf); strcat(io_buffer, buf);

8
miner.php

@ -755,8 +755,12 @@ function fmt($section, $name, $value, $when, $alldata)
case 'SUMMARY.Discarded': case 'SUMMARY.Discarded':
case 'POOL.Discarded': case 'POOL.Discarded':
case 'total.Discarded': case 'total.Discarded':
case 'POOL.Diff1 Shares': case 'GPU.Diff1 Work':
case 'total.Diff1 Shares': 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); $parts = explode('.', $value, 2);
if (count($parts) == 1) if (count($parts) == 1)
$dec = ''; $dec = '';

Loading…
Cancel
Save