Displays a value on an RS display board

Dependencies:   EthernetInterface PCA9635 dispBoB mbed-rtos mbed munin-client-lib

Displaying values retrieved from a munin node on an RS display board. Porting this code to work with an alternative display should be trivial, I have also used an mbed application board's LCD to display the values for example.

Hardware

Software

Most of the work is done by libraries that are freely available on mbed.org. The code uses the lwip based EthernetInterface library. The only code I had to write was submit a command to a munin node and parse it's response.

Testing

The software has currently been running for around 2 weeks without any problems. On a previous run it stopped updating after 4 days.

Revision:
4:186148592f35
Parent:
3:56c6df84e619
Child:
5:5c0288a4e2c7
diff -r 56c6df84e619 -r 186148592f35 main.cpp
--- a/main.cpp	Fri Apr 11 18:05:00 2014 +0000
+++ b/main.cpp	Fri Apr 11 18:13:40 2014 +0000
@@ -1,10 +1,9 @@
+#include <string>
+#include <vector>
+#include <sstream>
 #include "mbed.h"
 #include "EthernetInterface.h"
 #include "dispBoB.h"
-#include <string>
-#include <vector>
-#include <sstream>
-#include <utility>
 
 namespace {
     const char* MUNIN_SERVER_ADDRESS = "172.28.22.45";
@@ -15,13 +14,13 @@
 
 class MuninDisplay {
 public:
-    MuninDisplay::MuninDisplay() : db(p28, p27, p26) {
-        db.cls();   
+    MuninDisplay() : bob_display(p28, p27, p26) {
+        bob_display.cls();   
     }
 
     void lcd_print_str(const char *str) {
-        db.cls();
-        db.printf("%s\n", str);        
+        bob_display.cls();
+        bob_display.printf("%s\n", str);        
     }
 
     void dhcp_connection() {
@@ -38,7 +37,7 @@
         return ret;
     }
 
-    int socket_close() {
+    void socket_close() {
         socket.close();
     }
 
@@ -76,8 +75,8 @@
                 std::vector<std::string> name_value = explode(param, ' ');
                 if (name_value.size() == 2) {
                     const int val = atoi(name_value[1].c_str());
-                    db.cls();
-                    db.printf(" %s\n", name_value[1].c_str());
+                    bob_display.cls();
+                    bob_display.printf(" %s\n", name_value[1].c_str());
                     printf("DISPLAYING: %s\r\n", name_value[1].c_str());                    
                     return val;
                 }
@@ -89,7 +88,7 @@
 protected:
     EthernetInterface eth;
     TCPSocketConnection socket;
-    dispBoB db;
+    dispBoB bob_display;
     char buf[256];
 
     std::vector<std::string> explode(std::string const &s, char delim)