From 3dd4b0d112c16311c39efc10e8eda9f63e513775 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Fri, 22 Nov 2024 11:57:08 -0300 Subject: [PATCH 1/3] feat(openthread): add license declaration to all soure code and examples (#10631) --- .../examples/COAP/coap_lamp/coap_lamp.ino | 14 ++++++++++++++ .../examples/COAP/coap_switch/coap_switch.ino | 14 ++++++++++++++ .../OpenThread/examples/SimpleCLI/SimpleCLI.ino | 14 ++++++++++++++ .../OpenThread/examples/SimpleNode/SimpleNode.ino | 14 ++++++++++++++ .../ExtendedRouterNode/ExtendedRouterNode.ino | 14 ++++++++++++++ .../SimpleThreadNetwork/LeaderNode/LeaderNode.ino | 14 ++++++++++++++ .../SimpleThreadNetwork/RouterNode/RouterNode.ino | 14 ++++++++++++++ .../OpenThread/examples/ThreadScan/ThreadScan.ino | 14 ++++++++++++++ .../OpenThread/examples/onReceive/onReceive.ino | 14 ++++++++++++++ libraries/OpenThread/src/OThreadCLI.cpp | 14 ++++++++++++++ libraries/OpenThread/src/OThreadCLI.h | 14 ++++++++++++++ libraries/OpenThread/src/OThreadCLI_Util.cpp | 14 ++++++++++++++ libraries/OpenThread/src/OThreadCLI_Util.h | 14 ++++++++++++++ 13 files changed, 182 insertions(+) diff --git a/libraries/OpenThread/examples/COAP/coap_lamp/coap_lamp.ino b/libraries/OpenThread/examples/COAP/coap_lamp/coap_lamp.ino index 9b53373f702..51483bb4c7c 100644 --- a/libraries/OpenThread/examples/COAP/coap_lamp/coap_lamp.ino +++ b/libraries/OpenThread/examples/COAP/coap_lamp/coap_lamp.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + #include "OThreadCLI.h" #include "OThreadCLI_Util.h" diff --git a/libraries/OpenThread/examples/COAP/coap_switch/coap_switch.ino b/libraries/OpenThread/examples/COAP/coap_switch/coap_switch.ino index 1d42930389b..aac5db0bc82 100644 --- a/libraries/OpenThread/examples/COAP/coap_switch/coap_switch.ino +++ b/libraries/OpenThread/examples/COAP/coap_switch/coap_switch.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + #include "OThreadCLI.h" #include "OThreadCLI_Util.h" diff --git a/libraries/OpenThread/examples/SimpleCLI/SimpleCLI.ino b/libraries/OpenThread/examples/SimpleCLI/SimpleCLI.ino index db9dc910e94..feef800c0fa 100644 --- a/libraries/OpenThread/examples/SimpleCLI/SimpleCLI.ino +++ b/libraries/OpenThread/examples/SimpleCLI/SimpleCLI.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + /* * OpenThread.begin(false) will not automatically start a node in a Thread Network * The user will need to start it manually using the OpenThread CLI commands diff --git a/libraries/OpenThread/examples/SimpleNode/SimpleNode.ino b/libraries/OpenThread/examples/SimpleNode/SimpleNode.ino index b7f48c82b5d..95bf7a2401a 100644 --- a/libraries/OpenThread/examples/SimpleNode/SimpleNode.ino +++ b/libraries/OpenThread/examples/SimpleNode/SimpleNode.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + /* * OpenThread.begin() will automatically start a node in a Thread Network * If NVS is empty, default configuration will be as follow: diff --git a/libraries/OpenThread/examples/SimpleThreadNetwork/ExtendedRouterNode/ExtendedRouterNode.ino b/libraries/OpenThread/examples/SimpleThreadNetwork/ExtendedRouterNode/ExtendedRouterNode.ino index 249ba2a3fe0..4fc8a921584 100644 --- a/libraries/OpenThread/examples/SimpleThreadNetwork/ExtendedRouterNode/ExtendedRouterNode.ino +++ b/libraries/OpenThread/examples/SimpleThreadNetwork/ExtendedRouterNode/ExtendedRouterNode.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + #include "OThreadCLI.h" #include "OThreadCLI_Util.h" diff --git a/libraries/OpenThread/examples/SimpleThreadNetwork/LeaderNode/LeaderNode.ino b/libraries/OpenThread/examples/SimpleThreadNetwork/LeaderNode/LeaderNode.ino index e2342426a7a..7b709717692 100644 --- a/libraries/OpenThread/examples/SimpleThreadNetwork/LeaderNode/LeaderNode.ino +++ b/libraries/OpenThread/examples/SimpleThreadNetwork/LeaderNode/LeaderNode.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + /* OpenThread.begin(false) will not automatically start a node in a Thread Network A Leader node is the first device, that has a complete dataset, to start Thread diff --git a/libraries/OpenThread/examples/SimpleThreadNetwork/RouterNode/RouterNode.ino b/libraries/OpenThread/examples/SimpleThreadNetwork/RouterNode/RouterNode.ino index 8ec01344d7a..45475fa0c6a 100644 --- a/libraries/OpenThread/examples/SimpleThreadNetwork/RouterNode/RouterNode.ino +++ b/libraries/OpenThread/examples/SimpleThreadNetwork/RouterNode/RouterNode.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + /* OpenThread.begin(false) will not automatically start a node in a Thread Network A Router/Child node is the device that will join an existing Thread Network diff --git a/libraries/OpenThread/examples/ThreadScan/ThreadScan.ino b/libraries/OpenThread/examples/ThreadScan/ThreadScan.ino index f2a5711a4ea..9d0074bb180 100644 --- a/libraries/OpenThread/examples/ThreadScan/ThreadScan.ino +++ b/libraries/OpenThread/examples/ThreadScan/ThreadScan.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + /* OpenThread.begin(true) will automatically start a node in a Thread Network Full scanning requires the thread node to be at least in Child state. diff --git a/libraries/OpenThread/examples/onReceive/onReceive.ino b/libraries/OpenThread/examples/onReceive/onReceive.ino index 24a9e0ccc23..b37c2fc7931 100644 --- a/libraries/OpenThread/examples/onReceive/onReceive.ino +++ b/libraries/OpenThread/examples/onReceive/onReceive.ino @@ -1,3 +1,17 @@ +// Copyright 2024 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. + /* OpenThread.begin() will automatically start a node in a Thread Network This will demonstrate how to capture the CLI response in a callback function diff --git a/libraries/OpenThread/src/OThreadCLI.cpp b/libraries/OpenThread/src/OThreadCLI.cpp index 9190f09bc6b..85ba03563e8 100644 --- a/libraries/OpenThread/src/OThreadCLI.cpp +++ b/libraries/OpenThread/src/OThreadCLI.cpp @@ -1,3 +1,17 @@ +// Copyright 2024 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. + #include "OThreadCLI.h" #if SOC_IEEE802154_SUPPORTED #if CONFIG_OPENTHREAD_ENABLED diff --git a/libraries/OpenThread/src/OThreadCLI.h b/libraries/OpenThread/src/OThreadCLI.h index 689b4a5672b..bc8dc5d2b19 100644 --- a/libraries/OpenThread/src/OThreadCLI.h +++ b/libraries/OpenThread/src/OThreadCLI.h @@ -1,3 +1,17 @@ +// Copyright 2024 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 "soc/soc_caps.h" #include "sdkconfig.h" diff --git a/libraries/OpenThread/src/OThreadCLI_Util.cpp b/libraries/OpenThread/src/OThreadCLI_Util.cpp index d1b7f27a36f..d21daa1effc 100644 --- a/libraries/OpenThread/src/OThreadCLI_Util.cpp +++ b/libraries/OpenThread/src/OThreadCLI_Util.cpp @@ -1,3 +1,17 @@ +// Copyright 2024 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. + #include "OThreadCLI.h" #if SOC_IEEE802154_SUPPORTED #if CONFIG_OPENTHREAD_ENABLED diff --git a/libraries/OpenThread/src/OThreadCLI_Util.h b/libraries/OpenThread/src/OThreadCLI_Util.h index 5484776889d..1ab2e061dfc 100644 --- a/libraries/OpenThread/src/OThreadCLI_Util.h +++ b/libraries/OpenThread/src/OThreadCLI_Util.h @@ -1,3 +1,17 @@ +// Copyright 2024 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 "soc/soc_caps.h" #include "sdkconfig.h" From 1712fb5eeee9069ad4e016c5fd6659b28ca397b0 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 25 Nov 2024 07:17:38 -0300 Subject: [PATCH 2/3] fix(network): Avoid returning zero if connection is not dropped (#10640) Co-authored-by: NPaolini <75562717+NPaolini@users.noreply.github.com> --- libraries/Network/src/NetworkClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Network/src/NetworkClient.cpp b/libraries/Network/src/NetworkClient.cpp index 0782b74f2a9..067d288bf93 100644 --- a/libraries/Network/src/NetworkClient.cpp +++ b/libraries/Network/src/NetworkClient.cpp @@ -549,7 +549,7 @@ uint8_t NetworkClient::connected() { } if (_connected) { uint8_t dummy; - int res = recv(fd(), &dummy, 0, MSG_DONTWAIT); + int res = recv(fd(), &dummy, 1, MSG_DONTWAIT | MSG_PEEK); // avoid unused var warning by gcc (void)res; // recv only sets errno if res is <= 0 From 4fc8abfafe3b960535449311d3392e68c92a8d51 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 25 Nov 2024 09:04:20 -0300 Subject: [PATCH 3/3] AsyncUdp license and keyword update (#10637) * feat(asyncudp): add all current keywords to the list * feat(asyncudp): add license information to the source code * feat(asyncudp): add license information to the source code * feat(asyncudp): add license information to the source code * feat(asyncudp): add license information to the source code * feat(asyncudp): add license information to the source code * feat(asyncudp): revert license information to the source code * feat(asyncudp): revert license information to the source code * feat(asyncudp): revert license information to the source code * feat(asyncudp): revert license information to the source code * feat(asyncudp): revert license information to the source code * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- libraries/AsyncUDP/keywords.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/libraries/AsyncUDP/keywords.txt b/libraries/AsyncUDP/keywords.txt index 67c0b97a715..1401ea66c72 100644 --- a/libraries/AsyncUDP/keywords.txt +++ b/libraries/AsyncUDP/keywords.txt @@ -8,6 +8,7 @@ AsyncUDP KEYWORD1 AsyncUDPPacket KEYWORD1 +AsyncUDPMessage KEYWORD1 ####################################### # Methods and Functions (KEYWORD2) @@ -19,6 +20,21 @@ listen KEYWORD2 listenMulticast KEYWORD2 close KEYWORD2 write KEYWORD2 +space KEYWORD2 +flush KEYWORD2 +isBroadcast KEYWORD2 +isMulticast KEYWORD2 +isIPv6 KEYWORD2 +interface KEYWORD2 +localIPv6 KEYWORD2 +remoteIPv6 KEYWORD2 +remoteMac KEYWORD2 +send KEYWORD2 +peek KEYWORD2 +available KEYWORD2 +writeTo KEYWORD2 +broadcastTo KEYWORD2 +sendTo KEYWORD2 broadcast KEYWORD2 onPacket KEYWORD2 data KEYWORD2 @@ -27,7 +43,17 @@ localIP KEYWORD2 localPort KEYWORD2 remoteIP KEYWORD2 remotePort KEYWORD2 +listenIP KEYWORD2 +listenIPv6 KEYWORD2 +lastErr KEYWORD2 +_s_recv KEYWORD2 ####################################### # Constants (LITERAL1) ####################################### + +TCPIP_ADAPTER_IF_STA LITERAL1 +TCPIP_ADAPTER_IF_STA LITERAL1 +TCPIP_ADAPTER_IF_AP LITERAL1 +TCPIP_ADAPTER_IF_ETH LITERAL1 +TCPIP_ADAPTER_IF_PPP LITERAL1