Skip to content

Commit e86a3b2

Browse files
authored
Merge pull request #115 from aethernetio/113-fix-some-user-scripts-issues
113 fix some user scripts issues
2 parents db307e9 + 285fee5 commit e86a3b2

10 files changed

Lines changed: 28 additions & 16 deletions

File tree

aether/dns/esp32_dns_resolve.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
# include "lwip/err.h"
3333
# include "lwip/sys.h"
3434
# include "lwip/dns.h"
35+
# include "lwip/tcpip.h"
3536

3637
# include "aether/aether.h"
3738
# include "aether/actions/action_context.h"
@@ -71,6 +72,7 @@ class GethostByNameDnsResolver {
7172

7273
// make query
7374
ip_addr_t cached_addr;
75+
LOCK_TCPIP_CORE();
7476
auto res = dns_gethostbyname(
7577
name_address.name.c_str(), &cached_addr,
7678
[](const char* /* name */, const ip_addr_t* ipaddr,
@@ -79,6 +81,7 @@ class GethostByNameDnsResolver {
7981
context->self->QueryResult(*context, ipaddr);
8082
},
8183
&query_context);
84+
UNLOCK_TCPIP_CORE();
8285

8386
if (res == ERR_OK) {
8487
QueryResult(query_context, &cached_addr);

examples/cloud/cloud_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939

4040
#include "aether/tele/tele.h"
4141

42-
static constexpr std::string_view kWifiSsid = "Test";
43-
static constexpr std::string_view kWifiPass = "Test";
42+
static constexpr std::string_view kWifiSsid = "Test1234";
43+
static constexpr std::string_view kWifiPass = "Test1234";
4444

4545
namespace ae::cloud_test {
4646
constexpr ae::SafeStreamConfig kSafeStreamConfig{

examples/key_led/key_led_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545

4646
using std::vector;
4747

48-
static constexpr std::string_view kWifiSsid = "Test123";
49-
static constexpr std::string_view kWifiPass = "Test123";
48+
static constexpr std::string_view kWifiSsid = "Test1234";
49+
static constexpr std::string_view kWifiPass = "Test1234";
5050
static constexpr bool kUseAether = true;
5151

5252
namespace ae::key_led_test {

projects/espressif_riscv/platformio/aether-client-cpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ set(AE_DISTILLATION OFF CACHE BOOL "" FORCE)
4242

4343
list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether"
4444
# "../../../../examples/cloud"
45-
"../../../../examples/key_led"
46-
# "../../../../examples/registered"
45+
# "../../../../examples/key_led"
46+
"../../../../examples/registered"
4747
# "../../../../examples/benches/send_message_delays"
4848
)
4949

projects/espressif_riscv/platformio/aether-client-cpp/platformio.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
; https://docs.platformio.org/page/projectconf.html
2424

2525
[platformio]
26-
src_dir = ../../../../examples/button
27-
; src_dir = ../../../../examples/benches/send_message_delays
2826
;src_dir = ../../../../examples/cloud
27+
;src_dir = ../../../../examples/key_led
28+
src_dir = ../../../../examples/registered
29+
;src_dir = ../../../../examples/benches/send_message_delays
30+
2931
[env:esp32-c6-devkitm-1]
3032
platform = platformio/espressif32
3133
framework = espidf

projects/espressif_riscv/vscode/aether-client-cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ idf_build_set_property(CM_PLATFORM "ESP32")
2626
add_compile_definitions(CM_ESP32)
2727

2828
if(NOT COMPILE_EXAMPLE )
29-
set(COMPILE_EXAMPLE "key_led")
29+
set(COMPILE_EXAMPLE "registered")
3030
endif()
3131

3232
if (NOT USER_CONFIG)

projects/xtensa_lx6/platformio/aether-client-cpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ set(AE_DISTILLATION OFF CACHE BOOL "" FORCE)
4242

4343
list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether"
4444
# "../../../../examples/cloud"
45-
"../../../../examples/key_led"
46-
# "../../../../examples/registered"
45+
# "../../../../examples/key_led"
46+
"../../../../examples/registered"
4747
# "../../../../examples/benches/send_message_delays"
4848
)
4949

projects/xtensa_lx6/platformio/aether-client-cpp/platformio.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
; https://docs.platformio.org/page/projectconf.html
2424

2525
[platformio]
26-
src_dir = ../../../../examples/button
27-
; src_dir = ../../../../examples/benches/send_message_delays
2826
;src_dir = ../../../../examples/cloud
27+
;src_dir = ../../../../examples/key_led
28+
src_dir = ../../../../examples/registered
29+
;src_dir = ../../../../examples/benches/send_message_delays
30+
2931
[env:esp-wrover-kit]
3032
platform = platformio/espressif32
3133
framework = espidf

projects/xtensa_lx6/vscode/aether-client-cpp/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ idf_build_set_property(CM_PLATFORM "ESP32")
2626
add_compile_definitions(CM_ESP32)
2727

2828
if(NOT COMPILE_EXAMPLE )
29-
set(COMPILE_EXAMPLE "key_led")
29+
set(COMPILE_EXAMPLE "registered")
3030
endif()
3131

3232
if (NOT USER_CONFIG)
@@ -40,6 +40,7 @@ endif()
4040
# enable doubles in unity tests
4141
add_compile_definitions("CONFIG_UNITY_ENABLE_DOUBLE")
4242

43+
set(AE_DISTILLATION OFF CACHE BOOL "" FORCE)
4344

4445
list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether"
4546
"../../../../examples/cloud"

scripts/update_arduino_lib.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
# and call this script with -out <path to aether-client-arduino-library>
2222
#
2323

24+
import io
2425
import re
2526
import os
2627
import shutil
2728
import argparse
2829

30+
from pathlib import PureWindowsPath
31+
2932
# copy only files what matches
3033
FILTER_SOURCES = re.compile(r'^[\d\w\-_]+($|(\.((h)|(hpp)|(hh)|(c)|(cpp)|(cc)|(md))$))')
3134
# list names should not copied to arduino library
@@ -112,13 +115,14 @@ def fix_include_paths(dir: str):
112115
if not re_sources.match(f):
113116
continue
114117
file_path = os.path.join(root, f)
115-
lines = open(file_path, 'r').readlines()
116-
with open(file_path, 'w') as open_file:
118+
lines = io.open(file_path, 'r', encoding='utf-8').readlines()
119+
with io.open(file_path, 'w', encoding='utf-8') as open_file:
117120
for l in lines:
118121
match = re_include.match(l)
119122
if match:
120123
should_include = get_file_path_relative_to(match[1], root, base_dir)
121124
l = '#include \"{}\"\n'.format(should_include)
125+
l = PureWindowsPath(l).as_posix()
122126
open_file.write(l)
123127

124128
def copy_aether_dir(aether_path:str, out_dir: str):

0 commit comments

Comments
 (0)