Add cryptographic card device type

Add hub device type
Fix incorrect USB subclass read
pull/1/head
Timothy Pearson 9 years ago
parent 8545b92094
commit 5fdf839b35

@ -1383,12 +1383,18 @@ TDEGenericDeviceType::TDEGenericDeviceType readGenericDeviceTypeFromString(TQStr
else if (query == "Bridge") { else if (query == "Bridge") {
ret = TDEGenericDeviceType::Bridge; ret = TDEGenericDeviceType::Bridge;
} }
else if (query == "Hub") {
ret = TDEGenericDeviceType::Hub;
}
else if (query == "Platform") { else if (query == "Platform") {
ret = TDEGenericDeviceType::Platform; ret = TDEGenericDeviceType::Platform;
} }
else if (query == "Cryptography") { else if (query == "Cryptography") {
ret = TDEGenericDeviceType::Cryptography; ret = TDEGenericDeviceType::Cryptography;
} }
else if (query == "CryptographicCard") {
ret = TDEGenericDeviceType::CryptographicCard;
}
else if (query == "Event") { else if (query == "Event") {
ret = TDEGenericDeviceType::Event; ret = TDEGenericDeviceType::Event;
} }
@ -2261,7 +2267,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
TQFile ifaceprotofile(current_path + "/bInterfaceClass"); TQFile ifaceprotofile(current_path + "/bInterfaceClass");
if (ifaceprotofile.open(IO_ReadOnly)) { if (ifaceprotofile.open(IO_ReadOnly)) {
TQTextStream stream( &ifaceprotofile ); TQTextStream stream( &ifaceprotofile );
usbInterfaceClass = stream.readLine().toUInt(); usbInterfaceClass = stream.readLine().toUInt(NULL, 16);
ifaceprotofile.close(); ifaceprotofile.close();
} }
} }
@ -2271,7 +2277,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
TQFile ifaceprotofile(current_path + "/bInterfaceSubClass"); TQFile ifaceprotofile(current_path + "/bInterfaceSubClass");
if (ifaceprotofile.open(IO_ReadOnly)) { if (ifaceprotofile.open(IO_ReadOnly)) {
TQTextStream stream( &ifaceprotofile ); TQTextStream stream( &ifaceprotofile );
usbInterfaceSubClass = stream.readLine().toUInt(); usbInterfaceSubClass = stream.readLine().toUInt(NULL, 16);
ifaceprotofile.close(); ifaceprotofile.close();
} }
} }
@ -2281,10 +2287,18 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
TQFile ifaceprotofile(current_path + "/bInterfaceProtocol"); TQFile ifaceprotofile(current_path + "/bInterfaceProtocol");
if (ifaceprotofile.open(IO_ReadOnly)) { if (ifaceprotofile.open(IO_ReadOnly)) {
TQTextStream stream( &ifaceprotofile ); TQTextStream stream( &ifaceprotofile );
usbInterfaceProtocol = stream.readLine().toUInt(); usbInterfaceProtocol = stream.readLine().toUInt(NULL, 16);
ifaceprotofile.close(); ifaceprotofile.close();
} }
} }
if (usbInterfaceClass == 9) {
// Hub
if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Hub);
}
if (usbInterfaceClass == 11) {
// Smart Card Reader
if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::CryptographicCard);
}
if ((usbInterfaceClass == 6) && (usbInterfaceSubClass == 1) && (usbInterfaceProtocol == 1)) { if ((usbInterfaceClass == 6) && (usbInterfaceSubClass == 1) && (usbInterfaceProtocol == 1)) {
// PictBridge // PictBridge
if (!device) { if (!device) {
@ -4069,12 +4083,18 @@ TQString TDEHardwareDevices::getFriendlyDeviceTypeStringFromType(TDEGenericDevic
else if (query == TDEGenericDeviceType::Bridge) { else if (query == TDEGenericDeviceType::Bridge) {
ret = i18n("Bridge"); ret = i18n("Bridge");
} }
else if (query == TDEGenericDeviceType::Hub) {
ret = i18n("Hub");
}
else if (query == TDEGenericDeviceType::Platform) { else if (query == TDEGenericDeviceType::Platform) {
ret = i18n("Platform"); ret = i18n("Platform");
} }
else if (query == TDEGenericDeviceType::Cryptography) { else if (query == TDEGenericDeviceType::Cryptography) {
ret = i18n("Cryptography"); ret = i18n("Cryptography");
} }
else if (query == TDEGenericDeviceType::CryptographicCard) {
ret = i18n("Cryptographic Card");
}
else if (query == TDEGenericDeviceType::Event) { else if (query == TDEGenericDeviceType::Event) {
ret = i18n("Platform Event"); ret = i18n("Platform Event");
} }
@ -4224,12 +4244,18 @@ TQPixmap TDEHardwareDevices::getDeviceTypeIconFromType(TDEGenericDeviceType::TDE
else if (query == TDEGenericDeviceType::Bridge) { else if (query == TDEGenericDeviceType::Bridge) {
ret = DesktopIcon("kcmpci", size); ret = DesktopIcon("kcmpci", size);
} }
else if (query == TDEGenericDeviceType::Hub) {
ret = DesktopIcon("usb", size);
}
else if (query == TDEGenericDeviceType::Platform) { else if (query == TDEGenericDeviceType::Platform) {
ret = DesktopIcon("preferences-system", size); ret = DesktopIcon("preferences-system", size);
} }
else if (query == TDEGenericDeviceType::Cryptography) { else if (query == TDEGenericDeviceType::Cryptography) {
ret = DesktopIcon("password", size); ret = DesktopIcon("password", size);
} }
else if (query == TDEGenericDeviceType::CryptographicCard) {
ret = DesktopIcon("password", size);
}
else if (query == TDEGenericDeviceType::Event) { else if (query == TDEGenericDeviceType::Event) {
ret = DesktopIcon("preferences-system", size); ret = DesktopIcon("preferences-system", size);
} }

@ -60,8 +60,10 @@ enum TDEGenericDeviceType {
ThermalControl, ThermalControl,
BlueTooth, BlueTooth,
Bridge, Bridge,
Hub,
Platform, Platform,
Cryptography, Cryptography,
CryptographicCard,
Event, Event,
Input, Input,
PNP, PNP,

Loading…
Cancel
Save