Created
May 12, 2017 21:39
-
-
Save Khobalt/0ba643a31ddbc0f9691f782aae62a1e8 to your computer and use it in GitHub Desktop.
This gist demonstrates how to safely move a firmware update file to the root of the card from the pool
This file contains hidden or 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
msqPort = createObject("roMessagePort") | |
'Defer the watchdog because the system may be tied up for a little while as the transfer commences | |
msgPort.DeferWatchdog(120) | |
newSync = createObject("roSyncSpec") | |
newSync.readFromFile("path/to/newSyncSpec.xml") | |
assetCollection = newSync.GetAssets("download") | |
path$ ="/fwUpdate/path/to/pool" | |
pool = CreateObject("roAssetPool", path$) | |
realizer = CreateObject("roAssetRealizer", pool, "/") | |
event = realizer.Realize(assetCollection) | |
' check return value | |
if event.GetEvent() <> m.stateMachine.EVENT_REALIZE_SUCCESS then | |
print "### Realize failed " + stri(event.GetEvent()) + chr(9) + event.GetName() + chr(9) + event.GetFailureReason() | |
else | |
print "Success!" | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment