mirror of
https://github.com/craigerl/aprsd.git
synced 2024-12-22 01:20:59 -05:00
Added missing packet types in listen command
This patch adds some missing packet objects for the listen command. Also moves the keepalive startup a little later
This commit is contained in:
parent
9858955d34
commit
f450238348
@ -17,6 +17,7 @@ from rich.console import Console
|
|||||||
import aprsd
|
import aprsd
|
||||||
from aprsd import cli_helper, client, packets, plugin, stats, threads
|
from aprsd import cli_helper, client, packets, plugin, stats, threads
|
||||||
from aprsd.main import cli
|
from aprsd.main import cli
|
||||||
|
from aprsd.packets import log as packet_log
|
||||||
from aprsd.rpc import server as rpc_server
|
from aprsd.rpc import server as rpc_server
|
||||||
from aprsd.threads import rx
|
from aprsd.threads import rx
|
||||||
|
|
||||||
@ -53,27 +54,31 @@ class APRSDListenThread(rx.APRSDRXThread):
|
|||||||
filters = {
|
filters = {
|
||||||
packets.Packet.__name__: packets.Packet,
|
packets.Packet.__name__: packets.Packet,
|
||||||
packets.AckPacket.__name__: packets.AckPacket,
|
packets.AckPacket.__name__: packets.AckPacket,
|
||||||
|
packets.BeaconPacket.__name__: packets.BeaconPacket,
|
||||||
packets.GPSPacket.__name__: packets.GPSPacket,
|
packets.GPSPacket.__name__: packets.GPSPacket,
|
||||||
packets.MessagePacket.__name__: packets.MessagePacket,
|
packets.MessagePacket.__name__: packets.MessagePacket,
|
||||||
packets.MicEPacket.__name__: packets.MicEPacket,
|
packets.MicEPacket.__name__: packets.MicEPacket,
|
||||||
|
packets.ObjectPacket.__name__: packets.ObjectPacket,
|
||||||
|
packets.StatusPacket.__name__: packets.StatusPacket,
|
||||||
|
packets.ThirdPartyPacket.__name__: packets.ThirdPartyPacket,
|
||||||
packets.WeatherPacket.__name__: packets.WeatherPacket,
|
packets.WeatherPacket.__name__: packets.WeatherPacket,
|
||||||
|
packets.UnknownPacket.__name__: packets.UnknownPacket,
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.packet_filter:
|
if self.packet_filter:
|
||||||
filter_class = filters[self.packet_filter]
|
filter_class = filters[self.packet_filter]
|
||||||
if isinstance(packet, filter_class):
|
if isinstance(packet, filter_class):
|
||||||
packet.log(header="RX")
|
packet_log.log(packet)
|
||||||
if self.plugin_manager:
|
if self.plugin_manager:
|
||||||
# Don't do anything with the reply
|
# Don't do anything with the reply
|
||||||
# This is the listen only command.
|
# This is the listen only command.
|
||||||
self.plugin_manager.run(packet)
|
self.plugin_manager.run(packet)
|
||||||
else:
|
else:
|
||||||
|
packet_log.log(packet)
|
||||||
if self.plugin_manager:
|
if self.plugin_manager:
|
||||||
# Don't do anything with the reply.
|
# Don't do anything with the reply.
|
||||||
# This is the listen only command.
|
# This is the listen only command.
|
||||||
self.plugin_manager.run(packet)
|
self.plugin_manager.run(packet)
|
||||||
else:
|
|
||||||
packet.log(header="RX")
|
|
||||||
|
|
||||||
packets.PacketList().rx(packet)
|
packets.PacketList().rx(packet)
|
||||||
|
|
||||||
@ -96,11 +101,16 @@ class APRSDListenThread(rx.APRSDRXThread):
|
|||||||
"--packet-filter",
|
"--packet-filter",
|
||||||
type=click.Choice(
|
type=click.Choice(
|
||||||
[
|
[
|
||||||
packets.Packet.__name__,
|
|
||||||
packets.AckPacket.__name__,
|
packets.AckPacket.__name__,
|
||||||
|
packets.BeaconPacket.__name__,
|
||||||
packets.GPSPacket.__name__,
|
packets.GPSPacket.__name__,
|
||||||
packets.MicEPacket.__name__,
|
packets.MicEPacket.__name__,
|
||||||
packets.MessagePacket.__name__,
|
packets.MessagePacket.__name__,
|
||||||
|
packets.ObjectPacket.__name__,
|
||||||
|
packets.RejectPacket.__name__,
|
||||||
|
packets.StatusPacket.__name__,
|
||||||
|
packets.ThirdPartyPacket.__name__,
|
||||||
|
packets.UnknownPacket.__name__,
|
||||||
packets.WeatherPacket.__name__,
|
packets.WeatherPacket.__name__,
|
||||||
],
|
],
|
||||||
case_sensitive=False,
|
case_sensitive=False,
|
||||||
@ -180,7 +190,7 @@ def listen(
|
|||||||
aprs_client.set_filter(filter)
|
aprs_client.set_filter(filter)
|
||||||
|
|
||||||
keepalive = threads.KeepAliveThread()
|
keepalive = threads.KeepAliveThread()
|
||||||
keepalive.start()
|
#keepalive.start()
|
||||||
|
|
||||||
if CONF.rpc_settings.enabled:
|
if CONF.rpc_settings.enabled:
|
||||||
rpc = rpc_server.APRSDRPCThread()
|
rpc = rpc_server.APRSDRPCThread()
|
||||||
@ -205,6 +215,7 @@ def listen(
|
|||||||
)
|
)
|
||||||
LOG.debug("Start APRSDListenThread")
|
LOG.debug("Start APRSDListenThread")
|
||||||
listen_thread.start()
|
listen_thread.start()
|
||||||
|
keepalive.start()
|
||||||
LOG.debug("keepalive Join")
|
LOG.debug("keepalive Join")
|
||||||
keepalive.join()
|
keepalive.join()
|
||||||
LOG.debug("listen_thread Join")
|
LOG.debug("listen_thread Join")
|
||||||
|
Loading…
Reference in New Issue
Block a user