Hi ns-users ,

 Please, Can someone explain  to me  this part of LeachApp.cc code .
And , plz  where shall found the declaration  and initialization of
sensor_node (pointer on  chadv structure leachApp.h )   

Void LeachApp::start()
{
    if (agent_ == NULL)
    {
        char agentName[32];

        printf("Warning! LeachApp::start() => agent_ of %d is null! Creating
a RCAgent!\n", sensor_node_->nodeid()); // exactly this line 

        sprintf(agentName, "__rcagent%d", sensor_node_->nodeid());   

        agent_ = new RCAgent();
        agent_->name(agentName);

        Tcl::instance().enter(agent_);

        printf("%s attach %s", name(), agent_->name());
        Tcl::instance().evalf("%s attach %s", name(), agent_->name());
    }

    sensedData_->node_id() == sensor_node_->nodeid();

    mac_ = (MacSensor *) ((RCAgent *) agent_)->getMAC();
    mac_->node_num() = sensor_node_->nodeid();
    decideClusterHead();

    CommonNodeApp::start();
}

Many thanks
-- 
View this message in context: 
http://www.nabble.com/leachApp-under-mannasim-extension-tp25082599p25082599.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to