Exemplo n.º 1
0
        private async Task UpdateImpulsDataAsync(IImpulsDeviceDataRepository repository, VegaDevice device)
        {
            var lastUpdateTime = await repository
                                 .GetUptimeAsync(device.Id, _cancellationToken)
                                 .ConfigureAwait(false);

            var vegaServerLoadedData = await communicator
                                       .GetImpulsDeviceDataAsync(device.Eui, device.Id, lastUpdateTime, _cancellationToken)
                                       .ConfigureAwait(false);

            await repository
            .AddAsync(vegaServerLoadedData, _cancellationToken)
            .ConfigureAwait(false);
        }
Exemplo n.º 2
0
 public async Task <IEnumerable <VegaImpulsDeviceData> > GetAsync(string id)
 {
     return(await _communiactor.
            GetImpulsDeviceDataAsync(id, 0, DateTimeOffset.FromUnixTimeMilliseconds(0)).
            ConfigureAwait(false));
 }