Commit a684f56f authored by Gaia Grosso's avatar Gaia Grosso
Browse files

Update main.py

parent 2f00c430
......@@ -107,10 +107,10 @@ if __name__ == '__main__':
args = parser.parse_args()
board = args.board
property = args.property
prop = args.property
device = config_dict[board]["driver"]
location = config_dict[board]["property"][property]["location"]
bitmask = config_dict[board]["property"][property]["bitmask"]
location = config_dict[board]["property"][prop]["location"]
bitmask = config_dict[board]["property"][prop]["bitmask"]
action = args.action
value = args.value
if action == "set":
......@@ -125,8 +125,11 @@ if __name__ == '__main__':
print("Overflow error! value %s doesn't fit in the allowed memory location."%(args.value))
exit()
else:
WriteProperty(device, location, bitmask, writevalue)
print('Set property %s from location %s on %s: %i'%(property, location, board, writevalue.value))
isWritten = WriteProperty(device, location, bitmask, writevalue)
if is Written:
print('Set property %s from location %s on %s: %i'%(property, location, board, writevalue.value))
else:
print('The value could not be updated. Check the reading permission for property %s in board %s'%(prop, board))
elif action == "get":
readvalue = ReadProperty(device, location, bitmask)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment