From 156ac39223a178c3e0cf5b7b1004d5ada1bc5850 Mon Sep 17 00:00:00 2001 From: Oghenefego Ahia Date: Sat, 17 Dec 2016 18:24:26 -0500 Subject: [PATCH] Device updated --- device.py | 18 ++++++++++-------- packet.py | 9 ++++++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/device.py b/device.py index 1c39cf4..07033aa 100644 --- a/device.py +++ b/device.py @@ -12,11 +12,13 @@ def __init__(self, deviceID, hwTier, eventsPerSec, location): def getSpecsForGame(game): pass - def requestResend(): - pass - def sendPacket(): - pass + packet = Packet((5,50), , deviceID) + + def run(): + sendPacket() + + class OculusRift(Device): @@ -31,14 +33,14 @@ class PlayStationVR(Device): def __init__(self, deviceID, hwTier, eventsPerSec, location): super(PlayStationVR, self).__init__(deviceID, 120, eventsPerSec, location) -class GearVR(Device): - def __init__(self, deviceID, hwTier, eventsPerSec, location): - super(GearVR, self).__init__(deviceID, 60, eventsPerSec, location) - class LG360VR(Device): def __init__(self, deviceID, hwTier, eventsPerSec, location): super(LG360VR, self).__init__(deviceID, 120, eventsPerSec, location) +class GearVR(Device): + def __init__(self, deviceID, hwTier, eventsPerSec, location): + super(GearVR, self).__init__(deviceID, 60, eventsPerSec, location) + class VisusVR(Device): def __init__(self, deviceID, hwTier, eventsPerSec, location): super(VisusVR, self).__init__(deviceID, 60, eventsPerSec, location) diff --git a/packet.py b/packet.py index 7a6cc17..23d8048 100644 --- a/packet.py +++ b/packet.py @@ -2,13 +2,16 @@ class Packet(object): - def __init__(self, packet_id, event, timestamp, receiverAddress, senderAddress): + def __init__(self, position, timestamp, receiverAddress, senderAddress): self._init_packet_id() - self.event = event self.timestamp = timestamp self.position = position self.receiverAddress = receiverAddress self.senderAddress = senderAddress def _init_packet_id(self): - self.packet_id = uuid.uuid4() # generate a random UUID \ No newline at end of file + self.packet_id = uuid.uuid4() # generate a random UUID + + @property + def packet_id(self): + return self.packet_id \ No newline at end of file