option to disable beep, adjust server logging
This commit is contained in:
parent
002c30ccd4
commit
61075a5e03
|
@ -1,5 +1,5 @@
|
|||
.idea
|
||||
config.yml
|
||||
server/config.yml
|
||||
.vscode
|
||||
|
||||
# ---> Python
|
||||
|
|
|
@ -95,8 +95,11 @@
|
|||
#define SERVER_PROTOCOL PROTOCOL_UDP
|
||||
#endif
|
||||
|
||||
// Custom options from this fork
|
||||
#define SERVER_ENCRYPTION_ENABLE 1
|
||||
#define CHACHA20_KEY "your encryption key here"
|
||||
#define ENABLE_BEEPING 0
|
||||
// End custom options
|
||||
|
||||
#ifndef CONFIG_MBEDTLS_CHACHAPOLY_C
|
||||
#define CONFIG_MBEDTLS_CHACHAPOLY_C y
|
||||
|
|
|
@ -175,11 +175,13 @@ void printTimeoutStats()
|
|||
|
||||
void beep(int duration)
|
||||
{
|
||||
#if ENABLE_BEEPING
|
||||
// turn on buzzer at 2000Hz frequency
|
||||
sys.buzzer(2000);
|
||||
delay(duration);
|
||||
// turn off buzzer
|
||||
sys.buzzer(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if LOG_EXT_SENSORS
|
||||
|
|
|
@ -91,12 +91,14 @@ func main() {
|
|||
if err != nil {
|
||||
rawHex := hex.EncodeToString(buf[:n])
|
||||
logger.Warnf(formatLogMsg(addr.IP.String(), dest.Address, dest.Port, fmt.Sprintf(`Error decrypting message: %s. Length: %d, Raw: "%s"`, err, len(rawHex), rawHex)))
|
||||
// Forward the raw message to the backend without bothering with decryption.
|
||||
plaintext = buf[:n]
|
||||
plaintext = buf[:n] // Forward the raw message to the backend without bothering with decryption.
|
||||
if len(plaintext) > 0 {
|
||||
logger.Warningf("Encryption failed, possibly recieved unencrypted message -- %s", plaintext)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If empty message.
|
||||
plaintext = buf[:n]
|
||||
logger.Warningln("Got unencrypted message!")
|
||||
}
|
||||
|
||||
forwardAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%d", dest.Address, dest.Port))
|
||||
|
|
Loading…
Reference in New Issue