Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt fixes v2.5.1 #21

Open
wants to merge 6 commits into
base: qt_v2.5.1
Choose a base branch
from
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: 1 addition & 1 deletion qt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static void control_receive_message(int sock, void *eloop_ctx, void *sock_ctx) {
len = assemble_packet(buffer, BUFFER_LEN, &resp);
sendto(sock, (const char *)buffer, len, MSG_CONFIRM, (const struct sockaddr *) &from, fromlen);
#ifdef CONFIG_ZEPHYR
if(!strcmp(api->name, "DEVICE_RESET") || !strcmp(api->name, "STA_DISCONNECT")) {
if(!strcmp(api->name, "DEVICE_RESET")) {
k_msleep(500);
shell_execute_cmd(NULL, "kernel reboot cold");
}
Expand Down
1 change: 1 addition & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ zephyr_include_directories(

zephyr_library_sources(
# Zephyr's port of the Indigo API
${SOURCES_BASE}/zephyr/src/wpas_events.c
${SOURCES_BASE}/zephyr/src/main.c
${SOURCES_BASE}/zephyr/src/indigo_api_callback_dut.c
${SOURCES_BASE}/zephyr/src/vendor_specific_dut.c
Expand Down
22 changes: 14 additions & 8 deletions zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ module-help = Sets log level for WFA Quick Track
source "subsys/logging/Kconfig.template.log_config"

config WFA_QT_CONTROL_APP
# Need full POSIX from libc, Zephyr's POSIX support is only partial
depends on !POSIX_API
select PTHREAD_IPC
bool "WFA Quicktrack control app"
# Need full POSIX from libc, Zephyr's POSIX support is only partial
depends on !POSIX_API
select PTHREAD_IPC
bool "WFA Quicktrack control app"

config WFA_QT_THREAD_STACK_SIZE
int "WFA QT thread stack size"
default 4096
help
Set the stack size for WFA QT thread.
int "WFA QT thread stack size"
default 4096
help
Set the stack size for WFA QT thread.

config WPAS_READY_TIMEOUT_MS
int "WPA supplicant ready timeout (ms)"
default 10000
help
Set the timeout for WPA supplicant to be ready.
10 changes: 10 additions & 0 deletions zephyr/src/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

#define CHECK_SNPRINTF(dest, dest_size, ...) \
do { \
int result = snprintf(dest, dest_size, __VA_ARGS__); \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't declare variables in macros, let functions declare them and we just use it here

if (result < 0 || result >= dest_size) { \
indigo_logger(LOG_LEVEL_ERROR, "snprintf failed or buffer overflow occurred at line %d - Return value: %d", __LINE__, result); \
goto done; \
} \
} while(0)

Loading
Loading