Added queryPin method
queryPin reports the pin number
major refactoring for new protocol