Exemplo n.º 1
0
def run():
    with grpc.insecure_channel("localhost:50000") as channel:
        stub = easydriver_pb2_grpc.EasyDriverServiceStub(channel)
        print("-------------- GetStatus --------------")
        print(get_status(stub))

        stub.Enable(easydriver_pb2.EmptyRequest())
        stub.Wake(easydriver_pb2.EmptyRequest())

        stub.SetFullStep(easydriver_pb2.EmptyRequest())
        do_step_loop(stub)

        stub.SetHalfStep(easydriver_pb2.EmptyRequest())
        do_step_loop(stub)

        stub.SetQuarterStep(easydriver_pb2.EmptyRequest())
        do_step_loop(stub)

        stub.SetEighthStep(easydriver_pb2.EmptyRequest())
        do_step_loop(stub)

        stub.SetSixteenthStep(easydriver_pb2.EmptyRequest())
        do_step_loop(stub)

        stub.Sleep(easydriver_pb2.EmptyRequest())
        stub.Disable(easydriver_pb2.EmptyRequest())
Exemplo n.º 2
0
 def set_sixteenth_step(self):
     with grpc.insecure_channel(self.service_address) as channel:
         stub = easydriver_pb2_grpc.EasyDriverServiceStub(channel)
         return stub.SetSixteenthStep(easydriver_pb2.EmptyRequest())
Exemplo n.º 3
0
 def status(self):
     with grpc.insecure_channel(self.service_address) as channel:
         stub = easydriver_pb2_grpc.EasyDriverServiceStub(channel)
         return stub.GetStatus(easydriver_pb2.EmptyRequest())
Exemplo n.º 4
0
 def step_reverse(self):
     with grpc.insecure_channel(self.service_address) as channel:
         stub = easydriver_pb2_grpc.EasyDriverServiceStub(channel)
         return stub.StepReverse(easydriver_pb2.EmptyRequest())