Skip to content

Commit

Permalink
Update the example snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed May 3, 2024
1 parent 022d99e commit da99a03
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Furthermore, _operating_ the assembled Matter stack is also challenging, as vari
Instantiate it and then call `MatterStack::run(...)`.

```rust
//! An example utilizing the `MatterStack<WifiBle, ..>` struct.
//! An example utilizing the `WifiBleMatterStack` struct.
//! As the name suggests, this Matter stack assembly uses Wifi as the main transport,
//! and BLE for commissioning.
//! If you want to use Ethernet, utilize `MatterStack<Eth, ..>` instead.
//! If you want to use Ethernet, utilize `EthMatterStack` instead.
//!
//! The example implements a fictitious Light device (an On-Off Matter cluster).

Expand All @@ -32,7 +32,7 @@ use core::pin::pin;
use embassy_futures::select::select;
use embassy_time::{Duration, Timer};

use esp_idf_matter::{init_async_io, BuiltinMdns, Error, MatterStack, WifiBle};
use esp_idf_matter::{init_async_io, Error, MdnsType, WifiBleMatterStack};

use esp_idf_svc::eventloop::EspSystemEventLoop;
use esp_idf_svc::hal::peripherals::Peripherals;
Expand Down Expand Up @@ -172,8 +172,8 @@ async fn matter() -> Result<(), Error> {
/// The Matter stack is allocated statically to avoid
/// program stack blowups.
/// It is also a mandatory requirement when the `WifiBle` stack variation is used.
static MATTER_STACK: ConstStaticCell<MatterStack<WifiBle, BuiltinMdns>> =
ConstStaticCell::new(MatterStack::new(
static MATTER_STACK: ConstStaticCell<WifiBleMatterStack> =
ConstStaticCell::new(WifiBleMatterStack::new(
&BasicInfoConfig {
vid: 0xFFF1,
pid: 0x8000,
Expand All @@ -186,6 +186,7 @@ static MATTER_STACK: ConstStaticCell<MatterStack<WifiBle, BuiltinMdns>> =
vendor_name: "ACME",
},
&dev_att::HardCodedDevAtt::new(),
MdnsType::default(),
));

/// Endpoint 0 (the root endpoint) always runs
Expand All @@ -196,7 +197,7 @@ const LIGHT_ENDPOINT_ID: u16 = 1;
const NODE: Node<'static> = Node {
id: 0,
endpoints: &[
MatterStack::<WifiBle, BuiltinMdns>::root_metadata(),
WifiBleMatterStack::root_metadata(),
Endpoint {
id: LIGHT_ENDPOINT_ID,
device_type: DEV_TYPE_ON_OFF_LIGHT,
Expand Down

0 comments on commit da99a03

Please sign in to comment.