store stimulus information

This commit is contained in:
sessionm21
2020-05-13 06:36:23 +01:00
parent d39b4e8494
commit cf51b0da69
2 changed files with 21 additions and 8 deletions

View File

@@ -5,12 +5,13 @@ import message_pb2
import sqlite3
# Test protobuf here
code = bytearray('CgoNAAAAABUAAAAA', "utf-8")
code = bytearray('CgoNAABIQxUAAMhCEAA=', "utf-8")
print(code)
bcode = base64.b64decode(code)
res = message_pb2.CollarResponse()
res.ParseFromString(bcode)
assert res.loc.x == 0
assert res.loc.y == 0
assert res.loc.x == 200
assert res.loc.y == 100
assert res.oob == 0
print("Coord {x: " + str(res.loc.x) + ", y: " + str(res.loc.y) + "}")