api.c config 'Device Code' to show list of compiled devices + README
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 62 63 64 65 66 67 68 69 70
diff --git a/README b/README
index 9ee3a3d..2999368 100644
--- a/README
+++ b/README
@@ -620,7 +620,7 @@ The STATUS section is:
This defaults to the cgminer version but is the value of --api-description
if it was specified at runtime.
-For API version 1.5:
+For API version 1.6:
The list of requests - a (*) means it requires privileged access - and replies are:
@@ -637,7 +637,8 @@ The list of requests - a (*) means it requires privileged access - and replies a
ADL=X, <- Y or N if ADL is compiled in the code
ADL in use=X, <- Y or N if any GPU has ADL
Strategy=Name, <- the current pool strategy
- Log Interval=N| <- log interval (--log N)
+ Log Interval=N, <- log interval (--log N)
+ Device Code=GPU ICA | <- spaced list of compiled devices
summary SUMMARY The status summary of the miner
e.g. Elapsed=NNN,Found Blocks=N,Getworks=N,...|
diff --git a/api.c b/api.c
index 6cdeada..04cc929 100644
--- a/api.c
+++ b/api.c
@@ -157,7 +157,7 @@ static const char *COMMA = ",";
static const char SEPARATOR = '|';
static const char GPUSEP = ',';
-static const char *APIVERSION = "1.5";
+static const char *APIVERSION = "1.6";
static const char *DEAD = "Dead";
static const char *SICK = "Sick";
static const char *NOSTART = "NoStart";
@@ -169,6 +169,21 @@ static const char *DYNAMIC = _DYNAMIC;
static const char *YES = "Y";
static const char *NO = "N";
+static const char *DEVICECODE = ""
+#ifdef HAVE_OPENCL
+ "GPU "
+#endif
+#ifdef USE_BITFORCE
+ "BFL "
+#endif
+#ifdef USE_ICARUS
+ "ICA "
+#endif
+#ifdef WANT_CPUMINE
+ "CPU "
+#endif
+ "";
+
#define _DEVS "DEVS"
#define _POOLS "POOLS"
#define _SUMMARY "SUMMARY"
@@ -643,9 +658,9 @@ static void minerconfig(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
strcpy(io_buffer, message(MSG_MINECON, 0, NULL, isjson));
if (isjson)
- sprintf(buf, "," JSON_MINECON "{\"GPU Count\":%d,\"PGA Count\":%d,\"CPU Count\":%d,\"Pool Count\":%d,\"ADL\":\"%s\",\"ADL in use\":\"%s\",\"Strategy\":\"%s\",\"Log Interval\":\"%d\"}" JSON_CLOSE, nDevs, pgacount, cpucount, total_pools, adl, adlinuse, strategies[pool_strategy].s, opt_log_interval);
+ sprintf(buf, "," JSON_MINECON "{\"GPU Count\":%d,\"PGA Count\":%d,\"CPU Count\":%d,\"Pool Count\":%d,\"ADL\":\"%s\",\"ADL in use\":\"%s\",\"Strategy\":\"%s\",\"Log Interval\":\"%d\",\"Device Code\":\"%s\"}" JSON_CLOSE, nDevs, pgacount, cpucount, total_pools, adl, adlinuse, strategies[pool_strategy].s, opt_log_interval, DEVICECODE);
else
- sprintf(buf, _MINECON ",GPU Count=%d,PGA Count=%d,CPU Count=%d,Pool Count=%d,ADL=%s,ADL in use=%s,Strategy=%s,Log Interval=%d%c", nDevs, pgacount, cpucount, total_pools, adl, adlinuse, strategies[pool_strategy].s, opt_log_interval, SEPARATOR);
+ sprintf(buf, _MINECON ",GPU Count=%d,PGA Count=%d,CPU Count=%d,Pool Count=%d,ADL=%s,ADL in use=%s,Strategy=%s,Log Interval=%d,Device Code=%s%c", nDevs, pgacount, cpucount, total_pools, adl, adlinuse, strategies[pool_strategy].s, opt_log_interval, DEVICECODE, SEPARATOR);
strcat(io_buffer, buf);
}