mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-19 13:54:23 +01:00
Refactored String methods and constructor on Process class.
This commit is contained in:
parent
4d1b7ecf5e
commit
6b4f745d9a
@ -66,22 +66,12 @@ void Process::doBuffer() {
|
||||
buffered = bridge.transfer(cmd, 3, buffer, sizeof(buffer));
|
||||
}
|
||||
|
||||
void Process::begin(String &command) {
|
||||
void Process::begin(const String &command) {
|
||||
close();
|
||||
cmdline = new String(command);
|
||||
}
|
||||
|
||||
void Process::begin(const char *command) {
|
||||
close();
|
||||
cmdline = new String(command);
|
||||
}
|
||||
|
||||
void Process::addParameter(const char *param) {
|
||||
*cmdline += "\xFE";
|
||||
*cmdline += param;
|
||||
}
|
||||
|
||||
void Process::addParameter(String ¶m) {
|
||||
void Process::addParameter(const String ¶m) {
|
||||
*cmdline += "\xFE";
|
||||
*cmdline += param;
|
||||
}
|
||||
|
@ -23,16 +23,13 @@
|
||||
|
||||
class Process : public Stream {
|
||||
public:
|
||||
// Default constructor uses global Bridge instance
|
||||
Process() : bridge(Bridge), started(false), buffered(0), readPos(0) { }
|
||||
// Constructor with a user provided BridgeClass instance
|
||||
Process(BridgeClass &_b) : bridge(_b), started(false), buffered(0), readPos(0) { }
|
||||
Process(BridgeClass &_b = Bridge) :
|
||||
bridge(_b), started(false), buffered(0), readPos(0) { }
|
||||
~Process();
|
||||
|
||||
void begin(String &command);
|
||||
void begin(const char *command);
|
||||
void addParameter(String ¶m);
|
||||
void addParameter(const char *param);
|
||||
void begin(const String &command);
|
||||
void addParameter(const String ¶m);
|
||||
unsigned int run();
|
||||
void runAsynchronously();
|
||||
boolean running();
|
||||
|
Loading…
x
Reference in New Issue
Block a user