base-aprs-client 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- base_aprs_client/__init__.py +55 -0
- base_aprs_client/aio.py +730 -0
- base_aprs_client/client.py +482 -0
- base_aprs_client/common.py +99 -0
- base_aprs_client/py.typed +0 -0
- base_aprs_client/simulator.py +190 -0
- base_aprs_client/store.py +321 -0
- base_aprs_client-0.0.1.dist-info/METADATA +193 -0
- base_aprs_client-0.0.1.dist-info/RECORD +12 -0
- base_aprs_client-0.0.1.dist-info/WHEEL +5 -0
- base_aprs_client-0.0.1.dist-info/licenses/LICENSE +21 -0
- base_aprs_client-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""APRS station behaviour for applications.
|
|
2
|
+
|
|
3
|
+
``AsyncClient`` sends messages with acknowledgement and timer-driven retry,
|
|
4
|
+
acks incoming messages addressed to ``mycall`` (once each, with reply-ack
|
|
5
|
+
support), sends status and position reports, reconnects when the transport
|
|
6
|
+
drops, and can log frames and run a delayed send queue with ``PacketStore``.
|
|
7
|
+
``Client`` is its synchronous wrapper. ``APRSISSimulator`` is a local
|
|
8
|
+
APRS-IS-like relay for testing without a radio.
|
|
9
|
+
|
|
10
|
+
Two stations talking through the simulator. Each ``Client`` runs on a
|
|
11
|
+
background thread, so N0CALL-2 acks the message without being asked:
|
|
12
|
+
|
|
13
|
+
>>> from base_aprs_client import APRSISSimulator, Client
|
|
14
|
+
>>> with APRSISSimulator() as sim:
|
|
15
|
+
... with (
|
|
16
|
+
... Client.aprsis("N0CALL-1", sim.host, sim.port) as alice,
|
|
17
|
+
... Client.aprsis("N0CALL-2", sim.host, sim.port) as bob,
|
|
18
|
+
... ):
|
|
19
|
+
... sim.wait_for_clients(2)
|
|
20
|
+
... ack = alice.send_message("N0CALL-2", "see you at the net", ack=True)
|
|
21
|
+
... print("acked by", ack.result(timeout=10).source)
|
|
22
|
+
... (frame,) = bob.read(min_frames=1)
|
|
23
|
+
... print(frame.source, "says", frame.info.text.decode())
|
|
24
|
+
acked by N0CALL-2
|
|
25
|
+
N0CALL-1 says see you at the net
|
|
26
|
+
|
|
27
|
+
``Client.aprsis``, ``Client.kiss_tcp`` and ``Client.kiss_serial`` (and the
|
|
28
|
+
same constructors on ``AsyncClient``) connect to APRS-IS or a KISS TNC.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
from importlib.metadata import version
|
|
32
|
+
|
|
33
|
+
from .aio import AsyncClient, NotConnected, ReconnectPolicy
|
|
34
|
+
from .client import Client, MessageAckFuture
|
|
35
|
+
from .common import MaximumRetryExceeded, MessageRejected, OverflowDisposition
|
|
36
|
+
from .simulator import APRSISSimulator
|
|
37
|
+
|
|
38
|
+
__author__ = "Masen Furer KF7HVM <kf7hvm@0x26.net>"
|
|
39
|
+
__copyright__ = "Copyright 2022 Masen Furer and Contributors"
|
|
40
|
+
__license__ = "Apache License, Version 2.0"
|
|
41
|
+
__distribution__ = "base-aprs-client"
|
|
42
|
+
__version__ = version(__distribution__)
|
|
43
|
+
__all__ = [
|
|
44
|
+
"APRSISSimulator",
|
|
45
|
+
"AsyncClient",
|
|
46
|
+
"Client",
|
|
47
|
+
"MaximumRetryExceeded",
|
|
48
|
+
"MessageAckFuture",
|
|
49
|
+
"MessageRejected",
|
|
50
|
+
"NotConnected",
|
|
51
|
+
"OverflowDisposition",
|
|
52
|
+
"ReconnectPolicy",
|
|
53
|
+
"__distribution__",
|
|
54
|
+
"__version__",
|
|
55
|
+
]
|