-
Notifications
You must be signed in to change notification settings - Fork 1
/
TOSSIM.py
268 lines (251 loc) · 12.6 KB
/
TOSSIM.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.33
#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _TOSSIM
import new
new_instancemethod = new.instancemethod
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'PySwigObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
import types
try:
_object = types.ObjectType
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
del types
class MAC(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, MAC, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, MAC, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _TOSSIM.new_MAC(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _TOSSIM.delete_MAC
__del__ = lambda self : None;
def initHigh(*args): return _TOSSIM.MAC_initHigh(*args)
def initLow(*args): return _TOSSIM.MAC_initLow(*args)
def high(*args): return _TOSSIM.MAC_high(*args)
def low(*args): return _TOSSIM.MAC_low(*args)
def symbolsPerSec(*args): return _TOSSIM.MAC_symbolsPerSec(*args)
def bitsPerSymbol(*args): return _TOSSIM.MAC_bitsPerSymbol(*args)
def preambleLength(*args): return _TOSSIM.MAC_preambleLength(*args)
def exponentBase(*args): return _TOSSIM.MAC_exponentBase(*args)
def maxIterations(*args): return _TOSSIM.MAC_maxIterations(*args)
def minFreeSamples(*args): return _TOSSIM.MAC_minFreeSamples(*args)
def rxtxDelay(*args): return _TOSSIM.MAC_rxtxDelay(*args)
def ackTime(*args): return _TOSSIM.MAC_ackTime(*args)
def setInitHigh(*args): return _TOSSIM.MAC_setInitHigh(*args)
def setInitLow(*args): return _TOSSIM.MAC_setInitLow(*args)
def setHigh(*args): return _TOSSIM.MAC_setHigh(*args)
def setLow(*args): return _TOSSIM.MAC_setLow(*args)
def setSymbolsPerSec(*args): return _TOSSIM.MAC_setSymbolsPerSec(*args)
def setBitsBerSymbol(*args): return _TOSSIM.MAC_setBitsBerSymbol(*args)
def setPreambleLength(*args): return _TOSSIM.MAC_setPreambleLength(*args)
def setExponentBase(*args): return _TOSSIM.MAC_setExponentBase(*args)
def setMaxIterations(*args): return _TOSSIM.MAC_setMaxIterations(*args)
def setMinFreeSamples(*args): return _TOSSIM.MAC_setMinFreeSamples(*args)
def setRxtxDelay(*args): return _TOSSIM.MAC_setRxtxDelay(*args)
def setAckTime(*args): return _TOSSIM.MAC_setAckTime(*args)
MAC_swigregister = _TOSSIM.MAC_swigregister
MAC_swigregister(MAC)
class Radio(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Radio, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Radio, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _TOSSIM.new_Radio(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _TOSSIM.delete_Radio
__del__ = lambda self : None;
def add(*args): return _TOSSIM.Radio_add(*args)
def gain(*args): return _TOSSIM.Radio_gain(*args)
def connected(*args): return _TOSSIM.Radio_connected(*args)
def remove(*args): return _TOSSIM.Radio_remove(*args)
def setNoise(*args): return _TOSSIM.Radio_setNoise(*args)
def setSensitivity(*args): return _TOSSIM.Radio_setSensitivity(*args)
Radio_swigregister = _TOSSIM.Radio_swigregister
Radio_swigregister(Radio)
class Packet(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Packet, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Packet, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _TOSSIM.new_Packet(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _TOSSIM.delete_Packet
__del__ = lambda self : None;
def setSource(*args): return _TOSSIM.Packet_setSource(*args)
def source(*args): return _TOSSIM.Packet_source(*args)
def setDestination(*args): return _TOSSIM.Packet_setDestination(*args)
def destination(*args): return _TOSSIM.Packet_destination(*args)
def setLength(*args): return _TOSSIM.Packet_setLength(*args)
def length(*args): return _TOSSIM.Packet_length(*args)
def setType(*args): return _TOSSIM.Packet_setType(*args)
def type(*args): return _TOSSIM.Packet_type(*args)
def data(*args): return _TOSSIM.Packet_data(*args)
def setData(*args): return _TOSSIM.Packet_setData(*args)
def maxLength(*args): return _TOSSIM.Packet_maxLength(*args)
def setStrength(*args): return _TOSSIM.Packet_setStrength(*args)
def deliver(*args): return _TOSSIM.Packet_deliver(*args)
def deliverNow(*args): return _TOSSIM.Packet_deliverNow(*args)
Packet_swigregister = _TOSSIM.Packet_swigregister
Packet_swigregister(Packet)
class variable_string_t(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, variable_string_t, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, variable_string_t, name)
__repr__ = _swig_repr
__swig_setmethods__["type"] = _TOSSIM.variable_string_t_type_set
__swig_getmethods__["type"] = _TOSSIM.variable_string_t_type_get
if _newclass:type = _swig_property(_TOSSIM.variable_string_t_type_get, _TOSSIM.variable_string_t_type_set)
__swig_setmethods__["ptr"] = _TOSSIM.variable_string_t_ptr_set
__swig_getmethods__["ptr"] = _TOSSIM.variable_string_t_ptr_get
if _newclass:ptr = _swig_property(_TOSSIM.variable_string_t_ptr_get, _TOSSIM.variable_string_t_ptr_set)
__swig_setmethods__["len"] = _TOSSIM.variable_string_t_len_set
__swig_getmethods__["len"] = _TOSSIM.variable_string_t_len_get
if _newclass:len = _swig_property(_TOSSIM.variable_string_t_len_get, _TOSSIM.variable_string_t_len_set)
__swig_setmethods__["isArray"] = _TOSSIM.variable_string_t_isArray_set
__swig_getmethods__["isArray"] = _TOSSIM.variable_string_t_isArray_get
if _newclass:isArray = _swig_property(_TOSSIM.variable_string_t_isArray_get, _TOSSIM.variable_string_t_isArray_set)
def __init__(self, *args):
this = _TOSSIM.new_variable_string_t(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _TOSSIM.delete_variable_string_t
__del__ = lambda self : None;
variable_string_t_swigregister = _TOSSIM.variable_string_t_swigregister
variable_string_t_swigregister(variable_string_t)
class nesc_app_t(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, nesc_app_t, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, nesc_app_t, name)
__repr__ = _swig_repr
__swig_setmethods__["numVariables"] = _TOSSIM.nesc_app_t_numVariables_set
__swig_getmethods__["numVariables"] = _TOSSIM.nesc_app_t_numVariables_get
if _newclass:numVariables = _swig_property(_TOSSIM.nesc_app_t_numVariables_get, _TOSSIM.nesc_app_t_numVariables_set)
__swig_setmethods__["variableNames"] = _TOSSIM.nesc_app_t_variableNames_set
__swig_getmethods__["variableNames"] = _TOSSIM.nesc_app_t_variableNames_get
if _newclass:variableNames = _swig_property(_TOSSIM.nesc_app_t_variableNames_get, _TOSSIM.nesc_app_t_variableNames_set)
__swig_setmethods__["variableTypes"] = _TOSSIM.nesc_app_t_variableTypes_set
__swig_getmethods__["variableTypes"] = _TOSSIM.nesc_app_t_variableTypes_get
if _newclass:variableTypes = _swig_property(_TOSSIM.nesc_app_t_variableTypes_get, _TOSSIM.nesc_app_t_variableTypes_set)
__swig_setmethods__["variableArray"] = _TOSSIM.nesc_app_t_variableArray_set
__swig_getmethods__["variableArray"] = _TOSSIM.nesc_app_t_variableArray_get
if _newclass:variableArray = _swig_property(_TOSSIM.nesc_app_t_variableArray_get, _TOSSIM.nesc_app_t_variableArray_set)
def __init__(self, *args):
this = _TOSSIM.new_nesc_app_t(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _TOSSIM.delete_nesc_app_t
__del__ = lambda self : None;
nesc_app_t_swigregister = _TOSSIM.nesc_app_t_swigregister
nesc_app_t_swigregister(nesc_app_t)
class Variable(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Variable, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Variable, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _TOSSIM.new_Variable(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _TOSSIM.delete_Variable
__del__ = lambda self : None;
def getData(*args): return _TOSSIM.Variable_getData(*args)
Variable_swigregister = _TOSSIM.Variable_swigregister
Variable_swigregister(Variable)
class Mote(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Mote, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Mote, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _TOSSIM.new_Mote(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _TOSSIM.delete_Mote
__del__ = lambda self : None;
def id(*args): return _TOSSIM.Mote_id(*args)
def euid(*args): return _TOSSIM.Mote_euid(*args)
def setEuid(*args): return _TOSSIM.Mote_setEuid(*args)
def bootTime(*args): return _TOSSIM.Mote_bootTime(*args)
def bootAtTime(*args): return _TOSSIM.Mote_bootAtTime(*args)
def isOn(*args): return _TOSSIM.Mote_isOn(*args)
def turnOff(*args): return _TOSSIM.Mote_turnOff(*args)
def turnOn(*args): return _TOSSIM.Mote_turnOn(*args)
def getVariable(*args): return _TOSSIM.Mote_getVariable(*args)
def addNoiseTraceReading(*args): return _TOSSIM.Mote_addNoiseTraceReading(*args)
def createNoiseModel(*args): return _TOSSIM.Mote_createNoiseModel(*args)
def generateNoise(*args): return _TOSSIM.Mote_generateNoise(*args)
Mote_swigregister = _TOSSIM.Mote_swigregister
Mote_swigregister(Mote)
class Tossim(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Tossim, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Tossim, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _TOSSIM.new_Tossim(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _TOSSIM.delete_Tossim
__del__ = lambda self : None;
def init(*args): return _TOSSIM.Tossim_init(*args)
def time(*args): return _TOSSIM.Tossim_time(*args)
def ticksPerSecond(*args): return _TOSSIM.Tossim_ticksPerSecond(*args)
def setTime(*args): return _TOSSIM.Tossim_setTime(*args)
def timeStr(*args): return _TOSSIM.Tossim_timeStr(*args)
def currentNode(*args): return _TOSSIM.Tossim_currentNode(*args)
def getNode(*args): return _TOSSIM.Tossim_getNode(*args)
def setCurrentNode(*args): return _TOSSIM.Tossim_setCurrentNode(*args)
def addChannel(*args): return _TOSSIM.Tossim_addChannel(*args)
def removeChannel(*args): return _TOSSIM.Tossim_removeChannel(*args)
def randomSeed(*args): return _TOSSIM.Tossim_randomSeed(*args)
def runNextEvent(*args): return _TOSSIM.Tossim_runNextEvent(*args)
def mac(*args): return _TOSSIM.Tossim_mac(*args)
def radio(*args): return _TOSSIM.Tossim_radio(*args)
def newPacket(*args): return _TOSSIM.Tossim_newPacket(*args)
Tossim_swigregister = _TOSSIM.Tossim_swigregister
Tossim_swigregister(Tossim)