From e17a71b5efa82831b130f8ea2407278e2edc612b Mon Sep 17 00:00:00 2001 From: David Shalaby Date: Mon, 23 Oct 2017 18:37:00 -0400 Subject: [PATCH] Removed check for EoF in IsValidFrame(), fixed null reference exception on reader disconnect, changed URL launching to not cease if a scanning error or non-URI tag is detected. --- Example/MainWindow.xaml | 2 +- Example/MainWindow.xaml.cs | 18 +++++++++------- Example/Properties/AssemblyInfo.cs | 8 +++---- Example/Tappy Tcmp Demo.csproj | 16 +++++++------- Tcmp-SDK/Properties/AssemblyInfo.cs | 4 ++-- .../Bluetooth/BluetoothConnection.cs | 5 ++++- Tcmp-SDK/Tcmp/Communication/TappyReader.cs | 21 +++++++++---------- Tcmp-SDK/Tcmp/Communication/TcmpFrame.cs | 16 ++++++++------ Tcmp-SDK/Tcmp/Communication/UsbConnection.cs | 9 ++++---- 9 files changed, 55 insertions(+), 44 deletions(-) diff --git a/Example/MainWindow.xaml b/Example/MainWindow.xaml index 59f469f..85273e4 100644 --- a/Example/MainWindow.xaml +++ b/Example/MainWindow.xaml @@ -9,7 +9,7 @@ xmlns:gif="http://wpfanimatedgif.codeplex.com" mc:Ignorable="d" WindowStartupLocation="CenterScreen" - Title="Tappy Demo 2.4" Height="650" Width="800" Foreground="{x:Null}" Background="{StaticResource LightBackground}"> + Title="Tappy Demo 2.5" Height="650" Width="800" Foreground="{x:Null}" Background="{StaticResource LightBackground}"> diff --git a/Example/MainWindow.xaml.cs b/Example/MainWindow.xaml.cs index bdce83d..6ed6759 100644 --- a/Example/MainWindow.xaml.cs +++ b/Example/MainWindow.xaml.cs @@ -166,7 +166,8 @@ private void AddUID(ResponseFrame frame, Exception e) private void WriteURLButton_Click(object sender, RoutedEventArgs e) { - string url = string.Copy(urlTextBox.Text); + + string url = string.Copy(urlTextBox.Text); Command cmd = new WriteUri((byte)timeout.Value, (bool)lockCheckBox.IsChecked, new NdefUri(url)); Callback repeatCommand = null; bool repeat = (bool)repeatUrlWrite.IsChecked; @@ -486,7 +487,7 @@ private void AutoDetectButton_Click(object sender, RoutedEventArgs e) tappy.SwitchProtocol(window.Protocol); - ShowPendingStatus("Searching for a Tappy"); + ShowPendingStatus("Searching for a Tappy"); Task.Run(() => { @@ -654,7 +655,7 @@ private void launchUrlButton_Click(object sender, RoutedEventArgs e) private void DetectandLaunch() { - Command cmd = new DetectSingleNdef(0, DetectTagSetting.Type2Type4AandMifare); + Command cmd = new StreamNdef(0, DetectTagSetting.Type2Type4AandMifare); tappy.SendCommand(cmd, LaunchCallback); } @@ -737,12 +738,13 @@ private void disconnectButton_Click(object sender, RoutedEventArgs e) { try { - tappy.Disconnect(); - tappy.DisconnectBlueGiga(); - ShowSuccessStatus("Disconnect was successful"); + tappy.Disconnect(); + ShowSuccessStatus("Disconnect was successful"); } - catch - { + catch(Exception exc) + + { + Console.Write(exc.ToString()); ShowFailStatus("Disconnect was unsuccessful"); } } diff --git a/Example/Properties/AssemblyInfo.cs b/Example/Properties/AssemblyInfo.cs index a4c2316..bdac93f 100644 --- a/Example/Properties/AssemblyInfo.cs +++ b/Example/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tappy Demo")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Tappy Reader Demo for Windows")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("TapTrack (TM)")] [assembly: AssemblyProduct("Tappy Demo")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] @@ -51,7 +51,7 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.4.0.0")] -[assembly: AssemblyFileVersion("2.4.0.0")] +[assembly: AssemblyVersion("2.5.0.0")] +[assembly: AssemblyFileVersion("2.5.0.0")] [assembly: NeutralResourcesLanguage("en-CA")] diff --git a/Example/Tappy Tcmp Demo.csproj b/Example/Tappy Tcmp Demo.csproj index f78cdf6..c55039a 100644 --- a/Example/Tappy Tcmp Demo.csproj +++ b/Example/Tappy Tcmp Demo.csproj @@ -8,7 +8,7 @@ WinExe Properties TapTrack.Demo - Tappy Demo 2.4 + Tappy Demo 2.5 v4.5.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -49,7 +49,7 @@ DEBUG;TRACE prompt 4 - bin\Debug\Tappy Demo 2.4.xml + bin\Debug\Tappy Demo 2.5.xml AnyCPU @@ -59,7 +59,7 @@ TRACE prompt 4 - bin\Release\Tappy Demo 2.4.xml + bin\Release\Tappy Demo 2.5.xml DA55EDA3D657C041EF308F9D8CDF1B5A4950F2E4 @@ -102,9 +102,6 @@ 4.0 - - ..\Tcmp-SDK\bin\Debug\TapTrack.Tcmp.dll - @@ -659,7 +656,12 @@ - + + + {cd277ef8-6666-4b0c-b482-9eafa662732e} + TapTrack.Tcmp + +