kopia lustrzana https://github.com/sh123/esp32_loraprs
Disable bluetooth if USB mode is active
rodzic
c25ec7d816
commit
635df470aa
5
config.h
5
config.h
|
@ -48,11 +48,6 @@
|
|||
|
||||
// USB
|
||||
#define CFG_USB_SERIAL_ENABLE false // true - enable communication over USB Serial
|
||||
#if CFG_USB_SERIAL_ENABLE == true
|
||||
#define DEBUGLOG_DISABLE_LOG // logging must be disabled when using USB mode
|
||||
#undef CFG_BT_NAME
|
||||
#define CFG_BT_NAME ""
|
||||
#endif
|
||||
|
||||
// KISS protocol options
|
||||
#define CFG_KISS_EXTENSIONS false // true - enable modem control from application with KISS commands
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <arduino-timer.h>
|
||||
#include "WiFi.h"
|
||||
#include "loraprs_service.h"
|
||||
|
||||
#if __has_include("/tmp/esp32_loraprs_config.h")
|
||||
#pragma message("Using external config")
|
||||
|
@ -15,8 +16,6 @@
|
|||
#pragma message("Configured for server mode")
|
||||
#endif
|
||||
|
||||
#include "loraprs_service.h"
|
||||
|
||||
void initializeConfig(LoraPrs::Config &cfg) {
|
||||
|
||||
// client/server mode switch
|
||||
|
|
|
@ -64,7 +64,7 @@ void Service::setup(const Config &conf)
|
|||
setupWifi(config_.WifiSsid, config_.WifiKey);
|
||||
}
|
||||
|
||||
if (needsBt() || config_.BtName.length() > 0) {
|
||||
if (needsBt()) {
|
||||
setupBt(config_.BtName);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,13 +54,13 @@ private:
|
|||
void loraReceive(int packetSize);
|
||||
#endif
|
||||
void onAprsisDataAvailable();
|
||||
|
||||
|
||||
void sendSignalReportEvent(int rssi, float snr);
|
||||
void sendPeriodicBeacon();
|
||||
void sendToAprsis(const String &aprsMessage);
|
||||
bool sendAX25ToLora(const AX25::Payload &payload);
|
||||
void processIncomingRawPacketAsServer(const byte *packet, int packetLength);
|
||||
|
||||
|
||||
inline bool needsAprsis() const {
|
||||
return !config_.IsClientMode // only in server mode
|
||||
&& (config_.EnableRfToIs || config_.EnableIsToRf) // rx/tx igate enabled
|
||||
|
@ -70,8 +70,14 @@ private:
|
|||
return needsAprsis() // aprsis is needed
|
||||
|| config_.KissEnableTcpIp; // or kiss over tcp ip is enabled
|
||||
}
|
||||
inline bool needsBt() const { return config_.IsClientMode; }
|
||||
inline bool needsBeacon() const { return !config_.IsClientMode && config_.EnableBeacon; }
|
||||
inline bool needsBt() const {
|
||||
return (config_.IsClientMode || config_.BtName.length() > 0) // client mode or name must be specified
|
||||
&& !config_.UsbSerialEnable; // inactive in usb serial mode
|
||||
}
|
||||
inline bool needsBeacon() const {
|
||||
return !config_.IsClientMode // beaconing only in apris gate / server mode
|
||||
&& config_.EnableBeacon; // beacon must be explicitly enabled
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool onRigTxBegin();
|
||||
|
|
Ładowanie…
Reference in New Issue