From 62fe30213bd743a62eb198011a44c18fa56584c5 Mon Sep 17 00:00:00 2001 From: Joerg Schultze-Lutter Date: Tue, 21 Dec 2021 11:18:23 +0100 Subject: [PATCH] Upgrade to aprslib 0.7.0 --- .gitignore | 1 + README.md | 4 ++-- dependencies.txt => requirements.txt | 2 +- src/AprsLibrary.py | 14 +++++++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) rename dependencies.txt => requirements.txt (50%) diff --git a/.gitignore b/.gitignore index 01d33ab..1394c26 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,4 @@ log.html output.xml report.html .DS_Store +.idea diff --git a/README.md b/README.md index 0e2fb34..49b01b3 100644 --- a/README.md +++ b/README.md @@ -96,11 +96,11 @@ My first test case - When you need to define strings which contain multiple spaces, escaping these strings won't work as Robot will try to interpret these as list values. You need to construct them as Robot-conform strings with ``${SPACE}``. Example: ``ABCD${SPACE}${SPACE}${SPACE}${SPACE}EFGH`` results in ``ABCD____EFGH`` (four blanks between the variable's value). -- Apart from minor helper methods for the connection setup and field check/retrieval, this Robot Framework library does not offer any additional keywords for exchanging data in a proper way. (Almost) every feature that the original [aprslib](https://github.com/rossengeorgiev/aprs-python) offers is supported by this Robot library - nothing more and nothing less. As aprslib does not [support the more recent replyack scheme](http://www.aprs.org/aprs11/replyacks.txt), this keyword library will also not decode these messages in a proper way and you may need to decode them manually. I was thinking about introducing a workaround to this library (the one that [mpad](https://github.com/joergschultzelutter/mpad) uses), but in the end this decoding should rather be done by aprslib itself. +- Apart from minor helper methods for the connection setup and field check/retrieval, this Robot Framework library does not offer any additional keywords for exchanging data in a proper way. (Almost) every feature that the original [aprslib](https://github.com/rossengeorgiev/aprs-python) offers is supported by this Robot library - nothing more and nothing less. - The current version of the Robot Framework does not support WHILE loops (planned for RF 5.x) which would permit the Robot script to run endlessly (when needed). Loops can only be triggered with the help of finite FOR loops. This should be enough for testing but unless a real WHILE loop is made available for the Robot Framework, you can't build an APRS messaging server which will not terminate after a certain point in time. -- The ```Receive APRS Packet``` keyword has no timeout which means that it will only return back from this code if it has found a message that is to be returned back to Robot. If you depend on timeout, you may need to amend your APRS-IS filter settings and handle the filter process in your code. +- The ```Receive APRS Packet``` keyword has no timeout which means that it will only return from its code if it has found a message that is to be returned to Robot. If you depend on timeout, you may need to amend your APRS-IS filter settings and handle the filter process in your code. - The keyword ``Send APRS Packet`` will __not__ check whether the APRS-IS connection has been establised read-only (``N0CALL`` call sign) or read-write. diff --git a/dependencies.txt b/requirements.txt similarity index 50% rename from dependencies.txt rename to requirements.txt index cde947d..b0b86c5 100644 --- a/dependencies.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -aprs-python>=0.6.47 +aprslib>=0.7.0 robotframework>=3.2 diff --git a/src/AprsLibrary.py b/src/AprsLibrary.py index b7eb9de..4bd3536 100644 --- a/src/AprsLibrary.py +++ b/src/AprsLibrary.py @@ -30,7 +30,7 @@ ) logger = logging.getLogger(__name__) -__version__ = "0.5.0" +__version__ = "0.6.0" __author__ = "Joerg Schultze-Lutter" @@ -454,6 +454,12 @@ def get_msgno(self, aprs_packet): aprs_packet=aprs_packet, field_name="msgNo" ) + @keyword("Get Ack Message Number Value from APRS Packet") + def get_ackmsgno(self, aprs_packet): + return self.get_value_from_aprs_packet( + aprs_packet=aprs_packet, field_name="ackMsgNo" + ) + # This is the core function which will extract the requested # field name from our packet(s). The packet can either be in # raw format (str or bytes) OR decoded. If you try to access @@ -542,6 +548,12 @@ def check_packet_msgno(self, aprs_packet): aprs_packet=aprs_packet, field_name="msgNo" ) + @keyword("Check If APRS Packet Contains Ack Message Number") + def check_packet_ackmsgno(self, aprs_packet): + return self.check_if_field_exists_in_packet( + aprs_packet=aprs_packet, field_name="ackMsgNo" + ) + # This is the core function which will check if a field exists # in our packet(s). The packet can either be in # raw format (str or bytes) OR decoded.