def __init__(self, title=''): super(SimpleBenchmark, self).__init__() self.log = logging.getLogger('SimpleBenchmark') self.title = title self.running = False self.timeInterval = 4 self.blocking_timer = TimerEventSender( self, PeriodicBlockingEvaluationTimeEvent) self.non_blocking_timer = TimerEventSender( self, PeriodicNonBlockingEvaluationTimeEvent) self.non_blocking_timer.start(self.timeInterval) self.packetLossEventsEnabled = False
def my_start_function(self): self.log.info("start control app") node = self.localNode self.log.debug("My local node: {}, Local: {}" .format(node.hostname, node.local)) for dev in node.get_devices(): self.log.debug("Dev: %s" % dev.name) for m in node.get_modules(): self.log.debug("Module: %s" % m.name) for apps in node.get_control_applications(): self.log.debug("App: %s" % apps.name) # start iperf server iperfServerEvent = IperfServerRequestEvent() #iperfServerEvent.resultReportInterval = 1 iperfServerEvent.stopAfterFirstReport = True self.log.info("Start iperf server ...") self.send_event(iperfServerEvent) self.timeInterval = 1 self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.timeInterval)
def my_start_function(self): self.log.info("start control app") self.running = True node = self.localNode self.log.debug("My local node: {}, Local: {}".format( node.hostname, node.local)) for dev in node.get_devices(): self.log.debug("Dev: %s" % dev.name) for m in node.get_modules(): self.log.debug("Module: %s" % m.name) for apps in node.get_control_applications(): self.log.debug("App: %s" % apps.name) self.device = node.get_device(0) # activate GnuRadio RP self.grc_radio_program_name = 'test' inval = {} inval['ID'] = 11 inval['grc_radio_program_code'] = self.grc_xml self.device.activate_radio_program(self.grc_radio_program_name, **inval) self.timeInterval = 1 self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.timeInterval)
def __init__(self): super(MyController, self).__init__() self.log = logging.getLogger('MyController') self.running = False self.timeInterval = 10 self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.timeInterval)
def __init__(self, hostList=[], interval=1): super(Pinger, self).__init__() self.log = logging.getLogger('Pinger') self.pingInterval = interval self.pingTimer = TimerEventSender(self, PingTimeEvent) self.pingTimer.start(self.pingInterval) self.hostList = hostList
def __init__(self): super(SlaveController, self).__init__() self.log = logging.getLogger('SlaveController') self.running = False self.timeInterval = 10 self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.timeInterval) self.dut_iface = "eno1" self.bn_iface = "wlp2s0"
def my_start_function(self): self.log.debug("start scanner app") # start scanner self.exec_file = 'scanner/scanner' self.processArgs = self.exec_file + ' ' + self.scan_iface self.process = subprocess.Popen(self.processArgs.split(), shell=False) # wait to settle down time.sleep(1) # channel hopping every 100ms self.chHoppingTimeInterval = self.hopping_interval self.chTimer = TimerEventSender(self, PeriodicChannelSwitchTimeEvent) self.chTimer.start(self.chHoppingTimeInterval) # reporting signal quality as event self.reportingTimeInterval = self.reporting_interval self.reportingTimer = TimerEventSender(self, PeriodicCQIReportingTimeEvent) self.reportingTimer.start(self.reportingTimeInterval)
def __init__(self): super(MyController, self).__init__() self.log = logging.getLogger('MyController') self.running = False self.nodes = [] self.timeInterval = 10 self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.timeInterval) self.myFilterRunning = False self.packetLossEventsEnabled = False
def my_start_function(self): self.log.info("start control app") self.channel_lst = (1, 3, 6, 9, 11) self.next_channel_idx = 1 self.ifaceName = 'mon0' self.start = None #self.hopping_interval = 3 self.margot_uuid = None # CSI stuff self.results = [] self.timeInterval = 1 self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.timeInterval)
def my_start_function(self): self.log.info("start wifi radio slicer") # store object referenes node = self.localNode self.log.info(node) self.device = node.get_device(0) self.log.info(self.device) self.myHMACID = 'RadioSlicerID' self.iface = 'ap5' self.total_slots = 30 self.phy_to_data_factor = 0.4 # slots are in microseonds slot_duration = 10000 # 20 ms sta1 = "00:15:6d:86:0f:84" #tv set, IP: 192.168.6.10 sta2 = '00:16:ea:5f:2a:03' #internet radio, IP: 192.168.6.20 sta3 = "ec:1f:72:82:09:56" #Mobile Phone youtube, IP 192.168.6.30 sta4 = "00:15:6d:84:3c:12" #Guest Smartphone 1, IP: 192.168.7.10 sta5 = "00:15:6d:84:3c:13" #Guest Smartphone 2, IP: 192.168.7.20 self.min_rates = {sta1: 10.0, sta2: 1.0} self.min_rate_home_devices = 1.0 self.phy_rates = {} self.min_slots = {} # create new MAC for local node self.mac = HMACConfigParam(no_slots_in_superframe=self.total_slots, slot_duration_ns=slot_duration) # assign allow all to each slot for slot_nr in range(self.total_slots): acGuard = HMACAccessPolicyParam() acGuard.allowAll() # allow all self.mac.addAccessPolicy(slot_nr, acGuard) self.mac.printConfiguration() # install configuration in MAC #self.device.install_mac_processor(self.iface, self.mac) self.device.activate_radio_program(self.myHMACID, self.mac, self.iface) self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.update_interval) self.log.info('... done')
def my_start_function(self): self.log.info("start wifi radio slicer") # store object referenes node = self.localNode self.log.info(node) self.device = node.get_device(0) self.log.info(self.device) self.iface = 'ap5' self.total_slots = 20 # slots are in microseonds slot_duration = 20000 # 20 ms sta1 = "00:15:6d:84:fb:7a" #fernseher self.min_rates = {sta1 : 15.0} self.phy_rates = {} self.min_slots = {} # create new MAC for local node self.mac = HMACConfigParam( no_slots_in_superframe=self.total_slots, slot_duration_ns=slot_duration) # assign allow all to each slot for slot_nr in range(self.total_slots): acGuard = HMACAccessPolicyParam() acGuard.allowAll() # allow all self.mac.addAccessPolicy(slot_nr, acGuard) self.mac.printConfiguration() # install configuration in MAC self.device.install_mac_processor(self.iface, self.mac) self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.update_interval) self.log.info('... done')
def my_start_function(self): self.log.info("start wifi radio slicer") # store object referenes node = self.localNode self.log.info(node) self.device = node.get_device(0) self.log.info(self.device) self.myHMACID = 'RadioSlicerID' self.iface = 'ap5' self.total_slots = 20 self.phy_to_data_factor = 0.6 # slots are in microseonds self.slot_duration = 10000 # 10 ms self.stepperiod = 3 sta1 = "00:15:6d:86:0f:84" #tv set, IP: 192.168.6.10 sta2 = '00:16:ea:5f:2a:03' #internet radio, IP: 192.168.6.20 sta3 = "ec:1f:72:82:09:56" #Mobile Phone youtube, IP 192.168.6.30 sta4 = "00:15:6d:84:3c:12" #Guest Smartphone 1, IP: 192.168.7.10 sta5 = "00:15:6d:84:3c:13" #Guest Smartphone 2, IP: 192.168.7.20 self.min_rates = {sta1: 15.0, sta2: 1.0} self.min_rate_home_devices = 1.0 self.phy_rates = {} self.min_slots = {} self.stop = False self.runs = 0 # create new MAC for local node self.mac = HMACConfigParam(no_slots_in_superframe=self.total_slots, slot_duration_ns=self.slot_duration) # assign allow all to each slot for slot_nr in range(self.total_slots): acGuard = HMACAccessPolicyParam() acGuard.allowAll() # allow all self.mac.addAccessPolicy(slot_nr, acGuard) self.mac.printConfiguration() # install configuration in MAC #self.device.install_mac_processor(self.iface, self.mac) self.device.activate_radio_program(self.myHMACID, self.mac, self.iface) print( "*************************************************************\n") print("EQUAL SHARE FOR ALL\n") print( "*************************************************************\n") staslotshareevent = StaSlotShareEvent("TV", 33) self.send_event(staslotshareevent) staslotshareevent = StaSlotShareEvent("Guest1", 33) self.send_event(staslotshareevent) staslotshareevent = StaSlotShareEvent("Guest2", 33) self.send_event(staslotshareevent) #self.log.debug('... Waiting 100s') #time.sleep(100) #print("*************************************************************\n") #print("SLICER ACTIVATED!!!!\n") #print("*************************************************************\n") self.timer = TimerEventSender(self, PeriodicEvaluationTimeEvent) self.timer.start(self.update_interval) #self.log.debug('... Waiting 100s') #time.sleep(100) #self.log.debug('... done') #self.stop = True #self.log.debug('... Enabling free for all') # assign allow all to each slot #for slot_nr in range(self.total_slots): # acGuard = HMACAccessPolicyParam() # acGuard.allowAll() # allow all # self.mac.addAccessPolicy(slot_nr, acGuard) #self.mac.printConfiguration() #self.log.debug('... Calling Stop Function') #self.my_stop_function() self.log.debug('... done')
def my_start(self): self.timeInterval = 10 self.timer = TimerEventSender(self, SampleSendTimeEvent) self.timer.start(self.timeInterval)