Skip to content

Commit

Permalink
🐛 Interpret firmware file as an bytearray (homieiot#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
LiyouZhou authored and jesserockz committed Mar 12, 2018
1 parent b9c81d9 commit 833b4b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/ota_updater/ota_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ def base_topic_arg(s):
args = parser.parse_args()

# read the contents of firmware into buffer
firmware = args.firmware.read()
fw_buffer = args.firmware.read()
args.firmware.close()
firmware = bytearray()
firmware.extend(fw_buffer)

# Invoke the business logic
main(args.broker_host, args.broker_port, args.broker_username,
Expand Down

0 comments on commit 833b4b2

Please sign in to comment.