Add method to resolve speed numbers to speed names

This commit is contained in:
Klaus Reimer 2013-04-13 11:08:52 +02:00
parent d41814a9fa
commit 5c412a8360

View File

@ -105,4 +105,28 @@ public final class DumpUtils
if (i % columns != 0) builder.append(String.format("%n"));
return builder.toString();
}
/**
* Returns the name for the specified speed number.
*
* @param speed
* The speed number.
* @return The speed name.
*/
public static String getSpeedName(int speed)
{
switch (speed)
{
case LibUSB.SPEED_SUPER:
return "Super";
case LibUSB.SPEED_FULL:
return "Full";
case LibUSB.SPEED_HIGH:
return "High";
case LibUSB.SPEED_LOW:
return "Low";
default:
return "Unknown";
}
}
}