📄 nullnode.c
字号:
/****************************************************************************
*
* MODULE: Null Node
* COMPONENT: $RCSfile: NullNode.c,v $
*
* VERSION: $Name: $
*
* REVISION: $Revision: 1.2 $
*
* DATED: $Date: 2006/05/16 17:17:58 $
*
* STATUS: $State: Exp $
*
* AUTHOR: GPfef
*
* DESCRIPTION:
*
*
* LAST MODIFIED BY: $Author: gpfef $
* $Modtime: $
*
****************************************************************************
*
* (c) Copyright 2005 JENNIC Ltd
*
****************************************************************************/
/****************************************************************************/
/*** Include files ***/
/****************************************************************************/
#include "jendefs.h"
#include <AppHardwareApi.h>
#include <string.h>
#include "gdb.h"
#include "JZ_Api.h"
#include "af.h"
#include "aps.h"
#include "af_profile.h"
/****************************************************************************/
/*** Macro Definitions ***/
/****************************************************************************/
/* DIO lines used to drive LEDs */
#define LED_OUTPUTS_MASK 0x0000C000UL
#define LED1_MASK 0x00004000UL
#define LED2_MASK 0x00008000UL
/****************************************************************************/
/*** Type Definitions ***/
/****************************************************************************/
/****************************************************************************/
/*** Local Function Prototypes ***/
/****************************************************************************/
PRIVATE void NullDeviceInit(void);
/****************************************************************************/
/*** Exported Variables ***/
/****************************************************************************/
/****************************************************************************/
/*** Local Variables ***/
/****************************************************************************/
/****************************************************************************/
/*** Exported Functions ***/
/****************************************************************************/
/****************************************************************************
*
* NAME: AppColdStart
*
* DESCRIPTION:
* Entry point for application from boot loader. Initialises system.
*
* RETURNS:
* Never returns.
*
****************************************************************************/
PUBLIC void AppColdStart(void)
{
/* Debug hooks: include these regardless of whether debugging or not */
HAL_GDB_INIT();
HAL_BREAKPOINT();
/* General initialisation: reset hardware, set some values in PIB */
JZS_sConfig.u32Channel = 0x11;
JZS_sConfig.u16PanId = 0x1aab;
/* General initialisation */
NullDeviceInit();
/* No return from the above function call */
}
/****************************************************************************
*
* NAME: AppWarmStart
*
* DESCRIPTION:
* Entry point for application from boot loader. Simply jumps to AppColdStart
* as, in this instance, application will never warm start.
*
* RETURNS:
* Never returns.
*
****************************************************************************/
PUBLIC void AppWarmStart(void)
{
AppColdStart();
}
/****************************************************************************
*
* NAME: appZigBeeNetworkStart
*
* DESCRIPTION:
* Would be used for instance to add simple descriptors for endpoints prior
* starting as a coordinator/router/end device as defined in the make file
*
* RETURNS:
*
*
****************************************************************************/
BOOL JZA_boAppStart(void)
{
JZS_vStartStack();
return TRUE;
}
/****************************************************************************
*
* NAME: appKeyOperationKey
*
* DESCRIPTION:
* Main user routine. This is called by the Basic Operating System (BOS)
* for the first time after the device has successfully started/joined a
* network and then regularly thereafter.
*
* RETURNS:
*
*
****************************************************************************/
void JZA_vAppEventHandler(void)
{
/* indicate network successfully started/joined by turning LED 1 off */
vAHI_DioSetOutput(LED1_MASK, 0);
}
/****************************************************************************
*
* NAME: vAppHardwareEvent
*
* DESCRIPTION:
* Adds events to the hardware event queue.
*
* PARAMETERS: Name RW Usage
* u32Device R Peripheral responsible for interrupt e.g DIO
* u32ItemBitmap R Source of interrupt e.g. DIO bit map
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC void JZA_vPeripheralEvent(uint32 u32Device, uint32 u32ItemBitmap)
{
}
/****************************************************************************
*
* NAME: userAppTask
*
* DESCRIPTION:
* Can be used to add additional tasks.
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC void JZA_vAppDefineTasks(void)
{
}
/****************************************************************************
*
* NAME: applicationKVPObject
*
* DESCRIPTION:
* Receives incoming KVP data frames
*
* PARAMETERS: Name RW Usage
* afSrcAddr R Source address of KVP frame
* u8DstEndpoint R Destination endpoint for frame
* *pu8ClusterId R Pointer to Cluster ID for KVP frame
* eCommandTypeId R Command type specified by the frame
* u16AttributeId R Target Attribute ID of Cluster
* *pu8AfduLength R Pointer to length of data portion of frame
* *pu8Afdu R Pointer to data portion of frame
*
* RETURNS:
* Application framework error code
*
****************************************************************************/
AF_ERROR_CODE JZA_eAfKvpObject(AF_ADDRTYPE afSrcAddr,
uint8 u8DstEndpoint,
uint8 u8SequenceNum,
uint8 *pu8ClusterId,
AF_COMMAND_TYPE_ID eCommandTypeId,
uint16 u16AttributeId,
uint8 *pu8AfduLength,
uint8 *pu8Afdu)
{
return KVP_INVALID_ENDPOINT;
}
/****************************************************************************
*
* NAME: applicationKVPResponse
*
* DESCRIPTION:
* Used to send response to incoming KVP frame
*
* PARAMETERS: Name RW Usage
* srcAddressMod R Address of responding node
* transactionSequenceNum R Sequence number of frame
* commandTypeIdentifier R Type of command sent
* dstEndPoint R Endpoint which response is sent to
* clusterID R ID of target cluster
* attributeIdentifier R Attibute ID of target cluster
* errorCode R Success or otherwise of request
* afduLength R Length of data portion
* *pAfdu R Pointer to data portion of frame
*
* RETURNS:
* void
*
****************************************************************************/
void JZA_vAfKvpResponse(AF_ADDRTYPE srcAddressMod,
UINT8 transactionSequenceNum,
AF_COMMAND_TYPE_ID commandTypeIdentifier,
UINT8 dstEndPoint,
UINT8 clusterID,
UINT16 attributeIdentifier,
UINT8 errorCode,
UINT8 afduLength,
UINT8 *pAfdu )
{
}
/****************************************************************************
*
* NAME: applicationMSGObject
*
* DESCRIPTION:
* Receives incoming MSG data frames.
*
* PARAMETERS: Name RW Usage
* afSrcAddr R Source address of message frame
* dstEndPoint R Destination Endpoint of message
* *clusterID R Pointer to Cluster ID for frame
* *afduLength R Pointer to length of data portion
* *pAfdu R Pointer to data portion
* RETURNS:
*
*
****************************************************************************/
UINT8 *JZA_pu8AfMsgObject( AF_ADDRTYPE afSrcAddr,
UINT8 dstEndPoint,
UINT8 *clusterID,
UINT8 *afduLength,
UINT8 *pAfdu)
{
return NULL;
}
/****************************************************************************
*
* NAME: vZdpResponse
*
* DESCRIPTION:
* Receives responses to Binding or MatchDescriptor requests
*
* PARAMETERS: Name RW Usage
* u8Type R Type of response
* *pu8Payload R Pointer to response
* u8PayloadLen R Length of response
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC void JZA_vZdpResponse(uint8 u8Type, uint8 *pu8Payload, uint8 u8PayloadLen)
{
}
/****************************************************************************/
/*** Local Functions ***/
/****************************************************************************/
/****************************************************************************
*
* NAME: NullDeviceInit
*
* DESCRIPTION:
* Initialises stack and hardware.
*
* RETURNS:
* void
*
****************************************************************************/
PRIVATE void NullDeviceInit(void)
{
JZS_u32InitSystem();
/* Set LED IO's to outputs */
vAHI_DioSetDirection(0, LED_OUTPUTS_MASK);
vAHI_DioSetOutput(0, LED1_MASK);
vAHI_DioSetOutput(LED2_MASK, 0);
/* Start BOS */
BOSIntSystem();
BOSStartSystem();
}
/****************************************************************************/
/*** END OF FILE ***/
/****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -