Skip to content

Commit

Permalink
catch exceptions when operating reader
Browse files Browse the repository at this point in the history
  • Loading branch information
g3gg0 committed Mar 22, 2024
1 parent ca062fe commit 6a95c2e
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions TeddyBench/TeddyMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2240,19 +2240,25 @@ private void measureAnteannaToolStripMenuItem_Click(object sender, EventArgs e)
TagOperationDialog opDlg = new TagOperationDialog();

opDlg.Show();
Proxmark3.MeasurementResult result = RfidReader.MeasureAntenna();
try
{
Proxmark3.MeasurementResult result = RfidReader.MeasureAntenna();

opDlg.Close();
opDlg.Close();

if (result == null)
{
MessageBox.Show("Measurement failed.", "Failed");
return;
}
if (result == null)
{
MessageBox.Show("Measurement failed.", "Failed");
return;
}

PlotAntennaForm form = new PlotAntennaForm(result);
PlotAntennaForm form = new PlotAntennaForm(result);

form.ShowDialog();
form.ShowDialog();
}
catch (Exception ex)
{
}
}

private void flashFirmwareToolStripMenuItem_Click(object sender, EventArgs e)
Expand All @@ -2263,7 +2269,13 @@ private void flashFirmwareToolStripMenuItem_Click(object sender, EventArgs e)
dlg.Filter = "Firmware ELF files (*.elf)|*.elf|All files (*.*)|*.*";
if (dlg.ShowDialog() == DialogResult.OK)
{
RfidReader.EnterBootloader(dlg.FileName);
try
{
RfidReader.EnterBootloader(dlg.FileName);
}
catch (Exception ex)
{
}
}
}

Expand All @@ -2275,7 +2287,13 @@ private void flashBootloaderToolStripMenuItem_Click(object sender, EventArgs e)
dlg.Filter = "Bootloader ELF files (*.elf)|*.elf|All files (*.*)|*.*";
if (dlg.ShowDialog() == DialogResult.OK)
{
RfidReader.EnterBootloader(dlg.FileName);
try
{
RfidReader.EnterBootloader(dlg.FileName);
}
catch (Exception ex)
{
}
}
}

Expand Down

0 comments on commit 6a95c2e

Please sign in to comment.