/* Process model C form file: wpan_packet_source_process.pr.c */
/* Portions of this file copyright 1986-2008 by OPNET Technologies, Inc. */
/* This variable carries the header into the object file */
const char wpan_packet_source_process_pr_c [] = "MIL_3_Tfile_Hdr_ 145A 30A modeler 7 49D5FDBC 49D5FDBC 1 nb-pju jurcikp 0 0 none none 0 0 none 0 0 0 0 0 0 0 0 1e80 8 ";
#include <string.h>
/* OPNET system definitions */
#include <opnet.h>
/* Header Block */
/* Include files */
// Distribution Modeling sub-package
#include <oms_dist_support.h>
#include "headers\wpan_math.h"
#include "headers\wpan_params.h"
#include "headers\wpan_struct.h"
/* Node configuration constants */
/* Special attribute values */
#define SC_INFINITE_TIME -1.0
/* Interrupt code values */
#define SC_START 0
#define SC_STOP 1
#define SC_GENERATE_ACK 2
#define SC_GENERATE_UNACK 3
/* Input and output streams */
#define STRM_FROM_UNACK_TO_MAC 0
#define STRM_FROM_ACK_TO_MAC 1
/* State machine conditions */
#define START ((op_intrpt_type () == OPC_INTRPT_SELF) && (op_intrpt_code () == SC_START))
#define DISABLED ((op_intrpt_type () == OPC_INTRPT_SELF) && (op_intrpt_code () == SC_STOP))
#define STOP ((op_intrpt_type () == OPC_INTRPT_SELF) && (op_intrpt_code () == SC_STOP))
#define ACK_MSDU_GENERATE ((op_intrpt_type () == OPC_INTRPT_SELF) && (op_intrpt_code () == SC_GENERATE_ACK))
#define UNACK_MSDU_GENERATE ((op_intrpt_type () == OPC_INTRPT_SELF) && (op_intrpt_code () == SC_GENERATE_UNACK))
/* Function prototypes. */
static void wpan_source_init (void);
static void wpan_print_parameters (void);
static void wpan_ack_traffic_generate (void);
static void wpan_unack_traffic_generate (void);
/* Global variables. */
extern int app_sent_msdu_nbr; // Number of MSDU generated by the Application Layer
extern double app_sent_msdu_bits; // MSDUs sent by the Application Layer [kbits]
/* End of Header Block */
#if !defined (VOSD_NO_FIN)
#undef BIN
#undef BOUT
#define BIN FIN_LOCAL_FIELD(_op_last_line_passed) = __LINE__ - _op_block_origin;
#define BOUT BIN
#define BINIT FIN_LOCAL_FIELD(_op_last_line_passed) = 0; _op_block_origin = __LINE__;
#else
#define BINIT
#endif /* #if !defined (VOSD_NO_FIN) */
/* State variable definitions */
typedef struct
{
/* Internal state tracking for FSM */
FSM_SYS_STATE
/* State Variables */
double ack_start_time ; /* Time when this source will start its ack-MSDU generation activities. */
double ack_stop_time ; /* Time when this source will stop its ack-MSDU generation activities. */
OmsT_Dist_Handle ack_msdu_interarrival_dist_ptr ; /* PDF used to determine the interarrival times of the generated ack-MSDUs. */
OmsT_Dist_Handle ack_msdu_size_dist_ptr ; /* PDF used to determine the sizes of generated ack-MSDUs. */
char ack_msdu_interarrival_dist_str[128] ; /* PDF used to determine the interarrival times of the generated ack-MSDUs. */
char ack_msdu_size_dist_str[128] ; /* PDF used to determine the sizes of generated ack-MSDUs. */
double unack_start_time ; /* Time when this source will start its unack-MSDU generation activities. */
double unack_stop_time ; /* Time when this source will stop its unack-MSDU generation activities. */
OmsT_Dist_Handle unack_msdu_interarrival_dist_ptr ; /* PDF used to determine the interarrival times of generated unack-MSDUs. */
OmsT_Dist_Handle unack_msdu_size_dist_ptr ; /* PDF used to determine the sizes of generated unack-MSDUs. */
char unack_msdu_interarrival_dist_str[128] ; /* PDF used to determine the interarrival times of generated unack-MSDUs. */
char unack_msdu_size_dist_str[128] ; /* PDF used to determine the sizes of generated unack-MSDUs. */
int dest_mac_address ; /* Destination MAC address for data transmission */
char node_name[30] ; /* Name of the node */
Objid parent_id ; /* Object ID of the parent object (node) */
Boolean enable_log ; /* Is the logging to the file enabled? */
Stathandle ack_bits_sent_hndl ; /* Statistic handle for "Traffic Sent (bits/sec)" statistic. */
Stathandle ack_msdus_sent_hndl ; /* Statistic handle for "Traffic Sent (MSDUs/sec)" statistic. */
Stathandle ack_msdu_size_hndl ; /* Statistic handle for "MSDU Size (bits)" statistic. */
Stathandle ack_msdu_interarrival_time_hndl ; /* Statistic handle for "MSDUt Interaarival Time (secs)" statistic. */
Stathandle ack_bits_sent_hndlG ; /* Statistic handle for "Traffic Sent (bits/sec)" statistic. */
Stathandle ack_msdus_hndl ; /* Statistic handle for the total number of generated MSDUs. */
Stathandle ack_msdus_hndlG ;
Stathandle unack_bits_sent_hndl ; /* Statistic handle for "Traffic Sent (bits/sec)" statistic. */
Stathandle unack_msdus_sent_hndl ; /* Statistic handle for "Traffic Sent (MSDUs/sec)" statistic. */
Stathandle unack_msdu_size_hndl ; /* Statistic handle for "MSDU Size (bits)" statistic. */
Stathandle unack_msdu_interarrival_time_hndl ; /* Statistic handle for "MSDU Interaarival Time (secs)" statistic. */
Stathandle unack_bits_sent_hndlG ; /* Statistic handle for "Traffic Sent (bits/sec)" statistic. */
Stathandle unack_msdus_hndl ; /* Statistic handle for the total number of generated MSDUs. */
Stathandle unack_msdus_hndlG ;
Evhandle ack_next_msdu_evh ; /* Event handle for the arrival of next acknowledged MSDU. */
Evhandle unack_next_msdu_evh ; /* Event handle for the arrival of next unacknowledged MSDU. */
} wpan_packet_source_process_state;
#define ack_start_time op_sv_ptr->ack_start_time
#define ack_stop_time op_sv_ptr->ack_stop_time
#define ack_msdu_interarrival_dist_ptr op_sv_ptr->ack_msdu_interarrival_dist_ptr
#define ack_msdu_size_dist_ptr op_sv_ptr->ack_msdu_size_dist_ptr
#define ack_msdu_interarrival_dist_str op_sv_ptr->ack_msdu_interarrival_dist_str
#define ack_msdu_size_dist_str op_sv_ptr->ack_msdu_size_dist_str
#define unack_start_time op_sv_ptr->unack_start_time
#define unack_stop_time op_sv_ptr->unack_stop_time
#define unack_msdu_interarrival_dist_ptr op_sv_ptr->unack_msdu_interarrival_dist_ptr
#define unack_msdu_size_dist_ptr op_sv_ptr->unac
没有合适的资源?快使用搜索试试~ 我知道了~
IEEE802.15.4_opnet_simulation_model_v2.1.zip
共34个文件
m:21个
c:6个
h:3个
3星 · 超过75%的资源 需积分: 14 37 下载量 5 浏览量
2009-09-13
16:48:12
上传
评论 2
收藏 160KB ZIP 举报
温馨提示
opent 14.5A版本仿真无线传感器网络的例子,其中MAC层采用IEEE802.15.4,内含电源模块建模。
资源推荐
资源详情
资源评论
收起资源包目录
IEEE802.15.4_opnet_simulation_model_v2.1.zip (34个子文件)
IEEE802.15.4_opnet_simulation_model_v2.1
wpan_analyzer_node.nd.m 3KB
wpan_synchro_process.pr.c 16KB
wpan_mac_process.pr.m 193KB
wpan_sink_process.pr.c 11KB
Sensor_Icons.icons 10KB
wpan_analyzer_process.pr.m 17KB
wpan_gts_traffic_source.pr.c 24KB
wpan_analyzer_process.pr.c 27KB
wpan_synchro_process.pr.m 10KB
wpan_sensor_node.nd.m 19KB
wpan_mac_process.pr.cpp 191KB
wpan_battery_process.pr.m 16KB
headers
wpan_math.h 5KB
wpan_params.h 2KB
wpan_struct.h 4KB
ici
wpan_battery_ici_format.ic.m 594B
wpan_gts_traffic_ici_format.ic.m 544B
wpan_battery_process.pr.c 17KB
wpan_sink_process.pr.m 6KB
wpan_packet_source_process.pr.m 40KB
wpan_gts_traffic_source.pr.m 21KB
wpan_ieee802_15_4.project
wpan_ieee802_15_4-scenario1.seq 4KB
wpan_ieee802_15_4-scenario1.nt.m 13KB
wpan_ieee802_15_4.prj 1KB
wpan_ieee802_15_4-scenario1.pb.m 6KB
packets
wpan_beacon_MSDU_format.pk.m 5KB
wpan_beacon_MPDU_format_64.pk.m 4KB
wpan_beacon_MPDU_format.pk.m 4KB
wpan_frame_MPDU_format.pk.m 5KB
wpan_frame_PPDU_format.pk.m 2KB
wpan_ack_MPDU_format.pk.m 3KB
wpan_frame_MPDU_format_64.pk.m 5KB
wpan_command_MSDU_format.pk.m 1KB
wpan_packet_source_process.pr.c 40KB
共 34 条
- 1
资源评论
- y8652315562013-01-05仿真发现错误,不知道是哪里出的原因
- sea640944482012-11-22对我学习建模方法有一定帮助,就是需要时间啊,因为没有说明
- sandyawen2012-07-10谢谢,对协议的物理层与媒体层都有仿真,有帮助
- chengmengli2012-12-0614.5仿真结果发生错误<<< Program Abort >>> Packet format (wpan_beacon_MSDU_format) is unrecognized.
jianghs2521
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功