fix esp now
This commit is contained in:
@@ -46,9 +46,10 @@ bool Network::activateEspNow(recieveCallbackPtr reci, sendCallbackPtr send) {
|
||||
|
||||
esp_now_register_send_cb(send);
|
||||
|
||||
memcpy(this->peerInfo.peer_addr, this->broadcastAddress, 6);
|
||||
this->peerInfo.channel = 0;
|
||||
this->peerInfo.encrypt = false;
|
||||
esp_now_peer_info_t peerInfo = {};
|
||||
memcpy(peerInfo.peer_addr, this->broadcastAddress, 6);
|
||||
peerInfo.channel = 0;
|
||||
peerInfo.encrypt = false;
|
||||
|
||||
if (esp_now_add_peer(&peerInfo) != ESP_OK) {
|
||||
std::cout << "Network::connectEspNow - Failed to add peer" << std::endl;
|
||||
|
||||
@@ -62,7 +62,6 @@ class Network : public Component {
|
||||
NetworkAdresses adresses;
|
||||
WiFiClient wifiClient;
|
||||
PubSubClient* mqttClient = nullptr;
|
||||
esp_now_peer_info_t peerInfo;
|
||||
|
||||
bool initSucessful = false;
|
||||
bool wifiConnected = false;
|
||||
|
||||
Reference in New Issue
Block a user