Example #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));
        }
Example #2
0
        public async Task <IGattService> AddService(string uuid, bool primary, Action <IGattServiceBuilder> serviceBuilder)
        {
            var sb = new GattService(uuid);

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

            this.services.Add(uuid, sb);

            return(sb);
        }