diff --git a/data/tracker_config.json b/data/tracker_config.json index 7531787..d2b520b 100644 --- a/data/tracker_config.json +++ b/data/tracker_config.json @@ -1,7 +1,7 @@ { "beacons": [ { - "callsign": "CD2RXU-7", + "callsign": "NOCALL-7", "symbol": "[", "comment": "", "smart_beacon": { @@ -17,7 +17,7 @@ } }, { - "callsign": "CD2RXU-7", + "callsign": "NOCALL-7", "symbol": ">", "comment": "", "smart_beacon": { @@ -33,7 +33,7 @@ } }, { - "callsign": "CD2RXU-7", + "callsign": "NOCALL-7", "symbol": "j", "comment": "", "smart_beacon": { diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 6381fea..e495207 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -1,6 +1,6 @@ -//#ifdef ESP32 -//#include -//#endif +#ifdef ESP32 +#include +#endif #include #include #include @@ -18,12 +18,11 @@ #include "lora_utils.h" #include "msg_utils.h" #include "gps_utils.h" -#include "ble_utils.h" #include "display.h" #include "SPIFFS.h" #include "utils.h" -#define VERSION "2023.07.01" +#define VERSION "2023.07.12" Configuration Config; PowerManagement powerManagement; @@ -87,7 +86,6 @@ void setup() { logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "WiFi and BT controller stopped"); esp_bt_controller_disable(); logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "BT controller disabled"); - //BLE_Utils::setup(); userButton.attachClick(BUTTON_Utils::singlePress); userButton.attachLongPressStart(BUTTON_Utils::longPress); diff --git a/src/ble_utils.cpp b/src/ble_utils.cpp deleted file mode 100644 index bb7d19c..0000000 --- a/src/ble_utils.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "ble_utils.h" -#include -#include "lora_utils.h" - -#define SERVICE_UUID "0000180A-0000-1000-8000-00805F9B34FB" -#define CHARACTERISTIC_UUID "00002A29-0000-1000-8000-00805F9B34FB" - -extern NimBLECharacteristic* pCharacteristic; - -class MyCallbacks : public NimBLECharacteristicCallbacks { - void onWrite(NimBLECharacteristic* pChar) { - std::string receivedData = pChar->getValue(); // Read the data from the characteristic - //Serial.print("Received message: "); Serial.println(receivedData.c_str()); - String receivedString = ""; - for (int i=0; isetValue("hola tambien"); - pCharacteristic->notify(); - } else if (receivedString=="/send message") { - Serial.println("Send Message To..."); - pCharacteristic->setValue("Send Message To..."); - pCharacteristic->notify(); - } else if (receivedString=="CD2RXU-7") { - Serial.println("Sending message to CD2RXU-7..."); - pCharacteristic->setValue("Sending message to CD2RXU-7..."); - pCharacteristic->notify(); - } else if (receivedString=="test") { - Serial.println("Sending Test message to CD2RXU-15..."); - LoRa_Utils::sendNewPacket("CD2RXU-7>APLRT1,WIDE1-1::CD2RXU-15:wrl"); - pCharacteristic->setValue("Sending Test message to CD2RXU-15..."); - pCharacteristic->notify(); - } - } -}; - - -namespace BLE_Utils { - -void setup() { - NimBLEDevice::init("Tracker BLE Test"); - NimBLEServer* pServer = NimBLEDevice::createServer(); - NimBLEService* pService = pServer->createService(SERVICE_UUID); - pCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::NOTIFY); - - pCharacteristic->setCallbacks(new MyCallbacks()); - pService->start(); - - NimBLEAdvertising* pAdvertising = NimBLEDevice::getAdvertising(); - pAdvertising->addServiceUUID(SERVICE_UUID); - pAdvertising->start(); - - Serial.println("Waiting for BLE central to connect..."); -} - -} diff --git a/src/ble_utils.h b/src/ble_utils.h deleted file mode 100644 index 0436587..0000000 --- a/src/ble_utils.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef BLE_UTILS_H_ -#define BLE_UTILS_H_ - -#include - -namespace BLE_Utils { - -void setup(); - -} - -#endif \ No newline at end of file