-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c020eeb
commit 1a7e92c
Showing
8 changed files
with
492 additions
and
363 deletions.
There are no files selected for viewing
Submodule MetaWear-SDK-Cpp
updated
122 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# usage: python update_firmware.py [mac] [version](optional) | ||
from mbientlab.metawear import MetaWear, libmetawear | ||
from threading import Event | ||
|
||
import sys | ||
|
||
device = MetaWear(sys.argv[1]) | ||
device.connect() | ||
print("Connected") | ||
|
||
args = { | ||
'progress_handler': lambda p: print("upload: %d%%" % (p)), | ||
} | ||
if (len(sys.argv) >= 3): | ||
args['version'] = sys.argv[2] | ||
|
||
e = Event() | ||
result = [] | ||
def dfu_handler(err): | ||
result.append(err) | ||
e.set() | ||
|
||
device.update_firmware_async(dfu_handler, **args) | ||
e.wait() | ||
|
||
if (result[0] != None): | ||
raise result[0] |
Oops, something went wrong.