1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-16 10:12:21 +01:00

Initial Support for RP2040 platform (#3284)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Jesse Hills
2022-10-20 16:50:39 +13:00
committed by GitHub
parent e87edcc77a
commit 6153bcc6ad
49 changed files with 1270 additions and 61 deletions

View File

@@ -38,6 +38,9 @@ void MDNSComponent::compile_records_() {
#endif
#ifdef USE_ESP32
platform = "ESP32";
#endif
#ifdef USE_RP2040
platform = "RP2040";
#endif
if (platform != nullptr) {
service.txt_records.push_back({"platform", platform});

View File

@@ -0,0 +1,40 @@
#ifdef USE_RP2040
#include "esphome/components/network/ip_address.h"
#include "esphome/components/network/util.h"
#include "esphome/core/log.h"
#include "mdns_component.h"
namespace esphome {
namespace mdns {
void MDNSComponent::setup() {
this->compile_records_();
network::IPAddress addr = network::get_ip_address();
// MDNS.begin(this->hostname_.c_str(), (uint32_t) addr);
// for (const auto &service : this->services_) {
// // Strip the leading underscore from the proto and service_type. While it is
// // part of the wire protocol to have an underscore, and for example ESP-IDF
// // expects the underscore to be there, the ESP8266 implementation always adds
// // the underscore itself.
// auto *proto = service.proto.c_str();
// while (*proto == '_') {
// proto++;
// }
// auto *service_type = service.service_type.c_str();
// while (*service_type == '_') {
// service_type++;
// }
// MDNS.addService(service_type, proto, service.port);
// for (const auto &record : service.txt_records) {
// MDNS.addServiceTxt(service_type, proto, record.key.c_str(), record.value.c_str());
// }
// }
}
} // namespace mdns
} // namespace esphome
#endif