示例#1
0
    def stop_sensor_command(self, client):
        """ Return server response from Sensor request. """
        u_sensor_type = u"{}".format(self.type)
        response = client.request(
            messaging.StreamDataCommand(u_sensor_type, self.sensor_id, self.client_ip, self.port_number, u'tcp',
                                        1, packet_size=self.packet_size, dropFrames=self.drop_frames),
            timeout=2)

        return response
示例#2
0
 def start_sensor_command(self, client):
     """ Return server response from Sensor request. """
     logging.getLogger("sensor").debug('Request sensor stream {0}'.format(self.type))
     u_sensor_type = u"{}".format(self.type)
     msg_cls = messaging.StreamDataCommand(u_sensor_type, self.sensor_id, self.client_ip,
                                           self.port_number, u'tcp', 0, packet_size=self.packet_size)
     response = self.request_sensor_stream(client, msg_cls)
     logging.getLogger("sensor").debug("Sensor:" + str(self.name) + " Response:" + str(response))
     return response
示例#3
0
    def start_sensor_command(self, client):
        """ Return server response from Sensor request. """
        u_sensor_type = u"{}".format(self.type)
        msg_cls = messaging.StreamDataCommand(u_sensor_type,
                                              self.sensor_id,
                                              self.client_ip,
                                              self.port_number,
                                              u'tcp',
                                              0,
                                              packet_size=self.packet_size)
        response = self.request_sensor_stream(client, msg_cls)

        return response
示例#4
0
 def start_sensor_command(self, sensor_type, display_port, sensor_id,
                          packet_size, drop_frames):
     """ Return server response from Sensor request. """
     u_sensor_type = u"{}".format(sensor_type)
     response = self.request_sensor_stream(
         messaging.StreamDataCommand(u_sensor_type,
                                     sensor_id,
                                     self.configuration.client_ip,
                                     display_port,
                                     u'tcp',
                                     0,
                                     packet_size=packet_size,
                                     dropFrames=drop_frames))
     return response