diff --git a/CHANGELOG.md b/CHANGELOG.md index fc872cf..afb82d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Release Versions: +- [2.0.1](#201) - [2.0.0](#200) - [1.4.1](#141) - [1.4.0](#140) @@ -12,6 +13,13 @@ Release Versions: - [0.2.0](#020) - [0.1.0](#010) +## 2.0.1 + +Version 2.0.1 contains a hotfix that enables socket communiction with any serialized message in Python, which was not +possible before due to an error in the bindings. + +- fix(python): avoid removal of null characters in bindings (#66) + ## 2.0.0 Version 2.0.0 is a major update to this repository and contains breaking changes. diff --git a/build.sh b/build.sh index 00d6254..341e27b 100644 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -IMAGE_NAME=ghcr.io/aica-technology/communication-interfaces +IMAGE_NAME=ghcr.io/aica-technology/network-interfaces IMAGE_TAG=latest ROS2_VERSION=humble diff --git a/python/setup.py b/python/setup.py index 7d299b9..8285e1a 100644 --- a/python/setup.py +++ b/python/setup.py @@ -6,7 +6,7 @@ from pybind11.setup_helpers import ParallelCompile, Pybind11Extension, build_ext, naive_recompile from setuptools import setup -__version__ = "1.0.0" +__version__ = "1.0.1" try: status = pkgconfig.installed('communication_interfaces', f'>= {__version__}') diff --git a/python/src/communication_interfaces_bindings.cpp b/python/src/communication_interfaces_bindings.cpp index b211449..8bade4d 100644 --- a/python/src/communication_interfaces_bindings.cpp +++ b/python/src/communication_interfaces_bindings.cpp @@ -44,7 +44,6 @@ PYBIND11_MODULE(communication_interfaces, m) { std::string buffer; auto res = socket.receive_bytes(buffer); if (res) { - buffer.erase(std::find(buffer.begin(), buffer.end(), '\0'), buffer.end()); return py::bytes(buffer); } else { return py::none(); diff --git a/python/test/test_tcp.py b/python/test/test_tcp.py index ae8b8ce..00d3bdf 100644 --- a/python/test/test_tcp.py +++ b/python/test/test_tcp.py @@ -16,7 +16,7 @@ def serve(self): response = self.server.receive_bytes() if response is None: pytest.fail("No response from client") - assert response.decode("utf-8") == self.client_message + assert response.decode("utf-8").rstrip("\x00") == self.client_message assert self.server.send_bytes(self.server_message) def test_comm(self): @@ -28,4 +28,4 @@ def test_comm(self): assert self.client.send_bytes(self.client_message) response = self.client.receive_bytes() assert response - assert response.decode("utf-8") == self.server_message + assert response.decode("utf-8").rstrip("\x00") == self.server_message diff --git a/python/test/test_udp.py b/python/test/test_udp.py index 0ea78a9..d5846f5 100644 --- a/python/test/test_udp.py +++ b/python/test/test_udp.py @@ -24,7 +24,7 @@ def client(udp_config): def test_send_receive(server, client): - send_string = b"Hello world" + send_string = "Hello world" try: server.open() @@ -39,7 +39,7 @@ def test_send_receive(server, client): assert client.send_bytes(send_string) response = server.receive_bytes() assert response - assert response == send_string + assert response.decode("utf-8").rstrip("\x00") == send_string def test_timeout(udp_config): diff --git a/source/communication_interfaces/CMakeLists.txt b/source/communication_interfaces/CMakeLists.txt index 19bc0c3..461bc2a 100644 --- a/source/communication_interfaces/CMakeLists.txt +++ b/source/communication_interfaces/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -set(COMMUNICATION_INTERFACES_VERSION 1.0.0) +set(COMMUNICATION_INTERFACES_VERSION 1.0.1) project(communication_interfaces VERSION ${COMMUNICATION_INTERFACES_VERSION}) option(BUILD_TESTING "Build tests." OFF)