Changes between Version 8 and Version 9 of WARPnet1/BuildClientScripts
- Timestamp:
- Jun 18, 2010, 2:38:39 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WARPnet1/BuildClientScripts
v8 v9 23 23 int pktGen_numPackets; 24 24 } warpnetControl; 25 26 typedef struct { 27 char structID; 28 char nodeID; 29 short cmdID; 30 } warpnetAck; 25 31 }}} 26 32 … … 29 35 {{{ 30 36 #!python 37 STRUCTID_CONTROL = 0x13 38 STRUCTID_CONTROL_ACK = 0x14 39 31 40 class ControlStruct(ClientStruct): 32 41 txPower = -1 … … 53 62 def prepToSend(self, nodeID): 54 63 self.updateDone = False 55 return struct.pack('!6BH II', self.structID, nodeID, self.txPower, self.channel, self.modOrderHeader, \56 self.modOrderPayload, self.reserved, self.packetGeneratorPeriod, self.packetGeneratorLength )64 return struct.pack('!6BH3I', self.structID, nodeID, self.txPower, self.channel, self.modOrderHeader, \ 65 self.modOrderPayload, self.reserved, self.packetGeneratorPeriod, self.packetGeneratorLength, self.packetGeneratorNumPackets) 57 66 58 67 def updateFromNode(self, rawData, pcapts): … … 60 69 61 70 }}} 71 72 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. 62 73 63 74 == Running the Client Script ==