コード例 #1
0
void triggerQueryCEER(void* param)
{
    CCommand* pCmd = new CCommand(RIL_CHANNEL_DLC8, NULL, REQ_ID_NONE,
                                    "AT+CEER\r",
                                    &CTE::ParseLastDataCallFailCause);

    if (pCmd)
    {
        pCmd->SetHighPriority();
        if (!CCommand::AddCmdToQueue(pCmd, TRUE))
        {
            RIL_LOG_CRITICAL("triggerQueryCEER() - Unable to queue command!\r\n");
            delete pCmd;
            pCmd = NULL;
        }
    }
    else
    {
        RIL_LOG_CRITICAL("triggerQueryCEER() - Unable to allocate memory for new command!\r\n");
    }
}
コード例 #2
0
// [in] param = context id.
void triggerDeactivateDataCall(void* param)
{
    RIL_LOG_VERBOSE("triggerDeactivateDataCall() - Enter\r\n");

    UINT32 uiCID;
    REQUEST_DATA rReqData;
    BOOL bSuccess = FALSE;
    CCommand* pCmd = NULL;
    UINT32* pCID = NULL;

    if (param == NULL)
        return;

    uiCID = (UINT32)param;

    pCID = (UINT32*)malloc(sizeof(UINT32));
    if (NULL == pCID)
        return;

    *pCID = uiCID;
    memset(&rReqData, 0, sizeof(REQUEST_DATA));

    if (!PrintStringNullTerminate(rReqData.szCmd1, sizeof(rReqData.szCmd1),
                                                "AT+CGACT=0,%d\r", uiCID))
    {
        RIL_LOG_CRITICAL("triggerDeactivateDataCall() - Unable to create CGACT command!\r\n");
        goto Error;
    }

    rReqData.pContextData = pCID;
    rReqData.cbContextData = sizeof(UINT32);

    pCmd = new CCommand(g_pReqInfo[RIL_REQUEST_DEACTIVATE_DATA_CALL].uiChannel,
                            NULL, RIL_REQUEST_DEACTIVATE_DATA_CALL, rReqData,
                            &CTE::ParseDeactivateDataCall,
                            &CTE::PostDeactivateDataCallCmdHandler);

    if (pCmd)
    {
        pCmd->SetHighPriority();
        if (!CCommand::AddCmdToQueue(pCmd, TRUE))
        {
            RIL_LOG_CRITICAL("triggerDeactivateDataCall() - Unable to queue command!\r\n");
            goto Error;
        }
    }
    else
    {
        RIL_LOG_CRITICAL("triggerDeactivateDataCall() - Unable to allocate memory for new command!\r\n");
    }

    bSuccess = TRUE;
Error:
    if (!bSuccess)
    {
        free(pCID);
        delete pCmd;
    }

    RIL_LOG_VERBOSE("triggerDeactivateDataCall() - Exit\r\n");
}