diff --git a/Cardia/Properties/AssemblyInfo.cs b/Cardia/Properties/AssemblyInfo.cs index 4f28779..b0bd471 100644 --- a/Cardia/Properties/AssemblyInfo.cs +++ b/Cardia/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Cardia")] -[assembly: AssemblyCopyright("Copyright © 2013-2018")] +[assembly: AssemblyCopyright("Copyright © 2013-2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // 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("1.2.0.0")] +[assembly: AssemblyVersion("1.2.0.1")] //[assembly: AssemblyFileVersion("0.7.*")] diff --git a/HRM/HRP/BtHrp.cs b/HRM/HRP/BtHrp.cs index a9bb9de..3c56639 100644 --- a/HRM/HRP/BtHrp.cs +++ b/HRM/HRP/BtHrp.cs @@ -263,45 +263,35 @@ private async Task ConfigureServiceForNotificationsAsync() #endif characteristic.ValueChanged += Characteristic_ValueChanged; - // In order to avoid unnecessary communication with the device, determine if the device is already - // correctly configured to send notifications. - // By default ReadClientCharacteristicConfigurationDescriptorAsync will attempt to get the current - // value from the system cache and communication with the device is not typically required. + // Set the Client Characteristic Configuration Descriptor to enable the device to send notifications + // when the Characteristic value changes #if DEBUG - logger.Debug("Reading GattCharacteristic configuration descriptor"); + logger.Debug("Setting GattCharacteristic configuration descriptor to enable notifications"); #endif - var currentDescriptorValue = await characteristic.ReadClientCharacteristicConfigurationDescriptorAsync(); - if ((currentDescriptorValue.Status != GattCommunicationStatus.Success) || - (currentDescriptorValue.ClientCharacteristicConfigurationDescriptor != CHARACTERISTIC_NOTIFICATION_TYPE)) - { - // Set the Client Characteristic Configuration Descriptor to enable the device to send notifications - // when the Characteristic value changes -#if DEBUG - logger.Debug("Setting GattCharacteristic configuration descriptor to enable notifications"); -#endif - - GattCommunicationStatus status = - await characteristic.WriteClientCharacteristicConfigurationDescriptorAsync( - CHARACTERISTIC_NOTIFICATION_TYPE); + GattCommunicationStatus status = + await characteristic.WriteClientCharacteristicConfigurationDescriptorAsync( + CHARACTERISTIC_NOTIFICATION_TYPE); - if (status == GattCommunicationStatus.Unreachable) - { + if (status == GattCommunicationStatus.Unreachable) + { #if DEBUG - logger.Debug("Device unreachable"); + logger.Debug("Device unreachable"); #endif - - // Register a PnpObjectWatcher to detect when a connection to the device is established, - // such that the application can retry device configuration. - StartDeviceConnectionWatcher(); - } + // Register a PnpObjectWatcher to detect when a connection to the device is established, + // such that the application can retry device configuration. + StartDeviceConnectionWatcher(); } - else - { #if DEBUG + else if (status == GattCommunicationStatus.Success) + { logger.Debug("Configuration successfull"); -#endif + + logger.Debug($"GattSession status = {service.Session.SessionStatus}, " + + $"mantain connection = {service.Session.MaintainConnection}, " + + $"can mantain connection = {service.Session.MaintainConnection}"); } +#endif } catch (Exception e) { diff --git a/HRM/Properties/AssemblyInfo.cs b/HRM/Properties/AssemblyInfo.cs index 06e6496..f245d21 100644 --- a/HRM/Properties/AssemblyInfo.cs +++ b/HRM/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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("1.1.0.1")] +[assembly: AssemblyVersion("1.1.0.2")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/README.md b/README.md index abb15aa..5153289 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,9 @@ If you would like to support me and help me buy the devices to include support f - - - - ### Changelog +* v1.2.0.1 (2022-08-03) + * Change BT HRP initialization sequence (thanks to [@effgenesis](https://www.github.com/effgenesis)) + * v1.2 (2018-12-01) * Included UDP logging support * Partial code rewrital to support better modularity