BST_UINT8 *BST_APP_CEmailIMAP::SetImapIDCmd( const BST_UINT8 *pucImapIDCmd, BST_UINT16 usLen ) { BST_ERR_ENUM_UINT8 enRtnVal; if ( BST_NULL_PTR == pucImapIDCmd ) { return BST_NULL_PTR; } if ( 0 == usLen ) { return BST_NULL_PTR; } if ( BST_NULL_PTR == m_pstrImapIDCmd ) { BST_RLS_LOG( "BST_APP_CEmailExchange::SetDeviceID m_pDeviceID=NULL" ); return BST_NULL_PTR; } enRtnVal = BST_LIB_StrFill( m_pstrImapIDCmd, pucImapIDCmd, usLen ); BST_ASSERT_NORM_RTN( (BST_NO_ERROR_MSG != enRtnVal), BST_NULL_PTR ); return ( BST_UINT8 *)(m_pstrImapIDCmd->pData); }
BST_ERR_ENUM_UINT8 BST_SRV_CHNL_Acked ( BST_SRV_CHNL_LINK_STRU *pstLinkItem, const BST_UINT32 ulMinNumber, const BST_UINT32 ulMaxNumber ) { BST_SRV_CHNL_SENT_STRU *pSentItem; BST_SRV_CHNL_SENT_STRU *pSentItem2; BST_SRV_CHNL_HEAD_STRU *pstPktItem; BST_SRV_CHNL_HEAD_STRU *pstPktItem2; BST_UINT32 ulSpinlockCnt; BST_UINT32 ulOrigCounter; BST_DRV_STRU *pNetDrvHandle; BST_ERR_ENUM_UINT8 enRtnVal; BST_ASSERT_NULL_RTN( pstLinkItem, BST_ERR_INVALID_PTR ); BST_ASSERT_NORM_RTN( ulMaxNumber < ulMinNumber, BST_ERR_ILLEGAL_PARAM ); BST_DBG_LOG2( "BST_SRV_CHNL_Acked ulMinNumber, ulMaxNumber", ulMinNumber, ulMaxNumber ); /*查找已发送的数据包的*/ pSentItem = BST_SRV_Q_PeekHead(pstLinkItem->pSentList); ulOrigCounter = g_ulHighPriCnt; pSentItem2 = BST_NULL_PTR; pstPktItem2 = BST_NULL_PTR; while( pSentItem != BST_NULL_PTR ) { if ( ( pSentItem->ulAckNo > ulMinNumber ) &&( pSentItem->ulAckNo <=ulMaxNumber ) ) { if( BST_DSPP_FLG_LVLTYPE_HS == pSentItem->usProcLevel ) { ulSpinlockCnt = BST_OS_SpinLock( &g_HighPriCntSpinLock ); if ( g_ulHighPriCnt > 0 ) { g_ulHighPriCnt--; } BST_OS_SpinUnLock( &g_HighPriCntSpinLock , ulSpinlockCnt ); } BST_DBG_LOG1("BST_SRV_CHNL_Acked,g_ulHighPriCnt--",g_ulHighPriCnt); BST_SRV_Q_RmvItem( (BST_SRV_CHNL_Q **)&pstLinkItem->pSentList, (BST_SRV_CHNL_Q *)pSentItem, (BST_SRV_CHNL_Q **)&pSentItem2 ); BST_OS_FREE( pSentItem ); } else { pSentItem2 = pSentItem->pNext; } pSentItem = pSentItem2; } pstPktItem = BST_SRV_Q_PeekHead(pstLinkItem->pUnsendList); while ( pstPktItem != BST_NULL_PTR ) { if( BST_IP_SKT_PROP_NONE != pstPktItem->ucPropType ) { if( ( ( pstPktItem->stProp.ulSeqNum + pstPktItem->ulUsed ) > ulMinNumber ) &&( ( pstPktItem->stProp.ulSeqNum + pstPktItem->ulUsed ) <=ulMaxNumber ) ) { BST_SRV_Q_RmvItem( (BST_SRV_CHNL_Q **)&pstLinkItem->pUnsendList, (BST_SRV_CHNL_Q *)pstPktItem, (BST_SRV_CHNL_Q **)&pstPktItem2 ); BST_SRV_FreeIpBlock( pstPktItem ); } else { pstPktItem2 = pstPktItem->pNext; } } else { pstPktItem2 = pstPktItem->pNext; } pstPktItem = pstPktItem2; } enRtnVal = BST_NO_ERROR_MSG; if( BST_NULL_PTR != pstLinkItem->pUnsendList ) { BST_OS_TimerStop( pstLinkItem->ulTimerId ); BST_DBG_LOG( "BST_SRV_CHNL_Acked, Proc Unsent List" ); enRtnVal = BST_SRV_CHNL_ProcInCB( pstLinkItem ); } /** * 刚刚有值,现在无值,那么说明全部高优先数据发送完成 */ if( ( 0 != ulOrigCounter ) && ( 0 == g_ulHighPriCnt ) ) { pNetDrvHandle = BST_DRV_NetGetDvcHandle(); enRtnVal = 0; pNetDrvHandle->pfIoCtrl( BST_DRV_CMD_HPR_DATA_FINISH, (BST_VOID *)&enRtnVal ); BST_DBG_LOG( "BST_SRV_CHNL_Acked, BST_DRV_CMD_HPR_DATA_FINISH" ); } return enRtnVal; }