Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
app.cpp@21:53c2a598dda1, 2015-12-01 (annotated)
- Committer:
- Oschofield
- Date:
- Tue Dec 01 13:18:49 2015 +0000
- Revision:
- 21:53c2a598dda1
added the App.h and app.cpp files to library;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Oschofield | 21:53c2a598dda1 | 1 | #include "app.h" |
Oschofield | 21:53c2a598dda1 | 2 | #include "mbed.h" |
Oschofield | 21:53c2a598dda1 | 3 | |
Oschofield | 21:53c2a598dda1 | 4 | App::App(string name, Serial* serialPort) // Constructor - Names the app and allocates the Serial Port info. |
Oschofield | 21:53c2a598dda1 | 5 | { |
Oschofield | 21:53c2a598dda1 | 6 | this -> name = name; |
Oschofield | 21:53c2a598dda1 | 7 | this -> serialPort = serialPort; |
Oschofield | 21:53c2a598dda1 | 8 | } |
Oschofield | 21:53c2a598dda1 | 9 | |
Oschofield | 21:53c2a598dda1 | 10 | string App::getName() // returns the Applications name |
Oschofield | 21:53c2a598dda1 | 11 | { |
Oschofield | 21:53c2a598dda1 | 12 | return this -> name; |
Oschofield | 21:53c2a598dda1 | 13 | } |
Oschofield | 21:53c2a598dda1 | 14 | |
Oschofield | 21:53c2a598dda1 | 15 | void App::start() |
Oschofield | 21:53c2a598dda1 | 16 | { |
Oschofield | 21:53c2a598dda1 | 17 | string message = "Application " + this->name + " has Started. \r\n"; |
Oschofield | 21:53c2a598dda1 | 18 | this->serialPort -> puts(message.c_str()); |
Oschofield | 21:53c2a598dda1 | 19 | } |
Oschofield | 21:53c2a598dda1 | 20 | |
Oschofield | 21:53c2a598dda1 | 21 | void App::stop() |
Oschofield | 21:53c2a598dda1 | 22 | { |
Oschofield | 21:53c2a598dda1 | 23 | string message = "Application " + this->name + " terminated. \r\n"; |
Oschofield | 21:53c2a598dda1 | 24 | this->serialPort -> puts(message.c_str()); |
Oschofield | 21:53c2a598dda1 | 25 | } |