ResponseCodeThe
ResponseCode represents the response code of a HART command. Use the properties or the indexer to evaluate the request.
[Test]
public void UseProperty()
{
HartCommunicationLite communication = new HartCommunicationLite("COM1");
OpenResult openResult = communication.Open();
Assert.That(openResult, Is.EqualTo(OpenResult.Opened));
CommandResult commandResult = communication.Send(12);
Assert.That(commandResult, Is.Not.Null);
Assert.That(commandResult.CommandNumber, Is.EqualTo(12));
Assert.That(commandResult.ResponseCode.FirstByte, Is.EqualTo(0));
communication.Close();
}
[Test]
public void UseIndexer()
{
HartCommunicationLite communication = new HartCommunicationLite("COM1");
OpenResult openResult = communication.Open();
Assert.That(openResult, Is.EqualTo(OpenResult.Opened));
CommandResult commandResult = communication.Send(12);
Assert.That(commandResult, Is.Not.Null);
Assert.That(commandResult.CommandNumber, Is.EqualTo(12));
Assert.That(commandResult.ResponseCode[0], Is.EqualTo(0));
communication.Close();
}