Skip to content
Merged
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
3 changes: 3 additions & 0 deletions aether/dns/esp32_dns_resolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
# include "lwip/err.h"
# include "lwip/sys.h"
# include "lwip/dns.h"
# include "lwip/tcpip.h"

# include "aether/aether.h"
# include "aether/actions/action_context.h"
Expand Down Expand Up @@ -71,6 +72,7 @@ class GethostByNameDnsResolver {

// make query
ip_addr_t cached_addr;
LOCK_TCPIP_CORE();
auto res = dns_gethostbyname(
name_address.name.c_str(), &cached_addr,
[](const char* /* name */, const ip_addr_t* ipaddr,
Expand All @@ -79,6 +81,7 @@ class GethostByNameDnsResolver {
context->self->QueryResult(*context, ipaddr);
},
&query_context);
UNLOCK_TCPIP_CORE();

if (res == ERR_OK) {
QueryResult(query_context, &cached_addr);
Expand Down
4 changes: 2 additions & 2 deletions examples/cloud/cloud_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

#include "aether/tele/tele.h"

static constexpr std::string_view kWifiSsid = "Test";
static constexpr std::string_view kWifiPass = "Test";
static constexpr std::string_view kWifiSsid = "Test1234";
static constexpr std::string_view kWifiPass = "Test1234";

namespace ae::cloud_test {
constexpr ae::SafeStreamConfig kSafeStreamConfig{
Expand Down
4 changes: 2 additions & 2 deletions examples/key_led/key_led_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@

using std::vector;

static constexpr std::string_view kWifiSsid = "Test123";
static constexpr std::string_view kWifiPass = "Test123";
static constexpr std::string_view kWifiSsid = "Test1234";
static constexpr std::string_view kWifiPass = "Test1234";
static constexpr bool kUseAether = true;

namespace ae::key_led_test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ set(AE_DISTILLATION OFF CACHE BOOL "" FORCE)

list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether"
# "../../../../examples/cloud"
"../../../../examples/key_led"
# "../../../../examples/registered"
# "../../../../examples/key_led"
"../../../../examples/registered"
# "../../../../examples/benches/send_message_delays"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
; https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = ../../../../examples/button
; src_dir = ../../../../examples/benches/send_message_delays
;src_dir = ../../../../examples/cloud
;src_dir = ../../../../examples/key_led
src_dir = ../../../../examples/registered
;src_dir = ../../../../examples/benches/send_message_delays

[env:esp32-c6-devkitm-1]
platform = platformio/espressif32
framework = espidf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ idf_build_set_property(CM_PLATFORM "ESP32")
add_compile_definitions(CM_ESP32)

if(NOT COMPILE_EXAMPLE )
set(COMPILE_EXAMPLE "key_led")
set(COMPILE_EXAMPLE "registered")
endif()

if (NOT USER_CONFIG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ set(AE_DISTILLATION OFF CACHE BOOL "" FORCE)

list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether"
# "../../../../examples/cloud"
"../../../../examples/key_led"
# "../../../../examples/registered"
# "../../../../examples/key_led"
"../../../../examples/registered"
# "../../../../examples/benches/send_message_delays"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
; https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = ../../../../examples/button
; src_dir = ../../../../examples/benches/send_message_delays
;src_dir = ../../../../examples/cloud
;src_dir = ../../../../examples/key_led
src_dir = ../../../../examples/registered
;src_dir = ../../../../examples/benches/send_message_delays

[env:esp-wrover-kit]
platform = platformio/espressif32
framework = espidf
Expand Down
3 changes: 2 additions & 1 deletion projects/xtensa_lx6/vscode/aether-client-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ idf_build_set_property(CM_PLATFORM "ESP32")
add_compile_definitions(CM_ESP32)

if(NOT COMPILE_EXAMPLE )
set(COMPILE_EXAMPLE "key_led")
set(COMPILE_EXAMPLE "registered")
endif()

if (NOT USER_CONFIG)
Expand All @@ -40,6 +40,7 @@ endif()
# enable doubles in unity tests
add_compile_definitions("CONFIG_UNITY_ENABLE_DOUBLE")

set(AE_DISTILLATION OFF CACHE BOOL "" FORCE)

list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether"
"../../../../examples/cloud"
Expand Down
20 changes: 12 additions & 8 deletions scripts/update_arduino_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@
# and call this script with -out <path to aether-client-arduino-library>
#

import io
import re
import os
import shutil
import argparse

from pathlib import PureWindowsPath

# copy only files what matches
FILTER_SOURCES = re.compile(r'^[\d\w\-_]+($|(\.((h)|(hpp)|(hh)|(c)|(cpp)|(cc)|(md))$))')
# list names should not copied to arduino library
Expand All @@ -50,12 +53,11 @@ def remove_empty_folders(dir:str):

# get file path to #include relative to base
def deep_get_file_path_relative_to(file_name:str, dir: str):
n = os.path.split(file_name)[1]
name = n if len(n) else file_name
for (root, _, files) in os.walk(dir):
for f in files:
if f == name:
return os.path.join(root, f)
for (root, dirs, _) in os.walk(dir):
for d in dirs:
file_path = os.path.join(root, d, file_name)
if os.path.exists(file_path):
return file_path
return ''

# get file path to #include relative to base
Expand All @@ -72,6 +74,7 @@ def get_file_path_relative_to(file_name:str, dir: str, base: str):
deep_find = deep_get_file_path_relative_to(file_name, dir)
if len(deep_find):
return os.path.relpath(deep_find, base)
# go to parent
dir = os.path.split(dir)[0]
raise Exception('file not found', 'File {} should be somewhere in {}'.format(file_name, base))

Expand Down Expand Up @@ -112,13 +115,14 @@ def fix_include_paths(dir: str):
if not re_sources.match(f):
continue
file_path = os.path.join(root, f)
lines = open(file_path, 'r').readlines()
with open(file_path, 'w') as open_file:
lines = io.open(file_path, 'r', encoding='utf-8').readlines()
with io.open(file_path, 'w', encoding='utf-8') as open_file:
for l in lines:
match = re_include.match(l)
if match:
should_include = get_file_path_relative_to(match[1], root, base_dir)
l = '#include \"{}\"\n'.format(should_include)
l = PureWindowsPath(l).as_posix()
open_file.write(l)

def copy_aether_dir(aether_path:str, out_dir: str):
Expand Down