Beispiel #1
0
        public IErrorResponse SendEnhancedNotification(IEnhancedNotification enhancedNotification)
        {
            this.connection.Connect();
            this.connection.Write(enhancedNotification.ToByteArray());
            var response = new byte[6];
            this.connection.Read(response, 0, response.Length);
            this.connection.Disconnect();
            IErrorResponse errorResponse = null;

            if (response[0] == 0x08)
            {
                // we received an error response...
                errorResponse = new ErrorResponse(BitConverter.ToInt32(response, 2), (ErrorResponseStatusCode) response[1]);
            }

            return errorResponse;
        }
Beispiel #2
0
        public IErrorResponse SendEnhancedNotification(IEnhancedNotification enhancedNotification)
        {
            this.connection.Connect();
            this.connection.Write(enhancedNotification.ToByteArray());
            var response = new byte[6];

            this.connection.Read(response, 0, response.Length);
            this.connection.Disconnect();
            IErrorResponse errorResponse = null;

            if (response[0] == 0x08)
            {
                // we received an error response...
                errorResponse = new ErrorResponse(BitConverter.ToInt32(response, 2), (ErrorResponseStatusCode)response[1]);
            }

            return(errorResponse);
        }