Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            try {
                var grpcClient = new GrpcClient();
                grpcClient.Connect(CA_FILE, SERVER_ADDR, SERVER_PORT);

                var quickStart = new QuickStart(grpcClient);

                var devID = quickStart.TestConnect();

                quickStart.TestDevice(devID);

                new FingerTest(quickStart.fingerSvc).Test(devID);
                new CardTest(quickStart.cardSvc).Test(devID);

                new UserTest(quickStart.userSvc, quickStart.fingerSvc).Test(devID);

                new EventTest(quickStart.eventSvc).Test(devID);

                uint[] deviceIDs = { devID };
                quickStart.connectSvc.Disconnect(deviceIDs);
                grpcClient.Close();
            } catch (RpcException e) {
                Console.WriteLine("gRPC Error: {0}", e);
            }
        }
Exemplo n.º 2
0
        public QuickStart(GrpcClient client)
        {
            grpcClient = client;

            connectSvc = new ConnectSvc(grpcClient.GetChannel());
            deviceSvc  = new DeviceSvc(grpcClient.GetChannel());
            userSvc    = new UserSvc(grpcClient.GetChannel());
            fingerSvc  = new FingerSvc(grpcClient.GetChannel());
            cardSvc    = new CardSvc(grpcClient.GetChannel());
            eventSvc   = new EventSvc(grpcClient.GetChannel());
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            var grpcClient = new GrpcClient();

            grpcClient.Connect(CA_FILE, SERVER_ADDR, SERVER_PORT);

            var connectTest = new ConnectTest(grpcClient);

            var tokenSource = connectTest.SubscribeDeviceStatus();

            MainMenu mainMenu = new MainMenu(connectTest.GetConnectSvc());

            mainMenu.Show();

            tokenSource.Cancel();
            grpcClient.Close();
        }
Exemplo n.º 4
0
        public ConnectTest(GrpcClient client)
        {
            grpcClient = client;

            connectSvc = new ConnectSvc(grpcClient.GetChannel());
        }