csicar / Ning

Network-Scanner for Android
216 stars 35 forks source link

Display different icons according to device type #37

Closed Porrumentzio closed 3 years ago

Porrumentzio commented 3 years ago

If it's possible to identity the type of device (smartphone, computer, minicomputer, printer, router...), it would be great to have different icons for each

mueller-ma commented 3 years ago

This is actually already implemented. However it only has about 10 vendors that are expected to have one device type. I suggest to

Porrumentzio commented 3 years ago

Great! I'm not having different icons for a Xiaomi device for example (I don't know if it's into those 10 vendors)

The second idea seems great to me, although it's possible that Huawei be a computer and a smartphone. Same for Xiaomi, but in this case also domotic machines are included. There should be done a specific database to show the type of device, or only show the vendor logo (I don't like much this)

mueller-ma commented 3 years ago

I'm not having different icons for a Xiaomi device for example

Xiaomi is one of the supported vendors: https://github.com/csicar/Ning/blob/master/app/src/main/java/de/csicar/ning/Model.kt#L54 What's the exact shown vendor name?

The second idea seems great to me, although it's possible that Huawei be a computer and a smartphone.

Maybe they're using different mac address ranges for different device types.

I'm having a device by AVM and the shown name matches exactly the string in Model.kt, but the default icon is shown. So there seems to be a bug.

Porrumentzio commented 3 years ago

What's the exact shown vendor name? Xiaomi Communications Co Ltd (for This Device)

It's showing a computer screen. As you said, the default icon.

Maybe they're using different mac address ranges for different device types.

It should be, because there exist apps that do show each type correctly with a lot of info

csicar commented 3 years ago

The names originate from the official MAC-Prefix registry, so in theory we could try to map every MAC-Prefix to an icon, but I think there are two main problems with this:

  1. As already discussed here, a vendor could produce different types of devices -> Would require different icons
  2. Many devices use networking chips by different companies. For example Chromecasts have WIFI-Chips by a company called AzureWave Technology Inc

In the long run, it's probably best to add port scanning to device detection, as some devices have unique ports open:

The when expression is used, to allow more nuanced device detection, like mac ranges or open ports.


In regards to the bug: I have no idea what could cause that, as it seems to be working fine for me. I'll look into that

csicar commented 3 years ago

BTW: I appreciate any new suggestions for what should be added to the device detection list. As long as it is reasonable to expect a vendor's device to be of one specific type, I'm fine with adding it. Device type detection can't be perfect, so a reasonable guess is fine with me.

Kreuger commented 3 years ago

I know this is something Fing does, I wonder how they handle it.

Porrumentzio commented 3 years ago

Great code, #42!

Porrumentzio commented 3 years ago

Hey, I have deduced that Xiaomi uses different vendor name for cleaning machines.

Xiaomi Communications Co Ltd is used for smartphones (and tableta, computers... too I suppose)

XIAOMI Electronics,CO.,LTD is used for a cleaning machine (at least in my net) (and maybe other non-communicating machines)

mueller-ma commented 3 years ago

Xiaomi Communications Co Ltd is used for smartphones (and tableta, computers... too I suppose)

https://github.com/csicar/Ning/pull/42/commits/aca79d70a28a0c25f268c7336d6c25b403ac35ee

mueller-ma commented 3 years ago

I'm having a device by AVM and the shown name matches exactly the string in Model.kt, but the default icon is shown. So there seems to be a bug.

With #42 the device has the correct icon.