Own fork of MbedSmartRest

Dependents:   MbedSmartRestMain MbedSmartRestMain

Fork of MbedSmartRest by Cumulocity Official

Revision:
21:207549b3711e
Parent:
20:505d29d5bdfc
Child:
23:0529d6779ab1
--- a/SmartRest.h	Mon Apr 13 14:24:44 2015 +0000
+++ b/SmartRest.h	Mon Apr 20 15:03:44 2015 +0000
@@ -31,17 +31,18 @@
  * The main SmartRest facade class. This class is abstract, because the
  * actual implementation has to supply a client.
  */
-
 #ifndef SMARTREST_H
 #define SMARTREST_H
 
 #include <stddef.h>
 #include <stdint.h>
 #include "AbstractSmartRest.h"
-#include "AbstractClient.h"
+#include "MbedClient.h"
 #include "config.h"
 #include "Parser.h"
 
+#define MBEDSMARTREST_TRIES 3
+
 /**
  * The main SmartRest client implementation.
  */
@@ -53,7 +54,10 @@
 		 * @param client the abstract client to use
 		 * @param identifier the device identifier
 		 */
-		SmartRest(AbstractClient&);
+		SmartRest(MDMSerial& mdm, uint8_t tries= MBEDSMARTREST_TRIES):
+		_source(NULL), _client(mdm, tries) {
+			_mogid[0] = 0;
+		}
 
 #ifdef SMARTREST_TRANSACTIONAL
 		uint8_t request(const DataGenerator&, const char* = NULL);
@@ -73,10 +77,10 @@
 		bool setMoGid(ParsedRecord&);
 
 	private:
-		AbstractClient& _client;
 		AbstractDataSource *_source;
+		char _mogid[8 * sizeof(long) + 1];
 		Parser _parser;
-		char _mogid[8 * sizeof(long) + 1];
+	    MbedClient _client;
 };
 
 #endif