Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/ble_dfu.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def characteristic_value_updated(self, characteristic, value):
print("[WARN ] PacketReceiptNotification failed")
print(" acknowledged {} : expected {}".format(ack_size, self.total_receipt_size))
self.disconnect()
self.window.update_progress_bar()
self.window.update_progress_bar(self.get_prog_text(), self.total_receipt_size / self.image_size)
if self.verbose:
print("[INFO ] receipt count", str(self.packet_recipt_count))
print("[INFO ] receipt size", self.total_receipt_size, "out of", self.image_size)
Expand Down Expand Up @@ -271,6 +271,14 @@ def get_init_bin_array(self):
init_bin_array = array("B", open(self.datfile_path, "rb").read())
return init_bin_array

def get_prog_text(self):
return (
str(self.total_receipt_size)
+ " / "
+ str(self.image_size)
+ " bytes received"
)

class Caffeinator():
def __init__(self):
try:
Expand Down
Loading