samedi 18 avril 2015

Get device names of connected devices to android hotspot created by my app

I have seen many questions but almost all of them, try to find the IP address and mac address of the connected devices which is already implemented in my code. Now the thing that I need is the name of the connected devices. (eg. NAVID-PC)


Android itself shows these names in the hotspot part of the settings app, so I think there must be a way for it.


I get this output from arp file located in /proc/net/arp:



IP address HW type Flags HW address Mask Device
192.168.43.128 0x1 0x0 f0:27:65:3d:6b:77 * wlan0
192.168.43.131 0x1 0x2 6c:71:d9:52:55:a5 * wlan0


Another question! what are HW type and Flags in this file? I figured out that 0x2 flag means that the device is connected now. Is it correct?


Thanks,


Navid


Aucun commentaire:

Enregistrer un commentaire