Examples/applications
10.2 RF182C user application
RF182C communication module
Operating Instructions, 10/2010
93
// first tag is a reply
endTag = "</reply>";
tag.type = "reply";
tag.startIndex = index1;
}
else if (index2 < index3)
{
// first tag is a notification
endTag = "</notification>";
tag.type = "notification";
tag.startIndex = index2;
}
//Is the complete message in the buffer?
int endIndex = ReceiveBuffer.IndexOf(endTag, tag.startIndex);
if (endIndex == -1) return null;
tag.length = endIndex - tag.star endTag.Length;
return tag;
}
// Appends an outgoing message to the list
private void AppendOutMessage(String message)
{
//Remove all CR and LF
message.Replace("\r", "");
message.Replace("\n", "");
//Add message
int index = listProcess.Items.Add("OUT: " + message);
//Scroll if desired
if (checkScroll.Checked == true)
{
listProcess.SelectedIndex = index;
}
}
// Appends an ingoing message to the list
private void AppendInMessage(String message)
{
//functionality just lie AppendOutMessage
message.Replace("\r", "");
message.Replace("\n", "");
int index = listProcess.Items.Add("IN : " + message);
if (checkScroll.Checked == true)
{
listProcess.SelectedIndex = index;
}
}
/* Call this function if a tag appeared / disappeared. */
private void SetTagDetectionState(TagDetectionState state)