Browse Source

Added get_api_extra_device_status for 'devs' request in metabank driver: Slot, Clock Bits, Temperature, Voltage.

Vicus-N 12 years ago
parent
commit
1b07da97df
1 changed files with 21 additions and 0 deletions
  1. 21 0
      driver-metabank.c

+ 21 - 0
driver-metabank.c

@@ -176,6 +176,26 @@ static void metabank_shutdown(struct thr_info *thr)
 	tm_i2c_close();
 }
 
+static struct api_data *metabank_api_extra_device_status(struct cgpu_info *cgpu)
+{
+	struct api_data *root = NULL;
+	float t, vc0, vc1;
+	struct bitfury_device * const bitfury = cgpu->device_data;
+
+	root = api_add_uint(root, "Slot", &(bitfury->slot), false);
+	root = api_add_int(root, "Clock Bits", (int*)&bitfury->osc6_bits, false);
+
+	t = tm_i2c_gettemp(bitfury->slot) * 0.1;
+	vc0 = tm_i2c_getcore0(bitfury->slot);
+	vc1 = tm_i2c_getcore1(bitfury->slot);
+
+	root = api_add_temp(root, "Slot Temp", &t, true);
+	root = api_add_temp(root, "Slot VC0", &vc0, true);
+	root = api_add_temp(root, "Slot VC1", &vc1, true);
+
+	return root;
+}
+
 struct device_drv metabank_drv = {
 	.dname = "metabank",
 	.name = "MBF",
@@ -194,4 +214,5 @@ struct device_drv metabank_drv = {
 	.job_process_results = bitfury_job_process_results,
 	
 	.thread_shutdown = metabank_shutdown,
+	.get_api_extra_device_status = metabank_api_extra_device_status,
 };