private void GenerateDisconnectRequest()
{
//Return error if connection is not established.
if (!Settings.Connected && !Settings.IsAuthenticationRequired)
{
replyData.Add(GenerateConfirmedServiceError(ConfirmedServiceError.InitiateError,
ServiceError.Service, (byte)Service.Unsupported));
return;
}
if (this.InterfaceType == InterfaceType.WRAPPER)
{
replyData.SetUInt8(0x63);
replyData.SetUInt8(0x0);
}
else
{
replyData.SetUInt8(0x81); // FromatID
replyData.SetUInt8(0x80); // GroupID
replyData.SetUInt8(0); // Length
replyData.SetUInt8(HDLCInfo.MaxInfoTX);
replyData.SetUInt8(GXCommon.GetSize(Limits.MaxInfoTX));
replyData.Add(Limits.MaxInfoTX);
replyData.SetUInt8(HDLCInfo.MaxInfoRX);
replyData.SetUInt8(GXCommon.GetSize(Limits.MaxInfoRX));
replyData.Add(Limits.MaxInfoRX);
replyData.SetUInt8(HDLCInfo.WindowSizeTX);
replyData.SetUInt8(GXCommon.GetSize(Limits.WindowSizeTX));
replyData.Add(Limits.WindowSizeTX);
replyData.SetUInt8(HDLCInfo.WindowSizeRX);
replyData.SetUInt8(GXCommon.GetSize(Limits.WindowSizeRX));
replyData.Add(Limits.WindowSizeRX);
int len = replyData.Position - 3;
replyData.SetUInt8(2, (byte)len); // Length.
}
}
}