Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package downloader #51

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
6 changes: 4 additions & 2 deletions openomni/bin/omni_listen_rfcat
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def main(options=None):
with open('../../results/' + fileName + '.json', 'a') as outFile:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails for me. I usually work out of the top level directory, and run things like ./openomni/bin/omni_listen_rfcat. File output should be an option; one is not always wanting to store things to disk.

Copy link
Collaborator Author

@Lytrix Lytrix Jan 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I've added a path argument to tackle this, plus added it to the readme. I will add the option to skip writing to file.

"""Create 1 dict for each message loop."""
package ={}
messages = []
messages = {"string": [],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've grouped the raw's all together and the strings, I first had it grouped for each step, but that was not really easy to read, see added example with the grouping I find is really helpful. @ps2 what do you think?

"raw": []}
print ('Start recording:')
print ('-------------------------')
print ('Press \'ctrl+c\' to quit and write the performed action')
Expand All @@ -69,7 +70,8 @@ def main(options=None):
messages.append(packet.as_json())
else:
print(packet)
messages.append({"string": str(packet), "raw": packet.data.encode("hex")})
messages["string"].append(str(packet))
messages["raw"].append(packet.data.encode("hex"))
package["messages"] = messages
break
x += 1
Expand Down