WSN仿真一例假定节点0(node[0])周期性广播消息其它节点接收到消息并转发出去

源代码在线查看: application.h

软件大小: 73 K
上传用户: foreigngirl
关键词: node WSN 节点 仿真
下载地址: 免注册下载 普通下载 VIP

相关代码

				//-------------------------------------------------------------------				//  file name: application.h				// 				//    - header file for the application class				//    - see the .cpp file for more details				//				//-------------------------------------------------------------------								#ifndef __APPLICATION_H				#define __APPLICATION_H												#include 				#include "globaldef.h"				#include 												/** Main class on top of all the protocol stack. It contains user defined code 				 * as the top application or for debugging/testing the underlying layers 				 */				class application : public cSimpleModule				{				    					/** omnet++ specific code */				    Module_Class_Members(application,cSimpleModule,0);									/** the initialization function */					void initialize();									/** main loop function */					void handleMessage(cMessage *msg);									/** last function to be called in this class */					void finish();									// local functions					void processFlood(cMessage *msg);									// local data structures										int last_seen_id;	// the id of the last seen message					int msgcount;		// number of generated/forwarded messages								};												Define_Module( application );												#endif							

相关资源