-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel/py-pnio-dcp: New port: Library to PROFINET Discovery and basic …
…DCP protocol A simple Python library to send and receive messages with the Profinet Discovery and basic Configuration Protocol (DCP) protocol. It can send requests and parse the corresponding responses to identify devices over the network, get and set their parameters or reset them to factory settings.
- Loading branch information
Showing
7 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
PORTNAME= pnio-dcp | ||
PORTVERSION= 1.2.0 | ||
CATEGORIES= devel python | ||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} | ||
|
||
MAINTAINER= acm@FreeBSD.org | ||
COMMENT= Library to PROFINET Discovery and basic DCP protocol | ||
WWW= https://gitlab.com/pyshacks/pnio_dcp | ||
|
||
LICENSE= MIT | ||
|
||
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools_scm>0:devel/py-setuptools_scm@${PY_FLAVOR} | ||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psutil>=0:sysutils/py-psutil@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}importlib-metadata>0:devel/py-importlib-metadata@${PY_FLAVOR} | ||
|
||
USES= python | ||
USE_PYTHON= autoplist distutils | ||
|
||
USE_GITLAB= yes | ||
GL_ACCOUNT= pyshacks | ||
GL_PROJECT= ${PORTNAME:S/-/_/} | ||
GL_COMMIT= 6156aa9c10bca35a118a58a02837b97a7e5a829e | ||
|
||
NO_ARCH= yes | ||
|
||
post-patch: | ||
${REINPLACE_CMD} -e 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/setup.py | ||
|
||
.include <bsd.port.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TIMESTAMP = 1708286638 | ||
SHA256 (pyshacks-pnio_dcp-6156aa9c10bca35a118a58a02837b97a7e5a829e_GL0.tar.gz) = c5aa5822faf78cae39ae1c7dc9010528acd322cef5d7037c6b71522e03f601e5 | ||
SIZE (pyshacks-pnio_dcp-6156aa9c10bca35a118a58a02837b97a7e5a829e_GL0.tar.gz) = 32613 |
10 changes: 10 additions & 0 deletions
10
devel/py-pnio-dcp/files/patch-pnio__dcp_l2socket_____init____.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- pnio_dcp/l2socket/__init__.py.orig 2024-02-18 23:35:44 UTC | ||
+++ pnio_dcp/l2socket/__init__.py | ||
@@ -10,5 +10,7 @@ if sys.platform == 'win32': | ||
L2Socket = L2PcapSocket | ||
elif sys.platform.startswith('linux'): | ||
L2Socket = L2LinuxSocket | ||
+elif sys.platform.startswith('freebsd'): | ||
+ L2Socket = L2LinuxSocket | ||
else: | ||
raise NotImplementedError(f"Platform {sys.platform} is currently not supported.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- pnio_dcp/pnio_dcp.py.orig 2024-02-18 23:53:00 UTC | ||
+++ pnio_dcp/pnio_dcp.py | ||
@@ -49,7 +49,7 @@ class DCP: | ||
available through this instance. | ||
""" | ||
|
||
- def __init__(self, ip): | ||
+ def __init__(self, ip, timeout=7): | ||
""" | ||
Create a new instance, use the given ip to select the network interface. | ||
:param ip: The ip address used to select the network interface. | ||
@@ -57,8 +57,8 @@ class DCP: | ||
""" | ||
self.src_mac, network_interface = self.__get_network_interface_and_mac_address(ip) | ||
|
||
- self.default_timeout = 7 # default timeout for requests (in seconds) | ||
- self.identify_all_timeout = 7 # timeout to receive all responses for identify_all | ||
+ self.default_timeout = timeout # default timeout for requests (in seconds) | ||
+ self.identify_all_timeout = timeout # timeout to receive all responses for identify_all | ||
|
||
# the XID is the id of the current transaction and can be used to identify the responses to a request | ||
self.__xid = int(random.getrandbits(32)) # initialize it with a random value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- setup.py.orig 2023-10-04 11:20:39 UTC | ||
+++ setup.py | ||
@@ -30,7 +30,7 @@ classifiers = [ | ||
] | ||
|
||
setup(name="pnio_dcp", | ||
- use_scm_version={"local_scheme": "no-local-version"}, | ||
+ version='1.2.0', | ||
setup_requires=['setuptools_scm'], | ||
description='Discover and configure PROFINET devices with the PROFINET Discovery and basic Configuration Protocol (DCP) ' | ||
'protocol.', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
A simple Python library to send and receive messages with the Profinet | ||
Discovery and basic Configuration Protocol (DCP) protocol. It can send requests | ||
and parse the corresponding responses to identify devices over the network, get | ||
and set their parameters or reset them to factory settings. |