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)
def reset(self): void = VoidMessage() return self.stub.reset(void, timeout=PulseStreamer.TIMEOUT)
def getUnderflow(self): void = VoidMessage() return self.stub.getUnderflow(void, timeout=PulseStreamer.TIMEOUT).value
def getDebugRegister(self): void = VoidMessage() return self.stub.getDebugRegister( void, timeout=PulseStreamer.PulseStreamer.TIMEOUT).value
def getNetworkConf(self): void = VoidMessage() return self.stub.getNetworkConf( void, timeout=PulseStreamer.TIMEOUT).string_value
def testNetworkConf(self): void = VoidMessage() return self.stub.testNetworkConf(void, timeout=PulseStreamer.TIMEOUT).value
def getFirmwareVersion(self): void = VoidMessage() return self.stub.getFirmwareVersion( void, timeout=PulseStreamer.TIMEOUT).string_value
def flash_lic(self): void = VoidMessage() return self.stub.flash_lic(void, timeout=PulseStreamer.TIMEOUT).string_value
def startNow(self): void = VoidMessage() return self.stub.startNow(void, timeout=PulseStreamer.TIMEOUT).value
def hasFinished(self): void = VoidMessage() return self.stub.hasFinished(void, timeout=PulseStreamer.TIMEOUT).value
def hasSequence(self): void = VoidMessage() return self.stub.hasSequence(void, timeout=PulseStreamer.TIMEOUT).value
def isStreaming(self): void = VoidMessage() return self.stub.isStreaming(void, timeout=PulseStreamer.TIMEOUT).value
def forceFinal(self): void = VoidMessage() self.stub.forceFinal(void, timeout=PulseStreamer.TIMEOUT)