It is currently April 26th, 2024, 3:40 pm
XBOX ONE Wireless Controller battery percentage
-
- Developer
- Posts: 265
- Joined: June 28th, 2014, 8:32 am
- Location: Tokyo, Japan
Re: XBOX ONE Wireless Controller battery percentage
Cheers - thanks!
-
- Posts: 424
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: XBOX ONE Wireless Controller battery percentage
I made the change to the code to enable the battery function. Could you re-compile it for me?jsmorley wrote:This is compiled and linked using VS2013, running under Windows10. I have no possible way to test the plugin, but If you make changes to the code and need me to re-compile it for you, I'm happy to do that.
I don't know what files you need so i made a rar file from the whole folder, and the file size is too big (5mb) so i uploaded the file to mediafire.
https://www.mediafire.com/?bo6xop70bi25q77
Michael
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Developer
- Posts: 22630
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: XBOX ONE Wireless Controller battery percentage
I'm getting:StArL0rd84 wrote:I made the change to the code to enable the battery function. Could you re-compile it for me?
I don't know what files you need so i made a rar file from the whole folder, and the file size is too big (5mb) so i uploaded the file to mediafire.
https://www.mediafire.com/?bo6xop70bi25q77
Michael
Code: Select all
1>------ Build started: Project: XInput, Configuration: Debug Win32 ------
1> XInput.cpp
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(300): error C2065: 'XINPUT_BATTERY_INFORMATION' : undeclared identifier
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(300): error C2146: syntax error : missing ';' before identifier 'batInfo'
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(300): error C2065: 'batInfo' : undeclared identifier
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(303): error C2065: 'BATTERY_DEVTYPE_GAMEPAD' : undeclared identifier
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(303): error C2065: 'batInfo' : undeclared identifier
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(304): error C2065: 'batInfo' : undeclared identifier
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(304): error C2228: left of '.BatteryType' must have class/struct/union
1> type is 'unknown-type'
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(304): error C2065: 'BATTERY_TYPE_UNKNOWN' : undeclared identifier
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(303): error C3861: 'XInputGetBatteryInformation': identifier not found
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(306): error C2065: 'batInfo' : undeclared identifier
1>c:\rainmeter-plugin-sdk\c++\xinput\xinput.cpp(306): error C2228: left of '.BatteryLevel' must have class/struct/union
1> type is 'unknown-type'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
-
- Developer
- Posts: 265
- Joined: June 28th, 2014, 8:32 am
- Location: Tokyo, Japan
Re: XBOX ONE Wireless Controller battery percentage
Those look like the same errors I get when building from Win7. Apparently the newer versions of the Windows SDK are supposed to include those functions in their XInput stuff, but looks like you're in the same boat as me. Whenever I upgrade I'll give it another shot.
Thanks anyway jsmorley!
dave
Thanks anyway jsmorley!
dave
-
- Developer
- Posts: 22630
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: XBOX ONE Wireless Controller battery percentage
Ah, maybe that explains it. He has a "version" of the entire Rainmeter Plugin SDK included in his bag-o-tricks, and the code and project files are both pointing to that. Let me point things at the latest API and see if that doesn't fix it.dgrace wrote:Those look like the same errors I get when building from Win7. Apparently the newer versions of the Windows SDK are supposed to include those functions in their XInput stuff, but looks like you're in the same boat as me. Whenever I upgrade I'll give it another shot.
Thanks anyway jsmorley!
dave
Edit: Nope, sorry. Still get those errors. Guess you will have to look at it when you can dgrace.
-
- Posts: 424
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: XBOX ONE Wireless Controller battery percentage
Thanks for looking at it Jsmorley.jsmorley wrote:Ah, maybe that explains it. He has a "version" of the entire Rainmeter Plugin SDK included in his bag-o-tricks, and the code and project files are both pointing to that. Let me point things at the latest API and see if that doesn't fix it.
Edit: Nope, sorry. Still get those errors. Guess you will have to look at it when you can dgrace.
I will keep tuned in to this thread dgrace.
see you in the future
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Posts: 5
- Joined: December 28th, 2015, 6:20 pm
Re: XBOX ONE Wireless Controller battery percentage
I downloaded dgrace's code from his Github repository and changed it to Windows 10, because that's what I use. I was able to compile the DLL and it seems to work with my Xbox 360 wireless controller. But because I never created a skin, I don't have anything except the compiled files.
Here is the entire VS 2015 solution with dgrace's code and the Rainmeter API:
https://dl.dropboxusercontent.com/u/22856750/Rainmeter/XInput-master.7z
@dgrace: You could add a sub-module and link to the Rainmeter API repository
Here is the entire VS 2015 solution with dgrace's code and the Rainmeter API:
https://dl.dropboxusercontent.com/u/22856750/Rainmeter/XInput-master.7z
@dgrace: You could add a sub-module and link to the Rainmeter API repository
-
- Posts: 424
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: XBOX ONE Wireless Controller battery percentage
Thanks Thurion.Thurion wrote: I was able to compile the DLL and it seems to work with my Xbox 360 wireless controller. But because I never created a skin, I don't have anything except the compiled files.
I copied the DLL into the plugins folder for rainmeter, but my battery skin only returns a zero.
Am i doing it wrong? Wrong channel?
[measureXInput_Battery]
Measure=Plugin
Plugin=XInput
Channel=BATTERY_PAD
[meterBattery]
Meter=STRING
MeasureName=measureXInput_Battery
MeterStyle=styleTitle
X=100
Y=12
EDIT 1: Ok now it returns a 1. hmm i thought it would return text saying something like, empty, low, medium & high.
The battery should be fully charged now, so maybe 1 means high?
EDIT 2: Now i now why it suddenly returned a 1. I moved one of the sticks.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Posts: 5
- Joined: December 28th, 2015, 6:20 pm
Re: XBOX ONE Wireless Controller battery percentage
I tested it with a bar instead of a value after I ran into the same problem. Maybe rainmeter doesn't use floatsing-point numbers in text?
According to the code it should return one of these values:
According to the code it should return one of these values:
- 0.0
- 0.33
- 0.75
- 1.0
-
- Posts: 424
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: XBOX ONE Wireless Controller battery percentage
Yeah it would seem so.
I am gonna try to to run down the battery, to see what values Rainmeter ACTUALLY spits out ;P
Tried a bar meter as well. didn't work.
How did you do your bar meter? Could you post it here?
I am gonna try to to run down the battery, to see what values Rainmeter ACTUALLY spits out ;P
Tried a bar meter as well. didn't work.
How did you do your bar meter? Could you post it here?
Last edited by StArL0rd84 on January 6th, 2016, 4:32 pm, edited 1 time in total.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))