device_query refactor: cycle through platforms and devices