Exemple #1
0
        public Task <IGattService> AddService(Guid uuid, bool primary, Action <IGattServiceBuilder> serviceBuilder)
        {
            var service = new GattService(this.context, uuid, primary);

            serviceBuilder(service);
            this.context.Server.AddService(service.Native);
            return(Task.FromResult <IGattService>(service));
        }
Exemple #2
0
        public async Task <IGattService> AddService(Guid uuid, bool primary, Action <IGattServiceBuilder> serviceBuilder)
        {
            var sb = new GattService(uuid);

            serviceBuilder(sb);
            await sb.Build();

            this.services.Add(uuid, sb);

            return(sb);
        }
Exemple #3
0
        public Task <IGattService> AddService(Guid uuid, bool primary, Action <IGattServiceBuilder> serviceBuilder)
        {
            if (this.server == null)
            {
                this.server = this.context.CreateServer();
            }

            var service = new GattService(this.context, uuid, primary);

            serviceBuilder(service);
            this.services.Add(uuid, service);
            return(Task.FromResult <IGattService>(service));
        }