[Tinyos-commits] CVS: tinyos-1.x/tools/python/pytos/tools
RamSymbols.py, 1.1, 1.2 Rpc.py, 1.1, 1.2
Kamin Whitehouse
kaminw at users.sourceforge.net
Tue Sep 27 23:59:13 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/tools/python/pytos/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14499/pytos/tools
Modified Files:
RamSymbols.py Rpc.py
Log Message:
NescApp now has an attribute called "connections" which holds all connections to the network for that particular app. This makes it easier for other applications to snoop on network traffic. The error messages have also been improved, if the user did not compile with nescDecls, rpc, or ram symbols. RoutingMessages now uses the connections field in NescApp, and has the new ability to connect to only local comm (ie. not use drip/drain) and to not bonk when a connection is not available.
Index: RamSymbols.py
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tools/python/pytos/tools/RamSymbols.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RamSymbols.py 23 Sep 2005 10:20:33 -0000 1.1
--- RamSymbols.py 28 Sep 2005 06:59:11 -0000 1.2
***************
*** 256,265 ****
"""
! def __init__(self, app, buildDir, sendComm=None, receiveComm=None, tosbase=True, **callParams) :
""" Find function defs in rpcSchema.xml file and create function objects."""
if not "ramSymbol_t" in app.types._types :
! print "The contrib/hood/tos/lib/RamSymbols/RamSymbolsM module was not included. No ram symbols will be imported."
! RoutingMessages.RoutingMessages.__init__(self, app, sendComm, receiveComm,
! app.enums.AM_RPCCOMMANDMSG, tosbase)
self.defaultCallParams = ( ("address", None), ("returnAddress", None),
--- 256,264 ----
"""
! def __init__(self, app, sendComm=None, receiveComm=None, tosbase=True, **callParams) :
""" Find function defs in rpcSchema.xml file and create function objects."""
if not "ramSymbol_t" in app.types._types :
! print "The RamSymbolsM module was not compiled in. No ram symbols will be imported."
! RoutingMessages.RoutingMessages.__init__(self, app)
self.defaultCallParams = ( ("address", None), ("returnAddress", None),
***************
*** 270,275 ****
self.noType = []
self.arraySizeIncorrect = []
! nescDeclsXml = nescDecls.findBuildFile(buildDir, "nescDecls.xml")
! schema = minidom.parse(nescDeclsXml)
symbols, = schema.childNodes[0].getElementsByTagName("ramSymbols")
symbols = [node for node in symbols.childNodes if node.nodeType == 1]
--- 269,273 ----
self.noType = []
self.arraySizeIncorrect = []
! schema = minidom.parse("%snescDecls.xml" % app.buildDir)
symbols, = schema.childNodes[0].getElementsByTagName("ramSymbols")
symbols = [node for node in symbols.childNodes if node.nodeType == 1]
Index: Rpc.py
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tools/python/pytos/tools/Rpc.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Rpc.py 23 Sep 2005 10:20:33 -0000 1.1
--- Rpc.py 28 Sep 2005 06:59:11 -0000 1.2
***************
*** 38,42 ****
"""
! import sys, string, time, types
from xml.dom import minidom
import pytos.util.nescDecls as nescDecls
--- 38,42 ----
"""
! import sys, string, time, types, os
from xml.dom import minidom
import pytos.util.nescDecls as nescDecls
***************
*** 210,217 ****
"""
! def __init__(self, app, buildDir, sendComm=None, receiveComm=None, tosbase=True, **callParams) :
""" Find function defs in rpcSchema.xml file and create function objects."""
! RoutingMessages.RoutingMessages.__init__(self, app, sendComm, receiveComm,
! app.enums.AM_RPCCOMMANDMSG, tosbase)
self.defaultCallParams = ( ("address", None), ("returnAddress", None),
--- 210,220 ----
"""
! def __init__(self, app, sendComm=None, receiveComm=None, tosbase=True, **callParams) :
""" Find function defs in rpcSchema.xml file and create function objects."""
! # Check for the rpcSchema.xml file
! if not os.path.isfile("%srpcSchema.xml" % app.buildDir) :
! raise Exception("""\nWARNING: cannot find file \"%srpcSchema.xml\". No rpc commands will be imported.""" % app.buildDir)
!
! RoutingMessages.RoutingMessages.__init__(self, app)
self.defaultCallParams = ( ("address", None), ("returnAddress", None),
***************
*** 219,224 ****
self.initializeCallParams(callParams)
! rpcSchema = nescDecls.findBuildFile(buildDir, "rpcSchema.xml")
! schema = minidom.parse(rpcSchema)
functions, = schema.childNodes[0].getElementsByTagName("rpcFunctions")
functions = [node for node in functions.childNodes if node.nodeType == 1]
--- 222,226 ----
self.initializeCallParams(callParams)
! schema = minidom.parse("%srpcSchema.xml" % app.buildDir)
functions, = schema.childNodes[0].getElementsByTagName("rpcFunctions")
functions = [node for node in functions.childNodes if node.nodeType == 1]
More information about the Tinyos-commits
mailing list