Skip to content

[TC-SU] Implement a named pipe cmd on OTA Provider to handle the ApplyUpdateRequest #786

@khodya

Description

@khodya

In the SU-2.5 step 3 we need to verify that OTA Requestor sends ApplyUpdateRequest again after 120 seconds of delay.

Implement a named pipe on the OTA Provider side that registers the ApplyUpdateRequest cmd retrieval.

Example :

void OTAProviderExample::HandleApplyUpdateRequest(app::CommandHandler * commandObj, 
                                                  const app::ConcreteCommandPath & commandPath,
                                                  const ApplyUpdateRequest::DecodableType & commandData)
{
    // ... existing code ...
    ChipLogDetail(SoftwareUpdate, "%s: token: %s, version: %" PRIu32, __FUNCTION__, tokenBuf, commandData.newVersion);
    
    // NEW: Send notification through named pipe if available
    if (mPipeDelegate && mPipeDelegate->GetPipes())
    {
        Json::Value notification;
        notification["Event"] = "ApplyUpdateRequest";
        notification["Version"] = commandData.newVersion;
        notification["Token"] = tokenBuf;
        mPipeDelegate->GetPipes()->WriteToOutPipe(Json::writeString(notification));
    }
    
    // ... rest of existing code ...
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions