Beispiel #1
0
        /**
         * Constructor taking an incoming data buffer
         *
         * @param frameBuffer the incoming data buffer
         */
        public AshFrameRstAck(int[] frameBuffer)
        {
            this._frameType = FrameType.RSTACK;

            this._version   = frameBuffer[1];
            this._resetCode = frameBuffer[2];
            this._errorCode = AshErrorCode.GetAshErrorCode(this._resetCode);
        }
Beispiel #2
0
        /**
         * Gets an AshErrorCode enum given the ASH error code
         *
         * @param errorCode
         * @return
         */
        public static AshErrorCode GetAshErrorCode(int errorCode)
        {
            AshErrorCode error = _codeDictionary[errorCode];

            if (error == null)
            {
                return(_codeDictionary[-1]);
            }

            return(error);
        }
Beispiel #3
0
        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("AshFrameError [version=");
            builder.Append(_version);
            builder.Append(", errorCode=");
            builder.Append(_errorCode);
            builder.Append(", ");
            AshErrorCode ashError = AshErrorCode.GetAshErrorCode(_errorCode);

            builder.Append(ashError.GetDescription());
            builder.Append(']');
            return(builder.ToString());
        }