Exemple #1
0
 /// <summary>
 /// Constructor for Confirmed ServiceError.
 /// </summary>
 internal GXDLMSExceptionResponse(ExceptionStateError error, ExceptionServiceError type, object value)
     : base("Exception response. \"" + GetStateError(error) + "\"-exception. " + GetServiceError(type, value))
 {
     ExceptionStateError   = error;
     ExceptionServiceError = type;
     Value    = value;
     HelpLink = " https://www.gurux.fi/Gurux.DLMS.ErrorCodes";
 }
 private static string GetStateError(ExceptionStateError stateError)
 {
     switch (stateError)
     {
         case ExceptionStateError.ServiceNotAllowed:
             return "Service not allowed";
         case ExceptionStateError.ServiceUnknown:
             return "Service unknown";
     }
     return string.Empty;
 }
 private static string GetStateError(ExceptionStateError stateError)
 {
     switch (stateError)
     {
         case ExceptionStateError.ServiceNotAllowed:
             return "Service not allowed";
         case ExceptionStateError.ServiceUnknown:
             return "Service unknown";
     }
     return string.Empty;
 }
Exemple #4
0
        /// <summary>
        /// Gets state error description.
        /// </summary>
        /// <param name="error">State error enumerator value.</param>
        /// <returns>State error as an string.</returns>
        ///
        public static string StateErrorToString(ExceptionStateError error)
        {
            switch (error)
            {
            case ExceptionStateError.ServiceNotAllowed:
                return("ServiceNotAllowed");

            case ExceptionStateError.ServiceUnknown:
                return("ServiceUnknown");

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemple #5
0
 /// <summary>
 /// Constructor for AARE error.
 /// </summary>
 internal GXDLMSException(ExceptionStateError stateError, ExceptionServiceError serviceError)
     : base("Meter returns " + GetStateError(stateError) + " exception. " + GetServiceError(serviceError))
 {
     StateError            = stateError;
     ExceptionServiceError = serviceError;
 }
 /// <summary>
 /// Constructor for AARE error.
 /// </summary>
 internal GXDLMSException(ExceptionStateError stateError, ExceptionServiceError serviceError)
     : base("Meter returns " + GetStateError(stateError) + " exception. " + GetServiceError(serviceError))
 {
     StateError = stateError;
     ExceptionServiceError = serviceError;
 }