public async Task <Beacon> CreateBeacon(BeaconBody beaconBody)
        {
            // create beacon
            Beacon newBeacon = new Beacon
            {
                Name       = beaconBody.Name,
                LocationId = beaconBody.LocationId,
                Lat        = beaconBody.Lat,
                Lng        = beaconBody.Lng
            };

            // save to database
            return(await beaconRepository.CreateAsync(newBeacon));
        }
        public async Task <Beacon> UpdateBeacon(int beaconId, BeaconBody beaconBody)
        {
            // create beacon
            Beacon updatedBeacon = new Beacon
            {
                Id         = beaconId,
                Name       = beaconBody.Name,
                LocationId = beaconBody.LocationId,
                Lat        = beaconBody.Lat,
                Lng        = beaconBody.Lng
            };

            // save to database
            return(await beaconRepository.UpdateAsync(updatedBeacon));
        }
예제 #3
0
        public RangerService(Context ctx)
        {
            _ctx      = ctx;
            telemetry = Telemetry.EmptyForUser("123");

            notif_manager = (NotificationManager)ctx.GetSystemService(Context.NotificationService);

            ranger = new RangerBuilder()
                     .AddFirstLineBeacon(BeaconBody.FromUUID(new Guid("EBEFD083-70A2-47C8-9837-E7B5634DF524")))
                     //.AddFirstLineBeacon(BeaconBody.FromUUID(new Guid("A07C5CA8-59EB-4EA8-9956-30B776E0FEDC")))
                     //.AddFirstLineBeacon(BeaconBody.FromMac("c9:18:b1:cf:9b:50"))
                     //.AddSecondLineBeacon(BeaconBody.FromUUID(new Guid("613037A8-D200-0400-FFFF-FFFFFFFFFFFF")))
                     .AddSecondLineBeacon(BeaconBody.FromUUID(new Guid("EBEFD083-70A2-47C8-9837-E7B5634DF599")))
                     //.AddSecondLineBeacon(BeaconBody.FromMac("DE:A6:78:08:52:A2"))
                     //.SetCalcSlideAverageCount(3)
                     //.SetAPointUid("B4B1DDB2-6941-40BE-AC8C-29F4E5043A8A")
                     .Build();

            ranger.OnEvent += RangereventHandler;
        }