Skip to content

Commit

Permalink
[ESP32] Fixed build failure in lighting-app and readme update (#19762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadhavrohit924 authored and pull[bot] committed Dec 5, 2023
1 parent 696a81a commit 1082018
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
7 changes: 7 additions & 0 deletions examples/lighting-app/esp32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ make sure the IDF_PATH has been exported(See the manual setup steps above).
export PATH=$PATH:path/to/connectedhomeip/out/host
```
- To erase flash of the chip.
$ idf.py -p /dev/tty.SLAB_USBtoUART erase-flash
Below mentioned command generates the nvs image with test DAC with
VID:0xFFF2 and PID:8001
Expand Down Expand Up @@ -171,6 +175,9 @@ make sure the IDF_PATH has been exported(See the manual setup steps above).
$ idf.py -p /dev/tty.SLAB_USBtoUART monitor
- Commissioning over ble after flashing script, change the passcode, replace
`20202021` with `99663300`.
## Commissioning over BLE using chip-tool
- Please build the standalone chip-tool as described [here](../../chip-tool)
Expand Down
11 changes: 10 additions & 1 deletion examples/lighting-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>

#if CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER
#include <platform/ESP32/ESP32FactoryDataProvider.h>
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

using namespace ::chip;
using namespace ::chip::DeviceManager;
using namespace ::chip::DeviceLayer;
Expand All @@ -39,6 +43,12 @@ static const char * TAG = "light-app";

static AppDeviceCallbacks EchoCallbacks;

namespace {
#if CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER
ESP32FactoryDataProvider sFactoryDataProvider;
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER
} // namespace

static void InitServer(intptr_t context)
{
// Print QR Code URL
Expand Down Expand Up @@ -68,7 +78,6 @@ extern "C" void app_main()
#if CONFIG_ENABLE_CHIP_SHELL
chip::LaunchShell();
#endif

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();

CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks);
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/esp32/common/Esp32AppServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@

namespace Esp32AppServer {
void Init(AppDelegate * context = nullptr);
}
} // namespace Esp32AppServer

0 comments on commit 1082018

Please sign in to comment.