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

📄 router.c

📁 Application note Jennic wifi modules sensor wireless
💻 C
字号:
/****************************************************************************//*! *\MODULE              Jenie Template * *\COMPONENT           $RCSfile: Router.c,v $ * *\VERSION             $Name: HEAD $ * *\REVISION            $Revision: 1.4 $ * *\DATED               $Date: 2008/03/26 15:29:42 $ * *\STATUS              $State: Exp $ * *\AUTHOR              Martin Looker * *\DESCRIPTION         Jenie Template - router. * * This file forms the basic Jenie application for the router * node type. This file contains the standard set of Jenie callback functions * that the Jenie stack calls. As the majority of the application code is the same * regardless of device type the functions in this file simply calls the * equivalent functions in Network.c. * * If the router needs to perform different tasks to the other node types * in the application, specific code can be added to or called from this file. * (Note that Network.c also keeps track of which node type a * device is running as, so it is also possible to have node dependent code in * Network.c). *//* CHANGE HISTORY * * $Log: Router.c,v $ * Revision 1.4  2008/03/26 15:29:42  mlook * Removed use of services, devices now send directly to coordinator. * * Revision 1.3  2007/11/21 16:11:28  mlook * JPI updates - completed * * Revision 1.2  2007/11/20 16:21:42  mlook * Updated to recent Jenie template. * * * * LAST MODIFIED BY    $Author: mlook $ *                     $Modtime: $ * **************************************************************************** * * This software is owned by Jennic and/or its supplier and is protected * under applicable copyright laws. All rights are reserved. We grant You, * and any third parties, a license to use this software solely and * exclusively on Jennic products. You, and any third parties must reproduce * the copyright and warranty notice and any other legend of ownership on each * copy or partial copy of the software. * * THIS SOFTWARE IS PROVIDED "AS IS". JENNIC MAKES NO WARRANTIES, WHETHER * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, * ACCURACY OR LACK OF NEGLIGENCE. JENNIC SHALL NOT, IN ANY CIRCUMSTANCES, * BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, SPECIAL, * INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON WHATSOEVER. * * Copyright Jennic Ltd 2005, 2006, 2007. All rights reserved * ****************************************************************************//****************************************************************************//***        Include files                                                 ***//****************************************************************************/#include <jendefs.h>#include <jenie.h>#include <JPI.h>#include <gdb.h>#include "Network.h"/****************************************************************************//***        Macro Definitions                                             ***//****************************************************************************//****************************************************************************//***        Type Definitions                                              ***//****************************************************************************//****************************************************************************//***        Local Function Prototypes                                     ***//****************************************************************************//****************************************************************************//***        Exported Variables                                            ***//****************************************************************************//****************************************************************************//***        Local Variables                                               ***//****************************************************************************//** Routing table storage */PRIVATE tsJenieRoutingTable asRoutingTable[NETWORK_ROUTING_TABLE_SIZE];/****************************************************************************//***        Local Constants                                               ***//****************************************************************************//****************************************************************************//***        Jenie Callback Functions                                      ***//****************************************************************************//**************************************************************************** * * NAME: vJenie_CbConfigureNetwork * * DESCRIPTION: * Set stack parameters prior to stack initialisation. * * RETURNS: * None * ****************************************************************************/PUBLIC void vJenie_CbConfigureNetwork (void){	/* Set up routing table */	gJenie_RoutingEnabled    = TRUE;	gJenie_RoutingTableSize  = NETWORK_ROUTING_TABLE_SIZE;	gJenie_RoutingTableSpace = (void *) asRoutingTable;    /* Set inactivity timer for end device children to 25 seconds */	gJenie_EndDeviceChildActivityTimeout = 250;	/*  Configure the network */	vNetwork_ConfigureNetwork(E_JENIE_ROUTER, NETWORK_MAX_CHILDREN, FALSE);}/**************************************************************************** * * NAME: vJenie_CbInit * * DESCRIPTION: * Perform application initialisation after stack has initialised. * Start running the stack. * * RETURNS: * None * ****************************************************************************/PUBLIC void vJenie_CbInit (bool_t bWarmStart){	/* Initialise integrated peripherals */	(void) u32JPI_Init();    /* Initialise network */	vNetwork_Init(bWarmStart, TRUE);}/**************************************************************************** * * NAME: vJenie_CbMain * * DESCRIPTION: * Main application task, called repeatedly by the stack. * This function should be non-blocking. * * RETURNS: * None * ****************************************************************************/PUBLIC void vJenie_CbMain (void){	/* Call the shared network main function */	vNetwork_Main();}/**************************************************************************** * * NAME: vJenie_CbStackMgmtEvent * * DESCRIPTION: * Called when stack management event has occurred. * * RETURNS: * None * ****************************************************************************/PUBLIC void vJenie_CbStackMgmtEvent (teEventType   eEventType,								   void        *pvEventPrim){	/* Call the shared network stack management event function */	vNetwork_StackMgmtEvent(eEventType, pvEventPrim);}/**************************************************************************** * * NAME: vJenie_CbStackDataEvent * * DESCRIPTION: * Called when data event has occurred. * * RETURNS: * None * ****************************************************************************/PUBLIC void vJenie_CbStackDataEvent (teEventType   eEventType,								   void             *pvEventPrim){	/* Call the shared network stack data event function */	vNetwork_StackDataEvent(eEventType, pvEventPrim);}/**************************************************************************** * * NAME: vJenie_CbHwEvent * * DESCRIPTION: * * * RETURNS: * None * ****************************************************************************/PUBLIC void vJenie_CbHwEvent (uint32 u32DeviceId,							uint32 u32ItemBitmap){	/* Call the shared network hardware event function */	vNetwork_HwEvent(u32DeviceId, u32ItemBitmap);}/****************************************************************************//***        END OF FILE                                                   ***//****************************************************************************/

⌨️ 快捷键说明

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