Ejemplo n.º 1
0
 /// <summary>
 /// Constructor for Confirmed ServiceError.
 /// </summary>
 internal GXDLMSException(ConfirmedServiceError service, ServiceError type, byte value)
     : base("ServiceError " + GetConfirmedServiceError(service) + " exception. " + GetServiceError(type) + " " + GetServiceErrorValue(type, value))
 {
     ConfirmedServiceError = service;
     ServiceError = type;
     ServiceErrorValue = value;
 }
 /// <summary>
 /// Constructor for Confirmed ServiceError.
 /// </summary>
 internal GXDLMSConfirmedServiceError(ConfirmedServiceError service, ServiceError type, byte value)
     : base("ServiceError " + GetConfirmedServiceError(service) + " exception. " + GetServiceError(type) + " " + GetServiceErrorValue(type, value))
 {
     ConfirmedServiceError = service;
     ServiceError          = type;
     ServiceErrorValue     = value;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor for Confirmed ServiceError.
 /// </summary>
 internal GXDLMSConfirmedServiceError(ConfirmedServiceError service, ServiceError type, byte value)
     : base("ServiceError " + GetConfirmedServiceError(service) + " exception. " + GetServiceError(type) + " " + GetServiceErrorValue(type, value))
 {
     ConfirmedServiceError = service;
     ServiceError          = type;
     ServiceErrorValue     = value;
     HelpLink = " https://www.gurux.fi/Gurux.DLMS.ErrorCodes";
 }
 private static string GetConfirmedServiceError(ConfirmedServiceError stateError)
 {
     switch (stateError)
     {
         case ConfirmedServiceError.InitiateError:
             return "Initiate Error";
         case ConfirmedServiceError.Read:
             return "Read";
         case ConfirmedServiceError.Write:
             return "Write";
         default:
             break;
     }
     return string.Empty;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Generate confirmed service error.
 /// </summary>
 /// <param name="service">Confirmed service error.</param>
 /// <param name="type">Service error.</param>
 /// <param name="code">code</param>
 /// <returns></returns>
 internal static byte[] GenerateConfirmedServiceError(ConfirmedServiceError service, ServiceError type, byte code)
 {
     return(new byte[] { (byte)Command.ConfirmedServiceError, (byte)service, (byte)type, code });
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Generate confirmed service error.
 /// </summary>
 /// <param name="service">Confirmed service error.</param>
 /// <param name="type">Service error.</param>
 /// <param name="code">code</param>
 /// <returns></returns>
 internal static byte[] GenerateConfirmedServiceError(ConfirmedServiceError service, ServiceError type, byte code)
 {
     return new byte[] { (byte)Command.ConfirmedServiceError, (byte)service, (byte)type, code };
 }
Ejemplo n.º 7
0
 private static string GetConfirmedServiceError(ConfirmedServiceError stateError)
 {
     switch (stateError)
     {
         case ConfirmedServiceError.InitiateError:
             return "Initiate Error";
         case ConfirmedServiceError.Read:
             return "Read";
         case ConfirmedServiceError.Write:
             return "Write";
         default:
             break;
     }
      return string.Empty;
 }