1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Run new astyle formatter against libs Bridge, SpacebrewYun and Temboo

This commit is contained in:
Federico Fissore
2013-10-21 10:13:31 +02:00
parent b4c68b3dff
commit 00bdd3df03
19 changed files with 841 additions and 805 deletions

View File

@ -22,48 +22,50 @@
#include <Bridge.h>
class Process : public Stream {
public:
// Constructor with a user provided BridgeClass instance
Process(BridgeClass &_b = Bridge) :
bridge(_b), started(false), buffered(0), readPos(0) { }
~Process();
void begin(const String &command);
void addParameter(const String &param);
unsigned int run();
void runAsynchronously();
boolean running();
unsigned int exitValue();
void close();
public:
// Constructor with a user provided BridgeClass instance
Process(BridgeClass &_b = Bridge) :
bridge(_b), started(false), buffered(0), readPos(0) { }
~Process();
unsigned int runShellCommand(const String &command);
void runShellCommandAsynchronously(const String &command);
void begin(const String &command);
void addParameter(const String &param);
unsigned int run();
void runAsynchronously();
boolean running();
unsigned int exitValue();
void close();
operator bool () { return started; }
unsigned int runShellCommand(const String &command);
void runShellCommandAsynchronously(const String &command);
// Stream methods
// (read from process stdout)
int available();
int read();
int peek();
// (write to process stdin)
size_t write(uint8_t);
void flush();
// TODO: add optimized function for block write
private:
BridgeClass &bridge;
unsigned int handle;
String *cmdline;
boolean started;
operator bool () {
return started;
}
// Stream methods
// (read from process stdout)
int available();
int read();
int peek();
// (write to process stdin)
size_t write(uint8_t);
void flush();
// TODO: add optimized function for block write
private:
BridgeClass &bridge;
unsigned int handle;
String *cmdline;
boolean started;
private:
void doBuffer();
uint8_t buffered;
uint8_t readPos;
static const int BUFFER_SIZE = 64;
uint8_t buffer[BUFFER_SIZE];
private:
void doBuffer();
uint8_t buffered;
uint8_t readPos;
static const int BUFFER_SIZE = 64;
uint8_t buffer[BUFFER_SIZE];
};
#endif