Changes between Version 6 and Version 7 of WARPnet1/BuildClientScripts
- Timestamp:
- Jun 18, 2010, 2:14:43 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WARPnet1/BuildClientScripts
v6 v7 1 1 = Building and Running Client Scripts = 2 2 3 Here we will build and run a client script. To see a complete example refer to [wiki:WARPnet/Example Scriptthe example script].3 Here we will build and run a client script. To see a complete example refer to [wiki:WARPnet/Example the example script]. 4 4 5 5 == Building the Client Script == … … 8 8 {{{ 9 9 #!c 10 #define STRUCTID_CONTROL 11 #define STRUCTID_CONTROL_ACK 10 #define STRUCTID_CONTROL 0x13 11 #define STRUCTID_CONTROL_ACK 0x14 12 12 13 13 typedef struct { … … 49 49 def prepToSend(self, nodeID): 50 50 self.updateDone = False 51 return struct.pack('!6BHII', self.structID, nodeID, self.txPower, self.channel, self.modOrderHeader, self.modOrderPayload, self.reserved, self.packetGeneratorPeriod, self.packetGeneratorLength) 51 return struct.pack('!6BHII', self.structID, nodeID, self.txPower, self.channel, self.modOrderHeader, \ 52 self.modOrderPayload, self.reserved, self.packetGeneratorPeriod, self.packetGeneratorLength) 52 53 53 54 def updateFromNode(self, rawData, pcapts): 54 55 dataTuple = struct.unpack('!BBH', rawData[0:4]) 55 print "Control struct successfully applied at node %d" % dataTuple[1]56 56 57 57 }}}