小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

任務(wù)處理函數(shù)_ProcessEvent

 xingwangjy 2014-12-24

//任務(wù)處理函數(shù)
UINT16 GenericApp_ProcessEvent( byte task_id, UINT16 events )
{
  //定義應(yīng)用層數(shù)據(jù)包
  afIncomingMSGPacket_t *MSGpkt;

//如果系統(tǒng)消息到來
  if ( events & SYS_EVENT_MSG )
  {
    //接收數(shù)據(jù)包
    MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( GenericApp_TaskID );
   
    //如果數(shù)據(jù)包不為空
    while ( MSGpkt )
    {

  //判斷消息類型
      switch ( MSGpkt->hdr.event )
      {  

//處理在初始化中注冊(cè)的消息
        case ZDO_CB_MSG:
          SAPI_ProcessZDOMsgs( (zdoIncomingMsg_t *)pMsg );
          break;

//按鍵消息
        case KEY_CHANGE:
          //調(diào)用按鍵處理函數(shù)
          GenericApp_HandleKeys( ((keyChange_t *)MSGpkt)->state, ((keyChange_t *)MSGpkt)->keys );
          break;

//數(shù)據(jù)發(fā)送后返回信息處理函數(shù)

case AF_DATA_CONFIRM_CMD:
          // This message is received as a confirmation of a data packet sent.
          // The status is of ZStatus_t type [defined in ZComDef.h]
          // The message fields are defined in AF.h
          pDataConfirm = (afDataConfirm_t *) pMsg;
          SAPI_SendDataConfirm( pDataConfirm->transID, pDataConfirm->hdr.status );
          break;

//接收數(shù)據(jù)事件
        case AF_INCOMING_MSG_CMD:
          //調(diào)接收數(shù)據(jù)的處理函數(shù)
          GenericApp_MessageMSGCB( MSGpkt );
          break;

//網(wǎng)絡(luò)狀態(tài)發(fā)生變化事件
        case ZDO_STATE_CHANGE:
          //獲取網(wǎng)絡(luò)狀態(tài)
          GenericApp_NwkState = (devStates_t)(MSGpkt->hdr.status);
          //判斷網(wǎng)絡(luò)類型
          if ( (GenericApp_NwkState == DEV_ZB_COORD)
              || (GenericApp_NwkState == DEV_ROUTER)
              || (GenericApp_NwkState == DEV_END_DEVICE) )
          {
           
          }
          break;
         
        default:
          break;
      }

     //釋放存儲(chǔ)區(qū)
      osal_msg_deallocate( (uint8 *)MSGpkt );

     //判斷操作系統(tǒng)層是否有未處理的數(shù)據(jù)包,繼續(xù)處理緩沖區(qū)中的包
      MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( GenericApp_TaskID );
    }

   // 返回未處理的任務(wù)
    return (events ^ SYS_EVENT_MSG);
  }

// Discard unknown events
  return 0;
}

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多