Skip to content
Snippets Groups Projects
Commit cbf67c3e authored by 남성찬's avatar 남성찬
Browse files

coapclient.py

parent e275126f
No related branches found
No related tags found
No related merge requests found
...@@ -47,7 +47,6 @@ class CoapClient(): ...@@ -47,7 +47,6 @@ class CoapClient():
} }
response = client.put(path, json.dumps(payload)) response = client.put(path, json.dumps(payload))
print((response.pretty_print())) print((response.pretty_print()))
string = json.loads(response.payload)['rpuuid']
except KeyboardInterrupt: except KeyboardInterrupt:
print("obtainMyID Stop") print("obtainMyID Stop")
...@@ -116,6 +115,7 @@ class CoapClient(): ...@@ -116,6 +115,7 @@ class CoapClient():
print((response.pretty_print())) print((response.pretty_print()))
if json.loads(response.payload)['operate'] == 0: # Postion 계산이 불가능한 경우 if json.loads(response.payload)['operate'] == 0: # Postion 계산이 불가능한 경우
client.stop() client.stop()
self.clearMyData()
print("RpNode Exit and delete my data in DB") print("RpNode Exit and delete my data in DB")
sys.exit(1) sys.exit(1)
...@@ -208,7 +208,7 @@ class CoapClient(): ...@@ -208,7 +208,7 @@ class CoapClient():
client.stop() client.stop()
def mkJsonRpgraphInfo(self, info): #문제 없음 def mkJsonRpgraphInfo(self, info): #문제 없음
n = 2.2 n = 3
print(info) print(info)
distance = math.pow(10, ((float(info[4]) - float(info[5])) / (10 * n))) distance = math.pow(10, ((float(info[4]) - float(info[5])) / (10 * n)))
payload = { payload = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment