2015-11-03 50 views
1

我在N/S2中通過藍牙協議實現無線技術。這是一個tcl腳本。不過,我收到以下錯誤:tcl中的藍牙實現錯誤

num_nodes is set 4 
    (_o13 cmd line 1) 
    invoked from within 
"_o13 cmd rt AODV" 
    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 "_o13" line 2) 
    (SplitObject unknown line 2) 
    invoked from within 
"$node_($i) rt AODV" 
    ("for" body line 3) 
    invoked from within 
"for {set i 0} {$i < $val(nn)} {incr i} { 
    set node_($i) [$ns_ node $i] 
    $node_($i) rt AODV 
    $node_($i) on 
    [$node_($i) set l2cap_] set ifq_limit_ 30 
    $nod..." 
    (file "bluetooth.tcl" line 58) 
+0

未知的ns2版本,未知文件bluetooth.tcl。未知的「Linux操作系統」。 (ns2正在變老,有些協議不能再與當代「Linux操作系統」一起構建或使用)。你是否向ns2添加了任何「藍牙」? ucbt?您的文件「bluetooth.tcl」可以上傳到「Google文檔」。藍牙示例:請參閱https://stackoverflow.com/questions/33283109/network-simulation-tool-supporting-bluetooth/33287043#33287043 –

+0

看起來問題是在執行'rt'方法,或者至少這是什麼是檢測問題。 _real_問題可能在其他地方。 (並且親愛的'env(DEITY)',看着這個堆棧跟蹤讓我擔心OTcl內部實現的很多問題,這將會是_slow _...) –

+0

我使用的是ubuntu 15.04,ns2版本是2.35+ DFSG-2ubuntu1 – rahul

回答

0

所有我們需要看到您的情況,並給你一個答案的第一。第二,看來你正試圖與榮獲」另一個參數創建節點T爲需要...

試試這個:

set node_($i) [$ns_ node] 

取而代之的是:

set node_($i) [$ns_ node $i] 

而關於下一行,你可以做到這一點,看看你錯過了什麼或者哪一個參數您使用了錯誤的方法:

  1. 打開一個新的終端和cd到您的NS2目錄。

    例如:$cd /ns-allinone-2.35/ns-2.35/

  2. 使用grep,瞭解如何正確使用這些參數。

    例子:

    grep -r "rt AODV" ./ 
    

    或者,如果結果是更多的終端的歷史,你可以指定一個文件搜索:

    grep -r "rt AODV" ./ > search.txt 
    

嘗試它的每個參數瞭解它是如何工作的。