コード例 #1
0
 def query(self, command):
     """To send a command that generates a reply, e.g. "InstrumentID.Value".
     Returns the reply"""
     from tcp_client import query
     reply = query(self.ip_address_and_port, command).strip("\n")
     debug("%s, reply %s" % (torepr(command), torepr(reply)))
     return reply
コード例 #2
0
 def query(self,command,terminator="\n",count=None):
     """Evaluate a command in the camera server and return the result.
     """
     from tcp_client import query
     reply = query(self.ip_address,command,terminator,count)
     return reply
コード例 #3
0
def send(ip_address_and_port, command):
    """Send a command that does not generate a reply.
    ip_address_and_port: e.g. '164.54.161.34:2001'
    command: string, will by '\n' terminated"""
    query(ip_address_and_port, command, count=0)
コード例 #4
0
 def query(self, command):
     """Send a command that generates a reply.
 Return the reply"""
     self.log("query %r" % command)
     from tcp_client import query
     return query(self.ip_address, command)