http://mbed.org/users/ansond/code/StatusReporter/#660361de9b8c