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)); }
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); }
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)); }