Example #1
0
        private void SendDeleteMeasurementRequest(Gateway gateway, KellerDevice device)
        {
            var uriBuilder = new UriBuilder("", gateway.GatewayIp, gateway.GatewayPort, ApiUrl);
            var channel    = new Channel(uriBuilder.ToString(), ChannelCredentials.Insecure);

            var client  = new Kiwi.Api.MeasurementService.MeasurementServiceClient(channel);
            var request = new DeleteMeasurementsRequest {
                DevEui = device.EUI
            };

            client.Delete(request);
            channel.ShutdownAsync().Wait();
        }
Example #2
0
        private GetMeasurementsResponse SendGetMeasurementRequest(Gateway gateway, KellerDevice device)
        {
            var uriBuilder = new UriBuilder("", gateway.GatewayIp, gateway.GatewayPort, ApiUrl);
            var channel    = new Channel(uriBuilder.ToString(), ChannelCredentials.Insecure);

            var client  = new Kiwi.Api.MeasurementService.MeasurementServiceClient(channel);
            var request = new GetMeasurementsRequest {
                DevEui = device.EUI
            };
            var reply = client.Get(request);

            channel.ShutdownAsync().Wait();
            return(reply);
        }