Add a color (2 colors can be now defined for a machine).
[temp2RGB.git] / TODO.md
1
2 * Mother board: [ASUS ROG CROSSHAIR VIII HERO] Registering RGB controller
3 * Corsair: [Corsair Lighting Node Pro] Registering RGB controller
4 * RTX 3080:
5   6319  |Info:    Registering I2C interface: Nuvoton NCT6798D SMBus at 200 Device 0000:0000 Subsystem: 0000:0000
6   6325  |Info:    Registering I2C interface: NVidia NvAPI I2C on GPU 0 Device 10DE:2208 Subsystem: 1458:4087
7   7280  |Info:    Registering I2C interface: AMD SMBus at 0x0B00 Device 1022:790B Subsystem: 1043:87C0
8   7280  |Info:    Registering I2C interface: AMD SMBus at 0x0B20 Device 1022:790B Subsystem: 1043:87C0
9
10
11
12 [ok] Add the support for A770 RGB
13 [ok] Add parameters "--install-service" and "--uninstall-service", see: https://github.com/mullvad/windows-service-rs/blob/main/examples/install_service.rs
14 [ok] Add a parameter (using clap) "--no-service" to run it without the service system
15 [ok] Create the service and test it
16 [ok] * Implement RGB for RAM:
17   * Use the same approach of OpenRGB by using https://github.com/GermanAizek/WinRing0
18 [ok]  How to read temperature of GPU + CPU ? : https://github.com/GermanAizek/WinRing0 (Replace managing a ring0 driver and calling 'DeviceIoControl' manually)
19 [ok] Assign color to:
20     * Graphic card
21     * MB: "ASUS ROG STRIX B650E-I GAMING WIFI", Location:
22         * LED Strips
23         * AIO Pump
24     * RAM : "Corsair Dominator Platinum"?
25 [ok] Define how GPU + CPU temperature are combined
26 [ok] Define update/polling rate (1s ?)
27 [ok] Define filtering function (moving average) 10s kernel size?
28 [ok] Set the exe as service or start it at startup
29
30
31 Temp = (CPU + GPU) / 2
32 Colors [R,G,B]
33 Cold: [0, 255, 40]: (55 + 44) / 2 = 50°C
34 Hot: [255, 0, 0]: (75 + 85) / 2 = 80°C
35
36
37 Get-WmiObject -query "SELECT * FROM Win32_PnPSignedDriver" > output_PnPSignedDriver.txt
38 Get-WmiObject -query "SELECT * FROM Win32_PnPAllocatedResource" > output_PnPAllocatedResource.txt
39
40
41 Intel(R) NF I2C Host Controller
42
43
44 \\?\C:\Users\gburri\Projects\temp2RGB\target\debug\WinRing0x64.sys
45
46 A770:
47 "\\\\?\\PCI#VEN_8086&DEV_56A0&SUBSYS_38881025&REV_08#6&1cb01252&0&00080009#{1ca05180-a699-450a-9a0c-de4fbe3ddd89}"
48
49
50   [return: MarshalAs(UnmanagedType.U1)]
51   internal static unsafe bool CVGAAdaptor\u002ESetLEDColor(
52     [In] CVGAAdaptor* obj0,
53     byte nArea,
54     byte r,
55     byte g,
56     byte b)
57   {
58     \u0024ArrayType\u0024\u0024\u0024BY08E arrayTypeBy08E;
59     // ISSUE: cast to a reference type
60     // ISSUE: explicit reference operation
61     ^(sbyte&) ref arrayTypeBy08E = (sbyte) 7;
62     // ISSUE: cast to a reference type
63     // ISSUE: explicit reference operation
64     ^(sbyte&) ((IntPtr) &arrayTypeBy08E + 1) = (sbyte) 7;
65     // ISSUE: cast to a reference type
66     // ISSUE: explicit reference operation
67     ^(sbyte&) ((IntPtr) &arrayTypeBy08E + 2) = (sbyte) nArea;
68     // ISSUE: cast to a reference type
69     // ISSUE: explicit reference operation
70     ^(sbyte&) ((IntPtr) &arrayTypeBy08E + 3) = (sbyte) r;
71     // ISSUE: cast to a reference type
72     // ISSUE: explicit reference operation
73     ^(sbyte&) ((IntPtr) &arrayTypeBy08E + 4) = (sbyte) g;
74     // ISSUE: cast to a reference type
75     // ISSUE: explicit reference operation
76     ^(sbyte&) ((IntPtr) &arrayTypeBy08E + 5) = (sbyte) b;
77     // ISSUE: cast to a reference type
78     // ISSUE: explicit reference operation
79     ^(sbyte&) ((IntPtr) &arrayTypeBy08E + 6) = (sbyte) 0;
80     // ISSUE: cast to a reference type
81     // ISSUE: explicit reference operation
82     ^(sbyte&) ((IntPtr) &arrayTypeBy08E + 7) = (sbyte) 0;
83     // ISSUE: cast to a reference type
84     // ISSUE: explicit reference operation
85     ^(sbyte&) ((IntPtr) &arrayTypeBy08E + 8) = (sbyte) 0;
86     ulong num1 = 9;
87     \u0024ArrayType\u0024\u0024\u0024BY08E* arrayTypeBy08EPtr1 = &\u003CModule\u003E.\u003FA0x171ed149\u002E\u003FprevData\u0040\u003F1\u003F\u003FSetLEDColor\u0040CVGAAdaptor\u0040\u0040UEAA_NEEEE\u0040Z\u00404PAEA;
88     \u0024ArrayType\u0024\u0024\u0024BY08E* arrayTypeBy08EPtr2 = &arrayTypeBy08E;
89     byte num2 = 7;
90     // ISSUE: cast to a reference type
91     // ISSUE: explicit reference operation
92     byte num3 = ^(byte&) ref \u003CModule\u003E.\u003FA0x171ed149\u002E\u003FprevData\u0040\u003F1\u003F\u003FSetLEDColor\u0040CVGAAdaptor\u0040\u0040UEAA_NEEEE\u0040Z\u00404PAEA;
93     // ISSUE: cast to a reference type
94     // ISSUE: explicit reference operation
95     if ((byte) 7 >= ^(byte&) ref \u003CModule\u003E.\u003FA0x171ed149\u002E\u003FprevData\u0040\u003F1\u003F\u003FSetLEDColor\u0040CVGAAdaptor\u0040\u0040UEAA_NEEEE\u0040Z\u00404PAEA)
96     {
97       while ((uint) num2 <= (uint) num3)
98       {
99         if (num1 == 1UL)
100           return true;
101         --num1;
102         ++arrayTypeBy08EPtr2;
103         ++arrayTypeBy08EPtr1;
104         num2 = *(byte*) arrayTypeBy08EPtr2;
105         num3 = *(byte*) arrayTypeBy08EPtr1;
106         if ((uint) num2 < (uint) num3)
107           break;
108       }
109     }
110     \u003CModule\u003E.\u003FA0x171ed149\u002E\u003FprevData\u0040\u003F1\u003F\u003FSetLEDColor\u0040CVGAAdaptor\u0040\u0040UEAA_NEEEE\u0040Z\u00404PAEA = arrayTypeBy08E;
111     \u003CModule\u003E.CVGAAdaptor\u002ELogData(obj0, (sbyte*) &\u003CModule\u003E.\u003F\u003F_C\u0040_0BB\u0040MOBGKECJ\u0040Fake\u003F5I2C_Write\u003F3\u003F5\u0040, (byte*) &arrayTypeBy08E, 9);
112     return true;
113   }
114
115    [return: MarshalAs(UnmanagedType.U1)]
116   internal static unsafe bool CVGAAdaptorIntel\u002EI2C_Write(
117     [In] CVGAAdaptorIntel* obj0,
118     int nOffset,
119     byte* pData,
120     int nDataSize,
121     [MarshalAs(UnmanagedType.U1)] bool bOutputDebug)
122   {
123     if (*(long*) ((IntPtr) obj0 + 1256L) == -1L && !\u003CModule\u003E.CVGAAdaptorIntel\u002EI2C_OpenDevice(obj0))
124       return false;
125     \u0024ArrayType\u0024\u0024\u0024BY0IA\u0040D arrayTypeBy0IaD;
126     if (!\u003CModule\u003E.CVGAAdaptorIntel\u002EI2C_OpenTarget(obj0))
127     {
128       \u003CModule\u003E.sprintf_s((sbyte*) &arrayTypeBy0IaD, 128UL, (sbyte*) &\u003CModule\u003E.\u003F\u003F_C\u0040_0CO\u0040GJJFMHGA\u0040DeviceIoControl\u003F\u0024CI\u003F\u0024CJ\u003F5to\u003F5devcie\u003F5FAI\u0040, __arglist ((int) \u003CModule\u003E.GetLastError()));
129       \u003CModule\u003E.OutputDebugStringA((sbyte*) &arrayTypeBy0IaD);
130     }
131     if (bOutputDebug)
132       \u003CModule\u003E.CVGAAdaptor\u002ELogData((CVGAAdaptor*) obj0, (sbyte*) &\u003CModule\u003E.\u003F\u003F_C\u0040_0M\u0040DGLNBELN\u0040I2C_Write\u003F3\u003F5\u0040, pData, nDataSize);
133     int num = \u003CModule\u003E.CVGAAdaptorIntel\u002EI2C_WriteTarget(obj0, pData, nDataSize) ? 1 : 0;
134     if (num == 0)
135     {
136       \u003CModule\u003E.sprintf_s((sbyte*) &arrayTypeBy0IaD, 128UL, (sbyte*) &\u003CModule\u003E.\u003F\u003F_C\u0040_0CI\u0040FFLBFBLK\u0040WriteFile\u003F\u0024CI\u003F\u0024CJ\u003F5to\u003F5devcie\u003F5FAILED\u003F4\u003F5h\u0040, __arglist ((int) \u003CModule\u003E.GetLastError()));
137       \u003CModule\u003E.OutputDebugStringA((sbyte*) &arrayTypeBy0IaD);
138     }
139     \u003CModule\u003E.CVGAAdaptorIntel\u002EI2C_CloseTarget(obj0);
140     return num != 0;
141   }
142
143
144
145 __GENUS                 : 2
146 __CLASS                 : Win32_PnPSignedDriver
147 __SUPERCLASS            : CIM_Service
148 __DYNASTY               : CIM_ManagedSystemElement
149 __RELPATH               :
150 __PROPERTY_COUNT        : 28
151 __DERIVATION            : {CIM_Service, CIM_LogicalElement, CIM_ManagedSystemElement}
152 __SERVER                : SMOL-WHITE
153 __NAMESPACE             : root\cimv2
154 __PATH                  :
155 Caption                 :
156 ClassGuid               : {4d36e97d-e325-11ce-bfc1-08002be10318}
157 CompatID                : INTC#I2C
158 CreationClassName       :
159 Description             : Intel(R) NF I2C Host Controller
160 DeviceClass             : SYSTEM
161 DeviceID                : DISPLAY\INTC_I2C\7&3255D98A&0&UID26040
162 DeviceName              : Intel(R) NF I2C Host Controller
163 DevLoader               :
164 DriverDate              : 20220203000000.******+***
165 DriverName              :
166 DriverProviderName      : Intel Corporation
167 DriverVersion           : 31.100.2210.1
168 FriendlyName            :
169 HardWareID              : VIDEO\VEN_8086&DEV_56A0&SUBSYS_38881025&REV_08&INTC_I2C
170 InfName                 : oem6.inf
171 InstallDate             :
172 IsSigned                : True
173 Location                :
174 Manufacturer            : Intel Corporation
175 Name                    :
176 PDO                     : \Device\00000078
177 Signer                  : Microsoft Windows Hardware Compatibility Publisher
178 Started                 :
179 StartMode               :
180 Status                  :
181 SystemCreationClassName :
182 SystemName              :
183 PSComputerName          : SMOL-WHITE