コード例 #1
0
 def scanAll(self, subip='192.168.0.'):
     res = ''
     for i in range(254):
         ip = subip + str(i)
         if  ping_one(ip, self.timeout) >= 0:
             res = ip + '<<<<<OK \n'
             print(res)
         else:
             res = ip + '<NO\n'
             print(res)
コード例 #2
0
ファイル: netscan.py プロジェクト: hdgallegot/quadcopterPi
 def scanAll(self, subip="192.168.0."):
     res = ""
     for i in xrange(254):
         ip = subip + str(i)
         if ping_one(ip, self.timeout) >= 0:
             res = ip + "<<<<<OK \n"
             print res
         else:
             res = ip + "<NO\n"
             print res
コード例 #3
0
    def run(self):
#this function is called by the start function, inherit from threading.thread

        self.logger.debug('netscan running...')
        while self.cycling:
            res = ping_one(self.ip, self.timeout)
            if  res >= 0:
                self.logger.debug('OK ' + str(res))
                self.badConnCounter = 0
            else:
                self.badConnCounter += 1
                self.logger.debug('NOT OK ' + str(res))

            if self.badConnCounter > 1:
                self.connectionUp = False
                self.logger.error('Connection lost with ' + str(self.ip))
            else:
                self.connectionUp = True
            sleep(0.300)

        self.logger.debug('nescan stopped')
コード例 #4
0
ファイル: netscan.py プロジェクト: hdgallegot/quadcopterPi
    def run(self):
        # this function is called by the start function, inherit from threading.thread

        self.logger.debug("netscan running...")
        while self.cycling:
            res = ping_one(self.ip, self.timeout)
            if res >= 0:
                self.logger.debug("OK " + str(res))
                self.badConnCounter = 0
            else:
                self.badConnCounter += 1
                self.logger.debug("NOT OK " + str(res))

            if self.badConnCounter > 1:
                self.connectionUp = False
                self.logger.error("Connection lost with " + str(self.ip))
            else:
                self.connectionUp = True
            sleep(0.300)

        self.logger.debug("nescan stopped")