adaptated from : https://github.com/HondaDai/PhoneGap-WifiInfoPlugin