Hi All

I am trying to develop a new protocol in MAC 802.11 .

NS Version : ns2.35


*In Mac-802_11.cc file :*


I added a new command setMacDemand as

 else if(strcmp(argv[1],"setMacDemand")==0) {
            Tcl &tcl = Tcl::instance();
            tcl.eval("puts \"Message from function\"");
            return (TCL_OK);



*And in ns-mobilenode.tcl*

Node/MobileNode instproc setMacDemand {demand} {
    $self instvar mac_
    $mac_(0) setMacDemand  $demand
 }



*In my tcl : *

$ns_ at 0.0  "$node_(0) setMacDemand 234 "



Now when I run the script , I am facing an error as below

setMacDemand lookup failed
ns: _o14 setMacDemand 234:
    (_o19 cmd line 1)
    invoked from within
"_o19 cmd setMacDemand 234"
    invoked from within
"catch "$self cmd $args" ret"
    invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
    (procedure "_o19" line 2)
    (SplitObject unknown line 2)
    invoked from within
"$mac_(0) setMacDemand $demand"
    (procedure "_o14" line 3)
    (Node/MobileNode setMacDemand line 3)
    invoked from within
"_o14 setMacDemand 234"



Please let me know what is wrong.Thanks a lot.

Reply via email to