2023-11-09 09:37:45 +00:00
|
|
|
from queues import DATA_QUEUE_TRANSMIT
|
2023-11-09 14:48:10 +00:00
|
|
|
import structlog
|
|
|
|
log = structlog.get_logger("COMMANDS")
|
2023-11-09 09:37:45 +00:00
|
|
|
|
2023-11-09 14:48:10 +00:00
|
|
|
def cqcqcq(self):
|
2023-11-09 12:52:27 +00:00
|
|
|
DATA_QUEUE_TRANSMIT.put(["CQ"])
|
2023-11-09 14:48:10 +00:00
|
|
|
|
|
|
|
def ping_ping(data):
|
|
|
|
try:
|
|
|
|
dxcallsign = data["dxcallsign"]
|
|
|
|
if not str(dxcallsign).strip():
|
|
|
|
return
|
|
|
|
DATA_QUEUE_TRANSMIT.put(["PING", None, dxcallsign])
|
|
|
|
|
|
|
|
except Exception as err:
|
|
|
|
log.warning(
|
|
|
|
"[CMD] PING command execution error", e=err, command=data
|
|
|
|
)
|
|
|
|
|
|
|
|
def beacon(data):
|
|
|
|
beacon_state = False
|
|
|
|
if data['enabled'] in ['True']:
|
|
|
|
beacon_state = True
|
|
|
|
#Beacon.beacon_state = beacon_state
|
|
|
|
log.info(
|
|
|
|
"[CMD] Changing beacon state", state=beacon_state
|
|
|
|
)
|
|
|
|
DATA_QUEUE_TRANSMIT.put(["BEACON", 300, beacon_state])
|