This is just for my own sanity check to ensure I can look back at this if I get confused along the way.. so excuse my ramblings.
After a PDUconnect is performed by t2win. It then registers events. This means we do not send any system/module event updates since it is afterwards.
Code: Select all
6:56:42 PM Wednesday, 13 April 2022 : PDUModuleConnect Success
6:56:42 PM Wednesday, 13 April 2022 : PDURegisterEventCallback Called
6:56:42 PM Wednesday, 13 April 2022 : hmod is: FFFFFFFF
6:56:42 PM Wednesday, 13 April 2022 : hcll is: FFFFFFFF
6:56:42 PM Wednesday, 13 April 2022 : Registering Default/System Event Callback
6:56:42 PM Wednesday, 13 April 2022 : PDURegisterEventCallback Success
6:56:42 PM Wednesday, 13 April 2022 : PDURegisterEventCallback Called
6:56:42 PM Wednesday, 13 April 2022 : hmod is: 50403020
6:56:42 PM Wednesday, 13 April 2022 : hcll is: FFFFFFFF
6:56:42 PM Wednesday, 13 April 2022 : Registering Module Event Callback
6:56:57 PM Wednesday, 13 April 2022 : PDURegisterEventCallback Success
After its done that, it setups up all the ObjectIds which are used extensively throughout t2win, and just before it shows all available tools, it does a
Code: Select all
6:56:42 PM Wednesday, 13 April 2022 : PDUIoCtl Called
6:56:42 PM Wednesday, 13 April 2022 : _hMod is: 50403020
6:56:42 PM Wednesday, 13 April 2022 : _hcll is: FFFFFFFF
6:56:42 PM Wednesday, 13 April 2022 : Ioctlcommandid is: PDU_IOCTL_READ_VBATT
hMod is the tools unique handler, I have set it to 50403020 since its a very easy value to spot, rather then doing a simple 1 ect.
PDU_IOCTL_READ_VBATT is the subcommand request which is as the name suggests, read battery voltage. This gets returned in millivolts, so 13.120 volts will be 13120, or 0x3340.
Each sub command has its own custom structure which needs to be implemented, but the only two other commands to implement is a start filter and remove filter.
At this point, this is where we are at the main homescreen!
Everything after this point is setting the protocol, setting filters, sending data to write to the bus and receiving via callbacks.