warnings--
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
use bleps::{ad_structure::{create_advertising_data, AdStructure, BR_EDR_NOT_SUPPORTED, LE_GENERAL_DISCOVERABLE}, attribute_server::{AttributeServer, NotificationData}, gatt, Ble, HciConnector};
|
||||
use bleps::{ad_structure::{create_advertising_data, AdStructure, BR_EDR_NOT_SUPPORTED, LE_GENERAL_DISCOVERABLE}, attribute_server::AttributeServer, gatt, Ble, HciConnector};
|
||||
use embassy_sync::channel::DynamicReceiver;
|
||||
use embassy_sync::pubsub::DynSubscriber;
|
||||
use embassy_time::Timer;
|
||||
use esp_hal::timer::AnyTimer;
|
||||
use esp_wifi::ble::controller::BleConnector;
|
||||
use log::*;
|
||||
|
||||
use crate::events::Notification;
|
||||
|
||||
pub async fn ble_task(notify: DynSubscriber<'static, Notification>, wifi_init: &esp_wifi::EspWifiController<'_>, bluetooth_device: esp_hal::peripherals::BT<'static>) {
|
||||
pub async fn ble_task(_notify: DynSubscriber<'static, Notification>, wifi_init: &esp_wifi::EspWifiController<'_>, bluetooth_device: esp_hal::peripherals::BT<'static>) {
|
||||
info!("Setting up BLE stack");
|
||||
let connector = BleConnector::new(wifi_init, bluetooth_device);
|
||||
let get_millis = || esp_hal::time::Instant::now().duration_since_epoch().as_millis();
|
||||
@@ -61,7 +60,7 @@ pub async fn ble_task(notify: DynSubscriber<'static, Notification>, wifi_init: &
|
||||
]
|
||||
}]);
|
||||
let mut rng = bleps::no_rng::NoRng;
|
||||
let mut srv = AttributeServer::new(&mut ble, &mut gatt_attributes, &mut rng);
|
||||
let mut _srv = AttributeServer::new(&mut ble, &mut gatt_attributes, &mut rng);
|
||||
|
||||
info!("BLE running!");
|
||||
// TODO: Somehow need to recreate the attributeserver after disconnecting?
|
||||
@@ -89,9 +88,9 @@ pub async fn ble_task(notify: DynSubscriber<'static, Notification>, wifi_init: &
|
||||
|
||||
// TODO: Wifi task needs to know when there is data to upload, so it only connects when needed.
|
||||
#[embassy_executor::task]
|
||||
pub async fn wireless_task(notify: DynamicReceiver<'static, Notification>, timer: AnyTimer<'static>, rng: esp_hal::peripherals::RNG<'static>, _wifi_device: esp_hal::peripherals::WIFI<'static>, bluetooth_device: esp_hal::peripherals::BT<'static>) {
|
||||
pub async fn wireless_task(_notify: DynamicReceiver<'static, Notification>, timer: AnyTimer<'static>, rng: esp_hal::peripherals::RNG<'static>, _wifi_device: esp_hal::peripherals::WIFI<'static>, _bluetooth_device: esp_hal::peripherals::BT<'static>) {
|
||||
let rng = esp_hal::rng::Rng::new(rng);
|
||||
let wifi_init =
|
||||
let _wifi_init =
|
||||
esp_wifi::init(timer, rng).expect("Failed to initialize WIFI/BLE controller");
|
||||
|
||||
//ble_task(notify, &wifi_init, bluetooth_device).await;
|
||||
|
||||
Reference in New Issue
Block a user