Closed Porrumentzio closed 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
val VENDORS_PHONE = setOf("LG", "HUAWEI", "Xiaomi")
. IMO this is cleaner than a large when(vendorName)
check.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)
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.
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
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:
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:
62078
open for syncing53
openThe 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
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.
I know this is something Fing does, I wonder how they handle it.
Great code, #42!
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)
Xiaomi Communications Co Ltd
is used for smartphones (and tableta, computers... too I suppose)
https://github.com/csicar/Ning/pull/42/commits/aca79d70a28a0c25f268c7336d6c25b403ac35ee
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.
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