Beispiel #1
0
        public static void AddPackagesFromManufacturerSection(IBluetoothAdvertisementPackage eventArgs, IBluetoothBeacon beaconDevice)
        {
            var manufacturerSections = eventArgs.Advertisement.ManufacturerData;

            foreach (var manufacture in manufacturerSections)
            {
                var array = manufacture.Data.ToArray();

                try
                {
                    var package = PackageFactory.CreatePackageFromManufacturerPayload(array);
                    beaconDevice.AddPackage(package);
                }
                catch (PackageException e)
                {
                }
            }
        }
Beispiel #2
0
        public static void AddPackagesFromDataSection(IBluetoothAdvertisementPackage eventArgs, IBluetoothBeacon beaconDevice)
        {
            var dataSections = eventArgs.Advertisement.DataSections;

            foreach (var data in dataSections)
            {
                var array = data.Data.ToArray();

                try
                {
                    var package = PackageFactory.CreatePackageFromDataPayload(array);
                    beaconDevice.AddPackage(package);
                }
                catch (PackageException e)
                {
                }
            }
        }