⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apsfunctionemulation.c

📁 ucos在NEC平台下的移植
💻 C
字号:
#include "includes.h"
extern UINT8 coordinatesX;
extern UINT8 coordinatesY;
extern UINT16 deviceShortAddress;
extern NEIGHBOR_RECORD neighborTable[NEIGHBOR_TABLE_ENTRIES];
extern BYTE  deviceInfoArray[DEVICE_INFO_ARRAY_LENGTH]; 
extern UINT16 devicesArray[NUMBERS_OF_DEVICE_IN_THIS_AREA];
extern UINT8 numOfCoveredNeighbors;
extern ZBOOL  clusterElection;

#define DEFAULT_PORT            deviceShortAddress


typedef struct 
{
  ZBOOL flag;
  UINT8 seconds;
}TIMER_INFO;

void nlmeLeaveIndication(BYTE *deviceAddress)
{
 printf("I am the APS layer of the stack,I will execute the nlmeLeaveIndication() function\n");
}
    
//-------------------------------------------------------------------------------------------------------
//  void nldeDataConfirm(NWK_ENUM status, BYTE nsduHandle)
//
//  DESCRIPTION:
//      NWK callback to the higher layer upon complete processing of a nldeDataRequest
//      Function must be implemented by the higher layer
//
//  PARAMETERS:
//      NWK_ENUM status
//          (SUCCESS | MAX_FRM_CNTR | INVALID_REQUEST | BAD_CCM_OUTPUT | NO_KEY)
//      BYTE nsduHandle 
//          A handle to this packet from the nldeDataRequest() function
//-------------------------------------------------------------------------------------------------------
void nldeDataConfirm(NWK_ENUM status, BYTE nsduHandle)
{
printf(" I am the APS layer of the stack,I will execute the nldeDataConfirm() function\n");
}

//-------------------------------------------------------------------------------------------------------
//  void nldeDataIndication(NLDE_DATA_INDICATION *pNDI)
//
//  DESCRIPTION:
//      NWK callback to the higher layer upon reception of a NWK data frame
//      Multi-buffering is handled internally in the NWK sublayer
//      Function must be implemented by the higher layer
//
//  PARAMETERS:
//      NLDE_DATA_INDICATION *pNDI
//          Pointer to the NLDE_DATA_INDICATION data indication struct 
//-------------------------------------------------------------------------------------------------------
void nldeDataIndication(NLDE_DATA_INDICATION *pNDI)
{
 printf("I am the APS layer of the stack,I will execute the nldeDataIndication() function\n");
 
 

}

//----------------------------------------------------------------------------
//     void nlmeLeaveConfirm(ADDRESS deviceAddress,NWK_ENUM status);
//
//     DESCRIPTION:
//            This function allows the next higher layer to be notified of the results
//             of its request for itself or another device to leave the network.
//     PARAMETER:
//             BYTE  *deviceAddress,
//                The 64-bit IEEE address in the request to which this is a confirmation or
//                null if the device requested to remove itself from the network.
//             NWK_ENUM status,
//                The status of the corresponding request
//     RETURN-VALUE:
//             NO
//---------------------------------------------------------------------------
void nlmeLeaveConfirm(ADDRESS  *deviceAddress,NWK_ENUM status)
{
printf("I am the APS layer of the stack,I will execute the nlmeLeaveConfirm() function\n");
}

//----------------------------------------------------------------------------
//void nlmeJoinConfirm(UINT16 panID, BYTE status);
//DESCRIPTION:
//        Notify the higher layer of the results of its request to join a network
//PARAMETER
//        WORD panID
//            The PAN identifier of the network to attempt  to join or rejoin.
//        BYTE status
//             The status of the cooresponding request
//RETURN-VALUE
//        NO
//-------------------------------------------------------------------------------
void nlmeJoinConfirm(UINT16 panID, BYTE status)
{
printf("I am the APS layer of the stack,I will execute the nlmeJoinConfirm() function\n");
if(status!=NWK_SUCCESS)
{
 if(status==NWK_NOT_PERMITTED)
   printf("Join network failed because of NWK_NOT_PERMITTED");
 else 
   printf("Join failed !");
 
}
else
{
 printf("Join success!");
 

 }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -