/// <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; }
/// <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; }
/// <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 }); }
/// <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 }; }