@@ -16,9 +16,13 @@ internal sealed class D5Next : Hardware
1616 // ID 12; Length 1025; <-- 0xC FEATURE
1717
1818 private readonly byte [ ] _rawData = new byte [ 1025 ] ;
19- private readonly Sensor [ ] _rpmSensors = new Sensor [ 1 ] ;
19+ private readonly Sensor [ ] _rpmSensors = new Sensor [ 2 ] ;
2020 private readonly HidStream _stream ;
2121 private readonly Sensor [ ] _temperatures = new Sensor [ 1 ] ;
22+ private readonly Sensor [ ] _voltages = new Sensor [ 4 ] ;
23+ private readonly Sensor [ ] _powers = new Sensor [ 2 ] ;
24+ private readonly Sensor [ ] _flows = new Sensor [ 1 ] ;
25+ private readonly Sensor [ ] _fanControl = new Sensor [ 2 ] ;
2226
2327 public D5Next ( HidDevice dev , ISettings settings ) : base ( "D5Next" , new Identifier ( dev ) , settings )
2428 {
@@ -34,6 +38,36 @@ internal sealed class D5Next : Hardware
3438
3539 _rpmSensors [ 0 ] = new Sensor ( "Pump" , 0 , SensorType . Fan , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
3640 ActivateSensor ( _rpmSensors [ 0 ] ) ;
41+
42+ _rpmSensors [ 1 ] = new Sensor ( "Fan" , 1 , SensorType . Fan , this , settings ) ;
43+ ActivateSensor ( _rpmSensors [ 1 ] ) ;
44+
45+ _voltages [ 0 ] = new Sensor ( "Fan Voltage" , 0 , SensorType . Voltage , this , settings ) ;
46+ ActivateSensor ( _voltages [ 0 ] ) ;
47+
48+ _voltages [ 1 ] = new Sensor ( "Pump Voltage" , 1 , SensorType . Voltage , this , settings ) ;
49+ ActivateSensor ( _voltages [ 1 ] ) ;
50+
51+ _voltages [ 2 ] = new Sensor ( "+5V Voltage" , 2 , SensorType . Voltage , this , settings ) ;
52+ ActivateSensor ( _voltages [ 2 ] ) ;
53+
54+ _voltages [ 3 ] = new Sensor ( "+12V Voltage" , 3 , SensorType . Voltage , this , settings ) ;
55+ ActivateSensor ( _voltages [ 3 ] ) ;
56+
57+ _powers [ 0 ] = new Sensor ( "Fan Power" , 0 , SensorType . Power , this , settings ) ;
58+ ActivateSensor ( _powers [ 0 ] ) ;
59+
60+ _powers [ 1 ] = new Sensor ( "Pump Power" , 1 , SensorType . Power , this , settings ) ;
61+ ActivateSensor ( _powers [ 1 ] ) ;
62+
63+ _flows [ 0 ] = new Sensor ( "Viritual Flow" , 0 , SensorType . Flow , this , settings ) ;
64+ ActivateSensor ( _flows [ 0 ] ) ;
65+
66+ _fanControl [ 0 ] = new Sensor ( "Fan Control" , 0 , SensorType . Control , this , settings ) ;
67+ ActivateSensor ( _fanControl [ 0 ] ) ;
68+
69+ _fanControl [ 1 ] = new Sensor ( "Pump Control" , 1 , SensorType . Control , this , settings ) ;
70+ ActivateSensor ( _fanControl [ 1 ] ) ;
3771 }
3872 }
3973
@@ -56,5 +90,20 @@ public override void Update()
5690 _stream . Read ( _rawData ) ;
5791 _temperatures [ 0 ] . Value = ( _rawData [ 88 ] | ( _rawData [ 87 ] << 8 ) ) / 100f ; //Water Temp
5892 _rpmSensors [ 0 ] . Value = _rawData [ 117 ] | ( _rawData [ 116 ] << 8 ) ; //Pump RPM
93+ _rpmSensors [ 1 ] . Value = ReadUInt16BE ( _rawData , 103 ) ; //Fan RPM
94+ _voltages [ 0 ] . Value = ReadUInt16BE ( _rawData , 97 ) / 100f ; //Fan Voltage
95+ _voltages [ 1 ] . Value = ReadUInt16BE ( _rawData , 110 ) / 100f ; //Pump Voltage
96+ _voltages [ 2 ] . Value = ReadUInt16BE ( _rawData , 57 ) / 100f ; //+5V Voltage
97+ _voltages [ 3 ] . Value = ReadUInt16BE ( _rawData , 55 ) / 100f ; //+12V Voltage
98+ _powers [ 0 ] . Value = ReadUInt16BE ( _rawData , 101 ) / 100f ; //Fan Power Consumption
99+ _powers [ 1 ] . Value = ReadUInt16BE ( _rawData , 114 ) / 100f ; //Pump Power Consumption
100+ _flows [ 0 ] . Value = ReadUInt16BE ( _rawData , 89 ) / 10f ; // Viritual Flow
101+ _fanControl [ 0 ] . Value = ReadUInt16BE ( _rawData , 95 ) / 100f ; // Fan Control in % (0-100)
102+ _fanControl [ 1 ] . Value = ReadUInt16BE ( _rawData , 108 ) / 100f ; // Pump Control in % (0-100)
103+ }
104+
105+ private ushort ReadUInt16BE ( byte [ ] value , int startIndex )
106+ {
107+ return ( ushort ) ( value [ startIndex + 1 ] | ( value [ startIndex ] << 8 ) ) ;
59108 }
60109}
0 commit comments