public void GATTAGUIDSFun()
        {
            var known = new KnownAttributes();

            //// You can add descriptions for any desired
            //// characteristics, services, and descriptors
            //known.AddService(myGuid1, "Foo");
            //known.AddCharacteristic(myGuid2, "Bar");
            //known.AddDescriptor(myGuid3, "Baz");
        }
Exemple #2
0
 /// <summary>
 /// Add the Bluetooth SIG adopted services to <paramref name="attributes" />.
 /// <remarks>
 ///    <see href="https://www.bluetooth.com/specifications/gatt/services" />
 /// </remarks>
 /// </summary>
 public static void AddTo(KnownAttributes attributes)
 {
     attributes.AddService(0x1800, "Generic Access");
     attributes.AddService(0x1811, "Alert Notification Service");
     attributes.AddService(0x1815, "Automation IO");
     attributes.AddService(0x180F, "Battery Service");
     attributes.AddService(0x1810, "Blood Pressure");
     attributes.AddService(0x181B, "Body Composition");
     attributes.AddService(0x181E, "Bond Management Service");
     attributes.AddService(0x181F, "Continuous Glucose Monitoring");
     attributes.AddService(0x1805, "Current Time Service");
     attributes.AddService(0x1818, "Cycling Power");
     attributes.AddService(0x1816, "Cycling Speed and Cadence");
     attributes.AddService(0x180A, "Device Information");
     attributes.AddService(0x181A, "Environmental Sensing");
     attributes.AddService(0x1826, "Fitness Machine");
     attributes.AddService(0x1801, "Generic Attribute");
     attributes.AddService(0x1808, "Glucose");
     attributes.AddService(0x1809, "Health Thermometer");
     attributes.AddService(0x180D, "Heart Rate");
     attributes.AddService(0x1823, "HTTP Proxy");
     attributes.AddService(0x1812, "Human Interface Device");
     attributes.AddService(0x1802, "Immediate Alert");
     attributes.AddService(0x1821, "Indoor Positioning");
     attributes.AddService(0x1820, "Internet Protocol Support Service");
     attributes.AddService(0x1803, "Link Loss");
     attributes.AddService(0x1819, "Location and Navigation");
     attributes.AddService(0x1827, "Mesh Provisioning Service");
     attributes.AddService(0x1828, "Mesh Proxy Service");
     attributes.AddService(0x1807, "Next DST Change Service");
     attributes.AddService(0x1825, "Object Transfer Service");
     attributes.AddService(0x180E, "Phone Alert Status Service");
     attributes.AddService(0x1822, "Pulse Oximeter Service");
     attributes.AddService(0x1806, "Reference Time Update Service");
     attributes.AddService(0x1814, "Running Speed and Cadence");
     attributes.AddService(0x1813, "Scan Parameters");
     attributes.AddService(0x1824, "Transport Discovery");
     attributes.AddService(0x1804, "Tx Power");
     attributes.AddService(0x181C, "User Data");
     attributes.AddService(0x181D, "Weight Scale");
 }
 public void ProcessJob(TaskScheduling task)
 {
     try
     {
         ServicesAdministrationServiceClient adminClient  = new ServicesAdministrationServiceClient(true);
         ServicesSearchServiceClient         searchClient = new ServicesSearchServiceClient(false);
         IdentityStore   store                   = adminClient.GetIdentityStoreById(task.get_IdentityStoreId(), true);
         KnownAttributes knownAttributes         = searchClient.GetKnownAttributes(task.get_IdentityStoreId());
         List <PermissionAnalyzerServer> servers = new List <PermissionAnalyzerServer>();
         Dictionary <string, Dictionary <int, string> > configurations = this.LoadConfigurations(store, adminClient, servers, knownAttributes);
         List <Schema> schema = adminClient.GetIdentityStoreSchema(task.get_IdentityStoreId());
         if (servers.Count > 0)
         {
             (new Imanami.PermissionReplicationService.PermissionReplicationService(store, configurations, schema, knownAttributes)).ReplicatePermissions(1, servers);
         }
     }
     catch (Exception exception)
     {
         LogExtension.LogException(PermissionAnalyzer.logger, "Error While Replicating Permissions.", exception);
     }
     PermissionAnalyzer.logger.InfoFormat("Job processed successfully.", Array.Empty <object>());
 }
        public Dictionary <string, Dictionary <int, string> > LoadConfigurations(IdentityStore store, ServicesAdministrationServiceClient _client, List <PermissionAnalyzerServer> servers, KnownAttributes knownAttributes)
        {
            Dictionary <string, Dictionary <int, string> > strs;

            try
            {
                try
                {
                    PermissionAnalyzerConfigurationService         permissionAnalyzerConfigurationService = new PermissionAnalyzerConfigurationService(store.get_IdentityStoreId());
                    Dictionary <string, Dictionary <int, string> > strs1 = new Dictionary <string, Dictionary <int, string> >();
                    IdentityStorePermissionAnalyzerConfiguration   permissionConfigurations = permissionAnalyzerConfigurationService.GetPermissionConfigurations();
                    if ((permissionConfigurations == null || permissionConfigurations.get_Servers() == null ? false : permissionConfigurations.get_Servers().Count > 0))
                    {
                        if (permissionConfigurations.get_IncludeFutureServers())
                        {
                            List <PermissionAnalyzerServer> allServers = permissionAnalyzerConfigurationService.GetCriteriaBasedServers(permissionConfigurations);
                            IEnumerable <string>            strs2      = (
                                from x in allServers
                                select x.get_ServerID()).Except <string>(
                                from y in permissionConfigurations.get_Servers()
                                select y.get_ServerID());
                            IEnumerable <PermissionAnalyzerServer> latestServers =
                                from server in allServers
                                where strs2.Any <string>((string id) => server.get_ServerID().Equals(id, StringComparison.InvariantCultureIgnoreCase))
                                select server;
                            if ((latestServers == null ? false : latestServers.Count <PermissionAnalyzerServer>() > 0))
                            {
                                permissionConfigurations.get_Servers().AddRange(latestServers);
                            }
                        }
                        if ((Helper.CurrentTask.get_Targets() == null ? false : Helper.CurrentTask.get_Targets().Count > 0))
                        {
                            permissionConfigurations.set_Servers((
                                                                     from server in permissionConfigurations.get_Servers()
                                                                     where Helper.CurrentTask.get_Targets().Any <SchedulingTarget>((SchedulingTarget target) => target.get_Target().Equals(server.get_ServerID(), StringComparison.InvariantCultureIgnoreCase))
                                                                     select server).ToList <PermissionAnalyzerServer>());
                            Helper.CurrentTask.get_Targets().Clear();
                        }
                        permissionConfigurations.get_Servers().ForEach((PermissionAnalyzerServer server) => {
                            if (permissionConfigurations.get_ExcludedServers() != null)
                            {
                                if (permissionConfigurations.get_ExcludedServers().Any <string>((string excludedServer) => excludedServer.Equals(server.get_ServerID(), StringComparison.InvariantCultureIgnoreCase)))
                                {
                                    return;
                                }
                            }
                            if (!string.IsNullOrEmpty(server.get_ScheduleJob()))
                            {
                                if (!server.get_ScheduleJob().Equals(PermissionAnalyzerConfigurationService.GetScheduleName()))
                                {
                                    return;
                                }
                            }
                            if (server.get_Credentials() == null)
                            {
                                server.set_Credentials(new PermissionAnalyzerServerCredentials());
                            }
                            server.get_Credentials();
                            if (server.get_IsServiceAccountConfigured())
                            {
                                server.get_Credentials().set_UserName(store.get_IdentityStoreConfigurationValues()["UserName"]);
                                server.get_Credentials().set_Password(store.get_IdentityStoreConfigurationValues()["Password"]);
                            }
                            server.get_Credentials().set_ServerName(server.get_Server());
                            if ((server.get_FileShare() == null ? false : server.get_FileShare().get_Shares() != null))
                            {
                                List <string> serverShares = new List <string>();
                                if (!server.get_IsServiceAccountConfigured())
                                {
                                    server.get_Credentials().set_Password(CryptographyHelper.DecryptFromLocalMachine(server.get_Credentials().get_Password()));
                                }
                                try
                                {
                                    serverShares = permissionAnalyzerConfigurationService.GetNetworkShareResourcesList(server.get_Credentials());
                                }
                                catch (Exception exception)
                                {
                                }
                                if (!server.get_IsServiceAccountConfigured())
                                {
                                    server.get_Credentials().set_Password(CryptographyHelper.EncryptForLocalMachine(server.get_Credentials().get_Password()));
                                }
                                serverShares.ForEach((string latestShare) => {
                                    if (!server.get_FileShare().get_Shares().Any <PermissionAnalyzerServerShare>((PermissionAnalyzerServerShare x) => x.get_ShareID().Equals(latestShare, StringComparison.InvariantCultureIgnoreCase)))
                                    {
                                        List <PermissionAnalyzerServerShare> shares = server.get_FileShare().get_Shares();
                                        PermissionAnalyzerServerShare permissionAnalyzerServerShare = new PermissionAnalyzerServerShare();
                                        permissionAnalyzerServerShare.set_IsSelected(true);
                                        permissionAnalyzerServerShare.set_Share(latestShare);
                                        permissionAnalyzerServerShare.set_ShareID(latestShare);
                                        shares.Add(permissionAnalyzerServerShare);
                                    }
                                });
                            }
                            this.SetConfigurations(store, server, strs1);
                            servers.Add(server);
                        });
                    }
                    strs = strs1;
                    return(strs);
                }
                catch (Exception exception1)
                {
                    Exception ex = exception1;
                    LogExtension.LogException(PermissionAnalyzer.logger, ex.Message, ex);
                }
            }
            finally
            {
                (new ServicesSchedulingServiceClient(false)).Update(Helper.CurrentTask);
            }
            strs = new Dictionary <string, Dictionary <int, string> >();
            return(strs);
        }
Exemple #5
0
 public static IAttribute CompilerGeneratedAttribute(this ICompilation compilation) =>
 new DefaultAttribute(
     KnownAttributes.FindType(compilation, KnownAttribute.CompilerGenerated),
     ImmutableArray <CustomAttributeTypedArgument <IType> > .Empty,
     ImmutableArray <CustomAttributeNamedArgument <IType> > .Empty
     );
Exemple #6
0
 /// <inheritdoc cref="AddTo" />
 public static void AddAdoptedServices(this KnownAttributes attributes)
 {
     AddTo(attributes);
 }
 /// <summary>
 /// Add the Bluetooth SIG adopted characteristics to <paramref name="attributes" />
 /// <remarks>
 ///    <see href="https://www.bluetooth.com/specifications/gatt/characteristics" />
 /// </remarks>
 /// </summary>
 public static void AddTo(KnownAttributes attributes)
 {
     attributes.AddCharacteristic(0x2a43, "Alert Category ID");
     attributes.AddCharacteristic(0x2a42, "Alert Category ID Bit Mask");
     attributes.AddCharacteristic(0x2a06, "Alert Level");
     attributes.AddCharacteristic(0x2a44, "Alert Notification Control Point");
     attributes.AddCharacteristic(0x2a3f, "Alert Status");
     attributes.AddCharacteristic(0x2a01, "Appearance");
     attributes.AddCharacteristic(0x2a19, "Battery Level");
     attributes.AddCharacteristic(0x2a49, "Blood Pressure Feature");
     attributes.AddCharacteristic(0x2a35, "Blood Pressure Measurement");
     attributes.AddCharacteristic(0x2a38, "Body Sensor Location");
     attributes.AddCharacteristic(0x2a22, "Boot Keyboard Input Report");
     attributes.AddCharacteristic(0x2a32, "Boot Keyboard Output Report");
     attributes.AddCharacteristic(0x2a33, "Boot Mouse Input Report");
     attributes.AddCharacteristic(0x2a5c, "CSC Feature");
     attributes.AddCharacteristic(0x2a5b, "CSC Measurement");
     attributes.AddCharacteristic(0x2a2b, "Current Time");
     attributes.AddCharacteristic(0x2a66, "Cycling Power Control Point");
     attributes.AddCharacteristic(0x2a65, "Cycling Power Feature");
     attributes.AddCharacteristic(0x2a63, "Cycling Power Measurement");
     attributes.AddCharacteristic(0x2a64, "Cycling Power Vector");
     attributes.AddCharacteristic(0x2a08, "Date Time");
     attributes.AddCharacteristic(0x2a0a, "Day Date Time");
     attributes.AddCharacteristic(0x2a09, "Day of Week");
     attributes.AddCharacteristic(0x2a00, "Device Name");
     attributes.AddCharacteristic(0x2a0d, "DST Offset");
     attributes.AddCharacteristic(0x2a0c, "Exact Time 256");
     attributes.AddCharacteristic(0x2a26, "Firmware Revision String");
     attributes.AddCharacteristic(0x2a51, "Glucose Feature");
     attributes.AddCharacteristic(0x2a18, "Glucose Measurement");
     attributes.AddCharacteristic(0x2a34, "Glucose Measure Context");
     attributes.AddCharacteristic(0x2a27, "Hardware Revision String");
     attributes.AddCharacteristic(0x2a39, "Heart Rate Control Point");
     attributes.AddCharacteristic(0x2a37, "Heart Rate Measurement");
     attributes.AddCharacteristic(0x2a4c, "HID Control Point");
     attributes.AddCharacteristic(0x2a4a, "HID Information");
     attributes.AddCharacteristic(0x2a36, "Intermediate Cuff Pressure");
     attributes.AddCharacteristic(0x2a1e, "Intermediate Temperature");
     attributes.AddCharacteristic(0x2a6b, "LN Control Point");
     attributes.AddCharacteristic(0x2a6a, "LN Feature");
     attributes.AddCharacteristic(0x2a0f, "Local Time Information");
     attributes.AddCharacteristic(0x2a67, "Location And Speed");
     attributes.AddCharacteristic(0x2a29, "Manufacturer Name String");
     attributes.AddCharacteristic(0x2a21, "Measurement Interval");
     attributes.AddCharacteristic(0x2a24, "Model Number String");
     attributes.AddCharacteristic(0x2a68, "Navigation");
     attributes.AddCharacteristic(0x2a46, "New Alert");
     attributes.AddCharacteristic(0x2a04, "Peripheral Preferred Connection Parameters");
     attributes.AddCharacteristic(0x2a02, "Peripheral Privacy Flag");
     attributes.AddCharacteristic(0x2a50, "PnP ID");
     attributes.AddCharacteristic(0x2a69, "Position Quality");
     attributes.AddCharacteristic(0x2a4e, "Protocol Mode");
     attributes.AddCharacteristic(0x2a03, "Reconnection Address");
     attributes.AddCharacteristic(0x2a52, "Record Access Control Point");
     attributes.AddCharacteristic(0x2a14, "Reference Time Information");
     attributes.AddCharacteristic(0x2a4d, "Report");
     attributes.AddCharacteristic(0x2a4b, "Report Map");
     attributes.AddCharacteristic(0x2a40, "Ringer Control Point");
     attributes.AddCharacteristic(0x2a41, "Ringer Setting");
     attributes.AddCharacteristic(0x2a54, "RSC Feature");
     attributes.AddCharacteristic(0x2a53, "RSC Measurement");
     attributes.AddCharacteristic(0x2a55, "SC Control Point");
     attributes.AddCharacteristic(0x2a4f, "Scan Interval Window");
     attributes.AddCharacteristic(0x2a31, "Scan Refresh");
     attributes.AddCharacteristic(0x2a5d, "Sensor Location");
     attributes.AddCharacteristic(0x2a25, "Serial Number String");
     attributes.AddCharacteristic(0x2a05, "Service Changed");
     attributes.AddCharacteristic(0x2a28, "Software Revision String");
     attributes.AddCharacteristic(0x2a47, "Supported New Alert Category");
     attributes.AddCharacteristic(0x2a48, "Supported Unread Alert Category");
     attributes.AddCharacteristic(0x2a23, "System ID");
     attributes.AddCharacteristic(0x2a1c, "Temperature Measurement");
     attributes.AddCharacteristic(0x2a1d, "Temperature Type");
     attributes.AddCharacteristic(0x2a12, "Time Accuracy");
     attributes.AddCharacteristic(0x2a13, "Time Source");
     attributes.AddCharacteristic(0x2a16, "Time Update Control Point");
     attributes.AddCharacteristic(0x2a17, "Time Update State");
     attributes.AddCharacteristic(0x2a11, "Time with DST");
     attributes.AddCharacteristic(0x2a0e, "Time Zone");
     attributes.AddCharacteristic(0x2a07, "Tx Power Level");
     attributes.AddCharacteristic(0x2a45, "Unread Alert Status");
     attributes.AddCharacteristic(0x2a7e, "Aerobic Heart Rate Lower Limit");
     attributes.AddCharacteristic(0x2a84, "Aerobic Heart Rate Uppoer Limit");
     attributes.AddCharacteristic(0x2a80, "Age");
     attributes.AddCharacteristic(0x2a5a, "Aggregate Input");
     attributes.AddCharacteristic(0x2a81, "Anaerobic Heart Rate Lower Limit");
     attributes.AddCharacteristic(0x2a82, "Anaerobic Heart Rate Upper Limit");
     attributes.AddCharacteristic(0x2a83, "Anaerobic Threshold");
     attributes.AddCharacteristic(0x2a58, "Analog");
     attributes.AddCharacteristic(0x2a73, "Apparent Wind Direction");
     attributes.AddCharacteristic(0x2a72, "Apparent Wind Speed");
     attributes.AddCharacteristic(0x2a9b, "Body Composition Feature");
     attributes.AddCharacteristic(0x2a9c, "Body Composition Measurement");
     attributes.AddCharacteristic(0x2a99, "Database Change Increment");
     attributes.AddCharacteristic(0x2a85, "Date of Birth");
     attributes.AddCharacteristic(0x2a86, "Date of Threshold Assessment");
     attributes.AddCharacteristic(0x2a7d, "Descriptor Value Changed");
     attributes.AddCharacteristic(0x2a7b, "Dew Point");
     attributes.AddCharacteristic(0x2a56, "Digital Input");
     attributes.AddCharacteristic(0x2a57, "Digital Output");
     attributes.AddCharacteristic(0x2a6c, "Elevation");
     attributes.AddCharacteristic(0x2a87, "Email Address");
     attributes.AddCharacteristic(0x2a0b, "Exact Time 100");
     attributes.AddCharacteristic(0x2a88, "Fat Burn Heart Rate Lower Limit");
     attributes.AddCharacteristic(0x2a89, "Fat Burn Heart Rate Upper Limit");
     attributes.AddCharacteristic(0x2a8a, "First Name");
     attributes.AddCharacteristic(0x2a8b, "Five Zone Heart Rate Limits");
     attributes.AddCharacteristic(0x2a8c, "Gender");
     attributes.AddCharacteristic(0x2a74, "Gust Factor");
     attributes.AddCharacteristic(0x2a8d, "Heart Rate Max");
     attributes.AddCharacteristic(0x2a7a, "Heat Index");
     attributes.AddCharacteristic(0x2a8e, "Height");
     attributes.AddCharacteristic(0x2a8f, "Hip Circumference");
     attributes.AddCharacteristic(0x2a6f, "Humidity");
     attributes.AddCharacteristic(0x2a77, "Irradiance");
     attributes.AddCharacteristic(0x2a90, "Last Name");
     attributes.AddCharacteristic(0x2a91, "Maximum Recommended Heart Rate");
     attributes.AddCharacteristic(0x2a3e, "Network Availability");
     attributes.AddCharacteristic(0x2a75, "Pollen Concentration");
     attributes.AddCharacteristic(0x2a6d, "Pressure");
     attributes.AddCharacteristic(0x2a78, "Rainfall");
     attributes.AddCharacteristic(0x2a92, "Resting Heart Rate");
     attributes.AddCharacteristic(0x2a3c, "Scientific Temperature in Celsius");
     attributes.AddCharacteristic(0x2a10, "Secondary Time Zone");
     attributes.AddCharacteristic(0x2a93, "Sport Type for Aerobic and Anaerobic Thresholds");
     attributes.AddCharacteristic(0x2a3d, "String");
     attributes.AddCharacteristic(0x2a6e, "Temperature");
     attributes.AddCharacteristic(0x2a1f, "Temperature in Celsius");
     attributes.AddCharacteristic(0x2a20, "Temperature in Fahrenheit");
     attributes.AddCharacteristic(0x2a94, "Three Zone Heart Rate Limits");
     attributes.AddCharacteristic(0x2a15, "Time Broadcast");
     attributes.AddCharacteristic(0x2a7c, "Trend");
     attributes.AddCharacteristic(0x2a71, "True Wind Direction");
     attributes.AddCharacteristic(0x2a70, "True Wind Speed");
     attributes.AddCharacteristic(0x2a95, "Two Zone Heart Rate Limit");
     attributes.AddCharacteristic(0x2a9f, "User Control Point");
     attributes.AddCharacteristic(0x2a9a, "User Index");
     attributes.AddCharacteristic(0x2a76, "UV Index");
     attributes.AddCharacteristic(0x2a96, "VO2 Max");
     attributes.AddCharacteristic(0x2a97, "Waist Circumference");
     attributes.AddCharacteristic(0x2a98, "Weight");
     attributes.AddCharacteristic(0x2a9d, "Weight Measurement");
     attributes.AddCharacteristic(0x2a9e, "Weight Scale Feature");
     attributes.AddCharacteristic(0x2a79, "Wind Chill");
     attributes.AddCharacteristic(0x2a1b, "Battery Level State");
     attributes.AddCharacteristic(0x2a1a, "Battery Power State");
     attributes.AddCharacteristic(0x2a2d, "Latitude");
     attributes.AddCharacteristic(0x2a2e, "Longitude");
     attributes.AddCharacteristic(0x2a2f, "Position 2D");
     attributes.AddCharacteristic(0x2a30, "Position 3D");
     attributes.AddCharacteristic(0x2a5f, "Pulse Oximetry Continuous Measurement");
     attributes.AddCharacteristic(0x2a62, "Pulse Oximetry Control Point");
     attributes.AddCharacteristic(0x2a61, "Pulse Oximetry Features");
     attributes.AddCharacteristic(0x2a60, "Pulse Oximetry Pulsatile Event");
     attributes.AddCharacteristic(0x2a5e, "Pulse Oximetry Spot-Check Measurement");
     attributes.AddCharacteristic(0x2a3a, "Removable");
     attributes.AddCharacteristic(0x2a3b, "Service Required");
 }
 /// <inheritdoc cref="AddTo" />
 public static void AddAdoptedCharacteristics(this KnownAttributes attributes)
 {
     AddTo(attributes);
 }
 /// <summary>
 /// Add the Bluetooth SIG adopted characteristics to <paramref name="attributes" />
 /// <remarks>
 ///    <see href="https://www.bluetooth.com/specifications/gatt/characteristics" />
 /// </remarks>
 /// </summary>
 public static void AddTo(KnownAttributes attributes)
 {
     attributes.AddCharacteristic(0x2A7E, "Aerobic Heart Rate Lower Limit");
     attributes.AddCharacteristic(0x2A84, "Aerobic Heart Rate Upper Limit");
     attributes.AddCharacteristic(0x2A7F, "Aerobic Threshold");
     attributes.AddCharacteristic(0x2A80, "Age");
     attributes.AddCharacteristic(0x2A5A, "Aggregate");
     attributes.AddCharacteristic(0x2A43, "Alert Category ID");
     attributes.AddCharacteristic(0x2A42, "Alert Category ID Bit Mask");
     attributes.AddCharacteristic(0x2A06, "Alert Level");
     attributes.AddCharacteristic(0x2A44, "Alert Notification Control Point");
     attributes.AddCharacteristic(0x2A3F, "Alert Status");
     attributes.AddCharacteristic(0x2AB3, "Altitude");
     attributes.AddCharacteristic(0x2A81, "Anaerobic Heart Rate Lower Limit");
     attributes.AddCharacteristic(0x2A82, "Anaerobic Heart Rate Upper Limit");
     attributes.AddCharacteristic(0x2A83, "Anaerobic Threshold");
     attributes.AddCharacteristic(0x2A58, "Analog");
     attributes.AddCharacteristic(0x2A59, "Analog Output");
     attributes.AddCharacteristic(0x2A73, "Apparent Wind Direction");
     attributes.AddCharacteristic(0x2A72, "Apparent Wind Speed");
     attributes.AddCharacteristic(0x2A01, "Appearance");
     attributes.AddCharacteristic(0x2AA3, "Barometric Pressure Trend");
     attributes.AddCharacteristic(0x2A19, "Battery Level");
     attributes.AddCharacteristic(0x2A1B, "Battery Level State");
     attributes.AddCharacteristic(0x2A1A, "Battery Power State");
     attributes.AddCharacteristic(0x2A49, "Blood Pressure Feature");
     attributes.AddCharacteristic(0x2A35, "Blood Pressure Measurement");
     attributes.AddCharacteristic(0x2A9B, "Body Composition Feature");
     attributes.AddCharacteristic(0x2A9C, "Body Composition Measurement");
     attributes.AddCharacteristic(0x2A38, "Body Sensor Location");
     attributes.AddCharacteristic(0x2AA4, "Bond Management Control Point");
     attributes.AddCharacteristic(0x2AA5, "Bond Management Features");
     attributes.AddCharacteristic(0x2A22, "Boot Keyboard Input Report");
     attributes.AddCharacteristic(0x2A32, "Boot Keyboard Output Report");
     attributes.AddCharacteristic(0x2A33, "Boot Mouse Input Report");
     attributes.AddCharacteristic(0x2AA6, "Central Address Resolution");
     attributes.AddCharacteristic(0x2AA8, "CGM Feature");
     attributes.AddCharacteristic(0x2AA7, "CGM Measurement");
     attributes.AddCharacteristic(0x2AAB, "CGM Session Run Time");
     attributes.AddCharacteristic(0x2AAA, "CGM Session Start Time");
     attributes.AddCharacteristic(0x2AAC, "CGM Specific Ops Control Point");
     attributes.AddCharacteristic(0x2AA9, "CGM Status");
     attributes.AddCharacteristic(0x2ACE, "Cross Trainer Data");
     attributes.AddCharacteristic(0x2A5C, "CSC Feature");
     attributes.AddCharacteristic(0x2A5B, "CSC Measurement");
     attributes.AddCharacteristic(0x2A2B, "Current Time");
     attributes.AddCharacteristic(0x2A66, "Cycling Power Control Point");
     attributes.AddCharacteristic(0x2A65, "Cycling Power Feature");
     attributes.AddCharacteristic(0x2A63, "Cycling Power Measurement");
     attributes.AddCharacteristic(0x2A64, "Cycling Power Vector");
     attributes.AddCharacteristic(0x2A99, "Database Change Increment");
     attributes.AddCharacteristic(0x2A85, "Date of Birth");
     attributes.AddCharacteristic(0x2A86, "Date of Threshold Assessment");
     attributes.AddCharacteristic(0x2A08, "Date Time");
     attributes.AddCharacteristic(0x2A0A, "Day Date Time");
     attributes.AddCharacteristic(0x2A09, "Day of Week");
     attributes.AddCharacteristic(0x2A7D, "Descriptor Value Changed");
     attributes.AddCharacteristic(0x2A00, "Device Name");
     attributes.AddCharacteristic(0x2A7B, "Dew Point");
     attributes.AddCharacteristic(0x2A56, "Digital");
     attributes.AddCharacteristic(0x2A57, "Digital Output");
     attributes.AddCharacteristic(0x2A0D, "DST Offset");
     attributes.AddCharacteristic(0x2A6C, "Elevation");
     attributes.AddCharacteristic(0x2A87, "Email Address");
     attributes.AddCharacteristic(0x2A0B, "Exact Time 100");
     attributes.AddCharacteristic(0x2A0C, "Exact Time 256");
     attributes.AddCharacteristic(0x2A88, "Fat Burn Heart Rate Lower Limit");
     attributes.AddCharacteristic(0x2A89, "Fat Burn Heart Rate Upper Limit");
     attributes.AddCharacteristic(0x2A26, "Firmware Revision String");
     attributes.AddCharacteristic(0x2A8A, "First Name");
     attributes.AddCharacteristic(0x2AD9, "Fitness Machine Control Point");
     attributes.AddCharacteristic(0x2ACC, "Fitness Machine Feature");
     attributes.AddCharacteristic(0x2ADA, "Fitness Machine Status");
     attributes.AddCharacteristic(0x2A8B, "Five Zone Heart Rate Limits");
     attributes.AddCharacteristic(0x2AB2, "Floor Number");
     attributes.AddCharacteristic(0x2A8C, "Gender");
     attributes.AddCharacteristic(0x2A51, "Glucose Feature");
     attributes.AddCharacteristic(0x2A18, "Glucose Measurement");
     attributes.AddCharacteristic(0x2A34, "Glucose Measurement Context");
     attributes.AddCharacteristic(0x2A74, "Gust Factor");
     attributes.AddCharacteristic(0x2A27, "Hardware Revision String");
     attributes.AddCharacteristic(0x2A39, "Heart Rate Control Point");
     attributes.AddCharacteristic(0x2A8D, "Heart Rate Max");
     attributes.AddCharacteristic(0x2A37, "Heart Rate Measurement");
     attributes.AddCharacteristic(0x2A7A, "Heat Index");
     attributes.AddCharacteristic(0x2A8E, "Height");
     attributes.AddCharacteristic(0x2A4C, "HID Control Point");
     attributes.AddCharacteristic(0x2A4A, "HID Information");
     attributes.AddCharacteristic(0x2A8F, "Hip Circumference");
     attributes.AddCharacteristic(0x2ABA, "HTTP Control Point");
     attributes.AddCharacteristic(0x2AB9, "HTTP Entity Body");
     attributes.AddCharacteristic(0x2AB7, "HTTP Headers");
     attributes.AddCharacteristic(0x2AB8, "HTTP Status Code");
     attributes.AddCharacteristic(0x2ABB, "HTTPS Security");
     attributes.AddCharacteristic(0x2A6F, "Humidity");
     attributes.AddCharacteristic(0x2A2A, "IEEE 11073-20601 Regulatory Certification Data List");
     attributes.AddCharacteristic(0x2AD2, "Indoor Bike Data");
     attributes.AddCharacteristic(0x2AAD, "Indoor Positioning Configuration");
     attributes.AddCharacteristic(0x2A36, "Intermediate Cuff Pressure");
     attributes.AddCharacteristic(0x2A1E, "Intermediate Temperature");
     attributes.AddCharacteristic(0x2A77, "Irradiance");
     attributes.AddCharacteristic(0x2AA2, "Language");
     attributes.AddCharacteristic(0x2A90, "Last Name");
     attributes.AddCharacteristic(0x2AAE, "Latitude");
     attributes.AddCharacteristic(0x2A6B, "LN Control Point");
     attributes.AddCharacteristic(0x2A6A, "LN Feature");
     attributes.AddCharacteristic(0x2AB1, "Local East Coordinate");
     attributes.AddCharacteristic(0x2AB0, "Local North Coordinate");
     attributes.AddCharacteristic(0x2A0F, "Local Time Information");
     attributes.AddCharacteristic(0x2A67, "Location and Speed Characteristic");
     attributes.AddCharacteristic(0x2AB5, "Location Name");
     attributes.AddCharacteristic(0x2AAF, "Longitude");
     attributes.AddCharacteristic(0x2A2C, "Magnetic Declination");
     attributes.AddCharacteristic(0x2AA0, "Magnetic Flux Density - 2D");
     attributes.AddCharacteristic(0x2AA1, "Magnetic Flux Density - 3D");
     attributes.AddCharacteristic(0x2A29, "Manufacturer Name String");
     attributes.AddCharacteristic(0x2A91, "Maximum Recommended Heart Rate");
     attributes.AddCharacteristic(0x2A21, "Measurement Interval");
     attributes.AddCharacteristic(0x2A24, "Model Number String");
     attributes.AddCharacteristic(0x2A68, "Navigation");
     attributes.AddCharacteristic(0x2A3E, "Network Availability");
     attributes.AddCharacteristic(0x2A46, "New Alert");
     attributes.AddCharacteristic(0x2AC5, "Object Action Control Point");
     attributes.AddCharacteristic(0x2AC8, "Object Changed");
     attributes.AddCharacteristic(0x2AC1, "Object First-Created");
     attributes.AddCharacteristic(0x2AC3, "Object ID");
     attributes.AddCharacteristic(0x2AC2, "Object Last-Modified");
     attributes.AddCharacteristic(0x2AC6, "Object List Control Point");
     attributes.AddCharacteristic(0x2AC7, "Object List Filter");
     attributes.AddCharacteristic(0x2ABE, "Object Name");
     attributes.AddCharacteristic(0x2AC4, "Object Properties");
     attributes.AddCharacteristic(0x2AC0, "Object Size");
     attributes.AddCharacteristic(0x2ABF, "Object Type");
     attributes.AddCharacteristic(0x2ABD, "OTS Feature");
     attributes.AddCharacteristic(0x2A04, "Peripheral Preferred Connection Parameters");
     attributes.AddCharacteristic(0x2A02, "Peripheral Privacy Flag");
     attributes.AddCharacteristic(0x2A5F, "PLX Continuous Measurement Characteristic");
     attributes.AddCharacteristic(0x2A5E, "PLX Spot-Check Measurement");
     attributes.AddCharacteristic(0x2A50, "PnP ID");
     attributes.AddCharacteristic(0x2A75, "Pollen Concentration");
     attributes.AddCharacteristic(0x2A2F, "Position 2D");
     attributes.AddCharacteristic(0x2A30, "Position 3D");
     attributes.AddCharacteristic(0x2A69, "Position Quality");
     attributes.AddCharacteristic(0x2A6D, "Pressure");
     attributes.AddCharacteristic(0x2A4E, "Protocol Mode");
     attributes.AddCharacteristic(0x2A62, "Pulse Oximetry Control Point");
     attributes.AddCharacteristic(0x2A60, "Pulse Oximetry Pulsatile Event Characteristic");
     attributes.AddCharacteristic(0x2A78, "Rainfall");
     attributes.AddCharacteristic(0x2A03, "Reconnection Address");
     attributes.AddCharacteristic(0x2A52, "Record Access Control Point");
     attributes.AddCharacteristic(0x2A14, "Reference Time Information");
     attributes.AddCharacteristic(0x2A3A, "Removable");
     attributes.AddCharacteristic(0x2A4D, "Report");
     attributes.AddCharacteristic(0x2A4B, "Report Map");
     attributes.AddCharacteristic(0x2AC9, "Resolvable Private Address Only");
     attributes.AddCharacteristic(0x2A92, "Resting Heart Rate");
     attributes.AddCharacteristic(0x2A40, "Ringer Control point");
     attributes.AddCharacteristic(0x2A41, "Ringer Setting");
     attributes.AddCharacteristic(0x2AD1, "Rower Data");
     attributes.AddCharacteristic(0x2A54, "RSC Feature");
     attributes.AddCharacteristic(0x2A53, "RSC Measurement");
     attributes.AddCharacteristic(0x2A55, "SC Control Point");
     attributes.AddCharacteristic(0x2A4F, "Scan Interval Window");
     attributes.AddCharacteristic(0x2A31, "Scan Refresh");
     attributes.AddCharacteristic(0x2A3C, "Scientific Temperature Celsius");
     attributes.AddCharacteristic(0x2A10, "Secondary Time Zone");
     attributes.AddCharacteristic(0x2A5D, "Sensor Location");
     attributes.AddCharacteristic(0x2A25, "Serial Number String");
     attributes.AddCharacteristic(0x2A05, "Service Changed");
     attributes.AddCharacteristic(0x2A3B, "Service Required");
     attributes.AddCharacteristic(0x2A28, "Software Revision String");
     attributes.AddCharacteristic(0x2A93, "Sport Type for Aerobic and Anaerobic Thresholds");
     attributes.AddCharacteristic(0x2AD0, "Stair Climber Data");
     attributes.AddCharacteristic(0x2ACF, "Step Climber Data");
     attributes.AddCharacteristic(0x2A3D, "String");
     attributes.AddCharacteristic(0x2AD7, "Supported Heart Rate Range");
     attributes.AddCharacteristic(0x2AD5, "Supported Inclination Range");
     attributes.AddCharacteristic(0x2A47, "Supported New Alert Category");
     attributes.AddCharacteristic(0x2AD8, "Supported Power Range");
     attributes.AddCharacteristic(0x2AD6, "Supported Resistance Level Range");
     attributes.AddCharacteristic(0x2AD4, "Supported Speed Range");
     attributes.AddCharacteristic(0x2A48, "Supported Unread Alert Category");
     attributes.AddCharacteristic(0x2A23, "System ID");
     attributes.AddCharacteristic(0x2ABC, "TDS Control Point");
     attributes.AddCharacteristic(0x2A6E, "Temperature");
     attributes.AddCharacteristic(0x2A1F, "Temperature Celsius");
     attributes.AddCharacteristic(0x2A20, "Temperature Fahrenheit");
     attributes.AddCharacteristic(0x2A1C, "Temperature Measurement");
     attributes.AddCharacteristic(0x2A1D, "Temperature Type");
     attributes.AddCharacteristic(0x2A94, "Three Zone Heart Rate Limits");
     attributes.AddCharacteristic(0x2A12, "Time Accuracy");
     attributes.AddCharacteristic(0x2A15, "Time Broadcast");
     attributes.AddCharacteristic(0x2A13, "Time Source");
     attributes.AddCharacteristic(0x2A16, "Time Update Control Point");
     attributes.AddCharacteristic(0x2A17, "Time Update State");
     attributes.AddCharacteristic(0x2A11, "Time with DST");
     attributes.AddCharacteristic(0x2A0E, "Time Zone");
     attributes.AddCharacteristic(0x2AD3, "Training Status");
     attributes.AddCharacteristic(0x2ACD, "Treadmill Data");
     attributes.AddCharacteristic(0x2A71, "True Wind Direction");
     attributes.AddCharacteristic(0x2A70, "True Wind Speed");
     attributes.AddCharacteristic(0x2A95, "Two Zone Heart Rate Limit");
     attributes.AddCharacteristic(0x2A07, "Tx Power Level");
     attributes.AddCharacteristic(0x2AB4, "Uncertainty");
     attributes.AddCharacteristic(0x2A45, "Unread Alert Status");
     attributes.AddCharacteristic(0x2AB6, "URI");
     attributes.AddCharacteristic(0x2A9F, "User Control Point");
     attributes.AddCharacteristic(0x2A9A, "User Index");
     attributes.AddCharacteristic(0x2A76, "UV Index");
     attributes.AddCharacteristic(0x2A96, "VO2 Max");
     attributes.AddCharacteristic(0x2A97, "Waist Circumference");
     attributes.AddCharacteristic(0x2A98, "Weight");
     attributes.AddCharacteristic(0x2A9D, "Weight Measurement");
     attributes.AddCharacteristic(0x2A9E, "Weight Scale Feature");
     attributes.AddCharacteristic(0x2A79, "Wind Chill");
 }
        private async void Button_Clicked_1(object sender, EventArgs e)
        {
            var connection = await ble.ConnectToDevice(
                // The IBlePeripheral to connect to
                blePeripherals[0],
                // TimeSpan or CancellationToken to stop the
                // connection attempt.
                // If you omit this argument, it will use
                // BluetoothLowEnergyUtils.DefaultConnectionTimeout
                TimeSpan.FromSeconds(15),
                // Optional IProgress<ConnectionProgress>
                progress => Debug.WriteLine(progress)
                );

            /*
             * Connect to a specific device without manually scanning
             * In use-cases where you are not scanning for advertisements but rather looking to connect to a specific, known, device:
             */
            //var connection = await ble.FindAndConnectToDevice(
            //   new ScanFilter()
            //      .SetAdvertisedDeviceName("foo")
            //      .SetAdvertisedManufacturerCompanyId(0xffff)
            //      .AddAdvertisedService(guid),
            //   TimeSpan.FromSeconds(30));

            if (connection.IsSuccessful())
            {
                var gattServer = connection.GattServer;
                // ... do things with gattServer here... (see later examples...)

                /*
                 * See & Observe server connection Status
                 */
                Debug.WriteLine(gattServer.State); // e.g. ConnectionState.Connected
                                                   // the server implements IObservable<ConnectionState> so you can subscribe to its state
                gattServer.Subscribe(state =>
                {
                    if (state == ConnectionState.Disconnected)
                    {
                        Debug.WriteLine("Connection Lost");
                    }
                });

                var known = new KnownAttributes();

                foreach (var guid in await gattServer.ListAllServices())
                {
                    Debug.WriteLine($"service: {known.GetDescriptionOrGuid(guid)}");
                }

                //Debug.WriteLine($"service: {serviceGuid}");
                //foreach (var guid in await gattServer.ListServiceCharacteristics(serviceGuid))
                //{
                //    Debug.WriteLine($"characteristic: {known.GetDescriptionOrGuid(guid)}");
                //}

                //Be sure to disconnect when you are done:
                await gattServer.Disconnect();
            }
            else
            {
                // Do something to inform user or otherwise handle unsuccessful connection.
                Debug.WriteLine("Error connecting to device. result={0:g}", connection.ConnectionResult);
                // e.g., "Error connecting to device. result=ConnectionAttemptCancelled"
            }
        }