ESP32: checking if PS4 controller is charging

How to check if the PS4 controller is charging or not, using the ESP32.