remove tmp files

This commit is contained in:
Tomasz Duda 2024-02-02 01:02:19 +01:00
parent a7364be94c
commit 3c33c9e128
3 changed files with 0 additions and 94 deletions

View File

@ -1,53 +0,0 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.const import (
CONF_ID,
)
from esphome.components.nrf52 import add_zephyr_prj_conf_option
ipsp_ns = cg.esphome_ns.namespace("ipsp")
Network = ipsp_ns.class_("Network", cg.Component)
CONFIG_SCHEMA = cv.All(
cv.Schema(
{
cv.GenerateID(): cv.declare_id(Network),
}
).extend(cv.COMPONENT_SCHEMA),
cv.only_with_zephyr,
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
add_zephyr_prj_conf_option("CONFIG_BT", True)
add_zephyr_prj_conf_option("CONFIG_BT_SMP", True)
add_zephyr_prj_conf_option("CONFIG_BT_PERIPHERAL", True)
add_zephyr_prj_conf_option("CONFIG_BT_CENTRAL", True)
add_zephyr_prj_conf_option("CONFIG_BT_L2CAP_DYNAMIC_CHANNEL", True)
add_zephyr_prj_conf_option("CONFIG_BT_DEVICE_NAME", "Test IPSP node") # TODO
add_zephyr_prj_conf_option("CONFIG_NETWORKING", True)
add_zephyr_prj_conf_option("CONFIG_NET_IPV6", True)
add_zephyr_prj_conf_option("CONFIG_NET_IPV4", False)
add_zephyr_prj_conf_option("CONFIG_NET_UDP", False)
add_zephyr_prj_conf_option("CONFIG_NET_TCP", True)
add_zephyr_prj_conf_option("CONFIG_TEST_RANDOM_GENERATOR", True)
add_zephyr_prj_conf_option("CONFIG_NET_L2_BT", True)
add_zephyr_prj_conf_option("CONFIG_INIT_STACKS", True)
add_zephyr_prj_conf_option("CONFIG_NET_PKT_RX_COUNT", 10)
add_zephyr_prj_conf_option("CONFIG_NET_PKT_TX_COUNT", 10)
add_zephyr_prj_conf_option("CONFIG_NET_BUF_RX_COUNT", 20)
add_zephyr_prj_conf_option("CONFIG_NET_BUF_TX_COUNT", 20)
add_zephyr_prj_conf_option("CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT", 3)
add_zephyr_prj_conf_option("CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT", 4)
add_zephyr_prj_conf_option("CONFIG_NET_MAX_CONTEXTS", 6)
add_zephyr_prj_conf_option("CONFIG_NET_CONFIG_AUTO_INIT", True)
add_zephyr_prj_conf_option("CONFIG_NET_CONFIG_SETTINGS", True)
add_zephyr_prj_conf_option("CONFIG_NET_CONFIG_MY_IPV6_ADDR", "2001:db8::1")
add_zephyr_prj_conf_option("CONFIG_NET_CONFIG_PEER_IPV6_ADDR", "2001:db8::2")
add_zephyr_prj_conf_option("CONFIG_NET_CONFIG_BT_NODE", True)
if True:
add_zephyr_prj_conf_option("CONFIG_LOG", True)
add_zephyr_prj_conf_option("CONFIG_NET_LOG", True)

View File

@ -1,31 +0,0 @@
#include "network.h"
#include <zephyr/net/net_if.h>
/* Define my IP address where to expect messages */
#define MY_IP6ADDR { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0x1 } } }
static struct in6_addr in6addr_my = MY_IP6ADDR;
namespace esphome {
namespace ipsp {
void Network::setup() {
if (net_addr_pton(AF_INET6,
CONFIG_NET_CONFIG_MY_IPV6_ADDR,
&in6addr_my) < 0) {
// LOG_ERR("Invalid IPv6 address %s",
// CONFIG_NET_CONFIG_MY_IPV6_ADDR);
}
do {
struct net_if_addr *ifaddr;
ifaddr = net_if_ipv6_addr_add(net_if_get_default(),
&in6addr_my, NET_ADDR_MANUAL, 0);
} while (0);
}
} // namespace shell
} // namespace esphome

View File

@ -1,10 +0,0 @@
#pragma once
#include "esphome/core/component.h"
namespace esphome {
namespace ipsp {
class Network : public Component {
void setup() override;
};
}
}