fix log messages

This commit is contained in:
NP v/d Spek 2024-09-19 20:25:35 +02:00
parent ad41f67a36
commit 6803773ee6
2 changed files with 4 additions and 3 deletions

View file

@ -114,7 +114,7 @@ void ESPNowComponent::dump_config() {
packet->content(5), packet->content(6), packet->content(7), packet->content(8), packet->content(9), packet->content(5), packet->content(6), packet->content(7), packet->content(8), packet->content(9),
packet->size()); packet->size());
ESP_LOGI(TAG, "test: A:%06x R:%02x C:%04x S:%d", packet->protocol_id(), packet->packet_id(), packet->crc(), ESP_LOGI(TAG, "test: A:%06lx R:%02x C:%04x S:%d", packet->protocol_id(), packet->packet_id(), packet->crc(),
packet->size()); packet->size());
ESP_LOGI(TAG, "test: is_valid: %s", ESP_LOGI(TAG, "test: is_valid: %s",
packet->is_valid() ? "Yes" : "No"); // ESP_LOGCONFIG(TAG, " WiFi Channel: %n", WiFi.channel()); packet->is_valid() ? "Yes" : "No"); // ESP_LOGCONFIG(TAG, " WiFi Channel: %n", WiFi.channel());
@ -241,7 +241,7 @@ ESPNowDefaultProtocol *ESPNowComponent::get_default_protocol() {
ESPNowProtocol *ESPNowComponent::get_protocol_(uint32_t protocol) { ESPNowProtocol *ESPNowComponent::get_protocol_(uint32_t protocol) {
if (this->protocols_[protocol] == nullptr) { if (this->protocols_[protocol] == nullptr) {
ESP_LOGE(TAG, "Protocol for '0x%06x' is not registered", protocol); ESP_LOGE(TAG, "Protocol for '0x%06lx' is not registered", protocol);
return nullptr; return nullptr;
} }
return this->protocols_[protocol]; return this->protocols_[protocol];

View file

@ -49,7 +49,8 @@ struct ESPNowData {
uint32_t timestamp{0}; uint32_t timestamp{0};
uint8_t size{0}; uint8_t size{0};
uint8_t content[251]{0}; uint8_t content[251]{0};
}; } __attribute__((packed));
class ESPNowPacket { class ESPNowPacket {
public: public:
ESPNowPacket() { ESPNowPacket() {