demo project
Dependencies: AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL
Alert.h@7:6723f6887d00, 2015-12-29 (annotated)
- Committer:
- henryrawas
- Date:
- Tue Dec 29 23:31:28 2015 +0000
- Revision:
- 7:6723f6887d00
- Child:
- 8:d98e2dec0f40
motion block alerts, more commands
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
henryrawas | 7:6723f6887d00 | 1 | /* |
henryrawas | 7:6723f6887d00 | 2 | Copyright (c) 2015 Jonathan Pickett & Microsoft. Some appropriate open source license. |
henryrawas | 7:6723f6887d00 | 3 | */ |
henryrawas | 7:6723f6887d00 | 4 | |
henryrawas | 7:6723f6887d00 | 5 | #ifndef __ALERT_H__ |
henryrawas | 7:6723f6887d00 | 6 | |
henryrawas | 7:6723f6887d00 | 7 | #include "mbed.h" |
henryrawas | 7:6723f6887d00 | 8 | #include "SafeCircBuf.h" |
henryrawas | 7:6723f6887d00 | 9 | |
henryrawas | 7:6723f6887d00 | 10 | #define AlertBufSize 20 |
henryrawas | 7:6723f6887d00 | 11 | #define AlertMsgMaxLen 200 |
henryrawas | 7:6723f6887d00 | 12 | #define AlertTypeMaxLen 16 |
henryrawas | 7:6723f6887d00 | 13 | |
henryrawas | 7:6723f6887d00 | 14 | enum AlertSeverity |
henryrawas | 7:6723f6887d00 | 15 | { |
henryrawas | 7:6723f6887d00 | 16 | AS_Info = 0, |
henryrawas | 7:6723f6887d00 | 17 | AS_Warn = 1, |
henryrawas | 7:6723f6887d00 | 18 | AS_Error = 2 |
henryrawas | 7:6723f6887d00 | 19 | }; |
henryrawas | 7:6723f6887d00 | 20 | |
henryrawas | 7:6723f6887d00 | 21 | class Alert |
henryrawas | 7:6723f6887d00 | 22 | { |
henryrawas | 7:6723f6887d00 | 23 | public: |
henryrawas | 7:6723f6887d00 | 24 | Alert() {}; |
henryrawas | 7:6723f6887d00 | 25 | |
henryrawas | 7:6723f6887d00 | 26 | void SetAlert(int severity, time_t created, char* msg, char* atype); |
henryrawas | 7:6723f6887d00 | 27 | |
henryrawas | 7:6723f6887d00 | 28 | void SetPositionAlert(int severity, time_t created, int partIx, float diff); |
henryrawas | 7:6723f6887d00 | 29 | |
henryrawas | 7:6723f6887d00 | 30 | int Sev; |
henryrawas | 7:6723f6887d00 | 31 | |
henryrawas | 7:6723f6887d00 | 32 | char AlertType[AlertTypeMaxLen]; |
henryrawas | 7:6723f6887d00 | 33 | |
henryrawas | 7:6723f6887d00 | 34 | char Msg[AlertMsgMaxLen]; |
henryrawas | 7:6723f6887d00 | 35 | |
henryrawas | 7:6723f6887d00 | 36 | time_t Created; |
henryrawas | 7:6723f6887d00 | 37 | }; |
henryrawas | 7:6723f6887d00 | 38 | |
henryrawas | 7:6723f6887d00 | 39 | extern SafeCircBuf<Alert, AlertBufSize, uint32_t> AlertBuf; |
henryrawas | 7:6723f6887d00 | 40 | |
henryrawas | 7:6723f6887d00 | 41 | #endif |