|
| 1 | +/* |
| 2 | + * |
| 3 | + * Copyright (c) 2021 Project CHIP Authors |
| 4 | + * All rights reserved. |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + * you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +/* This file contains the decalarions for the Linux implementation of the |
| 20 | + * the OTAImageProcessorDriver interface class |
| 21 | + */ |
| 22 | + |
| 23 | +#include "app/clusters/ota-requestor/OTAImageProcessor.h" |
| 24 | + |
| 25 | +class LinuxOTAImageProcessor : public OTAImageProcessorDriver |
| 26 | +{ |
| 27 | + |
| 28 | + // Virtuial functions from OTAImageProcessorDriver -- start |
| 29 | + // Open file, find block of space in persistent memory, or allocate a buffer, etc. |
| 30 | + CHIP_ERROR PrepareDownload() { return CHIP_NO_ERROR; } |
| 31 | + |
| 32 | + // Must not be a blocking call to support cases that require IO to elements such as // external peripherals/radios |
| 33 | + CHIP_ERROR ProcessBlock(chip::ByteSpan & data) { return CHIP_NO_ERROR; } |
| 34 | + |
| 35 | + // Close file, close persistent storage, etc |
| 36 | + CHIP_ERROR Finalize() { return CHIP_NO_ERROR; } |
| 37 | + |
| 38 | + chip::Optional<uint8_t> PercentComplete() { return chip::Optional<uint8_t>(0); } |
| 39 | + |
| 40 | + // Clean up the download which could mean erasing everything that was written, |
| 41 | + // releasing buffers, etc. |
| 42 | + CHIP_ERROR Abort() { return CHIP_NO_ERROR; } |
| 43 | + |
| 44 | + // Virtuial functions from OTAImageProcessorDriver -- end |
| 45 | +}; |
0 commit comments