demo project

Dependencies:   AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL

Committer:
henryrawas
Date:
Sat Jan 23 00:08:30 2016 +0000
Revision:
18:224289104fc0
Parent:
Alert.h@13:ffeff9b5e513
Child:
19:2f0ec9ac1238
refactor

Who changed what in which revision?

UserRevisionLine numberNew 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 13:ffeff9b5e513 10 #define AlertBufSize 8
henryrawas 13:ffeff9b5e513 11 #define AlertMsgMaxLen 120
henryrawas 7:6723f6887d00 12 #define AlertTypeMaxLen 16
henryrawas 13:ffeff9b5e513 13 #define MeasureNameMaxLen 16
henryrawas 7:6723f6887d00 14
henryrawas 7:6723f6887d00 15
henryrawas 7:6723f6887d00 16 class Alert
henryrawas 7:6723f6887d00 17 {
henryrawas 7:6723f6887d00 18 public:
henryrawas 7:6723f6887d00 19 Alert() {};
henryrawas 7:6723f6887d00 20
henryrawas 13:ffeff9b5e513 21 void SetAlert(time_t created, char* msg, char* atype);
henryrawas 7:6723f6887d00 22
henryrawas 13:ffeff9b5e513 23 void SetPositionAlert(time_t created, int partIx, float diff);
henryrawas 13:ffeff9b5e513 24
henryrawas 13:ffeff9b5e513 25 void SetLoadAlert(time_t created, int partIx, float val);
henryrawas 7:6723f6887d00 26
henryrawas 13:ffeff9b5e513 27 void SetHardwareAlert(time_t created, int partIx, int code);
henryrawas 8:d98e2dec0f40 28
henryrawas 13:ffeff9b5e513 29 void SetTemperatureAlert(time_t created, int partIx, float temp);
henryrawas 8:d98e2dec0f40 30
henryrawas 13:ffeff9b5e513 31 void SetVoltageAlert(time_t created, int partIx, float val);
henryrawas 7:6723f6887d00 32
henryrawas 7:6723f6887d00 33 char AlertType[AlertTypeMaxLen];
henryrawas 7:6723f6887d00 34
henryrawas 7:6723f6887d00 35 char Msg[AlertMsgMaxLen];
henryrawas 7:6723f6887d00 36
henryrawas 13:ffeff9b5e513 37 int Index;
henryrawas 13:ffeff9b5e513 38
henryrawas 13:ffeff9b5e513 39 char MeasureName[MeasureNameMaxLen];
henryrawas 13:ffeff9b5e513 40
henryrawas 13:ffeff9b5e513 41 float Value;
henryrawas 13:ffeff9b5e513 42
henryrawas 7:6723f6887d00 43 time_t Created;
henryrawas 7:6723f6887d00 44 };
henryrawas 7:6723f6887d00 45
henryrawas 7:6723f6887d00 46 extern SafeCircBuf<Alert, AlertBufSize, uint32_t> AlertBuf;
henryrawas 7:6723f6887d00 47
henryrawas 7:6723f6887d00 48 #endif