Own fork of MbedSmartRest

Dependents:   MbedSmartRestMain MbedSmartRestMain

Fork of MbedSmartRest by Cumulocity Official

Revision:
6:cd7ba1ddb664
Parent:
2:45a6e44a4fb4
Child:
8:3a4dba260b71
--- a/MbedClient.h	Thu Jul 10 16:20:31 2014 +0200
+++ b/MbedClient.h	Mon Jul 28 12:11:02 2014 +0200
@@ -36,17 +36,9 @@
 #include "MbedDataSink.h"
 #include "HTTPResponseFilter.h"
 
-#define MBED_STATE_INIT 0
-#define MBED_STATE_IN_REQUEST 1
-#define MBED_STATE_SENT_ID 2
-#define MBED_STATE_SENT_DATA 3
-#define MBED_STATE_REQ_COMPLETE 4
-#define MBED_STATE_RECVD_RESPONSE 5
-#define MBED_STATE_RECV_DATA 6
-
 class MbedClient : public AbstractClient {
 public:
-    MbedClient(const char*, uint16_t);
+    MbedClient(const char*, uint16_t, uint8_t);
     ~MbedClient();
 
     uint8_t setAuthorization(const char*, const char*);
@@ -63,8 +55,12 @@
     bool sendBasicAuth();
 
 private:
+    uint8_t internalError();
+    uint8_t connectionError();
+
+private:
     const char *_host, *_username, *_password;
-    uint16_t _port, _state;
+    uint16_t _port, _tries, _state;
     TCPSocketConnection _sock;
     MbedDataSource _source;
     MbedDataSink _sink;