Own fork of MbedSmartRest

Dependents:   MbedSmartRestMain MbedSmartRestMain

Fork of MbedSmartRest by Cumulocity Official

Revision:
23:0529d6779ab1
Parent:
21:207549b3711e
Child:
24:11fd6fd14c28
--- a/MbedClient.cpp	Mon Apr 27 10:50:03 2015 +0000
+++ b/MbedClient.cpp	Mon Apr 27 13:02:37 2015 +0000
@@ -46,7 +46,7 @@
 //#define MBCL_DBG(fmt, ...)
 #define DNS_ENTRY_DURATION 50
 
-MbedClient::MbedClient(MDMSerial& mdm, uint8_t tries) :
+MbedClient::MbedClient(uint8_t tries) :
     _tries(tries),
     _state(STATE_INIT),
     _isStreamRequest(false),
@@ -54,7 +54,6 @@
     _source(_sock),
     _sink(_sock),
     _filter(_source),
-    _mdm(mdm),
     cachedIPValid(0)
 {
 }
@@ -196,10 +195,11 @@
 
 bool MbedClient::connect()
 {
+    extern MDMRtos<MDMSerial> *pMdm;
     uint8_t tries = _tries;
     do {
         if (cachedIPValid == 0) {
-            MDMParser::IP ip = _mdm.gethostbyname(getHost());
+            MDMParser::IP ip = pMdm->gethostbyname(getHost());
             if (ip == NOIP)
                 continue;
             const unsigned char *c = (const unsigned char*)&ip;