コード例 #1
0
    def __init__(self, ip_hostname='pulsestreamer'):
        print("Connect to Pulse Streamer via google-RPC.")
        print("IP / Hostname:", ip_hostname)

        self.INFINITE = -1
        self.CONSTANT_ZERO = (0, 0, 0, 0)

        try:
            channel = insecure_channel(ip_hostname + ':50051')
            self.stub = PulseStreamerStub(channel)
            try:
                g = GetSerialMessage()
                g.serial = getattr(GetSerialMessage, Serial.MAC.name)
                self.stub.getSerial(g, timeout=PulseStreamer.TIMEOUT)
            except:
                try:
                    void = VoidMessage()
                    self.stub.isRunning(void, timeout=PulseStreamer.TIMEOUT)
                    print(
                        "Pulse Streamer class not compatible with current firmware. Please update your firmware."
                    )
                    sys.exit(1)
                except:
                    print("No Pulse Streamer found at IP/Host-address: " +
                          ip_hostname)
                    sys.exit(1)
        except:
            print("No Pulse Streamer found at IP/Host-address: " + ip_hostname)
            sys.exit(1)
コード例 #2
0
 def reset(self):
     void = VoidMessage()
     return self.stub.reset(void, timeout=PulseStreamer.TIMEOUT)
コード例 #3
0
 def getUnderflow(self):
     void = VoidMessage()
     return self.stub.getUnderflow(void,
                                   timeout=PulseStreamer.TIMEOUT).value
コード例 #4
0
 def getDebugRegister(self):
     void = VoidMessage()
     return self.stub.getDebugRegister(
         void, timeout=PulseStreamer.PulseStreamer.TIMEOUT).value
コード例 #5
0
 def getNetworkConf(self):
     void = VoidMessage()
     return self.stub.getNetworkConf(
         void, timeout=PulseStreamer.TIMEOUT).string_value
コード例 #6
0
 def testNetworkConf(self):
     void = VoidMessage()
     return self.stub.testNetworkConf(void,
                                      timeout=PulseStreamer.TIMEOUT).value
コード例 #7
0
 def getFirmwareVersion(self):
     void = VoidMessage()
     return self.stub.getFirmwareVersion(
         void, timeout=PulseStreamer.TIMEOUT).string_value
コード例 #8
0
 def flash_lic(self):
     void = VoidMessage()
     return self.stub.flash_lic(void,
                                timeout=PulseStreamer.TIMEOUT).string_value
コード例 #9
0
 def startNow(self):
     void = VoidMessage()
     return self.stub.startNow(void, timeout=PulseStreamer.TIMEOUT).value
コード例 #10
0
 def hasFinished(self):
     void = VoidMessage()
     return self.stub.hasFinished(void, timeout=PulseStreamer.TIMEOUT).value
コード例 #11
0
 def hasSequence(self):
     void = VoidMessage()
     return self.stub.hasSequence(void, timeout=PulseStreamer.TIMEOUT).value
コード例 #12
0
 def isStreaming(self):
     void = VoidMessage()
     return self.stub.isStreaming(void, timeout=PulseStreamer.TIMEOUT).value
コード例 #13
0
 def forceFinal(self):
     void = VoidMessage()
     self.stub.forceFinal(void, timeout=PulseStreamer.TIMEOUT)