All pastes #835043 Raw Edit

Unnamed

public text v1 · immutable
#835043 ·published 2007-12-28 17:30 UTC
rendered paste body
int recovery_cmd(string *args, struct shell_state *sh)
{
	
	if ( args[1] == "" )
	{
		ifNotQuiet cout << "Please provide a command to send to the phone." << endl;
		return SHELL_CONTINUE;
	}

        string cmd = "";
        for (int i=1; args[i] != ""; i++) {
            cmd += args[i];
            if (args[i + 1] != "") {
               cmd += " ";
            }
        }
	
	mach_error_t retval = sendCommandToDevice(	sh->recovery_dev,
							CFStringCreateWithCString(NULL, cmd.c_str(), kCFStringEncodingASCII) );
	
	ifVerbose cout	<< "cmd: " << cmd << ": " << retval << endl; 
	
	return SHELL_CONTINUE;
}