demo project
Dependencies: AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL
Utils/Alert.h@33:8b9dcbf6d8ec, 2016-02-04 (annotated)
- Committer:
- henryrawas
- Date:
- Thu Feb 04 20:10:33 2016 +0000
- Revision:
- 33:8b9dcbf6d8ec
- Parent:
- 20:891b5270845a
update libs
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
henryrawas | 19:2f0ec9ac1238 | 1 | // Copyright (c) Microsoft. All rights reserved. |
henryrawas | 19:2f0ec9ac1238 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
henryrawas | 7:6723f6887d00 | 3 | |
henryrawas | 7:6723f6887d00 | 4 | #ifndef __ALERT_H__ |
henryrawas | 7:6723f6887d00 | 5 | |
henryrawas | 7:6723f6887d00 | 6 | #include "mbed.h" |
henryrawas | 7:6723f6887d00 | 7 | #include "SafeCircBuf.h" |
henryrawas | 7:6723f6887d00 | 8 | |
henryrawas | 13:ffeff9b5e513 | 9 | #define AlertBufSize 8 |
henryrawas | 13:ffeff9b5e513 | 10 | #define AlertMsgMaxLen 120 |
henryrawas | 7:6723f6887d00 | 11 | #define AlertTypeMaxLen 16 |
henryrawas | 13:ffeff9b5e513 | 12 | #define MeasureNameMaxLen 16 |
henryrawas | 7:6723f6887d00 | 13 | |
henryrawas | 7:6723f6887d00 | 14 | |
henryrawas | 7:6723f6887d00 | 15 | class Alert |
henryrawas | 7:6723f6887d00 | 16 | { |
henryrawas | 7:6723f6887d00 | 17 | public: |
henryrawas | 7:6723f6887d00 | 18 | Alert() {}; |
henryrawas | 7:6723f6887d00 | 19 | |
henryrawas | 20:891b5270845a | 20 | void SetAlert(time_t created, int createdMs, char* msg, char* atype); |
henryrawas | 7:6723f6887d00 | 21 | |
henryrawas | 20:891b5270845a | 22 | void SetPositionAlert(time_t created, int createdMs, int partIx, float diff); |
henryrawas | 13:ffeff9b5e513 | 23 | |
henryrawas | 20:891b5270845a | 24 | void SetLoadAlert(time_t created, int createdMs, int partIx, float val); |
henryrawas | 7:6723f6887d00 | 25 | |
henryrawas | 20:891b5270845a | 26 | void SetHardwareAlert(time_t created, int createdMs, int partIx, int code); |
henryrawas | 8:d98e2dec0f40 | 27 | |
henryrawas | 20:891b5270845a | 28 | void SetTemperatureAlert(time_t created, int createdMs, int partIx, float temp); |
henryrawas | 8:d98e2dec0f40 | 29 | |
henryrawas | 20:891b5270845a | 30 | void SetVoltageAlert(time_t created, int createdMs, int partIx, float val); |
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 | 13:ffeff9b5e513 | 36 | int Index; |
henryrawas | 13:ffeff9b5e513 | 37 | |
henryrawas | 13:ffeff9b5e513 | 38 | char MeasureName[MeasureNameMaxLen]; |
henryrawas | 13:ffeff9b5e513 | 39 | |
henryrawas | 13:ffeff9b5e513 | 40 | float Value; |
henryrawas | 13:ffeff9b5e513 | 41 | |
henryrawas | 7:6723f6887d00 | 42 | time_t Created; |
henryrawas | 20:891b5270845a | 43 | |
henryrawas | 20:891b5270845a | 44 | int CreatedMs; |
henryrawas | 7:6723f6887d00 | 45 | }; |
henryrawas | 7:6723f6887d00 | 46 | |
henryrawas | 7:6723f6887d00 | 47 | extern SafeCircBuf<Alert, AlertBufSize, uint32_t> AlertBuf; |
henryrawas | 7:6723f6887d00 | 48 | |
henryrawas | 7:6723f6887d00 | 49 | #endif |