Merge pull request #22 from duggerd/fix-20

SW: End session cleanly after error; fixes #20
This commit is contained in:
Daniel Dugger 2020-03-15 16:35:41 -04:00 committed by GitHub
commit 64547c9cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 219 additions and 183 deletions

View File

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