update battery info
This commit is contained in:
parent
ed1b44b6e9
commit
ffd6bb0794
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"beacons": [
|
"beacons": [
|
||||||
{
|
{
|
||||||
"callsign": "CD2RXU-7",
|
"callsign": "NOCALL-7",
|
||||||
"symbol": "[",
|
"symbol": "[",
|
||||||
"comment": "",
|
"comment": "",
|
||||||
"smart_beacon": {
|
"smart_beacon": {
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"callsign": "CD2RXU-7",
|
"callsign": "NOCALL-7",
|
||||||
"symbol": ">",
|
"symbol": ">",
|
||||||
"comment": "",
|
"comment": "",
|
||||||
"smart_beacon": {
|
"smart_beacon": {
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"callsign": "CD2RXU-7",
|
"callsign": "NOCALL-7",
|
||||||
"symbol": "j",
|
"symbol": "j",
|
||||||
"comment": "",
|
"comment": "",
|
||||||
"smart_beacon": {
|
"smart_beacon": {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
//#ifdef ESP32
|
#ifdef ESP32
|
||||||
//#include <esp_bt.h>
|
#include <esp_bt.h>
|
||||||
//#endif
|
#endif
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <NimBLEDevice.h>
|
#include <NimBLEDevice.h>
|
||||||
#include <OneButton.h>
|
#include <OneButton.h>
|
||||||
|
|
@ -18,12 +18,11 @@
|
||||||
#include "lora_utils.h"
|
#include "lora_utils.h"
|
||||||
#include "msg_utils.h"
|
#include "msg_utils.h"
|
||||||
#include "gps_utils.h"
|
#include "gps_utils.h"
|
||||||
#include "ble_utils.h"
|
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "SPIFFS.h"
|
#include "SPIFFS.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#define VERSION "2023.07.01"
|
#define VERSION "2023.07.12"
|
||||||
|
|
||||||
Configuration Config;
|
Configuration Config;
|
||||||
PowerManagement powerManagement;
|
PowerManagement powerManagement;
|
||||||
|
|
@ -87,7 +86,6 @@ void setup() {
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "WiFi and BT controller stopped");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "WiFi and BT controller stopped");
|
||||||
esp_bt_controller_disable();
|
esp_bt_controller_disable();
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "BT controller disabled");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "BT controller disabled");
|
||||||
//BLE_Utils::setup();
|
|
||||||
|
|
||||||
userButton.attachClick(BUTTON_Utils::singlePress);
|
userButton.attachClick(BUTTON_Utils::singlePress);
|
||||||
userButton.attachLongPressStart(BUTTON_Utils::longPress);
|
userButton.attachLongPressStart(BUTTON_Utils::longPress);
|
||||||
|
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
#include "ble_utils.h"
|
|
||||||
#include <NimBLEDevice.h>
|
|
||||||
#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; i<receivedData.length()-2;i++) {
|
|
||||||
receivedString += receivedData[i];
|
|
||||||
}
|
|
||||||
if (receivedString == "hola") {
|
|
||||||
Serial.println("hola tambien");
|
|
||||||
pCharacteristic->setValue("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...");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
#ifndef BLE_UTILS_H_
|
|
||||||
#define BLE_UTILS_H_
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
namespace BLE_Utils {
|
|
||||||
|
|
||||||
void setup();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Loading…
Reference in New Issue