generate_listener.py: fix listener command

the loop variable i was increased even if no topic was updated. This means
less messages are outputed than specified.
This commit is contained in:
Beat Küng
2016-04-15 14:29:35 +02:00
parent 8a3b9e3b4e
commit 1269dfbc43

View File

@@ -158,9 +158,9 @@ for index,m in enumerate(messages[1:]):
print("\t\twhile(i < num_msgs) {")
print("\t\t\torb_check(sub,&updated);")
print("\t\t\tif (i == 0) { updated = true; } else { usleep(500); }")
print("\t\t\ti++;")
print("\t\t\tif (updated) {")
print("\t\tprintf(\"\\nTOPIC: %s #%%d\\n\", i);" % m)
print("\t\t\ti++;")
print("\t\t\tprintf(\"\\nTOPIC: %s #%%d\\n\", i);" % m)
print("\t\t\torb_copy(ID,sub,&container);")
for item in message_elements[index+1]:
if item[0] == "float":