Coded function to get devices's info