Changes between Version 8 and Version 9 of WARPnet1/BuildClientScripts


Ignore:
Timestamp:
Jun 18, 2010, 2:38:39 PM (14 years ago)
Author:
sgupta
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPnet1/BuildClientScripts

    v8 v9  
    2323        int pktGen_numPackets;
    2424} warpnetControl;
     25
     26typedef struct {
     27        char structID;
     28        char nodeID;
     29        short cmdID;
     30} warpnetAck;
    2531}}}
    2632
     
    2935{{{
    3036#!python
     37STRUCTID_CONTROL = 0x13
     38STRUCTID_CONTROL_ACK = 0x14
     39
    3140class ControlStruct(ClientStruct):
    3241        txPower = -1
     
    5362        def prepToSend(self, nodeID):
    5463                self.updateDone = False
    55                 return struct.pack('!6BHII', 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)
    5766               
    5867        def updateFromNode(self, rawData, pcapts):
     
    6069
    6170}}}
     71
     72The `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.
    6273
    6374== Running the Client Script ==