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
|
// USB
|
||||||
#define CFG_USB_SERIAL_ENABLE false // true - enable communication over USB Serial
|
#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
|
// KISS protocol options
|
||||||
#define CFG_KISS_EXTENSIONS false // true - enable modem control from application with KISS commands
|
#define CFG_KISS_EXTENSIONS false // true - enable modem control from application with KISS commands
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include <arduino-timer.h>
|
#include <arduino-timer.h>
|
||||||
#include "WiFi.h"
|
#include "WiFi.h"
|
||||||
|
#include "loraprs_service.h"
|
||||||
|
|
||||||
#if __has_include("/tmp/esp32_loraprs_config.h")
|
#if __has_include("/tmp/esp32_loraprs_config.h")
|
||||||
#pragma message("Using external config")
|
#pragma message("Using external config")
|
||||||
|
@ -15,8 +16,6 @@
|
||||||
#pragma message("Configured for server mode")
|
#pragma message("Configured for server mode")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "loraprs_service.h"
|
|
||||||
|
|
||||||
void initializeConfig(LoraPrs::Config &cfg) {
|
void initializeConfig(LoraPrs::Config &cfg) {
|
||||||
|
|
||||||
// client/server mode switch
|
// client/server mode switch
|
||||||
|
|
|
@ -64,7 +64,7 @@ void Service::setup(const Config &conf)
|
||||||
setupWifi(config_.WifiSsid, config_.WifiKey);
|
setupWifi(config_.WifiSsid, config_.WifiKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needsBt() || config_.BtName.length() > 0) {
|
if (needsBt()) {
|
||||||
setupBt(config_.BtName);
|
setupBt(config_.BtName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,14 @@ private:
|
||||||
return needsAprsis() // aprsis is needed
|
return needsAprsis() // aprsis is needed
|
||||||
|| config_.KissEnableTcpIp; // or kiss over tcp ip is enabled
|
|| config_.KissEnableTcpIp; // or kiss over tcp ip is enabled
|
||||||
}
|
}
|
||||||
inline bool needsBt() const { return config_.IsClientMode; }
|
inline bool needsBt() const {
|
||||||
inline bool needsBeacon() const { return !config_.IsClientMode && config_.EnableBeacon; }
|
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:
|
protected:
|
||||||
virtual bool onRigTxBegin();
|
virtual bool onRigTxBegin();
|
||||||
|
|
Ładowanie…
Reference in New Issue