diff options
author | Cristian Maglie <c.maglie@bug.st> | 2013-07-04 17:39:14 +0200 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2013-07-04 17:39:14 +0200 |
commit | cc56f7666d142107fe522684195b5056ffc8cafa (patch) | |
tree | 857df0d7588c88fa9ec2225b9d5f7c419a93e090 /libraries/Bridge | |
parent | d1db9d98101f7a78b07d28194bf07bd141dc8cde (diff) |
YunServer: added write() method
Diffstat (limited to 'libraries/Bridge')
-rw-r--r-- | libraries/Bridge/YunServer.cpp | 6 | ||||
-rw-r--r-- | libraries/Bridge/YunServer.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libraries/Bridge/YunServer.cpp b/libraries/Bridge/YunServer.cpp index f23566a..3473ce8 100644 --- a/libraries/Bridge/YunServer.cpp +++ b/libraries/Bridge/YunServer.cpp @@ -46,3 +46,9 @@ YunClient YunServer::accept() { return YunClient(res[0]); } +size_t YunServer::write(uint8_t c) { + uint8_t cmd[] = { 'b', c }; + bridge.transfer(cmd, 2); + return 1; +} + diff --git a/libraries/Bridge/YunServer.h b/libraries/Bridge/YunServer.h index 7343924..69fdeab 100644 --- a/libraries/Bridge/YunServer.h +++ b/libraries/Bridge/YunServer.h @@ -32,7 +32,7 @@ public: void begin(); YunClient accept(); - virtual size_t write(uint8_t c) { /* TODO */ } + virtual size_t write(uint8_t c); void listenOnLocalhost() { useLocalhost = true; } void noListenOnLocalhost() { useLocalhost = false; } |