TDevice tdv = dlst.getDevice(deviceNumber);
if (tdv == null) return TErrorList.device_not_connected;
String oldName = tdv.getName();
if (deviceName.compareTo(oldName) != 0)
{
dlst.renameDevice(oldName,deviceName);
}
if (deviceRedirection != null && deviceRedirection.length() > 0)
{
tdv.setRedirection(deviceRedirection);
deviceRedirection = null; // reset this !