这个Flash功能是怎么做的?

闲茶良味 2011-06-13 10:06:41
比如 我转了 优酷的Flash 但是不想他的广告点下就弹出来有什么可以控制
...全文
181 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
fsk_wyf 2012-03-01
  • 打赏
  • 举报
回复

处理数据加载函数
UINT32 ProcSegmentDownLoad(UCHAR ucChanNum,UCHAR ucAddr, UINT32 ulPos, PCCU485_QueryInfoT pMsg)
UCHAR ucNetFn = j1;UCHAR ucCmd = j1;UCHAR aucData[4] = {0};UINT32 ulResId = j3;
UINT16 uwHandle = j2;UINT32 ulRet = CCU_OK;UINT32 ulBlkTmp = j3;UINT32 ulCurBlk = j3;
UINT32 ulSchdule = 0;
CHECK_PARA1_NULL_RN(pMsg, CCU_ERR_MPI_INVALID_PARAMS);uwHandle = y5.uwHandle;y9;y8;
/* 上报上来的帧数 */ulBlkTmp = (UINT32)(pMsg->pData[3] << 8) + pMsg->pData[4];
ulCurBlk = y5.ulCurBlk;DBG_DOWNLOAD; ucNetFn = CCU_485LOAD_TYPE;ucCmd = CCU_485_LOAD_EXC_CMD;
if (CCU_OK == pMsg->pData[2]){if (ulCurBlk == ulBlkTmp + 1){if ( y5.ulCurBlk == y5.ulTotalBlk )
{/* 定时器终止 */y5.ucWaitTime = j1;y5.ucTimeCnt = 0;y5.ucRepeatTime = LOAD_RESEND_TIME;
y5.ucLoadState = END_DOWNLOAD_SEND;
ulRet = RS485RqNormal(ulResId, (UINT16)ulPos, uwHandle, ucNetFn, ucCmd, aucData, 0);y8;}
else{/* 定时器终止 */y5.ucWaitTime = j1;y5.ucTimeCnt = 0;y5.ucRepeatTime = LOAD_RESEND_TIME;
y5.ucLoadState = LOAD_SEGMENT_SEND; if (0 == y5.ulCurBlk % 20 ){
ulSchdule = (y5.ulCurBlk * 100) / y5.ulTotalBlk;DBG_DOWNLOAD;ulRet = ReportLoadSchedToPdt(y5.ulResourceId,\
y5.enLoadType,ulSchdule);}
ulRet = RS485RqNormal(ulResId, (UINT16)ulPos, uwHandle, ucNetFn, ucCmd, aucData, sizeof(aucData));
y8;} }else{/* 如果收到已经处理过的重复帧或错误帧,扔掉不处理了 */return CCU_OK;} }
else{DBG_DOWNLOAD;return CCU_485_ERR_QUREYCMDERR;}return ulRet;
处理结束加载函数
UINT32 ProcEndDownLoad(UCHAR ucChanNum,UCHAR ucAddr, UINT32 ulPos, PCCU485_QueryInfoT pMsg)
UCHAR ucNetFn = j1;UCHAR ucCmd = j1;UCHAR aucData[4] = {0};
UINT32 ulResId = j3;UINT16 uwHandle = j2;UINT32 ulRet = CCU_OK;
CHECK;uwHandle = y5.uwHandle;y9;y8;DBG_DOWNLOAD;ucNetFn = CCU_485LOAD_TYPE;
ucCmd = CCU_485_LOAD_EXC_CMD;/* 如果收到结束加载的响应,则转到下一个状态机 */
if (CCU_OK == pMsg->pData[2]){ /* 定时器终止 */y5.ucWaitTime = j1;y5.ucTimeCnt = 0;
y5.ucLoadState = ACTIVE_APP_SEND;
ulRet = RS485RqNormal(ulResId, (UINT16)ulPos, uwHandle, ucNetFn, ucCmd, aucData, 0);
y8;}else{ return CCU_485_ERR_QUREYCMDERR;}return ulRet;
fsk_wyf 2012-03-01
  • 打赏
  • 举报
回复

遍历加载控制表
UINT32 FindLoadDownTabPos(PCCU485_QueryInfoT pMsg,UINT32 *pos, UINT16 uwSeq)
UCHAR ucChanNum = j1;UCHAR ucAddr = j1;PRS485_BOARD_T pstNode = CCU_NULL_PTR;
UINT32 i = 0;CHECK;CHECK_PARA1_NULL_RN(pos, CCU_ERR_MPI_INVALID_PARAMS);
ucChanNum = pMsg->Chan_Num;ucAddr = pMsg->Addr;
pstNode = g_stCCUChan[ucChanNum].pstNodeList[ucAddr];
CHECK_PARA1_NULL_RN(pstNode, CCU_485_ERR_NODE_INIT);
for ( i = 0 ; i < MAX_NODE_NUM; i++ ){
if ((CCU_TRUE == y6.ucUseFlg) && (uwSeq == y6.uwHandle)
&& (pMsg->Chan_Num == Get485ChanNo(y6.ulResourceId))
&& (pMsg->Addr == Get485NodeAddr(y6.ulResourceId))
&& ((pMsg->Cmd2 == 0xfb) || (pMsg->Cmd2 == 0xfe)
|| (pMsg->Cmd2 == 0xf0) || (pMsg->Cmd2 == 0xf1) || (pMsg->Cmd2 == 0xf2) || ((pMsg->Cmd2 == 0xf3)))
&& (pMsg->Cmd1 == 0xe1)){*pos = i; return CCU_OK;}}return CCU_ERR;
处理加载APP软件开始加载命令
UINT32 ProcStartDownLoad(UCHAR ucChanNum,UCHAR ucAddr, UINT32 ulPos, PCCU485_QueryInfoT pMsg)
UCHAR ucNetFn = j1;UCHAR ucCmd = j1;UCHAR aucData[4] = {0};UINT32 ulResId = j3;
UINT16 uwHandle = j2;UINT32 ulRet = CCU_OK;CCU_LOAD_TYPE_ENUM enType = CCU_LOAD_BOARD_INVALID;
CHECK;uwHandle = y5.uwHandle;enType = y5.enLoadType;
y9;y8;DBG_DOWNLOAD; if (CCU_OK == pMsg->pData[2]){y5.ucLoadState = LOAD_SEGMENT_SEND;
/* 定时器终止 */y5.ucWaitTime = j1;y5.ucTimeCnt = 0;ucNetFn = CCU_485LOAD_TYPE;
ucCmd = CCU_485_LOAD_EXC_CMD;/* 此处原来是要传入节点地址,检视代码发现后来没有用,暂时去掉 */
ulRet = RS485RqNormal(ulResId, (UINT16)ulPos, uwHandle, ucNetFn, ucCmd, aucData, 0);
if (CCU_OK != ulRet){ConvRetToRet(ulRet);ReportLoadSchedToPdt(ulResId, enType, ulRet);
CCU485ClearLoadData(ucChanNum, (UINT16)ulPos);DBG_DOWNLOAD;return ulRet;}
/* 写命令到队列中执行状态机 */}else{DBG_DOWNLOAD;return CCU_485_ERR_QUREYCMDERR;}
return CCU_OK;
fsk_wyf 2012-03-01
  • 打赏
  • 举报
回复

获取电子标签API接口中内部执行函数
UINT32 Rs485_FruInfoGet(UINT32 ulresId,UCHAR ucNetFn,UCHAR ucCmd,
UCHAR *pucFruInfo,UINT32 ulInputLen,UINT32 *pulLen)
UCHAR ucChanIndex = j1;UINT16 uwIndex = j2;UINT16 uwHandle = j2;
UINT32 ulRet = CCU_ERR;UCHAR *pTmpInfo = CCU_NULL_PTR; pTmpInfo = pucFruInfo;
/* 把相关信息加到电子标签获取控制表中 */CHECK;ucChanIndex = Get485ChanNo(ulresId);
if ( ucChanIndex >= MAX_CCU_CHAN_NUM ){return CCU_ERR_MPI_INVALID_PARAMS;}
ulRet = RS485AddRqToFruTxTab(ulresId,ucNetFn,ucCmd,&uwIndex, &uwHandle, (LABEL_TYPE)(*pTmpInfo));
CHECK_FUNC_RTN_VALUE(ulRet, CCU_OK, ulRet);
/* 获取电子标签只是把把命令传到485任务中去,并不需要传递数据,此时的ullen是0 */
ulRet = RS485Rq(ulresId, uwIndex, uwHandle, ucNetFn, ucCmd, pTmpInfo, ulInputLen);
if ( CCU_OK != ulRet){DBG_DOWNLOAD;(VOID)DelRqFromRS485FruTxTab(uwIndex,ucChanIndex); return ulRet;}
return CCU_OK;
设备电子标签加载
UINT32 Rs485GetDevFruInfo(UINT32 ulresId,CHAR *pcFruInfo,UINT32 ulInputLen,UINT32 *pulLen)
UINT32 ulRet = CCU_ERR;UCHAR ucNetFn = j1;UCHAR ucCmd = j1;
UINT32 ulLen = j3;CHAR *pTmpFruInfo = CCU_NULL_PTR;CHECK;pTmpFruInfo = pcFruInfo;
ucNetFn = CCU_485LOAD_TYPE;ucCmd = SMS_485_GET_FRU_CMD;/* 高层软件传下来的长度 */
ulLen = *pulLen;
ulRet = Rs485_FruInfoGet(ulresId, ucNetFn, ucCmd, (UCHAR *)pTmpFruInfo, ulInputLen, &ulLen);
CHECK_FUNC_RTN_VALUE(ulRet, CCU_OK, ulRet);*pulLen = ulLen;return CCU_OK;
获取电子标签是同步接口,如果中间过程中有错误,则调用此接口把返回
UINT32 PutResultToFruTxTab(UINT32 ulRet, PDOWN_485_FRAME pSt485Msg, UINT32 ulLen, UCHAR* pucData)
UINT16 uwSeq = j2;UCHAR ucChanNum = j1;UCHAR ucNodeNum = j1;UINT32 ulRetTemp = CCU_ERR;
/* pucData 预留用,暂不指针检测 */CHECK;uwSeq = pSt485Msg->uwSeq;
ulRetTemp = IsResIdRight(pSt485Msg->ulResId, &ucChanNum, &ucNodeNum);
CHECK_RET_OK_RN(ulRetTemp, ulRetTemp);/* 如果uwSeq大于最大的单元数 说明系统出现了异常
但是这里存在着风险 也就是如果出现了不匹配的情况
不会释放信号量 会导致被错传的哪个信号量挂死,所以API中是使用了超时处理)属于系统异常)*/
if (uwSeq >= g_ast485GetFruTab[ucChanNum].uwSize){DBG_DOWNLOAD;return CCU_ERR_MPI_INVALID_PARAMS;}
/* 根据响应中的seq找到Api请求发送表中相应的请求,判定响应与请求的对应关系 */
if ( (CCU_TRUE == y4.ucUseFlg)&&(pSt485Msg->ulResId == y4.ulResId)
&&(pSt485Msg->ucNetFn == y4.ucNetFn) &&(pSt485Msg->ucCmd == y4.ucCmd)){
/* 保存完成码 */if (CCU_OK == ulRet){/* 完成码是OK的时候 不做偏移 否则加上偏移量0x8000 */
y4.ulCompCode = 0;}else{y4.ulCompCode = 0x8000 | (ulRet & 0xFF);}DelRqFromRS485FruTxTab(uwSeq, ucChanNum);
return CCU_OK;}/* 如果匹配不上 为了防止挂死 也释放信号量 */else{y4.ulCompCode = CCU_ERR_DATA_ABNORMAL;
return CCU_ERR_MPI_UNMATCH_RESP; }
如此美丽的你 2011-12-14
  • 打赏
  • 举报
回复
如此美丽的你 2011-12-14
  • 打赏
  • 举报
回复
yosyg 2011-09-21
  • 打赏
  • 举报
回复
可以装个栏截广告的插件
uncle_bacon 2011-09-14
  • 打赏
  • 举报
回复
可以装个栏截广告的插件
小贝壳666 2011-08-13
  • 打赏
  • 举报
回复
浏览器可以装个栏截广告的插件
wabcajs 2011-07-15
  • 打赏
  • 举报
回复
什么状况. 没看懂 3_3
yxfacw 2011-07-03
  • 打赏
  • 举报
回复
额,这貌似他的视频你能把广告去了?
x357146493 2011-06-24
  • 打赏
  • 举报
回复
老子是来灌水拿分的!
porschev 2011-06-13
  • 打赏
  • 举报
回复

那估计不行。。。

1,977

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧