Connection Manager sometimes doesn’t connect to the GSM Network

P Petr Selinger 3 years 7 months ago
1 0 0

1) 3pm / 07/07/09

2) 2 days

3) MC95

4) WM6.1

5) Clarify Case #1912067 
I would like to ask you for help with following issue. The device is MC95 and I understand it's still in Beta, but maybe you will be able see a mistake in the code snippet they've sent us... Thank you, Petr.
Summary: Sometimes the Connection Manager doesn’t connect to theGSM Network (RAS Call) -> CONNMGR_STATUS_CONNECTIONFAILED (0x21)

 

Afterthis happened, the devices is doesn’t try to establish an connection again.

 

Timewhen it occurred  (cc_log.txt):

23.06.2009|15:40:29| udp2.datalink     |I| Creating a connectionrequest. (Connection GUID: {A6483B11-43D6-45D1-B29B-9A3C44190E54})23.06.2009| 15:40:29| udp2.datalink     |I| Connectionstatus: Waiting Connection (0x40)23.06.2009| 15:40:30|udp2.datalink     |I| Connection status: Connection Failed(0x21)

 

Withinthe RIL-Log:

  71695 TID:64c9d21a RilDrv: Error - data connections not allowed whileinitializing

 

How is it possible to send a connecting request to the ConnectionManager, while Modem/RIL is initializing and cancel the request for ever?

If Kratzer enables the modem manually and waits for some minutesand restarts their application to establish a connection via Connection Manageris works without any problems.

           

This is the code which Kratzer is using:

 

bool CcConnectionManager::ConnMgrConnect(){    int nchars;

 

    TCHAR wEntryName[100];    ConnMgrConRefTypeEnum e = ConRefType_NAP;    GUID guid;    ZeroMemory(&guid, sizeof(GUID));    nchars = MultiByteToWideChar (CP_ACP, 0,getCStructure()->rasentry, -1, wEntryName, sizeof(wEntryName));    if (nchars == 0)    { CCTM_ERROR((m_cctm, "ConnMgrConnect: Converting phonebook entry namefailed: %d (%lu)", nchars, GetLastError())); return false;    }    HRESULT result = ConnMgrMapConRef(e, wEntryName, &guid);    if (result != S_OK)    { CCTM_ERROR((m_cctm, "Failed to resolve GUID for '%s'!(0x%08X)", getCStructure()->rasentry, result)); return false;    }        CONNMGR_CONNECTIONINFO connInfo;        connInfo.cbSize = sizeof(CONNMGR_CONNECTIONINFO);    connInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;    connInfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;    connInfo.bExclusive = TRUE;    connInfo.bDisabled = FALSE;    connInfo.guidDestNet = guid;    connInfo.hWnd = ccdevev_get_window();    connInfo.uMsg = m_msgId;        OLECHAR szGuid[MAX_PATH];    ZeroMemory(&szGuid, sizeof(szGuid));        int rc = StringFromGUID2(guid, (LPOLESTR)&szGuid,sizeof(szGuid));        if (!rc) CCTM_ERROR((m_cctm, "Failed to convert GUID to string! Buffer tosmall?!"));        char buffer[MAX_PATH];    sprintf(buffer, "%S",szGuid);    CCTM_INFO((m_cctm, "Creating a connection request.(Connection GUID: %s)", buffer));        result = ConnMgrEstablishConnection(&connInfo,&m_hConnection);       if (result != S_OK)    { CCTM_ERROR((m_cctm, "Failed to initiate establishing a connection!(0x%08X)", result)); m_hConnection = INVALID_HANDLE_VALUE; return false;    }    return true;}

 

Thisfunction get the status asynchron:

 

HRESULT result = ConnMgrConnectionStatus(m_hConnection,&dwStatus);if (result!= S_OK){    CCTM_ERROR((m_cctm, "Failedto get connection status! (0x%08X)", result));    return;}CCTM_INFO((m_cctm, "Connection status: %s(0x%02X)", getPrintableConnectionStatus(dwStatus), dwStatus));

And reports the Error/Status 0x21.

CONTACT
Can’t find what you’re looking for?