Hi Alex, >>> +uint32_t btd_device_get_class(struct btd_device *device) >>> +{ >>> + return device->class; >>> +} > >> why not export functions for getting the major and minor class. That seems to better then making a plugin decode that by themselves. Especially since we know they will get it work. > > Basically we had the device class exported like that in the previous > plugin. I don't see a huge advantage on splitting the class in this > file instead of in the plugin... and a plugin could also compare with > both the major and minor class at the same time. Anyway, is an easy > change and I don't have a strong preference. the reason why I prefer major and minor class is that then the core does the "math" ones and does it right. We had enough issues with it being done wrong. Including a kernel bug that we have to live with now. In addition you actually did not consider the 2 bits that define a format type of major/minor class. Only when they are 0, then the mapping is what you are checking against. These 3 bytes are the worst combination of smashing bits into each other. Check print_dev_class() of btmon to see what I mean. Regards Marcel -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html