#include <TestApplLayer.h>
Inherits BasicApplLayer.
Inherited by BurstApplLayer.
Inheritance diagram for TestApplLayer:
Public Types | |
enum | APPL_MSG_TYPES { SEND_BROADCAST_TIMER, BROADCAST_MESSAGE, BROADCAST_REPLY_MESSAGE } |
Public Member Functions | |
Module_Class_Members (TestApplLayer, BasicApplLayer, 0) | |
virtual void | initialize (int) |
Initialization of the module and some variables. | |
virtual void | finish () |
Protected Member Functions | |
virtual void | handleSelfMsg (cMessage *) |
Handle self messages such as timer... | |
virtual void | handleLowerMsg (cMessage *) |
Handle messages from lower layer. | |
void | sendBroadcast () |
send a broadcast packet to all connected neighbors | |
void | sendReply (ApplPkt *msg) |
send a reply to a broadcast message | |
Protected Attributes | |
cMessage * | delayTimer |
In this implementation all nodes randomly send broadcast packets to all connected neighbors. Every node who receives this packet will send a reply to the originator node.
|
Handle messages from lower layer. There are two kinds of messages that can arrive at this module: The first (kind = BROADCAST_MESSAGE) is a broadcast packet from a neighbor node to which we have to send a reply. The second (kind = BROADCAST_REPLY_MESSAGE) is a reply to a broadcast packet that we have send and just causes some output before it is deleted Reimplemented from BasicApplLayer. |
|
Handle self messages such as timer... A timer with kind = SEND_BROADCAST_TIMER indicates that a new broadcast has to be send (sendBroadcast). There are no other timer implemented for this module.
Reimplemented from BasicApplLayer. Reimplemented in BurstApplLayer. |
|
Initialization of the module and some variables. First we have to initialize the module from which we derived ours, in this case BasicModule. Then we will set a timer to indicate the first time we will send a message Reimplemented from BasicApplLayer. Reimplemented in BurstApplLayer. |
|
send a broadcast packet to all connected neighbors This function creates a new broadcast message and sends it down to the network layer |