Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openthread-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ force-generate-bindings = []
# If this feature is not enabled, the build will assume and use the "official" RiscV GCC toolchain:
# https://github.com/riscv-collab/riscv-gnu-toolchain
force-esp-riscv-toolchain = []
# Enable coap in the openthread cmake build and expose coap functionality to rust
coap = []

[build-dependencies]
anyhow = "1"
Expand Down
6 changes: 6 additions & 0 deletions openthread-sys/gen/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ impl OpenThreadBuilder {
.cflag("-DOPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS=128")
.cxxflag("-DOPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS=128");

if std::env::var("CARGO_FEATURE_COAP").is_ok() {
config
.define("OT_COAP", "ON")
.define("OT_COAP_OBSERVE", "ON");
}

config
.define("OT_THREAD_VERSION", "1.1")
.define("OT_LOG_LEVEL", "NOTE")
Expand Down
9 changes: 9 additions & 0 deletions openthread-sys/gen/include/include.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "openthread/tasklet.h"
#include "openthread/nat64.h"
#include "openthread/netdata.h"
#include "openthread/coap.h"

#include "openthread/platform/alarm-milli.h"
#include "openthread/platform/radio.h"
Expand All @@ -17,4 +18,12 @@

#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE
#define OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE 1
#endif

#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE
#define OPENTHREAD_CONFIG_COAP_API_ENABLE 1
#endif

#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE
#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 1
#endif
1 change: 1 addition & 0 deletions openthread/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ default = []
edge-nal = ["udp", "dep:edge-nal"]
udp = []
srp = ["udp"]
coap = []
defmt = ["dep:defmt", "heapless/defmt-03", "embassy-time/defmt"]
force-generate-bindings = ["openthread-sys/force-generate-bindings"]
force-esp-riscv-toolchain = ["openthread-sys/force-esp-riscv-toolchain"]
Expand Down
Loading