Autodiscovery of devices