Пример #1
0
 def initPackets(self):
     self.additionRequestPacket = packets.packet(
         template=[packets.pInteger('a', 2),
                   packets.pInteger('b', 2)])
     self.additionResponsePacket = packets.packet(
         template=[packets.pInteger('response', 2)])
     pass
Пример #2
0
	def _initPackets(self):
		#status
		self.statusResponsePacket = packets.packet(template = [packets.pString('status', 1), #status is encoded as 'b' for bootloader, 'a' for app.
																packets.pInteger('appValidity', 1)]) #app validity byte, gets set to 170 if app is valid
		
		#bootloader command
		self.bootCommandRequestPacket = packets.packet(template = [packets.pInteger('commandCode', 1)])
		self.bootCommandResponsePacket = packets.packet(template = [	packets.pInteger('responseCode', 1),
																packets.pInteger('pageNumber', 2)])
		#bootloader write
		self.bootWriteRequestPacket = packets.packet(template = [packets.pInteger('commandCode', 1),
															packets.pInteger('pageNumber', 2),
															packets.pList('writeData', self.bootPageSize)])
		self.bootWriteResponsePacket = packets.packet(self.bootCommandResponsePacket)
		
		#bootloader read
		self.bootReadRequestPacket = packets.packet(template = [packets.pInteger('pageNumber', 2)])
		self.bootReadResponsePacket = packets.packet(template = [packets.pList('readData', self.bootPageSize)])
		
		#request URL
		self.urlResponsePacket = packets.packet(template = [packets.pString('URL')])
		
		#set IP address
		self.setIPRequestPacket = packets.packet(template = [packets.pList('setAddress',2)])
		self.setIPResponsePacket = packets.packet(self.urlResponsePacket)
Пример #3
0
    def __init__(self, name=None, interface=None, owner=None):
        self.name = name  #name becomes important for networked gestalt
        self.owner = owner
        self.interface = interfaceShell(
            interface, self
        )  #uses the interfaceShell object for connecting to sub-interface

        self.receiveQueue = Queue.Queue()
        self.CRC = CRC()
        self.nodeManager = self.nodeManager(
        )  #used to map network addresses (physical devices) to nodes

        self.startInterfaceThreads(
        )  #this will start the receiver, packetRouter, channelPriority, and channelAccess threads.

        #define standard gestalt packet
        self.gestaltPacket = packets.packet(template=[
            packets.pInteger('startByte', 1),
            packets.pList('address', 2),
            packets.pInteger('port', 1),
            packets.pLength(),
            packets.pList('payload')
        ])
Пример #4
0
    def __init__(self, name=None, interface=None, owner=None):
        self.name = name  # name becomes important for networked gestalt
        self.owner = owner
        self.interface = interfaceShell(
            interface, self
        )  # uses the interfaceShell object for connecting to sub-interface

        self.receiveQueue = Queue.Queue()
        self.CRC = CRC()
        self.nodeManager = self.nodeManager()  # used to map network addresses (physical devices) to nodes

        self.startInterfaceThreads()  # this will start the receiver, packetRouter, channelPriority, and channelAccess threads.

        # define standard gestalt packet
        self.gestaltPacket = packets.packet(
            template=[
                packets.pInteger("startByte", 1),
                packets.pList("address", 2),
                packets.pInteger("port", 1),
                packets.pLength(),
                packets.pList("payload"),
            ]
        )
Пример #5
0
	def initPackets(self):
		self.getReferenceVoltageResponsePacket = packets.packet(template = [packets.pInteger('voltage',2)])
		
		self.spinRequestPacket = packets.packet(template = [packets.pInteger('majorSteps',1),
															packets.pInteger('directions',1),
															packets.pInteger('steps', 1),
															packets.pInteger('accel',1),
															packets.pInteger('accelSteps',1),
															packets.pInteger('decelSteps',1),
															packets.pInteger('sync', 1)])	#if >0, indicates that move is synchronous
				
		self.spinStatusPacket = packets.packet(template = [packets.pInteger('statusCode',1),
															packets.pInteger('currentKey',1),
															packets.pInteger('stepsRemaining',1),
															packets.pInteger('readPosition',1),
															packets.pInteger('writePosition',1)])
		
		self.setVelocityPacket = packets.packet(template = [packets.pInteger('velocity',2)])
Пример #6
0
	def initPackets(self):
		self.additionRequestPacket = packets.packet(template = [packets.pInteger('a',2),
									packets.pInteger('b',2)])
		self.additionResponsePacket = packets.packet(template = [packets.pInteger('response',2)])
		pass
Пример #7
0
    def initPackets(self):
        self.getReferenceVoltageResponsePacket = packets.packet(
            template=[packets.pInteger('voltage', 2)])

        self.spinRequestPacket = packets.packet(template=[
            packets.pInteger('majorSteps', 1),
            packets.pInteger('directions', 1),
            packets.pInteger('steps', 1),
            packets.pInteger('accel', 1),
            packets.pInteger('accelSteps', 1),
            packets.pInteger('decelSteps', 1),
            packets.pInteger('sync', 1)
        ])  #if >0, indicates that move is synchronous

        self.spinStatusPacket = packets.packet(template=[
            packets.pInteger('statusCode', 1),
            packets.pInteger('currentKey', 1),
            packets.pInteger('stepsRemaining', 1),
            packets.pInteger('readPosition', 1),
            packets.pInteger('writePosition', 1)
        ])

        self.setVelocityPacket = packets.packet(
            template=[packets.pInteger('velocity', 2)])