20171006
Dependencies: INA219 ISL29125 TSL2561 libmDot-mbed5 LoRa_Miun_20171002 SmartApp_Miun
Fork of Smart_Miun by
project/src/example.cpp@21:99ca5fc42f3e, 2017-04-12 (annotated)
- Committer:
- biwa1400
- Date:
- Wed Apr 12 05:35:40 2017 +0000
- Revision:
- 21:99ca5fc42f3e
- Child:
- 22:7230c1ce7bc2
Smart_Miun
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
biwa1400 | 21:99ca5fc42f3e | 1 | |
biwa1400 | 21:99ca5fc42f3e | 2 | #include "example.h" |
biwa1400 | 21:99ca5fc42f3e | 3 | #include "LoRa.h" |
biwa1400 | 21:99ca5fc42f3e | 4 | #include "MTSLog.h" |
biwa1400 | 21:99ca5fc42f3e | 5 | |
biwa1400 | 21:99ca5fc42f3e | 6 | int main() |
biwa1400 | 21:99ca5fc42f3e | 7 | { |
biwa1400 | 21:99ca5fc42f3e | 8 | |
biwa1400 | 21:99ca5fc42f3e | 9 | SmartApp_Example smartApp; |
biwa1400 | 21:99ca5fc42f3e | 10 | Application1 app1(1); |
biwa1400 | 21:99ca5fc42f3e | 11 | Application2 app2(2); |
biwa1400 | 21:99ca5fc42f3e | 12 | smartApp.addApp(app1); |
biwa1400 | 21:99ca5fc42f3e | 13 | smartApp.addApp(app2); |
biwa1400 | 21:99ca5fc42f3e | 14 | //smartApp.showAppMap(); |
biwa1400 | 21:99ca5fc42f3e | 15 | smartApp.startRunning(); |
biwa1400 | 21:99ca5fc42f3e | 16 | |
biwa1400 | 21:99ca5fc42f3e | 17 | return 0; |
biwa1400 | 21:99ca5fc42f3e | 18 | } |
biwa1400 | 21:99ca5fc42f3e | 19 | |
biwa1400 | 21:99ca5fc42f3e | 20 | |
biwa1400 | 21:99ca5fc42f3e | 21 | void Application1::run(std::string payload) |
biwa1400 | 21:99ca5fc42f3e | 22 | { |
biwa1400 | 21:99ca5fc42f3e | 23 | logInfo("In app 1 ", payload.c_str()); |
biwa1400 | 21:99ca5fc42f3e | 24 | send("Test Packet"); |
biwa1400 | 21:99ca5fc42f3e | 25 | } |
biwa1400 | 21:99ca5fc42f3e | 26 | |
biwa1400 | 21:99ca5fc42f3e | 27 | void Application2::interrupt() |
biwa1400 | 21:99ca5fc42f3e | 28 | { |
biwa1400 | 21:99ca5fc42f3e | 29 | logInfo("app2 interrupt"); |
biwa1400 | 21:99ca5fc42f3e | 30 | } |
biwa1400 | 21:99ca5fc42f3e | 31 | |
biwa1400 | 21:99ca5fc42f3e | 32 | uint8_t SmartApp_Example::measuredBattery() |
biwa1400 | 21:99ca5fc42f3e | 33 | { |
biwa1400 | 21:99ca5fc42f3e | 34 | return 90; |
biwa1400 | 21:99ca5fc42f3e | 35 | } |
biwa1400 | 21:99ca5fc42f3e | 36 |