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

📄 znwk.h

📁 zigbee精简协议栈代码
💻 H
📖 第 1 页 / 共 3 页
字号:
     * Output:          None
     *
     * Side Effects:    None
     *
     * Overview:        Does not allow new nodes to join with this network.
     *
     * Note:            Available to coordinators only.
     ********************************************************************/
    #define NWKDisableJoining()     MACSetAssociationPermit(FALSE)

    /*********************************************************************
     * Function:        BOOL AppOkayToAcceptThisNode(LONG_ADDR *longAddr)
     *
     * PreCondition:    None
     *
     * Input:           longAddr    - Long address of a node that wants
     *                                to join to this network.
     *
     * Output:          TRUE if application is okay with this node joining
     *                  FALSE otherwise
     *
     * Side Effects:    None
     *
     * Overview:        This is a callback to application.
     *                  The application would check given long address against
     *                  some predefined algorithm and allow/disallow
     *                  given node from joining the network.
     *
     * Note:            Available to coordinators only.
     ********************************************************************/
    extern BOOL AppOkayToAcceptThisNode(LONG_ADDR *longAddr);

    /*********************************************************************
     * Function:        void AppNewNodeJoined(LONG_ADDR *nodeAddr,
     *                                       BOOL bIsRejoined)
     *
     * PreCondition:    None
     *
     * Input:           longAddr    - Long address of a node that has
     *                                just joined the network
     *                  bIsRejoined - TRUE if this node was already a member
     *                                of this network.
     *                                FALSE, if this node has rejoined
     *                                this network.
     *
     * Output:          None
     *
     * Side Effects:    None
     *
     * Overview:        This is a callback to application.
     *                  This function is provided as a notification to
     *                  application that a new node has joined the network
     *                  The application may use this information to perform
     *                  application spedific process.
     *
     * Note:            Available to coordinators only.
     ********************************************************************/
    extern void AppNewNodeJoined(LONG_ADDR *nodeAddr, BOOL bIsRejoined);

    /*********************************************************************
     * Function:        void AppNodeLeft(LONG_ADDR *nodeAddr)
     *
     * PreCondition:    None
     *
     * Input:           longAddr    - Long address of a node that has
     *                                just left the network
     *
     * Output:          None
     *
     * Side Effects:    None
     *
     * Overview:        This is a callback to application.
     *                  This function is provided as a notification to
     *                  application that a new node has left the network
     *                  The application may use this information to perform
     *                  application spedific process.
     *
     * Note:            Available to coordinators only.
     ********************************************************************/
    extern void AppNodeLeft(LONG_ADDR *nodeAddr);

#endif

#if defined(I_AM_END_DEVICE)
    /*********************************************************************
     * Macro:           void NWKStartJoin(void)
     *
     * PreCondition:    None
     *
     * Input:           None
     *
     * Output:          None
     *
     * Side Effects:    None
     *
     * Overview:        This macro starts end device association procedure.
     *
     * Note:            Available to end devices only.
     ********************************************************************/
    #define NWKStartJoin()          MACStartAssociation()

    /*********************************************************************
     * Macro:           BOOL NWKIsJoinComplete(void)
     *
     * PreCondition:    None
     *
     * Input:           None
     *
     * Output:          TRUE, if nwk join process is complete
     *                  FALSE, otherwise
     *                  Call GetLastZError() to determine success/failure.
     *
     * Side Effects:    None
     *
     * Overview:        This macro runs association state machine.
     *
     * Note:            Available to end devices only.
     ********************************************************************/
    #define NWKIsJoinComplete()     MACIsAssociationComplete()

    /*********************************************************************
     * Macro:           BOOL NWKIsJoined(void)
     *
     * PreCondition:    None
     *
     * Input:           None
     *
     * Output:          TRUE, if this node has joined a network.
     *                  FALSE, otherwise
     *                  Call GetLastZError() to determine success/failure.
     *
     * Side Effects:    None
     *
     * Overview:        This macro returns the result of NWKJoin call.
     *
     * Note:            Available to end devices only.
     ********************************************************************/
    #define NWKIsJoined()           MACIsAssocated()

    /*********************************************************************
     * Macro:           void NWKStartRejoin(void)
     *
     * PreCondition:    None
     *
     * Input:           None
     *
     * Output:          None
     *
     * Side Effects:    None
     *
     * Overview:        This macro starts rejoin (orphan association)
     *                  process
     *
     * Note:            Available to end devices only.
     ********************************************************************/
    #define NWKStartRejoin()        MACStartOrphanNotification()

    /*********************************************************************
     * Macro:           BOOL NWKIsRejoinComplete(void)
     *
     * PreCondition:    None
     *
     * Input:           None
     *
     * Output:          TRUE, if nwk rejoin process is complete
     *                  FALSE, otherwise
     *                  Call GetLastZError() to determine success/failure.
     *
     * Side Effects:    None
     *
     * Overview:        This macro runs orphan notification state machine.
     *
     * Note:            Available to end devices only.
     ********************************************************************/
    #define NWKIsRejoinComplete()   MACIsOrphanNotificationComplete()

    /*********************************************************************
     * Macro:           void NWKAcceptCurrentPAN(void)
     *
     * PreCondition:    NWKIsJoined() = TRUE
     *
     * Input:           None
     *
     * Output:          None
     *
     * Side Effects:    None
     *
     * Overview:        This macro accepts previously discovered PAN.
     *
     * Note:            Available to end devices only.
     ********************************************************************/
    #define NWKAcceptCurrentPAN()   MACAcceptCurrentPAN()

#endif

/*********************************************************************
 * Function:        BOOL AppOkayToUseChannel(BYTE channel)
 *
 * PreCondition:    None
 *
 * Input:           channel - Channel number that is to be verify
 *
 * Output:          TRUE if application wants to use given channel
 *                  FALSE if otherwise
 *
 * Side Effects:    None
 *
 * Overview:        This is a callback to application to ask if app
 *                  wants to use given channel.If not, next channel
 *                  will be selected and app will be asked again.
 *
 * Note:            None
 ********************************************************************/
extern BOOL AppOkayToUseChannel(BYTE channel);

/*********************************************************************
 * Macro:           BOOL NWKIsPutReady(void)
 *
 * PreCondition:    None
 *
 * Input:           None
 *
 * Output:          TRUE if it is okay to load new byte into transmit buffer
 *                  FALSE if otherwise
 *
 * Side Effects:    None
 *
 * Overview:        This is a wrapper on MAC function to provide a
 *                  level of abstraction.
 *
 * Note:            None
 ********************************************************************/
#define NWKIsPutReady()         MACIsPutReady()

/*********************************************************************
 * Macro:           void NWKPut(BYTE d)
 *
 * PreCondition:    NWKIsPutReady() = TRUE
 *
 * Input:           d       - A data byte that is to be loaded
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        This is a wrapper on MAC function to provide a
 *                  level of abstraction.
 *                  It loads given byte into trasnmit buffer.
 *
 * Note:            None
 ********************************************************************/
#define NWKPut(d)               MACPut(d)

/*********************************************************************
 * Macro:           void NWKPutArray(BYTE* v, BYTE s)
 *
 * PreCondition:    NWKIsPutReady() = TRUE
 *
 * Input:           v       - A data byte array that is to be loaded
 *                  s       - Count of bytes
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        This is a wrapper on MAC function to provide a
 *                  level of abstraction.
 *                  It loads given array into transmit buffer.
 *
 * Note:            None
 ********************************************************************/
#define NWKPutArray(v, s)       MACPutArray(v, s)

/*********************************************************************
 * Macro:           void NWKFlush(void)
 *
 * PreCondition:    NWKIsPutReady() = TRUE and NWKPutHeader() and
 *                  zero or more NWKPut() are called.
 *
 * Input:           None
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        This is a wrapper on MAC function to provide a
 *                  level of abstraction.
 *                  It transmits current transmit buffer
 *
 * Note:            None
 ********************************************************************/
#define NWKFlush()              MACFlush()

/*********************************************************************
 * Function:        void NWKPutHeader(NODE_INFO *dest,
 *                                      BYTE frameCONLSB,
 *                                      BYTE frameCONMSB)
 *
 * PreCondition:    NWKIsPutReady() = TRUE
 *
 * Input:           dest        - Dest node
 *                  frameCONLSB - NWK frame header control LSB
 *                  frameCONMSB - NWK frame header control MSB
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        Prepares NWK frame header and loads it in XCVR
 *
 * Note:            None
 ********************************************************************/
void NWKPutHeader(struct NODE_INFO *dest,
                  BYTE frameCONLSB,
                  BYTE frameCONMSB,
				  SHORT_ADDR dest_nwk_addr);

/*********************************************************************
 * Macro:           BOOL NWKIsGetReady(void)
 *
 * PreCondition:    None
 *
 * Input:           None
 *
 * Output:          TRUE if it there is a new NWK frame received
 *                  FALSE if otherwise
 *
 * Side Effects:    None
 *
 * Overview:        This is a wrapper on MAC function to provide a
 *                  level of abstraction.
 *
 * Note:            None
 ********************************************************************/
#define NWKIsGetReady()         MACIsGetReady()

⌨️ 快捷键说明

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