コード例 #1
0
    def run(self):
        while True:
            (clientsocket, address) = self.serversocket.accept()
            mutex.acquire()
            print ("S: Receiving...")
            try:
                message = clientsocket.recv(1024*5).decode()      
                print(message)
                (position, clientID, floorNum) = localization.start(message, self.BSSID_APinfo, self.SignalStrength_RSSI, self.APlocation)
                global xGraphic
                xGraphic=position[0]
                global yGraphic
                yGraphic=position[1]
                global zGraphic
                zGraphic=floorNum
                print ("Client %s is on the %d floor -> Predicted Location is:" % (clientID, floorNum))
                print ("*******************")
                print ("X:", position[0])
                print ("Y:", position[1])
                print ("Z:", position[2])
                print ("*******************")

               
            except:
                print ("S: Error")

            finally:
                clientsocket.close()
                print ("S: Done\n")
                mutex.release()
コード例 #2
0
    def run(self):
        while True:
            (clientsocket, address) = self.serversocket.accept()
            mutex.acquire()
            print "S: Receiving..."
            try:
                message = clientsocket.recv(2048)
                print "S: Received:\n", message
                (position, clientID,
                 floorNum) = localization.start(message, self.BSSID_APinfo,
                                                self.SignalStrength_RSSI,
                                                self.APlocation)

                print(
                    "Client %s is on the %d floor -> Predicted Location is:" %
                    (clientID, floorNum))
                print "*******************"
                print "X:", position[0]
                print "Y:", position[1]
                print "Z:", position[2]
                print "*******************"

            except:
                print "S: Error"

            finally:
                clientsocket.close()
                print "S: Done\n"
                mutex.release()
コード例 #3
0
ファイル: main.py プロジェクト: Eunjuni/Indoor-Tracking
    def run(self):
        while True:
            (clientsocket, address) = self.serversocket.accept()
            mutex.acquire()
            print "S: Receiving..."
            try:
                message = clientsocket.recv(2048)
                print "S: Received:\n", message
                (position, clientID, floorNum) = localization.start(message, self.BSSID_APinfo, self.SignalStrength_RSSI, self.APlocation)
    
                print ("Client %s is on the %d floor -> Predicted Location is:" % (clientID, floorNum))
                print "*******************"
                print "X:", position[0]
                print "Y:", position[1]
                print "Z:", position[2]
                print "*******************"

            except:
                print "S: Error"

            finally:
                clientsocket.close()
                print "S: Done\n"
                mutex.release()