![Yoctopuce Yocto-GPS Скачать руководство пользователя страница 136](http://html1.mh-extra.com/html/yoctopuce/yocto-gps/yocto-gps_user-manual_3415557136.webp)
int
newstatus = fw_update.
get_progress
()
;
if
(
newstatus != status
)
{
Console
.
WriteLine
(
"% "
+ fw_update.
get_progressMessage
())
;
}
YAPI.
Sleep
(
500
,
ref
errmsg
)
;
status = newstatus;
}
if
(
status <
0
)
{
Console
.
WriteLine
(
"Firmware Update failed: "
+ fw_update.
get_progressMessage
())
;
}
else
{
Console
.
WriteLine
(
"Firmware Updated Successfully!"
)
;
}
An Android characteristic
You can update a module firmware using the Android library. However, for modules connected by
USB, Android asks the user to authorize the application to access the USB port.
During firmware update, the module restarts several times. Android interprets a USB device reboot
as a disconnection and a reconnection to the USB port, and prevents all USB access as long as the
user has not closed the pop-up window. The use has to click on
OK
for the update process to
continue correctly.
You cannot update a module connected by USB to an Android device
without having the user interacting with the device.
18.5. The "update" mode
If you want to erase all the parameters of a module or if your module does not start correctly
anymore, you can install a firmware from the "update" mode.
To force the module to work in "update" mode, disconnect it, wait a few seconds, and reconnect it
while maintaining the
Yocto-button
down. This will restart the module in "update" mode. This update
mode is protected against corruptions and is always available.
In this mode, the module is not detected by the YModule objects anymore. To obtain the list of
connected modules in "update" mode, you must use the
YAPI.GetAllBootLoaders()
function.
This function returns a character string array with the serial numbers of the modules in "update"
mode.
List<
string
> allBootLoader = YAPI.
GetAllBootLoaders
()
;
The update process is identical to the standard case (see the preceding section), but you must
manually
instantiate
the
YFirmwareUpdate
object
instead
of
calling
module.updateFirmware()
. The constructor takes as argument three parameters: the module
serial number, the path of the firmware to be installed, and a byte array with the parameters to be
restored at the end of the update (or
null
to restore default parameters).
YFirmwareUpdateupdate fw_update;
fw_update =
new
YFirmwareUpdate
(
allBootLoader
[
0
]
, newfirm,
null
)
;
int
status = fw_update.
startUpdate
()
;
.....
18. Firmware Update
130
www.yoctopuce.com
Содержание Yocto-GPS
Страница 1: ...Yocto GPS User s guide...
Страница 2: ......
Страница 6: ...22 Characteristics 557 Blueprint 559 Index 561...
Страница 10: ...4 www yoctopuce com...
Страница 14: ...8 www yoctopuce com...
Страница 18: ...12 www yoctopuce com...
Страница 22: ...16 www yoctopuce com...
Страница 38: ...32 www yoctopuce com...
Страница 42: ...36 www yoctopuce com...
Страница 54: ...48 www yoctopuce com...
Страница 72: ...66 www yoctopuce com...
Страница 92: ...86 www yoctopuce com...
Страница 122: ...116 www yoctopuce com...
Страница 132: ...126 www yoctopuce com...
Страница 159: ...20 High level API Reference On failure throws an exception or returns a negative error code www yoctopuce com 153...
Страница 564: ...22 Characteristics 558 www yoctopuce com...
Страница 565: ......
Страница 566: ......