MODSERIAL with support for more devices

Dependents:   1D-Pong BMT-K9_encoder BMT-K9-Regelaar programma_filter ... more

Check the cookbook page for more information: https://mbed.org/cookbook/MODSERIAL

Did you add a device? Please send a pull request so we can keep everything in one library instead of many copies. In that case also send a PM, since currently mbed does not inform of new pull requests. I will then also add you to the developers of this library so you can do other changes directly.

Files at this revision

API Documentation at this revision

Comitter:
Sissors
Date:
Mon Sep 12 12:07:22 2016 +0000
Parent:
41:d8422efe4761
Child:
43:8c8d13e1840b
Commit message:
Compatible with latest mbed
;
; the _name value in FileBase was moved from protected to private, with a new function which was added we can access it again.

Changed in this revision

MODSERIAL.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MODSERIAL.cpp	Tue Nov 17 12:11:44 2015 -0300
+++ b/MODSERIAL.cpp	Mon Sep 12 12:07:22 2016 +0000
@@ -94,13 +94,13 @@
 
 
 bool MODSERIAL::claim (FILE *stream) {
-    if ( _name == NULL) {
+    if ( FileBase::getName() == NULL) {
         error("claim requires a name to be given in the instantiator of the MODSERIAL instance!\r\n");
     }
     
     //Add '/' before name:
-    char *path = new char[strlen(_name) + 2];
-    sprintf(path, "/%s", _name);
+    char *path = new char[strlen(FileBase::getName()) + 2];
+    sprintf(path, "/%s", FileBase::getName());
     
     if (freopen(path, "w", stream) == NULL) {
         // Failed, should not happen