Wykres commitów

16 Commity (cda1cb511bf2d88940e0dcea3d8e4600c0e98b32)

Autor SHA1 Wiadomość Data
Konstantin Gründger c58739705f Added telnet parser and test
Added TelnetClient

Change encoding, added connect() and disconnect()

Bugfixes
2018-03-10 09:52:52 +01:00
Konstantin Gründger fdb05074a3 Release v0.8.2 2018-01-20 13:11:57 +01:00
Konstantin Gründger 37e239fb3a Release v0.8.1 2018-01-12 19:03:47 +01:00
Konstantin Gründger c2b82817c7 Fix for fortyfour #44 2017-12-13 19:26:56 +01:00
Konstantin Gründger 382eae4ef7 Release v0.8.0 2017-10-02 19:43:06 +02:00
Anze Kolar 13cc75cf03 Allow client to do sequential connect-disconnect
With introduction of the kill switch it was impossible to restart the
consumption of the OGN messages after a .disconnect() method has been
called.

This commit resets the kill flag after .connect() has been called.

Minimal example:

```
client = AprsClient(aprs_user='testuser', aprs_filter='')
client.connect()
client.run(callback=lambda x: x, autoreconnect=True)
...
client.disconnect()
client.connect()
client.run()
```
2017-07-20 15:28:01 +02:00
Anze Kolar 182f9518a4 Add kill flag to AprsClient
When starting an AprsClient with AprsClient.run(...) the client enters
a loop without an exit condition (i.e. a while True loop).  If autoreconnect
is set to True, it is impossible to exit the aforementioned loop even if
AprsClient.disconnect() is called.

This causes problems when running the client in a thread (or as a
background service, etc.) as the process will not join nor terminate
unless explicitly shutdown with SIGKILL.

Minimal example:

```
import signal

from ogn.client import AprsClient
from ogn.parser import parse_aprs, parse_ogn_beacon, ParseError

def process_beacon(raw_message):
    print('Received message')

client = AprsClient(aprs_user='N0CALL')
signal.signal(signal.SIGTERM, lambda signo, stackno: client.disconnect())
client.connect()
client.run(callback=process_beacon, autoreconnect=True)
```

This commit fixes such issues by adding a kill flag that is raised when
calling AprsClien.disconnect() to the while conditions of both loops inside
AprsClient.run().

Note: the outermost loop could still remain a while True loop as the
exit condition is checked at the end of the loop body.
2017-07-20 11:12:04 +02:00
Konstantin Gründger d0044deb47 Release v0.7.1 2017-06-05 10:07:04 +02:00
Fabian P. Schmidt 24336cf689 Release v0.7.0 2017-06-04 07:22:39 +02:00
Fabian P. Schmidt 7565de6c16 Release v0.6.0 2016-10-21 22:11:40 +02:00
Fabian P. Schmidt 13adb3efed Release v0.5.0 2016-09-29 18:42:26 +02:00
Fabian P. Schmidt 58cceb9aa2 Release v0.4.0 2016-03-29 15:24:09 +02:00
Fabian P. Schmidt fd53e6a3df client: Add timed callback
A timed callback allows the modification of server-side filters
during runtime (the client instance provided as callback argument
includes the socket and its send function).

Since sock_file.readline() is blocking, a secure scheduling can't
be guaranteed but is likely due to regular server-sent status messages.
2016-03-25 19:11:14 +01:00
Fabian P. Schmidt be181f4791 Release v0.3.0 2016-03-18 21:57:26 +01:00
Fabian P. Schmidt a8f0e1f464 client: Import class AprsClient at package level 2016-03-08 02:46:11 +01:00
Fabian P. Schmidt abae52b165 Rename module ogn.gateway to ogn.client
Renamed also class ognGateway to AprsClient to comply with the PEP8 naming
convention and to emphasis that it is a generic aprs client, not ogn specific.
2016-03-08 02:05:50 +01:00