Thomas Cauwelier / Mbed 2 deprecated visible_light_communication

Dependencies:   SoftSerial SDFileSystem mbed wave_player

Revision:
17:8683abdc1912
Parent:
16:1a0589d846bf
Child:
19:822d93e0bf34
--- a/MySoftSerial.cpp	Wed May 10 14:31:39 2017 +0000
+++ b/MySoftSerial.cpp	Wed May 10 17:31:22 2017 +0200
@@ -3,9 +3,10 @@
 //
 
 #include "MySoftSerial.h"
+#include "Manchester.h"
 
 MySoftSerial::MySoftSerial(PinName TX, PinName RX, const char *name) : SoftSerial(TX, RX, name) {
-
+    format(16, SoftSerial::None, 1);
 }
 
 MySoftSerial::~MySoftSerial() {
@@ -13,9 +14,27 @@
 }
 
 int MySoftSerial::putc(int c) {
+    c = Manchester::encode(c);
     return _putc(c);
 }
 
 int MySoftSerial::getc() {
-    return _getc();
+    return Manchester::decode(_getc());
+}
+
+void MySoftSerial::prepare_tx(int c) {
+
+    SoftSerial::prepare_tx(c);
 }
+
+void MySoftSerial::baud(int baudrate) {
+    SoftSerial::baud(baudrate);
+}
+
+int MySoftSerial::readable() {
+    return SoftSerial::readable();
+}
+
+int MySoftSerial::writeable() {
+    return SoftSerial::writeable();
+}