المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Quick quest



C# Programming
06-30-2009, 07:00 PM
Just wondering as rxMessage is looking at the 3rd byte not the second am I right putting :

switch (rxMessage[2])
{
case 0x56: // "V" Version Number Request
if (rxMessage.Length == 3)
{
rxCommmandType = commandType.VersionNumRequest;
}
else
{
throw new IndexOutOfRangeException("Inavlid data entered, "
+ "Incorect number of bytes for a display update");
}
break;