Send the command to switch from SWD to jtag
559512
def _jtag_to_swd(self):
        
        data = [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]
        self._protocol.swj_sequence(data)

        data = [0x9e, 0xe7]
        self._protocol.swj_sequence(data)

        data = [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]
        self._protocol.swj_sequence(data)

        data = [0x00]
        self._protocol.swj_sequence(data)
1285081
def send(self, targetPath, parent, diff, showProgress=True, allowDryRun=True):
        
        if parent is not None:
            cmd = ["btrfs", "send", "-p", parent, targetPath]
        else:
            cmd = ["btrfs", "send", targetPath]

        if Store.skipDryRun(logger, self.dryrun and allowDryRun)("Command: %s", cmd):
            return None

        process = subprocess.Popen(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=DEVNULL)
        _makeNice(process)

        return _Reader(process, process.stdout, targetPath, diff, showProgress)
929100
@Override
	public void sendKeys(CharSequence keysToSend) throws WidgetException {
		try {
			  Actions builder = new Actions(getGUIDriver().getWrappedDriver());
		        synchronized (InteractiveElement.class) {
		            getGUIDriver().focus();
		            builder.sendKeys(getWebElement(), keysToSend).build().perform();
		        }
		} catch (Exception e) {
			throw new WidgetException("Error while sending keys", getByLocator(),
					e);
		}

	}
368498
public void setSplitTransition(Transition transition) {
        if (split == null) {
            if (transition != null) {
                setSplitHref("#");
            } else {
                return;
            }
        }
        if (split != null) JQMCommon.setTransition(split, transition);
    }
1363949
def connect(self, protocol=None):
        """"""
        # Convert protocol to port enum.
        if protocol is not None:
            port = self.PORT_MAP[protocol]
        else:
            port = DAPAccess.PORT.DEFAULT
        
        try:
            self._link.connect(port)
        except DAPAccess.Error as exc:
            six.raise_from(self._convert_exception(exc), exc)
        
        # Read the current mode and save it.
        actualMode = self._link.get_swj_mode()
        self._protocol = self.PORT_MAP[actualMode]
        
        self._invalidate_cached_registers()
243023
def send_keys(self, keysToSend):
        
        if self.driver.w3c:
            self.driver.execute(Command.W3C_SET_ALERT_VALUE, {'value': keys_to_typing(keysToSend),
                                                              'text': keysToSend})
        else:
            self.driver.execute(Command.SET_ALERT_VALUE, {'text': keysToSend})
1286205
def switch(self, idx, u):
        """"""
        self.u[self.uid[idx]] = u
        self.rebuild = True
        self.system.dae.factorize = True
        logger.debug('<Line> Status switch to {} on idx {}.'.format(u, idx))
1287012
protected void sendExit2(final OtpErlangPid from, final OtpErlangPid dest,
            final OtpErlangObject reason) throws IOException {
        sendExit(exit2Tag, from, dest, reason);
    }
969817
def flexifunction_command_ack_send(self, command_type, result, force_mavlink1=False):
                '''
                

                '''
                return self.send(self.flexifunction_command_ack_encode(command_type, result), force_mavlink1=force_mavlink1)
921137
def send_command(self, *args, **kwargs):
        
        if len(args) >= 1:
            command_string = args[0]
        else:
            command_string = kwargs["command_string"]

        # If changeto in command, look for '#' to determine command is done
        if "changeto" in command_string:
            if len(args) <= 1:
                expect_string = kwargs.get("expect_string", "#")
                kwargs["expect_string"] = expect_string
        output = super(CiscoAsaSSH, self).send_command(*args, **kwargs)

        if "changeto" in command_string:
            self.set_base_prompt()

        return output
523299
public static void postAction (Component source, String command)
    {
        // slip things onto the event queue for later
        ActionEvent event = new ActionEvent(source, 0, command);
        EventQueue.invokeLater(new ActionInvoker(event));
    }
100518
function send_commands(cmds, cb) {
        function callback(value) {
            if (cb) cb(value)
            this.locked = false
        }
        function run() { 
            if (this.locked = cmds.length > 0) send_command(cmds.shift(), (success) => {
                if (success) setTimeout(run, 200);
                else callback(false);
            });
            else callback(true); 
        };
        if(!this.locked) run();
    }
1248361
function _sendToPanel (win, panelID, message, ...args) {
  if ( typeof message !== 'string' ) {
    console.error(`The message "${message}" sent to panel "${panelID}" must be a string`);
    return;
  }

  let opts = ipcPlus.internal._popReplyAndTimeout(args);
  if ( !opts ) {
    args = [`${ipcPlus.id}:main2panel`, panelID, message, ...args];
    if ( win.webContents.send.apply(win.webContents, args) === false ) {
      console.error(`Failed to send message "${message}" to panel "${panelID}", no response received.`);
    }
    return;
  }

  let sessionId = ipcPlus.internal._newSession(message, `${panelID}@main`, opts.reply, opts.timeout, this);

  //
  args = [`${ipcPlus.id}:main2panel`, panelID, message, ...args, ipcPlus.option({
    sessionId: sessionId,
    waitForReply: true,
    timeout: opts.timeout, // this is only used as debug info
  })];
  win.webContents.send.apply(win.webContents, args);

  return sessionId;
}
1174405
def connect(self, protocol=None):
        """"""
        self._link.enter_debug(STLink.Protocol.SWD)
        self._is_connected = True
619069
def send_command(command)
      SerialPort.open(self.device_path, 9600, 8, 1) do |port|
        # flush anything existing on the port
        port.flush
        flush_read_buffer(port)

        byte_string = command.to_bytes.pack('C*')

        begin
          while byte_string && byte_string.length != 0
            count = port.write_nonblock(byte_string)
            byte_string = byte_string[count,-1]

            port.flush
          end
        rescue IO::WaitWritable
          if IO.select([], [port], [], 5)
            retry
          else
            raise IOError, "Timeout writing command to #{self.device_path}"
          end
        end

        # wait for expected confirmation signals
        got_eot = false
        got_soh = false
        loop do
          begin
            c = port.read_nonblock(1)

            case c
              when "\x04"
                if ! got_eot
                  got_eot = true
                else
                  raise IOError, "Got EOT reply twice from #{self.device_path}"
                end
              when "\x01"
                if got_eot
                  if ! got_soh
                    got_soh = true

                    break
                  else
                    raise IOError, "Got SOH twice from #{self.device_path}"
                  end
                else
                  raise IOError, "Got SOH before EOT from #{self.device_path}"
                end
            end
          rescue IO::WaitReadable
            if IO.select([port], [], [], 3)
              retry
            else
              raise IOError, "Timeout waiting for command reply from #{self.device_path}.  EOT:#{got_eot} SOH:#{got_soh}"
            end
          end
        end
      end

      self
    end
291583
@CliCommand(value = "send drools start", help = "start send to drools action")
    public String sendToDroolsStart(
            @CliOption(key = {"stream"}, help = "The stream name", mandatory = true, optionContext = "stream") final
            String streamName,
            @CliOption(key = {"group"}, help = "Drools Group Configuration", mandatory = true, optionContext = "group")
            final String groupName,
            @CliOption(key = {"output_stream"}, help = "CEP Stream to insert the results", mandatory = false) final
            String outputStream,
            @CliOption(key = {"kafkaTopic"}, help = "Name of a Kafka Topic to insert the results", mandatory = false)
            final
            String kafkaTopic ) {
        try {
            ssaw.api().startSendToDrools(streamName, groupName, outputStream, kafkaTopic);
            return "Stream ".concat(streamName).concat(" attached to drools correctly");
        } catch (StratioStreamingException e) {
            throw new StreamingShellException(e);
        }
    }
148034
async def send_cmd(self, cmd, loop=None):
        """"""
        _LOGGER.info("Send cmd = %s", cmd)

        if cmd not in COMMANDS and cmd not in range(0, 999):
            _LOGGER.error("Unknown command")
            raise PyMediaroomError("Unknown commands")

        keys = []
        if cmd in range(0, 999):
            for character in str(cmd):
                keys.append(COMMANDS["Number"+str(character)])
            if len(keys) < 3:
                keys.append(COMMANDS["OK"])
            self.current_channel = cmd
        else:
            keys = [COMMANDS[cmd]]

        try:
            async with timeout(OPEN_CONTROL_TIMEOUT, loop=loop):
                async with self.lock:
                    _LOGGER.debug("Connecting to %s:%s", self.stb_ip, REMOTE_CONTROL_PORT)
                    stb_recv, stb_send = await asyncio.open_connection(self.stb_ip,
                                                                       REMOTE_CONTROL_PORT,
                                                                       loop=loop)
                    await stb_recv.read(6)
                    _LOGGER.info("Connected to %s:%s", self.stb_ip, REMOTE_CONTROL_PORT)

                    for key in keys:
                        _LOGGER.debug("%s key=%s", cmd, key)
                        stb_send.write("key={}\n".format(key).encode('UTF-8'))
                        _ = await stb_recv.read(3)
                        await asyncio.sleep(0.300)

        except asyncio.TimeoutError as error:
            _LOGGER.warning(error)
            raise PyMediaroomError("Timeout connecting to {}".format(self.stb_ip))
        except ConnectionRefusedError as error:
            _LOGGER.warning(error)
            raise PyMediaroomError("Connection refused to {}".format(self.stb_ip))