improve ping api
use ping() in setPing()
Merge pull request #150 from jphire/fix/104_improve_ping_api

Fix/104 improve ping api