Merge branch 'move_ota' into 'main'

Move app_ota to esp_matter_ota component

See merge request app-frameworks/esp-matter!74
This commit is contained in:
Shu Chen
2022-02-11 10:58:04 +00:00
10 changed files with 51 additions and 91 deletions
+3
View File
@@ -0,0 +1,3 @@
idf_component_register(SRCS "esp_matter_ota.cpp"
INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}"
REQUIRES esp_matter app_update esp32_mbedtls esp_system)
@@ -1,18 +1,25 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
// Copyright 2022 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <esp_log.h>
#include <esp_matter_console.h>
#include <esp_matter_ota.h>
#include <string.h>
#include "OTAImageProcessorImpl.h"
#include "platform/GenericOTARequestorDriver.h"
#include "app/clusters/ota-requestor/BDXDownloader.h"
#include "app/clusters/ota-requestor/OTARequestor.h"
#include "OTAImageProcessorImpl.h"
#include "platform/GenericOTARequestorDriver.h"
#include "platform/OTARequestorInterface.h"
using chip::BDXDownloader;
@@ -26,7 +33,7 @@ GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
OTAImageProcessorImpl gImageProcessor;
void matter_ota_requestor_init(void)
void esp_matter_ota_requestor_init(void)
{
chip::SetRequestorInstance(&gRequestorCore);
gRequestorCore.Init(&(Server::GetInstance()), &gRequestorUser, &gDownloader);
@@ -0,0 +1,25 @@
// Copyright 2022 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include "esp_err.h"
#include "sdkconfig.h"
#if CONFIG_ENABLE_OTA_REQUESTOR
/** Initialize the matter OTA Requestor
*
*/
void esp_matter_ota_requestor_init(void);
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode app_update)
set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode esp_matter_ota)
idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
+2 -2
View File
@@ -12,10 +12,10 @@
#include <esp_matter.h>
#include <esp_matter_console.h>
#include <esp_matter_ota.h>
#include <esp_route_hook.h>
#include <app_driver.h>
#include <app_ota.h>
#include <app_qrcode.h>
static const char *TAG = "app_main";
@@ -87,6 +87,6 @@ extern "C" void app_main()
#endif
#if CONFIG_ENABLE_OTA_REQUESTOR
matter_ota_requestor_init();
esp_matter_ota_requestor_init();
#endif
}
-19
View File
@@ -1,19 +0,0 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include "esp_err.h"
#include "sdkconfig.h"
#if CONFIG_ENABLE_OTA_REQUESTOR
/** Initialize the matter OTA Requestor
*
*/
void matter_ota_requestor_init(void);
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode app_update)
set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode esp_matter_ota)
idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
+2 -2
View File
@@ -12,10 +12,10 @@
#include <esp_matter.h>
#include <esp_matter_console.h>
#include <esp_matter_ota.h>
#include <esp_route_hook.h>
#include <app_driver.h>
#include <app_ota.h>
#include <app_qrcode.h>
#include <app_binding_handler.h>
@@ -88,6 +88,6 @@ extern "C" void app_main()
#endif
#if CONFIG_ENABLE_OTA_REQUESTOR
matter_ota_requestor_init();
esp_matter_ota_requestor_init();
#endif
}
-37
View File
@@ -1,37 +0,0 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <esp_log.h>
#include <esp_matter_console.h>
#include <string.h>
#include "OTAImageProcessorImpl.h"
#include "platform/GenericOTARequestorDriver.h"
#include "app/clusters/ota-requestor/BDXDownloader.h"
#include "app/clusters/ota-requestor/OTARequestor.h"
#include "platform/OTARequestorInterface.h"
using chip::BDXDownloader;
using chip::OTAImageProcessorImpl;
using chip::OTARequestor;
using chip::DeviceLayer::GenericOTARequestorDriver;
using chip::Server;
#if CONFIG_ENABLE_OTA_REQUESTOR
OTARequestor gRequestorCore;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
OTAImageProcessorImpl gImageProcessor;
void matter_ota_requestor_init(void)
{
chip::SetRequestorInstance(&gRequestorCore);
gRequestorCore.Init(&(Server::GetInstance()), &gRequestorUser, &gDownloader);
gImageProcessor.SetOTADownloader(&gDownloader);
gDownloader.SetImageProcessorDelegate(&gImageProcessor);
gRequestorUser.Init(&gRequestorCore, &gImageProcessor);
}
#endif
-19
View File
@@ -1,19 +0,0 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include "esp_err.h"
#include "sdkconfig.h"
#if CONFIG_ENABLE_OTA_REQUESTOR
/** Initialize the matter OTA Requestor
*
*/
void matter_ota_requestor_init(void);
#endif