Prevent this device from receiving more RPCs
197349
def _disable_rpcs(self, conn, services, timeout=1.0):
        

        success, result = self._set_notification(conn, services[TileBusService]['characteristics'][TileBusReceiveHeaderCharacteristic], False, timeout)
        if not success:
            return success, result

        return self._set_notification(conn, services[TileBusService]['characteristics'][TileBusReceivePayloadCharacteristic], False, timeout)
1011624
def _dispatch_rpc(self, address, rpc_id, arg_payload):
        """"""

        if self.emulator.is_tile_busy(address):
            self._track_change('device.rpc_busy_response', (address, rpc_id, arg_payload, None, None), formatter=format_rpc)
            raise BusyRPCResponse()

        try:
            # Send the RPC immediately and wait for the response
            resp = super(EmulatedDevice, self).call_rpc(address, rpc_id, arg_payload)
            self._track_change('device.rpc_sent', (address, rpc_id, arg_payload, resp, None), formatter=format_rpc)

            return resp
        except AsynchronousRPCResponse:
            self._track_change('device.rpc_started', (address, rpc_id, arg_payload, None, None), formatter=format_rpc)
            raise
        except Exception as exc:
            self._track_change('device.rpc_exception', (address, rpc_id, arg_payload, None, exc), formatter=format_rpc)
            raise
618699
def _mds_rpc_post(self, device_id, _wrap_with_consumer=True, async_id=None, **params):
        """"""
        self.ensure_notifications_thread()
        api = self._get_api(mds.DeviceRequestsApi)
        async_id = async_id or utils.new_async_id()
        device_request = mds.DeviceRequest(**params)
        api.create_async_request(
            device_id,
            async_id=async_id,
            body=device_request,
        )
        return AsyncConsumer(async_id, self._db) if _wrap_with_consumer else async_id
1201560
def cli(env, identifier):
    """"""

    mgr = SoftLayer.HardwareManager(env.client)
    hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware')
    if not (env.skip_confirmations or
            formatting.confirm('This will power off the server with id %s and '
                               'reflash device firmware. Continue?' % hw_id)):
        raise exceptions.CLIAbort('Aborted.')

    mgr.reflash_firmware(hw_id)
714040
public synchronized void stop() {
        if (isRunning()) {
            try {
                setSendingStatus(false);
            } catch (Throwable t) {
                logger.error("Problem stopping sending status during shutdown", t);
            }
            DeviceFinder.getInstance().removeIgnoredAddress(socket.get().getLocalAddress());
            socket.get().close();
            socket.set(null);
            broadcastAddress.set(null);
            updates.clear();
            setTempoMaster(null);
            setDeviceNumber((byte)0);  // Set up for self-assignment if restarted.
            deliverLifecycleAnnouncement(logger, false);
        }
    }
1076576
def rpc_stop(server_state):
    
    rpc_srv = server_state['rpc']

    if rpc_srv is not None:
        log.info("Shutting down RPC")
        rpc_srv.stop_server()
        rpc_srv.join()
        log.info("RPC joined")

    else:
        log.info("RPC already joined")

    server_state['rpc'] = None
326945
def _disconnect_hanging_devices(self):
        """"""

        now = monotonic()
        for uuid, data in self._connections.items():
            if (now - data['last_touch']) > self.client_timeout:
                self._logger.info("Disconnect inactive client %s from device 0x%X", data['client'], uuid)
                self._loop.add_callback(self._disconnect_from_device, uuid, data['key'], data['client'], unsolicited=True)
352129
def stop_consuming(self):
        """"""
        if self._channel:
            logger.debug('Sending a Basic.Cancel RPC command to RabbitMQ')
            self._channel.basic_cancel(self.on_cancelok, self._consumer_tag)
85523
def _send_rpc(self, device_info, control_info, address, rpc_id, payload, poll_interval, timeout):
        """"""

        write_address, write_data = control_info.format_rpc(address, rpc_id, payload)
        self._jlink.memory_write32(write_address, write_data)

        self._trigger_rpc(device_info)

        start = monotonic()
        now = start

        poll_address, poll_mask = control_info.poll_info()

        while (now - start) < timeout:
            time.sleep(poll_interval)
            value, = self._jlink.memory_read8(poll_address, 1)

            if value & poll_mask:
                break

            now = monotonic()

        if (now - start) >= timeout:
            raise HardwareError("Timeout waiting for RPC response", timeout=timeout, poll_interval=poll_interval)

        read_address, read_length = control_info.response_info()
        read_data = self._read_memory(read_address, read_length, join=True)

        return control_info.format_response(read_data)
856654
def stop_consuming(self):
        
        if self._channel:
            _logger.debug('Sending a Basic.Cancel RPC command to RabbitMQ')
            self._channel.basic_cancel(self.on_cancelok, self._consumer_tag)
533709
function(r) {
    if (!seenConnectionBanner) {
      self.emit('connected', r);
      seenConnectionBanner = true;
      deferredSetup.resolve(r);
      return;
    }

    if (r.hasOwnProperty("rx") && self.serialPortData === null) {
      self.ignoredResponses--;
      if (!self.timedSendsOnly) {
        self.linesRequested = r.rx - 1;
      }
      // -1 is okay, that just means wait until we've sent two lines to send again
    } else if (self.ignoredResponses > 0) {
      self.ignoredResponses--;
      return;
    } else {
        if (!self.timedSendsOnly) {
          self.linesRequested++;
        }
    }

    self._sendLines();
  }
311913
def commission
      response = nil
      begin
        unlock_network
        Timeout.timeout(30) do
          @logger.info("Listening for devices ...")
          loop do
            buffer = @serial.receive(4)
            buffer += @serial.receive(buffer.bytes.to_a[3]+1)
            if buffer.bytes.to_a[1] == 0xa0
              response = BroadcastResponse.read(buffer)
              @logger.info("Found device 0x%x on network 0x%x" % [response.device_id, response.network_id])
              break
            end
          end
        end
      rescue Timeout::Error
      ensure
        lock_network
      end

      update_time(response.network_id) if response
    end
750220
def stop_sync(self):
        """"""

        if self.scanning:
            self.stop_scan()

        # Make a copy since this will change size as we disconnect
        con_copy = copy.copy(self._connections)

        for _, context in con_copy.items():
            self.disconnect_sync(context['connection_id'])

        self._command_task.stop()
        self._stream.stop()
        self._serial_port.close()

        self.stopped = True
219499
def stop_consuming(self):
        
        if self._channel:
            self._logger.info('Sending a Basic.Cancel RPC command to RabbitMQ')
            self._channel.basic_cancel(self.on_cancelok, self._consumer_tag)
1313570
def stop(self):
        
        self.debug("()")
        # Not sure if this is necessary, but good form
        if self._is_running:
            for gpio in self.gpios:
                GPIO.remove_event_detect(gpio)
            # Cleanup - includes used numbering scheme
        GPIO.cleanup()
        # Leave audience
        try:
            self.changer.on_person_leave(self.people)
        except:
            self.exception("Failed to remove people from audience")
        super(GPIODetector, self).stop()
1115674
protected void stopRPC(boolean interruptClientHandlers)
      throws IOException, InterruptedException {
    // stop client handlers
    stopRPCInternal(server, "client", interruptClientHandlers);

    // stop datanode handlers
    stopRPCInternal(dnProtocolServer, "datanode", interruptClientHandlers);

    // waiting for the ongoing requests to complete
    stopWaitRPCInternal(server, "client");
    stopWaitRPCInternal(dnProtocolServer, "datanode");
  }
246560
def RPC(self, url, opname, obj, replytype=None, **kw):
        '''
        '''
        self.Send(url, opname, obj, **kw)
        return self.Receive(replytype, **kw)