BOOL CPort::Open(const char* pszFileName, BOOL fIsSocket) { RIL_LOG_VERBOSE("CPort::Open() - Enter fIsSocket=[%d]\r\n", fIsSocket); BOOL fRet = FALSE; if (NULL == pszFileName) { RIL_LOG_CRITICAL("CPort::Open() - pszFileName is NULL!\r\n"); return FALSE; } if (!m_fIsPortOpen) { if (NULL == m_pFile) { m_pFile = new CFile(); } if (fIsSocket) { fRet = OpenSocket(pszFileName); } else { fRet = OpenPort(pszFileName); } } else { RIL_LOG_CRITICAL("CPort::Open() - Port is already open!\r\n"); } RIL_LOG_VERBOSE("CPort::Open() - Exit\r\n"); return fRet; }
CChannel_ATCmd::~CChannel_ATCmd() { RIL_LOG_VERBOSE("CChannel_ATCmd::~CChannel_ATCmd() - Enter\r\n"); delete[] m_paInitCmdStrings; RIL_LOG_VERBOSE("CChannel_ATCmd::~CChannel_ATCmd() - Exit\r\n"); m_paInitCmdStrings = NULL; }
BOOL CPort::Read(char* pszReadBuf, UINT32 uiReadBufSize, UINT32& ruiBytesRead) { RIL_LOG_VERBOSE("CPort::Read() - Enter\r\n"); BOOL fRet = FALSE; ruiBytesRead = 0; if (m_fIsPortOpen) { if (CFile::Read(m_pFile, pszReadBuf, uiReadBufSize, ruiBytesRead)) { fRet = TRUE; } else { RIL_LOG_CRITICAL("CPort::Read() - Unable to read from port\r\n"); } } else { CModemRestart::SaveRequestReason(3, "Port read error", "port is not open", CFile::GetName(m_pFile)); RIL_LOG_CRITICAL("CPort::Read() - Port is not open!\r\n"); } RIL_LOG_VERBOSE("CPort::Read() - Exit\r\n"); return fRet; }
BOOL CPort::Close() { RIL_LOG_VERBOSE("CPort::Close() - Enter\r\n"); BOOL fRet = FALSE; if (!m_fIsPortOpen) { RIL_LOG_CRITICAL("CPort::Close() - Port is already closed!\r\n"); } else { m_fIsPortOpen = FALSE; fRet = CFile::Close(m_pFile); if (!fRet) { RIL_LOG_CRITICAL("CPort::Close() - Unable to properly close port!\r\n"); } } delete m_pFile; m_pFile = NULL; RIL_LOG_VERBOSE("CPort::Close() - Exit\r\n"); return fRet; }
BOOL CPort::Write(const char* pszWriteBuf, const UINT32 uiBytesToWrite, UINT32& ruiBytesWritten) { RIL_LOG_VERBOSE("CPort::Write() - Enter\r\n"); BOOL fRet = FALSE; ruiBytesWritten = 0; if (m_fIsPortOpen) { if (CFile::Write(m_pFile, pszWriteBuf, uiBytesToWrite, ruiBytesWritten)) { fRet = TRUE; } else { RIL_LOG_CRITICAL("CPort::Write() - Unable to write to port\r\n"); } } else { CModemRestart::SaveRequestReason(3, "Port write error", "port is not open", CFile::GetName(m_pFile)); RIL_LOG_CRITICAL("CPort::Write() - Port is not open!\r\n"); } RIL_LOG_VERBOSE("CPort::Write() - Exit\r\n"); return fRet; }
BOOL CPort::OpenPort(const char* pszFileName) { RIL_LOG_VERBOSE("CPort::OpenPort() - Enter\r\n"); BOOL fRet = FALSE; if (NULL == m_pFile) { RIL_LOG_CRITICAL("CPort::OpenPort() - m_pFile is NULL"); return fRet; } fRet = CFile::Open(m_pFile, pszFileName, FILE_ACCESS_READ_WRITE, FILE_OPEN_EXIST); if (fRet) { m_fIsPortOpen = TRUE; } else { RIL_LOG_CRITICAL("CPort::OpenPort() CANNOT OPEN PORT\r\n"); } RIL_LOG_VERBOSE("CPort::OpenPort() - Exit\r\n"); return fRet; }
CChannel_DLC2::~CChannel_DLC2() { RIL_LOG_VERBOSE("CChannel_DLC2::~CChannel_DLC2() - Enter\r\n"); delete[] m_paInitCmdStrings; m_paInitCmdStrings = NULL; RIL_LOG_VERBOSE("CChannel_DLC2::~CChannel_DLC2() - Exit\r\n"); }
BOOL CChannel_ATCmd::FinishInit() { RIL_LOG_VERBOSE("CChannel_ATCmd::FinishInit() - Enter\r\n"); BOOL bRet = FALSE; // Init our channel AT init commands. m_paInitCmdStrings = new INITSTRING_DATA[COM_MAX_INDEX]; if (!m_paInitCmdStrings) { RIL_LOG_CRITICAL("CChannel_ATCmd::FinishInit() : chnl=[%d] Could not create new " "INITSTRING_DATA\r\n", m_uiRilChannel); goto Error; } // Set the init command strings for this channel m_paInitCmdStrings[COM_BASIC_INIT_INDEX].szCmd = m_szChannelBasicInitCmd; m_paInitCmdStrings[COM_UNLOCK_INIT_INDEX].szCmd = m_szChannelUnlockInitCmd; m_paInitCmdStrings[COM_POWER_ON_INIT_INDEX] = ATCmdPowerOnInitString; m_paInitCmdStrings[COM_READY_INIT_INDEX] = ATCmdReadyInitString; bRet = TRUE; Error: RIL_LOG_VERBOSE("CChannel_ATCmd::FinishInit() - Exit\r\n"); return bRet; }
// // RIL_REQUEST_SIM_TRANSMIT_CHANNEL // RIL_RESULT_CODE CTE_XMM2230::CoreSimTransmitChannel(REQUEST_DATA& /*rReqData*/, void* /*pData*/, UINT32 /*uiDataSize*/) { RIL_LOG_VERBOSE("CTE_XMM2230::CoreSimTransmitChannel() - Enter\r\n"); RIL_RESULT_CODE res = RRIL_RESULT_NOTSUPPORTED; RIL_LOG_VERBOSE("CTE_XMM2230::CoreSimTransmitChannel() - Exit\r\n"); return res; }
BOOL CPort::OpenSocket(const char* pszSocketName) { RIL_LOG_VERBOSE("CPort::OpenSocket() - Enter\r\n"); // TODO : Pull this from repository const char szSocketInit[] = "gsm"; UINT32 uiBytesWritten = 0; UINT32 uiBytesRead = 0; char szResponse[10] = {0}; BOOL fRet = FALSE; const UINT32 uiRetries = 30; const UINT32 uiInterval = 2000; for (UINT32 uiAttempts = 0; uiAttempts < uiRetries; uiAttempts++) { fRet = CFile::Open(m_pFile, pszSocketName, 0, 0, TRUE); if (fRet) { m_fIsPortOpen = TRUE; RIL_LOG_INFO("CPort::OpenSocket() - Port is open!!\r\n"); break; } Sleep(uiInterval); } if (fRet) { if (Write(szSocketInit, strlen(szSocketInit), uiBytesWritten)) { if (Read(szResponse, sizeof(szResponse), uiBytesRead)) { m_fIsPortOpen = TRUE; } else { RIL_LOG_CRITICAL("CPort::OpenSocket() - Unable to read response from socket\r\n"); fRet = FALSE; } } else { RIL_LOG_CRITICAL("CPort::OpenSocket() - Unable to write \"%s\" to socket\r\n", szSocketInit); fRet = FALSE; } } RIL_LOG_VERBOSE("CPort::OpenSocket() - Exit\r\n"); return fRet; }
INT32 CellInfoCache::checkCache(const RIL_CellInfo& pData) { RIL_LOG_VERBOSE("CellInfoCache::checkCache() %d\r\n", m_iCacheSize); for (INT32 i = 0; i < m_iCacheSize; i++) { if (pData == m_sCellInfo.pnCellData[i]) { RIL_LOG_VERBOSE("CellInfoCache::checkCache() - Found match at %d\r\n",i); return i; } } return -1; }
char* CTE_XMM2230::GetUnlockInitCommands(UINT32 uiChannelType) { RIL_LOG_VERBOSE("CTE_XMM2230::GetUnlockInitCommands() - Enter\r\n"); char szInitCmd[MAX_BUFFER_SIZE] = {'\0'}; if (RIL_CHANNEL_URC == uiChannelType) { ConcatenateStringNullTerminate(szInitCmd, sizeof(szInitCmd), "|+CGAUTO=0|+CRC=1"); } RIL_LOG_VERBOSE("CTE_XMM2230::GetUnlockInitCommands() - Exit\r\n"); return strndup(szInitCmd, strlen(szInitCmd)); }
// // IMS network support reporting // BOOL CSilo_IMS::ParseCIREPI(CResponse* const pResponse, const char*& rszPointer) { RIL_LOG_VERBOSE("CSilo_IMS::ParseCIREPI() - Enter\r\n"); BOOL fRet = FALSE; UINT32 uiNwimsvops = 0; char szAlpha[MAX_BUFFER_SIZE]; int pos = 0; sOEM_HOOK_RAW_UNSOL_IMS_SUPPORT_STATUS data; if (NULL == pResponse) { RIL_LOG_CRITICAL("CSilo_IMS::ParseCIREPI() - pResponse is NULL.\r\n"); goto Error; } pResponse->SetUnsolicitedFlag(TRUE); // Throw out the alpha chars if there are any (void)ExtractQuotedString(rszPointer, szAlpha, MAX_BUFFER_SIZE, rszPointer); // Parse "<nwimsvops>" if (!ExtractUInt32(rszPointer, uiNwimsvops, rszPointer)) { RIL_LOG_CRITICAL("CSilo_IMS::ParseCIREPI() - Could not parse IMS Voice over PS" "support indication\r\n"); goto Error; } data.command = RIL_OEM_HOOK_RAW_UNSOL_IMS_SUPPORT_STATUS; data.status = uiNwimsvops; // Framework will trigger IMS registration depending on this information. RIL_LOG_INFO("CSilo_IMS::ParseCIREPI() - CIREPI=[%d]\r\n", uiNwimsvops); pResponse->SetResultCode(RIL_UNSOL_OEM_HOOK_RAW); if (!pResponse->SetData((void*)&data, sizeof(sOEM_HOOK_RAW_UNSOL_IMS_SUPPORT_STATUS), TRUE)) { goto Error; } fRet = TRUE; Error: RIL_LOG_VERBOSE("CSilo_IMS::ParseCIREPI() - Exit\r\n"); return fRet; }
// // RIL_REQUEST_BASEBAND_VERSION // RIL_RESULT_CODE CTE_XMM2230::CoreBasebandVersion(REQUEST_DATA& rReqData, void* pData, UINT32 uiDataSize) { RIL_LOG_VERBOSE("CTE_XMM2230::CoreBasebandVersion() - Enter\r\n"); RIL_RESULT_CODE res = RRIL_RESULT_ERROR; if (CopyStringNullTerminate(rReqData.szCmd1, "at+xgendata\r", sizeof(rReqData.szCmd1))) { res = RRIL_RESULT_OK; } RIL_LOG_VERBOSE("CTE_XMM2230::CoreBasebandVersion() - Exit\r\n"); return res; }
CSilo_rfcoexistence::CSilo_rfcoexistence(CChannel* pChannel) : CSilo(pChannel) { RIL_LOG_VERBOSE("CSilo_rfcoexistence::CSilo_rfcoexistence() - Enter\r\n"); // AT Response Table static ATRSPTABLE pATRspTable[] = { { "+XMETRIC: " , (PFN_ATRSP_PARSE)&CSilo_rfcoexistence::ParseXMETRIC }, { "+XNRTCWSI: " , (PFN_ATRSP_PARSE)&CSilo_rfcoexistence::ParseXNRTCWSI }, { "" , (PFN_ATRSP_PARSE)&CSilo_rfcoexistence::ParseNULL } }; m_pATRspTable = pATRspTable; RIL_LOG_VERBOSE("CSilo_rfcoexistence::CSilo_rfcoexistence() - Exit\r\n"); }
void triggerQueryDefaultPDNContextParams(void* param) { REQUEST_DATA rReqData; memset(&rReqData, 0, sizeof(REQUEST_DATA)); CChannel_Data* pChannelData = NULL; UINT32 uiCID = 0; if (param == NULL) return; pChannelData = (CChannel_Data*)param; uiCID = pChannelData->GetContextID(); RIL_LOG_VERBOSE("triggerQueryDefaultPDNContextParams - uiCID: %u\r\n", uiCID); if (PrintStringNullTerminate(rReqData.szCmd1, sizeof(rReqData.szCmd1), "AT+CGCONTRDP=%u\r", uiCID)) { CCommand* pCmd = new CCommand(pChannelData->GetRilChannel(), NULL, REQ_ID_NONE, rReqData, &CTE::ParseReadContextParams, &CTE::PostReadDefaultPDNContextParams); if (pCmd) { if (!CCommand::AddCmdToQueue(pCmd)) { RIL_LOG_CRITICAL("triggerQueryDefaultPDNContextParams - " "Unable to queue AT+CGCONTRDP command!\r\n"); delete pCmd; } } } }
int MapErrorCodeToRilDataFailCause(UINT32 uiCause) { RIL_LOG_VERBOSE("MapErrorCodeToRilDataFailCause() - Enter\r\n"); switch (uiCause) { case CEER_CAUSE_OPERATOR_DETERMINED_BARRING: return PDP_FAIL_OPERATOR_BARRED; case CEER_CAUSE_INSUFFICIENT_RESOURCES: return PDP_FAIL_INSUFFICIENT_RESOURCES; case CEER_CAUSE_MISSING_UNKNOWN_APN: return PDP_FAIL_MISSING_UKNOWN_APN; case CEER_CAUSE_UNKNOWN_PDP_ADDRESS_TYPE: return PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE; case CEER_CAUSE_USER_AUTHENTICATION_FAILED: return PDP_FAIL_USER_AUTHENTICATION; case CEER_CAUSE_ACTIVATION_REJECTED_BY_GGSN: return PDP_FAIL_ACTIVATION_REJECT_GGSN; case CEER_CAUSE_ACTIVATION_REJECT_UNSPECIFIED: return PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED; case CEER_CAUSE_OPTION_NOT_SUPPORTED: return PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED; case CEER_CAUSE_OPTION_NOT_SUBSCRIBED: return PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED; case CEER_CAUSE_OPTION_TEMP_OUT_OF_ORDER: return PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER; case CEER_CAUSE_NSPAI_ALREADY_USED: return PDP_FAIL_NSAPI_IN_USE; case CEER_CAUSE_PDP_AUTHENTICATION_FAILURE: return PDP_FAIL_USER_AUTHENTICATION; default: return PDP_FAIL_ERROR_UNSPECIFIED; } }
// CContextEvent void CContextEvent::Execute(BOOL bRes, UINT32 /*uiErrorCode*/) { if (bRes) { RIL_LOG_VERBOSE("CContextEvent::Execute() - Signalling event!\r\n"); CEvent::Signal(&m_pEvent); } }
// // IMS-SRVCC sync notification // BOOL CSilo_IMS::ParseXISRVCCI(CResponse* const pResponse, const char*& rszPointer) { RIL_LOG_VERBOSE("CSilo_IMS::ParseXISRVCCI() - Enter\r\n"); BOOL fRet = FALSE; UINT32 uiSrvccHoStatus = 0; char szAlpha[MAX_BUFFER_SIZE]; sOEM_HOOK_RAW_UNSOL_IMS_SRVCC_HO_STATUS data; if (NULL == pResponse) { RIL_LOG_CRITICAL("CSilo_IMS::ParseXISRVCCI() - pResponse is NULL.\r\n"); goto Error; } pResponse->SetUnsolicitedFlag(TRUE); // Throw out the alpha chars if there are any (void)ExtractQuotedString(rszPointer, szAlpha, MAX_BUFFER_SIZE, rszPointer); // Parse "<srvcc_ho_status>" if (!ExtractUInt32(rszPointer, uiSrvccHoStatus, rszPointer)) { RIL_LOG_CRITICAL("CSilo_IMS::ParseXISRVCCI() - Could not parse SRVCC HO" "status indication\r\n"); goto Error; } data.command = RIL_OEM_HOOK_RAW_UNSOL_IMS_SRVCC_HO_STATUS; data.status = uiSrvccHoStatus; RIL_LOG_VERBOSE("CSilo_IMS::ParseXISRVCCI() - XISRVCC=[%u]\r\n", uiSrvccHoStatus); pResponse->SetResultCode(RIL_UNSOL_OEM_HOOK_RAW); if (!pResponse->SetData((void*)&data, sizeof(sOEM_HOOK_RAW_UNSOL_IMS_SRVCC_HO_STATUS), TRUE)) { goto Error; } fRet = TRUE; Error: RIL_LOG_VERBOSE("CSilo_IMS::ParseXISRVCCI() - Exit\r\n"); return fRet; }
CSilo_MISC::CSilo_MISC(CChannel* pChannel, CSystemCapabilities* pSysCaps) : CSilo(pChannel, pSysCaps) { RIL_LOG_VERBOSE("CSilo_MISC::CSilo_MISC() - Enter\r\n"); // AT Response Table static ATRSPTABLE pATRspTable[] = { { "+XDRVI: " , (PFN_ATRSP_PARSE)&CSilo_MISC::ParseXDRVI }, { "+XMETRIC: " , (PFN_ATRSP_PARSE)&CSilo_MISC::ParseXMETRIC }, { "+XNRTCWSI: " , (PFN_ATRSP_PARSE)&CSilo_MISC::ParseXNRTCWSI }, { "" , (PFN_ATRSP_PARSE)&CSilo_MISC::ParseNULL } }; m_pATRspTable = pATRspTable; RIL_LOG_VERBOSE("CSilo_MISC::CSilo_MISC() - Exit\r\n"); }
CSilo_Data::CSilo_Data(CChannel* pChannel) : CSilo(pChannel) { RIL_LOG_VERBOSE("CSilo_Data::CSilo_Data() - Enter\r\n"); // AT Response Table static ATRSPTABLE pATRspTable[] = { { "NO CARRIER" , (PFN_ATRSP_PARSE)&CSilo_Data::ParseNoCarrier }, { "+XCIEV: " , (PFN_ATRSP_PARSE)&CSilo_Data::ParseUnrecognized }, { "+XCIEV:" , (PFN_ATRSP_PARSE)&CSilo_Data::ParseUnrecognized }, { "" , (PFN_ATRSP_PARSE)&CSilo_Data::ParseNULL } }; m_pATRspTable = pATRspTable; RIL_LOG_VERBOSE("CSilo_Data::CSilo_Data() - Exit\r\n"); }
BOOL CPort::WaitForAvailableData(UINT32 uiTimeout) { RIL_LOG_VERBOSE("CPort::WaitForAvailableData() - Enter\r\n"); BOOL fRet = FALSE; UINT32 uiMask = 0; if (m_fIsPortOpen) { fRet = CFile::WaitForEvent(m_pFile, uiMask, uiTimeout); if(fRet) { if (uiMask & FILE_EVENT_ERROR) { RIL_LOG_CRITICAL("CPort::WaitForAvailableData() - FILE_EVENT_ERROR received" " on port\r\n"); } if (uiMask & FILE_EVENT_BREAK) { RIL_LOG_INFO("CPort::WaitForAvailableData() - FILE_EVENT_BREAK received on" " port\r\n"); } if (uiMask & FILE_EVENT_RXCHAR) { fRet = TRUE; } } else { RIL_LOG_CRITICAL("CPort::WaitForAvailableData() - Returning failure\r\n"); } } else { CModemRestart::SaveRequestReason(3, "Port is not open", "", CFile::GetName(m_pFile)); RIL_LOG_CRITICAL("CPort::WaitForAvailableData() - Port is not open!\r\n"); } Error: RIL_LOG_VERBOSE("CPort::WaitForAvailableData() - Exit\r\n"); return fRet; }
void triggerQueryBearerParams(void* param) { REQUEST_DATA rReqDataTFT; REQUEST_DATA rReqDataQOS; memset(&rReqDataTFT, 0, sizeof(REQUEST_DATA)); memset(&rReqDataQOS, 0, sizeof(REQUEST_DATA)); CChannel_Data* pChannelData = NULL; UINT32 uiPCID = 0; UINT32 uiCID = 0; void** callbackParams = NULL; if (param == NULL) return; callbackParams = (void**)param; uiPCID = (UINT32)callbackParams[0]; uiCID = (UINT32)callbackParams[1]; pChannelData = (CChannel_Data*)callbackParams[2]; delete callbackParams; RIL_LOG_VERBOSE("triggerQueryBearerParams - uiPCID: %u, uiCID: %u\r\n", uiPCID, uiCID); if (PrintStringNullTerminate(rReqDataTFT.szCmd1, sizeof(rReqDataTFT.szCmd1), "AT+CGTFTRDP=%u\r", uiCID)) { CCommand* pCmdTFT = new CCommand(pChannelData->GetRilChannel(), NULL, REQ_ID_NONE, rReqDataTFT, &CTE::ParseReadBearerTFTParams); if (pCmdTFT) { if (!CCommand::AddCmdToQueue(pCmdTFT)) { RIL_LOG_CRITICAL("triggerQueryBearerParams - " "Unable to queue AT+CGTFTRDP command!\r\n"); delete pCmdTFT; } } } if (PrintStringNullTerminate(rReqDataQOS.szCmd1, sizeof(rReqDataQOS.szCmd1), "AT+CGEQOS=%u\r", uiCID)) { CCommand* pCmdQOS = new CCommand(pChannelData->GetRilChannel(), NULL, REQ_ID_NONE, rReqDataQOS, &CTE::ParseReadBearerQOSParams); if (pCmdQOS) { if (!CCommand::AddCmdToQueue(pCmdQOS)) { RIL_LOG_CRITICAL("triggerQueryBearerParams - " "Unable to queue AT+CGEQOS command!\r\n"); delete pCmdQOS; } } } }
CInitializer* CTE_XMM2230::GetInitializer() { RIL_LOG_VERBOSE("CTE_XMM2230::GetInitializer() - Enter\r\n"); CInitializer* pRet = NULL; RIL_LOG_INFO("CTE_XMM2230::GetInitializer() - Creating CInit2230 initializer\r\n"); m_pInitializer = new CInit2230(); if (NULL == m_pInitializer) { RIL_LOG_CRITICAL("CTE_XMM2230::GetInitializer() - Failed to create a CInit2230 " "initializer!\r\n"); goto Error; } pRet = m_pInitializer; Error: RIL_LOG_VERBOSE("CTE_XMM2230::GetInitializer() - Exit\r\n"); return pRet; }
CSilo_IMS::CSilo_IMS(CChannel* pChannel) : CSilo(pChannel) { RIL_LOG_VERBOSE("CSilo_IMS::CSilo_IMS() - Enter\r\n"); // AT Response Table static ATRSPTABLE pATRspTable[] = { { "+CIREPI: " , (PFN_ATRSP_PARSE)&CSilo_IMS::ParseCIREPI }, { "+CIREPH: " , (PFN_ATRSP_PARSE)&CSilo_IMS::ParseCIREPH }, { "+CIREGU: " , (PFN_ATRSP_PARSE)&CSilo_IMS::ParseCIREGU }, { "+XISRVCCI: " , (PFN_ATRSP_PARSE)&CSilo_IMS::ParseXISRVCCI }, { "+XISRVCCSTATI: " , (PFN_ATRSP_PARSE)&CSilo_IMS::ParseUnrecognized }, // FIXME: Following strings to be confirmed and parsed. { "+IMSCALLSTAT: " , (PFN_ATRSP_PARSE)&CSilo_IMS::ParseNULL }, { "+IMSSMSSTAT: " , (PFN_ATRSP_PARSE)&CSilo_IMS::ParseNULL }, { "" , (PFN_ATRSP_PARSE)&CSilo_IMS::ParseNULL } }; m_pATRspTable = pATRspTable; RIL_LOG_VERBOSE("CSilo_IMS::CSilo_IMS() - Exit\r\n"); }
BOOL CellInfoCache::updateCache(const P_ND_N_CELL_INFO_DATA pData, const INT32 aItemsCount) { BOOL ret = FALSE; RIL_LOG_VERBOSE("CellInfoCache::updateCache() - aItemsCount %d \r\n",aItemsCount); if (NULL == pData || aItemsCount > RRIL_MAX_CELL_ID_COUNT) { RIL_LOG_INFO("CellInfoCache::updateCache() - Invalid data\r\n"); goto Error; } else { // if there were more items in the cache before if (aItemsCount != m_iCacheSize) { ret = TRUE; } else { for (INT32 storeIndex= 0; storeIndex < aItemsCount; storeIndex++) { if (checkCache(pData->pnCellData[storeIndex]) < 0 ) // new item { ret = TRUE; break; } } } } if (ret) { RIL_LOG_INFO("CellInfoCache::updateCache() -" "Updating cache with %d items\r\n", aItemsCount); // Access mutex CMutex::Lock(m_pCacheLock); m_iCacheSize = aItemsCount; memset(&m_sCellInfo, 0, sizeof(S_ND_N_CELL_INFO_DATA)); for (INT32 j = 0; j < m_iCacheSize; j++) { m_sCellInfo.pnCellData[j] = pData->pnCellData[j]; } // release mutex CMutex::Unlock(m_pCacheLock); } Error: return ret; }
CSilo_MISC::~CSilo_MISC() { RIL_LOG_VERBOSE("CSilo_MISC::~CSilo_MISC() - Enter\r\n"); RIL_LOG_VERBOSE("CSilo_MISC::~CSilo_MISC() - Exit\r\n"); }
// // Thermal sensor notification // BOOL CSilo_MISC::ParseXDRVI(CResponse* const pResponse, const char*& rszPointer) { RIL_LOG_VERBOSE("CSilo_MISC::ParseXDRVI() - Enter\r\n"); BOOL fRet = FALSE; sOEM_HOOK_RAW_UNSOL_THERMAL_ALARM_IND* pData = NULL; UINT32 nIpcChrGrp; UINT32 nIpcChrTempThresholdInd; UINT32 nXdrvResult; UINT32 nSensorId; UINT32 nTemp; if (NULL == pResponse) { RIL_LOG_CRITICAL("CSilo_MISC::ParseXDRVI() - pResponse is NULL.\r\n"); goto Error; } pResponse->SetUnsolicitedFlag(TRUE); // Extract "<IPC_CHR_GRP>" if (!ExtractUInt32(rszPointer, nIpcChrGrp, rszPointer)) { RIL_LOG_CRITICAL("CSilo_MISC::ParseXDRVI() - Could not parse nIpcChrGrp.\r\n"); goto Error; } // Parse <IPC_CHR_TEMP_THRESHOLD_IND> if (!SkipString(rszPointer, ",", rszPointer) || !ExtractUInt32(rszPointer, nIpcChrTempThresholdInd, rszPointer)) { RIL_LOG_CRITICAL("CSilo_MISC::ParseXDRVI() -" " Unable to parse <IPC_CHR_TEMP_THRESHOLD_IND>!\r\n"); goto Error; } // Parse <xdrv_result> if (!SkipString(rszPointer, ",", rszPointer) || !ExtractUInt32(rszPointer, nXdrvResult, rszPointer)) { RIL_LOG_CRITICAL("CSilo_MISC::ParseXDRVI() - Unable to parse <xdrv_result>!\r\n"); goto Error; } // Parse <temp_sensor_id> if (!SkipString(rszPointer, ",", rszPointer) || !ExtractUInt32(rszPointer, nSensorId, rszPointer)) { RIL_LOG_CRITICAL("CSilo_MISC::ParseXDRVI() - Unable to parse <temp_sensor_id>!\r\n"); goto Error; } // Parse <temp> if (!SkipString(rszPointer, ",", rszPointer) || !ExtractUInt32(rszPointer, nTemp, rszPointer)) { RIL_LOG_CRITICAL("CSilo_MISC::ParseXDRVI() - Unable to parse <temp>!\r\n"); goto Error; } RIL_LOG_INFO("CSilo_MISC::ParseXDRVI - IPC_CHR_GRP: %u, IPC_CHR_TEMP_THRESHOLD_IND: %u," " xdrv_result: %u\r\n", nIpcChrGrp, nIpcChrTempThresholdInd, nXdrvResult); RIL_LOG_INFO("CSilo_MISC::ParseXDRVI - temp_sensor_id: %u, temp: %u\r\n", nSensorId, nTemp); pData = (sOEM_HOOK_RAW_UNSOL_THERMAL_ALARM_IND*)malloc( sizeof(sOEM_HOOK_RAW_UNSOL_THERMAL_ALARM_IND)); if (NULL == pData) { RIL_LOG_CRITICAL("CSilo_MISC::ParseXDRVI() - Could not allocate memory for pData.\r\n"); goto Error; } memset(pData, 0, sizeof(sOEM_HOOK_RAW_UNSOL_THERMAL_ALARM_IND)); pData->nCommand = RIL_OEM_HOOK_RAW_UNSOL_THERMAL_ALARM_IND; pData->nSensorId = nSensorId; pData->nTemp = nTemp; pResponse->SetResultCode(RIL_UNSOL_OEM_HOOK_RAW); if (!pResponse->SetData((void*)pData, sizeof(sOEM_HOOK_RAW_UNSOL_THERMAL_ALARM_IND), FALSE)) { goto Error; } fRet = TRUE; Error: if (!fRet) { free(pData); pData = NULL; } RIL_LOG_VERBOSE("CSilo_MISC::ParseXDRVI() - Exit\r\n"); return fRet; }
CChannel_ATCmd::CChannel_ATCmd(UINT32 uiChannel) : CChannel(uiChannel) { RIL_LOG_VERBOSE("CChannel_ATCmd::CChannel_ATCmd() - Enter\r\n"); RIL_LOG_VERBOSE("CChannel_ATCmd::CChannel_ATCmd() - Exit\r\n"); }
BOOL CPort::Init() { RIL_LOG_VERBOSE("CPort::Init() - Enter\r\n"); BOOL fRet = FALSE; int fd = 0; int bit = 0; int flag; struct termios oldtio; struct termios newtio; if (m_fIsPortOpen) { fd = CFile::GetFD(m_pFile); if (fd >= 0) { // save current port settings tcgetattr(fd,&oldtio); // switch TTY to NON BLOCKING mode for Rd/Wr RRIL operations flag = fcntl(fd, F_GETFL, 0); flag |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flag) < 0) perror("fcntl()"); bzero(&newtio, sizeof(newtio)); newtio.c_cflag = B115200; newtio.c_cflag |= CS8 | CLOCAL | CREAD; newtio.c_iflag &= ~(INPCK | IGNPAR | PARMRK | ISTRIP | IXANY | ICRNL); newtio.c_oflag &= ~OPOST; newtio.c_cc[VMIN] = 1; newtio.c_cc[VTIME] = 10; // set input mode (non-canonical, no echo,...) newtio.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); //newtio.c_lflag &= ~(ICANON | ISIG); //newtio.c_cc[VTIME] = 1000; /* inter-character timer unused */ //newtio.c_cc[VMIN] = 1; /* blocking read until 5 chars received */ tcflush(fd, TCIFLUSH); tcsetattr(fd,TCSANOW,&newtio); bit = TIOCM_DTR; /* if(ioctl(fd, TIOCMBIS, &bit)) { RIL_LOG_CRITICAL("CPort::Init() - ioctl(%d, 0x%x, 0x%x) failed with error=" " %d\r\n", errno); } else { fRet = TRUE; } */ fRet = TRUE; } else { RIL_LOG_CRITICAL("CPort::Init() - File descriptor was negative!\r\n"); } } else { RIL_LOG_CRITICAL("CPort::Init() - Port is not open!\r\n"); } RIL_LOG_VERBOSE("CPort::Init() - Exit\r\n"); return fRet; }