category and sub_category must be big-endian in the device-type string.
---

I could not find a explicit endianess for this in the spec, however
wpa_supplicant (see wps_dev_type_str2bin()), wireshark and various devices
all use big-endian here, so I'm pretty sure that this is correct.

 plugins/wifi.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 1f90a311a2a1..8246c45f974b 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2446,24 +2446,24 @@ static void interface_removed(GSupplicantInterface 
*interface)
 static void set_device_type(const char *type, char dev_type[17])
 {
        const char *oui = "0050F204";
-       const char *category = "0100";
+       const char *category = "0001";
        const char *sub_category = "0000";
 
        if (!g_strcmp0(type, "handset")) {
-               category = "0A00";
-               sub_category = "0500";
+               category = "000A";
+               sub_category = "0005";
        } else if (!g_strcmp0(type, "vm") || !g_strcmp0(type, "container"))
-               sub_category = "0100";
+               sub_category = "0001";
        else if (!g_strcmp0(type, "server"))
-               sub_category = "0200";
+               sub_category = "0002";
        else if (!g_strcmp0(type, "laptop"))
-               sub_category = "0500";
+               sub_category = "0005";
        else if (!g_strcmp0(type, "desktop"))
-               sub_category = "0600";
+               sub_category = "0006";
        else if (!g_strcmp0(type, "tablet"))
-               sub_category = "0900";
+               sub_category = "0009";
        else if (!g_strcmp0(type, "watch"))
-               category = "FF00";
+               category = "00FF";
 
        snprintf(dev_type, 17, "%s%s%s", category, oui, sub_category);
 }
-- 
2.1.4

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to