This commit is contained in:
Fancy code 2024-05-07 21:10:51 +08:00
parent e82f4f43f8
commit 075d82be2a
6 changed files with 13 additions and 12 deletions

View File

@ -25,11 +25,11 @@ SdCardHandleState::SdCardHandleState() : State("SdCardHandleState"), mSdCardStat
}
void SdCardHandleState::GoInState()
{
LogInfo(" ========== opState::GoInState.\n");
LogInfo(" ========== SdCardHandleState::GoInState.\n");
}
void SdCardHandleState::GoOutState()
{
LogInfo(" ========== opState::GoOutState.\n");
LogInfo(" ========== SdCardHandleState::GoOutState.\n");
}
bool SdCardHandleState::ExecuteStateMsg(VStateMachineData *msg)
{

View File

@ -23,12 +23,12 @@ StorageHandleState::StorageHandleState() : State("StorageHandleState")
}
void StorageHandleState::GoInState()
{
LogInfo(" ========== opState::GoInState.\n");
LogInfo(" ========== StorageHandleState::GoInState.\n");
MissionStateMachine::GetInstance()->SwitchState(SystemState::SD_CARD_HANDLE_STATE);
}
void StorageHandleState::GoOutState()
{
LogInfo(" ========== opState::GoOutState.\n");
LogInfo(" ========== StorageHandleState::GoOutState.\n");
}
bool StorageHandleState::ExecuteStateMsg(VStateMachineData *msg)
{

View File

@ -22,14 +22,14 @@ TopState::TopState() : State("TopState")
}
void TopState::GoInState()
{
LogInfo(" ========== opState::GoInState.\n");
LogInfo(" ========== TopState::GoInState.\n");
std::shared_ptr<VMediaMonitor> monitor = std::dynamic_pointer_cast<TopState>(shared_from_this());
IMediaManager::GetInstance()->SetMediaMonitor(monitor);
MissionStateMachine::GetInstance()->SwitchState(SystemState::MISSION_STATE);
}
void TopState::GoOutState()
{
LogInfo(" ========== opState::GoOutState.\n");
LogInfo(" ========== TopState::GoOutState.\n");
}
bool TopState::ExecuteStateMsg(VStateMachineData *msg)
{

View File

@ -23,11 +23,11 @@ UpgradeState::UpgradeState() : State("UpgradeState")
}
void UpgradeState::GoInState()
{
LogInfo(" ========== opState::GoInState.\n");
LogInfo(" ========== UpgradeState::GoInState.\n");
}
void UpgradeState::GoOutState()
{
LogInfo(" ========== opState::GoOutState.\n");
LogInfo(" ========== UpgradeState::GoOutState.\n");
}
bool UpgradeState::ExecuteStateMsg(VStateMachineData *msg)
{

View File

@ -20,6 +20,7 @@ StatusCode HuntingUpgradeImpl::CheckFileHeader(const UpgradeFileHeader &head)
}
StatusCode HuntingUpgradeImpl::CheckUpgradeFile(void)
{
LogError("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss\n");
UpgradeFileHeader header;
StatusCode code = UpgradeBase::CheckUpgradeFile(SD_CARD_MOUNT_PATH APPLICATION_CHECK_PATH, header);
if (!IsCodeOK(code)) {

View File

@ -21,9 +21,9 @@
StatusCode UpgradeBase::CheckUpgradeFile(const char *fileName, UpgradeFileHeader &header)
{
FILE *file = nullptr;
LogInfo("Checking file:%s\n", fileName);
file = fopen(fileName, "rb");
if (file == NULL) {
if (file == nullptr) {
LogError("Error opening file:%s\n", fileName);
return CreateStatusCode(STATUS_CODE_NOT_OK);
}
@ -48,13 +48,13 @@ StatusCode UpgradeBase::MoveUpgradeFile(const char *sourceFile, const char *targ
size_t bytesRead;
inputFile = fopen(sourceFile, "rb");
if (inputFile == NULL) {
if (inputFile == nullptr) {
LogError("Error opening input file\n");
return CreateStatusCode(STATUS_CODE_NOT_OK);
}
outputFile = fopen(targetFile, "wb");
if (outputFile == NULL) {
if (outputFile == nullptr) {
LogError("Error opening output file\n");
fclose(inputFile);
return CreateStatusCode(STATUS_CODE_NOT_OK);