def init(): global initDone if not initDone: wb6.Login(targetIP, "installer") wb6.SendHTTP(targetIP, "CR3") # DMX for idx in range(1, 9, 1): doDmxCmd(idx, 0) initDone = True
def wbStarted( self, event ): if ( self.lastWebBrick != event.ipAdr() ): self.lastWebBrick = event.ipAdr() now = datetime.datetime.now() # synchronize to a minute. logging.info( string.join(('Setting Time for ', event.ipAdr(), ' Waiting for start of minute' ) ) ) while ( now.second <> 0 ): time.sleep( 0.5 ) now = datetime.datetime.now() # datetime starts on monday day = now.weekday() + 1 if ( day == 7 ): day = 0 logging.info( string.join(('Setting Time for ', event.ipAdr(), ' To ', str(day), " ", str(now.hour), ":", str(now.minute) ) ) ) wb6.Login( event.ipAdr(), password ); wb6.SetTime( event.ipAdr(), day, now.hour, now.minute ) self.timeVal = timeout # reset else: logging.info( string.join(('Duplicate ', event.ipAdr() ) ) )
import sys sys.path.append('../API') import datetime import wb6 test_ip = "10.100.100.101" now = datetime.datetime.now() # datetime starts on monday day = now.weekday() + 1 if (day == 7): day = 0 wb6.Login(test_ip, "password") wb6.SetTime(test_ip, day, now.hour, now.minute)
def doLogin(self, ipAdr = None ): if ipAdr: wb6.Login( ipAdr, "installer" ); else: wb6.Login( underTestAddress, "installer" ); time.sleep( 0.1 )
def doLogin(wbAddress): logging.debug("doLogin") wb6.Login(wbAddress, "installer") return
import sys sys.path.append('../API') # # WBExercise # # Andy Harris # # Beat the living daylights out of a WebBrick till it gives up # import wb6, wbUdp, time #targetIP = 'mail.thirtover.com:84' targetIP = '10.100.100.100' wb6.Login(targetIP, "password") wb6.SendHTTP(targetIP, "ITN") wb6.SendHTTP(targetIP, "IRN") while 1: # address for i in range(32): # channel for j in range(64): wb6.SendHTTP(targetIP, "IS" + str(i) + ";" + str(j)) time.sleep(0.1)
def doLogin(self): wb6.Login(self._wbAddress, "installer") return
# send strings for idx in range(10): for s in strings: print s port.write( s ) time.sleep(0.1) # address time.sleep(1.0) # close comm port port.close() port = None # add if main here and parameter checking. wb6.Login( targetIP,"installer" ) if doRs485: cmd = "CR4;%i"%(BaudIdx) wb6.SendHTTP(targetIP,cmd ) # RS485 else: cmd = "CR2;%i"%(BaudIdx) print "setup %s" % cmd wb6.SendHTTP(targetIP,cmd ) # RS232 if doRs485: if doSend: wb6.SendHTTP(targetIP,"RO" ) # RS485 output else: wb6.SendHTTP(targetIP,"RI" ) # RS485 input