CMXX - Firmware update improvements
This commit is contained in:
@@ -229,17 +229,24 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
|
||||
}
|
||||
else {
|
||||
//GET HW + SW from object
|
||||
$hw_version = $post_content['testdetails']['logdetails']['HW'];
|
||||
$sw_version = $post_content['testdetails']['logdetails']['HEX_FW'];
|
||||
$hw_version = $post_content['testdetails']['logdetails']['HW'] ?? '';
|
||||
$fw_version = $post_content['testdetails']['logdetails']['FW'] ?? '';
|
||||
$sw_version = $post_content['testdetails']['logdetails']['HEX_FW'] ?? '';
|
||||
|
||||
//GET COMMITCODE
|
||||
$commitCode = compareCommitCodes($sw_version,$fw_version);
|
||||
|
||||
//IF COMMITCODE IS EMPTY THEN RETURN HEX_FW
|
||||
$sw_version = ($commitCode != '' || !empty($commitCode)) ? $commitCode : $sw_version;
|
||||
}
|
||||
|
||||
//check SW_VERSION for filetype
|
||||
//check SW_VERSION for filetype HEX_FW can contain extension
|
||||
$version_file_type = strtolower(substr($sw_version, -4)); // filetype
|
||||
|
||||
|
||||
if ($version_file_type[0] == '.'){
|
||||
$sw_version = substr($sw_version, 0, -4);
|
||||
}
|
||||
|
||||
|
||||
//Update Equipment record
|
||||
$sql = "UPDATE equipment SET hw_version = ?, sw_version = ? $whereclause";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
|
||||
@@ -215,8 +215,15 @@ if (isset($post_content['sn']) && isset($post_content['payload'])){
|
||||
}
|
||||
else {
|
||||
//GET HW + SW from object
|
||||
$hw_version = $post_content['payload']['logdetails']['HW'];
|
||||
$sw_version = $post_content['payload']['logdetails']['HEX_FW'];
|
||||
$hw_version = $post_content['testdetails']['logdetails']['HW'] ?? '';
|
||||
$fw_version = $post_content['testdetails']['logdetails']['FW'] ?? '';
|
||||
$sw_version = $post_content['testdetails']['logdetails']['HEX_FW'] ?? '';
|
||||
|
||||
//GET COMMITCODE
|
||||
$commitCode = compareCommitCodes($sw_version,$fw_version);
|
||||
|
||||
//IF COMMITCODE IS EMPTY THEN RETURN HEX_FW
|
||||
$sw_version = ($commitCode != '' || !empty($commitCode)) ? $commitCode : $sw_version;
|
||||
}
|
||||
|
||||
//check SW_VERSION for filetype
|
||||
|
||||
Reference in New Issue
Block a user