Remote Firmware Update¶
Precheck firmware update status¶
Execute firmware update at camera by remote.
Users can now update the camera’s firmware remotely within user application. In the future, when a new firmware for the camera is provided by Sony, it can be applied without disassembling the system.
This function is only enable if the value of CrDeviceProperty_FirmwareUpdateCommandVersion is equal or over 0x00000065 (means equal or over ver.1.01).
Firmware file is same that used for update normally. It can get from support page. Please confirm precautions of support page.
First, transfer the firmware file from HostPC to camera. Then request update to camera. There are two check APIs available.
Using PrecheckFirmwareUpdate(), you can check the camera status before transfer.
Using RequestFirmwareUpdaterInfo(), you can check firmware information of uploaded.
You can receive result for above APIs by OnNotifyRemoteFirmwareUpdateResult().
Precheck camera status.
Example:
// Set the size of firmware file.
CrInt64u fileSize = getFirmwareFileSize();
CrError err = SCRSDK::PrecheckFirmwareUpdate(handle, fileSize);
if (CR_FAILED(err)) {
printf("failed Precheck. err(%x)", err);
}
Check firmware information of uploaded.
Example:
CrError err = SCRSDK::RequestFirmwareUpdaterInfo(handle);
if (CR_FAILED(err)) {
printf("failed request. err(%x)", err);
}
Receive result of remote firmware update¶
Receive result of check APIs.
Example:
class MyDeviceCallback : public IDeviceCallback {
void OnNotifyRemoteFirmwareUpdateResult(CrInt32u notify, const void* param) {
switch (notify) {
// Precheck result
case: SCRSDK::CrNotify_RemoteFirmware_Precheck_OK:
// Precheck result is OK;
break;
case: SCRSDK::CrNotify_RemoteFirmware_Precheck_NG:
// Precheck result is NG.
// Confirm "param" that set CrNotifyParam_FirmwareUpdateEvent.
auto reason = (const SCRSDK::CrNotifyParam_FirmwareUpdateEvent*) param;
break;
// Request firmware updater info
case: SCRSDK::CrNotify_RemoteFirmware_GetUpdaterInfo_OK:
// Get firmware info successfully;
const CrChar* firmwareVersion = (const CrChar*) param;
break;
case: SCRSDK:: CrNotify_RemoteFirmware_GetUpdaterInfo_NG:
// get firmware info failed. That means failed upload firmware.
// Confirm "param" that set CrNotifyParam_FirmwareUpdaterGetStatus.
auto reason = (SCRSDK::CrNotifyParam_FirmwareUpdaterGetStatus*) param;
break;
// Other notification
}
}
}
Upload the file for remote firmware update¶
Please call UploadPartialFile() when upload firmware file. Then SDK will start upload firmware to camera.
You can receive result and upload progress by OnNotifyRemoteFirmwareUpdateResult().
You can cancel upload that use CancelFirmwareUpload().
Example:
~
CrChar* filePath = getFirmwareFilePath();
CrError err = SCRSDK::UploadPartialFile(handle,
SCRSDK::CrUploadPartialDataType_FirmwareData, filePath);
if (CR_FAILED(err)) {
printf("failed upload request. err(%x)", err);
}
// If you cancel.
CrError err = SCRSDK::CancelFirmwareUpload(handle);
if (CR_FAILED(err)) {
printf("failed cancel request. err(%x)", err);
}
~
class MyDeviceCallback : public IDeviceCallback {
void OnNotifyRemoteFirmwareUpdateResult(CrInt32u notify, const void* param) {
switch (notify) {
// Upload result
case: SCRSDK::CrNotify_RemoteFirmware_Upload_OK:
// Upload completed successfully.
break;
case: SCRSDK::CrNotify_RemoteFirmware_Upload_NG:
// Upload failed.
// Confirm "param" that set CrNotifyParam_FirmwareUploadResult.
auto reason = (const SCRSDK::CrNotifyParam_FirmwareUploadResult*) param;
break;
case: SCRSDK::CrNotify_RemoteFirmware_Upload_Rate:
// Receive upload progress.
const CrInt32u* rate = (const CrInt32u*) param;
break;
// Other notification
}
}
}
Execute remote firmware update¶
Please call StartFirmwareUpdate() when start firmware update on camera.
The camera will be disconnected during the firmware update.
After update completed, reconnect the camera automatically. Caution: You can’t cancel firmware update after call StartFirmwareUpdate().
Example:
CrError err = SCRSDK::StartFirmwareUpdate(handle);
if (CR_FAILED(err)) {
printf("failed start update.err(%x)", err);
}
You can check this function without using firmware data by using debug mode.
In debug mode, these API behaviors are as follows:
All check APIs are always return successfully case.
Got firmware version is fixed value.
The camera update is complete immediately without actual update.
Use firmware file is not required valid firmware file. You can use dummy file.
Please check below about specify of dummy firmware file.
- Specification of dummy firmware file.
- File Size: 200MB – 1.5GBFile Name: any (can read)Data: any
Please set the value ”CrDebugMode_Pseudo_update_with_Fake_Firmware” at CrDeviceProperty_DebugMode when you want to enter debug mode.
Debug mode is disable when camera turn off or set the value “CrDebugMode_OFF”.
You should not include the camera firmware file in user application because it is inhibited redistribution.
Please announce to end-users that the camera firmware file should be downloaded in an end-user environment and read by user application (For example, replace file by the end-user).