mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-31 03:07:30 +02:00
Linux port: VFS to init termux, W-no-format for linux only
This commit is contained in:
@ -33,4 +33,7 @@ idf_component_register(SRCS "${srcs}"
|
|||||||
|
|
||||||
target_compile_features(${COMPONENT_LIB} PRIVATE cxx_std_17)
|
target_compile_features(${COMPONENT_LIB} PRIVATE cxx_std_17)
|
||||||
|
|
||||||
|
if(${target} STREQUAL "linux")
|
||||||
|
# This is needed for ESP_LOGx() macros, as integer formats differ on ESP32(..) and x64
|
||||||
set_target_properties(${COMPONENT_LIB} PROPERTIES COMPILE_FLAGS -Wno-format)
|
set_target_properties(${COMPONENT_LIB} PROPERTIES COMPILE_FLAGS -Wno-format)
|
||||||
|
endif()
|
||||||
|
@ -8,11 +8,14 @@
|
|||||||
#include "esp_modem_config.h"
|
#include "esp_modem_config.h"
|
||||||
#include "esp_netif.h"
|
#include "esp_netif.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define CONFIG_EXAMPLE_SIM_PIN "1234"
|
||||||
|
|
||||||
using namespace esp_modem;
|
using namespace esp_modem;
|
||||||
|
|
||||||
[[maybe_unused]] static const char *TAG = "linux_modem_main";
|
[[maybe_unused]] static const char *TAG = "linux_modem_main";
|
||||||
|
|
||||||
#define CONFIG_EXAMPLE_SIM_PIN "1234"
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -25,6 +28,7 @@ int main()
|
|||||||
.vfs_config = { }
|
.vfs_config = { }
|
||||||
};
|
};
|
||||||
dte_config.vfs_config.dev_name = "/dev/ttyUSB0";
|
dte_config.vfs_config.dev_name = "/dev/ttyUSB0";
|
||||||
|
dte_config.vfs_config.resource = ESP_MODEM_VFS_IS_UART; // This tells the VFS to init the UART (use termux to setup baudrate, etc.)
|
||||||
|
|
||||||
esp_netif_config_t netif_config = {
|
esp_netif_config_t netif_config = {
|
||||||
.dev_name = "/dev/net/tun",
|
.dev_name = "/dev/net/tun",
|
||||||
|
Reference in New Issue
Block a user