Connection Manager library for u-blox cellular modules. It manages the modem for keeping data connection always active.
Diff: CNData.cpp
- Revision:
- 1:29ad1d1ac1f9
- Parent:
- 0:86284a262735
--- a/CNData.cpp Tue Jan 12 09:08:15 2016 +0000 +++ b/CNData.cpp Thu Jan 21 14:00:25 2016 +0000 @@ -25,6 +25,7 @@ static MDMParser::Auth auth; //!<authentication mode (CHAP,PAP,NONE or DETECT) void cnDataInit(){ + TRACE("%s enter \r\n", __FUNCTION__); state = DATA_DOWN; dataIsEnable = false; tmDataPullStatus.setExpireTimeout(TIMEOUT_CHECK_STATUS_DATA_CONNECITION); @@ -36,6 +37,7 @@ } void cnDataEnable(bool enabled){ + TRACE("%s enter enabled: %d\r\n", __FUNCTION__, enabled); dataIsEnable = enabled; } @@ -63,7 +65,8 @@ *dataStatus = DATA_NO_CHANGES; MDMParser::IP ip; char *apn, *username, *password; - + + TRACE("%s enter \r\n", __FUNCTION__); //enable data connection if (dataIsEnable && IS_DATA_DISCONNECTED(state) && regStatus == REG_REGISTERED){ if (!tmDataRetry.isOn() || tmDataRetry.isExpired()){ @@ -110,12 +113,13 @@ *dataStatus = DATA_IS_DISCONNECTED; tmDataPullStatus.stop(); } + //dump info if (getUtilDebugLevel() > 1 && ( HAS_DATA_ATTACHED(state, newState) || HAS_DATA_DEATTACHED(state, newState))){ INFO("CNM Data Dump\r\n"); const char* txtState[] = { "Undefined", "Up", "Down"}; if (newState < sizeof(txtState)/sizeof(*txtState) && newState != DATA_UNDEFINED) - INFO(" State is now: %s\r\n", txtState[newState]); + INFO(" State is now: %s\r\n", txtState[newState]); INFO(" Data is enabled: %s, has Data Attached: %s, has Data Detached: %s\r\n", BOOLTOSTR(dataIsEnable),\ BOOLTOSTR(HAS_DATA_ATTACHED(state, newState)), BOOLTOSTR(HAS_DATA_DEATTACHED(state, newState))); INFO(" Timer for Data Retry: %d, Timer for Check Data %d \r\n", tmDataRetry.getRetryContunter(), \