spidr4.rpc

This module contains all protocol buffer and gRPC stub. Unfortunately we can’t actually generate API documentation in Python for it.

Please look at gRPC interface reference.

All protobuf members are module level fields. For example the message ChipIndex can be found as spidr4.rpc.ChipIndex.

which you can then instantiate as follows:

from spidr4.rpc import ChipIndex
chipIndex = ChipIndex(idx=1)

To actually instantiate a service, more needs to be done. First a channel needs to be created which acts as a link between the server and client. Then a stub from a service needs instantiated and bound to that channel. In the next example we get the ControlInfo ControlInfo service, and bind it to the remote side using a channel. From that we request the version (a Version) message and print its contents.

import grpc
from spidr4.rpc import ControlInfoStub, EMPTY

with grpc.insecure_channel("192.168.1.10:50051") as channel:
    control = ControlInfoStub(channel)
    version = control.GetVersion(EMPTY)
    print(version)

Please see the examples to get to know the gRPC API more.