Changes between Version 15 and Version 16 of WARPnet1/BuildClientScripts
- Timestamp:
- Jun 25, 2010, 2:16:20 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WARPnet1/BuildClientScripts
v15 v16 26 26 int pktGen_period; 27 27 int pktGen_length; 28 int pktGen_numPackets;29 28 } warpnetControl; 30 29 … … 51 50 packetGeneratorPeriod = 0 52 51 packetGeneratorLength = 0 53 packetGeneratorNumPackets = 054 52 55 53 def __init__(self, logger=None): … … 63 61 self.packetGeneratorPeriod = 10 64 62 self.packetGeneratorLength = 1300 65 self.packetGeneratorNumPackets = 100066 63 67 64 def prepToSend(self, nodeID): 68 65 self.updateDone = False 69 return struct.pack('!6BH 3I', self.structID, nodeID, self.txPower, self.channel, self.modOrderHeader, \70 self.modOrderPayload, self.reserved, self.packetGeneratorPeriod, self.packetGeneratorLength , self.packetGeneratorNumPackets)66 return struct.pack('!6BH2I', self.structID, nodeID, self.txPower, self.channel, self.modOrderHeader, \ 67 self.modOrderPayload, self.reserved, self.packetGeneratorPeriod, self.packetGeneratorLength) 71 68 72 69 def updateFromNode(self, rawData, pcapts): … … 75 72 }}} 76 73 77 The `prepToSend` function creates the raw data that is seen by `warpnet.c` in the FPGA. It creates a byte packed data of 6 bytes (6B), 1 short (H) and 3 ints (3I). This is exactly what the node is expecting. A appropriate response from the node is a `warpnetACK` which `updateFromNode` parses in the python file.74 The `prepToSend` function creates the raw data that is seen by `warpnet.c` in the FPGA. It creates a byte packed data of 6 bytes (6B), 1 short (H) and 2 ints (2I). This is exactly what the node is expecting. A appropriate response from the node is a `warpnetACK` which `updateFromNode` parses in the python file. 78 75 79 76 For a struct that is requesting data the raw data sent would be a `warpnetRequest` struct and expect a response of the appropriate type.