HOME › Forums › Gateways › EZSrve › Some assistance required with a simple Insteon application › Reply To: Some assistance required with a simple Insteon application
Inactive
September 28, 2010 at 8:35 pm
Post count: 6
Just tried it with the GetRevision command, and had exactly the same result – the read command returned absolutely nothing. In my debugger, I can see that the command been written to the EZServe is correct, but whether or not that “Write” actually occurs is not apparent, and I don’t know how to verify that – the problem definitely appears to be in this function:
public string GetXMLResults(string XMLInput)
{
if (ezsrveStream != null)
{
ezsrveStream.Close();
}
Connect();
byte[] data = System.Text.Encoding.ASCII.GetBytes(XMLInput);
ezsrveStream.Write(data, 0, data.Length);
string XMLString = "";
if (ezsrveStream.CanRead)
{
// Receive the result
byte[] results = new byte[8000];
try
{
int len = ezsrveStream.Read(results, 0, 8000);
if (len > 0)
{
foreach (byte b in results)
{
if (b.ToString() != "0")
{
XMLString += (char)b;
}
}
}
}
catch (Exception ex)
{
//Response.Write("GetXMLResults:" + ex.Message);
}
}
else
{
//Response.Write("Unable to read Network Stream");
}
return XMLString;
}
a little messy, but worked fine with the other switch – the read operation returns a len of 0, and thereafter it exits the function – sigh 🙁