diff --git a/core/el_types.h b/core/el_types.h index d0a77d59..985071b1 100644 --- a/core/el_types.h +++ b/core/el_types.h @@ -225,6 +225,7 @@ typedef enum { EL_TRANSPORT_UART, EL_TRANSPORT_SPI, EL_TRANSPORT_I2C, + EL_TRANSPORT_MQTT } el_transport_type_t; #ifdef __cplusplus diff --git a/porting/espressif/el_device_esp.cpp b/porting/espressif/el_device_esp.cpp index 805fef9a..5dd70b6e 100644 --- a/porting/espressif/el_device_esp.cpp +++ b/porting/espressif/el_device_esp.cpp @@ -82,6 +82,7 @@ void DeviceEsp::init() { static SerialEsp serial{ usb_serial_jtag_driver_config_t{.tx_buffer_size = 8192, .rx_buffer_size = 8192} }; + serial.type = EL_TRANSPORT_UART; this->_transports.emplace_front(&serial); static NetworkEsp network{}; diff --git a/sscma/callback/wifi.hpp b/sscma/callback/wifi.hpp index 8976fe3a..3a32ab8a 100644 --- a/sscma/callback/wifi.hpp +++ b/sscma/callback/wifi.hpp @@ -20,7 +20,6 @@ static int32_t wifi_status = 0; static in4_info_t in4_info{}; static in6_info_t in6_info{}; } // namespace shared_variables -#endif void set_wifi_ver(const std::vector& argv, void* caller) { shared_variables::wifi_ver = argv[1]; @@ -41,6 +40,7 @@ void get_wifi_ver(const std::string& cmd, void* caller) { "\"}}\n")}; static_cast(caller)->send_bytes(ss.c_str(), ss.size()); } +#endif void set_wifi_network(const std::vector& argv, void* caller, bool called_by_event = false) { auto ret = EL_OK; diff --git a/sscma/static_resource.hpp b/sscma/static_resource.hpp index c807b6f0..78e5307d 100644 --- a/sscma/static_resource.hpp +++ b/sscma/static_resource.hpp @@ -102,6 +102,9 @@ class StaticResource final { static auto v_mqtt{MQTT(wifi)}; mqtt = &v_mqtt; + + mqtt->type = EL_TRANSPORT_MQTT; + transports.emplace_front(mqtt); #endif static auto v_instance{Server()}; @@ -159,6 +162,7 @@ class StaticResource final { case EL_TRANSPORT_I2C: reinterpret_cast(transport)->init(); break; + case EL_TRANSPORT_MQTT: default: break; }