I try to use pytos from the cvs version (tinyos-1.x).
First I adapted the jimport's to JPackages (jpype), but it shouldnt be
the problem.
As long as I dont use @rpc behind a provided interface/function,
everything works fine (also NescApp('build/pc/').
If I add @rpc behind an interface, recompile successfully the project
and start it in the same way again with >>> NescApp('build/pc/'), I
receive the following error:
In [2]: app = na.NescApp(buildDir='build/mica2/')
Import the rpc commands and ram symbols
---------------------------------------------------------------------------
exceptions.AttributeError Traceback (most
recent call last)
/home/awapf/tosprojecttrunk/Routing1Relay/<ipython console>
/usr/lib/python2.4/site-packages/pytos/util/NescApp.py in
__init__(self, buildDir, motecom, tosbase, localCommOnly,
applicationName, xmlFileDOM)
481 # Import the rpc commands and ram symbols
482 try:
--> 483 self.rpc = Rpc.Rpc(self)
484 except Exception, e:
485 if len(e.args)>0 and re.search("WARNING: cannot find
file", e.args[0]) > 0 :
/usr/lib/python2.4/site-packages/pytos/tools/Rpc.py in __init__(self,
app, sendComm, receiveComm, tosbase, **callParams)
235 functions, =
schema.childNodes[0].getElementsByTagName("rpcFunctions")
236 functions = [node for node in functions.childNodes if
node.nodeType == 1]
237 for funcDef in functions:
--> 238 self._messages[funcDef.tagName] = RpcFunction(funcDef, self)
239
/usr/lib/python2.4/site-packages/pytos/tools/Rpc.py in __init__(self,
xmlDefinition, parent)
93 self.rpcHeader.dataLength = self.size - self.rpcHeader.size
94 #turn the response type into a response msg (to be
received by the user)
---> 95 responseType = parent.app.types[
96
xmlDefinition.getElementsByTagName("returnType")[0].getAttribute("typeName")]
97 if issubclass(type(responseType), nescDecls.nescStruct) :
/usr/lib/python2.4/site-packages/pytos/util/NescApp.py in __getitem__(self, key)
126 return deepcopy(self._types[key])
127 else:
--> 128 raise AttributeError("No type \"%s\" defined" % key)
129
130 def __repr__(self) :
AttributeError: No type "result_t" defined
Any suggestions? The same happens after compiling the
tinyos-1.x/contrib/hood/apps/TestRpc/
Thanks,
Andreas
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help