mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-06-26 01:41:32 +02:00
test(mdns): Host tests to use IDF's esp_event_stub
Also fixes one minor from esp_netif_linux implementation
This commit is contained in:
@ -6,7 +6,7 @@ endif()
|
|||||||
|
|
||||||
idf_build_get_property(target IDF_TARGET)
|
idf_build_get_property(target IDF_TARGET)
|
||||||
if(${target} STREQUAL "linux")
|
if(${target} STREQUAL "linux")
|
||||||
set(dependencies esp_event esp_netif_linux esp_timer_linux esp_system)
|
set(dependencies esp_netif_linux esp_timer_linux esp_system)
|
||||||
set(srcs "mdns.c" ${MDNS_NETWORKING})
|
set(srcs "mdns.c" ${MDNS_NETWORKING})
|
||||||
else()
|
else()
|
||||||
set(dependencies lwip console esp_netif)
|
set(dependencies lwip console esp_netif)
|
||||||
|
@ -5,3 +5,7 @@ set(EXTRA_COMPONENT_DIRS "../..")
|
|||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
set(COMPONENTS main esp_netif_linux)
|
set(COMPONENTS main esp_netif_linux)
|
||||||
project(mdns_host)
|
project(mdns_host)
|
||||||
|
|
||||||
|
# Enable sanitizers for mdns implementation
|
||||||
|
idf_component_get_property(mdns mdns COMPONENT_LIB)
|
||||||
|
target_link_options(${mdns} INTERFACE -fsanitize=address -fsanitize=undefined)
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
idf_component_register(SRCS esp_event_mock.c
|
|
||||||
INCLUDE_DIRS include)
|
|
@ -1,21 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "esp_err.h"
|
|
||||||
#include "esp_event.h"
|
|
||||||
|
|
||||||
const char *WIFI_EVENT = "WIFI_EVENT";
|
|
||||||
const char *IP_EVENT = "IP_EVENT";
|
|
||||||
|
|
||||||
esp_err_t esp_event_handler_register(const char *event_base, int32_t event_id, void *event_handler, void *event_handler_arg)
|
|
||||||
{
|
|
||||||
return ESP_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
esp_err_t esp_event_handler_unregister(const char *event_base, int32_t event_id, void *event_handler)
|
|
||||||
{
|
|
||||||
return ESP_OK;
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "stdbool.h"
|
|
||||||
#include "esp_err.h"
|
|
||||||
#include "esp_event_base.h"
|
|
||||||
#include "bsd/string.h"
|
|
||||||
|
|
||||||
esp_err_t esp_event_handler_register(const char *event_base, int32_t event_id, void *event_handler, void *event_handler_arg);
|
|
||||||
|
|
||||||
esp_err_t esp_event_handler_unregister(const char *event_base, int32_t event_id, void *event_handler);
|
|
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
WIFI_EVENT_STA_CONNECTED, /**< ESP32 station connected to AP */
|
|
||||||
WIFI_EVENT_STA_DISCONNECTED, /**< ESP32 station disconnected from AP */
|
|
||||||
WIFI_EVENT_AP_START, /**< ESP32 soft-AP start */
|
|
||||||
WIFI_EVENT_AP_STOP, /**< ESP32 soft-AP stop */
|
|
||||||
} mdns_used_event_t;
|
|
||||||
|
|
||||||
#define ESP_EVENT_DECLARE_BASE(x)
|
|
||||||
#define ESP_EVENT_ANY_ID (-1)
|
|
||||||
|
|
||||||
typedef void *esp_event_base_t;
|
|
||||||
typedef void *system_event_t;
|
|
@ -1,3 +1,2 @@
|
|||||||
idf_component_register(SRCS esp_netif_linux.c
|
idf_component_register(SRCS esp_netif_linux.c
|
||||||
INCLUDE_DIRS include $ENV{IDF_PATH}/components/esp_netif/include
|
INCLUDE_DIRS include $ENV{IDF_PATH}/components/esp_netif/include)
|
||||||
REQUIRES esp_event)
|
|
||||||
|
@ -55,6 +55,7 @@ esp_err_t esp_netif_get_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_
|
|||||||
}
|
}
|
||||||
tmp = tmp->ifa_next;
|
tmp = tmp->ifa_next;
|
||||||
}
|
}
|
||||||
|
freeifaddrs(addrs);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
idf_component_register(SRCS esp_timer_linux.c timer_task.cpp
|
idf_component_register(SRCS esp_timer_linux.c timer_task.cpp
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include)
|
||||||
REQUIRES esp_event)
|
|
||||||
|
|
||||||
set_target_properties(${COMPONENT_LIB} PROPERTIES
|
set_target_properties(${COMPONENT_LIB} PROPERTIES
|
||||||
CXX_STANDARD 17
|
CXX_STANDARD 17
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include "bsd/string.h"
|
||||||
|
|
||||||
typedef struct esp_timer *esp_timer_handle_t;
|
typedef struct esp_timer *esp_timer_handle_t;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user