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