Now getting serious, I've been following this topic, let me tell you that is awesome. I was a programmer myself when I was young, like 20 years ago, nothing like this, mostly enterprise application, databases and stuff, so I have a fair idea of the whole development process thing. This thread has been very interesting to follow, I didn't know how many things got involved in developing drivers and stuff related to hardware, very interesting.
Welcome, mate I've been trying to steer my career towards programming as a full-time profession but so far that hasn't really worked so I went back to doing everything the way I like and devote time to device driver development. Not my loss so far I struggled a lot in the past while developing the other projects and found this style of "blogging" to be a good way to both reflect on what I've been doing and as a reference and timeline for myself and other people interested. Sounds like it's a good strategy.
Also, your previous post about hunting the bug related to the crash when device got disabled, it got me thinking in other things that could happen that could be related...
What happens when
Thanks for participating, let's go through the points one by one:
The controller is moved out of range of the bluetooth receiver
Then after a certain timeout the host driver (the one which controls the Bluetooth host device, a.k.a. "stock driver") will initiate a disconnect sequence and notifies the profile driver that the device is gone and now my clean-up code takes over. So far this case is handled properly. Should test it though
The bluetooth receiver is disabled in the Device Manager (eg. if the receiver is embedded in a wifi card like the Intel ones on laptops)
That's a typical power down event and since the profile driver is a child of the
bthport.sys which then gets unloaded it receives shutdown indication as well and needs to dispose all connections and free memory before unloading the profile driver. So far this is handled already.
The bluetooth receiver is disconnected from the host (eg. the receiver it's a USB dongle type)
This case is called "surprise removal" and is also handled. When the parent is gone, the whole stack gets demolished. The profile children (PDOs) get removed, the profile driver enters clean-up and unloads, then the stock drivers unload. This is also implemented and tested.
If the controller get connected to host via USB cable while operating/connected via Bluetooth protocol, do it still operates or got it disconnected???
This is in fact an absurd case because the SIXAXIS/DS3 does not disconnect from Bluetooth when connected to USB while also connected wireless. That's a scenario I haven't tackled yet
Does the controller start to charge its internal battery when is connected to host via USB cable?
Yes, despite all the BS and false information you find on the web there is no special driver required for the controller to charge via a standard 500 mA USB outlet. It also charges with a simple mobile phone charger, if it doesn't it has a hardware issue, not a software one. It does report battery charge level via software though on both USB and Bluetooth.
I'm sure you already considered this scenarios, but I got curious about the answer to this events.
I try to think of all aspects, especially because I wanna get this through WHQL so the quality and robustness has to be stellar
Anyway, let thank your for your effort in this, I really appreciate it.
It's really amazing to see that somebody got the time, knowledge and motivation to write this. In other OS like linux, this works out-of-the-box, also on NVidia Shield TV, but on windows it's disappointing to have to resort to third-party solutions to be able use our gamepads properly.
Thanks, I might have just slipped into insanity without noticing Seriously though, it's been quite the challenge getting this and real-life obstacles handled in one go but as I'm adapting my life to support this stuff I might be able to keep this rodeo going until production-ready Linux has the advantage of the open kernel and contributors have added the Sony-specific customization a long time ago. On Windows you need to play after the rules of Microsoft. And dance with the devil in kernel-land where the forbidden fruits grow and magic can be found even to this day!
Also, what is the HARDWARE id that get reported to OS when the PS3 controllers are connected via this driver?
I created some custom, GUID-based Hardware IDs the function drivers will use in the future.
Hope I got everything, cheers!