CO528 - Assessment 3 - Guard Room Project
Dependencies: C12832 MMA7660 mbed-http
Fork of http-example by
source/Core.h@15:8965fc128e7b, 2017-05-03 (annotated)
- Committer:
- fpaf2
- Date:
- Wed May 03 12:06:22 2017 +0000
- Revision:
- 15:8965fc128e7b
CO528 - Assessment 3 - Guard Room project
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fpaf2 | 15:8965fc128e7b | 1 | /* mbed library for the mbed Lab Board 128*32 pixel LCD |
fpaf2 | 15:8965fc128e7b | 2 | * use C12832 controller |
fpaf2 | 15:8965fc128e7b | 3 | * Copyright (c) 2012 Peter Drescher - DC2PD |
fpaf2 | 15:8965fc128e7b | 4 | * Released under the MIT License: http://mbed.org/license/mit |
fpaf2 | 15:8965fc128e7b | 5 | * |
fpaf2 | 15:8965fc128e7b | 6 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
fpaf2 | 15:8965fc128e7b | 7 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
fpaf2 | 15:8965fc128e7b | 8 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
fpaf2 | 15:8965fc128e7b | 9 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
fpaf2 | 15:8965fc128e7b | 10 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
fpaf2 | 15:8965fc128e7b | 11 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
fpaf2 | 15:8965fc128e7b | 12 | * THE SOFTWARE. |
fpaf2 | 15:8965fc128e7b | 13 | */ |
fpaf2 | 15:8965fc128e7b | 14 | |
fpaf2 | 15:8965fc128e7b | 15 | #ifndef CORE_H |
fpaf2 | 15:8965fc128e7b | 16 | #define CORE_H |
fpaf2 | 15:8965fc128e7b | 17 | |
fpaf2 | 15:8965fc128e7b | 18 | #include <string> |
fpaf2 | 15:8965fc128e7b | 19 | #include "MMA7660.h" |
fpaf2 | 15:8965fc128e7b | 20 | #include "C12832.h" |
fpaf2 | 15:8965fc128e7b | 21 | #include "easy-connect.h" |
fpaf2 | 15:8965fc128e7b | 22 | #include "http_request.h" |
fpaf2 | 15:8965fc128e7b | 23 | //#include "select-demo.h" |
fpaf2 | 15:8965fc128e7b | 24 | |
fpaf2 | 15:8965fc128e7b | 25 | /** This classe is being used to control the temperature program |
fpaf2 | 15:8965fc128e7b | 26 | * |
fpaf2 | 15:8965fc128e7b | 27 | */ |
fpaf2 | 15:8965fc128e7b | 28 | |
fpaf2 | 15:8965fc128e7b | 29 | class Core { |
fpaf2 | 15:8965fc128e7b | 30 | public: |
fpaf2 | 15:8965fc128e7b | 31 | /** Create a Core object and initialise all the values |
fpaf2 | 15:8965fc128e7b | 32 | * |
fpaf2 | 15:8965fc128e7b | 33 | */ |
fpaf2 | 15:8965fc128e7b | 34 | Core(); |
fpaf2 | 15:8965fc128e7b | 35 | |
fpaf2 | 15:8965fc128e7b | 36 | /** Plays the program, this is the heart of this class |
fpaf2 | 15:8965fc128e7b | 37 | * |
fpaf2 | 15:8965fc128e7b | 38 | */ |
fpaf2 | 15:8965fc128e7b | 39 | void guard(void); |
fpaf2 | 15:8965fc128e7b | 40 | |
fpaf2 | 15:8965fc128e7b | 41 | private: |
fpaf2 | 15:8965fc128e7b | 42 | bool doorIsOpening(void); |
fpaf2 | 15:8965fc128e7b | 43 | void displayMessageOnScreen(void); |
fpaf2 | 15:8965fc128e7b | 44 | void triggerAlarm(void); |
fpaf2 | 15:8965fc128e7b | 45 | void shutDownAlarm(void); |
fpaf2 | 15:8965fc128e7b | 46 | void updateInfoWithAPI(void); |
fpaf2 | 15:8965fc128e7b | 47 | void dumpResponsePut(HttpResponse *); |
fpaf2 | 15:8965fc128e7b | 48 | void dumpResponseGet(HttpResponse *); |
fpaf2 | 15:8965fc128e7b | 49 | void putRequest(void); |
fpaf2 | 15:8965fc128e7b | 50 | void getRequest(void); |
fpaf2 | 15:8965fc128e7b | 51 | |
fpaf2 | 15:8965fc128e7b | 52 | /** These are the variables used in the program |
fpaf2 | 15:8965fc128e7b | 53 | * |
fpaf2 | 15:8965fc128e7b | 54 | */ |
fpaf2 | 15:8965fc128e7b | 55 | bool _quiet; |
fpaf2 | 15:8965fc128e7b | 56 | std::string _message; |
fpaf2 | 15:8965fc128e7b | 57 | NetworkInterface* _network; |
fpaf2 | 15:8965fc128e7b | 58 | }; |
fpaf2 | 15:8965fc128e7b | 59 | |
fpaf2 | 15:8965fc128e7b | 60 | |
fpaf2 | 15:8965fc128e7b | 61 | |
fpaf2 | 15:8965fc128e7b | 62 | |
fpaf2 | 15:8965fc128e7b | 63 | #endif |