- added additional error codes to reflect MMS data access errors

- IedConnection_getRCBValues returns correct error code in case the RCB does not exist
pull/6/head
Michael Zillgith 10 years ago
parent a9afafe7c2
commit f3347e4f16

@ -1146,6 +1146,30 @@ namespace IEC61850
/** The server expected an object of another type */
IED_ERROR_TYPE_INCONSISTENT = 25,
/** The object or service is temporarily unavailable */
IED_ERROR_TEMPORARILY_UNAVAILABLE = 26,
/** The specified object is not defined in the server (returned by server) */
IED_ERROR_OBJECT_UNDEFINED = 27,
/** The specified address is invalid (returned by server) */
IED_ERROR_INVALID_ADDRESS = 28,
/** Service failed due to a hardware fault (returned by server) */
IED_ERROR_HARDWARE_FAULT = 29,
/** The requested data type is not supported by the server (returned by server) */
IED_ERROR_TYPE_UNSUPPORTED = 30,
/** The provided attributes are inconsistent (returned by server) */
IED_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT = 31,
/** The provided object value is invalid (returned by server) */
IED_ERROR_OBJECT_VALUE_INVALID = 32,
/** The object is invalidated (returned by server) */
IED_ERROR_OBJECT_INVALIDATED = 33,
/* unknown error */
IED_ERROR_UNKNOWN = 99
}

@ -458,6 +458,16 @@ IedConnection_getRCBValues(IedConnection self, IedClientError* error, const char
return NULL;
}
if (MmsValue_getType(rcb) == MMS_DATA_ACCESS_ERROR) {
if (DEBUG_IED_CLIENT)
printf("DEBUG_IED_CLIENT: getRCBValues returned data-access-error!\n");
*error = iedConnection_mapDataAccessErrorToIedError(
MmsValue_getDataAccessError(rcb));
return NULL;
}
if (MmsValue_getType(rcb) != MMS_STRUCTURE) {
if (DEBUG_IED_CLIENT)
printf("DEBUG_IED_CLIENT: getRCBValues returned wrong type!\n");

@ -97,12 +97,49 @@ IedClientError
iedConnection_mapDataAccessErrorToIedError(MmsDataAccessError mmsError)
{
switch (mmsError) {
case DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT:
return IED_ERROR_OBJECT_DOES_NOT_EXIST;
case DATA_ACCESS_ERROR_NO_RESPONSE:
return IED_ERROR_TIMEOUT;
case DATA_ACCESS_ERROR_SUCCESS:
return IED_ERROR_OK;
case DATA_ACCESS_ERROR_OBJECT_INVALIDATED:
return IED_ERROR_OBJECT_INVALIDATED;
case DATA_ACCESS_ERROR_HARDWARE_FAULT:
return IED_ERROR_HARDWARE_FAULT;
case DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE:
return IED_ERROR_TEMPORARILY_UNAVAILABLE;
case DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED:
return IED_ERROR_ACCESS_DENIED;
case DATA_ACCESS_ERROR_OBJECT_UNDEFINED:
return IED_ERROR_OBJECT_UNDEFINED;
case DATA_ACCESS_ERROR_INVALID_ADDRESS:
return IED_ERROR_INVALID_ADDRESS;
case DATA_ACCESS_ERROR_TYPE_UNSUPPORTED:
return IED_ERROR_TYPE_UNSUPPORTED;
case DATA_ACCESS_ERROR_TYPE_INCONSISTENT:
return IED_ERROR_TYPE_INCONSISTENT;
case DATA_ACCESS_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT:
return IED_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT;
case DATA_ACCESS_ERROR_OBJECT_ACCESS_UNSUPPORTED:
return IED_ERROR_OBJECT_ACCESS_UNSUPPORTED;
case DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT:
return IED_ERROR_OBJECT_DOES_NOT_EXIST;
case DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID:
return IED_ERROR_OBJECT_VALUE_INVALID;
default:
return IED_ERROR_UNKNOWN;
}

@ -120,18 +120,42 @@ typedef enum {
/** The server rejected the access to the requested object/service due to access control */
IED_ERROR_ACCESS_DENIED = 21,
/** The server reported that the requested object does not exist */
/** The server reported that the requested object does not exist (returned by server) */
IED_ERROR_OBJECT_DOES_NOT_EXIST = 22,
/** The server reported that the requested object already exists */
IED_ERROR_OBJECT_EXISTS = 23,
/** The server does not support the requested access method */
/** The server does not support the requested access method (returned by server) */
IED_ERROR_OBJECT_ACCESS_UNSUPPORTED = 24,
/** The server expected an object of another type */
/** The server expected an object of another type (returned by server) */
IED_ERROR_TYPE_INCONSISTENT = 25,
/** The object or service is temporarily unavailable (returned by server) */
IED_ERROR_TEMPORARILY_UNAVAILABLE = 26,
/** The specified object is not defined in the server (returned by server) */
IED_ERROR_OBJECT_UNDEFINED = 27,
/** The specified address is invalid (returned by server) */
IED_ERROR_INVALID_ADDRESS = 28,
/** Service failed due to a hardware fault (returned by server) */
IED_ERROR_HARDWARE_FAULT = 29,
/** The requested data type is not supported by the server (returned by server) */
IED_ERROR_TYPE_UNSUPPORTED = 30,
/** The provided attributes are inconsistent (returned by server) */
IED_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT = 31,
/** The provided object value is invalid (returned by server) */
IED_ERROR_OBJECT_VALUE_INVALID = 32,
/** The object is invalidated (returned by server) */
IED_ERROR_OBJECT_INVALIDATED = 33,
/* unknown error */
IED_ERROR_UNKNOWN = 99
} IedClientError;

Loading…
Cancel
Save