There are quite a few Service Discovery Protocols and various flavors of ZeroConf (Bonjour) in wide use these days so it's pretty much a solved problem if your device has the horsepower to run the protocols.
Still doesn't change the fact that this is not an application that should require an app