Changes between Version 6 and Version 7 of WARPnet1/BuildClientScripts


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

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPnet1/BuildClientScripts

    v6 v7  
    11= Building and Running Client Scripts =
    22
    3 Here we will build and run a client script. To see a complete example refer to [wiki:WARPnet/ExampleScript the example script].
     3Here we will build and run a client script. To see a complete example refer to [wiki:WARPnet/Example the example script].
    44
    55== Building the Client Script ==
     
    88{{{
    99#!c
    10 #define STRUCTID_CONTROL                                        0x13
    11 #define STRUCTID_CONTROL_ACK                            0x14
     10#define STRUCTID_CONTROL 0x13
     11#define STRUCTID_CONTROL_ACK 0x14
    1212
    1313typedef struct {
     
    4949        def prepToSend(self, nodeID):
    5050                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)
    5253               
    5354        def updateFromNode(self, rawData, pcapts):
    5455                dataTuple = struct.unpack('!BBH', rawData[0:4])
    55                 print "Control struct successfully applied at node %d" % dataTuple[1]
    5656
    5757}}}