kopia lustrzana https://github.com/sh123/esp32_loraprs
Update readme
rodzic
1df9f4f87a
commit
daa2b95c10
|
@ -106,6 +106,10 @@ Install via libraries:
|
|||
- `cfg.EnableBeacon` set to `true` to enable periodic beacons specified in `cfg.AprsRawBeacon` with period specified in `cfg.AprsRawBeaconPeriodMinutes` into RF and APRS-IS if `cfg.EnableRfToIs` is enabled
|
||||
- `cfg.LoraUseIsr` set to `true` to enable LoRa incoming packet handling using interrupts in continous RX mode suitable for speech data, otherwise set to `false` for single packet polling mode
|
||||
|
||||
# BLE Usage (iOS)
|
||||
- iOS does not support serial over Bluetooth and requires BLE support, this enables APRS applications such as official aprs.fi to work with the modem
|
||||
- to enable BLE support set `cfg.BtEnableBle` to `true`
|
||||
|
||||
# Protocol Compatibility
|
||||
- Make sure LoRa sync word and other LoRa parameters match
|
||||
- **Client** should be interoperable with other clients, which transmit raw text APRS messages if bluetooth client sends them in this format to the modem
|
||||
|
|
|
@ -57,7 +57,7 @@ BLESerial::~BLESerial(void)
|
|||
|
||||
// Begin bluetooth serial
|
||||
|
||||
bool BLESerial::begin(char* localName)
|
||||
bool BLESerial::begin(const char* localName)
|
||||
{
|
||||
// Create the BLE Device
|
||||
BLEDevice::init(localName);
|
||||
|
|
|
@ -33,7 +33,7 @@ class BLESerial: public Stream
|
|||
BLESerial(void);
|
||||
~BLESerial(void);
|
||||
|
||||
bool begin(char* localName="loraprs");
|
||||
bool begin(const char* localName);
|
||||
int available(void);
|
||||
int peek(void);
|
||||
bool connected(void);
|
||||
|
|
2
config.h
2
config.h
|
@ -29,7 +29,7 @@
|
|||
#define CFG_LORA_ENABLE_CRC true // set to false for speech data
|
||||
|
||||
#define CFG_BT_NAME "loraprs"
|
||||
#define CFG_USE_BLE true // set to true to use bluetooth low energy (for ios devices)
|
||||
#define CFG_USE_BLE false // set to true to use bluetooth low energy (for ios devices)
|
||||
|
||||
#define CFG_APRS_LOGIN "NOCALL-10"
|
||||
#define CFG_APRS_PASS "12345"
|
||||
|
|
|
@ -47,7 +47,7 @@ void initializeConfig(LoraPrs::Config &cfg) {
|
|||
|
||||
// bluetooth device name
|
||||
cfg.BtName = CFG_BT_NAME;
|
||||
cfg.useBLE = CFG_USE_BLE;
|
||||
cfg.BtEnableBle = CFG_USE_BLE;
|
||||
|
||||
// server mode wifi paramaters
|
||||
cfg.WifiSsid = CFG_WIFI_SSID;
|
||||
|
|
|
@ -26,7 +26,8 @@ struct Config
|
|||
|
||||
// bluetooth
|
||||
String BtName; // bluetooth device name for the client, set to empty string to disable bluetooth in server mode
|
||||
bool useBLE; // bluetooth device presents as BLE rather than serial bluetooth e.g. for iOS devices
|
||||
bool BtEnableBle; // bluetooth device presents as BLE rather than serial bluetooth e.g. for iOS devices
|
||||
|
||||
// wifi
|
||||
String WifiSsid; // wifi access point name
|
||||
String WifiKey; // wifi access point key
|
||||
|
|
|
@ -141,9 +141,9 @@ void Service::setupLora(long loraFreq, long bw, int sf, int cr, int pwr, int syn
|
|||
|
||||
void Service::setupBt(const String &btName)
|
||||
{
|
||||
if (config_.useBLE) {
|
||||
if (config_.BtEnableBle) {
|
||||
Serial.print("BLE init " + btName + "...");
|
||||
if (serialBLE_.begin()) {
|
||||
if (serialBLE_.begin(btName.c_str())) {
|
||||
Serial.println("ok");
|
||||
}
|
||||
else {
|
||||
|
@ -401,7 +401,7 @@ void Service::onRigTxEnd()
|
|||
|
||||
void Service::onSerialTx(byte b)
|
||||
{
|
||||
if (config_.useBLE) {
|
||||
if (config_.BtEnableBle) {
|
||||
serialBLE_.write(b);
|
||||
}
|
||||
else {
|
||||
|
@ -411,7 +411,7 @@ void Service::onSerialTx(byte b)
|
|||
|
||||
bool Service::onSerialRxHasData()
|
||||
{
|
||||
if (config_.useBLE) {
|
||||
if (config_.BtEnableBle) {
|
||||
return serialBLE_.available();
|
||||
}
|
||||
else {
|
||||
|
@ -421,7 +421,7 @@ bool Service::onSerialRxHasData()
|
|||
|
||||
bool Service::onSerialRx(byte *b)
|
||||
{
|
||||
if (config_.useBLE) {
|
||||
if (config_.BtEnableBle) {
|
||||
int rxResult = serialBLE_.read();
|
||||
if (rxResult == -1) {
|
||||
return false;
|
||||
|
|
Ładowanie…
Reference in New Issue