archive old bbnow driver
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "blk_box_drivers/bbnow_old.hpp"
|
||||
#include "bbnow_pub.hpp"
|
||||
#include "esp_now.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_mac.h"
|
||||
@@ -150,7 +151,7 @@ static void bbnow_handle_received(const BBNowQueueItem& item) {
|
||||
}
|
||||
ESP_LOGI(TAG, "received PUB packet: type=%d", static_cast<int>(pkt->packet_type));
|
||||
if (pkt->packet_type == BBNowPubPacketType::DISCOVERY) {
|
||||
ESP_LOGI(TAG, " DISCOVERY expantion=%d", static_cast<int>(pkt->packet_data.discovery.expantion_type));
|
||||
ESP_LOGI(TAG, " DISCOVERY expantion=%d", static_cast<int>(std::get<BlkBoxNowPubDiscoveryData>(pkt->packet_data).expantion_type));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#include "blk_box_drivers/radio.hpp"
|
||||
#include "blk_box_drivers/bbnow.hpp"
|
||||
#include "blk_box_drivers/bbnow_old.hpp"
|
||||
#include "esp_wifi.h"
|
||||
|
||||
void init_radio() {
|
||||
|
||||
@@ -1,3 +1,36 @@
|
||||
#include "blk_box_drivers/wifi.hpp"
|
||||
|
||||
#include "esp_event.h"
|
||||
#include "esp_netif.h"
|
||||
#include "esp_wifi.h"
|
||||
|
||||
esp_err_t Wifi::init()
|
||||
{
|
||||
esp_err_t err;
|
||||
|
||||
err = esp_netif_init();
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
err = esp_event_loop_create_default();
|
||||
if (err != ESP_OK && err != ESP_ERR_INVALID_STATE) {
|
||||
return err;
|
||||
}
|
||||
|
||||
esp_netif_create_default_wifi_sta();
|
||||
|
||||
wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT();
|
||||
|
||||
err = esp_wifi_init(&config);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
err = esp_wifi_set_mode(WIFI_MODE_STA);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
return esp_wifi_start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user