AusweisApp2/src/global/DeviceError.cpp

42 lines
821 B
C++
Raw Normal View History

2017-07-03 09:33:28 +02:00
/*!
2017-12-20 14:54:05 +01:00
* \copyright Copyright (c) 2017 Governikus GmbH & Co. KG, Germany
2017-07-03 09:33:28 +02:00
*/
#include "DeviceError.h"
#include "moc_DeviceError.cpp"
2017-12-20 14:54:05 +01:00
#include "GlobalStatus.h"
2017-07-03 09:33:28 +02:00
namespace governikus
{
static int registerDeviceError = qRegisterMetaType<DeviceError>("DeviceError");
namespace DeviceErrorUtil
{
GlobalStatus toGlobalStatus(DeviceError pDeviceError)
{
Q_UNUSED(registerDeviceError);
switch (pDeviceError)
{
case DeviceError::DEVICE_CONNECTION_ERROR:
return GlobalStatus::Code::Workflow_Reader_Device_Connection_Error;
case DeviceError::DEVICE_POWERED_OFF:
return GlobalStatus::Code::No_Error;
case DeviceError::DEVICE_SCAN_ERROR:
return GlobalStatus::Code::Workflow_Reader_Device_Scan_Error;
case DeviceError::UNKNOWN_ERROR:
return GlobalStatus::Code::Unknown_Error;
}
2017-12-20 14:54:05 +01:00
Q_UNREACHABLE();
2017-07-03 09:33:28 +02:00
}
}
}