From bc5aa58a15614b0226d18097f7ba8c402f3412a4 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Tue, 21 Dec 2021 11:13:53 -0800 Subject: [PATCH 01/17] update version --- setup.cfg | 2 +- src/com_server/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 668f8d9..9ad0db1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = com-server -version = 0.1b1 +version = 0.1b2 author = Jonathan Liu author_email = jonathanhliu21@gmail.com description = A simple Python library and a REST API server that interacts with COM ports diff --git a/src/com_server/__init__.py b/src/com_server/__init__.py index 2180daa..193b25a 100644 --- a/src/com_server/__init__.py +++ b/src/com_server/__init__.py @@ -21,4 +21,4 @@ from .api_builtins import Builtins -__version__ = "0.1b1" +__version__ = "0.1b2" From 4b6c4b92a2fd73f3c957b91b1d9fef3b115e9edb Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 11:35:59 -0800 Subject: [PATCH 02/17] move scripts --- examples/{ => send_back}/connection_example.py | 2 +- examples/{ => send_back}/server_example.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename examples/{ => send_back}/connection_example.py (96%) rename examples/{ => send_back}/server_example.py (100%) diff --git a/examples/connection_example.py b/examples/send_back/connection_example.py similarity index 96% rename from examples/connection_example.py rename to examples/send_back/connection_example.py index 2d81862..3dd778c 100644 --- a/examples/connection_example.py +++ b/examples/send_back/connection_example.py @@ -5,7 +5,7 @@ An example of how to use the Connection object. NOTE: the sketch located in examples/send_back needs -to be uploaded to the Arduino before running this script. +to be uploaded to an Arduino before running this script. """ import time diff --git a/examples/server_example.py b/examples/send_back/server_example.py similarity index 100% rename from examples/server_example.py rename to examples/send_back/server_example.py From 0e452e7b29e3dd81027ce675525d5228432b1a3d Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 11:36:10 -0800 Subject: [PATCH 03/17] add blink example --- examples/blink/blink.ino | 47 ++++++++++++++++++++++++++++++++++++++++ examples/blink/blink.py | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 examples/blink/blink.ino create mode 100644 examples/blink/blink.py diff --git a/examples/blink/blink.ino b/examples/blink/blink.ino new file mode 100644 index 0000000..34d301e --- /dev/null +++ b/examples/blink/blink.ino @@ -0,0 +1,47 @@ +/* +blink.ino + +This sketch reads data from the serial port, then changes the +state of the built-in LED whenever a command comes in from the +serial port. The baud rate for this is 115200. + +When it reads "s", then it leaves it on solid. +When it reads "b", then it blinks the LED. +When it reads "o", then it turns the LED off. + +It shows how you can write data to the Arduino using +com_server. + +Copyright 2021 (c) Jonathan Liu +Code is licensed under MIT license. +*/ + +int curstate = 0; // 0 = off, 1 = blink, 2 = solid on + +void setup(){ + Serial.begin(115200); + + pinMode(LED_BUILTIN, OUTPUT); +} + +void loop(){ + if (Serial.available()){ + String s = Serial.readStringUntil('\n'); + + if (s == "s") + curstate = 2; + else if (s == "b") + curstate = 1; + else + curstate = 0; + } + + if (curstate == 0) { + digitalWrite(LED_BUILTIN, LOW); + } else if (curstate == 2) { + digitalWrite(LED_BUILTIN, HIGH); + } else { + // blink every second so cycle = 2 seconds + digitalWrite(LED_BUILTIN, ((millis() / 1000) % 2 == 0)); + } +} diff --git a/examples/blink/blink.py b/examples/blink/blink.py new file mode 100644 index 0000000..7ec09fe --- /dev/null +++ b/examples/blink/blink.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +An example of writing data to an Arduino. + +This sketch will ask for an input, and the +built-in LED on the Arduino should turn on, +blink, or turn off based on different inputs. + +NOTE: The sketch located in examples/blink must +be uploaded to an Arduino before running this script. +""" + +import time + +from com_server import Connection + +# make the Connection object; make send_interval 0.1 seconds because not sending large data +conn = Connection(baud=115200, port="/dev/ttyUSB0", send_interval=0.1) +# conn = Connection(baud=115200, port="/dev/ttyUSB...", send_interval=0.1) # if Linux; can be "/dev/ttyACM..." +# conn = Connection(baud=115200, port="/dev/cu.usbserial...", send_interval=0.1) +# conn = Connection(baud=115200, port="COM...", send_interval=0.1) # if Windows + +with conn: + # use a context manager, which will connect and disconnect + # automatically when entering and exiting. + + while conn.connected: + # continue running as long as there is a connection established + + cmd = input("Enter LED state: (s)olid, (b)link, (o)ff, or (e)xit: ") + + if cmd == "e" or cmd == "exit": + break + elif cmd == "s" or cmd == "solid": + conn.send("s", ending='\n') + elif cmd == "b" or cmd == "blink": + conn.send("b", ending='\n') + elif cmd == "o" or cmd == "off": + conn.send("o", ending='\n') + else: + print("Command not recognized; please try again.") + + # Recommended to include a delay when using connection + # object in a loop + time.sleep(0.01) From 3ce18d4f7789248853ddfcf9d30f06297a8d14f9 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 11:36:22 -0800 Subject: [PATCH 04/17] add example README --- examples/README.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/README.txt diff --git a/examples/README.txt b/examples/README.txt new file mode 100644 index 0000000..a6cb6c9 --- /dev/null +++ b/examples/README.txt @@ -0,0 +1,9 @@ +Examples of COM-Server: + +NOTE: You need an Arduino, and you have to upload the Arduino sketches provided under each directory before running the scripts in that directory. + +blink - An simple example of sending data to the serial port. It allows you to manipulate the LED on the Arduino from the command line. +Upload the blink.ino sketch, then run the python script. + +send_back - The sketch tells the Arduino to read the data from the serial port until a newline character, then it will send that data back through the serial port. +Upload the send_back.ino sketch, then run each python script. Press ^C (Control-C) to exit the program. Read the files to see what output is expected. From dc8bb5b558cd5a1ef2475753d8dfd826910da6d7 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 13:11:14 -0800 Subject: [PATCH 05/17] add mac comment --- examples/blink/blink.py | 4 ++-- examples/send_back/connection_example.py | 4 ++-- examples/send_back/server_example.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/blink/blink.py b/examples/blink/blink.py index 7ec09fe..2aa2baa 100644 --- a/examples/blink/blink.py +++ b/examples/blink/blink.py @@ -17,9 +17,9 @@ from com_server import Connection # make the Connection object; make send_interval 0.1 seconds because not sending large data -conn = Connection(baud=115200, port="/dev/ttyUSB0", send_interval=0.1) +conn = Connection(baud=115200, port="/dev/ttyUSB0", send_interval=0.1) # if Linux # conn = Connection(baud=115200, port="/dev/ttyUSB...", send_interval=0.1) # if Linux; can be "/dev/ttyACM..." -# conn = Connection(baud=115200, port="/dev/cu.usbserial...", send_interval=0.1) +# conn = Connection(baud=115200, port="/dev/cu.usbserial...", send_interval=0.1) # if Mac # conn = Connection(baud=115200, port="COM...", send_interval=0.1) # if Windows with conn: diff --git a/examples/send_back/connection_example.py b/examples/send_back/connection_example.py index 3dd778c..40c91fc 100644 --- a/examples/send_back/connection_example.py +++ b/examples/send_back/connection_example.py @@ -13,9 +13,9 @@ from com_server import Connection # make the Connection object -conn = Connection(baud=115200, port="/dev/ttyUSB0") +conn = Connection(baud=115200, port="/dev/ttyUSB0") # if Linux # conn = Connection(baud=115200, port="/dev/ttyUSB...") # if Linux; can be "/dev/ttyACM..." -# conn = Connection(baud=115200, port="/dev/cu.usbserial...") +# conn = Connection(baud=115200, port="/dev/cu.usbserial...") # if Mac # conn = Connection(baud=115200, port="COM...") # if Windows conn.connect() # connect to serial port diff --git a/examples/send_back/server_example.py b/examples/send_back/server_example.py index 1b39b97..3dbdde9 100644 --- a/examples/send_back/server_example.py +++ b/examples/send_back/server_example.py @@ -11,9 +11,9 @@ from com_server import Builtins, Connection, ConnectionResource, RestApiHandler # make the Connection object -conn = Connection(baud=115200, port="/dev/ttyUSB0") +conn = Connection(baud=115200, port="/dev/ttyUSB0") # if Linux # conn = Connection(baud=115200, port="/dev/ttyUSB...") # if Linux; can be "/dev/ttyACM..." -# conn = Connection(baud=115200, port="/dev/cu.usbserial...") +# conn = Connection(baud=115200, port="/dev/cu.usbserial...") # if Mac # conn = Connection(baud=115200, port="COM...") # if Windows # make the API Handler object; initialize it with the connection object From 774e044e8620f7abdde3333dd87544d3df75e6d9 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 13:24:37 -0800 Subject: [PATCH 06/17] add expected output from get request --- examples/send_back/server_example.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/send_back/server_example.py b/examples/send_back/server_example.py index 3dbdde9..5e1776e 100644 --- a/examples/send_back/server_example.py +++ b/examples/send_back/server_example.py @@ -48,6 +48,21 @@ class Hello_World_Endpoint(ConnectionResource): # for more information on Flask, see https://flask.palletsprojects.com/en/2.0.x/ def get(self): + """ + When there is a GET request, this endpoint will respond with + + { + "Hello": "World!", + "Received": [timestamp, data] + } + + The "Received" key is mapped to a value that is a list: [timestamp, data] + where timestamp is the time that the data was received from the serial port and + data is the data that came from the serial port. + + However, if there was no data received, then "Received" should be null. + """ + return { "Hello": "World!", "Received": self.conn.receive_str() From da323f525f11cf8735a701066e95cc5e3486a92a Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 14:18:11 -0800 Subject: [PATCH 07/17] add send/receive reset disclaimers --- docs/guide/getting-started.md | 2 ++ docs/guide/library-api.md | 9 ++++++--- docs/server/server-api.md | 1 + src/com_server/api_server.py | 8 ++++---- src/com_server/connection.py | 2 ++ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 9559415..2a6822a 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -112,6 +112,8 @@ print(conn.connected) On the event of a disconnect, you can call the `reconnect()` method to try to reconnect to a port provided in `__init__()`. However, it will raise a `ConnectException` if the port is already connected and this is called. +Note that disconnecting the serial device will **reset** the receive and send queues. + ```py with Connection(...) as conn: while True: diff --git a/docs/guide/library-api.md b/docs/guide/library-api.md index 5c63664..958a10f 100644 --- a/docs/guide/library-api.md +++ b/docs/guide/library-api.md @@ -624,6 +624,8 @@ continuously try to reconnect indefinitely. Will raise `ConnectException` if already connected, regardless of if `exception` is True or not. +Note that disconnecting the serial device will **reset** the receive and send queues. + Parameters: - `timeout` (float, None) (optional): Will try to reconnect for @@ -719,9 +721,10 @@ will be used to ensure that there is only one connection at a time. Note that un resource classes have to extend the custom `ConnectionResource` class from this library, not the `Resource` from `flask_restful`. -`500 Internal Server Error`s may occur with endpoints dealing with the connection -if the serial port is disconnected. Disconnections while the server is running -require restarts of the server and may change the port of the device that was previously connected. +`500 Internal Server Error`s will occur with endpoints dealing with the connection +if the serial port is disconnected. The server will spawn another thread that will +immediately try to reconnect the serial port if it is disconnected. However, note +that the receive and send queues will **reset** when the serial port is disconnected. More information on [Flask](https://flask.palletsprojects.com/en/2.0.x/) and [flask-restful](https://flask-restful.readthedocs.io/en/latest/) diff --git a/docs/server/server-api.md b/docs/server/server-api.md index 0482839..f62ee09 100644 --- a/docs/server/server-api.md +++ b/docs/server/server-api.md @@ -353,6 +353,7 @@ Notes: - When it reconnects, it calls the `reconnect()` method in the `Connection` object. It will try to reconnect to the ports given in `__init__()`, which means that if the port was changed somehow between disconnecting and reconnecting, it will not reconnect and will require restarting the server. - When running a development server, it will print out the disconnect and reconnect events to stdout. It will not when running a production server. +- Disconnecting the serial device will **reset** the receive and send queues. ## Escape characters diff --git a/src/com_server/api_server.py b/src/com_server/api_server.py index 9ced997..d4c3ef6 100644 --- a/src/com_server/api_server.py +++ b/src/com_server/api_server.py @@ -50,10 +50,10 @@ class RestApiHandler: Finally, resource classes have to extend the custom `ConnectionResource` class from this library, not the `Resource` from `flask_restful`. - `500 Internal Server Error`s may occur with endpoints dealing with the connection - if the serial port is disconnected. Disconnections while the server is running - require restarts of the server and may change the port of the device that was - previously connected. + `500 Internal Server Error`s will occur with endpoints dealing with the connection + if the serial port is disconnected. The server will spawn another thread that will + immediately try to reconnect the serial port if it is disconnected. However, note + that the receive and send queues will **reset** when the serial port is disconnected. More information on [Flask](https://flask.palletsprojects.com/en/2.0.x/) and [flask-restful](https://flask-restful.readthedocs.io/en/latest/). diff --git a/src/com_server/connection.py b/src/com_server/connection.py index 2720218..430a2a4 100644 --- a/src/com_server/connection.py +++ b/src/com_server/connection.py @@ -446,6 +446,8 @@ def reconnect(self, timeout: t.Optional[float] = None) -> bool: Will raise `ConnectException` if already connected, regardless of if `exception` is True or not. + Note that disconnecting the serial device will **reset** the receive and send queues. + Parameters: - `timeout` (float, None) (optional): Will try to reconnect for `timeout` seconds before returning. If None, then will try to reconnect From 7c2695c546cf0f6b8fc9f26a8d91bf029723f376 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 16:45:24 -0800 Subject: [PATCH 08/17] update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 873f45c..ff01397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.1 + +Previous version: 0.1b1 + +## Changes from previous version: + +- Added some more examples in the examples directory, addressing [#74](https://github.com/jonyboi396825/COM-Server/issues/74) + # 0.1 Beta Release 1 Previous version: 0.1b0 From 8c7fe3bff5e983a778727e8abf24f1b26e25a415 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 16:47:13 -0800 Subject: [PATCH 09/17] update version --- setup.cfg | 2 +- src/com_server/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 9ad0db1..6f1f4bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = com-server -version = 0.1b2 +version = 0.1 author = Jonathan Liu author_email = jonathanhliu21@gmail.com description = A simple Python library and a REST API server that interacts with COM ports diff --git a/src/com_server/__init__.py b/src/com_server/__init__.py index 193b25a..0e8de5d 100644 --- a/src/com_server/__init__.py +++ b/src/com_server/__init__.py @@ -21,4 +21,4 @@ from .api_builtins import Builtins -__version__ = "0.1b2" +__version__ = "0.1" From 828a6dc6438ce5f6a4b500897ae896cd1aa5e712 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 22 Dec 2021 22:21:23 -0800 Subject: [PATCH 10/17] add thread locks --- src/com_server/base_connection.py | 9 ++++++--- src/com_server/connection.py | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/com_server/base_connection.py b/src/com_server/base_connection.py index eed7b81..8772ac9 100644 --- a/src/com_server/base_connection.py +++ b/src/com_server/base_connection.py @@ -498,18 +498,21 @@ def _binary_search_rcv(self, target: float) -> int: When comparing, rounds to 4 digits. """ - if len(self._rcv_queue) <= 0: + with self._lock: + _tmp_q = self._rcv_queue.copy() + + if len(_tmp_q) <= 0: # not found if no size return -1 low = 0 - high = len(self._rcv_queue) + high = len(_tmp_q) while low <= high: mid = (low + high) // 2 # integer division # comparing rounding to two digits - cmp1 = round(self._rcv_queue[mid][0], 4) + cmp1 = round(_tmp_q[mid][0], 4) cmp2 = round(target, 4) if cmp1 == cmp2: diff --git a/src/com_server/connection.py b/src/com_server/connection.py index 430a2a4..53c486c 100644 --- a/src/com_server/connection.py +++ b/src/com_server/connection.py @@ -5,6 +5,7 @@ Contains implementation of connection object. """ +import copy import os import sys import time @@ -143,8 +144,11 @@ def get_all_rcv(self) -> t.List[t.Tuple[float, bytes]]: if not self.connected: raise base_connection.ConnectException("No connection established") + + with self._lock: + _rq = copy.deepcopy(self._rcv_queue) - return self._rcv_queue + return _rq def get_all_rcv_str( self, read_until: t.Optional[str] = None, strip: bool = True @@ -172,7 +176,7 @@ def get_all_rcv_str( return [ (ts, self.conv_bytes_to_str(rcv, read_until=read_until, strip=strip)) - for ts, rcv in self._rcv_queue + for ts, rcv in self.get_all_rcv() ] def receive_str( From f0eb6b93289fe8cd2b5ab74cf3f31b24a5b2b32d Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 23 Dec 2021 08:56:39 -0800 Subject: [PATCH 11/17] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff01397..18e128b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Previous version: 0.1b1 ## Changes from previous version: - Added some more examples in the examples directory, addressing [#74](https://github.com/jonyboi396825/COM-Server/issues/74) +- Fixed [#78](https://github.com/jonyboi396825/COM-Server/issues/78) by adding thread lock to binary search method for checking availability, and also a lock to the `Connection.get_all_rcv()` and `Connection.get_all_rcv_str()` methods to **deep copy** the receive queue instead of directly returning the receive queue. # 0.1 Beta Release 1 From 50b37d2caebab2e032060d8f9108510ce86a59bc Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 23 Dec 2021 08:59:00 -0800 Subject: [PATCH 12/17] format document --- src/com_server/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com_server/connection.py b/src/com_server/connection.py index 53c486c..aa4be61 100644 --- a/src/com_server/connection.py +++ b/src/com_server/connection.py @@ -144,7 +144,7 @@ def get_all_rcv(self) -> t.List[t.Tuple[float, bytes]]: if not self.connected: raise base_connection.ConnectException("No connection established") - + with self._lock: _rq = copy.deepcopy(self._rcv_queue) From 79d9fea46e082efcfdcbdce2e566db991b3cf4cb Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 23 Dec 2021 10:45:06 -0800 Subject: [PATCH 13/17] add verison shield --- README.md | 1 + docs/index.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 7bf14be..dde6f73 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jonyboi396825/COM-Server/Run%20Pytest%20(Push%20to%20master)) [![Documentation Status](https://readthedocs.org/projects/com-server/badge/?version=latest)](https://com-server.readthedocs.io/en/latest/?badge=latest) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jonyboi396825/COM-Server/Upload%20Python%20Package?label=PyPI%20upload) +![PyPI](https://img.shields.io/pypi/v/com_server?label=Version) COM-Server is a Python library and a local web server that hosts an API locally and interacts with serial or COM ports. The Python library provides a different way of sending and receiving data from the serial port using a thread, and it also gives a set of tools that simplifies the task of manipulating data to and from the port. Additionally, the server makes it easier for other processes to communicate with the serial port. diff --git a/docs/index.md b/docs/index.md index 5ce6844..6b66a45 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,7 @@ # COM-Server Documentation +![PyPI](https://img.shields.io/pypi/v/com_server?label=Version) + Welcome to the COM-Server documentation. COM-Server is a Python library and a local web server that hosts an API locally and interacts with serial or COM ports. The Python library provides a different way of sending and receiving data from the serial port using a thread, and it also gives a set of tools that simplifies the task of manipulating data to and from the port. Additionally, the server makes it easier for other processes to communicate with the serial port. From 401325f055ca4cfe640ad5c29ca35f8d2b63627e Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 23 Dec 2021 10:45:17 -0800 Subject: [PATCH 14/17] add port reconnected at --- src/com_server/disconnect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com_server/disconnect.py b/src/com_server/disconnect.py index 1fe8e7f..7acdaf5 100644 --- a/src/com_server/disconnect.py +++ b/src/com_server/disconnect.py @@ -47,6 +47,6 @@ def run(self) -> None: self._conn.reconnect() if self._v: - print("Device reconnected") + print(f"Device reconnected at {self._conn.port}") time.sleep(0.01) From 8f86caaac83ae2bbeb866ccaf970095a0f9e914a Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 23 Dec 2021 11:25:14 -0800 Subject: [PATCH 15/17] add "attempting to reconnect" msg --- src/com_server/disconnect.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com_server/disconnect.py b/src/com_server/disconnect.py index 7acdaf5..34f9e68 100644 --- a/src/com_server/disconnect.py +++ b/src/com_server/disconnect.py @@ -43,6 +43,7 @@ def run(self) -> None: if not self._conn.connected: if self._v: print("Device disconnected") + print("Attempting to reconnect...") self._conn.reconnect() From 694ea781ac8fda1fccd43e5823ba3880b9e06a57 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 23 Dec 2021 11:26:51 -0800 Subject: [PATCH 16/17] change label name --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 6b66a45..e54adff 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # COM-Server Documentation -![PyPI](https://img.shields.io/pypi/v/com_server?label=Version) +![PyPI](https://img.shields.io/pypi/v/com_server?label=Latest%20Version) Welcome to the COM-Server documentation. From 944f9a3325a6e9fc94f3791c281c063d45f3fd60 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 23 Dec 2021 12:46:06 -0800 Subject: [PATCH 17/17] update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18e128b..ed77d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ Previous version: 0.1b1 ## Changes from previous version: -- Added some more examples in the examples directory, addressing [#74](https://github.com/jonyboi396825/COM-Server/issues/74) +- Added some more examples in the examples directory, addressing [#74](https://github.com/jonyboi396825/COM-Server/issues/74). - Fixed [#78](https://github.com/jonyboi396825/COM-Server/issues/78) by adding thread lock to binary search method for checking availability, and also a lock to the `Connection.get_all_rcv()` and `Connection.get_all_rcv_str()` methods to **deep copy** the receive queue instead of directly returning the receive queue. +- Added more verbose output to the disconnect handler, including that port that it reconnected to. # 0.1 Beta Release 1