SW: End session cleanly after error; fixes #20

This commit is contained in:
Daniel Dugger 2020-03-15 16:33:18 -04:00
parent 54a098a568
commit cc3943c466
1 changed files with 219 additions and 183 deletions

View File

@ -55,6 +55,8 @@ namespace KFDtool.P25.ManualRekey
{
Begin();
try
{
InventoryCommandListActiveKsetIds cmdKmmBody1 = new InventoryCommandListActiveKsetIds();
KmmBody rspKmmBody1 = TxRxKmm(cmdKmmBody1);
@ -145,6 +147,13 @@ namespace KFDtool.P25.ManualRekey
{
throw new Exception("unexpected kmm");
}
}
catch
{
End();
throw;
}
End();
}
@ -172,6 +181,8 @@ namespace KFDtool.P25.ManualRekey
{
Begin();
try
{
InventoryCommandListActiveKsetIds cmdKmmBody1 = new InventoryCommandListActiveKsetIds();
KmmBody rspKmmBody1 = TxRxKmm(cmdKmmBody1);
@ -262,6 +273,13 @@ namespace KFDtool.P25.ManualRekey
{
throw new Exception("unexpected kmm");
}
}
catch
{
End();
throw;
}
End();
}
@ -271,6 +289,8 @@ namespace KFDtool.P25.ManualRekey
{
Begin();
try
{
ZeroizeCommand commandKmmBody = new ZeroizeCommand();
KmmBody responseKmmBody = TxRxKmm(commandKmmBody);
@ -289,6 +309,13 @@ namespace KFDtool.P25.ManualRekey
{
throw new Exception("unexpected kmm");
}
}
catch
{
End();
throw;
}
End();
}
@ -300,6 +327,8 @@ namespace KFDtool.P25.ManualRekey
Begin();
try
{
bool more = true;
int marker = 0;
@ -357,6 +386,13 @@ namespace KFDtool.P25.ManualRekey
throw new Exception("unexpected kmm");
}
}
}
catch
{
End();
throw;
}
End();