123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044 |
- #include "ZComDef.h"
- #include "hal_drivers.h"
- #include "OSAL.h"
- #include "OSAL_Tasks.h"
- #if defined ( MT_TASK )
- #include "MT.h"
- #include "MT_TASK.h"
- #endif
- #include "nwk.h"
- #include "APS.h"
- #include "ZDApp.h"
- #include "osal_nv.h"
- #include "NLMEDE.h"
- #include "AF.h"
- #include "OnBoard.h"
- #include "nwk_util.h"
- #include "ZDProfile.h"
- #include "ZDObject.h"
- #include "hal_led.h"
- #include "hal_key.h"
- #include "sapi.h"
- #include "MT_SAPI.h"
- extern uint8 zgStartDelay;
- extern uint8 zgSapiEndpoint;
- #if !defined OSAL_SAPI
- #define OSAL_SAPI TRUE
- #endif
- #if !defined SAPI_CB_FUNC
- #define SAPI_CB_FUNC TRUE
- #endif
- #define ZB_USER_MSG 0xE0
- #define SAPICB_DATA_CNF 0xE0
- #define SAPICB_BIND_CNF 0xE1
- #define SAPICB_START_CNF 0xE2
- #if OSAL_SAPI
- const pTaskEventHandlerFn tasksArr[] = {
- macEventLoop,
- nwk_event_loop,
- Hal_ProcessEvent,
- #if defined( MT_TASK )
- MT_ProcessEvent,
- #endif
- APS_event_loop,
- ZDApp_event_loop,
- SAPI_ProcessEvent
- };
- const uint8 tasksCnt = sizeof( tasksArr ) / sizeof( tasksArr[0] );
- uint16 *tasksEvents;
- #endif
- endPointDesc_t sapi_epDesc;
- uint8 sapi_TaskID;
- static uint16 sapi_bindInProgress;
- void SAPI_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg );
- static void SAPI_SendCback( uint8 event, uint8 status, uint16 data );
- static void SAPI_StartConfirm( uint8 status );
- static void SAPI_SendDataConfirm( uint8 handle, uint8 status );
- static void SAPI_BindConfirm( uint16 commandId, uint8 status );
- static void SAPI_FindDeviceConfirm( uint8 searchType,
- uint8 *searchKey, uint8 *result );
- static void SAPI_ReceiveDataIndication( uint16 source,
- uint16 command, uint16 len, uint8 *pData );
- static void SAPI_AllowBindConfirm( uint16 source );
- void zb_SystemReset ( void )
- {
- SystemResetSoft();
- }
- void zb_StartRequest()
- {
- uint8 logicalType;
- zb_ReadConfiguration( ZCD_NV_LOGICAL_TYPE, sizeof(uint8), &logicalType );
-
- if ((logicalType > ZG_DEVICETYPE_ENDDEVICE) ||
- #if !ZG_BUILD_ENDDEVICE_TYPE
- (logicalType == ZG_DEVICETYPE_ENDDEVICE) ||
- #endif
- #if !ZG_BUILD_RTR_TYPE
- (logicalType == ZG_DEVICETYPE_ROUTER) ||
- (logicalType == ZG_DEVICETYPE_COORDINATOR) ||
- #elif ZG_BUILD_RTRONLY_TYPE
- (logicalType == ZG_DEVICETYPE_COORDINATOR) ||
- #elif !ZG_BUILD_JOINING_TYPE
- (logicalType == ZG_DEVICETYPE_ROUTER) ||
- #endif
- (0))
- {
- logicalType = ZB_INVALID_PARAMETER;
- SAPI_SendCback(SAPICB_START_CNF, logicalType, 0);
- }
- else
- {
- logicalType = ZB_SUCCESS;
- ZDOInitDevice(zgStartDelay);
- }
-
- return;
- }
- void zb_BindDevice ( uint8 create, uint16 commandId, uint8 *pDestination )
- {
- zAddrType_t destination;
- uint8 ret = ZB_ALREADY_IN_PROGRESS;
- if ( create )
- {
- if (sapi_bindInProgress == 0xffff)
- {
- if ( pDestination )
- {
- destination.addrMode = Addr64Bit;
- osal_cpyExtAddr( destination.addr.extAddr, pDestination );
- ret = APSME_BindRequest( sapi_epDesc.endPoint, commandId,
- &destination, sapi_epDesc.endPoint );
- if ( ret == ZSuccess )
- {
-
- ZDP_NwkAddrReq(pDestination, ZDP_ADDR_REQTYPE_SINGLE, 0, 0 );
- osal_start_timerEx( ZDAppTaskID, ZDO_NWK_UPDATE_NV, 250 );
- }
- }
- else
- {
- ret = ZB_INVALID_PARAMETER;
- destination.addrMode = Addr16Bit;
- destination.addr.shortAddr = NWK_BROADCAST_SHORTADDR;
- if ( ZDO_AnyClusterMatches( 1, &commandId, sapi_epDesc.simpleDesc->AppNumOutClusters,
- sapi_epDesc.simpleDesc->pAppOutClusterList ) )
- {
-
- ret = ZDP_MatchDescReq( &destination, NWK_BROADCAST_SHORTADDR,
- sapi_epDesc.simpleDesc->AppProfId, 1, &commandId, 0, (cId_t *)NULL, 0 );
- }
- else if ( ZDO_AnyClusterMatches( 1, &commandId, sapi_epDesc.simpleDesc->AppNumInClusters,
- sapi_epDesc.simpleDesc->pAppInClusterList ) )
- {
- ret = ZDP_MatchDescReq( &destination, NWK_BROADCAST_SHORTADDR,
- sapi_epDesc.simpleDesc->AppProfId, 0, (cId_t *)NULL, 1, &commandId, 0 );
- }
- if ( ret == ZB_SUCCESS )
- {
-
- #if ( ZG_BUILD_RTR_TYPE )
- osal_start_timerEx(sapi_TaskID, ZB_BIND_TIMER, AIB_MaxBindingTime);
- #else
-
- osal_start_timerEx(sapi_TaskID, ZB_BIND_TIMER, zgApsDefaultMaxBindingTime);
- #endif
- sapi_bindInProgress = commandId;
- return;
- }
- }
- }
- SAPI_SendCback( SAPICB_BIND_CNF, ret, commandId );
- }
- else
- {
-
- BindingEntry_t *pBind;
-
- while ( pBind = bindFind( sapi_epDesc.simpleDesc->EndPoint, commandId, 0 ) )
- {
- bindRemoveEntry(pBind);
- }
- osal_start_timerEx( ZDAppTaskID, ZDO_NWK_UPDATE_NV, 250 );
- }
- return;
- }
- uint8 zb_PermitJoiningRequest ( uint16 destination, uint8 timeout )
- {
- #if defined( ZDO_MGMT_PERMIT_JOIN_REQUEST )
- zAddrType_t dstAddr;
- dstAddr.addrMode = Addr16Bit;
- dstAddr.addr.shortAddr = destination;
- return( (uint8) ZDP_MgmtPermitJoinReq( &dstAddr, timeout, 0, 0 ) );
- #else
- (void)destination;
- (void)timeout;
- return ZUnsupportedMode;
- #endif
- }
- void zb_AllowBind ( uint8 timeout )
- {
- osal_stop_timerEx(sapi_TaskID, ZB_ALLOW_BIND_TIMER);
- if ( timeout == 0 )
- {
- afSetMatch(sapi_epDesc.simpleDesc->EndPoint, FALSE);
- }
- else
- {
- afSetMatch(sapi_epDesc.simpleDesc->EndPoint, TRUE);
- if ( timeout != 0xFF )
- {
- if ( timeout > 64 )
- {
- timeout = 64;
- }
- osal_start_timerEx(sapi_TaskID, ZB_ALLOW_BIND_TIMER, timeout*1000);
- }
- }
- return;
- }
- void zb_SendDataRequest ( uint16 destination, uint16 commandId, uint8 len,
- uint8 *pData, uint8 handle, uint8 txOptions, uint8 radius )
- {
- afStatus_t status;
- afAddrType_t dstAddr;
- txOptions |= AF_DISCV_ROUTE;
-
- if (destination == ZB_BINDING_ADDR)
- {
-
- dstAddr.addrMode = afAddrNotPresent;
- }
- else
- {
-
- dstAddr.addr.shortAddr = destination;
- dstAddr.addrMode = afAddr16Bit;
- if ( ADDR_NOT_BCAST != NLME_IsAddressBroadcast( destination ) )
- {
- txOptions &= ~AF_ACK_REQUEST;
- }
- }
- dstAddr.panId = 0;
- dstAddr.endPoint = sapi_epDesc.simpleDesc->EndPoint;
-
- status = AF_DataRequest(&dstAddr, &sapi_epDesc, commandId, len,
- pData, &handle, txOptions, radius);
- if (status != afStatus_SUCCESS)
- {
- SAPI_SendCback( SAPICB_DATA_CNF, status, handle );
- }
- }
- uint8 zb_ReadConfiguration( uint8 configId, uint8 len, void *pValue )
- {
- uint8 size;
- size = (uint8)osal_nv_item_len( configId );
- if ( size > len )
- {
- return ZFailure;
- }
- else
- {
- return( osal_nv_read(configId, 0, size, pValue) );
- }
- }
- uint8 zb_WriteConfiguration( uint8 configId, uint8 len, void *pValue )
- {
- return( osal_nv_write(configId, 0, len, pValue) );
- }
- void zb_GetDeviceInfo ( uint8 param, void *pValue )
- {
- switch(param)
- {
- case ZB_INFO_DEV_STATE:
- osal_memcpy(pValue, &devState, sizeof(uint8));
- break;
- case ZB_INFO_IEEE_ADDR:
- osal_memcpy(pValue, &aExtendedAddress, Z_EXTADDR_LEN);
- break;
- case ZB_INFO_SHORT_ADDR:
- osal_memcpy(pValue, &_NIB.nwkDevAddress, sizeof(uint16));
- break;
- case ZB_INFO_PARENT_SHORT_ADDR:
- osal_memcpy(pValue, &_NIB.nwkCoordAddress, sizeof(uint16));
- break;
- case ZB_INFO_PARENT_IEEE_ADDR:
- osal_memcpy(pValue, &_NIB.nwkCoordExtAddress, Z_EXTADDR_LEN);
- break;
- case ZB_INFO_CHANNEL:
- osal_memcpy(pValue, &_NIB.nwkLogicalChannel, sizeof(uint8));
- break;
- case ZB_INFO_PAN_ID:
- osal_memcpy(pValue, &_NIB.nwkPanId, sizeof(uint16));
- break;
- case ZB_INFO_EXT_PAN_ID:
- osal_memcpy(pValue, &_NIB.extendedPANID, Z_EXTADDR_LEN);
- break;
- }
- }
- void zb_FindDeviceRequest( uint8 searchType, void *searchKey )
- {
- if (searchType == ZB_IEEE_SEARCH)
- {
- ZDP_NwkAddrReq((uint8*) searchKey, ZDP_ADDR_REQTYPE_SINGLE, 0, 0 );
- }
- }
- void SAPI_StartConfirm( uint8 status )
- {
- #if defined ( MT_SAPI_CB_FUNC )
-
- if ( SAPICB_CHECK( SPI_CB_SAPI_START_CNF ) )
- {
- zb_MTCallbackStartConfirm( status );
- }
- else
- #endif
- {
- #if ( SAPI_CB_FUNC )
- zb_StartConfirm( status );
- #endif
- }
- }
- void SAPI_SendDataConfirm( uint8 handle, uint8 status )
- {
- #if defined ( MT_SAPI_CB_FUNC )
-
- if ( SAPICB_CHECK( SPI_CB_SAPI_SEND_DATA_CNF ) )
- {
- zb_MTCallbackSendDataConfirm( handle, status );
- }
- else
- #endif
- {
- #if ( SAPI_CB_FUNC )
- zb_SendDataConfirm( handle, status );
- #endif
- }
- }
- void SAPI_BindConfirm( uint16 commandId, uint8 status )
- {
- #if defined ( MT_SAPI_CB_FUNC )
-
- if ( SAPICB_CHECK( SPI_CB_SAPI_BIND_CNF ) )
- {
- zb_MTCallbackBindConfirm( commandId, status );
- }
- else
- #endif
- {
- #if ( SAPI_CB_FUNC )
- zb_BindConfirm( commandId, status );
- #endif
- }
- }
- void SAPI_AllowBindConfirm( uint16 source )
- {
- #if defined ( MT_SAPI_CB_FUNC )
-
- if ( SAPICB_CHECK( SPI_CB_SAPI_ALLOW_BIND_CNF ) )
- {
- zb_MTCallbackAllowBindConfirm( source );
- }
- else
- #endif
- {
- #if ( SAPI_CB_FUNC )
- zb_AllowBindConfirm( source );
- #endif
- }
- }
- void SAPI_FindDeviceConfirm( uint8 searchType, uint8 *searchKey, uint8 *result )
- {
- #if defined ( MT_SAPI_CB_FUNC )
-
- if ( SAPICB_CHECK( SPI_CB_SAPI_FIND_DEV_CNF ) )
- {
- zb_MTCallbackFindDeviceConfirm( searchType, searchKey, result );
- }
- else
- #endif
- {
- #if ( SAPI_CB_FUNC )
- zb_FindDeviceConfirm( searchType, searchKey, result );
- #endif
- }
- }
- void SAPI_ReceiveDataIndication( uint16 source, uint16 command, uint16 len, uint8 *pData )
- {
- #if defined ( MT_SAPI_CB_FUNC )
-
- if ( SAPICB_CHECK( SPI_CB_SAPI_RCV_DATA_IND ) )
- {
- zb_MTCallbackReceiveDataIndication( source, command, len, pData );
- }
- else
- #endif
- {
- #if ( SAPI_CB_FUNC )
- zb_ReceiveDataIndication( source, command, len, pData );
- #endif
- }
- }
- UINT16 SAPI_ProcessEvent( byte task_id, UINT16 events )
- {
- osal_event_hdr_t *pMsg;
- afIncomingMSGPacket_t *pMSGpkt;
- afDataConfirm_t *pDataConfirm;
- if ( events & SYS_EVENT_MSG )
- {
- pMsg = (osal_event_hdr_t *) osal_msg_receive( task_id );
- while ( pMsg )
- {
- switch ( pMsg->event )
- {
- case ZDO_CB_MSG:
- SAPI_ProcessZDOMsgs( (zdoIncomingMsg_t *)pMsg );
- break;
- case AF_DATA_CONFIRM_CMD:
-
-
-
- pDataConfirm = (afDataConfirm_t *) pMsg;
- SAPI_SendDataConfirm( pDataConfirm->transID, pDataConfirm->hdr.status );
- break;
- case AF_INCOMING_MSG_CMD:
- pMSGpkt = (afIncomingMSGPacket_t *) pMsg;
- SAPI_ReceiveDataIndication( pMSGpkt->srcAddr.addr.shortAddr, pMSGpkt->clusterId,
- pMSGpkt->cmd.DataLength, pMSGpkt->cmd.Data);
- break;
- case ZDO_STATE_CHANGE:
-
- if (pMsg->status == DEV_END_DEVICE ||
- pMsg->status == DEV_ROUTER ||
- pMsg->status == DEV_ZB_COORD )
- {
- SAPI_StartConfirm( ZB_SUCCESS );
- }
- else if (pMsg->status == DEV_HOLD ||
- pMsg->status == DEV_INIT)
- {
- SAPI_StartConfirm( ZB_INIT );
- }
- break;
- case ZDO_MATCH_DESC_RSP_SENT:
- SAPI_AllowBindConfirm( ((ZDO_MatchDescRspSent_t *)pMsg)->nwkAddr );
- break;
- case KEY_CHANGE:
- #if ( SAPI_CB_FUNC )
- zb_HandleKeys( ((keyChange_t *)pMsg)->state, ((keyChange_t *)pMsg)->keys );
- #endif
- break;
- case SAPICB_DATA_CNF:
- SAPI_SendDataConfirm( (uint8)((sapi_CbackEvent_t *)pMsg)->data,
- ((sapi_CbackEvent_t *)pMsg)->hdr.status );
- break;
- case SAPICB_BIND_CNF:
- SAPI_BindConfirm( ((sapi_CbackEvent_t *)pMsg)->data,
- ((sapi_CbackEvent_t *)pMsg)->hdr.status );
- break;
- case SAPICB_START_CNF:
- SAPI_StartConfirm( ((sapi_CbackEvent_t *)pMsg)->hdr.status );
- break;
- default:
-
- if ( pMsg->event >= ZB_USER_MSG )
- {
- }
- break;
- }
-
- osal_msg_deallocate( (uint8 *) pMsg );
-
- pMsg = (osal_event_hdr_t *) osal_msg_receive( task_id );
- }
-
- return (events ^ SYS_EVENT_MSG);
- }
- if ( events & ZB_ALLOW_BIND_TIMER )
- {
- afSetMatch(sapi_epDesc.simpleDesc->EndPoint, FALSE);
- return (events ^ ZB_ALLOW_BIND_TIMER);
- }
- if ( events & ZB_BIND_TIMER )
- {
-
- SAPI_BindConfirm( sapi_bindInProgress, ZB_TIMEOUT );
- sapi_bindInProgress = 0xffff;
- return (events ^ ZB_BIND_TIMER);
- }
- if ( events & ZB_ENTRY_EVENT )
- {
- uint8 startOptions;
-
- #if ( SAPI_CB_FUNC )
- zb_HandleOsalEvent( ZB_ENTRY_EVENT );
- #endif
-
- HalLedSet (HAL_LED_4, HAL_LED_MODE_OFF);
- zb_ReadConfiguration( ZCD_NV_STARTUP_OPTION, sizeof(uint8), &startOptions );
- if ( startOptions & ZCD_STARTOPT_AUTO_START )
- {
- zb_StartRequest();
- }
- else
- {
-
- HalLedBlink(HAL_LED_2, 0, 50, 500);
- }
- return (events ^ ZB_ENTRY_EVENT );
- }
-
- if ( events & ( ZB_USER_EVENTS ) )
- {
-
- #if ( SAPI_CB_FUNC )
- zb_HandleOsalEvent( events );
- #endif
-
- }
-
- return 0;
- }
- void SAPI_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg )
- {
- switch ( inMsg->clusterID )
- {
- case NWK_addr_rsp:
- {
-
- ZDO_NwkIEEEAddrResp_t *pNwkAddrRsp = ZDO_ParseAddrRsp( inMsg );
- SAPI_FindDeviceConfirm( ZB_IEEE_SEARCH, (uint8*)&pNwkAddrRsp->nwkAddr, pNwkAddrRsp->extAddr );
- }
- break;
- case Match_Desc_rsp:
- {
- zAddrType_t dstAddr;
- ZDO_ActiveEndpointRsp_t *pRsp = ZDO_ParseEPListRsp( inMsg );
- if ( sapi_bindInProgress != 0xffff )
- {
-
- dstAddr.addrMode = Addr16Bit;
- dstAddr.addr.shortAddr = pRsp->nwkAddr;
- if ( APSME_BindRequest( sapi_epDesc.simpleDesc->EndPoint,
- sapi_bindInProgress, &dstAddr, pRsp->epList[0] ) == ZSuccess )
- {
- osal_stop_timerEx(sapi_TaskID, ZB_BIND_TIMER);
- osal_start_timerEx( ZDAppTaskID, ZDO_NWK_UPDATE_NV, 250 );
-
- ZDP_IEEEAddrReq( pRsp->nwkAddr, ZDP_ADDR_REQTYPE_SINGLE, 0, 0 );
- #if defined ( MT_SAPI_CB_FUNC )
- zb_MTCallbackBindConfirm( sapi_bindInProgress, ZB_SUCCESS );
- #endif
-
- #if ( SAPI_CB_FUNC )
- zb_BindConfirm( sapi_bindInProgress, ZB_SUCCESS );
- #endif
- sapi_bindInProgress = 0xffff;
- }
- }
- }
- break;
- }
- }
- void SAPI_Init( byte task_id )
- {
- sapi_TaskID = task_id;
- sapi_bindInProgress = 0xffff;
- sapi_epDesc.task_id = &sapi_TaskID;
- sapi_epDesc.endPoint = 0;
-
- #if ( SAPI_CB_FUNC )
- sapi_epDesc.endPoint = zb_SimpleDesc.EndPoint;
- sapi_epDesc.task_id = &sapi_TaskID;
- sapi_epDesc.simpleDesc = (SimpleDescriptionFormat_t *)&zb_SimpleDesc;
- sapi_epDesc.latencyReq = noLatencyReqs;
-
- afRegister( &sapi_epDesc );
- #endif
-
- afSetMatch(sapi_epDesc.simpleDesc->EndPoint, FALSE);
-
- ZDO_RegisterForZDOMsg( sapi_TaskID, NWK_addr_rsp );
- ZDO_RegisterForZDOMsg( sapi_TaskID, Match_Desc_rsp );
- #if ( SAPI_CB_FUNC )
- #if (defined HAL_KEY) && (HAL_KEY == TRUE)
-
- RegisterForKeys( sapi_TaskID );
- if ( HalKeyRead () == HAL_KEY_SW_5)
- {
-
- uint8 startOptions = ZCD_STARTOPT_CLEAR_STATE | ZCD_STARTOPT_CLEAR_CONFIG;
- zb_WriteConfiguration( ZCD_NV_STARTUP_OPTION, sizeof(uint8), &startOptions );
- zb_SystemReset();
- }
- #endif
-
- osal_set_event(task_id, ZB_ENTRY_EVENT);
- #endif
- }
- void SAPI_SendCback( uint8 event, uint8 status, uint16 data )
- {
- sapi_CbackEvent_t *pMsg;
- pMsg = (sapi_CbackEvent_t *)osal_msg_allocate( sizeof(sapi_CbackEvent_t) );
- if( pMsg )
- {
- pMsg->hdr.event = event;
- pMsg->hdr.status = status;
- pMsg->data = data;
- osal_msg_send( sapi_TaskID, (uint8 *)pMsg );
- }
- }
- #if OSAL_SAPI
- void osalInitTasks( void )
- {
- uint8 taskID = 0;
- tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt);
- osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt));
- macTaskInit( taskID++ );
- nwk_init( taskID++ );
- Hal_Init( taskID++ );
- #if defined( MT_TASK )
- MT_TaskInit( taskID++ );
- #endif
- APS_Init( taskID++ );
- ZDApp_Init( taskID++ );
- SAPI_Init( taskID );
- }
- #endif
|