demo project

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

Revision:
18:224289104fc0
Parent:
13:ffeff9b5e513
Child:
19:2f0ec9ac1238
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/Alert.h	Sat Jan 23 00:08:30 2016 +0000
@@ -0,0 +1,48 @@
+/* 
+Copyright (c) 2015 Jonathan Pickett & Microsoft. Some appropriate open source license.
+*/
+
+#ifndef __ALERT_H__
+
+#include "mbed.h"
+#include "SafeCircBuf.h"
+
+#define AlertBufSize  8
+#define AlertMsgMaxLen  120
+#define AlertTypeMaxLen  16
+#define MeasureNameMaxLen  16
+
+
+class Alert
+{
+public:
+    Alert() {};
+    
+    void SetAlert(time_t created, char* msg, char* atype);
+    
+    void SetPositionAlert(time_t created, int partIx, float diff);
+    
+    void SetLoadAlert(time_t created, int partIx, float val);
+    
+    void SetHardwareAlert(time_t created, int partIx, int code);
+    
+    void SetTemperatureAlert(time_t created, int partIx, float temp);
+    
+    void SetVoltageAlert(time_t created, int partIx, float val);
+    
+    char AlertType[AlertTypeMaxLen];
+    
+    char Msg[AlertMsgMaxLen];
+    
+    int Index;
+    
+    char MeasureName[MeasureNameMaxLen];
+    
+    float Value;
+    
+    time_t Created;
+};
+
+extern SafeCircBuf<Alert, AlertBufSize, uint32_t> AlertBuf;
+
+#endif